Dgame.Graphic.VertexArray
« Go back
Bottom- 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.
See:
Shape, Vertex
Author:
Randy Schuett (rswhite4@googlemail.com)
- final pure nothrow @nogc this(Geometry geometry, ref Texture texture);
- CTor
- 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.
Note:
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.
« Go back