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 | |
---|---|---|
DepthStencilState | Creates an instance of DepthStencilState with default values. |
Top
Properties
Name | Description | |
---|---|---|
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. | |
CounterClockwiseStencilFail | Gets or sets the stencil operation to perform if the stencil test fails for a counterclockwise triangle. The default is Keep. | |
CounterClockwiseStencilFunction | Gets or sets the comparison function to use for counterclockwise stencil tests. The default is Always. | |
CounterClockwiseStencilPass | Gets or sets the stencil operation to perform if the stencil and depth-tests pass for a counterclockwise triangle. The default is Keep. | |
DepthBufferEnable | Gets or sets a value that indicates whether to enable depth buffering. The default is true. | |
DepthBufferFunction | Gets or sets the comparison function for the depth-buffer test. The default is LessEqual. | |
DepthBufferWriteEnable | Gets or sets a value that indicates whether to enable writing to the depth buffer. The default is true. | |
IsDisposed | Gets a value that indicates whether the object is disposed. (Inherited from GraphicsResource.) | |
ReferenceStencil | Gets or sets a reference value to use for the stencil test. The default is zero. | |
StencilDepthBufferFail | Gets or sets the stencil operation to perform if the stencil test passes and the depth-test fails. The default is Keep. | |
StencilEnable | Gets or sets stencil enabling. The default is false. | |
StencilFail | Gets or sets the stencil operation to perform if the stencil test fails. The default is Keep. | |
StencilFunction | Gets or sets the comparison function for the stencil test. The default is Always. | |
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. | |
StencilPass | Gets or sets the stencil operation to perform if the stencil test passes. The default is Keep. | |
StencilWriteMask | Gets or sets the write mask applied to values written into the stencil buffer. The default mask is MaxValue. | |
TwoSidedStencilMode | Gets or sets a value that indicates whether to enable two-sided stenciling. The default is false. |
Top
Methods
Name | Description | |
---|---|---|
Dispose() | Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.) | |
Dispose(Boolean) | Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.) | |
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 | |
---|---|---|
Default | A built-in state object with default settings for using a depth stencil buffer. | |
DepthRead | A built-in state object with settings for enabling a read-only depth stencil buffer. | |
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.