diff options
Diffstat (limited to 'src/sprite.h')
-rw-r--r-- | src/sprite.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/sprite.h b/src/sprite.h new file mode 100644 index 0000000..3af9341 --- /dev/null +++ b/src/sprite.h | |||
@@ -0,0 +1,33 @@ | |||
1 | #ifndef SPRITE_H_70503825 | ||
2 | #define SPRITE_H_70503825 | ||
3 | |||
4 | #include <string_view> | ||
5 | #include "renderer.h" | ||
6 | |||
7 | class Sprite { | ||
8 | public: | ||
9 | |||
10 | Sprite(std::string_view filename, Renderer& renderer); | ||
11 | |||
12 | int getTextureId() const { | ||
13 | return textureId_; | ||
14 | } | ||
15 | |||
16 | int getX() { return x_; } | ||
17 | |||
18 | int getY() { return y_; } | ||
19 | |||
20 | int getWidth() { return width_; } | ||
21 | |||
22 | int getHeight() { return height_; } | ||
23 | |||
24 | private: | ||
25 | |||
26 | int textureId_; | ||
27 | int x_ = 0; | ||
28 | int y_ = 0; | ||
29 | int width_ = 17*4; | ||
30 | int height_ = 27*4; | ||
31 | }; | ||
32 | |||
33 | #endif /* end of include guard: SPRITE_H_70503825 */ | ||