Hi Everyone, I am reading texture data on different Android devices with the goal of saving it to disk (to deal with onStart/onStop cycles)
The way I do it is like this:
glGenFramebuffersOES(1, &uiFBOId);
glBindFramebufferOES(GL_FRAMEBUFFER_OES, uiFBOId);
glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, (*i)->uiGLId, 0);
glReadPixels(0,0,(*i)->iSrcSizeX,(*i)->iSrcSizeY, GL_RGBA, GL_UNSIGNED_BYTE, map);
or like this:
glGenFramebuffersOES(1, &uiFBOId);
glBindFramebufferOES(GL_FRAMEBUFFER_OES, uiFBOId);
glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, (*i)->uiGLId, 0);
glReadPixels(0,0,(*i)->iSrcSizeX,(*i)->iSrcSizeY, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, map);
I check glFramebufferTexture2DOES status by calling
glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES)
I know it has been mentioned that you can’t do this approach with L8A8 type textures, but what I am seeing is that:
Both RGBA and L8A8 work on Motorola Xoom, Acer A500
Neither RGBA and L8A8 work on Samsung Galaxy Nexus (phone)
Thoughts?