View Full Version : getting glTexImage2D to work w/ GL_RGBA alpha image data

08-22-2005, 05:30 AM
I have an image buffer that has 4 components (RGBA):

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

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?

08-22-2005, 07:04 PM

Have you looked at the examples in the redbook?

Have you looked at glBlendFunc/glEnable(GL_BLEND)?