Replaced asserts with proper runtime exceptions

This commit is contained in:
Elias Naur 2004-03-27 11:55:07 +00:00
parent afb8491cfa
commit c093f3ace1
11 changed files with 1058 additions and 1013 deletions

View file

@ -67,7 +67,7 @@ public final class ARBVertexShader {
// ---------------------------
public static void glBindAttribLocationARB(int programObj, int index, ByteBuffer name) {
if ( name.get(name.limit() - 1) != 0 ) {
throw new RuntimeException("<name> must be a null-terminated string.");
throw new IllegalArgumentException("<name> must be a null-terminated string.");
}
nglBindAttribLocationARB(programObj, index, name, name.position());
}
@ -99,7 +99,7 @@ public final class ARBVertexShader {
// ---------------------------
public static int glGetAttribLocationARB(int programObj, ByteBuffer name) {
if ( name.get(name.limit() - 1) != 0 ) {
throw new RuntimeException("<name> must be a null-terminated string.");
throw new IllegalArgumentException("<name> must be a null-terminated string.");
}
return nglGetAttribLocationARB(programObj, name, name.position());
}
@ -107,4 +107,4 @@ public final class ARBVertexShader {
private static native int nglGetAttribLocationARB(int programObj, ByteBuffer name, int nameOffset);
// ---------------------------
}
}