Browse Source

fix build err

lizzie/rework-sdl3-cs
lizzie 3 days ago
parent
commit
2fa963e7b1
  1. 4
      src/yuzu_cmd/emu_window/emu_window_sdl3.cpp

4
src/yuzu_cmd/emu_window/emu_window_sdl3.cpp

@ -5,6 +5,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <SDL3/SDL.h>
#include <SDL3/SDL_timer.h>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@ -29,11 +30,12 @@ EmuWindow_SDL3::EmuWindow_SDL3(InputCommon::InputSubsystem* input_subsystem_, Co
LOG_CRITICAL(Frontend, "Failed to initialize SDL3: {}, Exiting...", SDL_GetError());
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 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);
SDL_SetWindowTitle(this_->render_window, title.c_str());
return 2000;
}, this);
}

Loading…
Cancel
Save