PDA

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



mark-w
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?

Hlz
08-22-2005, 07:04 PM
http://pyopengl.sourceforge.net/documentation/manual/glTexImage2D.3G.html

Have you looked at the examples in the redbook?

Have you looked at glBlendFunc/glEnable(GL_BLEND)?