| 314 | } |
| 315 | |
| 316 | void |
| 317 | DeviceManager::Render() |
| 318 | { |
| 319 | D3D11_VIEWPORT viewport = { 0.0f, 0.0f, (float)m_SwapChainDesc.BufferDesc.Width, (float)m_SwapChainDesc.BufferDesc.Height, 0.0f, 1.0f }; |
| 320 | |
| 321 | // rendering back-to-front |
| 322 | for(auto it = m_vControllers.rbegin(); it != m_vControllers.rend(); it++) |
| 323 | { |
| 324 | if((*it)->IsEnabled()) |
| 325 | { |
| 326 | m_ImmediateContext->OMSetRenderTargets(1, &m_BackBufferRTV, m_DepthStencilDSV); |
| 327 | m_ImmediateContext->RSSetViewports(1, &viewport); |
| 328 | |
| 329 | (*it)->Render(m_Device, m_ImmediateContext, m_BackBufferRTV, m_DepthStencilDSV); |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | m_ImmediateContext->OMSetRenderTargets(0, NULL, NULL); |
| 334 | } |
| 335 | |
| 336 | void |
| 337 | DeviceManager::Animate(double fElapsedTimeSeconds) |