summaryrefslogtreecommitdiff
path: root/Client/Source/Graphics/VertexAttribute.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Source/Graphics/VertexAttribute.cpp')
-rw-r--r--Client/Source/Graphics/VertexAttribute.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/Client/Source/Graphics/VertexAttribute.cpp b/Client/Source/Graphics/VertexAttribute.cpp
new file mode 100644
index 0000000..e5f2ea7
--- /dev/null
+++ b/Client/Source/Graphics/VertexAttribute.cpp
@@ -0,0 +1,20 @@
+#include "VertexAttribute.h"
+
+namespace VertexAttribute
+{
+
+ // map VertexAttrFormat to OpenGL type
+ static GLenum kGLVertexAttrFormat[VertexAttrFormat_Count] = {
+ GL_FLOAT, // VertexAttrFormat_Float
+ GL_HALF_FLOAT, // VertexAttrFormat_Float16
+ GL_UNSIGNED_BYTE, // VertexAttrFormat_Color
+ GL_BYTE, // VertexAttrFormat_Byte
+ GL_UNSIGNED_BYTE, // VertexAttrFormat_Unsigned_Byte
+ };
+
+ GLenum ConvertAttrFormatToGLFormat(uint fmt)
+ {
+ return kGLVertexAttrFormat[fmt];
+ }
+
+} \ No newline at end of file