]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Sprite.h
added simple sprite class
[l2e.git] / src / graphics / Sprite.h
1 /*
2  * Sprite.h
3  *
4  *  Created on: Aug 5, 2012
5  *      Author: holy
6  */
7
8 #ifndef GRAPHICS_SPRITE_H_
9 #define GRAPHICS_SPRITE_H_
10
11 #include <SDL.h>
12
13 namespace graphics {
14
15 class Sprite {
16
17 public:
18         Sprite(SDL_Surface *s, int width, int height)
19         : surface(s), width(width), height(height) { }
20
21 public:
22         int Width() const { return width; }
23         int Height() const { return height; }
24         void Draw(SDL_Surface *dest, int x, int y, int col = 0, int row = 0) const;
25
26 private:
27         SDL_Surface *surface;
28         int width;
29         int height;
30
31 };
32
33 }
34
35 #endif /* GRAPHICS_SPRITE_H_ */