You.i Engine
YiSpriteSheet.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_SPRITE_SHEET_H_
3 #define _YI_SPRITE_SHEET_H_
4 
5 #include "asset/YiAssetTexture.h"
6 #include "framework/YiPredef.h"
7 
8 #include <glm/mat3x3.hpp>
9 
15 class CYIMaterial;
16 class CYIMesh;
17 
22 {
23  public:
24 
28  SpriteSheet(const std::shared_ptr<CYIAssetTexture> &pTextureAsset, float fSubimageWidth, float fSubimageHeight);
29  ~SpriteSheet();
30 
34  void DisplayFrame(int32_t nIndex);
35 
36  const std::shared_ptr<CYIMesh> &GetMesh() const;
37  const std::shared_ptr<CYIMaterial> GetMaterial() const;
38 
39  private:
40  std::shared_ptr<CYIAssetTexture> m_TextureAsset;
41  float m_fSubimageWidth;
42  float m_fSubimageHeight;
43  uint32_t m_uImageMapWidth;
44  uint32_t m_uImageMapHeight;
45 
46  std::shared_ptr<CYIMesh> m_pMesh;
47  std::shared_ptr<CYIMaterial> m_pMaterial;
48 
49  glm::mat3 CalculateTextureMatrix(int32_t nIndex);
50 };
51 
54 #endif // _YI_SPRITE_SHEET_H_
Class representing an instance of geometry information.
Definition: YiMesh.h:33
SpriteSheet(const std::shared_ptr< CYIAssetTexture > &pTextureAsset, float fSubimageWidth, float fSubimageHeight)
Definition: YiSpriteSheet.h:21
CYIMaterial is a place holder for all the drawing parameters required by the renderer to draw a mesh/...
Definition: YiMaterial.h:27
const std::shared_ptr< CYIMesh > & GetMesh() const
void DisplayFrame(int32_t nIndex)
const std::shared_ptr< CYIMaterial > GetMaterial() const