mirror of https://github.com/fltk/fltk
Added HAVE_GL check to CubeView demo code.
git-svn-id: file:///fltk/svn/fltk/trunk@368 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
16d264d393
commit
474e82bd95
|
@ -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 $".
|
||||
//
|
||||
|
|
|
@ -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 $".
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue