2D Component painting in an OpenGLComponent


Just checking I’m getting this right…

An OpenGLComponent is able to draw 2D Components on top of itself. It does this with a screen aligned (well, Component aligned) buffer that the Components are drawn into by a software rendering context.

The OpenGLRenderer uses OpenGL to draw Components directly.

Is this right? Does that cover it?

(I’m looking for somewhere to hook in and draw Components individually in OpenGL).



Yes - more or less right. Except that the OpenGLRenderer doesn’t render components, it’s just for running your own GL code directly.


Oh, right. And the JuceDemo OpenGL component has some example code that renders 2D components semi-manually?

So - the problem with getting the OpenGLRenderer to have child components that render OpenGL is the complexity of component rendering? There’s no cheeky way to slip a dynamic_cast(*component)->renderGL() type trick in there?

Is the GL renderer sub-classable? So I could run two passes?