From 349dd957ea05c1cd9289646db6888a993c8ee02f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 2 Jan 2023 17:13:01 +0000 Subject: Add gl_traits for all the common types --- lib/gl_traits.hpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'lib/gl_traits.hpp') diff --git a/lib/gl_traits.hpp b/lib/gl_traits.hpp index b50ec50..d140de9 100644 --- a/lib/gl_traits.hpp +++ b/lib/gl_traits.hpp @@ -3,12 +3,41 @@ #include #include #include +#include template struct gl_traits; -template<> struct gl_traits { +template<> struct gl_traits { static constexpr GLenum type {GL_FLOAT}; static constexpr GLint size {1}; }; +template<> struct gl_traits { + static constexpr GLenum type {GL_DOUBLE}; + static constexpr GLint size {1}; +}; +template<> struct gl_traits { + static constexpr GLenum type {GL_BYTE}; + static constexpr GLint size {1}; +}; +template<> struct gl_traits { + static constexpr GLenum type {GL_SHORT}; + static constexpr GLint size {1}; +}; +template<> struct gl_traits { + static constexpr GLenum type {GL_INT}; + static constexpr GLint size {1}; +}; +template<> struct gl_traits { + static constexpr GLenum type {GL_UNSIGNED_BYTE}; + static constexpr GLint size {1}; +}; +template<> struct gl_traits { + static constexpr GLenum type {GL_UNSIGNED_SHORT}; + static constexpr GLint size {1}; +}; +template<> struct gl_traits { + static constexpr GLenum type {GL_UNSIGNED_INT}; + static constexpr GLint size {1}; +}; template struct gl_traits> : public gl_traits { static constexpr GLint size {S * gl_traits::size}; -- cgit v1.2.3