I want to share my Juce patchset with you, which allows using the modern OpenGL APIs on all platforms:
It is a simple set of changes which for the most part omits system GL header inclusion, fixes some type consistency issues here and there, and uses the glbinding library also for the OpenGL calls made inside Juce. I will try to keep this updated as soon as new Juce releases come out, or maybe I won't even need to since upstream decides they want to integrate this.
If you want to give it a try:
- Install the glbinding library: https://github.com/cginternals/glbinding
- Add glbinding to your linked libraries
- Set the JUCE_GLBINDING preprocessor define for your project / platform
- Call glbinding::Binding::initialize() once before doing any OpenGL calls
Then, wherever you use OpenGL functions, you can import the glbinding symbols into the global namespace if you want:
using namespace gl;
If you want to make sure your software runs with a specific OpenGL version, glbinding provides respective headers which you can include. To only make use of OpenGL functionality up to 3.3 for example, you can include version-specific headers like this:
#include <glbinding/gl/functions33.h> #include <glbinding/Binding.h> using namespace gl33;
I will be glad if people give this some testing in order to make it more robust. For me it works fine for the time being. Just create issues on GitHub or send me pull requests, this is supposed to be very open for contribution.
Hope this will be of use to some of you!