VertexBufferObjectSubData class. Sets the glVertexAttribDivisor for every VertexAttribute
automatically.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final VertexAttributes | |
| pack-priv final FloatBuffer | |
| pack-priv int | |
| pack-priv final ByteBuffer | |
| pack-priv boolean | |
| pack-priv final boolean | |
| pack-priv boolean | |
| pack-priv final boolean | |
| pack-priv final int |
| Access | Constructor and Description |
|---|---|
| public | InstanceBufferObjectSubData(boolean
whether the vertex data is static. isStatic, int the maximum number of vertices numInstances, VertexAttribute... the instanceAttributes)VertexAttributes.Constructs a new interleaved InstanceBufferObject. |
| public | InstanceBufferObjectSubData(boolean
whether the vertex data is static. isStatic, int the maximum number of vertices numInstances, VertexAttributes the instanceAttributes)VertexAttributes.Constructs a new interleaved InstanceBufferObject. |
| Modifier and Type | Method and Description |
|---|---|
| public void | bind(final ShaderProgram
the shader shader)Implements com. Binds this InstanceBufferObject for rendering via glDrawArraysInstanced or glDrawElementsInstanced |
| public void | bind(final ShaderProgram shader, final int[] locations)
Implements com. Binds this InstanceData for rendering via glDrawArraysInstanced or glDrawElementsInstanced. |
| private void | |
| private int | |
| public void | dispose()
Implements com. Disposes of all resources this InstanceBufferObject uses. |
| public VertexAttributes | |
| public FloatBuffer | getBuffer()
Implements com.
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 | getBuffer(boolean forWriting)
Implements com. Returns the underlying FloatBuffer for reading or writing. |
| public int | |
| public int | Returns: number of instances in this bufferImplements com. Effectively returns |
| public int | Returns: maximum number of instances in this bufferImplements com. Effectively returns |
| public void | invalidate()
Implements com. Invalidates the InstanceBufferObject so a new OpenGL buffer handle is created. |
| public void | setInstanceData(float[] data, int offset, int count)
Implements com. Sets the vertices of this InstanceData, discarding the old vertex data. |
| public void | setInstanceData(FloatBuffer data, int count)
Implements com. Sets the vertices of this InstanceData, discarding the old vertex data. |
| public void | unbind(final ShaderProgram
the shader shader)Implements com. Unbinds this InstanceBufferObject. |
| public void | unbind(final ShaderProgram shader, final int[] locations)
Implements com. Unbinds this InstanceData. |
| public void | updateInstanceData(int targetOffset, float[] data, int sourceOffset, int count)
Implements com. Update (a portion of) the vertices. |
| public void | updateInstanceData(int targetOffset, FloatBuffer data, int sourceOffset, int count)
Implements com. Update (a portion of) the vertices. |
| attributes | back to summary |
|---|---|
| pack-priv final VertexAttributes attributes | |
| buffer | back to summary |
|---|---|
| pack-priv final FloatBuffer buffer | |
| bufferHandle | back to summary |
|---|---|
| pack-priv int bufferHandle | |
| byteBuffer | back to summary |
|---|---|
| pack-priv final ByteBuffer byteBuffer | |
| isBound | back to summary |
|---|---|
| pack-priv boolean isBound | |
| isDirect | back to summary |
|---|---|
| pack-priv final boolean isDirect | |
| isDirty | back to summary |
|---|---|
| pack-priv boolean isDirty | |
| isStatic | back to summary |
|---|---|
| pack-priv final boolean isStatic | |
| usage | back to summary |
|---|---|
| pack-priv final int usage | |
| InstanceBufferObjectSubData | back to summary |
|---|---|
| public InstanceBufferObjectSubData(boolean isStatic, int numInstances, VertexAttribute... instanceAttributes) Constructs a new interleaved InstanceBufferObject.
| |
| InstanceBufferObjectSubData | back to summary |
|---|---|
| public InstanceBufferObjectSubData(boolean isStatic, int numInstances, VertexAttributes instanceAttributes) Constructs a new interleaved InstanceBufferObject.
| |
| bind | back to summary |
|---|---|
| public void bind(final ShaderProgram shader) Implements com. Binds this InstanceBufferObject for rendering via glDrawArraysInstanced or glDrawElementsInstanced
| |
| bind | back to summary |
|---|---|
| public void bind(final ShaderProgram shader, final int[] locations) Implements com. Doc from com. Binds this InstanceData for rendering via glDrawArraysInstanced or glDrawElementsInstanced.
| |
| bufferChanged | back to summary |
|---|---|
| private void bufferChanged() | |
| createBufferObject | back to summary |
|---|---|
| private int createBufferObject() | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements com. Disposes of all resources this InstanceBufferObject uses.
| |
| getAttributes | back to summary |
|---|---|
| public VertexAttributes getAttributes() Implements com.
| |
| getBuffer | back to summary |
|---|---|
| public FloatBuffer getBuffer() Implements com. Doc from com. 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) Implements com. Doc from com. Returns the underlying FloatBuffer for reading or writing.
| |
| getBufferHandle | back to summary |
|---|---|
| public int getBufferHandle() Returns the InstanceBufferObject handle
| |
| getNumInstances | back to summary |
|---|---|
| public int getNumInstances() Implements com. Effectively returns
| |
| getNumMaxInstances | back to summary |
|---|---|
| public int getNumMaxInstances() Implements com. Effectively returns
| |
| invalidate | back to summary |
|---|---|
| public void invalidate() Implements com. Invalidates the InstanceBufferObject so a new OpenGL buffer handle is created. Use this in case of a context loss. | |
| setInstanceData | back to summary |
|---|---|
| public void setInstanceData(float[] data, int offset, int count) Implements com. Doc from com. 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) Implements com. Doc from com. 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(final ShaderProgram shader) Implements com. Unbinds this InstanceBufferObject.
| |
| unbind | back to summary |
|---|---|
| public void unbind(final ShaderProgram shader, final int[] locations) Implements com. Doc from com. Unbinds this InstanceData.
| |
| updateInstanceData | back to summary |
|---|---|
| public void updateInstanceData(int targetOffset, float[] data, int sourceOffset, int count) Implements com. Doc from com. 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) Implements com. Doc from com. Update (a portion of) the vertices. Does not resize the backing buffer.
| |