[SDL] [SPAM] Toggling fullscreen at run time.
Gabriele Greco
gabriele.greco at darts.it
Wed Aug 22 03:20:04 PDT 2007
benang at cs.its.ac.id wrote:
> 1. Freeing all resources (eg. surfaces, mix musics, mix chunks, etc)
> 2. Calling SDL_Quit.
> 3. Calling SDL_Init again.
> 4. Calling SDL_SetVideo without the fullscreen flag
> 5. Loading the resources again.
> Is this the only way to do it? It seems rather inefficient.
>
If your game is 2D you only have to call SDL_SetVideoMode() with or
without the SDL_FULLSCREEN flag.
If you are using OpenGL you may need to rebuild the opengl context (at
least on win32 you will). You don't have to realloc audio or generic
data, you may need to realloc surfaces IF you want top speed and the
pixel format of the fullscreen mode is different from the windowed one.
--
Bye,
Gabry
More information about the SDL
mailing list