|
|
- //在render函数里先画这个图片
- ID3DXSprite* g_pTextSprite = NULL;
- g_pTextSprite->SetTransform(&spmat);
- g_pTextSprite->Begin( D3DXSPRITE_BILLBOARD|D3DXSPRITE_ALPHABLEND|D3DXSPRITE_SORT_TEXTURE);
- V(g_pTextSprite->Draw(g_pTexture,NULL,NULL,NULL,0xFFFFFFFF));
- g_pTextSprite->End();
- g_pTextSprite->SetTransform(&spmat);
- //////再画一个矩形
- IDirect3DVertexDeclaration9 *pDecl = NULL;
- pd3dDevice->GetVertexDeclaration( &pDecl ); // Preserve the sprite's current vertex decl
- pd3dDevice->SetFVF( DXUT_SCREEN_VERTEX::FVF );
- pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG2 );
- pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2 );
- pd3dDevice->DrawPrimitiveUP( D3DPT_TRIANGLEFAN, 2, vertices, sizeof(DXUT_SCREEN_VERTEX) );
- pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
- pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
- // Restore the vertex decl
- pd3dDevice->SetVertexDeclaration( pDecl );
复制代码
发现ID3DXSprite画的东西遮挡了后画的东西,请问怎么解决啊?是不是ID3DXSprite就是这样的特性?
|
|