compilation fix for wxOSX/Cocoa: don't use Carbon functions in common to all OS X ports OpenGL code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
83c23edb02
commit
b6ccc13c2f
@ -24,6 +24,7 @@
|
|||||||
WXDLLIMPEXP_GL WXGLContext WXGLCreateContext( WXGLPixelFormat pixelFormat, WXGLContext shareContext );
|
WXDLLIMPEXP_GL WXGLContext WXGLCreateContext( WXGLPixelFormat pixelFormat, WXGLContext shareContext );
|
||||||
WXDLLIMPEXP_GL void WXGLDestroyContext( WXGLContext context );
|
WXDLLIMPEXP_GL void WXGLDestroyContext( WXGLContext context );
|
||||||
WXDLLIMPEXP_GL WXGLContext WXGLGetCurrentContext();
|
WXDLLIMPEXP_GL WXGLContext WXGLGetCurrentContext();
|
||||||
|
WXDLLIMPEXP_GL bool WXGLSetCurrentContext(WXGLContext context);
|
||||||
WXDLLIMPEXP_GL void WXGLSwapBuffers( WXGLContext context );
|
WXDLLIMPEXP_GL void WXGLSwapBuffers( WXGLContext context );
|
||||||
|
|
||||||
WXDLLIMPEXP_GL WXGLPixelFormat WXGLChoosePixelFormat(const int *attribList);
|
WXDLLIMPEXP_GL WXGLPixelFormat WXGLChoosePixelFormat(const int *attribList);
|
||||||
|
@ -87,6 +87,17 @@ WXGLContext WXGLGetCurrentContext()
|
|||||||
return aglGetCurrentContext();
|
return aglGetCurrentContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WXGLSetCurrentContext(WXGLContext context)
|
||||||
|
{
|
||||||
|
if ( !aglSetCurrentContext(context) )
|
||||||
|
{
|
||||||
|
wxLogAGLError("aglSetCurrentContext");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void WXGLDestroyPixelFormat( WXGLPixelFormat pixelFormat )
|
void WXGLDestroyPixelFormat( WXGLPixelFormat pixelFormat )
|
||||||
{
|
{
|
||||||
if ( pixelFormat )
|
if ( pixelFormat )
|
||||||
@ -266,12 +277,7 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !aglSetCurrentContext(m_glContext) )
|
return WXGLSetCurrentContext(m_glContext);
|
||||||
{
|
|
||||||
wxLogAGLError("aglSetCurrentContext");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -61,6 +61,13 @@ WXGLContext WXGLGetCurrentContext()
|
|||||||
return [NSOpenGLContext currentContext];
|
return [NSOpenGLContext currentContext];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WXGLSetCurrentContext(WXGLContext context)
|
||||||
|
{
|
||||||
|
[context makeCurrentContext];
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void WXGLDestroyPixelFormat( WXGLPixelFormat pixelFormat )
|
void WXGLDestroyPixelFormat( WXGLPixelFormat pixelFormat )
|
||||||
{
|
{
|
||||||
if ( pixelFormat )
|
if ( pixelFormat )
|
||||||
|
@ -164,12 +164,12 @@ bool wxGLCanvasBase::IsExtensionSupported(const char *extension)
|
|||||||
if ( !ctx )
|
if ( !ctx )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
WXGLContext ctxOld = aglGetCurrentContext();
|
WXGLContext ctxOld = WXGLGetCurrentContext();
|
||||||
aglSetCurrentContext(ctx);
|
WXGLSetCurrentContext(ctx);
|
||||||
|
|
||||||
wxString extensions = wxString::FromAscii(glGetString(GL_EXTENSIONS));
|
wxString extensions = wxString::FromAscii(glGetString(GL_EXTENSIONS));
|
||||||
|
|
||||||
aglSetCurrentContext(ctxOld);
|
WXGLSetCurrentContext(ctxOld);
|
||||||
WXGLDestroyPixelFormat(fmt);
|
WXGLDestroyPixelFormat(fmt);
|
||||||
WXGLDestroyContext(ctx);
|
WXGLDestroyContext(ctx);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user