X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c2265822fec3d0fa383dc6e043cad1a12a0e8418..4a1acb45b0fd4bd7fa4a318f77b912cfccc56931:/utils/glcanvas/samples/cube/cube.cpp diff --git a/utils/glcanvas/samples/cube/cube.cpp b/utils/glcanvas/samples/cube/cube.cpp index 6a756b2893..675cdaba73 100644 --- a/utils/glcanvas/samples/cube/cube.cpp +++ b/utils/glcanvas/samples/cube/cube.cpp @@ -29,8 +29,6 @@ #include "cube.h" -IMPLEMENT_APP(MyApp) - // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit(void) { @@ -54,7 +52,7 @@ 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); @@ -81,6 +79,8 @@ void MyApp::InitGL(void) glEnable(GL_LIGHT0); } +IMPLEMENT_APP(MyApp) + BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(wxID_EXIT, MyFrame::OnExit) END_EVENT_TABLE() @@ -169,8 +169,11 @@ void TestGLCanvas::OnSize(wxSizeEvent& event) int width, height; GetClientSize(& width, & height); - if ( GetContext() ) + if (GetContext()) + { + SetCurrent(); glViewport(0, 0, width, height); + } } void TestGLCanvas::OnEraseBackground(wxEraseEvent& event)