FLTK logo

Re: FLTK Written With OpenGL?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.opengl  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: FLTK Written With OpenGL? Greg Ercolano Oct 11, 2012  
 
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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.