[Params] Version option

pull/142/head
FlightlessMango 4 years ago
parent 0eaba7bb6c
commit e170e64f9c

@ -10,6 +10,11 @@ cpp = meson.get_compiler('cpp')
prog_python = import('python').find_installation('python3')
null_dep = dependency('', required : false)
mangohud_version = vcs_tag(
command: ['git', 'describe', '--tags', '--dirty=+'],
input: 'version.h.in',
output: 'version.h')
pre_args = [
'-D__STDC_CONSTANT_MACROS',
'-D__STDC_FORMAT_MACROS',

@ -58,6 +58,7 @@
#include "memory.h"
#include "notify.h"
#include "blacklist.h"
#include "version.h"
#ifdef HAVE_DBUS
#include "dbus_info.h"
@ -1135,9 +1136,12 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2&
window_size = ImVec2(params.width, params.height);
unsigned width = ImGui::GetIO().DisplaySize.x;
unsigned height = ImGui::GetIO().DisplaySize.y;
if (!params.no_display){
ImGui::Begin("Main", &open, ImGuiWindowFlags_NoDecoration);
if (params.enabled[OVERLAY_PARAM_ENABLED_version])
ImGui::Text("%s", MANGOHUD_VERSION);
ImGui::Dummy(ImVec2(0, 8.0f));
if (params.enabled[OVERLAY_PARAM_ENABLED_time]){
ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 1.00f), "%s", data.time.c_str());
}

@ -42,6 +42,7 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_BOOL(gpu_core_clock) \
OVERLAY_PARAM_BOOL(arch) \
OVERLAY_PARAM_BOOL(media_player) \
OVERLAY_PARAM_BOOL(version) \
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_file) \
OVERLAY_PARAM_CUSTOM(font_file) \

@ -0,0 +1,3 @@
#pragma once
#define MANGOHUD_VERSION "@VCS_TAG@"
Loading…
Cancel
Save