diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2016-01-17 00:44:07 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2016-01-17 00:44:07 +0000 |
| commit | eb8207ff1bde8a1e092e60d4b2c15336c78e3a40 (patch) | |
| tree | b1c9db0aa00c0245e8d5a01c09b305ef83185f92 /test | |
| parent | 3235168654b225ce256ae4b54324d68b563b9413 (diff) | |
Trying to create a more detaild way to configure the library, added runtime information, added an OpenGL graphics driver that renders a button on top of an OpenGL window (see test/cube).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11006 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test')
| -rw-r--r-- | test/cube.cxx | 10 |
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); |
