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.
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 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.
  • 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.
    Chapter 3                                                                                                                Error Handling