#include "wx/wx.h"
#endif
-#if !wxUSE_GLCANVAS
-#error Please set wxUSE_GLCANVAS to 1 in setup.h.
-#endif
-
#include "penguin.h"
#ifdef __WXMAC__
# ifdef __DARWIN__
menuBar->Append(fileMenu, wxT("&File"));
frame->SetMenuBar(menuBar);
+#if wxUSE_GLCANVAS
frame->SetCanvas( new TestGLCanvas(frame, -1, wxPoint(0, 0), wxSize(200, 200), wxSUNKEN_BORDER) );
/* Load file wiht mesh data */
frame->Show(TRUE);
return TRUE;
+#else
+
+ wxMessageBox( _T("This sample has to be compiled with wxUSE_GLCANVAS"), _T("Building error"), wxOK);
+
+ return FALSE;
+
+#endif
}
IMPLEMENT_APP(MyApp)
const wxSize& size, long style):
wxFrame(frame, -1, title, pos, size, style)
{
+#if wxUSE_GLCANVAS
m_canvas = NULL;
+#endif
}
/* Intercept menu commands */
-void MyFrame::OnExit(wxCommandEvent& event)
+void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event))
{
Destroy();
}
+#if wxUSE_GLCANVAS
+
BEGIN_EVENT_TABLE(TestGLCanvas, wxGLCanvas)
EVT_SIZE(TestGLCanvas::OnSize)
EVT_PAINT(TestGLCanvas::OnPaint)
lw_object_free(info.lwobject);
}
-void TestGLCanvas::OnPaint( wxPaintEvent& event )
+void TestGLCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
{
/* must always be here */
wxPaintDC dc(this);
}
}
-void TestGLCanvas::OnEraseBackground(wxEraseEvent& event)
+void TestGLCanvas::OnEraseBackground(wxEraseEvent& WXUNUSED(event))
{
/* Do nothing, to avoid flashing on MSW */
}
}
+#endif