      ;;(GLFW/glfwSetErrorCallback (GLFWErrorCallback/createPrint System/out))
      (GLFW/glfwSetErrorCallback (proxy [GLFWErrorCallback] []
                                            (invoke [error description] (log/error "GLFW error:" error description))))
-     ;(future
-       ;(GLUtil/setupDebugMessageCallback System/out)
-       (when-not (= (GLFW/glfwInit) GLFW/GLFW_TRUE)
-         (assert "Unable to initialize GLFW"))
-       (GLFW/glfwDefaultWindowHints)
-       (GLFW/glfwWindowHint GLFW/GLFW_VISIBLE GLFW/GLFW_FALSE)
-       (GLFW/glfwWindowHint GLFW/GLFW_RESIZABLE GLFW/GLFW_FALSE)
-       
-       (GLFW/glfwWindowHint GLFW/GLFW_CONTEXT_VERSION_MAJOR 3)
-       (GLFW/glfwWindowHint GLFW/GLFW_CONTEXT_VERSION_MINOR 2)
-       (GLFW/glfwWindowHint GLFW/GLFW_OPENGL_PROFILE GLFW/GLFW_OPENGL_CORE_PROFILE)
-       (GLFW/glfwWindowHint GLFW/GLFW_OPENGL_FORWARD_COMPAT GLFW/GLFW_TRUE)
-       (GLFW/glfwWindowHint GLFW/GLFW_OPENGL_DEBUG_CONTEXT GLFW/GLFW_TRUE)
-       (if-let [window (GLFW/glfwCreateWindow (int screen-width) (int screen-height) (str title) 0 0)]
-         (do
-           ;(Display/setDisplayMode (DisplayMode. screen-width screen-height))
-           ;(Display/setTitle title)
-           #_(when icon-array
-             (log/info "Setting icons")
-             ;(Display/setIcon icon-array)
-             (Thread/sleep 100))
-           (log/info "byte-buffer" icon-array)
-           (let [vidmode      (GLFW/glfwGetVideoMode (GLFW/glfwGetPrimaryMonitor))]
-             (GLFW/glfwSetWindowPos
-               window
-               (/ (- (.width vidmode) screen-width) 2)
-               (/ (- (.height vidmode) screen-height) 2))
-             (GLFW/glfwMakeContextCurrent window)
-             (GLFW/glfwSwapInterval 1)
-             (GLFW/glfwShowWindow window)
-             (let [capabilities (GL/createCapabilities)]
-               (GL11/glViewport 0 0 screen-width screen-height)
-               ;(GL11/glClearColor 0.0 0.0 1.0 1.0)
-               ;(except-gl-errors (str "glClearColor  " 0.0 0.0 1.0 1.0))
-               ;(GL11/glClear (bit-or GL11/GL_COLOR_BUFFER_BIT GL11/GL_DEPTH_BUFFER_BIT))
-               ;(GLFW/glfwSwapBuffers window)
-               ;; Release the Display so that any thread can aquire it including this thread - the thread that
-               ;; created it.
-               ;(Display/releaseContext)
-               (GLFW/glfwMakeContextCurrent 0)
-               ;; Signal to parent that display has been created
-               [window capabilities])))
-       (throw (RuntimeException. "Failed to create the GLFW window")))))
+     ;(GLUtil/setupDebugMessageCallback System/out)
+     (when-not (= (GLFW/glfwInit) GLFW/GLFW_TRUE)
+       (assert "Unable to initialize GLFW"))
+     (GLFW/glfwDefaultWindowHints)
+     (GLFW/glfwWindowHint GLFW/GLFW_VISIBLE GLFW/GLFW_FALSE)
+     (GLFW/glfwWindowHint GLFW/GLFW_RESIZABLE GLFW/GLFW_FALSE)
+     
+     (GLFW/glfwWindowHint GLFW/GLFW_CONTEXT_VERSION_MAJOR 3)
+     (GLFW/glfwWindowHint GLFW/GLFW_CONTEXT_VERSION_MINOR 2)
+     (GLFW/glfwWindowHint GLFW/GLFW_OPENGL_PROFILE GLFW/GLFW_OPENGL_CORE_PROFILE)
+     (GLFW/glfwWindowHint GLFW/GLFW_OPENGL_FORWARD_COMPAT GLFW/GLFW_TRUE)
+     (GLFW/glfwWindowHint GLFW/GLFW_OPENGL_DEBUG_CONTEXT GLFW/GLFW_TRUE)
+     (if-let [window (GLFW/glfwCreateWindow (int screen-width) (int screen-height) (str title) 0 0)]
+       (do
+         ; TODO: set window icons
+         #_(when icon-array
+           (log/info "Setting icons")
+           ;(Display/setIcon icon-array)
+           (Thread/sleep 100))
+         (log/info "byte-buffer" icon-array)
+         (let [vidmode      (GLFW/glfwGetVideoMode (GLFW/glfwGetPrimaryMonitor))]
+           (GLFW/glfwSetWindowPos
+             window
+             (/ (- (.width vidmode) screen-width) 2)
+             (/ (- (.height vidmode) screen-height) 2))
+           (GLFW/glfwMakeContextCurrent window)
+           (GLFW/glfwSwapInterval 1)
+           (GLFW/glfwShowWindow window)
+           (let [capabilities (GL/createCapabilities)]
+             (GL11/glViewport 0 0 screen-width screen-height)
+             (GLFW/glfwMakeContextCurrent 0)
+             ;; Signal to parent that display has been created
+             [window capabilities])))
+     (throw (RuntimeException. "Failed to create the GLFW window")))))
 
 (defn- load-shader
   [^String shader-str ^Integer shader-type]

        (loop-with-index row [line (reverse @character-map)]
          (loop-with-index col [c line]
            (let [chr        (or (get c :fx-character) (get c :character))
                  #_#_chr        (if (and (= layer-id base-layer-id)
                                      (char? chr)
                                      (= (char chr) (char 0)))
                                 \space
                                 chr)
                  highlight  (= @cursor-xy [col (- rows row 1)])
                  [fg-r fg-g fg-b] (if highlight
                                     (or (get c :fx-bg-color)  (get c :bg-color))

            ^ByteBuffer bbnil nil]
        (log/info "screen size" screen-width "x" screen-height)
        (try
          ;; TODO: fix fullscreen
          #_(when-not @fullscreen
            (Display/setDisplayMode (DisplayMode. screen-width screen-height)))
          ;; resize FBO
