So I want to create a custom component that shows certain information. This component has to be sent through Spout (spout is a library to share graphics between programs). So I want to send this component to Resolume Arena to map the information in this VJ program.
So I want to know how to know how I get the OpenGL texture from this component to give it to the spout library to send this texture to the other program so I can use it in this. But I don’t know enough from the internals from JUCE and openGL to know where I should do this. Where should I do the paintEntireComponent, in the paint() function of the component?
What you want is probably the OpenGL handle of the Texture Juce renders in so you can share it using Spout. I don’t know the specifics of the Juce OpenGL rendering but what you could do as well is render to an Image and convert that to a texture yourself. Using the BitmapData of the Juce Image that’s actually quite simple. But of course getting the Texure handle directly from Juce would be ideal. I guess Juce uses a render to texture mechanism. Let me know how you get on with this.
I’ll dive deeper in the internal JUCE render engine. Another option is to do all the rendering directly in OpenGL, but I prefer to use the easy JUCE components to show stuff because I’m not an OpenGL expert.
Rendering to a image and then converting to a texture seems like (correct me if I’m wrong) going from GPU data --> CPU data --> GPU data and seems indeed a bit unnecesarry.