Exemplo n.º 1
0
//-----------------------------------------------------------------------------------------------
void Game::Render() const
{
	static const double NEAR_CLIPPING_PLANE_DISTANCE = 0.1;
	static const double FAR_CLIPPING_PLANE_DISTANCE = 1000.0;

	Renderer* renderer = Renderer::GetRenderer();

	renderer->PushMatrix();

	renderer->SetPerpectiveProjection( m_horizontalFOVDegrees, m_aspectRatio, NEAR_CLIPPING_PLANE_DISTANCE, FAR_CLIPPING_PLANE_DISTANCE );

	RenderGame();
	Debug::RenderDrawings();

	renderer->PopMatrix();

	renderer->PushMatrix();

	renderer->SetOrthographicProjection( 0.0, static_cast< double >( m_screenWidth ), 0.0, static_cast< double >( m_screenHeight ), 0.0, FAR_CLIPPING_PLANE_DISTANCE );
	renderer->DisableFeature( Renderer::DEPTH_TESTING );
	renderer->DisableDepthBufferWriting();

	RenderUI();

	if( m_consoleVisible )
		m_console->Render();

	renderer->EnableDepthBufferWriting();
	renderer->EnableFeature( Renderer::DEPTH_TESTING );

	renderer->PopMatrix();
}