Open VisenDev opened 2 months ago
I never thought of having a minimum refresh interval. My initial reaction is that I wouldn't want the app to do anything without getting input - that would be surprising to me. But I understand your desire to not have a very old frame giving a wrong appearance.
If the app was minimized, we wouldn't want it, which would require tracking the minimized state. So it adds some complexity, but also some benefit.
For anybody else reading this, please comment. For an app that only does stuff in reaction to input events (think a photo editor, not a game), would you be surprised if the app had a minimum refresh rate, like 1 FPS?
For anybody else reading this, please comment. For an app that only does stuff in reaction to input events (think a photo editor, not a game), would you be surprised if the app had a minimum refresh rate, like 1 FPS?
Such an application would have no reason for doing so, but for the dvui demo trying to demonstrate dvui's low fps event processing abilities - such inaccurate FPS numbers are confusing and obscure what dvui is actually doing.
At the very least, I would like for the demos to have an accurate FPS counter
Good point - maybe we put something extra in the examples.
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.