Construct a VertexArray.
Destroy the VertexArray.
Possible states a VertexArray can be in.
Bind the VertexArray for drawing. Must be called before drawing. VertexArray must be locked.
Get the maximum number of vertices the VertexArray can hold.
Clear the VertexArray, deleting all vertices.
Get direct access to vertices in the VertexArray.
Draw vertices from the VertexArray directly, without using indices.
Is the VertexArray empty (no vertices) ?
Get the current number of vertices in the VertexArray.
Manually set the length of the VertexArray.
Lock the buffer.
Add a vertex to the VertexArray.
Release the buffer after drawing.
Unlock the buffer.
A wrapper around GL Vertex Attribute Object that also manages its vertex storage.
Acts as a dynamic array of vertex type V.
V must be a plain-old-data struct where each member is either a gl3n Vector (such as vec3) or a scalar number (such as float).
Example vertex type:
Vertex attributes must be either one of the following types: float, double, byte, short, int, ubyte, ushort, uint or a 4 or less dimensional gl3n.linalg.Vector with type parameter set to one of listed types. Note that by default, attributes with integral values will have those values normalized into the [0-1] range (for example, a color channel with value of 255 will be normalized into 1.0). In future, an UDA (TODO) will be added to allow the user to disable normalization of integers.
The VertexArray requires a shader program when being bound and looks for vertex attributes with names corresponding to fields of V. Any shader program used to draw a VertexArray must contain vertex attributes for all members of V (otherwise VertexArray binding will fail).
For example, the following vertex shader source has all members specified by the Vertex struct in the above example: