X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a4c85e75522de4882f2b98c7bc5ca619aed61c6..05ac7ac5785ef0ddb1bd04585f3c59c5d53089be:/src/mac/carbon/glcanvas.cpp?ds=sidebyside diff --git a/src/mac/carbon/glcanvas.cpp b/src/mac/carbon/glcanvas.cpp index 2ff4a89128..16e47d4c79 100644 --- a/src/mac/carbon/glcanvas.cpp +++ b/src/mac/carbon/glcanvas.cpp @@ -45,7 +45,7 @@ wxGLContext::wxGLContext( { m_window = win; - m_drawable = (AGLDrawable) UMAGetWindowPort(win->GetMacRootWindow()); + m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetRootWindow())); m_glContext = aglCreateContext(fmt, other ? other->m_glContext : NULL); wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") ); @@ -141,8 +141,10 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID i wxGLCanvas::~wxGLCanvas() { - if (m_glContext) - delete m_glContext; + if (m_glContext != NULL) { + delete m_glContext; + m_glContext = NULL; + } } static AGLPixelFormat ChoosePixelFormat(const int *attribList) @@ -216,7 +218,6 @@ bool wxGLCanvas::Create(wxWindow *parent, const wxGLContext *shared, wxWindowID const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attribList, const wxPalette& palette) { - m_macEraseOnRedraw = false ; wxWindow::Create( parent, id, pos, size, style, name ); AGLPixelFormat fmt = ChoosePixelFormat(attribList); @@ -252,7 +253,7 @@ void wxGLCanvas::SetViewport() int width, height; GetClientSize(& width, & height); Rect bounds ; - GetWindowPortBounds( GetMacRootWindow() , &bounds ) ; + GetWindowPortBounds( MAC_WXHWND(MacGetRootWindow()) , &bounds ) ; GLint parms[4] ; parms[0] = x ; parms[1] = bounds.bottom - bounds.top - ( y + height ) ;