diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-05-17 15:55:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-17 15:55:37 -0400 |
| commit | 90aadf3844386824140a20d7fbb847bc16009a94 (patch) | |
| tree | 6f83fce90e71abb22b1a8f3e09c79963b2a34d5d /src/renderer/texture.h | |
| parent | bc63fa57ced1c7329f7fdcfd168eaf7e290158bc (diff) | |
| parent | 86f0106d0523825549f1e74b835688c78a10cf6c (diff) | |
| download | therapy-90aadf3844386824140a20d7fbb847bc16009a94.tar.gz therapy-90aadf3844386824140a20d7fbb847bc16009a94.tar.bz2 therapy-90aadf3844386824140a20d7fbb847bc16009a94.zip | |
Merge pull request #7 from hatkirby/es-rewrite
The ECS rewrite exceeds the original branch in functionality, so it is time to merge it in.
Diffstat (limited to 'src/renderer/texture.h')
| -rw-r--r-- | src/renderer/texture.h | 52 |
1 files changed, 52 insertions, 0 deletions
| diff --git a/src/renderer/texture.h b/src/renderer/texture.h new file mode 100644 index 0000000..3aa8773 --- /dev/null +++ b/src/renderer/texture.h | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | #ifndef TEXTURE_H_84EC6DF6 | ||
| 2 | #define TEXTURE_H_84EC6DF6 | ||
| 3 | |||
| 4 | #include "wrappers.h" | ||
| 5 | |||
| 6 | struct Rectangle { | ||
| 7 | int x; | ||
| 8 | int y; | ||
| 9 | int w; | ||
| 10 | int h; | ||
| 11 | }; | ||
| 12 | |||
| 13 | class Texture { | ||
| 14 | public: | ||
| 15 | |||
| 16 | Texture(int width, int height); | ||
| 17 | |||
| 18 | Texture(const char* file); | ||
| 19 | |||
| 20 | Texture(const Texture& tex); | ||
| 21 | |||
| 22 | Texture(Texture&& tex); | ||
| 23 | |||
| 24 | Texture& operator= (Texture tex); | ||
| 25 | |||
| 26 | friend void swap(Texture& tex1, Texture& tex2); | ||
| 27 | |||
| 28 | Rectangle entirety() const; | ||
| 29 | |||
| 30 | inline GLuint getId() const | ||
| 31 | { | ||
| 32 | return texture_.getId(); | ||
| 33 | } | ||
| 34 | |||
| 35 | inline int getWidth() const | ||
| 36 | { | ||
| 37 | return width_; | ||
| 38 | } | ||
| 39 | |||
| 40 | inline int getHeight() const | ||
| 41 | { | ||
| 42 | return height_; | ||
| 43 | } | ||
| 44 | |||
| 45 | private: | ||
| 46 | |||
| 47 | GLTexture texture_; | ||
| 48 | int width_; | ||
| 49 | int height_; | ||
| 50 | }; | ||
| 51 | |||
| 52 | #endif /* end of include guard: TEXTURE_H_84EC6DF6 */ | ||
