]> git.localhorst.tv Git - gong.git/blob - src/graphics/ArrayTexture.hpp
code, assets, and other stuff stolen from blank
[gong.git] / src / graphics / ArrayTexture.hpp
1 #ifndef GONG_GRAPHICS_ARRAYTEXTURE_HPP_
2 #define GONG_GRAPHICS_ARRAYTEXTURE_HPP_
3
4 #include "Format.hpp"
5 #include "TextureBase.hpp"
6
7 #include <GL/glew.h>
8
9 struct SDL_Surface;
10
11
12 namespace gong {
13 namespace graphics {
14
15 class ArrayTexture
16 : public TextureBase<GL_TEXTURE_2D_ARRAY> {
17
18 public:
19         ArrayTexture();
20         ~ArrayTexture();
21
22         ArrayTexture(ArrayTexture &&) noexcept;
23         ArrayTexture &operator =(ArrayTexture &&) noexcept;
24
25         ArrayTexture(const ArrayTexture &) = delete;
26         ArrayTexture &operator =(const ArrayTexture &) = delete;
27
28 public:
29         GLsizei Width() const noexcept { return width; }
30         GLsizei Height() const noexcept { return height; }
31         GLsizei Depth() const noexcept { return depth; }
32
33         void Reserve(GLsizei w, GLsizei h, GLsizei d, const Format &) noexcept;
34         void Data(GLsizei l, const SDL_Surface &);
35         void Data(GLsizei l, const Format &, GLvoid *data) noexcept;
36
37 private:
38         GLsizei width, height, depth;
39
40         Format format;
41
42 };
43
44 }
45 }
46
47 #endif