Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frame count #709

Merged
merged 1 commit into from
Mar 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/MangoHud.conf
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ fps
# fps_value=30,60
# fps_color=B22222,FDFD09,39F900
frametime
# framecount

### Display miscellaneous information
# engine_version
Expand Down
14 changes: 14 additions & 0 deletions src/hud_elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -1066,6 +1078,7 @@ void HudElements::sort_elements(const std::pair<std::string, std::string>& 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;
Expand Down Expand Up @@ -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});
Expand Down
1 change: 1 addition & 0 deletions src/hud_elements.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/overlay_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down