                                      (.drawLine 0
                                                 y
                                                 char-width
-                                                y))))))
-          key-queue        []#_(LinkedBlockingQueue.)
-          on-key-fn        (or on-key-fn
-                               (fn default-on-key-fn [k]
-                                 (.add key-queue k)))
-          terminal-renderer nil #_(proxy [JComponent] []
-                             (getPreferredSize []
-                               (let [graphics      ^Graphics    (proxy-super getGraphics)
-                                     font-metrics  ^FontMetrics (.getFontMetrics graphics normal-font)
-                                     screen-width               (* columns (.charWidth font-metrics \space))
-                                     screen-height              (* rows (.getHeight font-metrics))
-                                     char-width                 (/ screen-width columns)
-                                     char-height                (/ screen-height rows)]
-                                 (Dimension. screen-width screen-height)))
-                             (paintComponent [^Graphics graphics]
-                               (log-time "blit"
-                                 (let [graphics-2d ^Graphics2D           (.create graphics)
-                                       font-metrics ^FontMetrics         (.getFontMetrics graphics normal-font)
-                                       screen-width                      (* columns (.charWidth font-metrics \space))
-                                       screen-height                     (* rows (.getHeight font-metrics))
-                                       char-width                        (/ screen-width columns)
-                                       char-height                       (/ screen-height rows)]
-                                   (doto graphics
-                                     (.fillRect 0 0 screen-width screen-height))))))
-                                   ;(doseq [row (range rows)]
-                                   ;  (println (apply str (map #(get % :character) (get @character-map row)))))
-          icon            nil #_(.getImage (java.awt.Toolkit/getDefaultToolkit) "images/icon.png")
-          frame           nil #_(doto (JFrame. "Robinson")
-                             (.. (getContentPane) (setLayout (BorderLayout.)))
-                             (.. (getContentPane) (add terminal-renderer BorderLayout/CENTER))
-                             (.addKeyListener keyListener)
-                             (.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
-                             (.setLocationByPlatform true)
-                             (.setLocationRelativeTo nil)
-                             (.setAlwaysOnTop true)
-                             (.setAlwaysOnTop false)
-                             (.setVisible true)
-                             (.setIconImage icon)
-                             (.setFocusTraversalKeysEnabled false)
-                             (.setResizable false)
-                             (.pack))]
+                                                y))))))]
       (reify rat/ATerminal
         (get-size [this]
           [columns rows])

              buffer-object/array-buffer
              buffer-object/static-draw
              3)
          square-texture-buffer-fn (memoize (fn [[u0 v0 u1 v1]]
                                              (let [u0 (/ u0 256)
                                                    v0 (/ v0 256)

          _                (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)]
          ;; 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 terminal canvas height
          _                (dom/setProperties 
                             terminal-canvas-dom
                             (clj->js {:width (* 80 12)
