mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
ui: Moved FPS counter to footer
This commit is contained in:
21
plugins/builtin/source/content/footer_items.cpp
Normal file
21
plugins/builtin/source/content/footer_items.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <hex/plugin.hpp>
|
||||
|
||||
#include <windows.h>
|
||||
#include <psapi.h>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
void addFooterItems() {
|
||||
|
||||
ContentRegistry::Interface::addFooterItem([] {
|
||||
static float framerate = 0;
|
||||
if (ImGui::HasSecondPassed()) {
|
||||
framerate = ImGui::GetIO().Framerate;
|
||||
}
|
||||
|
||||
ImGui::TextUnformatted(hex::format("FPS {0:.2f}", framerate).c_str());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,8 @@ namespace hex::plugin::builtin {
|
||||
void registerSettings();
|
||||
void registerDataProcessorNodes();
|
||||
|
||||
void addFooterItems();
|
||||
|
||||
void registerLanguageEnUS();
|
||||
void registerLanguageDeDE();
|
||||
void registerLanguageItIT();
|
||||
@@ -26,6 +28,8 @@ IMHEX_PLUGIN_SETUP("Built-in", "WerWolv", "Default ImHex functionality") {
|
||||
registerSettings();
|
||||
registerDataProcessorNodes();
|
||||
|
||||
addFooterItems();
|
||||
|
||||
registerLanguageEnUS();
|
||||
registerLanguageDeDE();
|
||||
registerLanguageItIT();
|
||||
|
||||
Reference in New Issue
Block a user