                            layer-order
                            cursor-xy
                            fx-uniforms
-                           {:p-matrix-buffer (ortho-matrix-buffer screen-width screen-height)
-                            :mv-matrix-buffer (position-matrix-buffer [(- (/ screen-width 2)) (- (/ screen-height 2)) -1.0 0.0]
-                                                                      [screen-width screen-height 1.0])
+                           {:p-matrix-buffer (ortho-matrix-buffer frame-buffer-width frame-buffer-height)
+                            :mv-matrix-buffer (position-matrix-buffer [(- (/ frame-buffer-width 2)) (- (/ frame-buffer-height 2)) -1.0 0.0]
+                                                                      [frame-buffer-width frame-buffer-height 1.0])
                             :buffers {:vertices-vbo-id vertices-vbo-id
                                       :vertices-count vertices-count
                                       :texture-coords-vbo-id texture-coords-vbo-id

  (fullscreen! [_ v]
    (with-gl-context gl-lock window capabilities
      (if (false? v)
        (let [{:keys [screen-width screen-height]} (get @font-textures (font-key @normal-font))]
          (reset! fullscreen false)
          #_(Display/setDisplayMode (DisplayMode. screen-width screen-height)))
        (let [[width height mode] v]

           (GLFW/glfwMakeContextCurrent window)
           (GLFW/glfwSwapInterval 1)
           (GLFW/glfwShowWindow window)
           (let [capabilities (GL/createCapabilities)
                 width-buffer (BufferUtils/createIntBuffer 1)
                 height-buffer (BufferUtils/createIntBuffer 1)]
             (GLFW/glfwGetFramebufferSize window width-buffer height-buffer)
             (let [frame-buffer-width (.get width-buffer)
                   frame-buffer-height (.get height-buffer)]
               (GL11/glViewport 0 0 frame-buffer-width frame-buffer-height)
               (GLFW/glfwMakeContextCurrent 0)
               ;; Signal to parent that display has been created
               [window
                capabilities
                frame-buffer-width
                frame-buffer-height]))))
     (throw (RuntimeException. "Failed to create the GLFW window")))))

(defn- load-shader
