Let me simplify by asking a glReadPixel question:

When I state the following:

IntBuffer pixels = IntBuffer.wrap(p);
gl.glReadPixels(x, 0, w, y + h, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, pixels);

…I’m wrapping the end parameter ‘pixels’ into array b? Yes, no?

Is it a start for me to have the following value for ‘pixels’?
java.nio.ReadWriteIntArrayBuffer, status: capacity=275200 position=0 limit=275200

Because that’s what I get when I print out the value for ‘pixels’ in the Android debugger.

Could you check whether you get any GL errors? There must be something like gl.glGetError() in the Java bindings you are using.

Also, I don’t quite understand the arguments you are passing to glReadPixels. Why (x,0,y+h,…)? If you want to read the whole framebuffer you should pass something like (0,0,width,height,…).

even i have tried but not working, since its hardware dependant api , try it in some real device … even i have heard that in android there is no permission to access the hardware… anyways chk it on real device … don forget to set permission in manifest

if you have any luck, let me know. Have sim prob here

Sorry but I work mainly with iPhone development… (

On iOS device (I tried ipad1 and ipad2) glreadpixel works for the RGBA pixel format, but for BGRA pixel format it does not work. In the code below I use GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES to get the native pixel format, which is GL_BGRA_EXT, but glgeterror returns GL_INVALID_ENUM. This contradicts the statement in the opengl doc http://www.khronos.org/opengles/sdk/1.1 … Pixels.xml which says GL_INVALID_ENUM is generated if format is not GL_RGBA or the value of GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES.

Does anyone have any take on this?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.