Implemented safe VBO indices (phew)

This commit is contained in:
Elias Naur 2003-08-04 23:00:49 +00:00
parent e6cca3fda8
commit 35a1538f82
24 changed files with 821 additions and 100 deletions

View file

@ -40,6 +40,7 @@ import java.nio.*;
* @version $Revision$
*/
abstract class Util {
private final static IntBuffer int_buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
/**
* A helper function which is used to get the byte offset in an arbitrary buffer
* based on its position
@ -55,4 +56,9 @@ abstract class Util {
else
return buffer.position();
}
static int getGLInteger(int enum) {
CoreGL11.glGetInteger(enum, int_buffer);
return int_buffer.get(0);
}
}