I’m writing a Batcher currently and having nothing displayed on the screen. I haven’t understood what’s the problem, I’ve rewritten the class more than a 20 times and still the same result. So I’ve tried using [icode]glGetError()[/icode] and put calls to it after every call to a opengl function and set break-points on those instances. The output said that there are errors when I’m updating the VBOs, so here is my code where I update my VBOs.
glBindBuffer(GL_ARRAY_BUFFER, vboVertID);
checkForErrors();
glBufferSubData(GL_ARRAY_BUFFER, 0, vBuffer);
checkForErrors();// Unacceptable value, Specified operation is not allowed in current state
glBindBuffer(GL_ARRAY_BUFFER, vboNormID);
checkForErrors();// Numeric argument is out of range
glBufferSubData(GL_ARRAY_BUFFER, 0, nBuffer);
checkForErrors();
glBindBuffer(GL_ARRAY_BUFFER, vboColID);
checkForErrors();// Numeric argument is out of range
glBufferSubData(GL_ARRAY_BUFFER, 0, cBuffer);
checkForErrors();
glBindBuffer(GL_ARRAY_BUFFER, vboTexID);
checkForErrors();// Numeric argument is out of range
glBufferSubData(GL_ARRAY_BUFFER, 0, tBuffer);
checkForErrors();
And my method to print the error messages is
public void checkForErrors()
{
int error = GL_NO_ERROR;
while ((error = glGetError()) != GL_NO_ERROR)
{
switch (error)
{
case GL_INVALID_ENUM:
System.err.println("An unacceptable value is specified for an enumerated argument.");
break;
case GL_INVALID_VALUE:
System.err.println("A numeric argument is out of range.");
break;
case GL_INVALID_OPERATION:
System.err.println("The specified operation is not allowed in the current state.");
break;
default:
System.err.println("Unknown OpenGL Error");
}
}
}
I’m now confused on where the error is. The complete class is here.
Thanks.