Export (0) Print
Expand All

GraphicsDevice.Clear Method

Clears the viewport depth buffer, and erases the stencil buffer.

NameDescription
GraphicsDevice.Clear (ClearOptions, Color, Single, Int32)Clears the viewport to a specified color, clears the depth buffer, and erases the stencil buffer.
GraphicsDevice.Clear (ClearOptions, Color, Single, Int32, Rectangle[])Clears a set of regions to a specified color, clears the depth buffer, and erases the stencil buffer.
GraphicsDevice.Clear (ClearOptions, Vector4, Single, Int32)Clears the viewport to a specified color, clears the depth buffer, and erases the stencil buffer.
GraphicsDevice.Clear (ClearOptions, Vector4, Single, Int32, Rectangle[])Clears a set of regions to a specified color, clears the depth buffer, and erases the stencil buffer.
GraphicsDevice.Clear (Color)Clears the viewport to a specified color.

This method fails if ClearOptions.ZBuffer or ClearOptions.Stencil is specified when the render target does not have an attached depth buffer. Similarly, the method fails if ClearOptions.Stencil is specified when the depth-buffer format does not contain stencil buffer information.
Show:
© 2014 Microsoft