Jump to content
  • Advertisement
Sign in to follow this  

sprite drawing problems

This topic is 5143 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

Well, after looking at this problem from a few angles, I figure its time to see if fresh eyes can tell me what I am obviously missing.

  Rect.left = SrcX;
  Rect.top  = SrcY;
  Rect.right = Rect.left + Width;
  Rect.bottom = Rect.top + Height;

  D3DXVECTOR2 vCenter( 0.0f, 0.0f );
  D3DXVECTOR2 vScale( XScale, YScale );
  D3DXVECTOR2 vPosition( (float)DestX, (float)DestY );
  D3DXVECTOR2 vRotationCenter( (float)Width/2, (float)Height/2 );


  D3DXMatrixTransformation2D( &mat, &vCenter, NULL, &vScale, &vRotationCenter, 0.0f, &vPosition );
  pSprite->SetTransform( &mat );

  if(FAILED(pSprite->Draw( m_Texture, &Rect, NULL, NULL, Color )))
    return FALSE;
  return TRUE;

The problem is that as far as I can tell everything is initialized. Yet when I check the result of pSprite->Draw, it tells me it failed and the only clue is D3DERR_INVALIDCALL. Any insight would be appreciated.

Share this post

Link to post
Share on other sites
Well, it was better than nothing I suppose.

Anyway, the problem was really obvious and had I really thought about it earlier, I would have realized that I forgot to include my Begin() function call. Oh well.

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!