param options for cpu_stats and gpu_stats

pull/20/head
FlightlessMango 4 years ago
parent 04de13987e
commit 68599a02a3

@ -1123,7 +1123,7 @@ static void compute_swapchain_display(struct swapchain_data *data)
} }
if (displayHud){ if (displayHud){
if (device_data->gpu_stats){ if (device_data->gpu_stats && instance_data->params.enabled[OVERLAY_PARAM_ENABLED_gpu_stats]){
ImGui::TextColored(ImVec4(0.180, 0.592, 0.384, 1.00f), "GPU"); ImGui::TextColored(ImVec4(0.180, 0.592, 0.384, 1.00f), "GPU");
ImGui::SameLine(hudFirstRow); ImGui::SameLine(hudFirstRow);
ImGui::Text("%i%%", gpuLoad); ImGui::Text("%i%%", gpuLoad);
@ -1133,15 +1133,18 @@ static void compute_swapchain_display(struct swapchain_data *data)
ImGui::SameLine(hudSecondRow); ImGui::SameLine(hudSecondRow);
ImGui::Text("%i%s", gpuTemp, "°C"); ImGui::Text("%i%s", gpuTemp, "°C");
} }
} }
ImGui::TextColored(ImVec4(0.180, 0.592, 0.796, 1.00f), "CPU"); if(instance_data->params.enabled[OVERLAY_PARAM_ENABLED_cpu_stats]){
ImGui::SameLine(hudFirstRow); ImGui::TextColored(ImVec4(0.180, 0.592, 0.796, 1.00f), "CPU");
ImGui::Text("%d%%", cpuLoadLog); ImGui::SameLine(hudFirstRow);
// ImGui::SameLine(150); ImGui::Text("%d%%", cpuLoadLog);
// ImGui::Text("%s", "%"); // ImGui::SameLine(150);
if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_cpu_temp]){ // ImGui::Text("%s", "%");
ImGui::SameLine(hudSecondRow);
ImGui::Text("%i%s", cpuTemp, "°C"); if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_cpu_temp]){
ImGui::SameLine(hudSecondRow);
ImGui::Text("%i%s", cpuTemp, "°C");
}
} }
if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_core_load]){ if (instance_data->params.enabled[OVERLAY_PARAM_ENABLED_core_load]){

@ -175,6 +175,8 @@ parse_overlay_env(struct overlay_params *params,
params->enabled[OVERLAY_PARAM_ENABLED_core_load] = false; params->enabled[OVERLAY_PARAM_ENABLED_core_load] = false;
params->enabled[OVERLAY_PARAM_ENABLED_cpu_temp] = false; params->enabled[OVERLAY_PARAM_ENABLED_cpu_temp] = false;
params->enabled[OVERLAY_PARAM_ENABLED_gpu_temp] = false; 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->fps_sampling_period = 500000; /* 500ms */ params->fps_sampling_period = 500000; /* 500ms */
params->width = 280; params->width = 280;
params->height = 140; params->height = 140;
@ -217,9 +219,15 @@ parse_overlay_env(struct overlay_params *params,
params->font_size = 24.0f; params->font_size = 24.0f;
if (params->font_size && !heightChanged) if (params->font_size && !heightChanged)
params->height = (params->font_size + 3 * 2) * 3 + FrameTimeGraphHeight; params->height = (params->font_size - 3 * 2) * 3 + FrameTimeGraphHeight;
// Apply more hud height if cores are enabled // Apply more hud height if cores are enabled
if (params->enabled[OVERLAY_PARAM_ENABLED_core_load] && !heightChanged) if (params->enabled[OVERLAY_PARAM_ENABLED_core_load] && !heightChanged)
params->height += ((params->font_size - 3) * get_nprocs()); params->height += ((params->font_size - 3) * get_nprocs());
}
if (params->enabled[OVERLAY_PARAM_ENABLED_gpu_stats])
params->height += (params->font_size - 3);
if (params->enabled[OVERLAY_PARAM_ENABLED_cpu_stats])
params->height += (params->font_size - 3);
}

@ -41,6 +41,8 @@ extern "C" {
OVERLAY_PARAM_BOOL(core_load) \ OVERLAY_PARAM_BOOL(core_load) \
OVERLAY_PARAM_BOOL(cpu_temp) \ OVERLAY_PARAM_BOOL(cpu_temp) \
OVERLAY_PARAM_BOOL(gpu_temp) \ OVERLAY_PARAM_BOOL(gpu_temp) \
OVERLAY_PARAM_BOOL(cpu_stats) \
OVERLAY_PARAM_BOOL(gpu_stats) \
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \ OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_file) \ OVERLAY_PARAM_CUSTOM(output_file) \
OVERLAY_PARAM_CUSTOM(position) \ OVERLAY_PARAM_CUSTOM(position) \

Loading…
Cancel
Save