toggle stats
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
SDL/*
|
SDL/*
|
||||||
# !SDL/src
|
bgfx.cmake/*
|
||||||
# bgfx.cmake/*
|
|
||||||
tinygltf/*
|
tinygltf/*
|
||||||
|
imgui/*
|
||||||
|
iconfontheaders/*
|
||||||
|
tracy/*
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ namespace Game
|
|||||||
bool ShowImguiDemo = false;
|
bool ShowImguiDemo = false;
|
||||||
uint8_t DebugCardRotation = 0;
|
uint8_t DebugCardRotation = 0;
|
||||||
bool ShortenLogFileNames = true;
|
bool ShortenLogFileNames = true;
|
||||||
|
bool ShowStats = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GameInstance
|
struct GameInstance
|
||||||
|
|||||||
@@ -72,14 +72,13 @@ namespace Tools
|
|||||||
void RenderDebugUI(Game::GameRendering& rendering)
|
void RenderDebugUI(Game::GameRendering& rendering)
|
||||||
{
|
{
|
||||||
auto& time = Game::GetInstance().Time;
|
auto& time = Game::GetInstance().Time;
|
||||||
if (rendering.UIVisible == Game::UIVisibilityState::Debug)
|
|
||||||
{
|
|
||||||
ZoneScopedN("DebugUI");
|
|
||||||
|
|
||||||
auto& shared = Game::GetShared();
|
auto& shared = Game::GetShared();
|
||||||
auto& debug = Game::GetInstance().DebugData;
|
auto& debug = Game::GetInstance().DebugData;
|
||||||
auto& level = Game::GetInstance().GameLevel;
|
auto& level = Game::GetInstance().GameLevel;
|
||||||
|
|
||||||
|
if (rendering.UIVisible == Game::UIVisibilityState::Debug)
|
||||||
|
{
|
||||||
|
ZoneScopedN("DebugUI");
|
||||||
if (ImGui::IsMouseClicked(ImGuiMouseButton_Right))
|
if (ImGui::IsMouseClicked(ImGuiMouseButton_Right))
|
||||||
{
|
{
|
||||||
debug.DebugCardRotation++;
|
debug.DebugCardRotation++;
|
||||||
@@ -150,6 +149,7 @@ namespace Tools
|
|||||||
level.Setup(shared.Game);
|
level.Setup(shared.Game);
|
||||||
}
|
}
|
||||||
ImGui::Checkbox("Show ImGui Demo", &debug.ShowImguiDemo);
|
ImGui::Checkbox("Show ImGui Demo", &debug.ShowImguiDemo);
|
||||||
|
ImGui::Checkbox("Show Stats", &debug.ShowStats);
|
||||||
if (debug.ShowImguiDemo) ImGui::ShowDemoWindow(&debug.ShowImguiDemo);
|
if (debug.ShowImguiDemo) ImGui::ShowDemoWindow(&debug.ShowImguiDemo);
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
@@ -325,6 +325,8 @@ namespace Tools
|
|||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
if (debug.ShowStats)
|
||||||
|
{
|
||||||
ImGui::SetNextWindowPos({0, 0});
|
ImGui::SetNextWindowPos({0, 0});
|
||||||
if (ImGui::Begin("Stats",
|
if (ImGui::Begin("Stats",
|
||||||
nullptr,
|
nullptr,
|
||||||
@@ -370,6 +372,7 @@ namespace Tools
|
|||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
void MeasureFrameEnd()
|
void MeasureFrameEnd()
|
||||||
{
|
{
|
||||||
FrameTimes[FrameTimeIdx] = bx::getHPCounter();
|
FrameTimes[FrameTimeIdx] = bx::getHPCounter();
|
||||||
|
|||||||
Reference in New Issue
Block a user