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