corregit el comptador de FPS

This commit is contained in:
2025-12-08 22:13:26 +01:00
parent 8886873ed5
commit cd7f06f3a1
5 changed files with 15 additions and 4 deletions

View File

@@ -433,11 +433,13 @@ void SDLManager::updateFPS(float delta_time) {
fps_accumulator_ = 0.0f;
// Actualitzar títol de la finestra
std::string title = std::format("{} v{} ({}) - {} FPS",
std::string vsync_state = (Options::rendering.vsync == 1) ? "ON" : "OFF";
std::string title = std::format("{} v{} ({}) - {} FPS - VSync: {}",
Project::LONG_NAME,
Project::VERSION,
Project::COPYRIGHT,
fps_display_);
fps_display_,
vsync_state);
if (finestra_) {
SDL_SetWindowTitle(finestra_, title.c_str());
@@ -462,6 +464,10 @@ void SDLManager::toggleVSync() {
SDL_SetRenderVSync(renderer_, Options::rendering.vsync);
}
// Reset FPS counter para evitar valores mixtos entre regímenes
fps_accumulator_ = 0.0f;
fps_frame_count_ = 0;
// Guardar configuració
Options::saveToFile();
}