Handmade Hero»Forums»Code
Kareem
7 posts
Day 018, factoring in buffer display time!
Hello,

At the end of the game loop, we display the prepared buffer. This should take almost constant amount of time since the same thing is done every iteration.

However, this time is not factored in the time allocated for every frame. We wait for the entire target time of a frame before we actually draw.

Shouldn't we reduce the target frame time a little bit to factor in the time needed for the buffer update?
Mārtiņš Možeiko
2562 posts / 2 projects
Day 018, factoring in buffer display time!
Don't worry much about this code. Few weeks ago (don't remember exact day, but somewhere in middle of debug UI code) Casey said that all that timing code doesn't work really well and commented it all out. So now we are not sleeping at all.
Kareem
7 posts
Day 018, factoring in buffer display time!
Thanks for pointing that out, mmozeiko.