|
|
@ -5,6 +5,7 @@ |
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
|
#include <SDL3/SDL.h>
|
|
|
#include <SDL3/SDL.h>
|
|
|
|
|
|
#include <SDL3/SDL_timer.h>
|
|
|
#ifdef __EMSCRIPTEN__
|
|
|
#ifdef __EMSCRIPTEN__
|
|
|
#include <emscripten.h>
|
|
|
#include <emscripten.h>
|
|
|
#endif
|
|
|
#endif
|
|
|
@ -29,11 +30,12 @@ EmuWindow_SDL3::EmuWindow_SDL3(InputCommon::InputSubsystem* input_subsystem_, Co |
|
|
LOG_CRITICAL(Frontend, "Failed to initialize SDL3: {}, Exiting...", SDL_GetError()); |
|
|
LOG_CRITICAL(Frontend, "Failed to initialize SDL3: {}, Exiting...", SDL_GetError()); |
|
|
exit(1); |
|
|
exit(1); |
|
|
} |
|
|
} |
|
|
titlebar_timer = SDL_AddTimer(2000, [](void *userdata, SDL_TimerID, Uint32) { |
|
|
|
|
|
|
|
|
titlebar_timer = SDL_AddTimer(2000, [](void *userdata, SDL_TimerID, Uint32) -> Uint32 { |
|
|
auto* this_ = (EmuWindow_SDL3*)userdata; |
|
|
auto* this_ = (EmuWindow_SDL3*)userdata; |
|
|
auto const results = this_->system.GetAndResetPerfStats(); |
|
|
auto const results = this_->system.GetAndResetPerfStats(); |
|
|
auto const title = fmt::format("{} | {}-{} | FPS: {:.0f} ({:.0f}%)", Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc, results.average_game_fps, results.emulation_speed * 100.0f); |
|
|
auto const title = fmt::format("{} | {}-{} | FPS: {:.0f} ({:.0f}%)", Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc, results.average_game_fps, results.emulation_speed * 100.0f); |
|
|
SDL_SetWindowTitle(this_->render_window, title.c_str()); |
|
|
SDL_SetWindowTitle(this_->render_window, title.c_str()); |
|
|
|
|
|
return 2000; |
|
|
}, this); |
|
|
}, this); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|