     (mat4/identity m)
     (mat4/translate m m (clj->js v))))
 
-(defn animate [draw-fn]
-  (letfn [(loop [frame]
-            (fn []
-              (.requestAnimationFrame js/window (loop (inc frame)))
-              (draw-fn frame)))]
-         ((loop 0))))
-  
 ;; Normally this would be a record, but until http://dev.clojure.org/jira/browse/CLJ-1224 is fixed
 ;; it is not performant to memoize records because hashCode values are not cached and are recalculated
 ;; each time.

          _                (log/info "Using font" normal-font)
          default-fg-color [(long default-fg-color-r) (long default-fg-color-g) (long default-fg-color-b)]
          default-bg-color [(long default-bg-color-g) (long default-bg-color-g) (long default-bg-color-b)]
          ;; TODO: create texture atlas
          _                (draw-character-canvas!)
          character-map    (atom (vec (repeat rows (vec (repeat columns (make-terminal-character \space default-fg-color default-bg-color #{}))))))
          cursor-xy        (atom nil)
          ;; adjust canvas height
          _                (dom/setProperties 
                             terminal-canvas-dom
                             (clj->js {:width (* 80 12)

          ;; create texture atlas as gl texture
          characters-texture  (texture/create-texture gl
                                                      :image character-canvas-dom
                                                      :parameters {texture-parameter-name/texture-mag-filter texture-filter/nearest
                                                                   texture-parameter-name/texture-min-filter texture-filter/nearest})
          ;; init shaders
          shader-prog         (init-shaders gl)
          ;; We just need one vertex buffer, a texture-mapped quad will suffice for drawing a character.
          square-vertex-buffer
            (buffers/create-buffer gl
              (ta/float32 [12.0, 16.0, 0.0,
