summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>1999-03-04 20:11:49 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>1999-03-04 20:11:49 +0000
commit474e82bd95f0a3b9ac5b1361e541ae25ddb7f8b4 (patch)
treea0a3359a18d9f4fd86bfc02048817ac1252c7221 /test
parent16d264d393e9aa8ce741102f453d84255cd31a1d (diff)
Added HAVE_GL check to CubeView demo code.
git-svn-id: file:///fltk/svn/fltk/trunk@368 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test')
-rw-r--r--test/CubeView.cxx8
-rw-r--r--test/CubeView.h10
2 files changed, 12 insertions, 6 deletions
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 <config.h>
#include <FL/Fl.H>
#include <FL/Fl_Gl_Window.H>
-#include <FL/gl.h>
-#include <GL/glu.h>
+#ifdef HAVE_GL
+# include <FL/gl.h>
+# include <GL/glu.h>
+#endif /* HAVE_GL */
#include <stdlib.h>
@@ -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 $".
//