Params to override cpu/gpu text

pull/197/head
FlightlessMango 4 years ago
parent d66790fd43
commit 2d0ba9a076

@ -1292,7 +1292,12 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2&
ImGui::BeginTable("hud", params.tableCols);
if (params.enabled[OVERLAY_PARAM_ENABLED_gpu_stats]){
ImGui::TableNextRow();
ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(params.gpu_color), "GPU");
const char* gpu_text;
if (params.gpu_text.empty())
gpu_text = "gPU";
else
gpu_text = params.gpu_text.c_str();
ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(params.gpu_color), gpu_text);
ImGui::TableNextCell();
right_aligned_text(char_width * 4, "%i", gpu_info.load);
ImGui::SameLine(0, 1.0f);
@ -1327,7 +1332,12 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2&
}
if(params.enabled[OVERLAY_PARAM_ENABLED_cpu_stats]){
ImGui::TableNextRow();
ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(params.cpu_color), "CPU");
const char* cpu_text;
if (params.cpu_text.empty())
cpu_text = "CPU";
else
cpu_text = params.cpu_text.c_str();
ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(params.cpu_color), cpu_text);
ImGui::TableNextCell();
right_aligned_text(char_width * 4, "%d", data.total_cpu);
ImGui::SameLine(0, 1.0f);

@ -197,6 +197,8 @@ parse_path(const char *str)
#define parse_pci_dev(s) parse_str(s)
#define parse_media_player_name(s) parse_str(s)
#define parse_font_scale_media_player(s) parse_font_size(s)
#define parse_cpu_text(s) parse_str(s)
#define parse_gpu_text(s) parse_str(s)
#define parse_cpu_color(s) parse_color(s)
#define parse_gpu_color(s) parse_color(s)

@ -84,6 +84,8 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_CUSTOM(pci_dev) \
OVERLAY_PARAM_CUSTOM(media_player_name) \
OVERLAY_PARAM_CUSTOM(media_player_color) \
OVERLAY_PARAM_CUSTOM(cpu_text) \
OVERLAY_PARAM_CUSTOM(gpu_text) \
OVERLAY_PARAM_CUSTOM(help)
enum overlay_param_position {
@ -136,6 +138,7 @@ struct overlay_params {
std::string time_format, output_file, font_file;
std::string pci_dev;
std::string media_player_name;
std::string cpu_text, gpu_text;
std::string config_file_path;
std::unordered_map<std::string,std::string> options;

Loading…
Cancel
Save