Example #1
0
///////////////////////////////////////////////////////////////////////////////
// Check rendering states and make appropriate adjustements. Returns true on
// termination flag.
BOOL CheckStates()
	{
	BOOL bRet = FALSE;

	// Is it time to leave or anything else
	EnterCriticalSection(&csThreadSafe);

	if(	rsRenderData.bModifyFlag)
		{
		// Flag set to terminate
		if(rsRenderData.bTerminate)
			bRet = TRUE;

		// Window resized
		if(rsRenderData.bResize)
			ResetViewport();

		// Reset the modify flag and exit
		rsRenderData.bModifyFlag = FALSE;
		}

	// Increment frame count
	rsRenderData.uiFrames++;

	LeaveCriticalSection(&csThreadSafe);

	return bRet;
	}
 void Graphics::SetViewportSize(int aWidth, int aHeight)
 {
     //Reset the viewport
 	m_ViewportWidth = aWidth;
     m_ViewportHeight = aHeight;
     ResetViewport();
     
     //Reset the projection and view matrices
     if(m_ActiveCamera != nullptr)
     {
         m_ActiveCamera->ResetProjectionMatrix();
         m_ActiveCamera->ResetViewMatrix();
     }
 }
Example #3
0
//===============================================================================================================================
void D3D::GBufferEnd()
{
	mGBuffer->End();
	
	//m_deviceContext->ClearDepthStencilView(m_pBackbufferDS->GetDSView(), D3D11_CLEAR_DEPTH, 1.0f, 0);
	
	//Set the depth stencil state
	m_deviceContext->OMSetDepthStencilState(m_depthStencilState, 1);
	
	SetBackBufferRenderTarget();
	//ID3D11RenderTargetView* rtv[1] = { m_pBackbufferRT->RTView };
	//m_deviceContext->OMSetRenderTargets(1, rtv, NULL);
	
	//Reset the viewport back to the original
	ResetViewport();
}