glReadPixels doesn't copy alpha values

I’m trying to read RGBA data from the frame buffer using glReadPixels. The color data is read fine. However, the alpha doesn’t get read.

The value of GL_ALPHA_BITS is 0 with my setup. The values of GL_RED_BITS, GL_GREEN_BITS, and GL_BLUE_BITS are all 8. Is that the cause of the problem? If so, is there a way to get the frame buffer to have 8 bits of alpha? I’m running on a TNT card, could it be a hardware limitation?

I appreciate any help.

You’ll need to be in 32 bpp mode, and you will need to select a pixelformat that has an 8 bit alpha buffer. I’m certain that will work. However, I can’t remember if the TNT driver will fall back to software if you select an 8 bit alpha buffer in 16 bpp mode (if you even can), or if it just tosses the alpha into the bit bucket.

I set the pixelformat to an 8 bit alpha buffer and it worked like a charm.

Thanks for your help.