glReadPixels takes a parameter to grab the data in a number of formats.
The GL_UNSIGNED_INT_8_8_8_8_REV option will read back a 32 bit source
in the 'native' format, ARGB or XRGB.
glReadPixels(xOrigin, yOrigin, width, height,
GL_BGRA,
GL_UNSIGNED_INT_8_8_8_8_REV,
dataBuffer);
On Dec 11, 2004, at 2:00 PM, Travis Heppe wrote:
For regression testing, we are creating a cggl context on top of an
agl context, then taking snapshots of the rendered output from quartz
using glReadPixels. It works, but the colors have their colors
reversed (b&r channels swapped), relative to when we capture the
rendered output from opengl. I can correct it by looping through the
data and swizzling the bytes back, but it would be nice to know why
it's happening. Anyone have any ideas?
-Travis