Solaris Handbook for Sun Frame Buffers

Notes to Programmers

X client programmers should strive to write programs that are 24-bit clean, so that they run properly when the default visual is 24-bit TrueColor.

A program might fail to be 24-bit clean for several reasons. Following are some programming practices to avoid:

Some programs only run in 8-bit depth because they have been ported from 8-bit-only systems and they have not been upgraded. Some programs might store their lists of pixels in a 256-element array. Other programs may require a modifiable colormap to perform colormap double buffering.

If your program requires 8-bit PseudoColor, check the depth and class of the default visual. If it's not the 8-bit PseudoColor visual, search the visual list until you find it.

On a multiple plane group device like the Creator accelerator, the depth of the window you are creating may not match the depth of the parent window (which is often the root window). Unless you specify an explicit border pixel value, the border pixel value of the window is inherited from the parent. If the depths differ, XCreateWindow will fail with a BadMatch error. Always use XCreatewindow rather than XCreateSimpleWindow and explicitly specify a border pixel value.

Test your applications under both "defdepth 8" and "defdepth 24" modes of the window system.