Skip to content

Commit

Permalink
Update Application::Run()
Browse files Browse the repository at this point in the history
  • Loading branch information
xorz57 committed Jan 25, 2024
1 parent b93914b commit 3b9e8c2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ void Application::Run() {
}

const sf::Time deltaTime = deltaClock.restart();
accumulator += timeScale * deltaTime;
const sf::Time scaledDeltaTime = timeScale * deltaTime;
accumulator += scaledDeltaTime;
while (accumulator > fixedDeltaTime) {
FixedUpdate(fixedDeltaTime);
accumulator -= fixedDeltaTime;
Expand Down Expand Up @@ -116,8 +117,10 @@ void Application::Run() {
}

ImGui::Begin("Statistics");
ImGui::Text("deltaTime : %.5lf", deltaTime.asSeconds());
ImGui::Text("fixedDeltaTime : %.5lf", fixedDeltaTime.asSeconds());
ImGui::Text("timeScale : %.5f", timeScale);
ImGui::Text("deltaTime : %.5f", deltaTime.asSeconds());
ImGui::Text("scaledDeltaTime : %.5f", scaledDeltaTime.asSeconds());
ImGui::Text("fixedDeltaTime : %.5f", fixedDeltaTime.asSeconds());
ImGui::End();

ImGui::SFML::Render(window);
Expand Down

0 comments on commit 3b9e8c2

Please sign in to comment.