Please indent code by 4 spaces to make it readable in the forum!
The original bug (not the android one), is now fixed on develop.
Sorry. I just added indents where needed to my previous posts.
I pulled the tip of the dev branch. Now nothing is being rendered.
Sometimes when the plugin is opened renderOpenGL() is called once, sometimes a couple of times, sometimes it’s not called at all. Often newOpenGLContextCreated() is not called on open either.
Setting a breakpoint at the start of runJob() in juce_OpenGLContext.cpp seems to always guarantee that newOpenGLContextCreated() and renderOpenGL() get called at least once. After that renderOpenGL() might be called once more, but never again.
The code for my ScrollingNoteViewer class is still exactly as I posted at the start of this thread.
Did all these OpenGL issues get resolved? I have a VST plugin with two OpenGL components. I can open and close the editor without issues, however, as soon as I have two instances of the plugin open in Reaper, I get a crash closing the second plugin window. Just wondering if I’m seeing the same issue or something different.
The call stack looks like this:
#0 0x00007fffd4eca921 in gleRunVertexSubmitImmediate ()
#1 0x00007fffd4e43db7 in glDrawElements_ACC_Exec ()
#2 0x00000001149b7b79 in homados::Shape::draw(juce::OpenGLContext&, homados::Attributes&) at /Volumes/Lolrus/dev.github/spotlight-gss/tools/maux-plugin/Common/UI/glHelpers.h:134
#3 0x00000001149b7ab9 in homados::SphereComponent::renderSmallSphere(float, homados::SphereComponent::Color const&) at /Volumes/Lolrus/dev.github/spotlight-gss/tools/maux-plugin/Common/UI/SphereComponent.cpp:340
#4 0x00000001149b766b in homados::SphereComponent::renderOpenGL() at /Volumes/Lolrus/dev.github/spotlight-gss/tools/maux-plugin/Common/UI/SphereComponent.cpp:206
#5 0x00000001149b7c0c in non-virtual thunk to homados::SphereComponent::renderOpenGL() ()
#6 0x0000000114f28de0 in juce::OpenGLContext::CachedImage::renderFrame() at /Volumes/Lolrus/dev.github/spotlight-gss/ext/JUCE/modules/juce_opengl/opengl/juce_OpenGLContext.cpp:247
#7 0x0000000114f261f9 in juce::OpenGLContext::CachedImage::runJob() at /Volumes/Lolrus/dev.github/spotlight-gss/ext/JUCE/modules/juce_opengl/opengl/juce_OpenGLContext.cpp:451
#8 0x0000000114f26309 in non-virtual thunk to juce::OpenGLContext::CachedImage::runJob() ()
#9 0x0000000114ba4cf8 in juce::ThreadPool::runNextJob(juce::ThreadPool::ThreadPoolThread&) at /Volumes/Lolrus/dev.github/spotlight-gss/ext/JUCE/modules/juce_core/threads/juce_ThreadPool.cpp:341
#10 0x0000000114beeee2 in juce::ThreadPool::ThreadPoolThread::run() at /Volumes/Lolrus/dev.github/spotlight-gss/ext/JUCE/modules/juce_core/threads/juce_ThreadPool.cpp:40
#11 0x0000000114ba2727 in juce::Thread::threadEntryPoint() at /Volumes/Lolrus/dev.github/spotlight-gss/ext/JUCE/modules/juce_core/threads/juce_Thread.cpp:101
#12 0x0000000114ba2a95 in juce::juce_threadEntryPoint(void*) at /Volumes/Lolrus/dev.github/spotlight-gss/ext/JUCE/modules/juce_core/threads/juce_Thread.cpp:113
#13 0x0000000114bc2fbe in ::threadEntryProc(void *) at /Volumes/Lolrus/dev.github/spotlight-gss/ext/JUCE/modules/juce_core/native/juce_posix_SharedCode.h:855
#14 0x0000000100e8bb90 in _pthread_body ()
#15 0x0000000100e8badc in _pthread_start ()
#16 0x0000000100e8b2c5 in thread_start ()
I should point out, it’s not the plugin that’s closing that is crashing. It’s the plugin that should still be running, could the closing plugin be killing it’s OpenGL somehow? Sorry, not an OpenGL expert.
Unfortunately I never did get it to work reliably. I finally gave up and made my application into a standalone audio/midi app (sort of a sequencer) where OpenGL is working fine, although even that was quite difficult.
If I recall correctly, a challenge with plugins seems to be that the host can close the plugin window without notifying the plugin, so the plugin doesn’t get a chance to close its OpenGL context before its window is closed.
