]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Sprite.h
added Point 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 "../geometry/Point.h"
12
13 #include <SDL.h>
14
15 namespace graphics {
16
17 class Sprite {
18
19 public:
20         Sprite(SDL_Surface *s, int width, int height)
21         : surface(s), width(width), height(height) { }
22
23 public:
24         int Width() const { return width; }
25         int Height() const { return height; }
26         void Draw(SDL_Surface *dest, geometry::Point<int> position, int col = 0, int row = 0) const;
27
28 private:
29         SDL_Surface *surface;
30         int width;
31         int height;
32
33 };
34
35 }
36
37 #endif /* GRAPHICS_SPRITE_H_ */