I have a JUCE v.1.53 application that makes extensive use of OpenGLComponents. I’m in the process of upgrading to the latest version of JUCE, but I’ve been having trouble getting OpenGL rendering to behave correctly.
I’ve tried two approaches so far:
Turn each OpenGLComponent into a Component and OpenGLRenderer, and attach each one to its own OpenGLContext. This led to the components being rendered, but CPU load was very high when the program was idle (>50% on a dual-core Linux box).
Attach the MainWindow’s content component to an OpenGLContext, with setComponentPaintingEnabled equal to “true”. This led (somewhat expectedly) to none of the sub-components being rendered and (unexpectedly) a high CPU load when idle.
It would be extremely helpful if someone had a working OpenGL application I can use as a model (besides the JUCE demo, which is too basic). I’d also appreciate a quick explanation of how to replicate the functionality of an OpenGLComponent using the new classes. It would be nice to better understand the rationale behind the recent upgrades, so I don’t have to stumble onto a solution through trial-and-error.
Forgive me if my knowledge of OpenGL contexts sounds naive. The previous version of JUCE made OpenGL ridiculously simple, so I didn’t have to dive into the details.
Thanks for any advice!