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 2 of 2

Thread: getting glTexImage2D to work w/ GL_RGBA alpha image data

  1. #1
    Intern Newbie
    Join Date
    May 2005
    Location
    NY, NY
    Posts
    30

    getting glTexImage2D to work w/ GL_RGBA alpha image data

    I have an image buffer that has 4 components (RGBA):

    Code :
    RGBA_buf = new unsigned char[image_width * image_height * 4];
    trying to map onto a quad with:

    Code :
    glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, image_width, image_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, RGBA_buf );
    what am I supposed to pass as the 7th parameter, because with GL_RGBA the image data appears corrupted... I can have it display normally with GL_RGB, but I can't get figure out how to get this to work w/ the alpha values...

    Any ideas?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Aug 2005
    Posts
    148

    Re: getting glTexImage2D to work w/ GL_RGBA alpha image data

    http://pyopengl.sourceforge.net/docu...mage2D.3G.html

    Have you looked at the examples in the redbook?

    Have you looked at glBlendFunc/glEnable(GL_BLEND)?

Posting Permissions

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