(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
This commit is contained in:
Francesco Montorsi 2009-05-16 10:57:25 +00:00
parent d6764050d8
commit df344ba9df

View File

@ -51,7 +51,6 @@ GLboolean g_lighting = GL_TRUE;
IMPLEMENT_APP(MyApp) IMPLEMENT_APP(MyApp)
// `Main program' equivalent, creating windows and returning main app frame
bool MyApp::OnInit() bool MyApp::OnInit()
{ {
if ( !wxApp::OnInit() ) if ( !wxApp::OnInit() )
@ -93,9 +92,8 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(wxID_EXIT, MyFrame::OnExit) EVT_MENU(wxID_EXIT, MyFrame::OnExit)
END_EVENT_TABLE() END_EVENT_TABLE()
// My frame constructor
MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, 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), : wxFrame(frame, wxID_ANY, title, pos, size, style),
m_canvas(NULL) m_canvas(NULL)
{ {
@ -234,6 +232,10 @@ void TestGLCanvas::LoadSurface(const wxString& filename)
wxLogMessage(_T("Loaded %d vertices, %d triangles from '%s'"), wxLogMessage(_T("Loaded %d vertices, %d triangles from '%s'"),
m_numverts, m_numverts-2, filename.c_str()); 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) ) void TestGLCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
@ -345,9 +347,9 @@ void TestGLCanvas::OnMouseEvent(wxMouseEvent& event)
// (for key events). // (for key events).
event.Skip(); event.Skip();
if(event.LeftIsDown()) if (event.LeftIsDown())
{ {
if(!dragging) if (!dragging)
{ {
dragging = 1; dragging = 1;
} }