Results 1 to 6 of 6

Thread: Let me simplify by asking a glReadPixel question:

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    3

    Let me simplify by asking a glReadPixel question:

    When I state the following:
    Code :
    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.

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Let me simplify by asking a glReadPixel question:

    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,...).
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Posts
    4

    Re: Let me simplify by asking a glReadPixel question:

    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

  4. #4

    Re: Let me simplify by asking a glReadPixel question:

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

  5. #5
    Junior Member
    Join Date
    Sep 2011
    Posts
    1

    Re: Let me simplify by asking a glReadPixel question:

    Sorry but I work mainly with iPhone development... (

  6. #6
    Junior Member
    Join Date
    Nov 2011
    Posts
    1

    Re: Let me simplify by asking a glReadPixel question:

    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?

Similar Threads

  1. glReadPixel sgx error: corrupt command buffer iOS 4.0
    By Dev-y in forum OpenGL ES general technical discussions
    Replies: 2
    Last Post: 01-20-2013, 02:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •