11-15-2010 10:04 AM
In the OpenGL example provided with the BB kit, I noticed it assumes a Bitmap object, when loaded from a PNG file is in RGB 565 format. This is 2 bytes per pixel, and by default it seems no ALPHA channel is stored:
GLUtils.glTexImage2D(gl, 0, GL10.GL_RGB, GL10.GL_UNSIGNED_SHORT_5_6_5, bitmapObject, null);
I'm wondering what is the native format for images on BB? Can I use ARGB 8888 format instead of RGB 565?
11-15-2010 11:20 AM
You can use whatever format you want, I don't know what native format OpenGL for BlackBerry is running but I know BlackBerry is mainly PNG and the screen format is RGB565. The easiest thing to do is to try ARGB8888 and see if any errors occur. If non-do then it's fine.
11-15-2010 10:37 PM
Does net.rim.device.api.system.Bitmap even support RGBA 8888?
The more I work with it, the less I think so. You can't even construct a net.rim.device.api.system.Bitmap using RGBA 8888, you only have the option to use RGB 565. You can configure OpenGL to use RGBA 8888, but I do not think net.rim.device.api.system.Bitmap supports RGBA 8888.
What can I use to load the alpha channel, then?
11-16-2010 01:12 PM
No, Bitmap does not support RGBA8888. It supports RGB565 but if you want alpha you add a seperete "layer" that is 8 bits so basically RGBA5658.