Direct3D Sprites
Hi all i have a little problem with a book i bought.
It has the following code in it but my compiler just wont compile it.
HRESULT CXPen::DrawTexture(CXTexture* Texture)
{
if((Texture != NULL) && (m_Sprite != NULL)){
D3DXMATRIX Mat;
D3DXMatrixTransformation2D(&Mat,NULL,0,Texture->GetScaling(),Texture->GetRotationCenter(),Texture->GetRotation(),Texture->GetTranslation());
m_Sprite->Begin(0);
m_Sprite->SetTransformation(&Mat);
HRESULT Result = m_Sprite->Draw(Texture->GetTexture(),Texture->GetRect(),NULL,NULL,0xFFFFFFFF);
m_Sprite->End();
return Result;
}
else
return E_FAIL;
}
I get errors in these lines:
m_Sprite->Begin(0);
m_Sprite->SetTransformation(&Mat);
HRESULT Result = m_Sprite->Draw(Texture->GetTexture(),Texture->GetRect(),NULL,NULL,0xFFFFFFFF);
in line 1 it tells me that the Begin funktion does not accept one parameter
in line 2 it tells me that the SetTransformation funktion is not part of Sprite
in line 3 it tells me that the Draw funktion does not accept five parameters
i have these dx includes:
d3d9.h
d3dx9.h
if anyone could please help me
that would be awsome
The D3DX docs I can see don't have SetTransformation, just SetTransform. So maybe you're using a version that is not the same as in the book.
Chances are your sdk is of a different version then the one used to create that code. Check your documentation to see what parameters the function has.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement