From 35d8f7c829e7f76ced6bc69f81ac671645e8c01d Mon Sep 17 00:00:00 2001 From: FlightlessMango Date: Wed, 5 Feb 2020 03:43:44 +0100 Subject: [PATCH] add ram/vram param options --- src/overlay.cpp | 24 ++++++++++++++++++------ src/overlay_params.c | 8 ++++++++ src/overlay_params.h | 6 ++++-- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/overlay.cpp b/src/overlay.cpp index 63086001..41dba742 100644 --- a/src/overlay.cpp +++ b/src/overlay.cpp @@ -1174,12 +1174,24 @@ static void compute_swapchain_display(struct swapchain_data *data) i++; } } - ImGui::TextColored(ImVec4(0.678, 0.392, 0.756, 1.00f), "VRAM"); - ImGui::SameLine(hudFirstRow); - ImGui::Text("%iMB", gpuMemUsed); - ImGui::TextColored(ImVec4(0.760, 0.4, 0.576, 1.00f), "RAM"); - ImGui::SameLine(hudFirstRow); - ImGui::Text("%.1fG", memused); + if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_vram]){ + ImGui::TextColored(ImVec4(0.678, 0.392, 0.756, 1.00f), "VRAM"); + ImGui::SameLine(hudFirstRow); + ImGui::Text("%i", gpuMemUsed); + ImGui::SameLine(0,1.0f); + ImGui::PushFont(font1); + ImGui::Text("MB"); + ImGui::PopFont(); + } + if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_ram]){ + ImGui::TextColored(ImVec4(0.760, 0.4, 0.576, 1.00f), "RAM"); + ImGui::SameLine(hudFirstRow); + ImGui::Text("%.1f", memused); + ImGui::SameLine(0,1.0f); + ImGui::PushFont(font1); + ImGui::Text("GB"); + ImGui::PopFont(); + } if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_fps]){ ImGui::TextColored(ImVec4(0.925, 0.411, 0.411, 1.00f), "%s", engineName.c_str()); ImGui::SameLine(hudFirstRow); diff --git a/src/overlay_params.c b/src/overlay_params.c index f35cb8a5..009b0fc6 100644 --- a/src/overlay_params.c +++ b/src/overlay_params.c @@ -177,6 +177,8 @@ parse_overlay_env(struct overlay_params *params, params->enabled[OVERLAY_PARAM_ENABLED_gpu_temp] = false; params->enabled[OVERLAY_PARAM_ENABLED_cpu_stats] = true; params->enabled[OVERLAY_PARAM_ENABLED_gpu_stats] = true; + params->enabled[OVERLAY_PARAM_ENABLED_ram] = false; + params->enabled[OVERLAY_PARAM_ENABLED_vram] = false; params->fps_sampling_period = 500000; /* 500ms */ params->width = 280; params->height = 140; @@ -230,4 +232,10 @@ parse_overlay_env(struct overlay_params *params, if (params->enabled[OVERLAY_PARAM_ENABLED_cpu_stats]) params->height += (params->font_size - 3); + + if (params->enabled[OVERLAY_PARAM_ENABLED_ram]) + params->height += (params->font_size - 3); + + if (params->enabled[OVERLAY_PARAM_ENABLED_vram]) + params->height += (params->font_size - 3); } diff --git a/src/overlay_params.h b/src/overlay_params.h index 82bf8e0c..fbcfe80a 100644 --- a/src/overlay_params.h +++ b/src/overlay_params.h @@ -41,8 +41,10 @@ extern "C" { OVERLAY_PARAM_BOOL(core_load) \ OVERLAY_PARAM_BOOL(cpu_temp) \ OVERLAY_PARAM_BOOL(gpu_temp) \ - OVERLAY_PARAM_BOOL(cpu_stats) \ - OVERLAY_PARAM_BOOL(gpu_stats) \ + OVERLAY_PARAM_BOOL(cpu_stats) \ + OVERLAY_PARAM_BOOL(gpu_stats) \ + OVERLAY_PARAM_BOOL(ram) \ + OVERLAY_PARAM_BOOL(vram) \ OVERLAY_PARAM_CUSTOM(fps_sampling_period) \ OVERLAY_PARAM_CUSTOM(output_file) \ OVERLAY_PARAM_CUSTOM(position) \