                                      (map->tile->col-row one-bit-map)
                                      (map->tile->transparent one-bit-map))]))
                                      
-#_(def font (CP437Font. "http://dwarffortresswiki.org/images/b/be/Pastiche_8x8.png" :green 2))
-                                     
-
 (defn -main [& _]
   ;; render in background thread
-   (let [terminal   (zgl/make-terminal [:text :rainbow]
+   (let [terminal   (zgl/make-terminal [:text :overlay]
                                        {:title "Zaffre demo"
                                         :columns 16 :rows 16
                                         :default-fg-color [250 250 250]

                                        :icon-paths ["images/icon-16x16.png"
                                                     "images/icon-32x32.png"
                                                     "images/icon-128x128.png"]})
       event-chan   (async/merge
                      [(zat/get-key-chan terminal)
                       (zat/get-mouse-chan terminal)]
                      10)
        last-key    (atom nil)
        trail-length 6
        last-mouse-pos (atom [])
        ;; Every 10ms, set the "Rainbow" text to have a random fg color
        fx-chan     (go-loop []
                      (dosync
                        (doseq [x (range (count "Rainbow"))
                                :let [rgb (hsv->rgb (double (rand 360)) 1.0 1.0)]]
                            (zat/set-fx-fg! terminal :rainbow (inc x) 1 rgb)))
                        (zat/refresh! terminal)
                      (Thread/sleep 10)
                      (recur))
        ;; Every 33ms, draw a full frame
        render-chan (go-loop []
                      (dosync

                          (doseq [[i c] (take 23 (map-indexed (fn [i c] [i (char c)]) (range (int \a) (int \z))))]
                            (zutil/put-string terminal :text 0 (inc i) (str c) [128 (* 10 i) 0] [0 0 50]))
                          (zutil/put-string terminal :text 12 0 (str key-in))
                          (zutil/put-string terminal :overlay 2 7 "Overlay")
                          (zat/put-chars! terminal :text
                            (for [x (range 1 11)
                                  y (range 5 10)]
                              {:c :metal       :fg [4 4 5] :bg [0 128 0] :x x :y y}))
                          (zat/refresh! terminal)))
                          ;; ~30fps
                        (Thread/sleep 33)
                        (recur))]
    ;; get key presses in fg thread
    (loop []
      (let [new-key (async/<!! key-chan)]
        (reset! last-key new-key)
        (log/info "got key" (or (str @last-key) "nil"))
        (case new-key
          \q (zat/destroy! terminal)
          nil)
        (if (= new-key :exit)
          (do
            (async/close! render-chan)
            (System/exit 0))
          ;; change font size on s/m/l keypress
          (recur))))))
