I posted your question on the main SDL mailing list and this is the response I got from a guy called Glenn Maynard...Originally Posted by BlueCat
"
I wrote a hack for the Windows implementation to allow changing some
window settings (everything except bit depth, I believe, which needs a
new context anyway), but only in Windows; I haven't implemented it on
anything else yet.
I'll attach it. It moves some stuff, so it's a little large. The code
to use it looks like this:
#ifndef SDL_HAS_CHANGEVIDEOMODE
/* We can't change the video mode without nuking the GL context. */
need_reload = true;
#endif
if( bpp != g_CurrentBPP )
need_reload = true; /* can't do this with SDL_SM_ChangeVideoMode_OpenGL */
if(need_reload) {
if(TEXTUREMAN) TEXTUREMAN->InvalidateTextures();
}
if(!g_screen || need_reload) {
g_screen = SDL_SetVideoMode(width, height, bpp, g_flags);
if(!g_screen)
throw RageException("SDL_SetVideoMode failed: %s", SDL_GetError());
SDL_WM_SetCaption("StepMania", "StepMania");
}
#ifdef SDL_HAS_CHANGEVIDEOMODE
else
{
SDL_SM_ChangeVideoMode_OpenGL(g_flags, g_screen, width, height);
}
#endif
You'll need to massage the patch (remove the refresh rate stuff, add a
prototype and the SDL_HAS_CHANGEVIDEOMODE #define) if you want to use it.
(Sorry, I didn't clean it up because diffing is a bit of a pain for me at
the moment ...)
I think this is something the SDL really needs to handle; nuking the GL
context to change video settings is definitely not good. I'm not sure of
a good general-purpose way to handle it, though, considering that some
archs may not be able to do certain things without a context recreation.
-- Glenn Maynard"
Sorry that it is C code, but I hope it proves useful
BTW you can join the main JEDI-SDL mailing list @
http://groups.yahoo.com/group/JEDI-SDL/join
Bookmarks