I’m developing plugin (currently VST only) that has a horizontally scrolling piano roll user interface implemented with OpenGL shaders. It’s working great when hosted in Ableton Live, but OpenGL won’t render when the plugin is loaded into the Juce Plugin Host.
Nothing related to GL thread is being called, such as newOpenGLContextCreated() and renderOpenGL().
I think the direct cause of problem is in this section of juce_OpenGLContext.cpp:
JobStatus runJob() override
{
{
// Allow the message thread to finish setting-up the context before using it..
MessageManagerLock mml (this);
if (! mml.lockWasGained()) //This is returning false
return ThreadPoolJob::jobHasFinished; //We are not getting to here
}
It’s failing to obtain a lock on the message manager. Is this is because the Plugin Host also has a message manager, and if so how can I avoid the conflict?
I was able to reproduce your bug - any plug-in made with JUCE that has an OpenGL view would not load correctly in the JUCE plug-in host. I now fixed this bug on develop. However, it didn’t have anything to do with the MessageManagerLock so it would be good if you could test the fix to confirm that this did in-deed fix the bug.
I didn’t have time to track that down so I went back to 4.2.4. and manually edited in just the changes to the juce_Mac_NSViewComponent.mm file, which solves my problem for now.