DepthStencilState Class

Contains depth-stencil state for the device.

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)

public class DepthStencilState : GraphicsResource

The DepthStencilState type exposes the following members.

  NameDescription
Public methodDepthStencilStateCreates an instance of DepthStencilState with default values.
Top

  NameDescription
Public propertyCounterClockwiseStencilDepthBufferFailGets 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 propertyCounterClockwiseStencilFailGets or sets the stencil operation to perform if the stencil test fails for a counterclockwise triangle. The default is Keep.
Public propertyCounterClockwiseStencilFunctionGets or sets the comparison function to use for counterclockwise stencil tests. The default is Always.
Public propertyCounterClockwiseStencilPassGets or sets the stencil operation to perform if the stencil and depth-tests pass for a counterclockwise triangle. The default is Keep.
Public propertyDepthBufferEnableGets or sets a value that indicates whether to enable depth buffering. The default is true.
Public propertyDepthBufferFunctionGets or sets the comparison function for the depth-buffer test. The default is LessEqual.
Public propertyDepthBufferWriteEnableGets or sets a value that indicates whether to enable writing to the depth buffer. The default is true.
Public propertyIsDisposedGets a value that indicates whether the object is disposed. (Inherited from GraphicsResource.)
Public propertyReferenceStencilGets or sets a reference value to use for the stencil test. The default is zero.
Public propertyStencilDepthBufferFailGets or sets the stencil operation to perform if the stencil test passes and the depth-test fails. The default is Keep.
Public propertyStencilEnableGets or sets stencil enabling. The default is false.
Public propertyStencilFailGets or sets the stencil operation to perform if the stencil test fails. The default is Keep.
Public propertyStencilFunctionGets or sets the comparison function for the stencil test. The default is Always.
Public propertyStencilMaskGets 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 propertyStencilPassGets or sets the stencil operation to perform if the stencil test passes. The default is Keep.
Public propertyStencilWriteMaskGets or sets the write mask applied to values written into the stencil buffer. The default mask is MaxValue.
Public propertyTwoSidedStencilModeGets or sets a value that indicates whether to enable two-sided stenciling. The default is false.
Top

  NameDescription
Public methodDispose()Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.)
Protected methodDispose(Boolean)Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.)
Protected methodFinalizeAllows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object. (Inherited from GraphicsResource.)
Top

  NameDescription
Public fieldStatic memberDefaultA built-in state object with default settings for using a depth stencil buffer.
Public fieldStatic memberDepthReadA built-in state object with settings for enabling a read-only depth stencil buffer.
Public fieldStatic memberNoneA built-in state object with settings for not using a depth stencil buffer.
Top

Silverlight

Supported in: 5

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

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

Community Additions

ADD
Show: