OpenGL interface renderer with OpenGLRenderer component broken - OpenGL Demo misleading

Yes, the demo is a bit confusing in that sense. As you know there isn’t really an “Open GL interface renderer”. You can only attach a GL context to a JUCE component. That JUCE component and all of it’s children will then be rendered with OpenGL.

There are a few limitations to this. First of all, you can’t have any of the child components also be attached to a different OpenGLContext. This will result in problems with z-ordering and clipping.

Also, we know that some GPUs struggle to cope with the situation where a parent component (not attached to an OpenGLContext), has two child components which are both attached to separate OpenGLContexts - you will get the flickering you observe. Often a driver update will fix the problem.

To avoid the situations described above, the JUCE demo will turn off OpenGL rendering for the side menu when running the OpenGL demo. However, the complete demo area is still completely rendered with opengl (as the top-level demo component attaches to a gl context).

If you have multiple components requiring opengl and you want to render all GUI components with OpenGL, then I strongly advise that you attach an OpenGLContext to the top-level component only. The top-level component can then keep track of all the subcomponents which require renderOpenGL callbacks and simply forward the renderOpenGL callback to them.