summaryrefslogtreecommitdiff
path: root/gfx/gl/glTexture.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-03-07 14:21:21 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2026-03-07 14:21:21 +0000
commitfb16b42096b45f02a9b02bee38d5d3ead6d430b0 (patch)
tree11f01ae37e5423c0ee2d5087bc72342db3a6832c /gfx/gl/glTexture.h
parentFix naming violations in Mesh (diff)
downloadilt-fb16b42096b45f02a9b02bee38d5d3ead6d430b0.tar.bz2
ilt-fb16b42096b45f02a9b02bee38d5d3ead6d430b0.tar.xz
ilt-fb16b42096b45f02a9b02bee38d5d3ead6d430b0.zip
Replace gl_traits glTexParameter with glTexture::parameter DSA wrapperHEADmain
Diffstat (limited to 'gfx/gl/glTexture.h')
-rw-r--r--gfx/gl/glTexture.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gfx/gl/glTexture.h b/gfx/gl/glTexture.h
index c482198..5e5c838 100644
--- a/gfx/gl/glTexture.h
+++ b/gfx/gl/glTexture.h
@@ -2,12 +2,27 @@
#include "config/types.h"
#include "glArrays.h"
+#include "gl_traits.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;
+
+ template<has_glTextureParameter T>
+ void
+ parameter(GLenum pname, T param)
+ {
+ (*gl_traits<T>::glTextureParameterFunc)(name, pname, param);
+ }
+
+ template<glm::length_t L, has_glTextureParameterv T, glm::qualifier Q>
+ void
+ parameter(GLenum pname, const glm::vec<L, T, Q> & param)
+ {
+ (*gl_traits<T>::glTextureParametervFunc)(name, pname, glm::value_ptr(param));
+ }
};
}