summaryrefslogtreecommitdiff
path: root/Runtime/GUI/UIQuad.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-20 14:10:24 +0800
committerchai <chaifix@163.com>2021-11-20 14:10:24 +0800
commit74ca8143a7c2352425d549b681b2838bda5ee218 (patch)
tree5aad35e7312b7c1b54769091b30f47d8ad747acb /Runtime/GUI/UIQuad.cpp
parent850d9c034792b96e2ff5ff3bbfbcc30661757aed (diff)
*misc
Diffstat (limited to 'Runtime/GUI/UIQuad.cpp')
-rw-r--r--Runtime/GUI/UIQuad.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/Runtime/GUI/UIQuad.cpp b/Runtime/GUI/UIQuad.cpp
index c57685c..269b805 100644
--- a/Runtime/GUI/UIQuad.cpp
+++ b/Runtime/GUI/UIQuad.cpp
@@ -30,8 +30,6 @@ void UIQuad::Draw()
m_Left, m_Top, // top-left
};
- int n = sizeof(Vector2);
-
float uv[] = {
0, 0,
1, 0,
@@ -39,7 +37,7 @@ void UIQuad::Draw()
0, 1,
};
- int indices[] = {
+ uint16 indices[] = {
0, 1, 3, // right-top
1, 2, 3, // left-bottom
};
@@ -47,7 +45,7 @@ void UIQuad::Draw()
uint8* vb;
uint16* ib;
- g_SharedVBO.GetChunk(sizeof(UIQuadLayout), sizeof(uint16), 4, 6, Primitive_Triangle, (void**)&vb, (void**)&ib);
+ g_SharedVBO.GetChunk(sizeof(UIQuadLayout), sizeof(uint16), nVerts, nIndices, Primitive_Triangle, (void**)&vb, (void**)&ib);
UIQuadLayout* dst = (UIQuadLayout*)vb;
@@ -60,6 +58,6 @@ void UIQuad::Draw()
for (int i = 0; i < nIndices; ++i)
ib[i] = indices[i];
- g_SharedVBO.ReleaseChunk(4, 6);
+ g_SharedVBO.ReleaseChunk(nVerts, nIndices);
g_SharedVBO.DrawChunk(layout);
} \ No newline at end of file