     [0 0])
   ;; characters is a list of {:c \character :x col :y row :fg [r g b] :bg [r g b]}
   (put-chars! [_ layer-id characters]
-    ; TODO: make better precondition check
-    {:pre [#_(contains? (set layer-order) layer-id)
+    {:pre [(get layer-id->group layer-id)
            (get layer-character-map layer-id)]}
     #_(log/info "characters" (str characters))
     (let [columns (-> layer-id layer-id->group :columns)
           rows    (-> layer-id layer-id->group :rows)]
-      (log/info "writing to layer" layer-id "dim:" columns "x" rows)
+      ;(log/info "writing to layer" layer-id "dim:" columns "x" rows)
       (alter (get layer-character-map layer-id)
              (fn [cm]
                (reduce (fn [cm [row row-characters]]

    (doseq [[id character-map] layer-character-map]
      (ref-set character-map (get layer-character-map-cleared id))))
  (clear! [_ layer-id]
    ; TODO: make better precondition check
    ;{:pre [(contains? (set layer-order) layer-id)]}
    (ref-set (get layer-character-map layer-id) (get layer-character-map-cleared layer-id)))
  (fullscreen! [_ v]
    (with-gl-context gl-lock window capabilities

  (set-fx-fg! [_ layer-id x y fg]
    {:pre [(vector? fg)
           (= (count fg) 3)
           (get layer-id->group 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)
           (get layer-id->group 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]
    {:pre [(get layer-id->group layer-id)]}
    (alter (get layer-character-map layer-id)
           (fn [cm] (assoc-in cm [y x :fx-character] c))))
  (clear-fx! [_ layer-id]
    {:pre [(get layer-id->group layer-id)]}
    (alter (get layer-character-map layer-id)
           (fn [cm]
             (mapv (fn [line]
