Contents / Previous / Next


GLU: Error Handling

gluErrorString produces an error string from an OpenGL or GLU error code.
  const GLubyte* gluErrorString( GLenum errorCode )
errorCode specifies an OpenGL or GLU error code.
The string is in an ISO Latin 1 format.
For example, gluErrorString(GL_OUT_OF_MEMORY) returns the string out of memory.

glGetError returns the value of the error flag as error code:

  GLenum glGetError( void )
Example:
 int errorCode = gl.glGetError();
 String errorStr = glu.gluErrorString( errorCode );
 System.out.println( errorStr );
 System.out.println( errorCode );