//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void CDmeDrawSettings::DrawDag( CDmeDag *pDag )
{
	if ( !pDag )
		return;

	CMatRenderContextPtr pRenderContext( g_pMaterialSystem );

	m_IsAMaterialBound = false;

	if ( !Shaded() )
	{
		BindWireframe();
	}
	else if ( GetGrayShade() )
	{
		BindGray();
	}

	pDag->Draw( this );

	m_IsAMaterialBound = false;

	if ( GetWireframeOnShaded() )
	{
		if ( Shaded() )
		{
			VMatrix m;

			pRenderContext->GetMatrix( MATERIAL_PROJECTION, &m );

			/*	Extract the near and far clipping plane values from projection matrix
			float c = m[ 2 ][ 2 ];
			float d = m[ 2 ][ 3 ];

			const float near = d / ( c - 1.0f );
			const float far = d / ( c + 1.0f );
			*/

			const float zBias = 0.00025;
			m[ 2 ][ 2 ] += zBias;
			m[ 2 ][ 3 ] += zBias;

			pRenderContext->MatrixMode( MATERIAL_PROJECTION );
			pRenderContext->PushMatrix();
			pRenderContext->LoadMatrix( m );

			BindWireframeOnShaded();
			PushDrawType();
			SetDrawType( CDmeDrawSettings::DRAW_WIREFRAME );
			pDag->Draw( this );
			PopDrawType();

			pRenderContext->MatrixMode( MATERIAL_PROJECTION );
			pRenderContext->PopMatrix();
		}
	}
}
Пример #2
0
//-----------------------------------------------------
void CTestRectGc::ConstructL(TPoint aPt, TSize aSize, TRgb aPenColor, TRgb aBrushColor, CGraphicsContext::TBrushStyle aBrushStyle)
    {    
    SetPenColor(aPenColor);
    SetBrushColor(aBrushColor);
    
    SetBrushStyle(aBrushStyle);
    SetDrawType(EDrawRect);
    SetExtent(aPt, aSize);
   
   	iFrameNo = g_FrameStart+=5; //Offset frame start for next control
   	g_FrameStart %= KNumAnimFrames;			
   }