adding 10.5 APIs to avoid CGErrors, fixes #13121
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -257,19 +257,29 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
|
|||||||
if ( !m_glContext )
|
if ( !m_glContext )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
AGLDrawable drawable = (AGLDrawable)GetWindowPort(
|
|
||||||
MAC_WXHWND(win.MacGetTopLevelWindowRef()));
|
|
||||||
|
|
||||||
GLint bufnummer = win.GetAglBufferName();
|
GLint bufnummer = win.GetAglBufferName();
|
||||||
aglSetInteger(m_glContext, AGL_BUFFER_NAME, &bufnummer);
|
aglSetInteger(m_glContext, AGL_BUFFER_NAME, &bufnummer);
|
||||||
//win.SetLastContext(m_glContext);
|
//win.SetLastContext(m_glContext);
|
||||||
|
|
||||||
const_cast<wxGLCanvas&>(win).SetViewport();
|
const_cast<wxGLCanvas&>(win).SetViewport();
|
||||||
|
|
||||||
if ( !aglSetDrawable(m_glContext, drawable) )
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
||||||
|
if ( UMAGetSystemVersion() >= 0x1050 )
|
||||||
{
|
{
|
||||||
wxLogAGLError("aglSetDrawable");
|
aglSetWindowRef(m_glContext, win.MacGetTopLevelWindowRef());
|
||||||
return false;
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
AGLDrawable drawable = (AGLDrawable)GetWindowPort(
|
||||||
|
MAC_WXHWND(win.MacGetTopLevelWindowRef()));
|
||||||
|
|
||||||
|
if ( !aglSetDrawable(m_glContext, drawable) )
|
||||||
|
{
|
||||||
|
wxLogAGLError("aglSetDrawable");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return WXGLSetCurrentContext(m_glContext);
|
return WXGLSetCurrentContext(m_glContext);
|
||||||
@@ -345,8 +355,17 @@ bool wxGLCanvas::Create(wxWindow *parent,
|
|||||||
m_bufferName = gCurrentBufferName++;
|
m_bufferName = gCurrentBufferName++;
|
||||||
aglSetInteger (m_dummyContext, AGL_BUFFER_NAME, &m_bufferName);
|
aglSetInteger (m_dummyContext, AGL_BUFFER_NAME, &m_bufferName);
|
||||||
|
|
||||||
AGLDrawable drawable = (AGLDrawable)GetWindowPort(MAC_WXHWND(MacGetTopLevelWindowRef()));
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
||||||
aglSetDrawable(m_dummyContext, drawable);
|
if ( UMAGetSystemVersion() >= 0x1050 )
|
||||||
|
{
|
||||||
|
aglSetWindowRef(m_dummyContext, MacGetTopLevelWindowRef());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
AGLDrawable drawable = (AGLDrawable)GetWindowPort(MAC_WXHWND(MacGetTopLevelWindowRef()));
|
||||||
|
aglSetDrawable(m_dummyContext, drawable);
|
||||||
|
}
|
||||||
|
|
||||||
m_macCanvasIsShown = true;
|
m_macCanvasIsShown = true;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user