PDA

View Full Version : glReadPixels GL_RGBA returning ARGB pixels instead



sanchiski
08-18-2012, 04: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);
}

V-man
08-18-2012, 07:28 AM
http://www.opengl.org/discussion_boards/showthread.php/176139-Forum-Posting-Guidelines?p=1230021#post1230021

Read #5