]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Frame.h
merged Point into Vector
[l2e.git] / src / graphics / Frame.h
1 /*
2  * Frame.h
3  *
4  *  Created on: Aug 7, 2012
5  *      Author: holy
6  */
7
8 #ifndef GRAPHICS_FRAME_H_
9 #define GRAPHICS_FRAME_H_
10
11 #include "../geometry/Vector.h"
12
13 #include <SDL.h>
14
15 namespace graphics {
16
17 class Frame {
18
19 public:
20         Frame(SDL_Surface *s, int borderWidth, int borderHeight, int repeatWidth = 1, int repeatHeight = 1, int xOffset = 0, int yOffset = 0)
21         : surface(s), borderWidth(borderWidth), borderHeight(borderHeight), repeatWidth(repeatWidth), repeatHeight(repeatHeight), xOffset(xOffset), yOffset(yOffset) { }
22
23 public:
24         int MinWidth() const { return 2 * borderWidth; }
25         int MinHeight() const { return 2 * borderHeight; }
26         int BorderWidth() const { return borderWidth; }
27         int BorderHeight() const { return borderHeight; }
28         void Draw(SDL_Surface *dest, const geometry::Vector<int> &position, int width, int height) const;
29
30 private:
31         SDL_Surface *surface;
32         int borderWidth;
33         int borderHeight;
34         int repeatWidth;
35         int repeatHeight;
36         int xOffset;
37         int yOffset;
38
39 };
40
41 }
42
43 #endif /* GRAPHICS_FRAME_H_ */