                                   line))
                    character-matrix))))
 
+;; A map from \character to [x1 y1 x2 y2] in the character atlas where
+;;    [x1 y1]
+;;    +--------+
+;;    |        |
+;;    |        |
+;;    +--------+
+;;              [x2 y2]
 (def character->pos
   (reduce (fn [m [c x y]]
             (assoc m c [x y (+ x 12) (+ y 16)]))

                                                char-width
                                                y))))
                               (.dispose offscreen-graphics-2d)
                               glyph-image)))
          key-queue        (LinkedBlockingQueue.)
          on-key-fn        (or on-key-fn
                               (fn default-on-key-fn [k]

(ns robinson.webglterminal
  (:use     robinson.common
            robinson.aterminal)
  (:require [taoensso.timbre :as timbre]
            [monet.canvas :as canvas]))

(def character-canvas-dom (.getElementById js/document "character-canvas"))
(def character-canvas (canvas/init character-canvas-dom "2d"))

(def terminal-canvas-dom (.getElementById js/document "terminal-canvas"))
(def terminal-canvas (canvas/init terminal-canvas-dom "2d"))

(timbre/refer-timbre)
(set! *warn-on-reflection* true)
