View Full Version : glDrawPixels : How to display 10-Bit pixel-values ??

11-08-2005, 10:50 PM
I use the following line to display an Image-Array. Each value in

byte Image[x][y];

is one BYTE (or 8 Bit) long. Now I want to display 10-BIT long values. Is this possible with glDrawPixels? How do I have to modify the command below and the declaration of Image[x][y] above??

glDrawPixels (ChipWidth,ChipHeight,GL_RGB,GL_UNSIGNED_BYTE,*Ima ge);

11-08-2005, 11:06 PM
You can't directly display 10 bit values, you'll have to extend them to 16 bit (shift left by 6 bit) and use GL_UNSIGNED_SHORT.

But as the framebuffer has only 8 bit by default, the extra precision will get cut off anyway, except when you're rendering to a float texture or some similar high precision target.