Components with OpenGL rendering

I am trying to develop a component using OpenGL rendering. I was able to get a simple Proof of Concept working. The only thing I noticed is that the component using OpenGL rendering is displayed on top of other components, including Components higher in the hierarchy that need to appear above the Component rendered with OpenGL. Is that behavior expected and is there a way to preserve the hierarchy so that Components using Graphics drawing can appear above Components rendering with OpenGL?

The OpenGL context is actually another window that gets floated ontop of the component it is attached to. If you want other components infront, you need to instead make the OpenGL component the parent that contains all children concerned.

Thank you, Fandusss! If the OpenGL rendering is happening on a window floating over the component, then how are child components being visualized? Are they automatically using OpenGL rendering as well?

If you enable component rendering on the OpenGL context, the renderer will paint the components under an OpenGL Graphics context. Otherwise, they will go through the normal JUCE painting.

Reference: setComponentPaintingEnabled

Hi caustik, thanks for clarifying that. But if the child components are displayed using normal JUCE painting, they will be hidden by their parent OpenGL component, is that correct?

No, you can add a component on top of an open gl component. Just tested it.

Thank you all for the help!