Hello.
I’m simply trying to draw 1 triangle with a mixed VBO like this:
glGenVertexArrays(1, &VAO);
glBindVertexArray(VAO);
static const GLfloat vrtClrB[] =
{
0.0f, 0.0f, 0.3f, 0.1f, 0.6f,
0.5f, 0.0f, 0.3f, 0.6f, 0.1f,
0.5f, 0.5f, 0.333f, 0.333f, 0.333f
};
glGenBuffers(1, &VBO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(vrtClrB), vrtClrB, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(GLfloat), (const void*)0); // 2D position
glEnableVertexAttribArray(1);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (const void*)(2 * sizeof(GLfloat))); // color
after which I continuously call
glDrawArrays(GL_TRIANGLES, 0, 3);
I’m using MSVS 2013 and it throws an unhandled exception in nvoglv64.dll.
The shaders compile and link just fine.
I just can’t see what I’m missing.