From 474e82bd95f0a3b9ac5b1361e541ae25ddb7f8b4 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 4 Mar 1999 20:11:49 +0000 Subject: Added HAVE_GL check to CubeView demo code. git-svn-id: file:///fltk/svn/fltk/trunk@368 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/CubeView.cxx | 8 ++++++-- test/CubeView.h | 10 ++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/CubeView.cxx b/test/CubeView.cxx index a8a846d70..162cce505 100644 --- a/test/CubeView.cxx +++ b/test/CubeView.cxx @@ -1,5 +1,5 @@ // -// "$Id: CubeView.cxx,v 1.1 1999/02/22 21:33:54 mike Exp $" +// "$Id: CubeView.cxx,v 1.2 1999/03/04 20:11:48 mike Exp $" // // CubeView class implementation for the Fast Light Tool Kit (FLTK). // @@ -51,6 +51,7 @@ CubeView::CubeView(int x,int y,int w,int h,const char *l) #define CUBECOLOR 255,255,255,255 void CubeView::drawCube() { +#ifdef HAVE_GL /* Draw a colored cube */ glBegin(GL_LINE_LOOP); glColor4ub(CUBECOLOR); v3f(boxv0); v3f(boxv1); v3f(boxv2); v3f(boxv3); glEnd(); glBegin(GL_LINE_LOOP); glColor4ub(CUBECOLOR); v3f(boxv5); v3f(boxv4); v3f(boxv7); v3f(boxv6); glEnd(); @@ -65,9 +66,11 @@ void CubeView::drawCube() { glBegin(GL_QUADS); glColor4ub(255, 0, 0, ALPHA); v3f(boxv4); v3f(boxv5); v3f(boxv6); v3f(boxv7); glEnd(); glBegin(GL_QUADS); glColor4ub(255, 0, 255, ALPHA); v3f(boxv0); v3f(boxv3); v3f(boxv7); v3f(boxv4); glEnd(); glBegin(GL_QUADS); glColor4ub( 0, 255, 0, ALPHA); v3f(boxv1); v3f(boxv5); v3f(boxv6); v3f(boxv2); glEnd(); +#endif /* HAVE_GL */ };//drawCube void CubeView::draw() { +#ifdef HAVE_GL if (!valid()) { glLoadIdentity(); glViewport(0,0,w(),h()); @@ -87,8 +90,9 @@ void CubeView::draw() { drawCube(); glPopMatrix(); +#endif /* HAVE_GL */ }; // -// End of "$Id: CubeView.cxx,v 1.1 1999/02/22 21:33:54 mike Exp $". +// End of "$Id: CubeView.cxx,v 1.2 1999/03/04 20:11:48 mike Exp $". // diff --git a/test/CubeView.h b/test/CubeView.h index c58060099..d00d517da 100644 --- a/test/CubeView.h +++ b/test/CubeView.h @@ -1,5 +1,5 @@ // -// "$Id: CubeView.h,v 1.1 1999/02/22 21:33:54 mike Exp $" +// "$Id: CubeView.h,v 1.2 1999/03/04 20:11:49 mike Exp $" // // CubeView class definitions for the Fast Light Tool Kit (FLTK). // @@ -28,8 +28,10 @@ #include #include #include -#include -#include +#ifdef HAVE_GL +# include +# include +#endif /* HAVE_GL */ #include @@ -109,5 +111,5 @@ private: #endif // -// End of "$Id: CubeView.h,v 1.1 1999/02/22 21:33:54 mike Exp $". +// End of "$Id: CubeView.h,v 1.2 1999/03/04 20:11:49 mike Exp $". // -- cgit v1.2.3