|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.badlogic.gdx.graphics.glutils.IndexArray
public class IndexArray
Constructor Summary | |
---|---|
IndexArray(int maxIndices)
Creates a new IndexArray to be used with vertex arrays. |
Method Summary | |
---|---|
void |
bind()
Binds this IndexArray for rendering with glDrawElements. |
void |
dispose()
Disposes this IndexArray and all its associated OpenGL resources. |
ShortBuffer |
getBuffer()
Returns the underlying ShortBuffer. |
int |
getNumIndices()
|
int |
getNumMaxIndices()
|
void |
invalidate()
Invalidates the IndexArray so a new OpenGL buffer handle is created. |
void |
setIndices(short[] indices,
int offset,
int count)
Sets the indices of this IndexArray, discarding the old indices. |
void |
unbind()
Unbinds this IndexArray. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexArray(int maxIndices)
maxIndices
- the maximum number of indices this buffer can holdMethod Detail |
---|
public int getNumIndices()
getNumIndices
in interface IndexData
public int getNumMaxIndices()
getNumMaxIndices
in interface IndexData
public void setIndices(short[] indices, int offset, int count)
Sets the indices of this IndexArray, discarding the old indices. The count must equal the number of indices to be copied to this IndexArray.
This can be called in between calls to bind()
and unbind()
. The index data will be updated instantly.
setIndices
in interface IndexData
indices
- the vertex dataoffset
- the offset to start copying the data fromcount
- the number of shorts to copypublic ShortBuffer getBuffer()
Returns the underlying ShortBuffer. If you modify the buffer contents they wil be uploaded on the call to bind()
.
If you need immediate uploading use setIndices(short[], int, int)
.
getBuffer
in interface IndexData
public void bind()
bind
in interface IndexData
public void unbind()
unbind
in interface IndexData
public void invalidate()
invalidate
in interface IndexData
public void dispose()
dispose
in interface IndexData
dispose
in interface Disposable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |