Sign in to follow this  

sprite drawing problems

This topic is 4839 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 );

  D3DXMATRIX mat;

  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

This topic is 4839 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this