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()
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