Akuli / 3d-game-experiment

My experiment at creating a 3D game without libraries for doing 3D stuff
MIT License
0 stars 0 forks source link

sus int div #95

Open Akuli opened 3 years ago

Akuli commented 3 years ago

https://github.com/Akuli/3d-game-experiment/blob/4b1d6e5cf0e3067770c9502d7e7266a0a02e8250/src/looptimer.c#L19

1000/60 = 16.666666666666668 Truncating this can make big error

Akuli commented 3 years ago

The same int division is used to actually control the FPS, so at least these two calculations are consistent, even though the game actually runs at 1000/16 = 62.5 FPS instead of 60 FPS. Maybe this is intentional. It's been a while since I wrote the code :)