|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface VertexData
A VertexData instance holds vertices for rendering with OpenGL. It is implemented as either a VertexArray
or a
VertexBufferObject
. Only the later supports OpenGL ES 2.0.
Method Summary | |
---|---|
void |
bind()
Binds this VertexData for rendering via glDrawArrays or glDrawElements. |
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 |
setVertices(float[] vertices,
int offset,
int count)
Sets the vertices of this VertexData, discarding the old vertex data. |
void |
unbind()
Unbinds this VertexData. |
void |
unbind(ShaderProgram shader)
Unbinds this VertexData. |
void |
unbind(ShaderProgram shader,
int[] locations)
Unbinds this VertexData. |
Method Detail |
---|
int getNumVertices()
int getNumMaxVertices()
VertexAttributes getAttributes()
VertexAttributes
as specified during construction.void setVertices(float[] vertices, int offset, int count)
Sets the vertices of this VertexData, 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 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 copyFloatBuffer getBuffer()
Returns the underlying FloatBuffer. If you modify the buffer contents they will be uploaded on the next call to
bind()
. If you need immediate uploading use setVertices(float[], int, int)
;
void bind()
void unbind()
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 dispose()
dispose
in interface Disposable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |