[SDL] Toggling fullscreen at run time.

Peter Mackay mackay.pete+sdl at gmail.com
Wed Aug 22 01:40:28 PDT 2007


I'm pretty sure you can skip steps 2 and 3, but it's still inefficient.

It would be really nice if SDL (or is it just the Windows back end?)
virtualised surfaces enough that the toggle fullscreen function worked
without problems. I wonder if this is this possible for 1.3?

Peter

On 22/08/07, benang at cs.its.ac.id <benang at cs.its.ac.id> wrote:
> Hi,
>
> I need to make my application so it can toggle between fullscreen or not
> in run time. How do I do that?
>
> I read in the documentation that there's no other function to set the
> fullscreen option except SDL_SetVideoMode (CMIIW). And also the display
> surface generated from SDL_SetVideoMode should only be freed with a call
> to SDL_Quit. So based on what I've just read, the only way that came to my
> mind is this:
> 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.
>
> Thanks in advance.
>
>
> Fare thee well,
> Bawenang R. P. P.
>
> ----------------
> ERROR: Brain not found. Please insert a new brain!
>
> "Do nothing which is of no use." - Miyamoto Musashi.
>
> "I live for my dream. And my dream is to live my life to the fullest."
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



More information about the SDL mailing list