]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/opengl/cube/cube.h
STC is not a separate library anymore
[wxWidgets.git] / samples / opengl / cube / cube.h
index 9b2c7ac63d2248250d4124715fe4ce6f187e15bd..a67e7b0a34868497ec6bf796f43fd6011a897daf 100644 (file)
@@ -40,12 +40,16 @@ class MyFrame: public wxFrame
 public:
     MyFrame();
 
-    void OnExit(wxCommandEvent& event);
+    // update the image shown on the canvas (after the shared wxGLContext was
+    // updated, presumably)
+    void RefreshCanvas();
+
+private:
+    void OnClose(wxCommandEvent& event);
     void OnNewWindow(wxCommandEvent& event);
     void OnDefRotateLeftKey(wxCommandEvent& event);
     void OnDefRotateRightKey(wxCommandEvent& event);
 
-private:
     TestGLCanvas *m_canvas;
 
     DECLARE_EVENT_TABLE()
@@ -56,12 +60,15 @@ class TestGLCanvas : public wxGLCanvas
 public:
     TestGLCanvas(wxWindow *parent);
 
+private:
     void OnPaint(wxPaintEvent& event);
     void OnSize(wxSizeEvent& event);
     void OnKeyDown(wxKeyEvent& event);
 
-private:
-    // one-time OpenGL initialization
+    // OpenGL calls can't be done until we're initialized
+    bool IsInitialized() const { return m_gllist != 0; }
+
+    // one-time OpenGL initialization, only does something if !IsInitialized()
     void InitGL();
 
     // render to window