• Advertisement


This topic is now archived and is closed to further replies.

ID3DXSprite Problem!!

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

Hey all, Ive recently started writing a simple libary for the use in my games. I decided to use ID3DXSprite because it simplifies things a little. But im now having problems with the second parameter, inwhich you specify a source rectangle to blit from. If i specify the size of my texture, the part which is drawn is always smaller than what i specify. I cant work out why... Its not the parameters ive got wrong because ive checked the values by using the debugger. Ive also noted that im using a 32bit texture, and a 32bit screen display. So the loss of texture information isnt lost there.. Im stuck for any other ideas as to why this may be happening. Any help would be greatly appreciated. Thanks, Heres a snippet of the code I use.
  void CSprite::Draw()
	RECT srcRect;
	srcRect.bottom = m_CellHeight * this->m_CurFrameY + m_CellHeight;
	srcRect.top    = m_CellHeight * this->m_CurFrameY;
	srcRect.right  = m_CellWidth  * this->m_CurFrameX + m_CellWidth;
	srcRect.left   = m_CellWidth  * this->m_CurFrameX;

    D3DXVECTOR2 translationVector;
	translationVector.x = m_X;
	translationVector.y = m_Y;
	D3DXVECTOR2 centerVector;
	centerVector.x = m_X+m_CellWidth/2;
	centerVector.y = m_Y+m_CellHeight/2;

					(0.0174 * m_Angle),

Share this post

Link to post
Share on other sites
Perhaps a look at the article "Dissecting Sprites in Direct3D" will help (to be found in the DirectGraphics section right here ;-)).

Share this post

Link to post
Share on other sites

  • Advertisement