(define gl-loop
(lambda (time delta-t)
(let ((late-by (- (now) time))
(next-frame-time (+ time (* *second* delta-t))))
(kinect_update_body *kinect* (real->integer width) (real->integer height))
;; (kinect_print_body)
(if (> late-by 0)
(print "Late by " (* 1.0 (/ late-by *second*)) "seconds\n")
(begin
(gl_render)
(gl:swap-buffers *gl-ctx*)))
(callback (* 0.9 next-frame-time)
'gl-loop
next-frame-time
delta-t))))