Open Source Tomb Raider Engine
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Sprite.h 801B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 "system/Shader.h"
  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. ShaderBuffer vertices, uvs;
  19. glm::vec4 uv2D;
  20. };
  21. class SpriteSequence {
  22. public:
  23. SpriteSequence(int objectID, int offset, int size)
  24. : id(objectID), start(offset), length(size) { }
  25. void display(glm::mat4 MVP, int index);
  26. int getID() { return id; }
  27. int getStart() { return start; }
  28. int size() { return length; }
  29. private:
  30. int id;
  31. int start;
  32. int length;
  33. };
  34. #endif