    (texture-id width height layers (BufferUtils/createByteBuffer (* width height 4 layers))))
   ([^long width ^long height ^long layers ^ByteBuffer texture-buffer]
    (let [texture-id (GL11/glGenTextures)]
-     ;;(.order texture-buffer (ByteOrder/nativeOrder))
      (GL11/glBindTexture GL30/GL_TEXTURE_2D_ARRAY texture-id)
      (GL11/glPixelStorei GL11/GL_UNPACK_ALIGNMENT 1)
      (GL11/glTexParameteri GL30/GL_TEXTURE_2D_ARRAY GL11/GL_TEXTURE_MIN_FILTER GL11/GL_NEAREST)

      (set! (.m33 ortho-matrix) m33)
      (.clear matrix-buffer)
      (.get ortho-matrix matrix-buffer)
      ;(.flip matrix-buffer)
      matrix-buffer)))

(defn position-matrix-buffer

              (except-gl-errors "Start of loop")
              ; Process messages in the main thread rather than the input go-loop due to Windows only allowing
              ; input on the thread that created the window
              (GLFW/glfwPollEvents)
              ;; Close the display if the close window button has been clicked
              ;; or the gl-lock has been released programmatically (e.g. by destroy!)
