]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/opengl/cube/cube.cpp
fix GetTLWParentIfNotBeingDeleted() to work correctly even if an intermediate non...
[wxWidgets.git] / samples / opengl / cube / cube.cpp
index 61f6494835e8547a6173e542ef46255f9738554c..325520181936b914d407cced5306da5ef47bf206 100644 (file)
@@ -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...)
@@ -383,6 +385,11 @@ MyFrame::MyFrame()
 
     SetClientSize(400, 400);
     Show();
+
+    // test IsDisplaySupported() function:
+    static const int attribs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
+    wxLogStatus("Double-buffered display %s supported",
+                wxGLCanvas::IsDisplaySupported(attribs) ? "is" : "not");
 }
 
 void MyFrame::OnClose(wxCommandEvent& WXUNUSED(event))