refactor: Move custom ImGui functions to ImGuiExt namespace (#1427)

Co-authored-by: Nik <werwolv98@gmail.com>
This commit is contained in:
iTrooz
2023-11-16 22:24:06 +01:00
committed by GitHub
parent 77c326d300
commit 39252dfe48
79 changed files with 644 additions and 622 deletions

View File

@@ -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));
});
}