diff options
Diffstat (limited to 'src/libjin/graphics/je_mesh.h')
-rw-r--r-- | src/libjin/graphics/je_mesh.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/libjin/graphics/je_mesh.h b/src/libjin/graphics/je_mesh.h index 5bcca2e..1dbf3a4 100644 --- a/src/libjin/graphics/je_mesh.h +++ b/src/libjin/graphics/je_mesh.h @@ -1,6 +1,11 @@ #ifndef __JE_MESH_H__ #define __JE_MESH_H__ +#include <vector> + +#include "../math/je_bbox.h" + +#include "je_vertex.h" #include "je_graphic.h" namespace JinEngine @@ -11,15 +16,34 @@ namespace JinEngine /// /// A 2D mesh. /// - class Mesh + class Mesh : public Renderable, public Object { public: + Mesh(); + void setGraphic(const Graphic* graphic); - void pushVertex(float x, float y, float u, float v); + void pushVertex(float x, float y, float u, float v, Color color = Color::WHITE); + void pushVertex(const Vertex& vertex); + inline Math::BBox getBound() { return mBound; } + + void render(float x, float y, float sx, float sy, float r, float ox = 0, float oy = 0) const; private: + /// + /// Graphic binded. + /// const Graphic* mGraphic; + /// + /// Bound box of mesh. + /// + Math::BBox mBound; + + /// + /// + /// + std::vector<Vertex> mVertices; + }; } // namespace Graphics |