diff options
author | chai <chaifix@163.com> | 2021-11-03 09:52:26 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-03 09:52:26 +0800 |
commit | c10e0d92f46e5eaf25a69e1fafe5f4dbd8eaab9d (patch) | |
tree | 2eb1a91339b35fea68f48b2774355f496519db83 /Runtime/GUI/UIMesh.cpp | |
parent | 3898f2c648b1a731dead8337aad8912d2b8b80d7 (diff) |
*misc
Diffstat (limited to 'Runtime/GUI/UIMesh.cpp')
-rw-r--r-- | Runtime/GUI/UIMesh.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Runtime/GUI/UIMesh.cpp b/Runtime/GUI/UIMesh.cpp new file mode 100644 index 0000000..a68b6fd --- /dev/null +++ b/Runtime/GUI/UIMesh.cpp @@ -0,0 +1,15 @@ +#include "UIMesh.h" + +CustomVertexLayout UIMesh::s_UIVertexLayout; +unsigned int UIMesh::s_SizePerVertex; + +InitializeStaticVariables([]() { + VertexAttributeDescriptor POSITION = VertexAttributeDescriptor(0, 2, VertexAttrFormat_Float, sizeof(UIVertexLayout)); + VertexAttributeDescriptor UV = VertexAttributeDescriptor(sizeof(Vector2), 2, VertexAttrFormat_Float, sizeof(UIVertexLayout)); + VertexAttributeDescriptor COLOR = VertexAttributeDescriptor(sizeof(Vector2) * 2, 4, VertexAttrFormat_Unsigned_Byte, sizeof(UIVertexLayout), true); + UIMesh::s_UIVertexLayout.attributes.push_back(POSITION); + UIMesh::s_UIVertexLayout.attributes.push_back(UV); + UIMesh::s_UIVertexLayout.attributes.push_back(COLOR); + + UIMesh::s_SizePerVertex = sizeof(UIVertexLayout); +}); |