2

In NDK, Android. 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??

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);
}
PerracoLabs
  • 16,449
  • 15
  • 74
  • 127

1 Answers1

0

It shouldn't be, does the framebuffer you read is default? Otherwise the color components are read from the color image that attached to the GL_COLOR_ATTACHMENT0 attachment point. BTW, what's the GPU vendor of your device?

james
  • 335
  • 1
  • 5
  • 18