Tatooine
gltype.h
Go to the documentation of this file.
1#ifndef TATOOINE_GL_GLTYPE_H
2#define TATOOINE_GL_GLTYPE_H
3//==============================================================================
4#include "glincludes.h"
5//==============================================================================
6namespace tatooine::gl {
7//==============================================================================
8struct gl_half;
9
10template <typename T>
11struct gl_type;
12// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
13template <typename T>
14static constexpr auto gl_type_v = gl_type<T>::value;
15//------------------------------------------------------------------------------
16//template <>
17//struct gl_type<GLfixed> {
18// static constexpr GLenum value = GL_FIXED;
19//};
20//------------------------------------------------------------------------------
21template <>
22struct gl_type<bool> {
23 static constexpr GLenum value = GL_BOOL;
24};
25//------------------------------------------------------------------------------
26template <>
27struct gl_type<gl_half> {
28 static constexpr GLenum value = GL_HALF_FLOAT;
29};
30//------------------------------------------------------------------------------
31template <>
32struct gl_type<GLfloat> {
33 static constexpr GLenum value = GL_FLOAT;
34};
35//------------------------------------------------------------------------------
36template <>
37struct gl_type<GLdouble> {
38 static constexpr GLenum value = GL_DOUBLE;
39};
40//------------------------------------------------------------------------------
41template <>
42struct gl_type<GLubyte> {
43 static constexpr GLenum value = GL_UNSIGNED_BYTE;
44};
45//------------------------------------------------------------------------------
46template <>
47struct gl_type<GLbyte> {
48 static constexpr GLenum value = GL_BYTE;
49};
50//------------------------------------------------------------------------------
51template <>
52struct gl_type<GLushort> {
53 static constexpr GLenum value = GL_UNSIGNED_SHORT;
54};
55//------------------------------------------------------------------------------
56template <>
57struct gl_type<GLshort> {
58 static constexpr GLenum value = GL_SHORT;
59};
60//------------------------------------------------------------------------------
61template <>
62struct gl_type<GLuint> {
63 static constexpr GLenum value = GL_UNSIGNED_INT;
64};
65//------------------------------------------------------------------------------
66template <>
67struct gl_type<GLint> {
68 static constexpr GLenum value = GL_INT;
69};
70//==============================================================================
71} // namespace tatooine::gl
72//==============================================================================
73#endif
Definition: ansiformat.h:6
static constexpr auto gl_type_v
Definition: gltype.h:14
Definition: gltype.h:11