Skip to content

Update templates and sample code to better support pausing - #3355

Open
ds5678 wants to merge 1 commit into
stride3d:masterfrom
ds5678:improve-sample-code-for-pausing
Open

Update templates and sample code to better support pausing#3355
ds5678 wants to merge 1 commit into
stride3d:masterfrom
ds5678:improve-sample-code-for-pausing

Conversation

@ds5678

@ds5678 ds5678 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

PR Details

A couple places incorrectly used Game.DrawTime in an Update method. I replaced them with with Game.UpdateTime.

#2999 says that the proper way to do game pausing for animations, particles, and physics is to set Game.UpdateTime.Factor to zero. However, most of the sample code used Game.UpdateTime.Elapsed instead of Game.UpdateTime.WarpElapsed. Game.UpdateTime.WarpElapsed is equal to Game.UpdateTime.Factor * Game.UpdateTime.Elapsed. Both are automatically calculated every frame, so there is no performance difference for using one over the other.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

A couple places incorrectly used `Game.DrawTime` in an `Update` method. I replaced them with with `Game.UpdateTime`.

stride3d#2999 says that the proper way to do game pausing for animations, particles, and physics is to set `Game.UpdateTime.Factor` to zero. However, most of the sample code used `Game.UpdateTime.Elapsed` instead of `Game.UpdateTime.WarpElapsed`. `Game.UpdateTime.WarpElapsed` is equal to `Game.UpdateTime.Factor * Game.UpdateTime.Elapsed`. Both are automatically calculated every frame, so there is no performance difference for using one over the other.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant