sys: Only display FPS in debug builds

This commit is contained in:
WerWolv
2022-09-05 22:37:28 +02:00
parent 2d5f77730b
commit 95a3104a56
4 changed files with 26 additions and 15 deletions

View File

@@ -212,14 +212,16 @@ namespace hex::plugin::builtin {
});
}
ContentRegistry::Interface::addFooterItem([] {
static float framerate = 0;
if (ImGui::HasSecondPassed()) {
framerate = 1.0F / ImGui::GetIO().DeltaTime;
}
#if defined(DEBUG)
ContentRegistry::Interface::addFooterItem([] {
static float framerate = 0;
if (ImGui::HasSecondPassed()) {
framerate = 1.0F / ImGui::GetIO().DeltaTime;
}
ImGui::TextFormatted("FPS {0:2}.{1:02}", u32(framerate), u32(framerate * 100) % 100);
});
ImGui::TextFormatted("FPS {0:2}.{1:02}", u32(framerate), u32(framerate * 100) % 100);
});
#endif
ContentRegistry::Interface::addFooterItem([] {
auto taskCount = TaskManager::getRunningTaskCount();

View File

@@ -133,7 +133,6 @@ namespace hex::plugin::builtin {
{ "hex.builtin.menu.view", "Ansicht" },
{ "hex.builtin.menu.layout", "Layout" },
{ "hex.builtin.menu.view.fps", "FPS anzeigen" },
{ "hex.builtin.menu.view.demo", "ImGui Demo anzeigen" },
{ "hex.builtin.menu.help", "Hilfe" },

View File

@@ -136,7 +136,6 @@ namespace hex::plugin::builtin {
{ "hex.builtin.menu.view", "" },
{ "hex.builtin.menu.layout", "레이아웃" },
{ "hex.builtin.menu.view.fps", "FPS 표시하기" },
{ "hex.builtin.menu.view.demo", "ImGui Demo 표시하기" },
{ "hex.builtin.menu.help", "도움말" },