Direct2D Tutorial 10: Timing and Frame Skipping (Patreon)
Published:
2016-01-28 08:53:17
Imported:
2026-06
haven't archived this post yet. have a subscription? use the importer!
Content
This video is all about making sure our programs appear to run at the same speed, regardless of the user's hardware. It is not so easy to simply set the frame rate. We can't be sure the computer running our app isn't very low powered, or perhaps it's running a lot of tasks. It might drop frames, our game could might halve its speed.
What we really want to do is scale the movement of objects with an independent time source. It's pretty simple, we just need to record the amount of time between each frame, and scale the movement of our objects by this time.
We'll look at using QueryPerformanceCounter and QueryPerformanceFrequency to read the time with a non-second precision!
Files
Previews only