[SDL] Re-Calling SDL_SetVideoMode to resize window?

Brian brian.ripoff at gmail.com
Fri May 2 02:35:13 PDT 2008


Hi

>  if I call SDL_SetVideoMode a 2nd time to resize my window, will this properly
>  delete the SDL_Surface it created when I called it for the first time?

Yes, as per the SDL_SetVideoMode documentation. Calling SDL_Quit() or
SDL_QuitSubSystem(SDL_INIT_VIDEO) will also free the video surface.

http://www.libsdl.org/cgi/docwiki.cgi/SDL_SetVideoMode

"the surface returned is freed by SDL_Quit and should not be freed by
the caller. Note: This rule includes consecutive calls to
SDL_SetVideoMode (i.e. resize or resolution change) - the pre-existing
surface will be released automatically"


More information about the SDL mailing list