Render OpenGL to Component with custom OpenGL context

Hi all,

We’re trying to render OpenGL to one of our components. Because of multiple reasons we’re running our own render thread and loop, which means we can’t use JUCE’s OpenGLContext and OpenGLRenderer.

And so, we’re trying to write our own custom system within JUCE of rendering to a given component, taking the JUCE OpenGLContext and OpenGLRenderer as examples, but it’s not entirely clear what exactly is happening in regards to rendering, tracking and window management. Could someone enlighten us about the following issues?

  • Is the OpenGLContext actually drawing a borderless window on top of the component?
  • If so, how exactly does the window track the position of the Component? At first I thought this is why the ::Attachment derives from ComponentMovementWatcher, but that’s tracking component movements, not movements of the top-level window.
  • Is it possible to reuse some elements from the system currently implement in JUCE?

I get this is not an average question and digs rather deep into the OpenGL system, but any pointers into the right direction are much appreciated!

1 Like