When using using namespace juce; opengl-definitions like GL_TEXTURE0 are either a macro (on mac, defined by gl3.h) or an enum (windows, MissingOpenGLDefinitions).
However, without using namespace juce; I would have to add juce:: in front of GL_TEXTURE0 when on windows, which wouldn’t work on mac anymore.
So the code won’t be portable.
However, I actually like the removal of using namespace juce;…
Am I missing something, or should JUCE revise the MissingOpenGLDefinitions-trick?
To add to the FR - the “wrangling” of functions and macros from OpenGL is a totally normal thing to do in order to get access to all functionality necessary at once.
And again – seems that this one comes up on a regular basis. Why is there no official reaction from the team regarding this since the first report of this issue two years ago? This is really annoying when trying to write clean and portable code without a global using namespace juce
I’ve made some changes to the way that we load OpenGL symbols which should solve some of the issues raised in this thread.
Given that the change is quite large, it’s currently on a feature branch: generated-opengl-headers. I’d really appreciate any feedback on this potential change, before we merge it to develop. As always, I’m happy to answer any questions you may have about this change.