segmentation faults with SDL
I'm looking for some general help when using SDL. I can get various tutorial examples to compile no problem, but it seems that whenever I start creating my own program I run into segmentation faults that seem to occur right on (or in) the SDL functions. The latest one has happened right on SDL_UpdateRect or SDL_UpdateRects, it didn't matter which one I used. I have riddled my code with excessive error checking and I have verified that my pointers are valid.
The one major difference I have seen between my code and SDL tutorial code in general is that I tend to avoid external variables at all costs, whereas the online code tends to use them quite liberally. Are there some memory management advantages to using external variables with SDL? Maybe in particular the SDL_Surface pointer that is returned from SDL_SetVideoMode?
My code is on a private network, otherwise I would go ahead and post it. So I'm just hoping that maybe somebody may have encountered something similar and might have some ideas.
Thanks for any suggestions and I apologize for the rather vague and open-ended question.
|