Browse Source

[Params] Version option

pull/142/head
FlightlessMango 1 year ago
parent
commit
e170e64f9c
4 changed files with 14 additions and 1 deletions
  1. +5
    -0
      meson.build
  2. +5
    -1
      src/overlay.cpp
  3. +1
    -0
      src/overlay_params.h
  4. +3
    -0
      version.h.in

+ 5
- 0
meson.build View File

@ -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',

+ 5
- 1
src/overlay.cpp View File

@ -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());
}

+ 1
- 0
src/overlay_params.h View File

@ -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) \

+ 3
- 0
version.h.in View File

@ -0,0 +1,3 @@
#pragma once
#define MANGOHUD_VERSION "@VCS_TAG@"

Loading…
Cancel
Save