다음을 통해 공유


DepthStencilState Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Contains depth-stencil state for the device.

Inheritance Hierarchy

System.Object
  Microsoft.Xna.Framework.Graphics.GraphicsResource
    Microsoft.Xna.Framework.Graphics.DepthStencilState

Namespace:  Microsoft.Xna.Framework.Graphics
Assembly:  Microsoft.Xna.Framework.Graphics (in Microsoft.Xna.Framework.Graphics.dll)

Syntax

'Declaration
Public Class DepthStencilState _
    Inherits GraphicsResource
public class DepthStencilState : GraphicsResource

The DepthStencilState type exposes the following members.

Constructors

  Name Description
Public method DepthStencilState Creates an instance of DepthStencilState with default values.

Top

Properties

  Name Description
Public property CounterClockwiseStencilDepthBufferFail Gets or sets the stencil operation to perform if the stencil test passes and the depth-buffer test fails for a counterclockwise triangle. The default is Keep.
Public property CounterClockwiseStencilFail Gets or sets the stencil operation to perform if the stencil test fails for a counterclockwise triangle. The default is Keep.
Public property CounterClockwiseStencilFunction Gets or sets the comparison function to use for counterclockwise stencil tests. The default is Always.
Public property CounterClockwiseStencilPass Gets or sets the stencil operation to perform if the stencil and depth-tests pass for a counterclockwise triangle. The default is Keep.
Public property DepthBufferEnable Gets or sets a value that indicates whether to enable depth buffering. The default is true.
Public property DepthBufferFunction Gets or sets the comparison function for the depth-buffer test. The default is LessEqual.
Public property DepthBufferWriteEnable Gets or sets a value that indicates whether to enable writing to the depth buffer. The default is true.
Public property IsDisposed Gets a value that indicates whether the object is disposed. (Inherited from GraphicsResource.)
Public property ReferenceStencil Gets or sets a reference value to use for the stencil test. The default is zero.
Public property StencilDepthBufferFail Gets or sets the stencil operation to perform if the stencil test passes and the depth-test fails. The default is Keep.
Public property StencilEnable Gets or sets stencil enabling. The default is false.
Public property StencilFail Gets or sets the stencil operation to perform if the stencil test fails. The default is Keep.
Public property StencilFunction Gets or sets the comparison function for the stencil test. The default is Always.
Public property StencilMask Gets or sets the mask applied to the reference value and each stencil buffer entry to determine the significant bits for the stencil test. The default mask is MaxValue.
Public property StencilPass Gets or sets the stencil operation to perform if the stencil test passes. The default is Keep.
Public property StencilWriteMask Gets or sets the write mask applied to values written into the stencil buffer. The default mask is MaxValue.
Public property TwoSidedStencilMode Gets or sets a value that indicates whether to enable two-sided stenciling. The default is false.

Top

Methods

  Name Description
Public method Dispose() Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.)
Protected method Dispose(Boolean) Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.)
Protected method Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object. (Inherited from GraphicsResource.)

Top

Fields

  Name Description
Public fieldStatic member Default A built-in state object with default settings for using a depth stencil buffer.
Public fieldStatic member DepthRead A built-in state object with settings for enabling a read-only depth stencil buffer.
Public fieldStatic member None A built-in state object with settings for not using a depth stencil buffer.

Top

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.