My goal:
- Implement the game update loop so that it's deterministic (i.e. every frame of updation behaves the same when run multiple times with same frame-input, does not depend on processing speed etc.)
- Limit the framerate of the game at (maximum) 60fps (can be slower if CPU hangs)
What I don't want to do:
- I don't want to use a
delta_time
to compute position updates, because it violates the goal - Don't want to introduce any additional input-lag that would come with any sort of buffering (for interpolating time between frames etc.)
What I came up with:
- I use vsync to guarantee that the game never produces more than 60 fps
- I disallow any screen-mode that is not running at 60Hz because the game would run at different speeds
- I allow windowed mode only if the current screen-mode is at 60Hz
Is there a better approach that what I'm doing to achieve what I want, perhaps without limiting the supported refresh rates?