]> git.localhorst.tv Git - blobs.git/blob - src/graphics/Texture.hpp
basic info box
[blobs.git] / src / graphics / Texture.hpp
1 #ifndef BLOBS_GRAPHICS_TEXTURE_HPP_
2 #define BLOBS_GRAPHICS_TEXTURE_HPP_
3
4 #include "TextureBase.hpp"
5
6 #include <GL/glew.h>
7
8 struct SDL_Surface;
9
10
11 namespace blobs {
12 namespace graphics {
13
14 struct Format;
15
16 class Texture
17 : public TextureBase<GL_TEXTURE_2D> {
18
19 public:
20         Texture();
21         ~Texture();
22
23         Texture(Texture &&) noexcept;
24         Texture &operator =(Texture &&) noexcept;
25
26         Texture(const Texture &) = delete;
27         Texture &operator =(const Texture &) = delete;
28
29 public:
30         GLsizei Width() const noexcept { return width; }
31         GLsizei Height() const noexcept { return height; }
32         glm::vec2 Size() const noexcept { return glm::vec2(width, height); }
33
34         void Data(const SDL_Surface &, bool pad2 = true) noexcept;
35         void Data(GLsizei w, GLsizei h, const Format &, GLvoid *data) noexcept;
36
37         static void UnpackAlignment(GLint) noexcept;
38         static int UnpackAlignmentFromPitch(int) noexcept;
39         static void UnpackRowLength(GLint) noexcept;
40
41 private:
42         GLsizei width, height;
43
44 };
45
46 }
47 }
48
49 #endif