I’m in the process of syncing my plugins to Juce 7 after a few years of dust collection. I’m seeing that all my opengl code wants me to wrap my GL symbols in the juce::gl namespace. Is there anything I need to know? What’s the story there?
I would think to avoid collisions in the namespace in case you need/want to include the “official” OpenGL headers.
If you don’t want to prefix all function calls and enums, etc. simple try:
using namespace juce::gl;
at the top of your *.cpp file(s).
I would think to avoid collisions in the namespace in case you need/want to include the “official” OpenGL headers.
Sure, but what I’m asking is for what reason we can’t(? shouldn’t?) use the official headers. Wrapping a popular existing library is an odd choice that I assume was made for a good reason. I’d like to understand this as best I can.
I guess the same reason JUCE has the VST2/3 headers included so that users don’t have to download some another SDK to be able to compile. Since JUCE needs the OpenGL headers anyway, might as well include them, to make usage easier.
I certainly appreciate that. I’ve recently started using OpenGL for a non-plugin project to render with my own shaders, etc. and I didn’t need to bother finding and downloading the OpenGL SDK and then setting up include paths, etc.
FWIW there is no standard ‘library’ for OpenGL. GLEW, GLAD, etc, are extension loaders, and anything past OpenGL v1 is an extension.
You have to dynamically link the API at runtime by querying the system, juce::gl defines all the necessary functions and loads them for you.
Ok, thanks for the responses. That is helpful. If Apple ever decides to completely axe OpenGL, having this included in JUCE including it won’t make a difference, I assume?