Simple Multiple openGLContext (or how to integrate Spout in Juce)


i’m trying to integrate Spout (Syphon for Windows) in Juce, and i saw some code from alfaleader that shows a basic class, but this class derives from OpenGLRenderer and when i instantiate it, the newOpenGlContextCreated override is never called, nor any gl override.

So before i’m spending more time on it, any idea on how to create other openGlContext in order to get Spout to work (in a clean way)



You need to have an OpenGLContext as a member variable and then add your OpenGLRenderer as a callback of that context:

class MyClass : public OpenGLRenderer
           openGLContext.setRenderer (this);

     OpenGLContext openGLContext;

Note that you also need to attach the OpenGLContext to a component and that that component must be visible on the screen before you get any open gl render callbacks.