Bagikan melalui


GraphicsDevice.Clear Method

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

Overload List

Name Description
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.

Remarks

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.

See Also

Reference

GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace