123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /*!
- * \file include/Sprite.h
- * \brief 2D Billboard Collection
- *
- * \author xythobuz
- */
-
- #ifndef _SPRITE_H_
- #define _SPRITE_H_
-
- #include <vector>
-
- class Sprite {
- public:
- Sprite(int tile, int x, int y, int width, int height);
- void display(glm::mat4 MVP);
-
- int getTexture() { return texture; }
- glm::vec4 getUVs() { return uv2D; }
-
- private:
- int texture;
- std::vector<glm::vec3> vertexBuff;
- std::vector<glm::vec2> uvBuff;
- glm::vec4 uv2D;
- };
-
- class SpriteSequence {
- public:
- SpriteSequence(int objectID, int offset, int size)
- : id(objectID), start(offset), length(size) { }
- void display(glm::mat4 MVP, int index);
-
- int getID() { return id; }
- int getStart() { return start; }
- int size() { return length; }
-
- private:
- int id;
- int start;
- int length;
- };
-
- #endif
|