 ;;
 ;; Animation handler
 ;;
+(def fallback-fps 60)
+
 (defn 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"

   #(.msRequestAnimationFrame js/window %)

   :else
   #(.setTimeout js/window % (/ 1000 *target-fps*))))

;; build the actual function
(def

  (request-animation-frame frame-event-chan-handler)
  (doseq [c @*frame-chans*] (put! c true)))

(defn install-frame-handler!
  "install the frame callback to send frame chan messages"
  []
  (request-animation-frame frame-event-chan-handler))

;; install all the event channel handlers
(install-key-handler!)
(install-frame-handler!)
(install-resize-handler!)

;;
;; gamepad wrapper
