X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bc521497d3e5c6aada638ee0907d29a47a98b24e..c95e653ca42e6474c32d71e69a3fd8a2bc443fc4:/samples/opengl/cube/cube.cpp diff --git a/samples/opengl/cube/cube.cpp b/samples/opengl/cube/cube.cpp index 61f6494835..411979b571 100644 --- a/samples/opengl/cube/cube.cpp +++ b/samples/opengl/cube/cube.cpp @@ -146,6 +146,8 @@ TestGLContext& MyApp::GetContext(wxGLCanvas *canvas) { if ( !m_glContext ) m_glContext = new TestGLContext(canvas); + else + m_glContext->SetCurrent(*canvas); return *m_glContext; } @@ -302,7 +304,7 @@ void TestGLCanvas::OnSize(wxSizeEvent& event) // don't prevent default processing from taking place event.Skip(); - if ( !IsShown() ) + if ( !IsShownOnScreen() ) return; // set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)