update mac gl, after rev 50900
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -26,7 +26,7 @@ public:
|
|||||||
wxGLContext(wxGLCanvas *win, const wxGLContext *other = NULL);
|
wxGLContext(wxGLCanvas *win, const wxGLContext *other = NULL);
|
||||||
virtual ~wxGLContext();
|
virtual ~wxGLContext();
|
||||||
|
|
||||||
virtual void SetCurrent(const wxGLCanvas& win) const;
|
virtual bool SetCurrent(const wxGLCanvas& win) const;
|
||||||
|
|
||||||
// Mac-specific
|
// Mac-specific
|
||||||
AGLContext GetAGLContext() const { return m_aglContext; }
|
AGLContext GetAGLContext() const { return m_aglContext; }
|
||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
virtual ~wxGLCanvas();
|
virtual ~wxGLCanvas();
|
||||||
|
|
||||||
// implement wxGLCanvasBase methods
|
// implement wxGLCanvasBase methods
|
||||||
virtual void SwapBuffers();
|
virtual bool SwapBuffers();
|
||||||
|
|
||||||
|
|
||||||
// Mac-specific functions
|
// Mac-specific functions
|
||||||
|
@@ -75,20 +75,27 @@ wxGLContext::~wxGLContext()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGLContext::SetCurrent(const wxGLCanvas& win) const
|
bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
|
||||||
{
|
{
|
||||||
if ( !m_aglContext )
|
if ( !m_aglContext )
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
AGLDrawable drawable = (AGLDrawable)GetWindowPort(
|
AGLDrawable drawable = (AGLDrawable)GetWindowPort(
|
||||||
MAC_WXHWND(win.MacGetTopLevelWindowRef()));
|
MAC_WXHWND(win.MacGetTopLevelWindowRef()));
|
||||||
if ( !aglSetDrawable(m_aglContext, drawable) )
|
if ( !aglSetDrawable(m_aglContext, drawable) )
|
||||||
|
{
|
||||||
wxLogAGLError("aglSetDrawable");
|
wxLogAGLError("aglSetDrawable");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !aglSetCurrentContext(m_aglContext) )
|
if ( !aglSetCurrentContext(m_aglContext) )
|
||||||
|
{
|
||||||
wxLogAGLError("aglSetCurrentContext");
|
wxLogAGLError("aglSetCurrentContext");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
wx_const_cast(wxGLCanvas&, win).SetViewport();
|
wx_const_cast(wxGLCanvas&, win).SetViewport();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -305,12 +312,13 @@ wxGLCanvas::~wxGLCanvas()
|
|||||||
aglDestroyPixelFormat(m_aglFormat);
|
aglDestroyPixelFormat(m_aglFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGLCanvas::SwapBuffers()
|
bool wxGLCanvas::SwapBuffers()
|
||||||
{
|
{
|
||||||
AGLContext context = aglGetCurrentContext();
|
AGLContext context = aglGetCurrentContext();
|
||||||
wxCHECK_RET( context, _T("should have current context") );
|
wxCHECK_MSG(context, false, _T("should have current context"));
|
||||||
|
|
||||||
aglSwapBuffers(context);
|
aglSwapBuffers(context);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGLCanvas::SetViewport()
|
void wxGLCanvas::SetViewport()
|
||||||
|
Reference in New Issue
Block a user