From 0e41fb0ec929ba41390aac1db8623c522a7cd59f Mon Sep 17 00:00:00 2001 From: CatChow0 Date: Wed, 1 Oct 2025 16:21:23 +0200 Subject: [PATCH] Patch - Start Implementing FPS Limiter - V14.4.1 Adds an FPS limiter to control the framerate, preventing excessive resource usage and providing a more consistent experience. Removes the standalone FPS limiter from the imguiManager and integrates it into the system class. --- enginecustom/src/inc/system/system_class.h | 3 +++ enginecustom/src/src/system/imguiManager.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/enginecustom/src/inc/system/system_class.h b/enginecustom/src/inc/system/system_class.h index 035a17b..09e407d 100644 --- a/enginecustom/src/inc/system/system_class.h +++ b/enginecustom/src/inc/system/system_class.h @@ -64,6 +64,9 @@ private: bool is_debug_key_pressed_ = false; std::mutex render_mutex_; + + std::unique_ptr fps_limiter_ = std::make_unique(60); + int target_fps_ = 60; }; diff --git a/enginecustom/src/src/system/imguiManager.cpp b/enginecustom/src/src/system/imguiManager.cpp index 1907518..d0ac364 100644 --- a/enginecustom/src/src/system/imguiManager.cpp +++ b/enginecustom/src/src/system/imguiManager.cpp @@ -2,8 +2,6 @@ #include "application_class.h" #include "stats.h" -static fps_limiter fpsLimiter(60.0f); - imguiManager::imguiManager() { io = nullptr; @@ -864,6 +862,8 @@ void imguiManager::WidgetEngineSettingsWindow() ImGui::SetTooltip("Enable or disable Vsync"); } + + float screen_depth = app_->get_screen_depth(); float screen_near = app_->get_screen_near(); // Drag float input for screen depth and near with min and max values and update the app values on change