View Full Version : glReadPixels GL_RGBA returning ARGB pixels instead

08-18-2012, 05:11 AM
Calling the next instruction to get the viewport pixels. I am expecting the pixels to be in RGBA format, but instead I get ARGB pixels. Is there something wrong or the be set prior to glReadPixels? (note: written in NDK, Android)

void getViewPortPixels(const unsigned int x, const unsigned int y, const unsigned int width, const unsigned int height, unsigned int* output)
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, (void*)output);

08-18-2012, 08:28 AM

Read #5