Correct way to render components with OpenGL


I’m trying to build a simpler controller app mainly for mobile. After my first run on a real Android device (S5 mini Android 6.0), I noticed that the graphics performance was not that great. So I did some research on rendering the JUCE sliders with OpenGL. The tutorial on OpenGL doesn’t show any component examples, but I found an old example which in the constructor of the mainwindow sets:


openGLContext is definded in the header:

class MainComponent : public OpenGLAppComponent {
  OpenGLContext openGLContext;

For it to compile I had to comment out the first line (see above).

So basically my question is: Is this the correct way to render JUCE components with OpenGL?

Have a look at the OpenGL renderer PIP demo in the examples folder