[SDL] [SPAM] Toggling fullscreen at run time.
benang at cs.its.ac.id
benang at cs.its.ac.id
Thu Aug 23 02:01:37 PDT 2007
So, I can just call the SDL_SetVideoMode() again but without the
SDL_FULLSCREEN flag, right? But will it return the same display surface
pointer? I basically just store the display surface pointer generated by
SDL_SetVideoMode() as a private member variables on my main class and pass
it as a parameter to any class which need it (and in turn set it as its
own member variable). And the one that wants to change the mode is the
other class (ie. not the main class). I know that it's a bad practice, but
that's what you get when developing without designing first (or designing
on the fly :D). I intend to fix it but it has evolved to a tangled web of
disarray, so I didn't. After all it has filled its purpose quite well.
Rainer Deyke wrote:
> Gabriele Greco wrote:
>> If your game is 2D you only have to call SDL_SetVideoMode() with or
>> without the SDL_FULLSCREEN flag.
>
> Not quite. If you have surfaces with the SDL_HWSURFACE flag, you need
> to free those before calling SDL_SetVideoMode (and reload them
> afterwards). If your new video mode has a different pixel format than
> your old video mode, you should convert your surfaces to the new pixel
> format (possibly reloading them first). You don't need to reload any
> other resources unless they use SDL_Surfaces internally.
>
>
> --
> Rainer Deyke - rainerd at eldwood.com
>
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."
More information about the SDL
mailing list