# Zero (or a negative value) means no limit.
#
# Applications can modify this value even during the main-loop.
- var maximum_fps = 60.0 is writable
+ var maximum_fps = 0.0 is writable
# Current frame-rate
#
private var frame_count = 0
# Deadline used to compute `current_fps`
- private var frame_count_deadline = 5
+ private var frame_count_deadline = 5.0
# Check and sleep to maintain a frame-rate bellow `maximum_fps`
#
# Is automatically called at the end of `full_frame`.
fun limit_fps
do
- var t = clock.total.sec
+ var t = clock.total
if t >= frame_count_deadline then
var cfps = frame_count.to_f / 5.0
self.current_fps = cfps
frame_count = 0
- frame_count_deadline = t + 5
+ frame_count_deadline = t + 5.0
end
frame_count += 1