diff --git a/bin/MangoHud.conf b/bin/MangoHud.conf index eaa04b77..b1509216 100644 --- a/bin/MangoHud.conf +++ b/bin/MangoHud.conf @@ -87,6 +87,7 @@ fps # fps_value=30,60 # fps_color=B22222,FDFD09,39F900 frametime +# framecount ### Display miscellaneous information # engine_version diff --git a/src/hud_elements.cpp b/src/hud_elements.cpp index 56ca2833..05a6cce1 100644 --- a/src/hud_elements.cpp +++ b/src/hud_elements.cpp @@ -914,6 +914,18 @@ void HudElements::gamepad_battery() #endif } +void HudElements::framecount(){ + if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_framecount]){ + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + ImGui::PushFont(HUDElements.sw_stats->font1); + ImGui::TextColored(HUDElements.colors.engine, "Frame Count"); + ImGui::TableNextColumn(); + right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width, "%llu", HUDElements.sw_stats->n_frames); + ImGui::PopFont(); + } +} + void HudElements::graphs(){ ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::Dummy(ImVec2(0.0f, real_font_size.y)); @@ -1066,6 +1078,7 @@ void HudElements::sort_elements(const std::pair& optio if (param == "fsr") { ordered_functions.push_back({gamescope_fsr, value}); } if (param == "debug") { ordered_functions.push_back({gamescope_frame_timing, value}); } if (param == "gamepad_battery") { ordered_functions.push_back({gamepad_battery, value}); } + if (param == "framecount") { ordered_functions.push_back({framecount, value}); } if (param == "graphs"){ if (!HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_graphs]) HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_graphs] = true; @@ -1109,6 +1122,7 @@ void HudElements::legacy_elements(){ ordered_functions.push_back({wine, value}); #endif ordered_functions.push_back({frame_timing, value}); + ordered_functions.push_back({framecount, value}); ordered_functions.push_back({gamescope_frame_timing, value}); #ifndef MANGOAPP ordered_functions.push_back({gamemode, value}); diff --git a/src/hud_elements.h b/src/hud_elements.h index 87e1891a..30542489 100644 --- a/src/hud_elements.h +++ b/src/hud_elements.h @@ -62,6 +62,7 @@ class HudElements{ static void gamescope_fsr(); static void gamescope_frame_timing(); static void gamepad_battery(); + static void framecount(); void convert_colors(struct overlay_params& params); void convert_colors(bool do_conv, struct overlay_params& params); diff --git a/src/overlay_params.h b/src/overlay_params.h index 2054f109..57a21388 100644 --- a/src/overlay_params.h +++ b/src/overlay_params.h @@ -63,6 +63,7 @@ typedef unsigned long KeySym; OVERLAY_PARAM_BOOL(legacy_layout) \ OVERLAY_PARAM_BOOL(cpu_mhz) \ OVERLAY_PARAM_BOOL(frametime) \ + OVERLAY_PARAM_BOOL(framecount) \ OVERLAY_PARAM_BOOL(resolution) \ OVERLAY_PARAM_BOOL(show_fps_limit) \ OVERLAY_PARAM_BOOL(fps_color_change) \