本文整理汇总了C++中TRefCountPtr::GetParent方法的典型用法代码示例。如果您正苦于以下问题:C++ TRefCountPtr::GetParent方法的具体用法?C++ TRefCountPtr::GetParent怎么用?C++ TRefCountPtr::GetParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRefCountPtr
的用法示例。
在下文中一共展示了TRefCountPtr::GetParent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsViewportFullscreen
void FSlateD3DRenderer::Private_CreateViewport( TSharedRef<SWindow> InWindow, const FVector2D &WindowSize )
{
TSharedRef< FGenericWindow > NativeWindow = InWindow->GetNativeWindow().ToSharedRef();
bool bFullscreen = IsViewportFullscreen( *InWindow );
bool bWindowed = true;//@todo implement fullscreen: !bFullscreen;
DXGI_SWAP_CHAIN_DESC SwapChainDesc;
FMemory::Memzero(&SwapChainDesc, sizeof(SwapChainDesc) );
SwapChainDesc.BufferCount = 1;
SwapChainDesc.BufferDesc.Width = FMath::TruncToInt(WindowSize.X);
SwapChainDesc.BufferDesc.Height = FMath::TruncToInt(WindowSize.Y);
SwapChainDesc.BufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
SwapChainDesc.BufferDesc.RefreshRate.Numerator = 0;
SwapChainDesc.BufferDesc.RefreshRate.Denominator = 1;
SwapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
SwapChainDesc.OutputWindow = (HWND)NativeWindow->GetOSWindowHandle();
SwapChainDesc.SampleDesc.Count = 1;
SwapChainDesc.SampleDesc.Quality = 0;
SwapChainDesc.Windowed = bWindowed;
SwapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
SwapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
TRefCountPtr<IDXGIDevice> DXGIDevice;
HRESULT Hr = GD3DDevice->QueryInterface( __uuidof(IDXGIDevice), (void**)DXGIDevice.GetInitReference() );
check( SUCCEEDED(Hr) );
TRefCountPtr<IDXGIAdapter> DXGIAdapter;
Hr = DXGIDevice->GetParent(__uuidof(IDXGIAdapter), (void **)DXGIAdapter.GetInitReference() );
check( SUCCEEDED(Hr) );
TRefCountPtr<IDXGIFactory> DXGIFactory;
DXGIAdapter->GetParent(__uuidof(IDXGIFactory), (void **)DXGIFactory.GetInitReference() );
check( SUCCEEDED(Hr) );
FSlateD3DViewport Viewport;
Hr = DXGIFactory->CreateSwapChain(DXGIDevice.GetReference(), &SwapChainDesc, Viewport.D3DSwapChain.GetInitReference() );
check( SUCCEEDED(Hr) );
Hr = DXGIFactory->MakeWindowAssociation((HWND)NativeWindow->GetOSWindowHandle(),DXGI_MWA_NO_ALT_ENTER);
check(SUCCEEDED(Hr));
uint32 Width = FMath::TruncToInt(WindowSize.X);
uint32 Height = FMath::TruncToInt(WindowSize.Y);
Viewport.ViewportInfo.MaxDepth = 1.0f;
Viewport.ViewportInfo.MinDepth = 0.0f;
Viewport.ViewportInfo.Width = Width;
Viewport.ViewportInfo.Height = Height;
Viewport.ViewportInfo.TopLeftX = 0;
Viewport.ViewportInfo.TopLeftY = 0;
CreateBackBufferResources( Viewport.D3DSwapChain, Viewport.BackBufferTexture, Viewport.RenderTargetView );
Viewport.ProjectionMatrix = CreateProjectionMatrixD3D( Width, Height );
WindowToViewportMap.Add( &InWindow.Get(), Viewport );
}