Device.DepthStencilSurface Property |
Language: |
Retrieves or sets the depth stencil surface owned by the Device object.
Visual Basic Public Property DepthStencilSurface As Surface C# public Surface DepthStencilSurface { get; set; } C++ public:
property Surface^ DepthStencilSurface {
Surface^ get();
void set(Surface^ value);
}JScript public function get DepthStencilSurface() : Surface
public function set DepthStencilSurface(Surface);
Microsoft.DirectX.Direct3D.Surface
Setting this value to null disables the depth stencil operation.This property is read/write.
Returns a Surface object that represents the depth stencil surface. If no depth stencil buffer is associated with the device, the return value is null.
The following restrictions apply when using this property.
- The multisample type must be the same for the render target and the depth stencil surface.
- The formats for the render target and depth stencil surface must be compatible. For more information, see Manager.CheckDepthStencilMatch.
- The size of the depth stencil surface must be greater than or equal to the size of the render target.
These restrictions are validated only when using the debug runtime when any of the Device drawing methods are called.
Cube textures differ from other surfaces in that they are collections of surfaces. To set a new depth stencil surface with a cube texture, choose an individual face using CubeTexture.GetCubeMapSurface, and pass the resulting surface to this property.
Exceptions
NotFoundException Occurs if the device does not have a depth stencil buffer associated with it. InvalidCallException Occurs if the method call is invalid. For example, a parameter may have an invalid value.
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center