From 74ca8143a7c2352425d549b681b2838bda5ee218 Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 20 Nov 2021 14:10:24 +0800 Subject: *misc --- Runtime/GUI/UIQuad.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Runtime/GUI/UIQuad.cpp') 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 -- cgit v1.1-26-g67d0