diff --git a/src/hud_elements.cpp b/src/hud_elements.cpp index 9f11a05..0f69849 100644 --- a/src/hud_elements.cpp +++ b/src/hud_elements.cpp @@ -374,6 +374,36 @@ void HudElements::graphs(){ ImGui::TextColored(HUDElements.sw_stats->colors.engine, "%s", "GPU Load"); ImGui::PopFont(); } + + if (value == "cpu_temp"){ + if (!HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_cpu_temp]) + HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_cpu_temp] = true; + for (auto& it : graph_data){ + arr.push_back(float(it.cpu_temp)); + arr.erase(arr.begin()); + } + if (int(arr.back()) > HUDElements.cpu_temp_max) + HUDElements.cpu_temp_max = arr.back(); + HUDElements.max = HUDElements.cpu_temp_max; + HUDElements.min = 0; + ImGui::PushFont(HUDElements.sw_stats->font1); + ImGui::TextColored(HUDElements.sw_stats->colors.engine, "%s", "CPU Temp"); + ImGui::PopFont(); + } + + if (value == "gpu_temp"){ + for (auto& it : graph_data){ + arr.push_back(float(it.gpu_temp)); + arr.erase(arr.begin()); + } + if (int(arr.back()) > HUDElements.gpu_temp_max) + HUDElements.gpu_temp_max = arr.back(); + HUDElements.max = HUDElements.gpu_temp_max; + HUDElements.min = 0; + ImGui::PushFont(HUDElements.sw_stats->font1); + ImGui::TextColored(HUDElements.sw_stats->colors.engine, "%s", "GPU Temp"); + ImGui::PopFont(); + } if (value == "gpu_core_clock"){ for (auto& it : graph_data){ @@ -476,7 +506,7 @@ void HudElements::sort_elements(std::pair option){ if (param == "graphs"){ std::vector permitted_params = { "gpu_load", "cpu_load", "gpu_core_clock", "gpu_mem_clock", - "vram", "ram" + "vram", "ram", "cpu_temp", "gpu_temp" }; std::stringstream ss; ss << value; while (std::getline(ss, value, '+')) { diff --git a/src/hud_elements.h b/src/hud_elements.h index 2f3022c..425fc3e 100644 --- a/src/hud_elements.h +++ b/src/hud_elements.h @@ -15,7 +15,7 @@ class HudElements{ int place; std::vector> options; std::vector> ordered_functions; - int min, max, gpu_core_max, gpu_mem_max; + int min, max, gpu_core_max, gpu_mem_max, cpu_temp_max, gpu_temp_max; void sort_elements(std::pair option); static void version(); static void time();