OpenGL - Multiple Calls to Visibility/Rendering Methods Causes Black Rendering Output

@DaveH @PluginPenguin Thank you both for your replies and useful information!

I will move to a single OpenGLContext due to the issues you all mention. When using a single context, do either of you two use the context to render both regular painted JUCE Components and custom OpenGL-based components? My goal is to render a few custom OpenGL-based components and many regular JUCE components using a single OpenGLContext. Is this possible?

Regarding this thread’s main question of visibility:

Yes, when I run the following code

myOpenGLComponent->setVisible (true);
myOpenGLComponent->getOpenGLContext().setContinuousRepainting (true);
myOpenGLComponent->getOpenGLContext().setContinuousRepainting (false);
myOpenGLComponent->getOpenGLContext().setContinuousRepainting (true);

it shows up as black, but if I only run:

myOpenGLComponent->setVisible (true);
myOpenGLComponent->getOpenGLContext().setContinuousRepainting (true);

it shows up fine.

I am gonna try to dig into my code more to find the problem. I have written OpenGL Components before that do not exhibit this behavior, so it must be some code I have written causing this. Just wondering if anyone had run into this kind of behavior before and knew a likely cause.