Hey everyone,
I'm porting an OpenGL app from the iPhone to Android, and I need to render OpenGL content to a texture. Since framebuffers are not available in OpenGL 1.0 and the DROID is the only Android phone with the framebuffer OpenGL extension, I'm trying to draw using OpenGL and then copy the result into a texture using glCopyTexImage2D. However, my initial findings are not good:
glCopyTexImage2D works in the Android emulator (OS v. 1.5), but only with GL10.GL_RGB, not GL_RGBA. If you try to copy the alpha data from the scene into the texture, you just get a completely white texture.
glCopyTexImage2D doesn't seem to work at all on the Android G1. glCopyTexImage2D does not throw an UnsupportedOperationException, but after calling it the texture is completely white.
Has anyone successfully used glCopyTexImage2D in an Android app? If so, could you please post a bit of the code you're using, and the devices your app is limited to? I suspect it works only with specific parameters on specific devices, if at all. Right now, I'm calling it like this:
gl.glCopyTexImage2D(GL10.GL_TEXTURE_2D, 0, GL11.GL_RGBA, 0,0, 256,
256, 0);