Switching between videomodes

Hi!

I would like to implement an application that initially is shown in a window. When a button was pressed, it should switch to fullscreen mode. It should the switch back, if a key was pressed.
How is that switching implemented?

Any help, please!

Ron

Ronald Sowa wrote:

Hi!

I would like to implement an application that initially is shown in a
window. When a button was pressed, it should switch to fullscreen mode.
It should the switch back, if a key was pressed.
How is that switching implemented?

Any help, please!

Ron

call SDL_SetVideoMode() again, passing SDL_FULLSCREEN this time.

Just reopen the display with/without SDL_FULLSCREEN. Since on most
targets, there’s no way to guarantee that the same display surface is
used in windowed and fullscreen modes (you may not even get the same
pixel format), you’ll have to reinitialize your “engine”. For
example, if you have SDL_DisplayFormat()ted surfaces, you may have to
reload and convert them again.

Kobo Deluxe does this when hitting Alt + Enter. Very simple
implementation: I just close and reopen the graphics engine,
reloading all graphics. I could probably skip this step when the
pixel format is unchanged, but I haven’t bothered.

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Thursday 13 March 2003 15.14, Ronald Sowa wrote:

Hi!

I would like to implement an application that initially is shown in
a window. When a button was pressed, it should switch to fullscreen
mode. It should the switch back, if a key was pressed. How is that
switching implemented?