#include <stdexcept>
+#include <msp/gl/extensions/nv_half_float.h>
#include "datatype.h"
using namespace std;
namespace Msp {
namespace GL {
-unsigned get_type_size(DataType type)
+GLenum get_gl_type(DataType type)
{
switch(type)
{
- case BYTE:
- case UNSIGNED_BYTE: return 1;
- case SHORT:
- case UNSIGNED_SHORT:
- case HALF_FLOAT: return 2;
- case INT:
- case UNSIGNED_INT:
- case FLOAT: return 4;
- default: throw invalid_argument("get_type_size");
+ case BYTE: return GL_BYTE;
+ case UNSIGNED_BYTE: return GL_UNSIGNED_BYTE;
+ case SHORT: return GL_SHORT;
+ case UNSIGNED_SHORT: return GL_UNSIGNED_SHORT;
+ case INT: return GL_INT;
+ case UNSIGNED_INT: return GL_UNSIGNED_INT;
+ case FLOAT: return GL_FLOAT;
+ case HALF_FLOAT: return GL_HALF_FLOAT;
+ default: throw invalid_argument("get_gl_type");
}
}