From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Wed, 1 Jul 2009 09:34:54 +0000 (+0000)
Subject: set the context we create in IsExtensionSupported() (see #10545)
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/880a2b69fb1d9e64fd22b9cc950246a97d6f7d16

set the context we create in IsExtensionSupported() (see #10545)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/osx/glcanvas_osx.cpp b/src/osx/glcanvas_osx.cpp
index 5d2c0cd9ed..11e4d99bbe 100644
--- a/src/osx/glcanvas_osx.cpp
+++ b/src/osx/glcanvas_osx.cpp
@@ -35,6 +35,8 @@
 
 #include "wx/osx/private.h"
 
+#include <AGL/agl.h>
+
 // ----------------------------------------------------------------------------
 // wxGLCanvas
 // ----------------------------------------------------------------------------
@@ -162,8 +164,12 @@ bool wxGLCanvasBase::IsExtensionSupported(const char *extension)
     if ( !ctx )
         return false;
 
+    WXGLContext ctxOld = aglGetCurrentContext();
+    aglSetCurrentContext(ctx);
+
     wxString extensions = wxString::FromAscii(glGetString(GL_EXTENSIONS));
 
+    aglSetCurrentContext(ctxOld);
     WXGLDestroyPixelFormat(fmt);
     WXGLDestroyContext(ctx);