Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Clear Method
Collapse the table of content
Expand the table of content

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:
© 2015 Microsoft