LPCTSTR str="欢迎来到我的世界"; //d3dClear(D3DCOLOR_XRGB(200,200,24)); //d3dClear(0); //d3dHdc hdc; //SetTextColor(hdc,RGB(255,255,255)); //SetBkMode(hdc,1); //TextOut(hdc,0,0,str,strlen(str)); //hdc.Release (); d3dClear(); //秨﹍酶籹 d3d_Device->BeginScene(); d3d_Device->SetRenderState( D3DRS_CULLMODE , D3DCULL_NONE); d3d_Device->SetRenderState( D3DRS_ZENABLE , D3DZB_FALSE ); d3d_Device->SetRenderState( D3DRS_SHADEMODE , D3DSHADE_FLAT ); d3d_Device->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE ); a_Bk.BltFast(0 , 0 ); //开混色 d3d_Device->SetRenderState( D3DRS_SRCBLEND , D3DBLEND_SRCALPHA); d3d_Device->SetRenderState( D3DRS_DESTBLEND ,D3DBLEND_INVSRCALPHA); d3d_Device->SetRenderState( D3DRS_ALPHABLENDENABLE , D3DZB_TRUE ); //a_Role.BltFast(0,0,100,100); //设定色彩与混色操作来源 d3d_Device->SetTextureStageState( 0 , D3DTSS_ALPHAARG1 , D3DTA_TEXTURE ); d3d_Device->SetTextureStageState( 0 , D3DTSS_ALPHAARG2 , D3DTA_DIFFUSE ); d3d_Device->SetTextureStageState( 0 , D3DTSS_COLORARG1 , D3DTA_TEXTURE ); d3d_Device->SetTextureStageState( 0 , D3DTSS_COLORARG2 , D3DTA_DIFFUSE ); //顶点混色值一律为0.5(128) //来源Alpha值两都相乖,着色用基台1 d3d_Device->SetTextureStageState( 0 , D3DTSS_COLOROP , D3DTOP_SELECTARG2); d3d_Device->SetTextureStageState( 0 , D3DTSS_ALPHAOP , D3DTOP_MODULATE ); //来源Alpha值基台1,使用基台2 d3d_Device->SetTextureStageState( 0 , D3DTSS_COLOROP , D3DTOP_SELECTARG2); d3d_Device->SetTextureStageState( 0 , D3DTSS_ALPHAOP , D3DTOP_SELECTARG1 ); a_Role.BltFast(000,0,200,200,D3DCOLOR_ARGB(128,255,0,0)); //来源Alpha值基台1,使用基台2 d3d_Device->SetTextureStageState( 0 , D3DTSS_COLOROP , D3DTOP_SELECTARG2); d3d_Device->SetTextureStageState( 0 , D3DTSS_ALPHAOP , D3DTOP_SELECTARG1 ); a_Role.BltFast(200,0,400,200,D3DCOLOR_ARGB(128,255,0,0)); //来源Alpha值基台1,使用基台2 d3d_Device->SetTextureStageState( 0 , D3DTSS_COLOROP , D3DTOP_MODULATE); d3d_Device->SetTextureStageState( 0 , D3DTSS_ALPHAOP , D3DTOP_SELECTARG1 ); a_Role.BltFast(0,200,200,400,D3DCOLOR_ARGB(128,255,0,0)); //来源Alpha值基台1,使用基台2 d3d_Device->SetTextureStageState( 0 , D3DTSS_COLOROP , D3DTOP_MODULATE); d3d_Device->SetTextureStageState( 0 , D3DTSS_ALPHAOP , D3DTOP_MODULATE ); a_Role.BltFast(200,200,400,400,D3DCOLOR_ARGB(128,0,255,255)); // d3d_Device->SetTextureStageState( 0 , D3DTSS_COLORARG2 , D3DTA_DIFFUSE ); d3d_Device->EndScene(); d3d_Device->Present (NULL,NULL,NULL,NULL);