MangoHud/src/hud_elements.h

94 lines
2.8 KiB
C
Raw Permalink 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;
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;
2021-09-17 23:43:36 +00:00
float min, max;
int 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();
void convert_colors(struct overlay_params& params);
void convert_colors(bool do_conv, 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;