« Go back


class VertexArray: Dgame.Graphic.Drawable.Drawable;
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.

Shape, Vertex

Randy Schuett (rswhite4@googlemail.com)

final pure nothrow @nogc this(Geometry geometry, ref Texture texture);

final pure nothrow @nogc void setTexture(ref Texture texture);
Set or reset a Texture

final inout pure nothrow @nogc inout(Texture)* getTexture();
Returns the current texture or null

final pure nothrow void reserve(size_t size);
Reserve (additional) space for the internal Vertex array

final nothrow void clear();
Clear all Vertices but preserve the storage and capacity

final pure nothrow void append(ref const Vertex vertex);
Stores a Vertex

final pure nothrow void append(const Vector2f vec);
Stores a Vertex

final pure nothrow 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.

This method only works for Geometry.Quads.

final inout pure nothrow @nogc inout(Vertex[]) getVertices();
Returns all Vertices

final inout pure nothrow @nogc ref inout(Vertex) opIndex(size_t index);
Returns all Vertices

final const pure nothrow @nogc @property size_t length();
Returns the current amount of stored Vertices

Page generated by Ddoc.

» Dgame.Graphic.VertexArray on Github


« Go back