]> git.tdb.fi Git - libs/gl.git/blob - source/core/datatype.cpp
7488a68bd4e7334c217877dda705575828cf65b1
[libs/gl.git] / source / core / datatype.cpp
1 #include <stdexcept>
2 #include <msp/gl/extensions/nv_half_float.h>
3 #include "datatype.h"
4
5 using namespace std;
6
7 namespace Msp {
8 namespace GL {
9
10 GLenum get_gl_type(DataType type)
11 {
12         switch(type)
13         {
14         case BYTE: return GL_BYTE;
15         case UNSIGNED_BYTE: return GL_UNSIGNED_BYTE;
16         case SHORT: return GL_SHORT;
17         case UNSIGNED_SHORT: return GL_UNSIGNED_SHORT;
18         case INT: return GL_INT;
19         case UNSIGNED_INT: return GL_UNSIGNED_INT;
20         case FLOAT: return GL_FLOAT;
21         case HALF_FLOAT: return GL_HALF_FLOAT;
22         default: throw invalid_argument("get_gl_type");
23         }
24 }
25
26 } // namespace GL
27 } // namespace Msp