Guest User

Untitled

a guest
Apr 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. enum DrawMode
  2. {
  3.     IMMEDIATE = 0,
  4.     TEXTURE
  5. };
  6.  
  7. class SpriteBatch
  8. {
  9. public:
  10.    
  11.     SpriteBatch();
  12.    
  13.     ~SpriteBatch();
  14.    
  15.     void Begin(DrawMode mode=IMMEDIATE);
  16.     void End();
  17.    
  18.     void Draw(Texture2D* texture, Vector2 position, float rotation=0.f, Vector2 scale=Vector2::One(), Vector2 origin=Vector2::Zero(), Colour colour=Colour::White(), float depth=0.f);
  19.     void DrawString(SpriteFont* font, Vector2 position, float rotation=0.f, Vector2 scale=Vector2::One(), Vector2 origin=Vector2::Zero(), Colour colour=Colour::White(), float depth=0.f);
  20.    
  21. private:
  22.    
  23.     GLfloat m_quadVertices[18];
  24.     GLfloat m_quadTexCoords[12];
  25.     GLuint m_quadVBOVertices;
  26.     GLuint m_quadVBOTexCoords;
  27.    
  28.     void Draw();
  29.  
  30. };
Add Comment
Please, Sign In to add comment