On 19.11.2010, at 00:06, Erik wrote:

> I am developing an environment that is based on OpenGL and use a GUI to 
> present data, specifically text, to users. Meebo.com's interface is the best 
> example of what I am trying to create. The application is to consist of a 
> primary window where all sub windows are contained. The background of the 
> primary window would then be the OpenGL scene. The sub windows do not need 
> any transformations applied to them and can be drawn above the OpenGL scene 
> but still remain child to the parent application window.
> 
>> From the examples and the documentation I can't determine if FLTK supports 
>> this. If so, is there an example of a window in a window on top of an OpenGL 
>> scene?

Well, kind of. In FLTK, widgets in the same level of hierarchy should not 
overlap. They can, but FLTK does not take special care. That means, you can put 
many windows inside another window. 

In FLTK1 terms, there are two kinds of windows though: the top level windows 
are showing all the standard OS decoration (drag bar, close button, title bar, 
etc. etc.). An Fl_Window that is a child of another Fl_Window is also 
independent and can be dragged around programmatically. It has its own clipping 
area and coordinate system, but it does not have any decoration (it's no 
problem to program a simple decoration, it just does not come standard with 
one).

Now OpenGL is whole other beast ;-). OpenGL graphics in FLTK are windows as 
well, but they don't support widgets as children (out of the box). You can of 
course make one big background Fl_Gl_Window and let other Fl_Windows overlap, 
but I have not tested the results of this action on all platforms. It may 
actually work.

Lastly, and these are the best news, FLTK 1.3 has a graphics driver system that 
lets you draw into any context (screen, printer, being the most common ones of 
course) including OpenGL. So, with very little effort, it is possible to render 
any FLTK widget as a child of the Fl_Gl_Widget. FLTK 1.4 will come standard 
with this feature. If 1.3 stays on schedule, a 1.4 preview will come out in 
January.

 - Matthias
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to