View Full Version : 8 bit bitmap
01-11-2006, 05:12 AM
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.
01-11-2006, 08:36 AM
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 ;) anyway you'll have to do it only once in your life...so it's a good exercise
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.