       (GLFW/glfwSetCharCallback window char-callback)
       (GLFW/glfwSetMouseButtonCallback window mouse-button-callback)
       (GLFW/glfwSetCursorPosCallback window cursor-pos-callback)
-      #_(go-loop []
-        (with-gl-context gl-lock window capabilities
-          (try
-            (loop []
-              (when (Keyboard/next)
-                (when (Keyboard/getEventKeyState)
-                  (let [character (Keyboard/getEventCharacter)
-                        key       (Keyboard/getEventKey)]
-                    (convert-key-code character key on-key-fn)))
-                (recur)))
-            (catch Exception e
-              (log/error "Error getting keyboard input" e)))
-          (try
-            (loop []
-              (when (Mouse/next)
-                (let [button (Mouse/getEventButton)
-                      state  (if (Mouse/getEventButtonState) :mousedown :mouseup)
-                      event-x ^int (Mouse/getEventX)
-                      event-y ^int (Mouse/getEventY)
-                      {:keys [screen-height
-                              character-width
-                              character-height]} (get @font-textures (font-key @normal-font))
-                      col    (quot event-x (int character-width))
-                      row    (quot (- (int screen-height) event-y) (int character-height))]
-                  (when (<= 0 button 2)
-                    (async/put! term-chan (case button
-                      0 {:button :left :state state :col col :row row}
-                      1 {:button :right :state state :col col :row row}
-                      2 {:button :middle :state state :col col :row row}))))
-                (recur)))
-            (catch Exception e
-              (log/error "Error getting mouse input" e)))
-          (try
-            (let [{:keys [screen-height
-                          character-width
-                          character-height]} (get @font-textures (font-key @normal-font))
-                  mouse-x ^int (Mouse/getX)
-                  mouse-y ^int (Mouse/getY)
-                  col     (quot mouse-x (int character-width))
-                  row     (quot (- (int screen-height) mouse-y) (int character-height))]
-              (when (not= [col row] @mouse-col-row)
-                (async/>! term-chan {:mouse-leave @mouse-col-row})
-                (reset! mouse-col-row [col row])
-                (async/>! term-chan {:mouse-enter @mouse-col-row})))
-            (catch Throwable e
-              (log/error "Error getting mouse movement" e))))
-        (if @gl-lock
-          (do
-            (Thread/sleep 5)
-            (recur))
-          (on-key-fn :exit)))
       (future
         ;; Wait for Display to be created
         (.await latch)

                             line))
                     cm)))))
  (destroy! [_]
    (reset! destroyed true)))


(defn make-terminal

                                           (with-gl-context gl-lock window capabilities
                                             (log/info "getting location of uniform" uniform-name)
                                             (let [location (GL20/glGetUniformLocation fb-pgm-id (str uniform-name))]
                                               #_(assert (not (neg? location)) (str "Could not find location for uniform " uniform-name location))
                                               (log/info "got location of uniform" uniform-name location)
                                               location))]))
                                 {}
