mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-06 06:53:59 +00:00
New buffer bounds checking code. Incomplete.
This commit is contained in:
parent
6839a17408
commit
10dd32bb95
7 changed files with 563 additions and 38 deletions
|
|
@ -41,7 +41,9 @@ import java.nio.*;
|
|||
*/
|
||||
|
||||
abstract class Util {
|
||||
private final static IntBuffer int_buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
|
||||
|
||||
final static IntBuffer int_buffer = ByteBuffer.allocateDirect(16).order(ByteOrder.nativeOrder()).asIntBuffer();
|
||||
|
||||
/**
|
||||
* A helper function which is used to get the byte offset in an arbitrary buffer
|
||||
* based on its position
|
||||
|
|
@ -62,4 +64,22 @@ abstract class Util {
|
|||
GL11.glGetInteger(gl_enum, int_buffer);
|
||||
return int_buffer.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handy mutable integer value class
|
||||
*/
|
||||
static final class IntValue {
|
||||
int value;
|
||||
IntValue(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
public boolean equals(Object obj) {
|
||||
return ((IntValue) obj).value == value;
|
||||
}
|
||||
public int hashCode() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue