glCreateShader(GL_VERTEX_SHADER) invalid enumerant

I’ve got a simple OpenGL app running, and as I was working towards getting some geometry shaders up and running I realized I wanted to make sure I was getting a 4.1 core profile context. This is my OpenGL initialization code:


	glutInitContextVersion(4, 1);
	glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
	glutInitContextProfile(GLUT_CORE_PROFILE);

Regardless of if I keep the GLUT_FORWARD_COMPATIBLE in there, glCreateShader(GL_VERTEX_SHADER) is causing an Invalid Enumerant error. Can anyone point me in the right direction as to why I can’t even create a 4.1 core profile vertex shader? I have the latest drivers, the latest versions of freeglut/glew, and my graphics card is a GeForce GTX 560.

If I recall, GLEW has some problems with core profiles. I don’t remember exactly what it was, but I know they have an issue with them.

Indeed it seems GLEW will not work with OpenGL core profiles (certainly not 3 or 4); looks like I’m ditching glew.

add:
“glewExperimental = GL_TRUE;”
before glewInit

BTW do you use GLEW? FreeGLUT is not enought to have api of opengl loaded! (on Win you need to load pointer to every OpenGL function from .dll, use GLEW to make it 2 lines of code)

BTW do you use GLEW? FreeGLUT is not enought to have api of opengl loaded! (on Win you need to load pointer to every OpenGL function from .dll, use GLEW to make it 2 lines of code)

Or you could use an extension loader that can tell the difference between core and compatibility without some kind of “experimental” hack. GLEW isn’t the only extension loader in the world, you know.

Yes, there are a few extension loaders
http://www.opengl.org/wiki/Extension_Loading_Library