1
0
mirror of synced 2025-02-06 22:24:24 +01:00
ImHex/plugins/builtin/source/content/footer_items.cpp
WerWolv af1d687758 fix: ImHex using way too much resources still
Now frames are rendered at only 5 FPS if no input events are being processed. Thanks a lot to @Tey. Properly fixes #189 now
2021-07-27 21:50:49 +02:00

18 lines
409 B
C++

#include <hex/plugin.hpp>
namespace hex::plugin::builtin {
void addFooterItems() {
ContentRegistry::Interface::addFooterItem([] {
static float framerate = 0;
if (ImGui::HasSecondPassed()) {
framerate = 1.0F / ImGui::GetIO().DeltaTime;
}
ImGui::TextUnformatted(hex::format("FPS {0:.2f}", framerate).c_str());
});
}
}