]> git.localhorst.tv Git - blank.git/blob - src/graphics/ArrayTexture.hpp
group entity updates in as few packets as possible
[blank.git] / src / graphics / ArrayTexture.hpp
1 #ifndef BLANK_GRAPHICS_ARRAYTEXTURE_HPP_
2 #define BLANK_GRAPHICS_ARRAYTEXTURE_HPP_
3
4 #include "Format.hpp"
5
6 #include <GL/glew.h>
7
8 struct SDL_Surface;
9
10
11 namespace blank {
12
13 class ArrayTexture {
14
15 public:
16         ArrayTexture();
17         ~ArrayTexture();
18
19         ArrayTexture(ArrayTexture &&) noexcept;
20         ArrayTexture &operator =(ArrayTexture &&) noexcept;
21
22         ArrayTexture(const ArrayTexture &) = delete;
23         ArrayTexture &operator =(const ArrayTexture &) = delete;
24
25 public:
26         GLsizei Width() const noexcept { return width; }
27         GLsizei Height() const noexcept { return height; }
28         GLsizei Depth() const noexcept { return depth; }
29
30         void Bind() noexcept;
31
32         void Reserve(GLsizei w, GLsizei h, GLsizei d, const Format &) noexcept;
33         void Data(GLsizei l, const SDL_Surface &);
34         void Data(GLsizei l, const Format &, GLvoid *data) noexcept;
35
36         void FilterNearest() noexcept;
37         void FilterLinear() noexcept;
38         void FilterTrilinear() noexcept;
39
40 private:
41         GLuint handle;
42
43         GLsizei width, height, depth;
44
45         Format format;
46
47 };
48
49 }
50
51 #endif