X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc3065a56f1febf3de3b3bbf0904cf8fdc7f7c50..508b10810389bea3ecf7e09389aa1c3fca199a15:/src/mac/carbon/glcanvas.cpp diff --git a/src/mac/carbon/glcanvas.cpp b/src/mac/carbon/glcanvas.cpp index fb67a57594..a65fbe680a 100644 --- a/src/mac/carbon/glcanvas.cpp +++ b/src/mac/carbon/glcanvas.cpp @@ -63,10 +63,6 @@ wxGLContext::wxGLContext(wxGLCanvas *win, const wxGLContext *other) other ? other->m_aglContext : NULL); if ( !m_aglContext ) wxLogAGLError("aglCreateContext"); - - return; - if ( !aglEnable(m_aglContext, AGL_BUFFER_RECT) ) - wxLogAGLError("aglEnable(AGL_BUFFER_RECT)"); } wxGLContext::~wxGLContext() @@ -84,7 +80,7 @@ void wxGLContext::SetCurrent(const wxGLCanvas& win) const if ( !m_aglContext ) return; - AGLDrawable drawable = (AGLDrawable)UMAGetWindowPort( + AGLDrawable drawable = (AGLDrawable)GetWindowPort( MAC_WXHWND(win.MacGetTopLevelWindowRef())); if ( !aglSetDrawable(m_aglContext, drawable) ) wxLogAGLError("aglSetDrawable"); @@ -363,9 +359,13 @@ void wxGLCanvas::SetViewport() parms[0] += 20000; if ( !aglSetInteger(context, AGL_BUFFER_RECT, parms) ) - { wxLogAGLError("aglSetInteger(AGL_BUFFER_RECT)"); - } + + if ( !aglEnable(context, AGL_BUFFER_RECT) ) + wxLogAGLError("aglEnable(AGL_BUFFER_RECT)"); + + if ( !aglUpdateContext(context) ) + wxLogAGLError("aglUpdateContext"); } void wxGLCanvas::OnSize(wxSizeEvent& event)