当前位置: 首页>>代码示例>>C++>>正文


C++ CGraphic::GetRenderStack方法代码示例

本文整理汇总了C++中CGraphic::GetRenderStack方法的典型用法代码示例。如果您正苦于以下问题:C++ CGraphic::GetRenderStack方法的具体用法?C++ CGraphic::GetRenderStack怎么用?C++ CGraphic::GetRenderStack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGraphic的用法示例。


在下文中一共展示了CGraphic::GetRenderStack方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Render

void CFlashRender::Render()
{
	CGraphic* pGraphic = CGraphic::GetInst();
	pGraphic->ClearStack();
	CMainWindowTarget::GetInst()->Clear();
	if(m_pText)
	{
		VerText2D* pVB;
		RenderState* pRS;
		CMatrix* Matrix = pGraphic->GetRenderStack( RS_GUI, m_pText, NULL, PT_TRIANGLESTRIP, 
			4, 2, VerText2D::Format, sizeof(VerText2D), (void**)&pVB, NULL, (void**)&pRS );
		pRS->m_Cull = 1;
		pRS->m_AlphaBlendEnable = m_bAlphaBlend;
		pRS->m_AlphaTestEnable  = m_bAlphaTest;
		pRS->m_ZTestEnable		= FALSE;
		Matrix->Identity();

		pVB[0].x = m_fOffX;  					pVB[0].y = m_fOffY;						pVB[0].z = 1.0f; 
		pVB[1].x = float(m_Width)+ m_fOffX;		pVB[1].y = m_fOffY;						pVB[1].z = 1.0f;	
		pVB[2].x = m_fOffX;						pVB[2].y = float(m_Height) + m_fOffY;	pVB[2].z = 1.0f;	
		pVB[3].x = float(m_Width)+ m_fOffX;		pVB[3].y = float(m_Height) + m_fOffY;	pVB[3].z = 1.0f;	

		pVB[0].w = 1.0;		pVB[0].tu = 0.0;	pVB[0].tv = 0.0;
		pVB[1].w = 1.0;		pVB[1].tu = 1.0;	pVB[1].tv = 0.0;
		pVB[2].w = 1.0;		pVB[2].tu = 0.0;	pVB[2].tv = 1.0; 
		pVB[3].w = 1.0;		pVB[3].tu = 1.0;	pVB[3].tv = 1.0;	

		if(m_bShowRect)
		{
			VerColor2D* pVBRenct;
			RenderState* pLRS;
			Matrix = pGraphic->GetRenderStack( RS_GUI, NULL, NULL, PT_TRIANGLESTRIP, 
				4, 2, VerColor2D::Format, sizeof(VerColor2D), (void**)&pVBRenct, NULL, (void**)&pLRS );
			Matrix->Identity();
			pLRS->m_Cull = 1;
			pLRS->m_AlpOP_S1		= TOP_SELECTARG1;
			pLRS->m_AlpArg1_S1		= TA_DIFFUSE;

			pLRS->m_TexOP_S1		= TOP_BLENDDIFFUSEALPHA;
			pLRS->m_TexArg1_S1		= TA_CURRENT;
			pLRS->m_TexArg2_S1		= TA_DIFFUSE;

			pLRS->m_AlphaBlendEnable = TRUE;
			pLRS->m_AlphaTestEnable = FALSE;
			pLRS->m_ZTestEnable		= FALSE;

			pVBRenct[0].x = m_fOffX + m_fRect.left;  	pVBRenct[0].y = m_fOffY + m_fRect.top;		pVBRenct[0].z = 1.0f;  
			pVBRenct[1].x = m_fOffX + m_fRect.right;	pVBRenct[1].y = m_fOffY + m_fRect.top;		pVBRenct[1].z = 1.0f;	
			pVBRenct[2].x = m_fOffX + m_fRect.left;		pVBRenct[2].y = m_fOffY + m_fRect.bottom;	pVBRenct[2].z = 1.0f;	
			pVBRenct[3].x = m_fOffX + m_fRect.right;	pVBRenct[3].y = m_fOffY + m_fRect.bottom;	pVBRenct[3].z = 1.0f;

			pVBRenct[0].w = 1.0f;
			pVBRenct[1].w = 1.0f;
			pVBRenct[2].w = 1.0f;
			pVBRenct[3].w = 1.0f;

			pVBRenct[0].diffuse = pVBRenct[1].diffuse = pVBRenct[2].diffuse = pVBRenct[3].diffuse = 0x800000FF;
		}
	}
}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:60,代码来源:CFlashRender.cpp

示例2: RenderSelWndList

	void CWndAreaRendere::RenderSelWndList()
	{
		if( !m_renderWndList || m_renderWndList->size() <= 1 )
			return;
		
		CGraphic* pGraphic = CGraphic::GetInst();
		vector<SQRWnd*>::iterator it = m_renderWndList->begin();
		vector<SQRWnd*>::iterator eit = m_renderWndList->end();
		while(it != eit)
		{
			SQRWnd* pwnd = *it;
			if (pwnd)
			{
				CFRect rt; pwnd->GetWndRect(rt);
				VerColor2D v[5]=
				{
					VerColor2D( (float)rt.left,  (float)rt.top,    0,	0xffff00ff ),
					VerColor2D( (float)rt.right, (float)rt.top,    0,	0xffff00ff ),
					VerColor2D( (float)rt.right, (float)rt.bottom, 0,	0xffff00ff ),
					VerColor2D( (float)rt.left,  (float)rt.bottom, 0,	0xffff00ff ),
					VerColor2D( (float)rt.left,  (float)rt.top,    0,	0xffff00ff ),
				};
				VerColor2D* pVB;
				RenderState * pRS;
				pGraphic->GetRenderStack( RS_FONT, NULL, NULL, PT_LINESTRIP, 5, 4, 
					VerColor2D::Format, sizeof(VerColor2D), (void**)&pVB, NULL, (void**)&pRS );
				pRS->m_ZTestEnable = false;
				pRS->m_ZTestFun    = CMP_ALWAYS;
				memcpy( pVB, v, sizeof( VerColor2D )*5 );
			}
			
			++it;
		}
		
	}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:35,代码来源:WndAreaRenderer.cpp

示例3: Render

	void CWndAreaRendere::Render()
	{
		// first render the root rect
		RenderRootRect();

		// then render the wnd rect selected
		if( !m_bRender )
			return;

		CGraphic* pGraphic = CGraphic::GetInst();
		VerColor2D v[5]=
		{
			VerColor2D( (float)m_curRect.left,  (float)m_curRect.top,    0,	0xff0000ff ),
			VerColor2D( (float)m_curRect.right, (float)m_curRect.top,    0,	0xff0000ff ),
			VerColor2D( (float)m_curRect.right, (float)m_curRect.bottom, 0,	0xff0000ff ),
			VerColor2D( (float)m_curRect.left,  (float)m_curRect.bottom, 0,	0xff0000ff ),
			VerColor2D( (float)m_curRect.left,  (float)m_curRect.top,    0,	0xff0000ff ),
		};
		VerColor2D* pVB;
		RenderState * pRS;
		pGraphic->GetRenderStack( RS_FONT, NULL, NULL, PT_LINESTRIP, 5, 4, 
			VerColor2D::Format, sizeof(VerColor2D), (void**)&pVB, NULL, (void**)&pRS );
		pRS->m_ZTestEnable = false;
		pRS->m_ZTestFun    = CMP_ALWAYS;
		memcpy( pVB, v, sizeof( VerColor2D )*5 );

		// render wnd list
		RenderSelWndList();
	}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:29,代码来源:WndAreaRenderer.cpp

示例4: RenderRootRect

	void CWndAreaRendere::RenderRootRect()
	{
		if( !m_bRootRender )
			return;

		CGraphic* pGraphic = CGraphic::GetInst();
		VerColor2D v[5]=
		{
			VerColor2D( (float)m_rootRect.left,  (float)m_rootRect.top,    0,	0xffff0000 ),
			VerColor2D( (float)m_rootRect.right, (float)m_rootRect.top,    0,	0xffff0000 ),
			VerColor2D( (float)m_rootRect.right, (float)m_rootRect.bottom, 0,	0xffff0000 ),
			VerColor2D( (float)m_rootRect.left,  (float)m_rootRect.bottom, 0,	0xffff0000 ),
			VerColor2D( (float)m_rootRect.left,  (float)m_rootRect.top,    0,	0xffff0000 ),
		};
		VerColor2D* pVB;
		RenderState * pRS;
		pGraphic->GetRenderStack( RS_FONT, NULL, NULL, PT_LINESTRIP, 5, 4, 
			VerColor2D::Format, sizeof(VerColor2D), (void**)&pVB, NULL, (void**)&pRS );
		pRS->m_ZTestEnable = false;
		pRS->m_ZTestFun    = CMP_ALWAYS;
		memcpy( pVB, v, sizeof( VerColor2D )*5 );
	}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:22,代码来源:WndAreaRenderer.cpp

示例5: Flip

void CRenderTarget::Flip()
{
	m_matPreDeltaView = m_matCurDeltaView;
	m_matCurDeltaView.Identity();

	CGraphic* pGph = CGraphic::GetInst();

	for ( int i = 0; i < m_nNearCount; i++ )
	{
		Vertex2D* pVB;
		RenderState* pRS;
		if( pGph->GetRenderStack( RS_DEFAULT, m_NearFilter[i].pText, NULL, PT_TRIANGLESTRIP, 4, 2,
			Vertex2D::Format, sizeof(Vertex2D), (void**)&pVB, NULL, (void**)&pRS ) )
		{
			if ( m_NearFilter[i].bRatio )
			{
				pVB[0] = Vertex2D( float(m_rcViewPort.left),float(m_rcViewPort.bottom),	0.99999994f, m_NearFilter[i].dwColor, m_NearFilter[i].cTexRt.left, m_NearFilter[i].cTexRt.bottom );
				pVB[1] = Vertex2D( float(m_rcViewPort.left),float(m_rcViewPort.top),	0.99999994f, m_NearFilter[i].dwColor, m_NearFilter[i].cTexRt.left, m_NearFilter[i].cTexRt.top );
				pVB[2] = Vertex2D( float(m_rcViewPort.right),float(m_rcViewPort.bottom),0.99999994f, m_NearFilter[i].dwColor, m_NearFilter[i].cTexRt.right, m_NearFilter[i].cTexRt.bottom );
				pVB[3] = Vertex2D( float(m_rcViewPort.right),float(m_rcViewPort.top),	0.99999994f, m_NearFilter[i].dwColor, m_NearFilter[i].cTexRt.right, m_NearFilter[i].cTexRt.top );

				pRS->m_UAddr_S0 = m_NearFilter[i].eSamp;
				pRS->m_VAddr_S0 = m_NearFilter[i].eSamp;
			}
			else
			{
				pVB[0] = Vertex2D( float(m_rcViewPort.left),float(m_rcViewPort.bottom),	0.99999994f, m_NearFilter[i].dwColor, 0, 1 );
				pVB[1] = Vertex2D( float(m_rcViewPort.left),float(m_rcViewPort.top),	0.99999994f, m_NearFilter[i].dwColor, 0, 0 );
				pVB[2] = Vertex2D( float(m_rcViewPort.right),float(m_rcViewPort.bottom),0.99999994f, m_NearFilter[i].dwColor, 1, 1 );
				pVB[3] = Vertex2D( float(m_rcViewPort.right),float(m_rcViewPort.top),	0.99999994f, m_NearFilter[i].dwColor, 1, 0 );
			}
			if(m_NearFilter[i].pText == NULL)
			{
				pRS->m_TexOP_S0		= TOP_SELECTARG2;
				pRS->m_AlpOP_S0		= TOP_SELECTARG2;
			}
			else
				pRS->m_AlpOP_S0		= TOP_MODULATE;
			pRS->m_LightEnable = FALSE;
			if ( !m_NearFilter[i].bMulti )
				pRS->m_DestBlend = BLEND_ONE;
		}
	}
	m_nNearCount = 0;
	
	for ( int i = 0; i < m_nFarCount; i++ )
	{
		Vertex2D* pVB;
		RenderState* pRS;
		if( pGph->GetRenderStack( RS_DEFAULT, m_FarFilter[i].pText, NULL, PT_TRIANGLESTRIP, 4, 2,
			Vertex2D::Format, sizeof(Vertex2D), (void**)&pVB, NULL, (void**)&pRS ) )
		{
			if ( m_FarFilter[i].bRatio )
			{
				pVB[0] = Vertex2D( float(m_rcViewPort.left),float(m_rcViewPort.bottom),	0.000018f, m_FarFilter[i].dwColor, m_FarFilter[i].cTexRt.left, m_FarFilter[i].cTexRt.bottom );
				pVB[1] = Vertex2D( float(m_rcViewPort.left),float(m_rcViewPort.top),	0.000018f, m_FarFilter[i].dwColor, m_FarFilter[i].cTexRt.left, m_FarFilter[i].cTexRt.top );
				pVB[2] = Vertex2D( float(m_rcViewPort.right),float(m_rcViewPort.bottom),0.000018f, m_FarFilter[i].dwColor, m_FarFilter[i].cTexRt.right, m_FarFilter[i].cTexRt.bottom );
				pVB[3] = Vertex2D( float(m_rcViewPort.right),float(m_rcViewPort.top),	0.000018f, m_FarFilter[i].dwColor, m_FarFilter[i].cTexRt.right, m_FarFilter[i].cTexRt.top );

				pRS->m_UAddr_S0 = m_FarFilter[i].eSamp;
				pRS->m_VAddr_S0 = m_FarFilter[i].eSamp;
			}
			else
			{
				pVB[0] = Vertex2D( float(m_rcViewPort.left),float(m_rcViewPort.bottom),	0.000018f, m_FarFilter[i].dwColor, 0, 1 );
				pVB[1] = Vertex2D( float(m_rcViewPort.left),float(m_rcViewPort.top),	0.000018f, m_FarFilter[i].dwColor, 0, 0 );
				pVB[2] = Vertex2D( float(m_rcViewPort.right),float(m_rcViewPort.bottom),0.000018f, m_FarFilter[i].dwColor, 1, 1 );
				pVB[3] = Vertex2D( float(m_rcViewPort.right),float(m_rcViewPort.top),	0.000018f, m_FarFilter[i].dwColor, 1, 0 );
			}
			if(m_FarFilter[i].pText == NULL)
			{
				pRS->m_TexOP_S0		= TOP_SELECTARG2;
				pRS->m_AlpOP_S0		= TOP_SELECTARG2;
			}
			else
				pRS->m_AlpOP_S0		= TOP_MODULATE;
			pRS->m_LightEnable	= FALSE;
			if ( !m_FarFilter[i].bMulti )
				pRS->m_DestBlend = BLEND_ONE;
		}
	}
	m_nFarCount = 0;

	for ( int i = 0; i < m_nPostCount; i++ )
	{
		m_PostFilter[i]->RenderFilter();
	}
	m_nPostCount = 0;
}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:89,代码来源:CRenderTarget.cpp


注:本文中的CGraphic::GetRenderStack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。