1 #ifndef BLANK_GRAPHICS_GL_TRAITS_HPP_
2 #define BLANK_GRAPHICS_GL_TRAITS_HPP_
14 /// number of components per generic attribute
15 /// must be 1, 2, 3, 4
16 // static constexpr GLint size;
19 /// accepted values are:
20 /// GL_BYTE, GL_UNSIGNED_BYTE,
21 /// GL_SHORT, GL_UNSIGNED_SHORT,
22 /// GL_INT, GL_UNSIGNED_INT,
23 /// GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE,
24 /// GL_FIXED, GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV
25 // static constexpr GLenum type;
32 template<> struct gl_traits<signed char> {
33 static constexpr GLint size = 1;
34 static constexpr GLenum type = GL_BYTE;
37 template<> struct gl_traits<unsigned char> {
38 static constexpr GLint size = 1;
39 static constexpr GLenum type = GL_UNSIGNED_BYTE;
42 template<> struct gl_traits<short> {
43 static constexpr GLint size = 1;
44 static constexpr GLenum type = GL_SHORT;
47 template<> struct gl_traits<unsigned short> {
48 static constexpr GLint size = 1;
49 static constexpr GLenum type = GL_UNSIGNED_SHORT;
52 template<> struct gl_traits<int> {
53 static constexpr GLint size = 1;
54 static constexpr GLenum type = GL_INT;
57 template<> struct gl_traits<unsigned int> {
58 static constexpr GLint size = 1;
59 static constexpr GLenum type = GL_UNSIGNED_INT;
62 template<> struct gl_traits<float> {
63 static constexpr GLint size = 1;
64 static constexpr GLenum type = GL_FLOAT;
67 template<> struct gl_traits<double> {
68 static constexpr GLint size = 1;
69 static constexpr GLenum type = GL_DOUBLE;
74 template<class T, glm::precision P>
75 struct gl_traits<TVEC1<T, P>> {
76 static constexpr GLint size = 1;
77 static constexpr GLenum type = gl_traits<T>::type;
79 template<class T, glm::precision P>
80 constexpr GLint gl_traits<TVEC1<T, P>>::size;
81 template<class T, glm::precision P>
82 constexpr GLenum gl_traits<TVEC1<T, P>>::type;
84 template<class T, glm::precision P>
85 struct gl_traits<TVEC2<T, P>> {
86 static constexpr GLint size = 2;
87 static constexpr GLenum type = gl_traits<T>::type;
89 template<class T, glm::precision P>
90 constexpr GLint gl_traits<TVEC2<T, P>>::size;
91 template<class T, glm::precision P>
92 constexpr GLenum gl_traits<TVEC2<T, P>>::type;
94 template<class T, glm::precision P>
95 struct gl_traits<TVEC3<T, P>> {
96 static constexpr GLint size = 3;
97 static constexpr GLenum type = gl_traits<T>::type;
99 template<class T, glm::precision P>
100 constexpr GLint gl_traits<TVEC3<T, P>>::size;
101 template<class T, glm::precision P>
102 constexpr GLenum gl_traits<TVEC3<T, P>>::type;
104 template<class T, glm::precision P>
105 struct gl_traits<TVEC4<T, P>> {
106 static constexpr GLint size = 4;
107 static constexpr GLenum type = gl_traits<T>::type;
109 template<class T, glm::precision P>
110 constexpr GLint gl_traits<TVEC4<T, P>>::size;
111 template<class T, glm::precision P>
112 constexpr GLenum gl_traits<TVEC4<T, P>>::type;