VertexArray

Define a set of one or more 2D primitives.

VertexArray is a very simple wrapper around a dynamic array of vertices and a primitives type.

It inherits Drawable, but unlike other drawables it is not transformable.

Constructors

this
this(PrimitiveType type, uint vertexCount)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

append
void append(Vertex newVertex)

Add a vertex to the array.

clear
void clear()

Clear the vertex array.

draw
void draw(RenderTarget renderTarget, RenderStates renderStates)

Draw the object to a render target.

getBounds
FloatRect getBounds()

Compute the bounding rectangle of the vertex array.

getVertexCount
uint getVertexCount()

Return the vertex count.

opIndex
Vertex opIndex(size_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
resize
void resize(uint length)

Resize the vertex array.

Variables

primitiveType
PrimitiveType primitiveType;

The type of primitive to draw.

Inherited Members

From Drawable

draw
void draw(RenderTarget renderTarget, RenderStates renderStates)

Draw the object to a render target.

See Also

Meta

Authors

Laurent Gomila, Jeremy DeHaan