#include "cube.h"
-IMPLEMENT_APP(MyApp)
-
// `Main program' equivalent, creating windows and returning main app frame
bool MyApp::OnInit(void)
{
frame->m_canvas = new TestGLCanvas(frame, -1, wxPoint(0, 0), wxSize(200, 200));
- InitGL();
+// InitGL();
// Show the frame
frame->Show(TRUE);
glEnable(GL_LIGHT0);
}
+IMPLEMENT_APP(MyApp)
+
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(wxID_EXIT, MyFrame::OnExit)
END_EVENT_TABLE()
int width, height;
GetClientSize(& width, & height);
- if ( GetContext() )
+ if (GetContext())
+ {
+ SetCurrent();
glViewport(0, 0, width, height);
+ }
}
void TestGLCanvas::OnEraseBackground(wxEraseEvent& event)