[SDL] Toggling full screen in runtime

Rainer Deyke rainerd at eldwood.com
Tue May 11 10:16:33 PDT 2004


Gabriel Gambetta wrote:
> The SDL documentation states that SDL_WM_ToggleFullScreen is not
> supported under Win32, and effectively, it doesn't work.
>
> Somebody just told me that calling SDL_SetVideoMode again with the
> SDL_FULLSCREEN correctly on or off would do the trick. I haven't
> tested it yet, but assuming it works, is it safe to use it?

It is safe if you do the necessary bookkeeping.  Reload all textures in
video memory.  Don't assume that you will get the same pixel format.  If you
have a pointer to the video surface stored somewhere, reset it.  Refresh the
video surface.

> If it is,
> why doesn't SDL_WM_ToggleFullScreen() call SDL_SetVideoMode()?

It isn't supposed to require the bookkeeping tasks listed above.


-- 
Rainer Deyke - rainerd at eldwood.com - http://eldwood.com





More information about the SDL mailing list