AudioProcessorEditor drawing with OpenGLRenderer flickers on resizing


#1

So my setup is this for the AudioProcessorEditor which I want to draw just a single OpenGL view inside:

class ThreeDAudioProcessorEditor  : public AudioProcessorEditor, public OpenGLRenderer, public MultiTimer // (i don't thing MultiTimer is related to the fickering issue though)

I have implemented resizing with a ResizableCornerComponent exactly as described in this thread:  http://www.juce.com/forum/topic/best-way-implement-resizable-plugin (the Juce demo plugin which implements this resizing functionality does not flicker for me by the way, but it does not draw with an OpenGLRenderer...)

I also draw some static text over the GL view using the Component::paint() method which is inhereted through the AudioProcessorEditor, though I don't think this is causing the flickering either as it still happens when the paint() method is left empty or unimplemented.

It all works wonderfully, except for the entire window (both the raw openGL drawn in renderOpenGL() and the text drawn with standard Juce graphics methods in paint()) flickers badly when the ResizableCornerComponent is dragged to resize the window.  Anybody have any ideas?  I am pretty confident that I am using double buffering correctly with the gl drawn stuff and am clearing the gl buffers correctly prior to drawing each frame.  I am more thinking that my setup may be a goofy one and that Juce has a better way of implementing said functionality.

I can post more details of my code if that would help, but again I'm mainly wondering if this is the best way to do this.  

By the way this is a host independent problem.  I am on OSX Yosemite 10.10.1 and have not tested it on other platforms

Also when I get rid of all the drawing done through OpenGLRenderer and just use what is drawn through Component::paint() there is no flickering.  

Many thanks for the help guys.


#2

OpenGL is often tricky to embed without artefacts when the window is resized. In an app it's possible to use some tricks to work around this, by forcing synchronous updates when the window changes, but in plugins where the window is owned by the host, it's harder. I can't justify us spending (possibly quite a long) time investigating this, when it's far from certain that anything could be done to prevent it.


#3

Thanks for the quick reply and explanation Jules.  I guess my time is probably better spent elsewhere as well.


#4

I just wanted to add for anybody reading this that has similar issues, that upgrading from JUCE 3 to JUCE 4 seemed to almost completely fix the flickering issues.  There is now no flickering at all when using my plugin in AULab or Garageband.  In Tracktion though resizing the window causes the GL to go blank white until it is set in size.  Still this is better and less distracting than it was before when it was flickering to siezure inducing magnitude.