Windows & OpenGL 3 fix

Because JUCE_OPENGL3 isn’t defined and set to 1, you can’t compile a JUCE application with the OpenGL 3 pipeline built into the OpenGLContext on Windows.

This change to juce_opengl.h should allow it:

 #if JUCE_MINGW
  #include <GL/gl.h>
 #else
  #include <gl/GL.h>
  #define JUCE_OPENGL3 1 //Added this.
 #endif

I’ve only tested this on Windows 10 Pro x64, VS2015.

@jimc This might apply to you. Mind giving it a whirl?

Bump for anybody to test this out.

Hello !

Quick question, how can I detect if the OpenGL 3 pipeline is properly included ? I have done the change you suggested in a project using OpenGL (Windows 8.1 64 bits) and it still works like before

Fairly straightforward: you would have to debug into OpenGLContext::CachedImage and be sure it’s running with the VBO extensions.

OK, so it works as expected

So I suppose no luck in improving the speed of your plugin?

Awesome. Should be an easy add for the JUCE team after they give it a test.

I presume that was directed to IvanC?

Proposed change here.

Would this not break some people’s code who expect, for example, their shaders to be processed with pre opengl 3? Isn’t it safer to just specify this as a pre-processor macro in the .jucer file if you want to use Open GL 3?

Yes it would be great to be able to specify this as a preprocessor macro :wink: But anyway I’m not sure in 2017 anybody still does anything using a version of OpenGL < 3

Unfortunately, there are still classes that use OpenGL2, believe it or not…

Perhaps… even so it begs the question why a macro is used at all: the OpenGLContext class has a method specifically designed to specify the OpenGL version to use. In other words, the of lack of this macro on Windows circumvents OpenGLContext::setOpenGLVersionRequired, removing VBO support entirely.

1 Like