dvui icon indicating copy to clipboard operation
dvui copied to clipboard

Inaccurate FPS Counter

Open VisenDev opened this issue 6 months ago • 3 comments

When looking at the SDL demo, the FPS number remains static when the window is not receiving any input. I assume that this is because the window is not rendering any frames until it receives input. So the real FPS is 0, but the screen shows something else since no frame has been rendered to update it. (As best I can tell)

I am not sure if I have diagnosed this correctly, but if I have, setting a minimum FPS would be be one way of fixing the inaccurate FPS display. If the FPS never falls below, say, 1 frame a second, the FPS display would always be correct even at low FPS.

Another way of fixing this would be rendering frames after exponentially longer intervals whenever no input it received.

For example, If no input is received, render a frame after 1 second, then after 2, then after 4, then after 8, etc... Thus the FPS display could be updated while the actual FPS is still decreasing.

VisenDev avatar Aug 11 '24 23:08 VisenDev