MCPcopy Create free account
hub / github.com/carbonengine/trinity / OnPrepareResources

Method OnPrepareResources

trinity/Tr2SwapChain.cpp:29–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29bool Tr2SwapChain::OnPrepareResources()
30{
31 USE_MAIN_THREAD_RENDER_CONTEXT();
32 if( SUCCEEDED( m_swapChain.Create( m_windowHandle, renderContext ) ) )
33 {
34 if( !m_depthStencil )
35 {
36 m_depthStencil.Attach( new OTr2DepthStencil );
37 }
38 CR_RETURN_VAL( HRESULT( m_depthStencil->Create( m_swapChain.GetWidth(), m_swapChain.GetHeight(), Tr2RenderContextEnum::DSFMT_D24S8, 0, 0 ) ), false );
39 if( !m_backBuffer )
40 {
41 m_backBuffer.CreateInstance();
42 m_backBuffer->SetName( "swapchain backbuffer" );
43 }
44 m_backBuffer->Attach( m_swapChain.GetBackBuffer(), this );
45 return true;
46 }
47 return false;
48}
49
50bool Tr2SwapChain::Present( Tr2RenderContext& renderContext )
51{

Callers

nothing calls this directly

Calls 7

CreateInstanceMethod · 0.80
CreateMethod · 0.45
AttachMethod · 0.45
GetWidthMethod · 0.45
GetHeightMethod · 0.45
SetNameMethod · 0.45
GetBackBufferMethod · 0.45

Tested by

no test coverage detected