X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0c1c1c714a8d8e54c2f673a296c1a4d0b9b55b88..c0e69d720d8b15f788fe0998806f18c46f7d5d8b:/samples/opengl/isosurf/isosurf.cpp?ds=sidebyside diff --git a/samples/opengl/isosurf/isosurf.cpp b/samples/opengl/isosurf/isosurf.cpp index fb8039efa7..471942b637 100644 --- a/samples/opengl/isosurf/isosurf.cpp +++ b/samples/opengl/isosurf/isosurf.cpp @@ -51,7 +51,6 @@ GLboolean g_lighting = GL_TRUE; IMPLEMENT_APP(MyApp) -// `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit() { if ( !wxApp::OnInit() ) @@ -93,9 +92,8 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(wxID_EXIT, MyFrame::OnExit) END_EVENT_TABLE() -// My frame constructor MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, - const wxSize& size, long style) + const wxSize& size, long style) : wxFrame(frame, wxID_ANY, title, pos, size, style), m_canvas(NULL) { @@ -105,9 +103,9 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, // Make a menubar wxMenu *fileMenu = new wxMenu; - fileMenu->Append(wxID_EXIT, _T("E&xit")); + fileMenu->Append(wxID_EXIT, wxT("E&xit")); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(fileMenu, _T("&File")); + menuBar->Append(fileMenu, wxT("&File")); SetMenuBar(menuBar); @@ -232,8 +230,12 @@ void TestGLCanvas::LoadSurface(const wxString& filename) delete stream; - wxLogMessage(_T("Loaded %d vertices, %d triangles from '%s'"), + wxLogMessage(wxT("Loaded %d vertices, %d triangles from '%s'"), m_numverts, m_numverts-2, filename.c_str()); + + // NOTE: for some reason under wxGTK the following is required to avoid that + // the surface gets rendered in a small rectangle in the top-left corner of the frame + PostSizeEventToParent(); } void TestGLCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) ) @@ -345,9 +347,9 @@ void TestGLCanvas::OnMouseEvent(wxMouseEvent& event) // (for key events). event.Skip(); - if(event.LeftIsDown()) + if (event.LeftIsDown()) { - if(!dragging) + if (!dragging) { dragging = 1; }