3.4 The Heart of the Renderer 207
Re nderer Constants
The renderer constants were discussed previously. The class RendererConstant has
a set of enumerations that name the renderer constants that a shader program will
use. The class also has a corresponding set of string names for these constants. The
parser in
Program::Load compares the names of shader constants found in the shader
program file to the string names of
RendererConstant. When it finds a match, the
constant is added to an array of
RendererConstant objects in the Program object. In
addition to storing the value of the constant, the parser also discovers which register
(or registers) has been assigned to the constant and stores that information. The
shader constants and registers are accessed ...