Jump to content
  • Advertisement
Sign in to follow this  
Rozik

Direct3D Sprites

This topic is 4816 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!