Table 4-1 illustrates which X visuals support which type of OpenGL rendering, and whether the colormaps for those visuals are writable or not. Visuals that aren't available on Silicon Graphics systems are marked with an asterisk.
OpenGL Rendering Mode | X visual | Writable colormap? |
---|---|---|
RGBA | TrueColor | no |
RGBA | DirectColor[1] | yes |
color index | PseudoColor | yes |
color index | StaticColor* | no |
not supported | GrayScale | yes |
not supported | StaticGray | no |
An X server can provide multiple visuals, depending on the available hardware and software support. Each server has a default visual that can be specified when the server starts. You can determine the default visual with the Xlib macro DefaultVisual().
Because you can't predict the configuration of every X server, and you may not know the system configuration your program will be used on, it is best to find out what visual classes are available on a case-by-case basis.
Note: For most applications, using OpenGL RGBA color mode and a TrueColor visual is recommended.