From 85f50df15476cc7a28c75da48a57ab3b157c17db Mon Sep 17 00:00:00 2001 From: tobid7 Date: Sat, 5 Sep 2026 17:03:17 +0200 Subject: [PATCH] unload debugfont and add Gfx debug menu --- tests/gfx/source/main.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/gfx/source/main.cpp b/tests/gfx/source/main.cpp index ff922d4..fda0222 100644 --- a/tests/gfx/source/main.cpp +++ b/tests/gfx/source/main.cpp @@ -198,9 +198,9 @@ int main(int argc, char** argv) { auto pTex = PD::Gfx::LoadTexture(img, img.Width(), img.Height()); PD::Li::Font font; PD::Li::Font debug_font; - font.LoadTTF(ResourcePath("default.ttf"), 32, LiFontFlags_SDF); - debug_font.LoadTTF(ResourcePath("JetBrainsMono-Medium.ttf"), 32, - LiFontFlags_SDF | LiFontFlags_Monospace); + font.LoadTTF(ResourcePath("default.ttf"), 32, LiFontFlags_SDF); + debug_font.LoadTTF(ResourcePath("JetBrainsMono-Medium.ttf"), 32, + LiFontFlags_SDF | LiFontFlags_Monospace); pList.SetFont(&font); App app(font); Cursor LeftStick; @@ -297,18 +297,28 @@ int main(int argc, char** argv) { "#ff00ff"); } pList.SetFont(&font); - #ifndef __3DS__ +#ifndef __3DS__ PD::TT::Beg("BuildUI7Menus"); if (auto m = ui7.BeginMenu("Test")) { m->Label("Hello World!"); ui7.EndMenu(); } + if (auto m = ui7.BeginMenu("LI DBG INFO")) { + m->Label("Gfx Driver: {}", PD::Gfx::GetDriverName()); + m->Separator(); + m->Label("LI Draw Comamnds: {}", PD::Gfx::GetNumCommands()); + m->Label("GFX Draw Calls: {}", PD::Gfx::GetNumDrawcalls()); + m->Label("GFX Vertices: {}", PD::Gfx::GetNumVertices()); + m->Label("GFX Triangles: {}", PD::Gfx::GetNumVertices()/3); + m->Label("GFX Indices: {}", PD::Gfx::GetNumIndices()); + ui7.EndMenu(); + } ui7.MetricsMenu(); PD::TT::End("BuildUI7Menus"); PD::TT::Beg("UI7::Context::Update"); ui7.Update(); PD::TT::End("UI7::Context::Update"); - #endif +#endif PD::Gfx::Reset(); PD::TT::Beg("PD::Gfx::Draw"); PD::Gfx::Draw(pList); @@ -320,6 +330,7 @@ int main(int argc, char** argv) { PD::TT::Beg("OSCTX::MainLoop"); } font.Delete(); + debug_font.Delete(); PD::Gfx::DeleteTexture(pTex); PD::Gfx::Deinit(); pOs->Deinit();