Masking Writes to the Frame Buffer |
Writes to the frame buffer and depth buffer can be selectively disabled and enabled.
The Glide functionsNote that disabling writes to the alpha planes is the same as disabling writes to the depth planes since they both share the same memory.
- grColorMask() and grDepthMask() control buffer masking:
- FXTRUE values allow writes to the associated buffer,
- FXFALSE values disable writes to the associated buffer.
- Writes to the color and alpha buffers are controlled by grColorMask() whereas writes to the depth buffer are controlled by grDepthMask() (described in Chapter 7).
void grColorMask( FxBool rgb, FxBool alpha ) void grDepthMask( FxBool enable )
grColorMask() specifies whether the color and/or alpha buffers can or cannot be written to during rendering operations.
If RGB is FXFALSE, for example, no change is made to the color buffer regardless of the drawing operation attempted. The alpha parameter is ignored if depth buffering is enabled since the alpha and depth buffers share memory.grDepthMask() enables writes to the depth buffer.
The value of grColorMask() and grDepthMask() are ignored during linear frame buffer writes if the pixel pipeline is disabled (i.e.. grLfbBypassMode() is enabled) (see Chapter 11). The default values are FXTRUE, indicating that the associated buffers are writable.