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


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

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


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


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