]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Texture.h
ef4256b83228b39e5e0301fc80fc85f2070e214a
[l2e.git] / src / graphics / Texture.h
1 #ifndef GRAPHICS_TEXTURE_H_
2 #define GRAPHICS_TEXTURE_H_
3
4 #include "../geometry/Vector.h"
5
6 #include <SDL.h>
7
8 namespace graphics {
9
10 class Texture {
11
12 public:
13         explicit Texture(
14                         SDL_Surface *surface = 0,
15                         const geometry::Vector<int> &size = geometry::Vector<int>(),
16                         const geometry::Vector<int> &offset = geometry::Vector<int>());
17         ~Texture();
18
19 public:
20         void Render(SDL_Surface *dest, const geometry::Vector<int> &from, const geometry::Vector<int> &to) const;
21
22 public:
23         void SetSurface(SDL_Surface *s) { surface = s; }
24         void SetSize(const geometry::Vector<int> &s) { size = s; }
25         void SetOffset(const geometry::Vector<int> &o) { offset = o; }
26
27 private:
28         SDL_Surface *surface;
29         geometry::Vector<int> size;
30         geometry::Vector<int> offset;
31
32 };
33
34 }
35
36 #endif /* GRAPHICS_TEXTURE_H_ */