OpenGLContext in UIViewController on iOS

I’m working on an iOS app with one JUCE-based view controller. The main JUCE component now contains an OpenGL component. When the view controller is dismissed, the JUCE component is destroyed. The main component’s constructor attaches the OpenGL child component to an OpenGLContext. The destructor detaches it.

The first time the JUCE component loads, it works fine. However, on subsequent loads the OpenGL component does not show. I’ve tried a few different combinations of things, e.g. keeping the OpenGLContext alive vs destroying and recreating. My initial version (before the OpenGL component) kept the whole component alive, but this caused issues with the OpenGL component.

Before I create s simplified example to show the issue, I wanted to see if this rings any bells for anyone…?

1 Like