Currently I’m using JUCE in combination with OpenCL (if anyone needs some info on that, please let me know, it was surprisingly easy to setup once you know how). For this I currently create an OpenGL context, which I share with OpenCL so they can share buffers etc. This works fine as I’m currently working within one component, but I now actually need to call the OpenCL context throughout the entire program.
For this, I need a persistent OpenGL context throughout the lifetime of the program (because my OpenCL context is built on top of that one). How do I go about this? OpenGLContext and OpenGLRenderer slightly confuse me tbh. Whenever I inherit OpenGLContext, I can’t start creating buffers in the constructor. I need to attach an OpenGLRenderer and create the buffers in newOpenGLContextCreated(). Now when I attach the OpenGLRenderer to a different component, newOpenGLContextCreated() is called again. So it will recreate the OpenGLContext, making all old buffers invalid, right?
In this thread, Jules mentions that the plan was to have a single OpenGLContext per window. Is this indeed (still) the case?
Many thanks in advance!