Example #1
0
// The Render function puts the model geometry on the video card to prepare it for drawing by the color shader.
void Overlay::Render( const Graphics &Gfx )
{
	// Begin and End draw are done here because the overlay is rendering to a texture
	// and not to the back buffer, so Overlay needs to control when to begin and end the
	// drawing.
	
	// All overlay rendering should be done between BeginDraw and EndDraw
	Gfx.BeginDraw2D();

	if( m_reachedGoal )
	{
		Gfx.RenderString(
			msg->GetString(),
			m_Font.Get(),
			msg->GetRect()
		);
	}
	
	// Signal direct2d that we are done drawing
	Gfx.EndDraw2D();
}