Skip to content

Commit

Permalink
Fixed perf icon & tab rendering for MSVC
Browse files Browse the repository at this point in the history
- used wireframe planet icon for Terrain tab
- MSVC requires use of u8 before icon \u string names
- added comment explaining icon name values
  • Loading branch information
fluffyfreak committed Nov 22, 2024
1 parent 7b64f71 commit 216a299
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/pigui/PerfInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,15 @@ void PerfInfo::Draw()
ImGui::ShowStackToolWindow(&m_state->stackToolOpen);
}

static const char *s_rendererIcon = "\uF082";
static const char *s_worldIcon = "\uF092";
static const char *s_perfIcon = "\uF0F0";
// Icons are found in the file /data/icons/icons.svg
// The value below can be calculated like this: \uF0A4
// \uF0 ignore this part
// A == 10 zero index based so the 11th row of icons.svg
// 4 == 4 zero index based so the 5th column of icons.svg
static const char *s_rendererIcon = u8"\uF082";
static const char *s_worldIcon = u8"\uF092";
static const char *s_perfIcon = u8"\uF0F0";
static const char *s_planetIcon = u8"\uF0A0";

bool BeginDebugTab(const char *icon, const char *label)
{
Expand Down Expand Up @@ -344,6 +350,11 @@ void PerfInfo::DrawPerfWindow()
EndDebugTab();
}

if (BeginDebugTab(s_planetIcon, "Terrain")) {
DrawTerrainDebug();
EndDebugTab();
}

if (false && ImGui::BeginTabItem("Input")) {
DrawInputDebug();
ImGui::EndTabItem();
Expand All @@ -356,11 +367,6 @@ void PerfInfo::DrawPerfWindow()
}
}

if (ImGui::BeginTabItem("Terrain")) {
DrawTerrainDebug();
ImGui::EndTabItem();
}

PiGui::RunHandler(Pi::GetFrameTime(), "debug-tabs");

ImGui::EndTabBar();
Expand Down

0 comments on commit 216a299

Please sign in to comment.