I have a custom OpenGL-based
juce::Component that is a
juce::OpenGLRenderer and has its own
juce::OpenGLContext. This Component uses custom OpenGL shader programs and is able to successfully render using an OpenGL render thread.
To initiate rendering I call:
myOpenGLComponent->setVisible (true); myOpenGLComponent->getOpenGLContext().setContinuousRepainting (true);
Everything is all well and good, rendering and resizing properly, until I call either of the above methods again, any number of times, either setting them to true or false.
After calling these methods again, and setting them to be true, I would expect to see my component properly rendering again, but instead the GL portion of my component renders as black. The pure JUCE Component’s contained within
myOpenGLComponent still render properly, but the custom OpenGL shader program renders as black. In the debugger, the
renderOpenGL() callback of my
OpenGLRenderer is still being called properly by the OpenGL rendering thread. Initially inspecting some of the variables during rendering, I did not find any NULL objects.
Has anybody had a problem like this with a custom OpenGL-based Component?
I would like to be able to show and hide my OpenGL component as I please.
Note: I am using multiple
OpenGLContexts in my JUCE app for different OpenGL components. Maybe this is contributing to the issue?