I need to tell OpenGL to render a new frame or grab/display frames every X number of samples, I need perfect sync between audio and graphics. Is there any way to get this done? Here is a demonstration of the problem:
Blue(Left) = CPU / Everything is done in audio thread
Pink(Right) = GPU / OpenGL
Left circle is the old version of my oscilloscope which all graphics are rendered in the audio thread thereby providing perfect sync, although the heavy CPU usage of calculating a complex image with thousands of dots/lines/pixels means the audio goes to s**t. So we moved on to using OpenGL. Now that the GPU is doing the heavy lifting of calculating the pixels, I’d like to somehow render/show the frames in perfect sync like I did before. I would love to simply call “render frame” or something FROM the audio thread, from the processBlock, but my programmers have informed me they are confused as to how to accomplish this due to how JUCE is setup.