Toggling full screen in runtime

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? If it is, why
doesn’t SDL_WM_ToggleFullScreen() call SDL_SetVideoMode()?

Thanks,
–Gabriel

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

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? If it is, why
doesn’t SDL_WM_ToggleFullScreen() call SDL_SetVideoMode()?

SDL_WM_ToggleFullScreen() is a hidden change to the application - only
the SDL_FULLSCREEN flag in the video surface changes. Pitch, pixels,
etc. stay the same. This is currently only guaranteed to be true when
using the X11 video backend.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

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

I previously posted code to do this ("[SDL] Windows resize (openGL)"), which
works to some extent, but doesn’t like the fullscreen->windows conversion
(windows->fullscreen works). You may find that useful as a starting peace.
I don’t know if your using openGL, but the SDL code should be pretty much
the same.

A apparently you need to wait for something to be correct/occur, but what?
I haven’t gotten a reply yet…

“Gabriel Gambetta” wrote in message
news:mailman.1057163230.17316.sdl at libsdl.org
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? If it is, why
doesn’t SDL_WM_ToggleFullScreen() call SDL_SetVideoMode()?

Thanks,
–Gabriel

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy