public class IndexByteBuffer extends IndexBuffer
ByteBuffers.| Constructor and Description |
|---|
IndexByteBuffer(java.nio.ByteBuffer buffer)
Instantiate an IndexBuffer using the specified ByteBuffer and a maximum
index value of 255.
|
IndexByteBuffer(java.nio.ByteBuffer buffer,
int maxValue)
Instantiate an IndexBuffer using the specified ByteBuffer and set its
maximum index value.
|
| Modifier and Type | Method and Description |
|---|---|
int |
get()
Returns the vertex index for the current position.
|
int |
get(int i)
Returns the vertex index for the given index in the index buffer.
|
java.nio.Buffer |
getBuffer()
Returns the underlying data-type specific
Buffer. |
VertexBuffer.Format |
getFormat()
Returns the format of the data stored in this buffer.
|
IndexByteBuffer |
put(int value)
Relative put method.
|
IndexByteBuffer |
put(int i,
int value)
Absolute put method.
|
int |
size()
Returns the size of the index buffer.
|
createIndexBuffer, remaining, rewind, wrapIndexBufferpublic IndexByteBuffer(java.nio.ByteBuffer buffer)
buffer - a pre-existing buffer (not null, alias created)public IndexByteBuffer(java.nio.ByteBuffer buffer,
int maxValue)
buffer - a pre-existing buffer (not null, alias created)maxValue - the desired maximum index value (≥0, ≤255)public int get()
IndexBufferget in class IndexBufferpublic int get(int i)
IndexBufferget in class IndexBufferi - The index inside the index bufferpublic IndexByteBuffer put(int i, int value)
IndexBufferPuts the vertex index at the index buffer's index.
Implementations may throw an UnsupportedOperationException
if modifying the IndexBuffer is not supported (e.g. virtual index
buffers).
put in class IndexBufferi - The buffer indexvalue - The vertex indexpublic IndexByteBuffer put(int value)
IndexBufferPuts the vertex index at the current position, then increments the
position. Implementations may throw an
UnsupportedOperationException if modifying the IndexBuffer is not
supported (e.g. virtual index buffers).
put in class IndexBuffervalue - The vertex indexpublic int size()
IndexBuffersize in class IndexBufferpublic java.nio.Buffer getBuffer()
IndexBufferBuffer.
Implementations may return null if there's no underlying
buffer.getBuffer in class IndexBufferBuffer.public VertexBuffer.Format getFormat()
IndexBufferThis method can be used to set an IndexBuffer to a
Mesh:
mesh.setBuffer(Type.Index, 3,
indexBuffer.getFormat(), indexBuffer);
getFormat in class IndexBuffer