]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Texture.h
renamed namespace geometry -> math
[l2e.git] / src / graphics / Texture.h
1 #ifndef GRAPHICS_TEXTURE_H_
2 #define GRAPHICS_TEXTURE_H_
3
4 #include "../math/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 math::Vector<int> &size = math::Vector<int>(),
16                         const math::Vector<int> &offset = math::Vector<int>());
17         ~Texture();
18
19         static const int TYPE_ID = 410;
20
21 public:
22         void Render(SDL_Surface *dest, const math::Vector<int> &from, const math::Vector<int> &to) const;
23
24 public:
25         void SetSurface(SDL_Surface *s) { surface = s; }
26         void SetSize(const math::Vector<int> &s) { size = s; }
27         void SetOffset(const math::Vector<int> &o) { offset = o; }
28
29         static void CreateTypeDescription();
30         static void Construct(void *);
31
32 private:
33         SDL_Surface *surface;
34         math::Vector<int> size;
35         math::Vector<int> offset;
36
37 };
38
39 }
40
41 #endif /* GRAPHICS_TEXTURE_H_ */