Hey guys

Hope someone of you can help me with this problem!
I made an awesome menu with photoshop, and I wanted to put it as my hackmenu.
I searched for drawing sprites with scale function, and I found a cool working method:
Code:
void CDirectx::DrawSprite(LPDIRECT3DDEVICE9 pDevice, LPDIRECT3DTEXTURE9 pTexture, int x, int y, int w, int h)
{
if(!cHacks.ValidPointer(pDevice) || !cHacks.ValidPointer(pTexture))
return;
struct tVertex
{
float X, Y, Z, RHW;
float IU, IV;
enum FVF
{
FVF_Flags = (D3DFVF_XYZRHW | D3DFVF_TEX1)
};
};
tVertex Veri[4] =
{
{(float)x ,(float)y , 0.0f, 1.0f, 0.0f, 0.0f },
{(float)(x+w) ,(float)y , 0.0f, 1.0f, 1.0f, 0.0f },
{(float)x ,(float)(y+h) , 0.0f, 1.0f, 0.0f, 1.0f },
{(float)(x+w) ,(float)(y+h) , 0.0f, 1.0f, 1.0f, 1.0f },
};
pDevice->SetTexture( 0, pTexture );
pDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
pDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_TEXTURE );
pDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
pDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE );
pDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE );
pDevice->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE );
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( tVertex::FVF_Flags );
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(tVertex));
}
But sometimes, my menu keeps crashing!
Its not detected, if I comment all my spritedrawing out it works, my old d3d-menu works too!
Could it be, that this function is crashing me, because Im drawing too much sprites?
Is there a fix for it?
Please help me
