Switching between fullscreen and windowed mode under windows loses input focusability with OpenGL

Running under Windows (2000, to be specific), with a TNT Radeon 9000, using
SDL 1.2.5, I’m having problems when I allow the user to press alt+enter to
switch from full screen to windowed mode using OpenGL.

I reload all textures when I receive notification of the switch, which
appears to work fine, but firstly, the window is not displayed, and if I
look in the top left corner of the desktop I can make out either the corner
of the window, or a window that has been created that is absolutely tiny.

If I then click on the taskbar icon for the application it appears to
’minimize’ the window to the taskbar, and click on it again reveals the
application apparently working. Except that it now accepts mouse input but
no keyboard input.

I’m relatively lost, and would welcome any advice.

Rob

Running under Windows (2000, to be specific), with a TNT Radeon 9000, using
SDL 1.2.5, I’m having problems when I allow the user to press alt+enter to
switch from full screen to windowed mode using OpenGL.

I reload all textures when I receive notification of the switch, which
appears to work fine, but firstly, the window is not displayed, and if I
look in the top left corner of the desktop I can make out either the corner
of the window, or a window that has been created that is absolutely tiny.

If I then click on the taskbar icon for the application it appears to
’minimize’ the window to the taskbar, and click on it again reveals the
application apparently working. Except that it now accepts mouse input but
no keyboard input.

I’m relatively lost, and would welcome any advice.

You’re calling SDL_SetVideoMode() to switch, right? After the switch
you need to rebuild your OpenGL context. If you’re doing that, can you
modify the testgl program that comes with the SDL source archive to do
the same thing and see if it has the same problem? If so, go ahead and
post the modified testgl code and maybe someone can check it out.

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment