From df344ba9df2d455286b67f9f03b6d7ea28bc61fa Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Sat, 16 May 2009 10:57:25 +0000 Subject: [PATCH] (dirty) fix rendering upon startup of the surface git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/opengl/isosurf/isosurf.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/samples/opengl/isosurf/isosurf.cpp b/samples/opengl/isosurf/isosurf.cpp index fb8039efa7..8798d37922 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) { @@ -234,6 +232,10 @@ void TestGLCanvas::LoadSurface(const wxString& filename) wxLogMessage(_T("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; }