summaryrefslogtreecommitdiff
path: root/Client/Source/GUI/UIMesh.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-12-13 00:07:19 +0800
committerchai <chaifix@163.com>2021-12-13 00:07:19 +0800
commit60cbbdec07ab7a5636eac5b3c024ae44e937f4d4 (patch)
treeb2c7b0a868f18159dbc43d8954e1bd7668549a88 /Client/Source/GUI/UIMesh.cpp
+init
Diffstat (limited to 'Client/Source/GUI/UIMesh.cpp')
-rw-r--r--Client/Source/GUI/UIMesh.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Client/Source/GUI/UIMesh.cpp b/Client/Source/GUI/UIMesh.cpp
new file mode 100644
index 0000000..9616c46
--- /dev/null
+++ b/Client/Source/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(Vector2f), 2, VertexAttrFormat_Float, sizeof(UIVertexLayout));
+ VertexAttributeDescriptor COLOR = VertexAttributeDescriptor(sizeof(Vector2f) * 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);
+});