Class OcsfmlGraphics.vertex_array

class vertex_array : ?primitive_type:PrimitiveType.t -> Vertex.t list -> object .. end
method append : Vertex.t -> unit
Add a vertex to the array.
method clear : unit
Clear the vertex array.

This function removes all the vertices from the array. It doesn't deallocate the corresponding memory, so that adding new vertices after clearing doesn't involve reallocating all the memory.

method destroy : unit
method get_at_index : int -> Vertex.t
Get a read-only access to a vertex by its index.

This function doesn't check index, it must be in range 0, GetVertexCount() - 1. The behaviour is undefined otherwise.

method get_bounds : FloatRect.t
Compute the bounding rectangle of the vertex array.

This function returns the axis-aligned rectangle that contains all the vertices of the array.
Returns Bounding rectangle of the vertex array

method get_primitive_type : PrimitiveType.t
Get the type of primitives drawn by the vertex array.
Returns Primitive type
method get_vertex_count : int
Return the vertex count.
Returns Number of vertices in the array.
method resize : int -> unit
Resize the vertex array.

If vertexCount is greater than the current size, the previous vertices are kept and new (default-constructed) vertices are added. If vertexCount is less than the current size, existing vertices are removed from the array.

method set_at_index : int -> Vertex.t -> unit
method set_primitive_type : PrimitiveType.t -> unit
Set the type of primitives to draw.

This function defines how the vertices must be interpreted when it's time to draw them: