4 ms·
For reference, SuperTux's code: https://github.com/SuperTux/supertux/blob/8d79ac7ce4db5e42258c6fbd7e93bfb5a11f2f82/src/supertux/screen_manager.cpp#L564-L653 htt
by Mathnerd314 2y ago
For reference, SuperTux's code: https://github.com/SuperTux/supertux/blob/8d79ac7ce4db5e42258c6fbd7e93bfb5a11f2f82/src/supertux/screen_manager.cpp#L564-L653 https://github.com/SuperTux/supertux/blob/8d79ac7ce4db5e4225... (disclosure: not code I wrote, but I've tweaked it here and there)
The idea is similarly to just simulate one logical step at a time, with the fixed timestep (this is important because SuperTux uses simple Euler integration which is timestep-sensitive). But there is tracking code that sleeps / adds extra logical steps between frames so the rate of logical frames ends up corresponding closely to the rate of rendered frames. And as with the final solution here there's no interpolation in rendering, you just display the latest game state without storing the previous.