本文整理汇总了C++中TRefCountPtr::CreateDepthStencilView方法的典型用法代码示例。如果您正苦于以下问题:C++ TRefCountPtr::CreateDepthStencilView方法的具体用法?C++ TRefCountPtr::CreateDepthStencilView怎么用?C++ TRefCountPtr::CreateDepthStencilView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRefCountPtr
的用法示例。
在下文中一共展示了TRefCountPtr::CreateDepthStencilView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SUCCEEDED
void FSlateD3DRenderer::CreateDepthStencilBuffer( FSlateD3DViewport& Viewport )
{
TRefCountPtr<ID3D11Texture2D> DepthStencil;
D3D11_TEXTURE2D_DESC DescDepth;
DescDepth.Width = Viewport.ViewportInfo.Width;
DescDepth.Height = Viewport.ViewportInfo.Height;
DescDepth.MipLevels = 1;
DescDepth.ArraySize = 1;
#if DEPTH_32_BIT_CONVERSION
DescDepth.Format = DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
#else
DescDepth.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
#endif
DescDepth.SampleDesc.Count = 1;
DescDepth.SampleDesc.Quality = 0;
DescDepth.Usage = D3D11_USAGE_DEFAULT;
DescDepth.BindFlags = D3D11_BIND_DEPTH_STENCIL;
DescDepth.CPUAccessFlags = 0;
DescDepth.MiscFlags = 0;
HRESULT Hr = GD3DDevice->CreateTexture2D( &DescDepth, NULL, DepthStencil.GetInitReference() );
check( SUCCEEDED(Hr) );
D3D11_DEPTH_STENCIL_VIEW_DESC DescDSV;
#if DEPTH_32_BIT_CONVERSION
DescDSV.Format = DXGI_FORMAT_D32_FLOAT_S8X24_UINT ;
#else
DescDSV.Format = DXGI_FORMAT_D24_UNORM_S8_UINT ;
#endif
DescDSV.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
DescDSV.Texture2D.MipSlice = 0;
DescDSV.Flags = 0;
// Create the depth stencil view
Hr = GD3DDevice->CreateDepthStencilView( DepthStencil, &DescDSV, Viewport.DepthStencilView.GetInitReference() );
check( SUCCEEDED(Hr) );
}