Open mstoeckl opened 3 months ago
I've tried it on a 120 Hz display and didn't notice a change in the amount of jittering. master: https://github.com/SuperTux/supertux/assets/3192173/d8e3f7cb-96e7-47d6-8c15-4e080332fdbb this PR: https://github.com/SuperTux/supertux/assets/3192173/ee983f0d-6637-4ab2-84ba-684deaabfcd9 I don't know if it happens because my system is too slow or if it happens for another reason. The minimum and maximum FPS both differ a lot from 120 Hz for me.
I don't see any disadvantage of using a time with higher precision.
@Vankata453 Please merge this as well.
Currently, because inverse frame rates are rounded to milliseconds in
src/supertux/screen_manager.cpp
, the only possible logical frame rates are 1/0.016 = 62.5fps, 1/0.015 = 66.66fps, 1/0.014 = 71.43fps, etc. (The current valueLOGICAL_FPS=64.f
gets rounded to 66.66.).This PR makes it possible to change the logical FPS to arbitrary values (like 120fps, if we want a multiple of the most common monitor refresh rate). It should also very slightly reduce jitter from time measurements on high frame rate displays.