feat: loop(...) now takes a delta double arg

This commit is contained in:
Sara Gerretsen 2025-09-04 22:19:39 +02:00
parent a8f7525576
commit e1b7e97348
2 changed files with 4 additions and 4 deletions

View file

@ -21,7 +21,7 @@ void setup() {
);
}
void loop() {
void loop(double delta) {
}
void draw_scene(sf::RenderTarget &target, sf::RenderStates const &states) {

View file

@ -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();