mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-29 00:10:02 -05:00
refactor: Move custom ImGui functions to ImGuiExt namespace (#1427)
Co-authored-by: Nik <werwolv98@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ namespace hex::plugin::windows {
|
||||
ContentRegistry::Interface::addFooterItem([] {
|
||||
static float cpuUsage = 0.0F;
|
||||
|
||||
if (ImGui::HasSecondPassed()) {
|
||||
if (ImGuiExt::HasSecondPassed()) {
|
||||
static ULARGE_INTEGER lastCPU, lastSysCPU, lastUserCPU;
|
||||
static u32 numProcessors;
|
||||
static HANDLE self = GetCurrentProcess();
|
||||
@@ -61,14 +61,14 @@ namespace hex::plugin::windows {
|
||||
cpuUsage *= 100;
|
||||
}
|
||||
|
||||
ImGui::TextFormatted(ICON_FA_TACHOMETER_ALT " {0:2}.{1:02}", u32(cpuUsage), u32(cpuUsage * 100) % 100);
|
||||
ImGuiExt::TextFormatted(ICON_FA_TACHOMETER_ALT " {0:2}.{1:02}", u32(cpuUsage), u32(cpuUsage * 100) % 100);
|
||||
});
|
||||
|
||||
ContentRegistry::Interface::addFooterItem([] {
|
||||
static MEMORYSTATUSEX memInfo;
|
||||
static PROCESS_MEMORY_COUNTERS_EX pmc;
|
||||
|
||||
if (ImGui::HasSecondPassed()) {
|
||||
if (ImGuiExt::HasSecondPassed()) {
|
||||
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
|
||||
GlobalMemoryStatusEx(&memInfo);
|
||||
GetProcessMemoryInfo(GetCurrentProcess(), reinterpret_cast<PROCESS_MEMORY_COUNTERS *>(&pmc), sizeof(pmc));
|
||||
@@ -77,7 +77,7 @@ namespace hex::plugin::windows {
|
||||
auto totalMem = memInfo.ullTotalPhys;
|
||||
auto usedMem = pmc.WorkingSetSize;
|
||||
|
||||
ImGui::TextFormatted(ICON_FA_MICROCHIP " {0} / {1}", hex::toByteString(usedMem), hex::toByteString(totalMem));
|
||||
ImGuiExt::TextFormatted(ICON_FA_MICROCHIP " {0} / {1}", hex::toByteString(usedMem), hex::toByteString(totalMem));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user