give an #error if wxUSE_GLCANVAS == 0 instead of building empty samples

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29830 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-10-13 21:19:38 +00:00
parent cc0c05cd9f
commit 806e2f154a
3 changed files with 13 additions and 62 deletions

View File

@@ -25,6 +25,10 @@
#include "wx/wx.h"
#endif
#if !wxUSE_GLCANVAS
#error "OpenGL required: set wxUSE_GLCANVAS to 1 and rebuild the library"
#endif
#include "penguin.h"
#ifdef __WXMAC__
# ifdef __DARWIN__
@@ -54,7 +58,6 @@ bool MyApp::OnInit()
menuBar->Append(fileMenu, wxT("&File"));
frame->SetMenuBar(menuBar);
#if wxUSE_GLCANVAS
frame->SetCanvas( new TestGLCanvas(frame, wxID_ANY, wxDefaultPosition,
wxSize(200, 200), wxSUNKEN_BORDER) );
@@ -65,14 +68,6 @@ bool MyApp::OnInit()
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)
@@ -86,9 +81,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos,
const wxSize& size, long style)
: wxFrame(frame, wxID_ANY, title, pos, size, style)
{
#if wxUSE_GLCANVAS
m_canvas = NULL;
#endif
}
/* Intercept menu commands */
@@ -98,8 +91,6 @@ void MyFrame::OnExit( wxCommandEvent& WXUNUSED(event) )
Close(true);
}
#if wxUSE_GLCANVAS
BEGIN_EVENT_TABLE(TestGLCanvas, wxGLCanvas)
EVT_SIZE(TestGLCanvas::OnSize)
EVT_PAINT(TestGLCanvas::OnPaint)
@@ -267,5 +258,3 @@ void TestGLCanvas::InitGL()
glEnable(GL_COLOR_MATERIAL);
}
#endif // #if wxUSE_GLCANVAS