diff --git a/plugins/builtin/CMakeLists.txt b/plugins/builtin/CMakeLists.txt index a25a3a253..1f5d87281 100644 --- a/plugins/builtin/CMakeLists.txt +++ b/plugins/builtin/CMakeLists.txt @@ -13,6 +13,8 @@ add_library(${PROJECT_NAME} SHARED source/content/tools_entries.cpp source/content/data_processor_nodes.cpp + source/content/footer_items.cpp + source/math_evaluator.cpp source/lang/en_US.cpp diff --git a/plugins/builtin/source/content/footer_items.cpp b/plugins/builtin/source/content/footer_items.cpp new file mode 100644 index 000000000..061a7def9 --- /dev/null +++ b/plugins/builtin/source/content/footer_items.cpp @@ -0,0 +1,31 @@ +#include + +#if defined(OS_WINDOWS) + #include + #include +#endif + +namespace hex::plugin::builtin { + + void addFooterItems() { + + #if defined(OS_WINDOWS) + ContentRegistry::Interface::addFooterItem([] { + static MEMORYSTATUSEX memInfo; + static PROCESS_MEMORY_COUNTERS_EX pmc; + + if (ImGui::GetFrameCount() % 60 == 0) { + memInfo.dwLength = sizeof(MEMORYSTATUSEX); + GlobalMemoryStatusEx(&memInfo); + GetProcessMemoryInfo(GetCurrentProcess(), reinterpret_cast(&pmc), sizeof(pmc)); + } + + auto totalMem = memInfo.ullTotalPhys; + auto usedMem = pmc.PrivateUsage; + + ImGui::TextUnformatted(hex::format("{0} / {1}", hex::toByteString(usedMem), hex::toByteString(totalMem)).c_str()); + }); + #endif + } + +} \ No newline at end of file diff --git a/plugins/builtin/source/plugin_builtin.cpp b/plugins/builtin/source/plugin_builtin.cpp index 271094347..58fae7bdc 100644 --- a/plugins/builtin/source/plugin_builtin.cpp +++ b/plugins/builtin/source/plugin_builtin.cpp @@ -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();