public class IndexBuffer
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
IndexBuffer(java.nio.Buffer dataBuffer)
Instantiate an IndexBuffer by wrapping the specified data buffer.
|
protected |
IndexBuffer(int maxVertices,
int capacity)
Instantiate an IndexBuffer with a new direct, writable data buffer.
|
| Modifier and Type | Method and Description |
|---|---|
java.nio.Buffer |
copyBuffer()
Copy all the indices to a new direct buffer.
|
static IndexBuffer |
createIndexBuffer(int maxVertices,
int capacity)
Create a mutable IndexBuffer with a new direct data buffer.
|
protected int |
get()
Read an index from the current read/write position, then increment the
position.
|
int |
get(int position)
Read an index from the specified buffer position.
|
protected java.nio.Buffer |
getBuffer()
Access the buffer data.
|
boolean |
isDirect()
Test whether the buffer is direct.
|
IndexBuffer |
limit(int newLimit)
Alter the limit.
|
protected IndexBuffer |
makeImmutable()
Make the buffer immutable.
|
protected IndexBuffer |
put(int index)
Write the specified index at the current read/write position, then
increment the position.
|
IndexBuffer |
put(int position,
int index)
Write the specified index at the specified buffer position.
|
int |
size()
Return the buffer's limit.
|
protected void |
verifyMutable()
Verify that the buffer is still mutable.
|
static IndexBuffer |
wrapIndexBuffer(java.nio.Buffer dataBuffer)
Create a mutable IndexBuffer by wrapping the specified data buffer.
|
protected IndexBuffer(java.nio.Buffer dataBuffer)
dataBuffer - the data buffer to wrap (a ByteBuffer or ShortBuffer or
IntBuffer, alias created)protected IndexBuffer(int maxVertices,
int capacity)
maxVertices - one more than the highest index value (≥1)capacity - number of indices (≥0)public java.nio.Buffer copyBuffer()
public static IndexBuffer createIndexBuffer(int maxVertices, int capacity)
maxVertices - one more than the highest index value (≥1)capacity - number of indices (≥0)public int get(int position)
position - the position from which to read (≥0, <limit)public boolean isDirect()
true if direct, otherwise falsepublic IndexBuffer limit(int newLimit)
newLimit - the desired limit position (≥0, ≤capacity);public IndexBuffer put(int position, int index)
position - the position to write to (≥0, <limit)index - the index to be written (≥0, <numVertices)public int size()
public static IndexBuffer wrapIndexBuffer(java.nio.Buffer dataBuffer)
dataBuffer - the data buffer to wrap (not null, a ByteBuffer or
ShortBuffer or IntBuffer, alias created)protected int get()
protected java.nio.Buffer getBuffer()
protected IndexBuffer makeImmutable()
protected IndexBuffer put(int index)
index - the index to be written (≥0, <numVertices)protected void verifyMutable()