]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/opengl/cube/cube.cpp
refresh GL canvas itself, not the frame, when the GL context changes, otherwise it...
[wxWidgets.git] / samples / opengl / cube / cube.cpp
index b5f5ba419e1dfc45a62c0b6dc9f71df53bbfa80e..783ed604e7a470fa866c5c439d6f9ebd8163fd1a 100644 (file)
@@ -243,7 +243,8 @@ void TestGLCanvas::OnKeyDown( wxKeyEvent& event )
           i != wxTopLevelWindows.end();
           ++i )
     {
-        (*i)->Refresh(false);
+        MyFrame *frame = (MyFrame *)*i;
+        frame->RefreshCanvas();
     }
 }
 
@@ -287,3 +288,7 @@ void MyFrame::OnNewWindow( wxCommandEvent& WXUNUSED(event) )
     (void) new MyFrame();
 }
 
+void MyFrame::RefreshCanvas()
+{
+    m_canvas->Refresh(false);
+}