void DrawRotatedCube(float xangle, float yangle);
private:
- // one-time OpenGL initialization, safe to call many times
- void Init();
-
-
- // the list of commands to draw the cube
- GLuint m_gllist;
+ // textures for the cube faces
+ GLuint m_textures[6];
};
// Define a new application type
-class MyApp: public wxApp
+class MyApp : public wxApp
{
public:
MyApp() { m_glContext = NULL; }
- // get the context we use creating it on demand (and set it as current)
+ // Returns the shared context used by all frames and sets it as current for
+ // the given canvas.
TestGLContext& GetContext(wxGLCanvas *canvas);
// virtual wxApp methods
};
// Define a new frame type
-class MyFrame: public wxFrame
+class MyFrame : public wxFrame
{
public:
MyFrame();
private:
void OnClose(wxCommandEvent& event);
void OnNewWindow(wxCommandEvent& event);
- void OnDefRotateLeftKey(wxCommandEvent& event);
- void OnDefRotateRightKey(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
private:
void OnPaint(wxPaintEvent& event);
- void OnSize(wxSizeEvent& event);
void OnKeyDown(wxKeyEvent& event);
// angles of rotation around x- and y- axis
};
#endif // _WX_CUBE_H_
-