FLTK logo

Re: drawing fltk butons on top of an Fl_Gl_Window

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.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: drawing fltk butons on top of an Fl_Gl_Window Ian MacArthur May 17, 2011  
 
On 17 May 2011, at 22:21, Andrew Waldrum wrote:

> I am trying to create a control panel that will appear or hide on a full
> screen Fl_Gl_Window.  When I attempt this my buttons work(I can press,
> select, slide things) but are visually overwritten by the openGL
> window.  I have played around with reordering the updates and explicitly
> redrawing the buttons without success.  I am currently working with the
> CubeView example program trying to make it's sliders appear over the
> image when moved on top of the image window.
> 
> Any ideas on how to make my buttons visible? 

Yup, this is a tricky one - as I summarise it, you are trying to lay "regular" fltk widgets on top of a GL window, is that right?

There's a basic problem with this, that the GL context doesn't even know the non-GL widgets are there, so can behave "badly" towards them, which is what you are seeing. Note that quite how that manifests itself can depend on what platform you are on, and how the graphics driver behaves, and, well, stuff...

So, as to a solution: Matt has (or used to have, anyway) a demo of how to render some derived widgets using GL, in the GL context - then GL knows they are there and things work a bit better.
That might work for you, too.

(Longer term, we do hope to get better integration, and leverage our new device layer to allow GL to be used as an option for all rendering, which would of course alleviate your situation - but that 'aint working yet...)

Another approach, which I did try with some success (albeit on only one platform, so I don't know how generic this is) was to render the GL scene into an offscreen buffer, and then blit that offscreen onto the display window and lay the regular widgets on top of the blitted scene. This worked (much to my surprise) but I did not persist with it, so I don't know if it is any use to you or not...
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'.