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