Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: GL_INVALID_VALUE, when using SaveGLStates  (Read 1874 times)

0 Members and 1 Guest are viewing this topic.

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
GL_INVALID_VALUE, when using SaveGLStates
« on: November 17, 2011, 07:17:32 pm »
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:
Quote

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):

Code: [Select]
GLCheck(glPushAttrib(GL_ALL_ATTRIB_BITS));

The last thing I do before calling saveStates is:

Code: [Select]
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);

}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
GL_INVALID_VALUE, when using SaveGLStates
« Reply #1 on: November 17, 2011, 07:25:57 pm »
I have no idea. GL_INVALID_VALUE doesn't even appear in the list of possible errors for glPushAttrib.
Laurent Gomila - SFML developer

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
GL_INVALID_VALUE, when using SaveGLStates
« Reply #2 on: November 17, 2011, 07:37:40 pm »
In that case it must be something to do with my OpenGL, i do have a suspicion that its to do with the shaders or somehting.