[ Previous | Next | Table Of Contents

CHAPTER 5 Palette management

When you are running in 256 color mode, OpenGL has to worry about palette management.

If you have chosen a 332 rgba Visual Configuration to create your OpenGL context with, OpenGL will create, select, and manage the color palette for you. You do not have to do much in regard to palette handling, OpenGL will handle the dirty work for you. If your OpenGL rendering window is a subwindow, i.e. not a top level window, you will need to send any WM_REALIZEPALETTE messages to the OpenGL window that your top level window receives. A window will not have the proper colormap unless it has focus. Also, the user should be aware that OpenGL really does require a lot of colors in its color palette. In order to pass the OpenGL required conformance tests, we had to get all 256 colors. We have done our best to maintain the desktop.

You should have the Workplace Shell Palette aware selected in the System Object located in the System Setup Folder. If the Workplace Shell isn't palette aware, we can't get all our colors in the hardware color palette.

If you have chosen a 256 color color index Visual Configuration to create a context with, you will need to create an OS/2 palette with the colors you need in it. If you create a palette with 256 shades of red in it, your desktop will be sunburned. After creating the palette, you pass it into OpenGL to use with pglSelectColorIndexPalette().

Of course, if you use 24bit or 16bit RGB color, you don't have to worry about palette management, and there is no color index Visual Configuration available, but 24 bit and 16 bit can be slower than 8 bit (more pixels to push around). 16 Bit has nice visual quality, but isn't as slow as 24 bit.

OpenGL currently supports 8 bit , 16 bit , and 24 bit rendering.

Please see the section on known limitations for more information about palette management. 


[ Previous | Next | Table Of Contents ]