summaryrefslogtreecommitdiff
path: root/gfx/gl/glTexture.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-03-02 13:17:28 +0000
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2026-03-02 13:17:28 +0000
commit64ede41ebaade64ad6705f7f55ca4a778a156481 (patch)
tree6d2fbc64cd28d272fe3f5bbf79ddd41ecc5e2626 /gfx/gl/glTexture.h
parentRefactor glArrays to better expose underlying types (diff)
downloadilt-main.tar.bz2
ilt-main.tar.xz
ilt-main.zip
Wrap up some low level texture operations in glTexture classHEADmain
Fixes previously hard coded billboard texture size.
Diffstat (limited to 'gfx/gl/glTexture.h')
-rw-r--r--gfx/gl/glTexture.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gfx/gl/glTexture.h b/gfx/gl/glTexture.h
new file mode 100644
index 0000000..c482198
--- /dev/null
+++ b/gfx/gl/glTexture.h
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "config/types.h"
+#include "glArrays.h"
+
+namespace Impl {
+ // NOLINTNEXTLINE(readability-identifier-naming)
+ struct glTexture : Detail::glNamed {
+ [[nodiscard]] TextureDimensions getSize() const;
+ void bind(GLenum type = GL_TEXTURE_2D, GLenum unit = GL_TEXTURE0) const;
+ };
+}
+
+// NOLINTBEGIN(readability-identifier-naming)
+template<size_t N> using glTextures = glManagedArray<Impl::glTexture, N, &glGenTextures, &glDeleteTextures>;
+using glTexture = glManagedSingle<Impl::glTexture, &glGenTextures, &glDeleteTextures>;
+// NOLINTEND(readability-identifier-naming)