holm.h...@gmail.com schrieb am Sonntag, 19. Juni 2022 um 15:30:05 UTC+2:
Based on the nice work by Matthias, I make a FL_Group in my
Fl_Gl_Window. This do support transparent colors, as can be seen in the
attached image.
Oh, wow, thanks for the screenshot. This looks really great!
This looks just like I wanted. However there are a few issues:
1) The event handling is not always ok. I suspect that my Fl_Gl_Window captrues it. This may be my mistake.
You need to override Fl_Gl_Window::handle() and make sure that your new function still calls the original handle() function. If that returns 1, the even was handled by the children or the GL window. Only if it was not handled (returning 0), you should add your own action (and then return 1 yourself if you handled the event, and 0 if not).
It is entirely possible though that I messed something up in the event handler. If you can get me more details, I'll be happy to dive in and find out, where the events are mishandled.
2)
Clicking on the buttons causes a redraw, and that may lead to the
Fl_Group is "blinking". Is the problem that my Fl_Gl_Window/draw() uses
too much time ?
Redrawing a UI within a GL window is different to a regular window. A GL window must always be redrawn in its entirety (*including* the 3D scene in the background), whereas system windows use clipping and other tricks to redraw only what's needed. Again, I'll be happy to look into that, but I will need more detail, and probably some sample source code that shows the unexpected behaviour. The overridden Fl_Gl_Window::draw() function should redraw the entire 3D scene first, and then call the original draw() function.
Hope that helps,
Matthias