# High cpu usage when using open gl

**URL:** <https://forum.juce.com/t/high-cpu-usage-when-using-open-gl/42749>\
**Category:** General JUCE discussion\
**Created:** [November 15, 2020, 9:45pm UTC](https://forum.juce.com/t/high-cpu-usage-when-using-open-gl/42749 "2020-11-15T21:45:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcouka](https://avatars.discourse-cdn.com/v4/letter/l/eada6e/32.png) [@lcouka](https://forum.juce.com/u/lcouka)\
**Post date:** [November 15, 2020, 9:45pm UTC](https://forum.juce.com/t/high-cpu-usage-when-using-open-gl/42749/1 "2020-11-15T21:45:43Z")

</div>

Hello,

I’m working on an equalizer plugin and I’m trying to get fluent paths animations for the spectrum analyzer and the magnitude curves.

For my whole graph component, I would like to inherit from the OpenGLRenderer class and write native openGL code instead of using the regular fillPath method that is the bottleneck of my code right now, whatever I use the software or the open gl renderer.

Unfortunatly, when I inherit from the OpenGLRenderer class and set openGLContext.setContinuousRepainting(true); the CPU load is 100% on one core, both in Debug/Release mode.

I can reproduce this issue with an app freshly created from the Projucer with adding the public juce::OpenGLRenderer inheritance on the main component and by setting openGLContext.setContinuousRepainting(true);

When profiling from VS the CPU activity, there is a strong CPU activity on the deactivateCurrentContext() function. (\>90%).

Any help would be appreciated 🙂

Win10  
Juce 6.0.4  
i7 9750H, 24GO RAM,
