[SDL] Beginner question: can't enter to fullscreen mode

Simon Roby simon.roby at gmail.com
Sun Jun 26 18:01:27 PDT 2005

On 6/26/05, Aaron C. <flathead at bigpond.net.au> wrote:
> Going off-topic for a moment,
> > The correct and always working way to switch to fullscreen is to call
> > SDL_SetVideoMode again with SDL_FULLSCREEN in the flags. It will
> > destroy the OpenGL context, though, so you have to reload textures and
> > display lists.
> Under what circumstances will the OGL context be destroyed? Always? I
> have a perfectly working (as far as I can tell.. :-)) piece of code that
> will:
>   1) Set video mode,
>   2) Reset and recalculate viewport & perspective,
> and nothing else. I can call this as many times as I like, yet my OGL
> context seems fine (tested only on Linux/X11). Perhaps this is platform
> dependant?

Under Windows you always lose the context whenever you change
resolutions and/or switch between window and fullscreen. This is a
well-known limitation of WGL. Under X11 (and OS X ??) this is never a
problem. Basically the real portable way of dealing with that is to
just go ahead and recreate the whole damn context every time you mess
up with the display.

It would be nice if SDL could let the app know when the context is
lost, but so far it's not possible. There has been lots of talk about
this lately. Check the archives.

More information about the SDL mailing list