The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Windows OpenGL contexts / disappearing windows
Gregory Smith
Guest

I'm finally attempting to remove Aleph One's dependence on
OPENGLBLIT, and I'm running into some issues. My strategy is to use a
non-OpenGL video mode for the SDL widget interface we have written,
until we go in-game, and then enable OpenGL. This works great in
Linux, but I have these issues in Windows:

When using SetVideoMode by itself (and reloading OpenGL context when
appropriate):
Toggling between fullscreen and windowed non-OpenGL modes works fine
Toggling from non-OpenGL windowed mode to OpenGL windowed mode works
fine
Going from fullscreen non-OpenGL to fullscreen OpenGL crashes
Going from windowed OpenGL to fullscreen OpenGL gives me the error:
"Unable to reset window for OpenGL context"

So, I tried the old trick of quitting the video subsystem and
reinitializing it, and the crashes are gone, but are replaced by a
heck of a lot of the windows desktop flickering through in fullscreen
(which may just be me doing something wrong, or is something I can
work around at least), and a disappearing window when switching from
fullscreen OpenGL to windowed mode.

Is there any way to have my cake and eat it too? I want to switch
between non-OpenGL and OpenGL windowed/fullscreen modes at will :)

I guess the big problem is the window disappearing. I can work around
everything else.

This is all with 1.2.9 cross-compiled with mingw

Gregory
Windows OpenGL contexts / disappearing windows
Sam Lantinga
Guest

Quote:
Is there any way to have my cake and eat it too? I want to switch
between non-OpenGL and OpenGL windowed/fullscreen modes at will Smile

Sure, please put together a test case that shows the problem. Once
you've done that, try using the windib driver instead of the directx
driver, and see if that fixes things.

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment
Windows OpenGL contexts / disappearing windows
Sam Lantinga
Guest

Oh, could you enter this into bugzilla so we can track it?
http://bugzilla.libsdl.org/

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment
Windows OpenGL contexts / disappearing windows
Gregory Smith
Guest

Sam,

I'll try to put a test case together and file on bugzilla.

Meanwhile, I tried windib and it doesn't crash when using
SDL_SetVideoMode by itself. But I'm sure it must have its own issues
if it's not SDL's default video driver.

Thanks for the suggestion.

Gregory

On Jan 22, 2006, at 1:56 PM, Sam Lantinga wrote:

Quote:
Quote:
Is there any way to have my cake and eat it too? I want to switch
between non-OpenGL and OpenGL windowed/fullscreen modes at will Smile

Sure, please put together a test case that shows the problem. Once
you've done that, try using the windib driver instead of the directx
driver, and see if that fixes things.

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
Windows OpenGL contexts / disappearing windows
Sam Lantinga
Guest

Quote:
Meanwhile, I tried windib and it doesn't crash when using
SDL_SetVideoMode by itself. But I'm sure it must have its own issues
if it's not SDL's default video driver.

It should be fine. The 2D performance and input response isn't quite as
good as the DirectX driver, but it's actually better for use with OpenGL.

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment
Windows OpenGL contexts / disappearing windows
Gregory Smith
Guest

Well, it works better, but it doesn't restore the native resolution
when going from fullscreen to windowed mode. Also, I still get the
"Unable to reset window for..." message sometimes, but now it's
unpredictable instead of always happening.

I'll create some little sample apps for whatever I come across (I
assume that's better than one big bug)

The game has a software renderer, that many people need to use due to
brain-dead OpenGL implementations on Windows, I'd have to see how
well it performs with windib on an old machine.

Gregory

On Jan 22, 2006, at 4:30 PM, Sam Lantinga wrote:

Quote:
Quote:
Meanwhile, I tried windib and it doesn't crash when using
SDL_SetVideoMode by itself. But I'm sure it must have its own issues
if it's not SDL's default video driver.

It should be fine. The 2D performance and input response isn't
quite as
good as the DirectX driver, but it's actually better for use with
OpenGL.

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment
Windows OpenGL contexts / disappearing windows
Gregory Smith
Guest

A little more info, those "Unable to make GL context current" or
"Unable to reset window for GL context" messages occur (both DirectX
and windib) when switching between fullscreen and windowed mode
(SDL_OPENGL) at a depth of 16 bits. Oops.

15 bits and 32 bits work fine...

This probably isn't even a bug, more like a "Don't do that", right?

Gregory

On Jan 22, 2006, at 4:36 PM, Gregory Smith wrote:

Quote:
Well, it works better, but it doesn't restore the native resolution
when going from fullscreen to windowed mode. Also, I still get the
"Unable to reset window for..." message sometimes, but now it's
unpredictable instead of always happening.

I'll create some little sample apps for whatever I come across (I
assume that's better than one big bug)

The game has a software renderer, that many people need to use due
to brain-dead OpenGL implementations on Windows, I'd have to see
how well it performs with windib on an old machine.

Gregory
Windows OpenGL contexts / disappearing windows
Sam Lantinga
Guest

Quote:
A little more info, those "Unable to make GL context current" or
"Unable to reset window for GL context" messages occur (both DirectX
and windib) when switching between fullscreen and windowed mode
(SDL_OPENGL) at a depth of 16 bits. Oops.

Quote:
15 bits and 32 bits work fine...

Quote:
This probably isn't even a bug, more like a "Don't do that", right?

It's probably not an SDL issue, but it's definitely something that should
work.

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment