[SDL] Semantics of SDL_SetVideoMode and the surface it returns
Solra Bizna
sbizna at tejat.net
Mon Oct 15 22:31:06 PDT 2007
I'm writing an SDL binding. (Thanks to a helpful investigator
off-list, I got an answer to my previous question.) I'm worried about
the semantics of the surface SDL_SetVideoMode returns. Is it safe to
SDL_FreeSurface it? When SDL_SetVideoMode is called again, is it safe
to SDL_FreeSurface the *old* display surface? Is the old display
surface even still valid?
I need to know because the language the binding is for has garbage
collection, and I'm trying to strip explicit memory allocation and
deallocation from my binding. I need to know whether I need to somehow
fence the SDL_Surface garbage collection method to avoid the display
surface, and whether to flag the old display surface as invalid
whenever the video mode is reset.
-:sigma.SB
More information about the SDL
mailing list