
Originally Posted by
topblast
well then I dont kno.. where did u draw..? How did u draw.. What was the color u choose...Send me the Function u called.
DrawSquare(pDevice,100,10,40,20,Yellow);
struct sVertex
{
float x, y, z, ht;
DWORD color;
enum FVF
{
FVF_Flags = (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)
};
};
void DrawSquare(LPDIRECT3DDEVICE9 pDevice,int x,int y,int w,int h,DWORD color1)
{
sVertex Veri[6] =
{
{(float)x ,(float)y , 0.0f, 0.0f, (color1-0x00888888)},
{(float)(x+w) ,(float)y , 0.0f, 0.0f, (color1-0x00888888)},
{(float)x ,(float)(y+(h/2)) , 0.0f, 0.0f, (color1)},
{(float)(x+w) ,(float)(y+(h/2)) , 0.0f, 0.0f, (color1)},
{(float)x ,(float)(y+h) , 0.0f, 0.0f, (color1+0x00555555)},
{(float)(x+w) ,(float)(y+h) , 0.0f, 0.0f, (color1+0x00555555)},
};
pDevice->SetTexture( 0, NULL );
pDevice->SetRenderState( D3DRS_LIGHTING, FALSE);
pDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW);
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
pDevice->SetRenderState( D3DRS_FOGENABLE, false );
pDevice->SetFVF( sVertex::FVF_Flags );
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,4,Veri,size of (sVertex));
}