(install-frame-handler)
install the frame callback to send frame chan messages
install the frame callback to send frame chan messages
(install-resize-handler)
install the resize callback to resize the main canvas renderer
install the resize callback to resize the main canvas renderer
(make-request-animation-frame)
compose a function that is the r-a-f func. returns a function. This returned function takes a callback and ensures its called next frame
compose a function that is the r-a-f func. returns a function. This returned function takes a callback and ensures its called next frame
(next-frame)
returns a single use channel which closes on next frame callback. pulling from it waits exactly one frame. eg
;; wait one frame
(<! (next-frame))
returns a single use channel which closes on next frame callback. pulling from it waits exactly one frame. eg ``` ;; wait one frame (<! (next-frame)) ```
schedules the passed in callback to be fired once, next animation frame.
schedules the passed in callback to be fired once, next animation frame.
(wait-frames frames)
returns a channel which closes when a certain number of frames have passed. eg
;; wait 10 frames
(<! (wait-frames 10))
returns a channel which closes when a certain number of frames have passed. eg ``` ;; wait 10 frames (<! (wait-frames 10)) ```
(wait-time delay)
returns a channel which closes when a certain amount of time in milliseconds has passed, but determines that time by counting the requestAnimationFrame callbacks, so that when tab focus is lost, the callback, and thus this wait is suspended.
;; wait one seconds worth of frames
(<! (wait-time 1000))
returns a channel which closes when a certain amount of time in milliseconds has passed, but determines that time by counting the requestAnimationFrame callbacks, so that when tab focus is lost, the callback, and thus this wait is suspended. ``` ;; wait one seconds worth of frames (<! (wait-time 1000)) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close