From eafe5c9be5f3fc22ef60bda0e9fe6cee9702ed03 Mon Sep 17 00:00:00 2001 From: tobid7 Date: Sat, 5 Sep 2026 21:28:09 +0200 Subject: [PATCH] Add Drawlist Vertex and Indexcount geteter (for debugging usage only) --- include/pd/lithium/drawlist.hpp | 12 ++++++++++++ source/ui7/io.cpp | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/pd/lithium/drawlist.hpp b/include/pd/lithium/drawlist.hpp index dfdcdd9..b023576 100644 --- a/include/pd/lithium/drawlist.hpp +++ b/include/pd/lithium/drawlist.hpp @@ -43,6 +43,18 @@ class PD_API Drawlist { void Optimize(); void Clear(); + size_t GetNumVertices() const { + size_t count = 0; + for (const auto& cmd : pCommands) count += cmd.VertexCount; + return count; + } + + size_t GetNumIndices() const { + size_t count = 0; + for (const auto& cmd : pCommands) count += cmd.IndexCount; + return count; + } + /** Command Allocation */ Command& NewCommand(); bool HasCommands() { return pCommands.size() > 0; } diff --git a/source/ui7/io.cpp b/source/ui7/io.cpp index 6256fdc..875a041 100644 --- a/source/ui7/io.cpp +++ b/source/ui7/io.cpp @@ -52,8 +52,8 @@ PD_API void UI7::IO::Update() { DrawlistRegestry.push_front(std::make_pair("CtxBackList", &Back)); if (Font) ItemRowHeight = FontScale * Font->PixelHeight; // RegisterDrawList("CtxBackList", Back); - NumIndices = 0; // FDL.pNumIndices; - NumVertices = 0; // FDL.pNumVertices; + NumIndices = FDL.GetNumIndices(); + NumVertices = FDL.GetNumVertices(); LabelPool.ResetFast(); DynObjPool.ResetFast(); ImagePool.ResetFast();