Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Sprite.h 834B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*!
  2. * \file include/Sprite.h
  3. * \brief 2D Billboard Collection
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _SPRITE_H_
  8. #define _SPRITE_H_
  9. #include <vector>
  10. class Sprite {
  11. public:
  12. Sprite(int tile, int x, int y, int width, int height);
  13. void display(glm::mat4 MVP);
  14. int getTexture() { return texture; }
  15. glm::vec4 getUVs() { return uv2D; }
  16. private:
  17. int texture;
  18. std::vector<glm::vec3> vertexBuff;
  19. std::vector<glm::vec2> uvBuff;
  20. glm::vec4 uv2D;
  21. };
  22. class SpriteSequence {
  23. public:
  24. SpriteSequence(int objectID, int offset, int size)
  25. : id(objectID), start(offset), length(size) { }
  26. void display(glm::mat4 MVP, int index);
  27. int getID() { return id; }
  28. int getStart() { return start; }
  29. int size() { return length; }
  30. private:
  31. int id;
  32. int start;
  33. int length;
  34. };
  35. #endif