Page 288 OpenGL (Business web hosting) Super Bible! Table 8-1 A
Page 288 OpenGL Super Bible! Table 8-1 A Few Sample Palette Entries for a 3-3-2 Palette Palette Blue Component Green Component Red Entry Binary (B G R) Component 0 000 000 000000 0 0 0 1 00 000 001 0 0 1*255/7 2 00 000 010 0 0 2*255/7 3 00 000 011 0 0 3*255/7 9 00 001 001 0 1*255/7 1*255/7 10 00 001 010 0 1*255/7 2*255/7 137 10 001 001 2*255/3 1*255/7 1*255/7 138 10 001 010 2*255/7 1*255/7 2*255/3 255 11 111 111 3*255/3 7*255/7 7*255/7 Building the Palette Unfortunately, at this time OpenGL for Windows will only support 3-3-2 palettes in RGBA color mode. This is actually specified in the PIXELFORMATDESCRIPTOR returned by DescribePixelFormat(). The members cRedBits, cGreenBits, and cBluebits specify 3, 3, and 2, respectively, for the number of bits that can represent each component. Furthermore, the cRedShift, cGreenShift, and cBlueShift values specify how much to shift the respective component value to the left (in this case, 0, 3, and 6 for red, green, and blue shifts). These sets of values compose the palette index (Figure 8-14). Figure 8-14 3-3-2 palette packing The code in Listing 8-4 creates a palette if needed and returns its handle. This function makes use of the component bit counts and shift information in the PIXELFORMATDESCRIPTOR to accommodate any subsequent palette requirements, such as a 2-2-2 palette .
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.