]> git.saurik.com Git - wxWidgets.git/commitdiff
compilation fix for wxOSX/Cocoa: don't use Carbon functions in common to all OS X...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 3 Jul 2009 12:22:40 +0000 (12:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 3 Jul 2009 12:22:40 +0000 (12:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/glcanvas.h
src/osx/carbon/glcanvas.cpp
src/osx/cocoa/glcanvas.mm
src/osx/glcanvas_osx.cpp

index 1fc775c88e43677140da25e3cc2865360ca2e23e..8dfde849eb3af783bf1f4642fc45d25996c5216e 100644 (file)
@@ -24,6 +24,7 @@
 WXDLLIMPEXP_GL WXGLContext WXGLCreateContext( WXGLPixelFormat pixelFormat, WXGLContext shareContext );
 WXDLLIMPEXP_GL void WXGLDestroyContext( WXGLContext context );
 WXDLLIMPEXP_GL WXGLContext WXGLGetCurrentContext();
+WXDLLIMPEXP_GL bool WXGLSetCurrentContext(WXGLContext context);
 WXDLLIMPEXP_GL void WXGLSwapBuffers( WXGLContext context );
 
 WXDLLIMPEXP_GL WXGLPixelFormat WXGLChoosePixelFormat(const int *attribList);
index 111e298fd849bcefe15ff6fb859155b39fddf11a..4084a19ecbbc9ee2da4c76f66a5fe150fcfd0c61 100644 (file)
@@ -87,6 +87,17 @@ WXGLContext WXGLGetCurrentContext()
     return aglGetCurrentContext();
 }
 
+bool WXGLSetCurrentContext(WXGLContext context)
+{
+    if ( !aglSetCurrentContext(context) )
+    {
+        wxLogAGLError("aglSetCurrentContext");
+        return false;
+    }
+
+    return true;
+}
+
 void WXGLDestroyPixelFormat( WXGLPixelFormat pixelFormat )
 {
     if ( pixelFormat )
@@ -266,12 +277,7 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
         return false;
     }
 
-    if ( !aglSetCurrentContext(m_glContext) )
-    {
-        wxLogAGLError("aglSetCurrentContext");
-        return false;
-    }
-    return true;
+    return WXGLSetCurrentContext(m_glContext);
 }
 
 // ----------------------------------------------------------------------------
index 83c99ce833f7778d1ac7b66bd9fbf8287ce8c455..f07fc0f64a39235d27f62fd8d4dacfdd8f08516b 100644 (file)
@@ -61,6 +61,13 @@ WXGLContext WXGLGetCurrentContext()
     return [NSOpenGLContext currentContext];
 }
 
+bool WXGLSetCurrentContext(WXGLContext context)
+{
+    [context makeCurrentContext];
+
+    return true;
+}
+
 void WXGLDestroyPixelFormat( WXGLPixelFormat pixelFormat )
 {
     if ( pixelFormat )
index 11e4d99bbeca28bb131730167e9bdf22f699877a..465e0d06dbd2831daa4b6be6584327c8ce8cd446 100644 (file)
@@ -164,12 +164,12 @@ bool wxGLCanvasBase::IsExtensionSupported(const char *extension)
     if ( !ctx )
         return false;
 
-    WXGLContext ctxOld = aglGetCurrentContext();
-    aglSetCurrentContext(ctx);
+    WXGLContext ctxOld = WXGLGetCurrentContext();
+    WXGLSetCurrentContext(ctx);
 
     wxString extensions = wxString::FromAscii(glGetString(GL_EXTENSIONS));
 
-    aglSetCurrentContext(ctxOld);
+    WXGLSetCurrentContext(ctxOld);
     WXGLDestroyPixelFormat(fmt);
     WXGLDestroyContext(ctx);