summaryrefslogtreecommitdiff
path: root/test/cube.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'test/cube.cxx')
-rw-r--r--test/cube.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/cube.cxx b/test/cube.cxx
index 9f4cf0aa6..7f7d37c4b 100644
--- a/test/cube.cxx
+++ b/test/cube.cxx
@@ -99,6 +99,7 @@ void cube_box::draw() {
glFrustum(-1,1,-1,1,2,10000);
glTranslatef(0,0,-10);
gl_font(FL_HELVETICA_BOLD, 16 );
+ glClearColor(0.4, 0.4, 0.4, 0);
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
@@ -113,6 +114,10 @@ void cube_box::draw() {
glDisable(GL_DEPTH_TEST);
gl_draw(wire ? "Cube: wire" : "Cube: flat", -4.5f, -4.5f );
glEnable(GL_DEPTH_TEST);
+
+ // if an OpenGL graphics driver is installed, give it a chance
+ // to draw additional graphics
+ if (Fl::cfg_gfx_opengl) Fl_Gl_Window::draw();
}
int cube_box::handle(int e) {
@@ -140,6 +145,11 @@ void makeform(const char *name) {
flat = new Fl_Radio_Light_Button(390,50,100,30,"Flat");
button = new Fl_Button(390,340,100,30,"Exit");
cube = new cube_box(23,23,344,344, 0);
+ if (Fl::cfg_gfx_opengl) { // try to overlay a button onto an OpenGL window
+ cube->begin();
+ /*Fl_Button *test =*/ new Fl_Button(35, 105, 100, 30, "Test");
+ cube->end();
+ }
cube2 = new cube_box(513,23,344,344, 0);
Fl_Box *b = new Fl_Box(FL_NO_BOX,cube->x(),size->y(),
cube->w(),size->h(),0);