PDA

View Full Version : glVertexAttribPointer causes INVALID_VALUE error in OpenGL 4.0?



JoshKlint
05-31-2013, 02:36 PM
I'm porting some code to OpenGL 4, and have run into trouble with my vertex buffers. My same OpenGL 2 code is producing an INVALID_VALUE error after a call to glVertexAttribPointer().

At the beginning of my program, I set up one vertex array object to be shared across vertex buffers:


GLuint vao;
glGenVertexArrays(1,&vao);
glBindVertexArray(vao);

And then my code to enable the vertex buffer looks like this:

glBindBuffer(GL_ARRAY_BUFFER,buffer);
glEnableVertexAttribArray((GLuint)target);
glVertexAttribPointer((GLuint)target,coordinates,g ltype,normalize,0,NULL);

Are there any common known issues when transitioning from OpenGL 2 to OpenGL 4 that could explain this? Thanks.

JoshKlint
05-31-2013, 02:51 PM
Ah. I think the problem was that vertex array objects are not shared across contexts.

tonyo_au
05-31-2013, 08:26 PM
vertex array objects are not shared across contexts
I believe that is correct.