|
|
On 10/08/12 10:53, Mike Werner wrote:
>> FLTK widgets can appear *around* an opengl drawing area, but not inside it.
>
> I make extensive use of the Fl_Gl_Window widget. In fact I actually do place
> widgets INSIDE the OpenGL window. They don't visually 'appear' because the
> OGL graphics is written on top of them.
> However they provide useful functionality. For example I often split
> the GL window into 3 or 4 viewports. To 'activate' a viewport the user
> left clicks anywhere inside it. This is implemented by putting a large
> FLTK button under the entire viewport with an appropriate callback.
That should be ok if you make the fltk widget invisible
The docs only warn about mixing fltk drawing with the opengl window:
From: http://fltk.org/doc-1.3/classFl__Gl__Window.html#details
> Please note that the FLTK drawing and clipping functions will not work
> inside an Fl_Gl_Window. All drawing should be done using OpenGL calls exclusively.
To make a widget invisible but still active, I think you can just
call the widget's clear_visible(), Fl_Widget's base class method.
But you're right, there are times where it's OK to have FLTK widgets
overlap with opengl; one technique is to make a giant invisible
Fl_Menu_Button over the entire window to easily get a right-click menu
over the entire window. Works even for an opengl app IIRC.
The popup menu draws OK because it's really handled as a separate
window in the window manager, so there's no cross over of fltk drawing
code with opengl; they're in separate windows.
But to just detect a left click, I'd probably go the route
of adding a handle() method to my gl window class and have it
look for left click events, avoiding the use of an FLTK widget
altogether.
[ Direct Link to Message ] | |
|
| |