]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/glcanvas_osx.cpp
Fixed wxPropertyGridInterface::SetPropertyValues() documentation
[wxWidgets.git] / src / osx / glcanvas_osx.cpp
index 5811ff545d442d3304b616e8116e5fa5d309b6f9..465e0d06dbd2831daa4b6be6584327c8ce8cd446 100644 (file)
@@ -35,6 +35,8 @@
 
 #include "wx/osx/private.h"
 
+#include <AGL/agl.h>
+
 // ----------------------------------------------------------------------------
 // wxGLCanvas
 // ----------------------------------------------------------------------------
@@ -60,7 +62,9 @@ wxGLContext::~wxGLContext()
 IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
 
 BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
+#if wxOSX_USE_CARBON
     EVT_SIZE(wxGLCanvas::OnSize)
+#endif
 END_EVENT_TABLE()
 
 wxGLCanvas::wxGLCanvas(wxWindow *parent,
@@ -160,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);
 }
 
 // ----------------------------------------------------------------------------