public class IndexShortBuffer extends IndexBuffer
ShortBuffer
s.Constructor and Description |
---|
IndexShortBuffer(java.nio.ShortBuffer buffer)
Instantiate an IndexBuffer using the specified ShortBuffer and a maximum
index value of 65_535.
|
IndexShortBuffer(java.nio.ShortBuffer buffer,
int maxValue)
Instantiate an IndexBuffer using the specified ShortBuffer 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.
|
IndexShortBuffer |
put(int value)
Relative put method.
|
IndexShortBuffer |
put(int i,
int value)
Absolute put method.
|
int |
size()
Returns the size of the index buffer.
|
createIndexBuffer, remaining, rewind, wrapIndexBuffer
public IndexShortBuffer(java.nio.ShortBuffer buffer)
buffer
- a pre-existing buffer (not null, alias created)public IndexShortBuffer(java.nio.ShortBuffer buffer, int maxValue)
buffer
- a pre-existing buffer (not null, alias created)maxValue
- the desired maximum index value (≥0, ≤65_535)public int get()
IndexBuffer
get
in class IndexBuffer
public int get(int i)
IndexBuffer
get
in class IndexBuffer
i
- The index inside the index bufferpublic IndexShortBuffer put(int i, int value)
IndexBuffer
Puts 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 IndexBuffer
i
- The buffer indexvalue
- The vertex indexpublic IndexShortBuffer put(int value)
IndexBuffer
Puts 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 IndexBuffer
value
- The vertex indexpublic int size()
IndexBuffer
size
in class IndexBuffer
public java.nio.Buffer getBuffer()
IndexBuffer
Buffer
.
Implementations may return null if there's no underlying
buffer.getBuffer
in class IndexBuffer
Buffer
.public VertexBuffer.Format getFormat()
IndexBuffer
This method can be used to set an IndexBuffer
to a
Mesh
:
mesh.setBuffer(Type.Index, 3, indexBuffer.getFormat(), indexBuffer);
getFormat
in class IndexBuffer