OpenGL Access violation

Hello, I am following this (http://openglbook.com/the-book/chapter-2-vertices-and-shapes ) guide to teach myself OpenGL. I followed the second chapter very carfully (I only used diffrent identifiers for variables and objects), but when I run my code I get an access violation error. Here is the code snippet which seems to be causing the issue:
1
2
glGenVertexArrays(1, &g_vaoID);
glBindVertexArray(g_vaoID);
I am using VC++ and it is set up correctly because my code will compile and a OpenGL windows opens if I comment out those two lines. g_vaoID is initlized on this line: GLuint g_vertexShaderID, g_fragmentShaderID, g_programID, g_vaoID, g_vboID, g_colourBufferID; if it helps. Could anybody who has programmed with OpenGL or just knows what I am doing wrong please give me a hand? Thankyou
Last edited on
~the ")" is considered part of the url~

I don't know too much about OpenGL, but if those functions fail they should set an error code. Try placing some glGetError():
http://www.opengl.org/wiki/GLAPI/glGetError
and see if anything turns up. You'll have to see what errors each function might set via the openGl API.
Last edited on
They dont return an error. When I say an access violation, I mean the program crashes and VC++ starts debugging
Topic archived. No new replies allowed.