X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4db172a3b318df9aff178eb6c5da149d56e0859..3925a44ce0e70080252c0abe71a098a219f3dd3c:/src/mac/carbon/glcanvas.cpp?ds=sidebyside diff --git a/src/mac/carbon/glcanvas.cpp b/src/mac/carbon/glcanvas.cpp index f5e7c59eb0..f1f70a4ecb 100644 --- a/src/mac/carbon/glcanvas.cpp +++ b/src/mac/carbon/glcanvas.cpp @@ -22,16 +22,17 @@ #ifndef WX_PRECOMP #include "wx/frame.h" #include "wx/log.h" + #include "wx/settings.h" #endif -#include "wx/settings.h" - #include "wx/mac/uma.h" // DLL options compatibility check: #include "wx/build.h" WX_CHECK_BUILD_OPTIONS("wxGL") +#include "wx/mac/private.h" + /* * GLContext implementation */ @@ -259,13 +260,26 @@ void wxGLCanvas::SetViewport() int width, height; GetClientSize(& width, & height); Rect bounds ; +#if 0 + // TODO in case we adopt point vs pixel coordinates, this will make the conversion + GetWindowPortBounds( MAC_WXHWND(MacGetTopLevelWindowRef()) , &bounds ) ; + HIRect hiRect = CGRectMake( x, y, width, height ) ; + HIRectConvert( &hiRect, kHICoordSpace72DPIGlobal, NULL, kHICoordSpaceScreenPixel, NULL) ; + HIRect hiBounds = CGRectMake( 0, 0, bounds.right - bounds.left , bounds.bottom - bounds.top ) ; + HIRectConvert( &hiBounds, kHICoordSpace72DPIGlobal, NULL, kHICoordSpaceScreenPixel, NULL) ; + GLint parms[4] ; + parms[0] = hiRect.origin.x ; + parms[1] = hiBounds.size.height - (hiRect.origin.y + hiRect.size.height) ; + parms[2] = hiRect.size.width ; + parms[3] = hiRect.size.height ; +#else GetWindowPortBounds( MAC_WXHWND(MacGetTopLevelWindowRef()) , &bounds ) ; GLint parms[4] ; parms[0] = x ; parms[1] = bounds.bottom - bounds.top - ( y + height ) ; parms[2] = width ; parms[3] = height ; - +#endif if ( !m_macCanvasIsShown ) parms[0] += 20000 ; aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ; @@ -316,7 +330,7 @@ void wxGLCanvas::SetColour(const wxChar *colour) bool wxGLCanvas::Show(bool show) { if ( !wxWindow::Show( show ) ) - return FALSE ; + return false ; /* if ( !show ) { @@ -335,7 +349,7 @@ bool wxGLCanvas::Show(bool show) } } */ - return TRUE ; + return true ; } void wxGLCanvas::MacVisibilityChanged()