Blank renderOpenGL output

I’ve been trying to fix a similar issue to this one with an OpenGL based plugin. There is nothing being rendered from our renderOpenGL call (JUCE components are rendering using OpenGL).

As suggested here I’ve copied the macOS 10.13 SDK from Xcode 9.4. The Xcode version being used to build with is 12.4. It seems to be building with the chosen SDK. But the OpenGL problem remains: Blank OpenGL window.

If I build this on a machine running Mojave with Xcode 11.2.1, it works on a Mojave machine. Similarly with Catalina (my build server). If I build it on my Big Sur dev machine, it works too. Can anyone point to a way to get these builds working on a given macOS version without having to build on a machine running that version?

Has anyone tackled this issue more recently?

Usually this points to a driver not supporting the OpenGL version you’re requesting (where JUCE picks one by default).

Assuming that the driver support/lack of support is the issue, you’d need to check what the driver spits out for OpenGL major/minor versions. From there, you can figure out when/how to detach your context on failure/too old a GL version and get a normal renderer in place.

What I’ve done in my projects is use this class I wrote to do the above. Feel free to copy/hack to your liking: squarepine_core/HighPerformanceRendererConfigurator.h at main · SquarePine/squarepine_core · GitHub

Using that, in my relevant Component’s constructor (the same Comp that owns the configurator), I do this:

    MessageManager::callAsync ([&]() // Should be nicer but it's a rough draft/off the top of my head
        configurator.configureWithOpenGLIfAvailable (*this);

        if (auto* context = configurator.context.get())
            context->executeOnGLThread ([&] (OpenGLContext& c)
            }, false);

Thank you Joël! I’ll digest that over the next couple of days…