OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
Sprite.h
Go to the documentation of this file.
1 
8 #ifndef _SPRITE_H_
9 #define _SPRITE_H_
10 
11 #include "system/Shader.h"
12 
13 class Sprite {
14  public:
15  Sprite(int tile, int x, int y, int width, int height);
16  void display(glm::mat4 MVP);
17 
18  int getTexture() { return texture; }
19  glm::vec4 getUVs() { return uv2D; }
20 
21  private:
22  int texture;
24  glm::vec4 uv2D;
25 };
26 
28  public:
29  SpriteSequence(int objectID, int offset, int size)
30  : id(objectID), start(offset), length(size) { }
31  void display(glm::mat4 MVP, int index);
32 
33  int getID() { return id; }
34  int getStart() { return start; }
35  int size() { return length; }
36 
37  private:
38  int id;
39  int start;
40  int length;
41 };
42 
43 #endif
44 
glm::vec4 uv2D
Definition: Sprite.h:24
int getStart()
Definition: Sprite.h:34
OpenGL Shader Implementation.
int length
Definition: Sprite.h:40
Sprite(int tile, int x, int y, int width, int height)
Definition: Sprite.cpp:19
int texture
Definition: Sprite.h:22
int size()
Definition: Sprite.h:35
ShaderBuffer uvs
Definition: Sprite.h:23
Definition: Sprite.h:13
int getID()
Definition: Sprite.h:33
int getTexture()
Definition: Sprite.h:18
void display(glm::mat4 MVP)
Definition: Sprite.cpp:48
SpriteSequence(int objectID, int offset, int size)
Definition: Sprite.h:29
ShaderBuffer vertices
Definition: Sprite.h:23
glm::vec4 getUVs()
Definition: Sprite.h:19
void display(glm::mat4 MVP, int index)
Definition: Sprite.cpp:54