X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/43c742d0054f02319a623e9d19f3f140213784b5..26ee65c723cf55822c540506f064ec11d9b26858:/samples/opengl/cube/cube.h diff --git a/samples/opengl/cube/cube.h b/samples/opengl/cube/cube.h index 9b2c7ac63d..a67e7b0a34 100644 --- a/samples/opengl/cube/cube.h +++ b/samples/opengl/cube/cube.h @@ -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