fixing bug 1782738

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2007-09-18 18:34:16 +00:00
parent cdb36045cd
commit c29d47c8c1

View File

@@ -289,6 +289,7 @@ void wxGLCanvas::SetViewport()
if ( !m_macCanvasIsShown ) if ( !m_macCanvasIsShown )
parms[0] += 20000 ; parms[0] += 20000 ;
aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ; aglSetInteger( m_glContext->m_glContext , AGL_BUFFER_RECT , parms ) ;
aglUpdateContext(m_glContext->m_glContext);
} }
#endif #endif
} }
@@ -302,8 +303,6 @@ void wxGLCanvas::MacUpdateView()
{ {
if (m_glContext) if (m_glContext)
{ {
UpdateContext();
m_glContext->SetCurrent();
SetViewport(); SetViewport();
} }
} }
@@ -338,44 +337,19 @@ bool wxGLCanvas::Show(bool show)
{ {
if ( !wxWindow::Show( show ) ) if ( !wxWindow::Show( show ) )
return false ; return false ;
/*
if ( !show ) // call directly to avoid redraw glitches
{ MacVisibilityChanged();
if ( m_macCanvasIsShown )
{
m_macCanvasIsShown = false ;
SetViewport() ;
}
}
else
{
if ( m_peer->IsVisible()&& !m_macCanvasIsShown )
{
m_macCanvasIsShown = true ;
SetViewport() ;
}
}
*/
return true ; return true ;
} }
void wxGLCanvas::MacVisibilityChanged() void wxGLCanvas::MacVisibilityChanged()
{ {
if ( !MacIsReallyShown() ) if ( MacIsReallyShown() != m_macCanvasIsShown )
{ {
if ( m_macCanvasIsShown ) m_macCanvasIsShown = !m_macCanvasIsShown;
{ MacUpdateView();
m_macCanvasIsShown = false ;
SetViewport() ;
}
}
else
{
if ( !m_macCanvasIsShown )
{
m_macCanvasIsShown = true ;
SetViewport() ;
}
} }
wxWindowMac::MacVisibilityChanged() ; wxWindowMac::MacVisibilityChanged() ;
} }