2020-07-06 17:31:40 +00:00
|
|
|
#pragma once
|
|
|
|
#ifndef MANGOHUD_OVERLAY_PARAMS_H
|
|
|
|
#define MANGOHUD_OVERLAY_PARAMS_H
|
2020-01-28 04:11:05 +00:00
|
|
|
|
2020-03-02 09:35:11 +00:00
|
|
|
#include <string>
|
2020-05-06 02:10:45 +00:00
|
|
|
#include <vector>
|
2020-03-16 16:32:48 +00:00
|
|
|
#include <unordered_map>
|
2020-03-02 09:35:11 +00:00
|
|
|
|
2020-01-28 04:11:05 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
2020-04-01 12:37:42 +00:00
|
|
|
|
|
|
|
#ifndef KeySym
|
|
|
|
typedef unsigned long KeySym;
|
|
|
|
#endif
|
2020-01-28 04:11:05 +00:00
|
|
|
|
2020-03-05 21:19:04 +00:00
|
|
|
#define RGBGetBValue(rgb) (rgb & 0x000000FF)
|
|
|
|
#define RGBGetGValue(rgb) ((rgb >> 8) & 0x000000FF)
|
|
|
|
#define RGBGetRValue(rgb) ((rgb >> 16) & 0x000000FF)
|
|
|
|
|
|
|
|
#define ToRGBColor(r, g, b, a) ((r << 16) | (g << 8) | (b));
|
|
|
|
|
2020-01-28 04:11:05 +00:00
|
|
|
#define OVERLAY_PARAMS \
|
|
|
|
OVERLAY_PARAM_BOOL(fps) \
|
|
|
|
OVERLAY_PARAM_BOOL(frame_timing) \
|
|
|
|
OVERLAY_PARAM_BOOL(core_load) \
|
|
|
|
OVERLAY_PARAM_BOOL(cpu_temp) \
|
2020-11-12 21:27:35 +00:00
|
|
|
OVERLAY_PARAM_BOOL(cpu_power) \
|
2020-01-28 04:11:05 +00:00
|
|
|
OVERLAY_PARAM_BOOL(gpu_temp) \
|
2020-02-05 02:43:44 +00:00
|
|
|
OVERLAY_PARAM_BOOL(cpu_stats) \
|
|
|
|
OVERLAY_PARAM_BOOL(gpu_stats) \
|
|
|
|
OVERLAY_PARAM_BOOL(ram) \
|
|
|
|
OVERLAY_PARAM_BOOL(vram) \
|
2020-02-12 17:24:00 +00:00
|
|
|
OVERLAY_PARAM_BOOL(time) \
|
2020-02-12 15:52:54 +00:00
|
|
|
OVERLAY_PARAM_BOOL(full) \
|
2020-02-18 09:47:58 +00:00
|
|
|
OVERLAY_PARAM_BOOL(read_cfg) \
|
2020-03-01 18:36:55 +00:00
|
|
|
OVERLAY_PARAM_BOOL(io_read) \
|
|
|
|
OVERLAY_PARAM_BOOL(io_write) \
|
2020-11-03 14:35:10 +00:00
|
|
|
OVERLAY_PARAM_BOOL(io_stats) \
|
2020-03-01 21:01:59 +00:00
|
|
|
OVERLAY_PARAM_BOOL(gpu_mem_clock) \
|
|
|
|
OVERLAY_PARAM_BOOL(gpu_core_clock) \
|
2020-05-22 12:44:34 +00:00
|
|
|
OVERLAY_PARAM_BOOL(gpu_power) \
|
2020-03-23 19:11:53 +00:00
|
|
|
OVERLAY_PARAM_BOOL(arch) \
|
2020-02-03 22:31:44 +00:00
|
|
|
OVERLAY_PARAM_BOOL(media_player) \
|
2020-05-02 16:39:39 +00:00
|
|
|
OVERLAY_PARAM_BOOL(version) \
|
2020-05-10 00:22:44 +00:00
|
|
|
OVERLAY_PARAM_BOOL(vulkan_driver) \
|
2020-05-10 00:21:39 +00:00
|
|
|
OVERLAY_PARAM_BOOL(gpu_name) \
|
2020-05-23 21:16:08 +00:00
|
|
|
OVERLAY_PARAM_BOOL(engine_version) \
|
2020-05-24 15:17:17 +00:00
|
|
|
OVERLAY_PARAM_BOOL(histogram) \
|
2020-07-18 19:18:27 +00:00
|
|
|
OVERLAY_PARAM_BOOL(wine) \
|
2020-09-29 04:24:26 +00:00
|
|
|
OVERLAY_PARAM_BOOL(gpu_load_change) \
|
2020-10-05 23:41:59 +00:00
|
|
|
OVERLAY_PARAM_BOOL(cpu_load_change) \
|
2020-11-06 23:01:23 +00:00
|
|
|
OVERLAY_PARAM_BOOL(graphs) \
|
2020-11-09 00:33:38 +00:00
|
|
|
OVERLAY_PARAM_BOOL(legacy_layout) \
|
2020-11-11 22:11:21 +00:00
|
|
|
OVERLAY_PARAM_BOOL(cpu_mhz) \
|
2020-11-16 23:37:03 +00:00
|
|
|
OVERLAY_PARAM_BOOL(frametime) \
|
2020-01-28 04:11:05 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
|
2020-08-15 13:14:55 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(output_folder) \
|
2020-08-16 13:11:53 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(output_file) \
|
2020-03-13 15:18:47 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(font_file) \
|
2020-06-29 14:15:50 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(font_file_text) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(font_glyph_ranges) \
|
2020-09-23 11:02:27 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(no_small_font) \
|
2020-06-29 14:15:50 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(font_size) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(font_size_text) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(font_scale) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(font_scale_media_player) \
|
2020-01-28 04:11:05 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(position) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(width) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(height) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(no_display) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(control) \
|
2020-02-07 11:14:59 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(fps_limit) \
|
2020-02-07 12:12:58 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(vsync) \
|
2020-03-12 10:11:31 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(gl_vsync) \
|
2020-02-09 11:10:41 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(toggle_hud) \
|
2020-08-17 06:09:01 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(toggle_fps_limit) \
|
2020-02-09 11:10:41 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(toggle_logging) \
|
2020-03-13 13:57:11 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(reload_cfg) \
|
2020-06-19 11:57:44 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(upload_log) \
|
2020-08-01 23:10:21 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(upload_logs) \
|
2020-02-10 16:37:37 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(offset_x) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(offset_y) \
|
2020-02-12 03:51:08 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(background_alpha) \
|
2020-03-02 09:35:11 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(time_format) \
|
2020-02-16 00:52:14 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(io_read) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(io_write) \
|
2020-03-10 03:51:27 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(cpu_color) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(gpu_color) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(vram_color) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(ram_color) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(engine_color) \
|
2020-03-10 05:30:37 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(frametime_color) \
|
2020-03-10 06:48:04 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(background_color) \
|
2020-03-10 04:01:31 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(io_color) \
|
2020-03-11 05:20:18 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(text_color) \
|
2020-11-06 23:01:23 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(wine_color) \
|
2020-03-11 05:07:41 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(alpha) \
|
2020-03-13 15:27:45 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(log_duration) \
|
2020-05-02 14:40:05 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(pci_dev) \
|
2020-05-11 19:01:40 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(media_player_name) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(media_player_color) \
|
2020-06-13 19:00:36 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(media_player_order) \
|
2020-06-01 00:08:35 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(cpu_text) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(gpu_text) \
|
2020-06-03 22:52:11 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(log_interval) \
|
2020-06-19 11:57:44 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(permit_upload) \
|
2020-06-18 22:42:25 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(benchmark_percentiles) \
|
2020-09-29 04:24:26 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(help) \
|
2020-10-20 05:11:26 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(gpu_load_value) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(cpu_load_value) \
|
2020-11-06 23:01:23 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(gpu_load_color) \
|
|
|
|
OVERLAY_PARAM_CUSTOM(cpu_load_color) \
|
2020-11-16 11:53:38 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(cellpadding_y) \
|
2020-11-17 14:09:15 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(table_columns) \
|
2020-11-15 05:58:01 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(blacklist) \
|
2020-11-27 13:17:43 +00:00
|
|
|
OVERLAY_PARAM_CUSTOM(autostart_log) \
|
2020-01-28 04:11:05 +00:00
|
|
|
|
|
|
|
enum overlay_param_position {
|
|
|
|
LAYER_POSITION_TOP_LEFT,
|
|
|
|
LAYER_POSITION_TOP_RIGHT,
|
|
|
|
LAYER_POSITION_BOTTOM_LEFT,
|
|
|
|
LAYER_POSITION_BOTTOM_RIGHT,
|
2020-05-04 04:54:25 +00:00
|
|
|
LAYER_POSITION_TOP_CENTER,
|
2020-01-28 04:11:05 +00:00
|
|
|
};
|
|
|
|
|
2020-03-24 19:38:08 +00:00
|
|
|
enum overlay_plots {
|
|
|
|
OVERLAY_PLOTS_frame_timing,
|
|
|
|
OVERLAY_PLOTS_MAX,
|
|
|
|
};
|
|
|
|
|
2020-06-13 19:00:36 +00:00
|
|
|
enum media_player_order {
|
|
|
|
MP_ORDER_TITLE,
|
|
|
|
MP_ORDER_ARTIST,
|
|
|
|
MP_ORDER_ALBUM,
|
|
|
|
};
|
|
|
|
|
2020-06-29 14:15:50 +00:00
|
|
|
enum font_glyph_ranges {
|
|
|
|
FG_KOREAN = (1u << 0),
|
|
|
|
FG_CHINESE_FULL = (1u << 1),
|
|
|
|
FG_CHINESE_SIMPLIFIED = (1u << 2),
|
|
|
|
FG_JAPANESE = (1u << 3),
|
|
|
|
FG_CYRILLIC = (1u << 4),
|
|
|
|
FG_THAI = (1u << 5),
|
|
|
|
FG_VIETNAMESE = (1u << 6),
|
|
|
|
FG_LATIN_EXT_A = (1u << 7),
|
|
|
|
FG_LATIN_EXT_B = (1u << 8),
|
|
|
|
};
|
|
|
|
|
2020-01-28 04:11:05 +00:00
|
|
|
enum overlay_param_enabled {
|
|
|
|
#define OVERLAY_PARAM_BOOL(name) OVERLAY_PARAM_ENABLED_##name,
|
|
|
|
#define OVERLAY_PARAM_CUSTOM(name)
|
|
|
|
OVERLAY_PARAMS
|
|
|
|
#undef OVERLAY_PARAM_BOOL
|
|
|
|
#undef OVERLAY_PARAM_CUSTOM
|
|
|
|
OVERLAY_PARAM_ENABLED_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
struct overlay_params {
|
|
|
|
bool enabled[OVERLAY_PARAM_ENABLED_MAX];
|
|
|
|
enum overlay_param_position position;
|
|
|
|
int control;
|
|
|
|
uint32_t fps_sampling_period; /* us */
|
2020-08-17 06:09:01 +00:00
|
|
|
std::vector<std::uint32_t> fps_limit;
|
2020-01-28 04:11:05 +00:00
|
|
|
bool help;
|
|
|
|
bool no_display;
|
2020-02-12 15:52:54 +00:00
|
|
|
bool full;
|
2020-11-03 14:35:10 +00:00
|
|
|
bool io_read, io_write, io_stats;
|
2020-01-28 04:11:05 +00:00
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
2020-03-10 09:18:59 +00:00
|
|
|
int offset_x, offset_y;
|
2020-02-07 12:12:58 +00:00
|
|
|
unsigned vsync;
|
2020-03-12 10:11:31 +00:00
|
|
|
int gl_vsync;
|
2020-06-11 06:58:29 +00:00
|
|
|
uint64_t log_duration;
|
2020-07-18 19:18:27 +00:00
|
|
|
unsigned cpu_color, gpu_color, vram_color, ram_color, engine_color, io_color, frametime_color, background_color, text_color, wine_color;
|
2020-10-20 03:41:39 +00:00
|
|
|
std::vector<unsigned> gpu_load_color;
|
2020-10-20 04:06:10 +00:00
|
|
|
std::vector<unsigned> cpu_load_color;
|
2020-10-20 05:11:26 +00:00
|
|
|
std::vector<unsigned> gpu_load_value;
|
|
|
|
std::vector<unsigned> cpu_load_value;
|
2020-05-11 19:01:40 +00:00
|
|
|
unsigned media_player_color;
|
2020-11-17 14:09:15 +00:00
|
|
|
unsigned table_columns;
|
2020-09-23 11:02:27 +00:00
|
|
|
bool no_small_font;
|
2020-06-29 14:15:50 +00:00
|
|
|
float font_size, font_scale;
|
|
|
|
float font_size_text;
|
2020-05-24 13:42:35 +00:00
|
|
|
float font_scale_media_player;
|
2020-03-11 05:07:41 +00:00
|
|
|
float background_alpha, alpha;
|
2020-11-16 11:53:38 +00:00
|
|
|
float cellpadding_y;
|
2020-05-06 02:10:45 +00:00
|
|
|
std::vector<KeySym> toggle_hud;
|
2020-08-17 06:09:01 +00:00
|
|
|
std::vector<KeySym> toggle_fps_limit;
|
2020-05-06 02:10:45 +00:00
|
|
|
std::vector<KeySym> toggle_logging;
|
|
|
|
std::vector<KeySym> reload_cfg;
|
2020-06-19 11:57:44 +00:00
|
|
|
std::vector<KeySym> upload_log;
|
2020-08-01 23:10:21 +00:00
|
|
|
std::vector<KeySym> upload_logs;
|
2020-08-16 13:11:53 +00:00
|
|
|
std::string time_format, output_folder, output_file;
|
2020-05-02 14:40:05 +00:00
|
|
|
std::string pci_dev;
|
2020-05-11 19:01:40 +00:00
|
|
|
std::string media_player_name;
|
2020-06-01 00:08:35 +00:00
|
|
|
std::string cpu_text, gpu_text;
|
2020-11-19 00:19:00 +00:00
|
|
|
//std::string blacklist;
|
|
|
|
std::vector<std::string> blacklist;
|
2020-11-27 13:17:43 +00:00
|
|
|
unsigned log_interval, autostart_log;
|
2020-06-13 19:00:36 +00:00
|
|
|
std::vector<media_player_order> media_player_order;
|
2020-06-18 22:42:25 +00:00
|
|
|
std::vector<std::string> benchmark_percentiles;
|
2020-06-29 14:15:50 +00:00
|
|
|
std::string font_file, font_file_text;
|
|
|
|
uint32_t font_glyph_ranges;
|
|
|
|
|
2020-03-16 16:32:48 +00:00
|
|
|
std::string config_file_path;
|
|
|
|
std::unordered_map<std::string,std::string> options;
|
2020-06-19 11:57:44 +00:00
|
|
|
int permit_upload;
|
2020-11-16 13:51:37 +00:00
|
|
|
|
|
|
|
size_t font_params_hash;
|
2020-01-28 04:11:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const extern char *overlay_param_names[];
|
|
|
|
|
|
|
|
void parse_overlay_env(struct overlay_params *params,
|
|
|
|
const char *env);
|
2020-02-15 21:21:32 +00:00
|
|
|
void parse_overlay_config(struct overlay_params *params,
|
|
|
|
const char *env);
|
2020-01-28 04:11:05 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-07-06 17:31:40 +00:00
|
|
|
#endif /* MANGOHUD_OVERLAY_PARAMS_H */
|