MangoHud/src/hud_elements.h

102 lines
3.1 KiB
C
Raw Normal View History

2020-11-03 14:34:18 +00:00
#pragma once
#include <vector>
#include <string>
#include <utility>
#include <imgui.h>
#include "timing.hpp"
struct overlay_params;
2020-11-03 14:34:18 +00:00
class HudElements{
public:
struct swapchain_stats *sw_stats;
struct overlay_params *params;
struct exec_entry {
2020-12-14 05:54:29 +00:00
int pos;
std::string value;
std::string ret;
};
float ralign_width;
float old_scale;
2020-11-30 20:11:38 +00:00
float res_width, res_height;
2020-12-14 19:11:14 +00:00
bool is_vulkan, gamemode_bol = false, vkbasalt_bol = false;
2020-11-06 23:01:23 +00:00
int place;
int text_column = 1;
2020-12-14 05:54:29 +00:00
Clock::time_point last_exec;
2020-11-06 23:01:23 +00:00
std::vector<std::pair<std::string, std::string>> options;
std::vector<std::pair<void(*)(), std::string >> ordered_functions;
2020-11-08 17:25:26 +00:00
int min, max, gpu_core_max, gpu_mem_max, cpu_temp_max, gpu_temp_max;
2021-07-30 16:11:13 +00:00
const std::vector<std::string> permitted_params = {
2020-11-09 00:33:38 +00:00
"gpu_load", "cpu_load", "gpu_core_clock", "gpu_mem_clock",
"vram", "ram", "cpu_temp", "gpu_temp"
};
std::vector<exec_entry> exec_list;
2021-07-30 16:11:13 +00:00
void sort_elements(const std::pair<std::string, std::string>& option);
2020-11-09 00:33:38 +00:00
void legacy_elements();
2020-12-14 05:54:29 +00:00
void update_exec();
static void version();
static void time();
static void gpu_stats();
static void cpu_stats();
static void core_load();
static void io_stats();
static void vram();
static void ram();
static void procmem();
static void fps();
static void engine_version();
static void gpu_name();
static void vulkan_driver();
static void arch();
static void wine();
static void frame_timing();
2020-11-03 20:58:40 +00:00
static void media_player();
2020-11-30 20:11:38 +00:00
static void resolution();
2020-12-01 02:36:20 +00:00
static void show_fps_limit();
static void custom_text_center();
static void custom_text();
2020-12-14 19:11:14 +00:00
static void vkbasalt();
static void gamemode();
2020-11-06 23:01:23 +00:00
static void graphs();
2020-12-14 05:54:29 +00:00
static void _exec();
static void battery();
static void fps_only();
2022-02-08 23:32:17 +00:00
static void gamescope_fsr();
2022-02-15 09:19:02 +00:00
static void gamescope_frame_timing();
static void gamepad_battery();
static void frame_count();
2022-04-04 05:07:31 +00:00
static void fan();
static void throttling_status();
2023-01-08 04:25:50 +00:00
static void exec_name();
void convert_colors(const struct overlay_params& params);
void convert_colors(bool do_conv, const struct overlay_params& params);
struct hud_colors {
bool convert, update;
ImVec4 cpu,
gpu,
vram,
ram,
2020-12-13 10:07:17 +00:00
swap,
engine,
io,
frametime,
background,
text,
media_player,
wine,
battery,
gpu_load_low,
gpu_load_med,
gpu_load_high,
cpu_load_low,
cpu_load_med,
2020-12-10 03:36:45 +00:00
cpu_load_high,
fps_value_low,
fps_value_med,
fps_value_high;
} colors {};
2020-11-03 14:34:18 +00:00
};
2020-11-03 20:58:40 +00:00
extern HudElements HUDElements;