I am trying to make DirectX display a sprite from a sprite sheet I found on the internet but it doesn't seem to be displaying the texture in the correct position as I am specifying it.
D3DXVECTOR2 scaling = D3DXVECTOR2(1.0,1.0); D3DXVECTOR2 center = D3DXVECTOR2(64,64); D3DXMatrixTransformation2D(&mat,NULL,0.0,&scaling,NULL,rot,&position); sprite->SetTransform(&mat); sprite->Draw(zombieTexture,&srcRect,NULL,NULL,0xFFFFFFFF);
srcRect is defined as follows:
srcRect.top = 384; srcRect.bottom = 512; srcRect.left = 512; srcRect.right = 640;
which instead of giving this texture:
It gets this one: (ignore the rotation)
What am I doing wrong?