Open soulweaver91 opened 8 years ago
Attempted some approaches:
QTimer
, and sleeping with QThread::usleep
with timekeeping by QElapsedTimer::nsecsElapsed()
. The loop ended up going from too fast to too slow.QTimer
between 14 and 15 ms, again keeping time with QElapsedTimer
. It managed to slightly drop the FPS to a relatively stable ~71 (14.05 ms/frame), but that still isn't good enough to claim it runs at 70 FPS.
Right now, the core timer is based on
QTimer
. It only supports intervals rounding to whole milliseconds, so effectively there is a new frame every 14 ms instead of the desired ~14.29 ms, resulting in an effective FPS of ~71.43.There should be a way to bring this to exactly 70 FPS. (Ideally, game logic loop should be separated at some level from the graphics loop anyway – right now they are tied together very closely.)