2020-11-03 14:34:18 +00:00
|
|
|
#pragma once
|
2021-08-07 12:55:04 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <utility>
|
|
|
|
#include <imgui.h>
|
|
|
|
#include "timing.hpp"
|
2020-11-03 14:35:10 +00:00
|
|
|
|
2021-08-07 12:55:04 +00:00
|
|
|
struct overlay_params;
|
2020-11-03 14:34:18 +00:00
|
|
|
class HudElements{
|
|
|
|
public:
|
2020-11-03 14:35:10 +00:00
|
|
|
struct swapchain_stats *sw_stats;
|
|
|
|
struct overlay_params *params;
|
2021-08-07 12:55:04 +00:00
|
|
|
struct exec_entry {
|
2020-12-14 05:54:29 +00:00
|
|
|
int pos;
|
|
|
|
std::string value;
|
|
|
|
std::string ret;
|
|
|
|
};
|
2020-11-03 14:35:10 +00:00
|
|
|
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;
|
2022-05-15 10:17:32 +00:00
|
|
|
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"
|
|
|
|
};
|
2021-08-07 12:55:04 +00:00
|
|
|
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();
|
2020-11-03 14:35:10 +00:00
|
|
|
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();
|
2021-08-07 12:55:04 +00:00
|
|
|
static void procmem();
|
2020-11-03 14:35:10 +00:00
|
|
|
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();
|
2020-12-09 01:02:50 +00:00
|
|
|
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();
|
2021-06-08 23:04:33 +00:00
|
|
|
static void battery();
|
2022-01-03 03:30:52 +00:00
|
|
|
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();
|
2022-02-09 01:50:01 +00:00
|
|
|
static void gamepad_battery();
|
2022-05-04 04:14:46 +00:00
|
|
|
static void frame_count();
|
2022-04-04 05:07:31 +00:00
|
|
|
static void fan();
|
2022-05-03 09:00:05 +00:00
|
|
|
static void throttling_status();
|
2023-01-08 04:25:50 +00:00
|
|
|
static void exec_name();
|
2020-11-17 18:23:33 +00:00
|
|
|
|
2022-03-13 11:17:38 +00:00
|
|
|
void convert_colors(const struct overlay_params& params);
|
|
|
|
void convert_colors(bool do_conv, const struct overlay_params& params);
|
2020-11-17 18:23:33 +00:00
|
|
|
struct hud_colors {
|
|
|
|
bool convert, update;
|
|
|
|
ImVec4 cpu,
|
|
|
|
gpu,
|
|
|
|
vram,
|
|
|
|
ram,
|
2020-12-13 10:07:17 +00:00
|
|
|
swap,
|
2020-11-17 18:23:33 +00:00
|
|
|
engine,
|
|
|
|
io,
|
|
|
|
frametime,
|
|
|
|
background,
|
|
|
|
text,
|
|
|
|
media_player,
|
|
|
|
wine,
|
2021-03-25 00:16:58 +00:00
|
|
|
battery,
|
2020-11-17 18:23:33 +00:00
|
|
|
gpu_load_low,
|
2020-11-26 01:39:02 +00:00
|
|
|
gpu_load_med,
|
|
|
|
gpu_load_high,
|
|
|
|
cpu_load_low,
|
2020-11-17 18:23:33 +00:00
|
|
|
cpu_load_med,
|
2020-12-10 03:36:45 +00:00
|
|
|
cpu_load_high,
|
|
|
|
fps_value_low,
|
|
|
|
fps_value_med,
|
|
|
|
fps_value_high;
|
2020-11-17 18:23:33 +00:00
|
|
|
} colors {};
|
2021-03-25 00:16:58 +00:00
|
|
|
|
2020-11-03 14:34:18 +00:00
|
|
|
};
|
|
|
|
|
2020-11-03 20:58:40 +00:00
|
|
|
extern HudElements HUDElements;
|