Why glReadPixels return unexpected color format value?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
ilzc
Posts: 2
Joined: Mon Sep 10, 2012 8:03 am

Why glReadPixels return unexpected color format value?

Post by ilzc »

I want to capture screen using Irrlicht ogl-es branch.

Here is my code written in c++

Code: Select all

glReadPixels(0, 0, 200, 200, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
Most Android devices work well. But MileStone with Android 2.2.3 got unexpected result.I desire RGBA color format,while MileStone return BGRA color.

At last, I change my code

Code: Select all

glReadPixels(0, 0, 200, 200, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
But MileStone return RGBA color.

I have question that why Red and Blue is unexpected? What are the proper reasons?
Post Reply