VertexArray

A VertrexArray is a simple way to handle a performant textured shape. It provides a simple API and maintains the necessary properties. It is similar to a trimmed-down version of Shape, but does not contain possible unnecessary content.

See: Shape, Vertex

Constructors

this
this(Geometry geometry, ref Texture texture)

CTor

Members

Functions

append
void append(ref const Vertex vertex)

Stores a Vertex

append
void append(const Vector2f vec)

Stores a Vertex

appendQuad
void appendQuad(const Vector2f position, const Rect texRect)

Append a whole Quad. This method provides a simple way to add a quadratic texture-view. And this as easily as if you would work with a Sprite.

clear
void clear()

Clear all Vertices but preserve the storage and capacity

getTexture
inout(Texture)* getTexture()

Returns the current texture or null

getVertices
inout(Vertex[]) getVertices()

Returns all Vertices

opIndex
inout(Vertex) opIndex(size_t index)

Returns all Vertices

reserve
void reserve(size_t size)

Reserve (additional) space for the internal Vertex array

setTexture
void setTexture(ref Texture texture)

Set or reset a Texture

Properties

length
size_t length [@property getter]

Returns the current amount of stored Vertices

Inherited Members

From Drawable

draw
void draw(ref const Window)

Draw method which is called from the Window's draw method

Meta

Authors

Randy Schuett (rswhite4@googlemail.com)