Resetting GL context

I am currently working on a game engine with an SDL/Ogre setup. SDL is being used for only windowing and input, ogre for rendering, and other libraries for other features. Ogre is configured to use the external GL context that is created by SDL. This worked fine and dandy but recently we started work on the UI and specifically the video settings, so it came time to expand on the engine to do as much as it can at runtime.

Ogre on it’s own can get away with setting a number of options without having to reset a context(if it were to make it’s own), the one in particular I’m trying to get working is toggling fullscreen. The problem is that SDL wants to reset the GL context on any change to the video mode. This is causing havok to ogre, and I’ve been trying for the last 2 weeks to make ogre cooperate. So far I’ve met one brick wall after another. In case you want to read more about that, the post can be found here (http://www.ogre3d.org/forums/viewtopic.php?f=2&t=62825). But that isn’t what the purpose of this post is.

What I want to know is: Are there any patches, tricks, or methods in SDL I can use to prevent it from resetting the context? Also, I’ve been strongly considering upgrading to SDL 1.3 trunk (currently using SDL 1.2.13), but I’m concerned about stability and that it may not do anything to fix the issue, or even make it worse. Does SDL 1.3 also reset the context when switching to fullscreen mode? Is this at least something planned to be added/changed if not?

Thanks in advance.

This is actually something I’m working on today. SDL 1.3 toggles fullscreen
mode cleanly on Mac OS X, and I’m going to be doing work on Windows and
Linux to make sure it can do it there as well.

See ya!On Thu, Feb 10, 2011 at 7:53 PM, Mako_energy <mako_energy02 at yahoo.com>wrote:

I am currently working on a game engine with an SDL/Ogre setup. SDL is
being used for only windowing and input, ogre for rendering, and other
libraries for other features. Ogre is configured to use the external GL
context that is created by SDL. This worked fine and dandy but recently we
started work on the UI and specifically the video settings, so it came time
to expand on the engine to do as much as it can at runtime.

Ogre on it’s own can get away with setting a number of options without
having to reset a context(if it were to make it’s own), the one in
particular I’m trying to get working is toggling fullscreen. The problem is
that SDL wants to reset the GL context on any change to the video mode. This
is causing havok to ogre, and I’ve been trying for the last 2 weeks to make
ogre cooperate. So far I’ve met one brick wall after another. In case you
want to read more about that, the post can be found herehttp://www.ogre3d.org/forums/viewtopic.php?f=2&t=62825.
But that isn’t what the purpose of this post is.

What I want to know is: Are there any patches, tricks, or methods in SDL I
can use to prevent it from resetting the context? Also, I’ve been strongly
considering upgrading to SDL 1.3 trunk (currently using SDL 1.2.13), but I’m
concerned about stability and that it may not do anything to fix the issue,
or even make it worse. Does SDL 1.3 also reset the context when switching to
fullscreen mode? Is this at least something planned to be added/changed if
not?

Thanks in advance.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

This is actually something I’m working on today. SDL 1.3 toggles fullscreen mode cleanly on Mac OS X, and I’m going to be doing work on Windows and Linux to make sure it can do it there as well.

Confirm, the switch on OSX now toggles to full screen cleanly in my tests.On 16/02/2011, at 6:11 AM, Sam Lantinga wrote:


john skaller
@john_skaller

Great! Windows and Linux should work in the latest snapshot as well.On Tue, Feb 15, 2011 at 4:58 PM, john skaller <skaller at users.sourceforge.net wrote:

On 16/02/2011, at 6:11 AM, Sam Lantinga wrote:

This is actually something I’m working on today. SDL 1.3 toggles
fullscreen mode cleanly on Mac OS X, and I’m going to be doing work on
Windows and Linux to make sure it can do it there as well.

Confirm, the switch on OSX now toggles to full screen cleanly in my tests.


john skaller
skaller at users.sourceforge.net


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

I just fixed a bug in SDL 1.3 that caused the window to be recreated when
resizing an OpenGL mode created with the 1.2 API.

You should be all set, if you’re using 1.3! :)On Thu, Feb 10, 2011 at 7:53 PM, Mako_energy <mako_energy02 at yahoo.com>wrote:

I am currently working on a game engine with an SDL/Ogre setup. SDL is
being used for only windowing and input, ogre for rendering, and other
libraries for other features. Ogre is configured to use the external GL
context that is created by SDL. This worked fine and dandy but recently we
started work on the UI and specifically the video settings, so it came time
to expand on the engine to do as much as it can at runtime.

Ogre on it’s own can get away with setting a number of options without
having to reset a context(if it were to make it’s own), the one in
particular I’m trying to get working is toggling fullscreen. The problem is
that SDL wants to reset the GL context on any change to the video mode. This
is causing havok to ogre, and I’ve been trying for the last 2 weeks to make
ogre cooperate. So far I’ve met one brick wall after another. In case you
want to read more about that, the post can be found herehttp://www.ogre3d.org/forums/viewtopic.php?f=2&t=62825.
But that isn’t what the purpose of this post is.

What I want to know is: Are there any patches, tricks, or methods in SDL I
can use to prevent it from resetting the context? Also, I’ve been strongly
considering upgrading to SDL 1.3 trunk (currently using SDL 1.2.13), but I’m
concerned about stability and that it may not do anything to fix the issue,
or even make it worse. Does SDL 1.3 also reset the context when switching to
fullscreen mode? Is this at least something planned to be added/changed if
not?

Thanks in advance.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

Sam Lantinga wrote:

I just fixed a bug in SDL 1.3 that caused the window to be recreated when resizing an OpenGL mode created with the 1.2 API.

You should be all set, if you’re using 1.3! :slight_smile:

You are my hero. <3 Thanks Sam!

You’re welcome! :)On Wed, Feb 16, 2011 at 8:38 AM, Mako_energy <mako_energy02 at yahoo.com>wrote:

Sam Lantinga wrote:

I just fixed a bug in SDL 1.3 that caused the window to be recreated when
resizing an OpenGL mode created with the 1.2 API.

You should be all set, if you’re using 1.3! [image: Smile]

You are my hero. <3 Thanks Sam!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and CEO, Galaxy Gameworks