Hello,

I have faced up a problem on android device with compressed_paletted_texture and would really appreciate any help.

I have a bmp RGBA_8888. I am generating a paletted_texture PALETTE8_RGBA8_OES from it and than upload it to openGL with glCompressedTexImage2D. It works fine...except the colours are not right ones. I am getting some strange image as a result:
http://img502.imageshack.us/i/devicek.png/

As you can see alpha channel is fine and that means that indexes and compressed img structure is ok, the problem is with the colours itself.
I believe it might be a problem with a difference in a colour representation in java and native openGL.

Here is my code(java android) to write colours in palette:

Code :
ByteArrayOutputStream bout = new ByteArrayOutputStream(size);
DataOutputStream out = new DataOutputStream(bout);
....
int colour = bmp.getPixel(i, j); //get a pixel colour, int = 4 bytes = RGBA_8888
out.writeInt(color);
...
return bout.toByteArray();

The structure of compressed image is the next(is it correct?):


Could anyone advise me what the problem is?

Thanks,
Yuriy