                      (.getData dbb))))]
     (.put texture-buffer data 0 (alength data))
     (.flip texture-buffer)
-    texture-buffer))
-
-(defn- buffered-image-rgba-byte-buffer [^BufferedImage buffered-image]
-  (let [width          (.getWidth buffered-image)
-        height         (.getHeight buffered-image)
-        texture-buffer ^ByteBuffer (BufferUtils/createByteBuffer (* width height 4))
-        channel        (.getChannel (FileOutputStream. (File. (format "bytes-%dx%d.raw.data" width height)) false))]
-    (log/info "Gettting bytes for image with type" (.getType buffered-image))
-    (doseq [y (range height)
-            x (range width)
-            :let [abgr   (.getRGB buffered-image x y)
-                  g      (unsigned-bit-shift-right (bit-and 0x000000FF abgr) 0)
-                  b      (unsigned-bit-shift-right (bit-and 0x0000FF00 abgr) 8)
-                  a      (unsigned-bit-shift-right (bit-and 0x00FF0000 abgr) 16)
-                  r      (unsigned-bit-shift-right (bit-and 0xFF000000 abgr) 24)
-                  i ^int (int (+ (bit-shift-left r 24)
-                                 (bit-shift-left g 16)
-                                 (bit-shift-left b 8)
-                                 (bit-shift-left a 0)))]]
-      (.putInt texture-buffer i))
-    (.flip texture-buffer)
-    (.write channel texture-buffer)
-    (.close channel)
     texture-buffer))
 
 (defn- get-fields [#^Class static-class]

             (recur)))))
     ;; Wait for Display to be created
     (.await latch)))

(defn- shader-error-str [shader-id]
  (let [infoLogLength (BufferUtils/createIntBuffer 1)
        _             (GL20/glGetShader shader-id GL20/GL_INFO_LOG_LENGTH, infoLogLength)
        log-length    (.get infoLogLength 0)
        infoLog ^ByteBuffer        (BufferUtils/createByteBuffer log-length)
        _              (.clear infoLogLength)
        _              (GL20/glGetShaderInfoLog shader-id, infoLogLength, infoLog)
        infoLogBytes   (byte-array log-length)
        _              (.get infoLog infoLogBytes, 0, log-length)]
    (log/info "info length" log-length)
    (String. infoLogBytes (Charset/forName "UTF-8"))))

(defn- load-shader
  [^String shader-str ^Integer shader-type]

                  (.position bg-image-data (+ 4 (.position bg-image-data)))))))
          (.rewind glyph-image-data)
          (.rewind fg-image-data)
          (.rewind bg-image-data)))
        (.position glyph-image-data (.limit glyph-image-data))
        (.position fg-image-data (.limit fg-image-data))
        (.position bg-image-data (.limit bg-image-data))
