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

Sprite.h 617B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*!
  2. * \file include/Sprite.h
  3. * \brief World Sprite
  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. private:
  15. int texture;
  16. ShaderBuffer vertices, uvs;
  17. };
  18. class SpriteSequence {
  19. public:
  20. SpriteSequence(int objectID, int offset, int size)
  21. : id(objectID), start(offset), length(size) { }
  22. void display(glm::mat4 MVP, int index);
  23. int getID() { return id; }
  24. private:
  25. int id;
  26. int start;
  27. int length;
  28. };
  29. #endif