Hi!
As OpenGL is not capable of ARGB I thought using java.awt.image.BufferedImage with type TYPE_4BYTE_ABGR would be the easiest way because I then can use the OpenGL-extension EXTAbgr. Although the extension is available on my PC the colors are wrong. What's wrong with this?
BufferedImage t = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);
// Drawing on the BufferedImage...
// ...
int[] data = new int[t.getWidth() * t.getHeight() * 4];
t.getRaster().getPixels(0, 0, t.getWidth(), t.getHeight(), data);
ByteBuffer dat = ByteBuffer.allocateDirect(data.length);
dat.order(ByteOrder.nativeOrder());
for(int i = 0; i < data.length; i++) {
dat.put((byte)data[i]);
}
dat.flip();
// Creating and binding texture...
// ...
GL11.glTexImage2D(target, 0, GL11.GL_RGBA, width, height, 0, EXTAbgr.GL_ABGR_EXT, GL11.GL_UNSIGNED_BYTE, dat);
WiESi