Next | Prev | Up | Top | Contents | Index

Some Background on Visuals

An X visual defines how pixels in a window are mapped to colors on the screen. Each window has an associated visual, which determines how pixels within the window are displayed on screen. GLX overloads X visuals with additional framebuffer capabilities needed by OpenGL.

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.

X Visuals and Supported OpenGL Rendering Modes
OpenGL Rendering ModeX visualWritable colormap?
RGBATrueColorno
RGBADirectColor[1]yes
color indexPseudoColoryes
color indexStaticColor*no
not supportedGrayScaleyes
not supportedStaticGrayno

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.


[1] Not supported on Silicon Graphics systems.
Next | Prev | Up | Top | Contents | Index