]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/glcanvas_osx.cpp
Made wxLogXXX() functions thread-safe.
[wxWidgets.git] / src / osx / glcanvas_osx.cpp
index 154d6ba4cefafcca42e18330edbfcc13fed8f006..465e0d06dbd2831daa4b6be6584327c8ce8cd446 100644 (file)
@@ -35,6 +35,8 @@
 
 #include "wx/osx/private.h"
 
+#include <AGL/agl.h>
+
 // ----------------------------------------------------------------------------
 // wxGLCanvas
 // ----------------------------------------------------------------------------
@@ -162,12 +164,16 @@ bool wxGLCanvasBase::IsExtensionSupported(const char *extension)
     if ( !ctx )
         return false;
 
+    WXGLContext ctxOld = WXGLGetCurrentContext();
+    WXGLSetCurrentContext(ctx);
+
     wxString extensions = wxString::FromAscii(glGetString(GL_EXTENSIONS));
 
+    WXGLSetCurrentContext(ctxOld);
     WXGLDestroyPixelFormat(fmt);
     WXGLDestroyContext(ctx);
 
-    return IsExtensionInList(extensions, extension);
+    return IsExtensionInList(extensions.ToAscii(), extension);
 }
 
 // ----------------------------------------------------------------------------