InstanceBufferObject or a InstanceBufferObjectSubData. Both require Open GL 3.3+.
| Modifier and Type | Method and Description |
|---|---|
| public void | bind(ShaderProgram shader)
Binds this InstanceData for rendering via glDrawArraysInstanced or glDrawElementsInstanced. |
| public void | bind(ShaderProgram shader, int[]
array containing the attribute locations. locations)Binds this InstanceData for rendering via glDrawArraysInstanced or glDrawElementsInstanced. |
| public void | dispose()
Redeclares com. Disposes this InstanceData and all its associated OpenGL resources. |
| public VertexAttributes | |
| public FloatBuffer | Returns: the underlying FloatBuffer holding the vertex data.
Deprecated
use
getBuffer(boolean) instead
Returns the underlying FloatBuffer and marks it as dirty, causing the buffer contents to be uploaded on the next call to bind. |
| public FloatBuffer | Returns: the underlying FloatBuffer holding the vertex data.when true, the underlying buffer will be uploaded on the next call to bind. If you need immediate
uploading use forWriting)setInstanceData(float[], int, int).Returns the underlying FloatBuffer for reading or writing. |
| public int | |
| public int | |
| public void | |
| public void | setInstanceData(float[]
the instance data data, int the offset to start copying the data from offset, int the number of floats to copy count)Sets the vertices of this InstanceData, discarding the old vertex data. |
| public void | setInstanceData(FloatBuffer
the instance data data, int the number of floats to copy count)Sets the vertices of this InstanceData, discarding the old vertex data. |
| public void | |
| public void | unbind(ShaderProgram shader, int[]
array containing the attribute locations. locations)Unbinds this InstanceData. |
| public void | updateInstanceData(int targetOffset, float[]
the instance data data, int the offset to start copying the data from sourceOffset, int the number of floats to copy count)Update (a portion of) the vertices. |
| public void | updateInstanceData(int targetOffset, FloatBuffer
the vertex data data, int the offset to start copying the data from sourceOffset, int the number of floats to copy count)Update (a portion of) the vertices. |
| bind | back to summary |
|---|---|
| public void bind(ShaderProgram shader) Binds this InstanceData for rendering via glDrawArraysInstanced or glDrawElementsInstanced. | |
| bind | back to summary |
|---|---|
| public void bind(ShaderProgram shader, int[] locations) Binds this InstanceData for rendering via glDrawArraysInstanced or glDrawElementsInstanced.
| |
| dispose | back to summary |
|---|---|
| public void dispose() Redeclares com. Disposes this InstanceData and all its associated OpenGL resources. | |
| getAttributes | back to summary |
|---|---|
public VertexAttributes getAttributes()
| |
| getBuffer | back to summary |
|---|---|
| public FloatBuffer getBuffer()
Deprecated use Returns the underlying FloatBuffer and marks it as dirty, causing the buffer contents to be uploaded on the next call to
bind. If you need immediate uploading use
| |
| getBuffer | back to summary |
|---|---|
| public FloatBuffer getBuffer(boolean forWriting) Returns the underlying FloatBuffer for reading or writing.
| |
| getNumInstances | back to summary |
|---|---|
public int getNumInstances()
| |
| getNumMaxInstances | back to summary |
|---|---|
public int getNumMaxInstances()
| |
| invalidate | back to summary |
|---|---|
| public void invalidate() Invalidates the InstanceData if applicable. Use this in case of a context loss. | |
| setInstanceData | back to summary |
|---|---|
| public void setInstanceData(float[] data, int offset, int count) Sets the vertices of this InstanceData, discarding the old vertex data. The count must equal the number of floats per
vertex times the number of vertices to be copied to this VertexData. The order of the vertex attributes must be the same as
specified at construction time via This can be called in between calls to bind and unbind. The vertex data will be updated instantly.
| |
| setInstanceData | back to summary |
|---|---|
| public void setInstanceData(FloatBuffer data, int count) Sets the vertices of this InstanceData, discarding the old vertex data. The count must equal the number of floats per
vertex times the number of vertices to be copied to this InstanceData. The order of the vertex attributes must be the same
as specified at construction time via This can be called in between calls to bind and unbind. The vertex data will be updated instantly.
| |
| unbind | back to summary |
|---|---|
| public void unbind(ShaderProgram shader) Unbinds this InstanceData. | |
| unbind | back to summary |
|---|---|
| public void unbind(ShaderProgram shader, int[] locations) Unbinds this InstanceData.
| |
| updateInstanceData | back to summary |
|---|---|
| public void updateInstanceData(int targetOffset, float[] data, int sourceOffset, int count) Update (a portion of) the vertices. Does not resize the backing buffer.
| |
| updateInstanceData | back to summary |
|---|---|
| public void updateInstanceData(int targetOffset, FloatBuffer data, int sourceOffset, int count) Update (a portion of) the vertices. Does not resize the backing buffer.
| |