Full Screen Toggle

Hi all,

I’ve implemented a windowed/full screen toggle into my game. It does this by
calling SDL_QuitSubSystem (SDL_INIT_VIDEO) to close the window / screen, and
then re-initialises it with SDL_InitSubSystem (SDL_INIT_VIDEO) before
re-creating the primary surface.

Is this about the right way to go about it? This method works well for me,
but someone who used dual monitors experienced a crash when trying to
re-initialise the video system (though going straight to full-screen at the
start did not pose any problems).

Cheers,
Peter

p.s.: I never thought this much through, but it seems that all other created
surfaces remain unchanged after calling SDL_QuitSubSystem (SDL_INIT_VIDEO),
is this something I can rely on?

No, you can’t rely on other surfaces being valid… but if they are
software surfaces, they’ll likely be valid.

I think the SDL_WM_ToggleFullScreen finally works on most platforms
with latest SDL?

SDL doesn’t know about multi monitor setups – and seems to fail a bit
with them. Unfortunately :(On Tue, Jul 1, 2008 at 12:06 PM, Peter Ketting wrote:

Hi all,

I’ve implemented a windowed/full screen toggle into my game. It does this by
calling SDL_QuitSubSystem (SDL_INIT_VIDEO) to close the window / screen, and
then re-initialises it with SDL_InitSubSystem (SDL_INIT_VIDEO) before
re-creating the primary surface.

Is this about the right way to go about it? This method works well for me,
but someone who used dual monitors experienced a crash when trying to
re-initialise the video system (though going straight to full-screen at the
start did not pose any problems).

Cheers,
Peter

p.s.: I never thought this much through, but it seems that all other created
surfaces remain unchanged after calling SDL_QuitSubSystem (SDL_INIT_VIDEO),
is this something I can rely on?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Le Mon, 30 Jun 2008 22:06:47 -0400
"Peter Ketting" a _crit:

Hi all,

I’ve implemented a windowed/full screen toggle into my game. It does this by
calling SDL_QuitSubSystem (SDL_INIT_VIDEO) to close the window / screen, and
then re-initialises it with SDL_InitSubSystem (SDL_INIT_VIDEO) before
re-creating the primary surface.

Is this about the right way to go about it? This method works well for me,
but someone who used dual monitors experienced a crash when trying to
re-initialise the video system (though going straight to full-screen at the
start did not pose any problems).

It’s much simpler to just call SDL_SetVideoMode() with ‘flags’ value having (or not)
SDL_FULLSCREEN set.–
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

It’s much simpler to just call SDL_SetVideoMode() with ‘flags’ value
having (or not)
SDL_FULLSCREEN set.

Now why didn’t I ever think of that? Sheeesh!

Cheers,
PeterFrom: mandin.patrice@orange.fr (Patrice Mandin)