diff options
author | jroweboy <jroweboy@gmail.com> | 2019-09-22 15:40:57 +0200 |
---|---|---|
committer | FearlessTobi <thm.frey@gmail.com> | 2019-09-22 15:49:39 +0200 |
commit | 64dbc92b614bfa388d31007788bf725c4e4b59e3 (patch) | |
tree | 45a929441460b900174e33b13f1997e8986d3507 /src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |
parent | Merge pull request #2867 from ReinUsesLisp/configure-framebuffers-clean (diff) | |
download | yuzu-64dbc92b614bfa388d31007788bf725c4e4b59e3.tar yuzu-64dbc92b614bfa388d31007788bf725c4e4b59e3.tar.gz yuzu-64dbc92b614bfa388d31007788bf725c4e4b59e3.tar.bz2 yuzu-64dbc92b614bfa388d31007788bf725c4e4b59e3.tar.lz yuzu-64dbc92b614bfa388d31007788bf725c4e4b59e3.tar.xz yuzu-64dbc92b614bfa388d31007788bf725c4e4b59e3.tar.zst yuzu-64dbc92b614bfa388d31007788bf725c4e4b59e3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index a6edc089a..aa69cc9c8 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp @@ -4,6 +4,8 @@ #include <SDL.h> #include "common/logging/log.h" +#include "common/scm_rev.h" +#include "core/core.h" #include "input_common/keyboard.h" #include "input_common/main.h" #include "input_common/motion_emu.h" @@ -170,6 +172,16 @@ void EmuWindow_SDL2::PollEvents() { break; } } + + const u32 current_time = SDL_GetTicks(); + if (current_time > last_time + 2000) { + const auto results = Core::System::GetInstance().GetAndResetPerfStats(); + const auto title = fmt::format( + "yuzu {} | {}-{} | FPS: {:.0f} ({:.0%})", Common::g_build_fullname, + Common::g_scm_branch, Common::g_scm_desc, results.game_fps, results.emulation_speed); + SDL_SetWindowTitle(render_window, title.c_str()); + last_time = current_time; + } } void EmuWindow_SDL2::OnMinimalClientAreaChangeRequest(std::pair<unsigned, unsigned> minimal_size) { |