Buffer checking code

This commit is contained in:
Caspian Rychlik-Prince 2004-02-15 19:41:51 +00:00
parent fd56dd232a
commit 061e1a76d1
51 changed files with 499 additions and 655 deletions

View file

@ -39,7 +39,6 @@
*/
package org.lwjgl.opengl;
import java.nio.BufferUnderflowException;
import java.nio.FloatBuffer;
public class ARBTransposeMatrix {
@ -47,26 +46,15 @@ public class ARBTransposeMatrix {
public static final int GL_TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4;
public static final int GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5;
public static final int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6;
static {
BufferChecks.putGetMap(GL_TRANSPOSE_MODELVIEW_MATRIX_ARB, 16);
BufferChecks.putGetMap(GL_TRANSPOSE_PROJECTION_MATRIX_ARB, 16);
BufferChecks.putGetMap(GL_TRANSPOSE_TEXTURE_MATRIX_ARB, 16);
BufferChecks.putGetMap(GL_TRANSPOSE_COLOR_MATRIX_ARB, 16);
}
public static void glLoadTransposeMatrixARB(FloatBuffer pfMtx) {
if (pfMtx.remaining() < 16) {
throw new BufferUnderflowException();
}
BufferChecks.checkBuffer(pfMtx);
nglLoadTransposeMatrixfARB(pfMtx, pfMtx.position());
}
private static native void nglLoadTransposeMatrixfARB(FloatBuffer pfMtx, int pfMtx_offset);
public static void glMultTransposeMatrixfARB(FloatBuffer pfMtx) {
if (pfMtx.remaining() < 16) {
throw new BufferUnderflowException();
}
BufferChecks.checkBuffer(pfMtx);
nglMultTransposeMatrixfARB(pfMtx, pfMtx.position());
}
private static native void nglMultTransposeMatrixfARB(FloatBuffer pfMtx, int pfMtx_offset);