Results 1 to 3 of 3

Thread: glReadPixels

  1. #1
    Member Contributor
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    86

    glReadPixels

    Im reading the pixels with glReadPixels and the bitmap is all gray...

    Any idea why?

  2. #2
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: glReadPixels

    Need more info than this.

  3. #3
    Guest

    Re: glReadPixels

    I have had the same problem and it was due to read from the wrong buffer. If you are running with doublebuffering I found the following scheme to work

    display(){
    ...renderToBuffer...
    glReadBuffer( GL_BACK );

    //w_ is width of window, same for h_
    glReadPixels( 0 , 0 , w_ , h_ , GL_RGB ,GL_UNSIGNED_BYTE , (GLvoid*) pixels);

    glutSwapBuffers();
    }
    //display end
    my problem was that i made the grab after I swapped buffers which just gave me a blank picture.

    Niels

Similar Threads

  1. PBO and glReadPixels()
    By ehsan2004 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-24-2007, 05:20 AM
  2. about glReadPixels
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-05-2006, 08:18 PM
  3. glReadPixels
    By mphanke in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-04-2002, 08:24 AM
  4. glReadPixels()
    By hatemagnet in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-11-2002, 10:17 PM
  5. glReadPixels
    By Dagana in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 08-02-2001, 10:14 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
  •  
Proudly hosted by Digital Ocean