mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-20 07:54:46 +00:00
cdbfb94c61
Currently the GLUT thread draws the screen too slowly, Ex. The default is supposed to be 60 FPS, but it will always draw a bit slower than 60 FPS. This is because the current logic simply inserts delays for the entire length of a frame, not taking into account how long it took us to render the last frame. The new code uses GetTicks() to measure how much time has passed since the last render, which then lets us calculate the exact amount of delay until the next frame. We additionally then measure how long the delay lasted vs. what we asked for (since any delay we do only has a minimum guarentee, it will ocassionally last a bit longer) and adjust based on that as well. The result is a perfect 60 FPS as long as rendering is quick enough. If the rendering falls behind (Ex. a slow _GL SUB is in the program) then we'll start skipping frames to get back on track. Fixes: #408 |
||
---|---|---|
.. | ||
c | ||
source | ||
support | ||
temp | ||
version.txt |