8 bit bitmap

Hi everyone,

Does anyone know how I can display an 8 or a 16 bit BMP with the glDrawPixels function. It only seems to be able to handle the 24 and 32 bit variety.

Any help would be greatly appreciated.


i don’t think there is an easy way. an 8-bit bitmap file usually consists of a colormap (defining RGB values for 256 user colors and thereby having a size of 3*256=768 bytes), and for each pixel a one-byte value which acts as an index into the colormap. afaik, there is no way to make OpenGL use that colormap.

you’ll have to write a subroutine which converts the pixel values from the bitmap file to a format which OGL can use. but that doesn’t seem to be too hard :wink: anyway you’ll have to do it only once in your life…so it’s a good exercise