Added cpu_mhz param

pull/392/head
FlightlessMango 4 years ago
parent ed2e06e68d
commit 553bf50e6a

@ -220,6 +220,10 @@ bool CPUStats::UpdateCoreMhz() {
i++;
}
}
m_cpuDataTotal.cpu_mhz = 0;
for (auto data : m_cpuData)
m_cpuDataTotal.cpu_mhz += data.mhz;
m_cpuDataTotal.cpu_mhz /= m_cpuData.size();
return true;
}

@ -35,6 +35,7 @@ typedef struct CPUData_ {
float percent;
int mhz;
int temp;
int cpu_mhz;
} CPUData;
class CPUStats

@ -115,6 +115,16 @@ void HudElements::cpu_stats(){
ImGui::SameLine(0, 1.0f);
ImGui::Text("°C");
}
if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_cpu_mhz])
ImGui::TableNextRow();
if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_cpu_mhz]){
ImGui::TableNextCell();
right_aligned_text(HUDElements.sw_stats->colors.text, HUDElements.ralign_width, "%i", cpuStats.GetCPUDataTotal().cpu_mhz);
ImGui::SameLine(0, 1.0f);
ImGui::PushFont(HUDElements.sw_stats->font1);
ImGui::Text("MHz");
ImGui::PopFont();
}
}
}

@ -55,6 +55,7 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_BOOL(cpu_load_change) \
OVERLAY_PARAM_BOOL(graphs) \
OVERLAY_PARAM_BOOL(legacy_layout) \
OVERLAY_PARAM_BOOL(cpu_mhz) \
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_folder) \
OVERLAY_PARAM_CUSTOM(output_file) \

Loading…
Cancel
Save