Im using SFML 2.0 and im trying to use pure OpenGL with SFML stuff
however when I draw stuff and then use SaveGLStatess I get an error:
An internal OpenGL call failed in Renderer.cpp (77) : GL_INVALID_VALUE, a numeric argument is out of range
Renderer.cpp 77 is(first line in SaveGLStates):
GLCheck(glPushAttrib(GL_ALL_ATTRIB_BITS));
The last thing I do before calling saveStates is:
void d3Sprite::Draw()
{
glEnableVertexAttribArray(positionID);
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
glVertexAttribPointer(
positionID,
3, // size
GL_FLOAT, // type
GL_FALSE, // normalized?
0, // stride
(void*)0 // array buffer offset
);
glUseProgram(shader.shaderID);
glUniformMatrix4fv(MatrixID, 1, GL_FALSE, &MVP[0][0]);
// Draw the triangle !
glDrawArrays(GL_TRIANGLES, 0, 6); // Starting from vertex 0; 6 vertices total -> 2 triangles
glDisableVertexAttribArray(positionID);
}