gl-loop   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm

Implementation

(define gl-loop
  (lambda (time delta-t)
    (gl_render)
    ;; this won't work in Scheme
    ;; (glfw_swap_buffers window)
    (let* ((cb-lookahead 0.1)
           (t (+ (now) (* cb-lookahead delta-t *second*)))
           (missed-frames (quotient (real->integer (- t time))
                                    (real->integer (* delta-t *second*))))
           (newtime (+ time (* (* (+ missed-frames 2) delta-t) *second*))))
      (if (> missed-frames 0)
          (begin (print-with-colors *impc:compiler:pretty-print-error-color* 'default #t
                                    (print "Warning"))
                 (print ": ")
                 (print-with-colors *impc:compiler:pretty-print-name-color* 'default #t
                                    (print "gl-loop"))
                 (print " couldn't handle the load, dropped ")
                 (print-with-colors *impc:compiler:pretty-print-code-color* 'default #f
                                    (print missed-frames))
                 (print " frames\n")))
      (callback (* newtime cb-lookahead) 'gl-loop newtime delta-t))))


Back to Index

Similar Entries

  • gl-loop    scheme
  • gl-loop    scheme
  • gl-loop    scheme
  • gl-loop    scheme
  • gl-loop    xtlang
  • gl-loop    xtlang
  • gl-loop    xtlang
  • gl-loop    scheme
  • gl-loop    scheme
  • gl-loop    scheme
  • my-gl-loop    xtlang
  • opengl-loop    scheme
  • opengl-loop    scheme
  • opengl-loop    scheme
  • opengl-loop    scheme
  • xtm-setup-and-start-gl-loop    scheme