]> git.localhorst.tv Git - gong.git/blob - src/graphics/Texture.hpp
code, assets, and other stuff stolen from blank
[gong.git] / src / graphics / Texture.hpp
1 #ifndef GONG_GRAPHICS_TEXTURE_HPP_
2 #define GONG_GRAPHICS_TEXTURE_HPP_
3
4 #include "TextureBase.hpp"
5
6 #include <GL/glew.h>
7
8 struct SDL_Surface;
9
10
11 namespace gong {
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
33         void Data(const SDL_Surface &, bool pad2 = true) noexcept;
34         void Data(GLsizei w, GLsizei h, const Format &, GLvoid *data) noexcept;
35
36         static void UnpackAlignment(GLint) noexcept;
37         static int UnpackAlignmentFromPitch(int) noexcept;
38         static void UnpackRowLength(GLint) noexcept;
39
40 private:
41         GLsizei width, height;
42
43 };
44
45 }
46 }
47
48 #endif