Windows & OpenGL 3 fix


#1

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?


#2

Bump for anybody to test this out.


#3

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


#4

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


#5

OK, so it works as expected


#6

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


#7

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


#8

I presume that was directed to IvanC?


#9

Proposed change here.


#10

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?


#11

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


#12

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


#13

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.


#14