Specifying Colors |
A color consists of three or four color components:
The color component values should be clamped to the range [0..255]
where 0 is black and 255 is maximum intensity.
The color components are packed together into a word to form a color. Glide supports four different color byte orderings, defined in the enumerated type GrColorFormat_t (see Figure 3.1 for a pictorial representation).
Color byte ordering determines how linear frame buffer writes and color arguments are interpreted and is established in the call to grSstWinOpen() when the Glide and Voodoo Graphics systems are initialized (see Chapter 3). |
The GrColor_t type definition represents a packed color value and is used in routines that set a constant color:
void grConstantColorValue( GrColor_t color ) |
Glide refers to a global constant color when performing flat shaded primitive rendering, set with grConstantColorValue(). The default value is 0xFFFFFFFF.Vertex colors are specified in the GrVertex structure as individual color components, since the Voodoo Graphics system will iterate and compute slopes for each color individually.