From e1b7e973486c5e43c460773768feb53031d97e8d Mon Sep 17 00:00:00 2001 From: Sara Gerretsen Date: Thu, 4 Sep 2025 22:19:39 +0200 Subject: [PATCH] feat: loop(...) now takes a `delta double` arg --- src/CHANGEME.cpp | 2 +- src/main.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CHANGEME.cpp b/src/CHANGEME.cpp index 2d00750..ff25b26 100644 --- a/src/CHANGEME.cpp +++ b/src/CHANGEME.cpp @@ -21,7 +21,7 @@ void setup() { ); } -void loop() { +void loop(double delta) { } void draw_scene(sf::RenderTarget &target, sf::RenderStates const &states) { diff --git a/src/main.cpp b/src/main.cpp index 4ca7772..8d897e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -54,9 +54,9 @@ int main() { // Event Polling poll_events(); // Update - loop(); - draw_scene(window); - ImGui::SFML::Update(window, deltaClock.restart()); + sf::Time const deltaTime{ deltaClock.restart() }; + ImGui::SFML::Update(window, deltaTime); + loop(deltaTime.asSeconds()); if(ImGui::BeginMainMenuBar()) { draw_main_menu_bar(); ImGui::EndMainMenuBar();