OpenGL in audio plugins


I am wondering whether it would be safe to use OpenGl inside of the ui of an VST/AU/RTAS plugin (if only it can be done) to perform some animations. Are there any pitfalls to avoid, or efficiency drawbacks of doing so? To be more specific, I would not like to do stuff related to the audio stream, but mostly fancy buttons or sliders.

Some voices inside of me are telling me that I’d want to stay away from this, but I am not really familiar with graphics programming, hence some hints would be greatly appreciated!

Thanks in advance,

About “drawbacks and pitfalls”: if you use GL, be sure that it’s hardware accelerated. If it isn’t, rendering will be very, very, very slow. I don’t know any portable way of determining whether if it is accelerated or not. At least, document somewhere that your plugin needs fast (i. e. hardware accelerated) OpenGL.

Generally, I would only use GL if it’s really needed: say, if you want to do some optional fancy audio visualization which opens in an extra window. I personally would not use it to animate buttons. This is nothing that would justify the dependency on accelerated GL, imho.

Couldn’t agree more. Use opengl only if you really need 3D or some kind of clever texture warping. If your animations are 2D, avoid it.

Hi i was planning to use opengl in an Audio plugin, but seeing above comment, i feel it is not wise to use opengl.

Is there any other option to create polygonal shapes like triangle and circle without using openGL?




This thread is 4 years old - things may have changed!

And yes, of course juce has a complete 2D graphics engine!

Thanks for your reply !

can i find some simple example anywhere ?




Are none of the examples in the demo app simple enough?