Added gluErrorString

This commit is contained in:
Elias Naur 2004-03-21 08:13:07 +00:00
parent eeb01b8da5
commit 09e51d6bed
3 changed files with 41 additions and 1 deletions

View file

@ -32,6 +32,8 @@
package org.lwjgl.opengl;
import org.lwjgl.opengl.glu.GLU;
/**
* $Id$
*
@ -47,7 +49,12 @@ public class OpenGLException extends RuntimeException {
* Constructor for OpenGLException.
*/
public OpenGLException(int gl_error_code) {
super("GL error code: " + gl_error_code);
this(createErrorMessage(gl_error_code));
}
private final static String createErrorMessage(int gl_error_code) {
String error_string = GLU.gluErrorString(gl_error_code);
return error_string + " (" + gl_error_code + ")";
}
/**