]> git.tdb.fi Git - libs/gl.git/blob - source/datatype.cpp
Remove the deprecated ProgramBuilder class
[libs/gl.git] / source / datatype.cpp
1 #include <stdexcept>
2 #include "datatype.h"
3
4 using namespace std;
5
6 namespace Msp {
7 namespace GL {
8
9 unsigned get_type_size(DataType type)
10 {
11         switch(type)
12         {
13         case BYTE:
14         case UNSIGNED_BYTE: return 1;
15         case SHORT:
16         case UNSIGNED_SHORT:
17         case HALF_FLOAT: return 2;
18         case INT:
19         case UNSIGNED_INT:
20         case FLOAT: return 4;
21         default: throw invalid_argument("get_type_size");
22         }
23 }
24
25 } // namespace GL
26 } // namespace Msp