Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: the alpha value from the screen

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    Castellon, Spain
    Posts
    7

    the alpha value from the screen

    Hi!
    I've problems with the alpha value when I read from a textured image from the screen.
    First of all, I use glReadPixels(0,0,width,hight,GL_RGBA,GL_UNSIGNED_B YTE, *frame);
    After chanching the Blue with the Red values, I get a tga file. But when I see it with the Photoshop, the alpha chanel is completely white!!
    Can I read RGBA from the screen or I can get only RGB values?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: the alpha value from the screen

    Did you set your framebuffer to store RGBA values? If you're using a 16-bit framebuffer, you don't get the alpha component.

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    Castellon, Spain
    Posts
    7

    Re: the alpha value from the screen

    No, actually I've defined the framebuffer as GLbyte framebuffer[width][height][4].
    Then I put every R, G, B or A values in a GLubyte.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: the alpha value from the screen

    The framebuffer is where OpenGL draws everything. In other words, the window, or the viewport. Does the windows pixelformat contain an alpha channel?

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    Castellon, Spain
    Posts
    7

    Re: the alpha value from the screen

    What do you mean? I have declared my windows
    glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);

    Is it enough or I've to use another function about the pixel format?

Posting Permissions

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