Jump to content
  • Advertisement


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


ID3DXSprite MSDN Reference is Wrong?

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

I''m trying to use the ID3DXSprite interface to render a particle system. I''m using DX9 without the summer update (which only affects managed DX right?). According to MSDN ID3DXSprite.Begin() accepts a number of flags as parameters. When I tried to compile I got an error that Begin does not take 1 parameter. I searched for the function definition and according to the headers Begin takes 0 parameters. Also there are only 5 parameters listed for ID3DXSprite.Draw on the MSDN page:
HRESULT Draw(          LPDIRECT3DTEXTURE9 pTexture,
    CONST RECT *pSrcRect,
    CONST D3DXVECTOR3 *pCenter,
    CONST D3DXVECTOR3 *pPosition,
    D3DCOLOR Color
But in my headers Draw takes more(7) and different parameters. Of most concern is that the position in my headers is a 2d vector while on MSDN it is listed as a 3d vector. Anyone know why this is happening? Oh yeah, here is what my headers say is expected for Draw:
        CONST RECT* pSrcRect, CONST D3DXVECTOR2* pScaling, 
        CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, 
        CONST D3DXVECTOR2* pTranslation, D3DCOLOR Color) PURE;
Thanks for any help. This hasn''t changed by the Summer Update has it? ATS

Share this post

Link to post
Share on other sites
dont know what u did but i made a class for it...

class D3DSprite {
lp_Sprite = NULL;

if( lp_Sprite != NULL )

void init()
D3DXCreateSprite(lp_Device, &lp_Sprite );

void draw(LPDIRECT3DTEXTURE9 texture, float x, float y, int width, int height, int frame, float scaleX, float scaleY)
RECT abcRect;
abcRect.top = 0;
abcRect.left = frame * width;
abcRect.bottom = abcRect.top + height;
abcRect.right = abcRect.left + width;
D3DXVECTOR2 dScaling(scaleX, scaleY);
D3DXVECTOR2 dCoords(x, y);
lp_Sprite->Draw( texture, &abcRect, &dScaling, NULL, 0.0f, &dCoords, D3DCOLOR_XRGB(255,255,255) );

Share this post

Link to post
Share on other sites
The summer update changes the ID3DXFont and ID3DXSprite interfaces so they are faster. There are a few minor changes to other parts of the SDK as well.

Share this post

Link to post
Share on other sites

  • 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!