本文整理汇总了C++中TRefCountPtr::OMSetRenderTargets方法的典型用法代码示例。如果您正苦于以下问题:C++ TRefCountPtr::OMSetRenderTargets方法的具体用法?C++ TRefCountPtr::OMSetRenderTargets怎么用?C++ TRefCountPtr::OMSetRenderTargets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRefCountPtr
的用法示例。
在下文中一共展示了TRefCountPtr::OMSetRenderTargets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void FSlateD3DRenderer::DrawWindows( FSlateDrawBuffer& InWindowDrawBuffer )
{
// Update the font cache with new text before elements are batched
FontCache->UpdateCache();
// Iterate through each element list and set up an RHI window for it if needed
TArray<FSlateWindowElementList>& WindowElementLists = InWindowDrawBuffer.GetWindowElementLists();
for( int32 ListIndex = 0; ListIndex < WindowElementLists.Num(); ++ListIndex )
{
FSlateWindowElementList& ElementList = WindowElementLists[ListIndex];
if ( ElementList.GetWindow().IsValid() )
{
TSharedRef<SWindow> WindowToDraw = ElementList.GetWindow().ToSharedRef();
// Add all elements for this window to the element batcher
ElementBatcher->AddElements( ElementList.GetDrawElements() );
bool bUnused = false;
ElementBatcher->FillBatchBuffers( ElementList, bUnused );
// All elements for this window have been batched and rendering data updated
ElementBatcher->ResetBatches();
FVector2D WindowSize = WindowToDraw->GetSizeInScreen();
FSlateD3DViewport* Viewport = WindowToViewportMap.Find( &WindowToDraw.Get() );
check(Viewport);
RenderingPolicy->UpdateBuffers( ElementList );
check(Viewport);
GD3DDeviceContext->RSSetViewports(1, &Viewport->ViewportInfo );
ID3D11RenderTargetView* RTV = Viewport->RenderTargetView;
ID3D11DepthStencilView* DSV = Viewport->DepthStencilView;
GD3DDeviceContext->OMSetRenderTargets( 1, &RTV, NULL );
RenderingPolicy->DrawElements( ViewMatrix*Viewport->ProjectionMatrix, ElementList.GetRenderBatches() );
GD3DDeviceContext->OMSetRenderTargets(0, NULL, NULL);
const bool bUseVSync = false;
Viewport->D3DSwapChain->Present( bUseVSync ? 1 : 0, 0);
// All elements have been drawn. Reset all cached data
ElementBatcher->ResetBatches();
}
}
// flush the cache if needed
FontCache->ConditionalFlushCache();
}
示例2: SUCCEEDED
void FSlateD3DRenderer::Private_ResizeViewport( const TSharedRef<SWindow> InWindow, uint32 Width, uint32 Height, bool bFullscreen )
{
FSlateD3DViewport* Viewport = WindowToViewportMap.Find( &InWindow.Get() );
if( Viewport && ( Width != Viewport->ViewportInfo.Width || Height != Viewport->ViewportInfo.Height || bFullscreen != Viewport->bFullscreen ) )
{
GD3DDeviceContext->OMSetRenderTargets(0,NULL,NULL);
Viewport->BackBufferTexture.SafeRelease();
Viewport->RenderTargetView.SafeRelease();
Viewport->DepthStencilView.SafeRelease();
Viewport->ViewportInfo.Width = Width;
Viewport->ViewportInfo.Height = Height;
Viewport->bFullscreen = bFullscreen;
Viewport->ProjectionMatrix = CreateProjectionMatrixD3D( Width, Height );
DXGI_SWAP_CHAIN_DESC Desc;
Viewport->D3DSwapChain->GetDesc( &Desc );
HRESULT Hr = Viewport->D3DSwapChain->ResizeBuffers( Desc.BufferCount, Viewport->ViewportInfo.Width, Viewport->ViewportInfo.Height, Desc.BufferDesc.Format, Desc.Flags );
check( SUCCEEDED(Hr) );
CreateBackBufferResources( Viewport->D3DSwapChain, Viewport->BackBufferTexture,Viewport->RenderTargetView );
}
}