                (Display/destroy))
              (log/info "Exiting"))
            (do
-             (Thread/sleep 1)
+             (Thread/sleep 5)
              (recur)))))
      ;; Wait for Display to be created
      (.await latch)))

(defn ortho-matrix-buffer
  ([viewport-width viewport-height]
    (ortho-matrix-buffer viewport-width viewport-height (BufferUtils/createFloatBuffer 16)))
  ([viewport-width viewport-height matrix-buffer]
    (let [ortho-matrix (doto (Matrix4f.)
                         (.setIdentity))
          matrix-buffer matrix-buffer

                    character-height
                    font-texture-width
                    font-texture-height
                    font-texture-image]} (get @font-textures (font-key @normal-font))
            ;; type nil as ByteBuffer to avoid reflection on glTexImage2D
            ^ByteBuffer bbnil nil]
        (log/info "screen size" screen-width "x" screen-height)
        (try
          (Display/setDisplayMode (DisplayMode. screen-width screen-height))
          ;; resize FBO
          (GL11/glBindTexture GL11/GL_TEXTURE_2D fbo-texture)
          (GL11/glTexImage2D GL11/GL_TEXTURE_2D 0 GL11/GL_RGB (int screen-width) (int screen-height) 0 GL11/GL_RGB GL11/GL_UNSIGNED_BYTE bbnil)
          (swap! font-textures update (font-key @normal-font) (fn [m] (assoc m :font-texture (texture-id font-texture-image))))
          (catch Throwable t
            (log/error "Eror changing font" t))))
