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