Patch below is adding support for these two textures. They are needed for direct memory copy between OS-textures and opengl textures on windows and linux.
I was able to test only BGRA8 and not all the code paths, so please review it carefully - I might have made some errors here.
[java]
Index: src/core/com/jme3/texture/image/ImageCodec.java
— src/core/com/jme3/texture/image/ImageCodec.java (revision 10782)
+++ src/core/com/jme3/texture/image/ImageCodec.java (working copy)
@@ -134,6 +134,10 @@
params.put(Format.ABGR8, new ByteOffsetImageCodec(4, 0, 0, 3, 2, 1));
-
params.put(Format.ARGB8, new ByteOffsetImageCodec(4, 0, 0, 1, 2, 3));
-
params.put(Format.BGRA8, new ByteOffsetImageCodec(4, 0, 3, 2, 1, 0));
-
params.put(Format.ARGB4444, new BitMaskImageCodec(2, 0, 4, 4, 4, 4, 12, 0, 4, 8));
Index: src/core/com/jme3/texture/Image.java
— src/core/com/jme3/texture/Image.java (revision 10782)
+++ src/core/com/jme3/texture/Image.java (working copy)
@@ -148,8 +148,18 @@
* 8-bit alpha, blue, green, and red.
*/
ABGR8(32),
+
-
/**
-
* 8-bit alpha, red, blue and green
-
*/
-
ARGB8(32), /**
-
* 8-bit blue, green, red and alpha.
-
*/
-
BGRA8(32),
-
/** * 16-bit red, green, blue and alpha */ RGBA16(64),
Index: src/lwjgl/com/jme3/renderer/lwjgl/TextureUtil.java
— src/lwjgl/com/jme3/renderer/lwjgl/TextureUtil.java (revision 10782)
+++ src/lwjgl/com/jme3/renderer/lwjgl/TextureUtil.java (working copy)
@@ -107,6 +107,8 @@
// RGB formats
setFormat(Format.BGR8, GL11.GL_RGB8, EXTBgra.GL_BGR_EXT, GL11.GL_UNSIGNED_BYTE, false);
-
setFormat(Format.ARGB8, GL11.GL_RGBA8, EXTBgra.GL_BGRA_EXT, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, false);
-
setFormat(Format.BGRA8, GL11.GL_RGBA8, EXTBgra.GL_BGRA_EXT, GL11.GL_UNSIGNED_BYTE, false); setFormat(Format.RGB8, GL11.GL_RGB8, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, false);
// setFormat(Format.RGB10, GL11.GL_RGB10, GL11.GL_RGB, GL12.GL_UNSIGNED_INT_10_10_10_2, false);
setFormat(Format.RGB16, GL11.GL_RGB16, GL11.GL_RGB, GL11.GL_UNSIGNED_SHORT, false);
@@ -147,6 +149,7 @@
}
break;
case BGR8:
-
case BGRA8: if (!caps.OpenGL12 && !caps.GL_EXT_bgra){ return null; }
Index: src/desktop/jme3tools/converters/ImageToAwt.java
— src/desktop/jme3tools/converters/ImageToAwt.java (revision 10782)
+++ src/desktop/jme3tools/converters/ImageToAwt.java (working copy)
@@ -172,6 +172,14 @@
params.put(Format.RGBA8, new DecodeParams(4, m___x, mx___, m_x__, m__x_,
s___x, sx___, s_x__, s__x_,
mxxxx, sxxxx));
-
params.put(Format.BGRA8, new DecodeParams(4, m___x, m__x_, m_x__, mx___,
-
s___x, s__x_, s_x__, sx___,
-
mxxxx, sxxxx));
-
params.put(Format.ARGB8, new DecodeParams(4, mx___, m_x__, m__x_, m___x,
-
sx___, s_x__, s__x_, s___x,
-
mxxxx, sxxxx));
-
}
private static int Ix(int x, int y, int w){
[/java]