OSX Mojave openGLContext.attachTo() issue if more than one context is used

The whole OpenGL topic is a little bit cumbersome on this forum. I describe this now again for all beginners, as it would have helped me too, because there are a lot of misunderstands.

OpenGL != OpenGLContext.

The openGL Context is just a replacement for the CoreGraphics Render, and uses OpenGL for redrawing the GUI, which can be faster than CoreGraphics, but doesn’t has to,

  • because it still uses the CPU
  • but mainly it also need to lock the Message-Thread (and is therefore constantly interrupted).

Normally you use one OpenGLContext per plugin window and attach it to the main plugin-Editor component.

If you really want fluid high-fps redrawing, you need to draw in inside the OpenGLRenderer::renderOpenGL() callback, via hardcore low-level OpenGL instructions.
And this happens parallel (concurrently) to the (main) message-Thread.

( There is also a technic using the a JUCE Graphics-class OpenGL-LowLevel render we discussed here Ableton Windows OpenGL "freeze-out" on high work load and multi-instance - #2 by chkn, but this maybe doesn’t work stable)

So overall a very complex topic, but doable.