Clearing Buffers |
The ability to clear a display buffer is fundamental to animation, since the remnants of a previously rendered scene must be reset before a new scene can be rendered. The Voodoo Graphics hardware allows the back buffer and alpha or depth buffer to be cleared simultaneously.
Note :
Clearing the buffer is not necessary when the scene paints a background
that covers the entire area.
Buffers are cleared by calling grBufferClear(). The area within
the buffer to be cleared is defined by grClipWindow(), described
in the next chapter.
The three parameters specify the values that will be used to clear
:
Although the color, alpha, and
depth parameters are always specified, the parameters actually used
will depend on the current configuration of the hardware, the irrelevant
parameters are ignored.
The depth parameter can be one of the constants
or a direct representation of a value in the depth buffer. See Chapter
7 for more details.
void grBufferClear( GrColor_t color, GrAlpha_t alpha, FxU16 depth ) |
Any buffers that are enabled are automatically and simultaneously cleared by grBufferClear().
For example,If an application does not want a buffer to be cleared, it should mask off writes to the buffer using grDepthMask() and grColorMask() as appropriate.if depth buffering is enabled (with grDepthBufferMode(), described in Chapter 7), the depth buffer will be cleared to depth. If alpha buffering is enabled (with grAlphaBlendFunction(), described in Chapter 6), the alpha buffer will be cleared to alpha. And if writes to the display buffer are enabled (with grColorMask(), described in Chapter 5), then it will be cleared to color.