diff options
author | chai <chaifix@163.com> | 2021-10-28 00:47:35 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-28 00:47:35 +0800 |
commit | 1b6f71b2777bdc74d63f988346a8cfee766718b0 (patch) | |
tree | ae710ba057f4841e7d0911eb4d3e0c346f79a524 /Runtime/Graphics/VertexAttribute.cpp | |
parent | 305ca0a09d4e750186b5190432de47f3493e806a (diff) |
+DefaultVertexLayout
Diffstat (limited to 'Runtime/Graphics/VertexAttribute.cpp')
-rw-r--r-- | Runtime/Graphics/VertexAttribute.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Runtime/Graphics/VertexAttribute.cpp b/Runtime/Graphics/VertexAttribute.cpp new file mode 100644 index 0000000..0b0e8e4 --- /dev/null +++ b/Runtime/Graphics/VertexAttribute.cpp @@ -0,0 +1,19 @@ +#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 + }; + + GLenum ConvertAttrFormatToGLFormat(uint fmt) + { + return kGLVertexAttrFormat[fmt]; + } + +}
\ No newline at end of file |