OpenGL and glew

I’ve been trying to figure out the best way to go about using the newer OpenGL Api’s under Juce on Windows. By default apparently only the header for OpenGL 1 is in the search path. So, if I try to use the macros for shaders for example, i.e. GL_FRAGMENT_SHADER GL_VERTEX_SHADER, they’re not found. I’ve been reading about this online, and some people recommend creating a glext.h file with these macros while others recommend using glew. I’ve tried both and have not been happy with either. glext.h has all kinds of naming clashes with Juce classes, and glew seems to define its own versions of some methods like glVertexAttribPointer and I’m getting inexplicable null pointers when calling into these methods. I was wondering what other people are doing who are using shaders on Windows.

It seems like the null pointers I was having when using glew were due to my not calling glewInit() in newOpenGLContextCreated().


I have avoided using any other of the GL add-on libs because i wanted to have things work under windows and Android and didnt want to port them.

I had to add a bunch of new functions into `juceOpenGLExtentions.h’ for vertex arrays and include gl2ext.h. Also binding the extension functions is nasty.