Hello, i need some help with my sprite is only being shown during like 50sec, (yes i call it in an infinite loop)
here is my code :
here is my code :
Code:
//ini
D3DXCreateTextureFromFile(dx_Device, "lol.png", &texture);
Function :
void DrawSprite(LPD3DXSPRITE sprite,int x, int y, float scalex,float scaley,LPDIRECT3DTEXTURE9 texture)
{
if(sprite==NULL)D3DXCreateSprite(dx_Device,&sprite);
sprite->Begin(D3DXSPRITE_ALPHABLEND);
D3DXVECTOR3 pos;
pos.x = x;
pos.y = y;
pos.z = 0;
if( scalex > 0 || scaley > 0)
{
D3DXMATRIX mat;
D3DXVECTOR2 scaling(scalex,scaley);
D3DXVECTOR2 trans=D3DXVECTOR2(50.0f,80.0f);
D3DXMatrixTransformation2D(&mat,NULL,0.0,&scaling,NULL,NULL,&trans);
sprite->SetTransform(&mat);
}
sprite->Draw(texture,NULL,NULL,&pos,0xFFFFFFFF);
sprite->End();
}
Aucun commentaire:
Enregistrer un commentaire