1
\$\begingroup\$

It is very odd.I want to load .png file via asset manager which is provided by android sdk. AssetManager manager; /........./ BitmapFactory.decodeStream(manager.open(path));

It returns BGR format data but opengl es 2.0 uses RGB format so , Blue seems red , red seems blue, how odd.

Is there any solution for it?

I use Nvıdia Tegra 2 (Android 2.2) device for test the application along with c++ via JNI.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

You should be able to specify the pixel-format to be GL_BGR instead of GL_RGB.

For glTexImage2D this would be the format parameter.

\$\endgroup\$
0
\$\begingroup\$

You can use this extension: EXT_texture_format_BGRA8888. But, you need to check that your device can handle it. Galaxt Spica or Moment doesn't. Otherwise just do a conversion. In my engine, i swap BGRA to RGBA before loading into glTexImage.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .