public interface VertexData extends Disposable
VertexArray
or a
VertexBufferObject
. Only the later supports OpenGL ES 2.0.Modifier and Type | Method and Description |
---|---|
void |
bind(ShaderProgram shader)
Binds this VertexData for rendering via glDrawArrays or glDrawElements.
|
void |
bind(ShaderProgram shader,
int[] locations)
Binds this VertexData for rendering via glDrawArrays or glDrawElements.
|
void |
dispose()
Disposes this VertexData and all its associated OpenGL resources.
|
VertexAttributes |
getAttributes() |
FloatBuffer |
getBuffer()
Returns the underlying FloatBuffer.
|
int |
getNumMaxVertices() |
int |
getNumVertices() |
void |
invalidate()
Invalidates the VertexData if applicable.
|
void |
setVertices(float[] vertices,
int offset,
int count)
Sets the vertices of this VertexData, discarding the old vertex data.
|
void |
unbind(ShaderProgram shader)
Unbinds this VertexData.
|
void |
unbind(ShaderProgram shader,
int[] locations)
Unbinds this VertexData.
|
void |
updateVertices(int targetOffset,
float[] vertices,
int sourceOffset,
int count)
Update (a portion of) the vertices.
|
int getNumVertices()
int getNumMaxVertices()
VertexAttributes getAttributes()
VertexAttributes
as specified during construction.void setVertices(float[] vertices, int offset, int count)
VertexAttributes
.
This can be called in between calls to bind and unbind. The vertex data will be updated instantly.
vertices
- the vertex dataoffset
- the offset to start copying the data fromcount
- the number of floats to copyvoid updateVertices(int targetOffset, float[] vertices, int sourceOffset, int count)
vertices
- the vertex datasourceOffset
- the offset to start copying the data fromcount
- the number of floats to copyFloatBuffer getBuffer()
setVertices(float[], int, int)
;void bind(ShaderProgram shader)
void bind(ShaderProgram shader, int[] locations)
locations
- array containing the attribute locations.void unbind(ShaderProgram shader)
void unbind(ShaderProgram shader, int[] locations)
locations
- array containing the attribute locations.void invalidate()
void dispose()
dispose
in interface Disposable
Copyright © 2014. All rights reserved.