OpenGL and SDL issue

When using OpenGL with SDL, has anyone else had a problem with OpenGL rendering getting screwed up after restoring a window that had been minimized?

This is because the OpenGL context is destroyed when windows are minimized (and also when resized, I think?). This means you have to recreate display lists and upload textures again. I will agree that it is a bit of a pain…

Is there any kind of work around? Does the context get destroyed because of how SDL is implemented on Windows? Or is it just a nuance of Windows?
Also, some other questions about SDL since I’ve just started playing with it:

  • Is there a way to toggle full screen in SDL? I see the SDL_WM_ToggleFullScreen() call, but I believe that’s not supported in windows.
  • Similarly, can I resize the window and set it’s position? Such as if I wanted to force a specific aspect ratio whenever I receive a SDL_VIDEORESIZE event.

As far as I know there is no work-around for the destruction of OpenGL-context on SDL_VIDEORESIZE event. One thing that makes it bearable is to have a function that sets everything up, which you can call each time it happens.

For further SDL-specific questions you might consider joining the SDL mailing list, I’m sure you’ll get better answers there!