PDA

View Full Version : weird opengl error problem



Spiral Man
10-20-2001, 11:58 AM
ok, this is kinda a weird error, and its not that important, but i thought id ask anyway. first, the code im using to grab and output the latest opengl error:

error=glGetError();
if ( error != GL_NO_ERROR);
{
errorstring=gluErrorString(error);
fprintf(stderr, "OpenGL error: %s\n", errorstring);
}

seems simple enough (i ripped it from the red book), but every time that bit of code is run, it outputs the error string, even when the error is "no error." id rather it not do this. can anybody see anything wrong with this?

thanks

Tron
10-20-2001, 10:24 PM
error=glGetError();
if ( error != GL_NO_ERROR); // delete the ;
{
// that's no error, but i'd write:
// fprintf(stderr, "OpenGL error: %s\n", gluErrorString(error));
// or cerr << "OpenGL error: " << gluErrorString(error) << '\n';
errorstring=gluErrorString(error);
fprintf(stderr, "OpenGL error: %s\n", errorstring);
}

Spiral Man
10-21-2001, 08:04 AM
ok, thats very embarasing...

sorry, and thanks...