Hi…
I just joined the list to look for a solution to all my
textures and other OpenGL settings getting whacked when
doing a window resize (and switch to fullscreen). I looked
at the archives and see that this is a known issue with
SDL in Windows and that some fixes were probably coming.
I’m still learning about SDL and OpenGL, so I’m not skilled
enough to figure out my own workaround and was wondering
if someone has already come up with a reasonably acceptable
workaround. I’d really rather not have to load all my textures
again, especially since I didn’t load them in the first place
(I’m using a scene graph library PLIB/SSG which loads them
when it loads my 3D objects from disk and I have no idea how
I’d try to load the textures in the same order and then go
through the scenegraph and set the proper texture bindings
without loading the objects from disk again, too).
I suppose this might not be a big issue for me, since I don’t
really expect to need to be worrying about anything except
full-scrren mode for my application, but it’s handy being
able to switch between full-screen and windowed mode for
testing purposes.
Any recommended workarounds?
Thanks!
-Chris
You can’t get rid of this completely. Windows requires a context reset
when the screen format changes, and it often changes when going from a
window to fullscreen.
I have some code to formalize the reset: it sends a message when it
happens. It doesn’t go to great lengths to avoid it, since I’m aiming
to fix the current unpredictable situation, not to optimize. (You can
do some tricks to avoid context resets; eg. don’t reset the screen
format if you don’t have to, but I don’t want to risk compatibility
problems at this stage.)
The code can be found in the copy of SDL in the StepMania SourceForge
repository (http://www.sf.net/projects/stepmania). I don’t have time
to pull it out into a patch right now, though.
Also, I’ve had some problem reports when changing modes. However, we’ve
had them since long before this code, so it’s impossible for me to
really know if the code doesn’t cause any new compatibility problems.
Once I have time, I’ll post a patch here for people to test in their own
programs.On Mon, May 12, 2003 at 08:06:20PM -0700, Chris Palmer wrote:
I suppose this might not be a big issue for me, since I don’t
really expect to need to be worrying about anything except
full-scrren mode for my application, but it’s handy being
able to switch between full-screen and windowed mode for
testing purposes.
–
Glenn Maynard