How update component but not children (openGL issue)?

I have an juce component which is an OpenGLRenderer. In the component I also override paint to draw things in screen space(gimbals,arrows, boxes, etc). The problem I have is that the openGl component has normal 2d components on top of it which are heavy to draw. So when I move the camera in the GLView and call repaint I am repainting all the child components which dont need to be updated. This is causing low frame rates. Does anyone know the best solution to this?

update - I found using repaint (const Rectangle< int > &area) while excluding the areas where child components are located, seems to work for me.

Out of curiosity, can you ‘setBufferedToImage(true)’ on the child components and see what the framerate does? If your children are opaque, try setting them as opaque as well.

So maybe revert to repaint() and use ‘setBufferedToImage(true);setOpaque(true)’ in your child component ctors. Just to see what the framerate does. As a test.

1 Like

This also seems to works , Thanks!

Awesome. I may need this in the future. Thanks!