I am trying to learn how to program in opengl and am using this tutorial. Tutorial 1 works fine, tutorial 2 crashes with return 1.
It fails on this:
GLuint VertexArrayID;
glGenVertexArrays(1, &VertexArrayID);
glBindVertexArray(VertexArrayID);
Specifically:
glGenVertexArrays(1, &VertexArrayID);
Any suggestions? Also related but never solved OpenGL, FreeGlut and Glew crash with glGenVertexArrays call
After reading this thread it appears that calling
glewExperimental = GL_TRUE;
glewInit();
Would fix the problem. Reading up on glewExperiemental here, it says that
GLEW obtains information on the supported extensions from the graphics driver. Experimental or pre-release drivers, however, might not report every available extension through the standard mechanism, in which case GLEW will report it unsupported. To circumvent this situation, the glewExperimental global switch can be turned on by setting it to GL_TRUE before calling glewInit(), which ensures that all extensions with valid entry points will be exposed.
I'm not too sure how that helps with glGenVertexArrays, but it's worth the try
Update your glew to 2.0.0. This was caused by this bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With