textureWidth = decoder.getWidth();
textureHeight = decoder.getHeight();
// Decode the PNG file in a ByteBuffer
imageBuffer = ByteBuffer.allocateDirect(4 * decoder.getWidth() * decoder.getHeight());
decoder.decode(imageBuffer, decoder.getWidth() * 4, PNGDecoder.Format.RGBA);
imageBuffer.flip();
} catch (IOException e) {
throw new RuntimeException("Clean this up:" + e);
}
}