From 99fdf95d8eef004027d0bbe494b692a1afd24a6e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 11 Nov 2005 21:01:58 +0000 Subject: [PATCH] possibly fix stale extension function pointer use after losing context --- stepmania/src/RageDisplay_OGL.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 8ca385e17e..1522c9d903 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -675,6 +675,10 @@ CString RageDisplay_OGL::TryVideoMode( VideoModeParams p, bool &bNewDeviceOut ) if( err != "" ) return err; // failed to set video mode + /* Now that we've initialized, we can search for extensions. Do this before InvalidateAllGeometry, + * since AllocateBuffers needs it. */ + SetupExtensions(); + if( bNewDeviceOut ) { /* We have a new OpenGL context, so we have to tell our textures that @@ -688,10 +692,6 @@ CString RageDisplay_OGL::TryVideoMode( VideoModeParams p, bool &bNewDeviceOut ) this->SetDefaultRenderStates(); - /* Now that we've initialized, we can search for extensions (some of which - * we may need to set up the video mode). */ - SetupExtensions(); - /* Set vsync the Windows way, if we can. (What other extensions are there * to do this, for other archs?) */ if( GLExt.wglSwapIntervalEXT ) @@ -985,8 +985,7 @@ public: static set g_GeometryList; static void InvalidateAllGeometry() { - set::iterator it; - for( it = g_GeometryList.begin(); it != g_GeometryList.end(); ++it ) + FOREACHS( RageCompiledGeometryHWOGL*, g_GeometryList, it ) (*it)->Invalidate(); }