在 NDK、Android 中。调用下一条指令来获取视口像素。我期望像素为 RGBA 格式,但我得到的是 ARGB 像素。有什么问题或者在 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);
}