 
           ;; create width*height texture that gets updated each frame that determines which character to draw in each cell
           _ (log/info "Creating glyph array")
-          ;next-pow-2-columns (zutil/next-pow-2 columns)
-          ;next-pow-2-rows    (zutil/next-pow-2 rows)
-          ;glyph-texture-width  next-pow-2-columns
-          ;glyph-texture-height next-pow-2-rows
-          ;glyph-array    (ta/unsigned-int8 (repeat (* columns rows) 0))
           glyph-image-data (for [layer-group layer-groups]
                              (let [np2-columns (zutil/next-pow-2 (get layer-group :columns))
                                    np2-rows    (zutil/next-pow-2 (get layer-group :rows))]

  (set-fx-fg! [_ layer-id x y fg]
    {:pre [(vector? fg)
           (= (count fg) 3)
           ; TODO: make better precondition check
           #_(contains? (set layer-order) layer-id)]}
      (alter (get layer-character-map layer-id)
             (fn [cm] (assoc-in cm [y x :fx-fg-color] fg))))
  (set-fx-bg! [_ layer-id x y bg]
    {:pre [(vector? bg)
           (= (count bg) 3)
           ; TODO: make better precondition check
           #_(contains? (set layer-order) layer-id)]}
      (alter (get layer-character-map layer-id)
             (fn [cm] (assoc-in cm [y x :fx-bg-color] bg))))
  (set-fx-char! [_ layer-id x y c]
    ; TODO: make better precondition check
    ;{:pre [(contains? (set layer-order) layer-id)]}
    (alter (get layer-character-map layer-id)
           (fn [cm] (assoc-in cm [y x :fx-character] c))))
  (clear-fx! [_ layer-id]
    ; TODO: make better precondition check
    ;{:pre [(contains? (set layer-order) layer-id)]}
    (alter (get layer-character-map layer-id)
           (fn [cm]
             (mapv (fn [line]

                :let [^ByteBuffer glyph-image-data glyph-image-data
                      ^ByteBuffer fg-image-data fg-image-data
                      ^ByteBuffer bg-image-data bg-image-data
                      texture-columns (int (zutil/next-pow-2 columns))
                      texture-rows    (int (zutil/next-pow-2 rows))
                      layer-count     (count layers)
                      layer-size      (* 4 texture-columns texture-rows)]]
          ;; Update glyph texture in buffers
