/// <summary> /// Create a depth-stencil state object that encapsulates depth-stencil test information for the output-merger stage. /// </summary> /// <param name="device">The <see cref="GraphicsDevice"/>.</param> /// <param name="depthStencilState">An existing <see cref="Direct3D11.DepthStencilState"/> instance.</param> /// <returns>A new instance of <see cref="DepthStencilState"/></returns> /// <remarks> /// <p>4096 unique depth-stencil state objects can be created on a device at a time.</p><p>If an application attempts to create a depth-stencil-state interface with the same state as an existing interface, the same interface will be returned and the total number of unique depth-stencil state objects will stay the same.</p> /// </remarks> /// <msdn-id>ff476506</msdn-id> /// <unmanaged>HRESULT ID3D11Device::CreateDepthStencilState([In] const D3D11_DEPTH_STENCIL_DESC* pDepthStencilDesc,[Out, Fast] ID3D11DepthStencilState** ppDepthStencilState)</unmanaged> /// <unmanaged-short>ID3D11Device::CreateDepthStencilState</unmanaged-short> public static DepthStencilState New(GraphicsDevice device, Direct3D11.DepthStencilState depthStencilState) { return(new DepthStencilState(device, depthStencilState)); }
/// <summary> /// Initializes a new instance of the <see cref="DepthStencilState" /> class. /// </summary> /// <param name="device">The device local.</param> /// <param name="nativeState">State of the native.</param> private DepthStencilState(GraphicsDevice device, Direct3D11.DepthStencilState nativeState) : base(device.MainDevice) { Description = nativeState.Description; Initialize(nativeState); }