                     character-height
                     font-texture-width
                     font-texture-height
-                    font-texture-image]} (get @font-textures (font-key @normal-font))]
+                    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 screen-width screen-height 0 GL11/GL_RGB GL11/GL_UNSIGNED_BYTE nil)
+          (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))))

(defn position-matrix-buffer
  ([v s]
   (position-matrix-buffer v s (BufferUtils/createFloatBuffer 16)))
  ([v s matrix-buffer]
    (let [matrix (doto (Matrix4f.)
                         (.setIdentity))]
      (.translate matrix (Vector3f. (get v 0) (get v 1) (get v 2)))

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