Add gamemode and vkbasalt function

pull/443/head
flightlessmango 4 years ago
parent 1d8f4b79c1
commit 05cf9fc5d6

@ -543,6 +543,28 @@ void HudElements::_exec(){
ImGui::PopFont();
}
void HudElements::gamemode(){
if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_gamemode]){
ImGui::TableNextRow();
ImGui::PushFont(HUDElements.sw_stats->font1);
ImGui::TextColored(HUDElements.colors.engine, "%s", "GAMEMODE");
ImGui::TableNextCell();
right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width, "%s", HUDElements.gamemode_bol ? "ON" : "OFF");
ImGui::PopFont();
}
}
void HudElements::vkbasalt(){
if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_vkbasalt]){
ImGui::TableNextRow();
ImGui::PushFont(HUDElements.sw_stats->font1);
ImGui::TextColored(HUDElements.colors.engine, "%s", "VKBASALT");
ImGui::TableNextCell();
right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width, "%s", HUDElements.vkbasalt_bol ? "ON" : "OFF");
ImGui::PopFont();
}
}
void HudElements::graphs(){
ImGui::TableNextRow();
ImGui::Dummy(ImVec2(0.0f, real_font_size.y));
@ -690,6 +712,8 @@ void HudElements::sort_elements(std::pair<std::string, std::string> option){
if (param == "show_fps_limit") { ordered_functions.push_back({show_fps_limit, value}); }
if (param == "custom_text") { ordered_functions.push_back({custom_text, value}); }
if (param == "custom_text_center") { ordered_functions.push_back({custom_text_center, value}); }
if (param == "gamemode") { ordered_functions.push_back({gamemode, value}); }
if (param == "vkbasalt") { ordered_functions.push_back({vkbasalt, value}); }
if (param == "exec") { ordered_functions.push_back({_exec, value});
exec_list.push_back({ordered_functions.size() - 1, value}); }
if (param == "graphs"){
@ -726,6 +750,8 @@ void HudElements::legacy_elements(){
ordered_functions.push_back({wine, value});
ordered_functions.push_back({frame_timing, value});
ordered_functions.push_back({media_player, value});
ordered_functions.push_back({gamemode, value});
ordered_functions.push_back({vkbasalt, value});
}
void HudElements::update_exec(){

@ -18,7 +18,7 @@ class HudElements{
float ralign_width;
float old_scale;
float res_width, res_height;
bool is_vulkan;
bool is_vulkan, gamemode_bol = false, vkbasalt_bol = false;
int place;
Clock::time_point last_exec;
std::vector<std::pair<std::string, std::string>> options;
@ -52,6 +52,8 @@ class HudElements{
static void show_fps_limit();
static void custom_text_center();
static void custom_text();
static void vkbasalt();
static void gamemode();
static void graphs();
static void _exec();

@ -65,6 +65,8 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_BOOL(custom_text_center) \
OVERLAY_PARAM_BOOL(custom_text) \
OVERLAY_PARAM_BOOL(exec) \
OVERLAY_PARAM_BOOL(vkbasalt) \
OVERLAY_PARAM_BOOL(gamemode) \
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_folder) \
OVERLAY_PARAM_CUSTOM(output_file) \

@ -35,6 +35,7 @@
#include <array>
#ifdef __gnu_linux__
#include <libgen.h>
#include <unistd.h>
#endif
#include <vulkan/vulkan.h>
@ -656,7 +657,16 @@ void init_system_info(){
else {
wineVersion = "";
}
// check for gamemode and vkbasalt
auto pid = getpid();
string command = "lsof -p " + to_string(pid) + " | grep gamemode";
string ret = exec(command);
if (!ret.empty())
HUDElements.gamemode_bol = true;
command = "lsof -p " + to_string(pid) + " | grep vkbasalt";
ret = exec(command);
if (!ret.empty())
HUDElements.vkbasalt_bol = true;
//driver = itox(device_data->properties.driverVersion);
if (ld_preload)

Loading…
Cancel
Save