about glReadPixels API

This topic contains 1 reply, has 2 voices, and was last updated by  Xmas 9 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29632

    gordongao
    Member

    I use glReadPixels  to capture my colorbuffer  on symbian s60 3rd, but  only get the first pixel of my framebuffer, and the pixel copy to all other array ,such as code below:

     

    unsigned char * imageData;

    imageData = new unsigned char[3 * width * height];

    glReadPixels(0,0, width, height,GL_RGB,GL_UNSIGNED_BYTE, (unsigned char*)imageData);

     

    all the data in imageData are the same as the first pixel of framebuffer, I don’t why ??

     

     

    and my egl setting as below:

     

    EGLConfig
    #32496

    Xmas
    Member
    gordongao wrote:
    glReadPixels(0,0, width, height,GL_RGB,GL_UNSIGNED_BYTE, (unsigned char*)imageData);

    Please check the values of GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES and

    GL_IMPLEMENTATION_COLOR_READ_TYPE_OES with glGetIntegerv before using a format/type combination other than GL_RGBA, GL_UNSIGNED_BYTE with glReadPixels. GL_RGBA, GL_UNSIGNED_BYTE is the only combination that is guaranteed to always work.

    Have you checked glGetError()?

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.