PDA

View Full Version : Hardware Acceleration at 8 bit colordepth



tabor25
04-08-2002, 05:41 AM
Hello,

i have to setup opengl for working under 8 bit color-depth. this is how i setup the pixel-format-descriptor :

PIXELFORMATDESCRIPTOR pfd;

memset(&pfd, 0, sizeof PIXELFORMATDESCRIPTOR));

pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 8;
pfd.iLayerType = PFD_MAIN_PLANE;
pfd.cDepthBits = 16;

after choosing the nearest pixelformat by using the "ChoosePixelFormat"-function, i get a description of the selected one by the "DescribePixelFormat"-function. The recieved pixelformat has 8 bit like desired, but the color white looks black and black is white. it seems that all colors are wrong. So what is wrong with this code. Maybe someone can help!?!

Best regards

tabor25

nexusone
04-08-2002, 06:48 AM
First you are not getting 8 bit hardware acceleration, I do not know of a video card that has 8 bit 3D acceleration. Most only get the accereleration at 16 to 32 bit, others only in 32 bit mode.

I am guessing you are getting the wrong color due to the fact you are not properly setting up the screen. From looking at your code you have a 16 bit screen with a 8 bit color, that mean's that 8 bit's have to control 16 bit's of color!


Originally posted by tabor25:
Hello,

i have to setup opengl for working under 8 bit color-depth. this is how i setup the pixel-format-descriptor :

PIXELFORMATDESCRIPTOR pfd;

memset(&pfd, 0, sizeof PIXELFORMATDESCRIPTOR));

pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 8;
pfd.iLayerType = PFD_MAIN_PLANE;
pfd.cDepthBits = 16;

after choosing the nearest pixelformat by using the "ChoosePixelFormat"-function, i get a description of the selected one by the "DescribePixelFormat"-function. The recieved pixelformat has 8 bit like desired, but the color white looks black and black is white. it seems that all colors are wrong. So what is wrong with this code. Maybe someone can help!?!

Best regards

tabor25