Browse code

Add implementation

Robert Cranston authored on 29/12/2021 16:30:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,69 @@
1
+#ifndef GLTEXTUREND_HPP_
2
+#define GLTEXTUREND_HPP_
3
+
4
+
5
+#include <array>
6
+#include <cstddef>
7
+#include <string>
8
+
9
+#include <globject.hpp>
10
+#include <gltexture.hpp>
11
+
12
+
13
+/// Class
14
+
15
+template<std::size_t N>
16
+class GLTextureND : public GLTexture
17
+{
18
+public:
19
+
20
+    /// Special member functions
21
+
22
+    using Size = std::array<GLsizei, N>;
23
+
24
+    explicit GLTextureND(
25
+        std::string object_label,
26
+        GLenum      target,
27
+        GLenum      binding,
28
+        GLenum      size_max_name,
29
+        Size        size,
30
+        GLenum      internal_format = 0,
31
+        GLenum      wrap            = 0,
32
+        GLenum      min_filter      = 0,
33
+        GLenum      mag_filter      = 0
34
+    );
35
+
36
+    /// Core
37
+
38
+    GLOBJECT_GET(Size, size);
39
+
40
+protected:
41
+
42
+    /// Core
43
+
44
+    std::size_t virtual data_size_() const override;
45
+
46
+    /// Check
47
+
48
+    void check_size_max_(GLenum size_max_name);
49
+
50
+    /// String
51
+
52
+    std::string static str_size_(Size size);
53
+
54
+private:
55
+
56
+    /// Core
57
+
58
+    Size const size_;
59
+};
60
+
61
+
62
+/// Explicit template instantiation
63
+
64
+extern template class GLTextureND<1>;
65
+extern template class GLTextureND<2>;
66
+extern template class GLTextureND<3>;
67
+
68
+
69
+#endif // GLTEXTUREND_HPP_