# id3dxsprite confusion

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

## Recommended Posts

I have a question about id3dxsprite. I'm using Directx 9.0c. (Using VS.net 2003) When I create the sprite everything works fine, then I want to use it and call begin. When I call begin it tells me that D3DXSPRITE_ALPHABLEND is an undeclared identifier, and Begin's tool tip say it takes no parameter (i.e. (void) ). So fine, I change it, and move onto draw. I see the tooltip says it takes 7 params for draw, is a virtual HRESULT, however when I use the sprite interface...
g_spr->Draw( g_tex2, NULL, &vec1, &vec2, 0xffffffff );

and I type it out, it gives me the 5 parameter version as stated in the above code block. However it gives me a compile time error and tells me that draw has 7 parameters. Any ideas?

##### Share on other sites
Are you sure your IDE isn't confusing it with some older version of the id3dxsprite?

##### Share on other sites
Its entirely possible however when I look at the msdn site, it shows that it should have settransform as a member function, but I don't see it either.

I have the latest d3d9*(d3dx9 as well) libraries included in the project.

I see a few articles which discuss the fact that MS put in a different sprite interface in, but I was hoping someone might know the alternative to using sprites, or how to use the correctly in the context of drawing them in 2d(moving sprites).

##### Share on other sites
I am using the Feb version of the SDK and VS 2003 compiles with no errors when

sprite->Begin(D3DXSPRITE_ALPHABLEND);
sprite->->Draw( g_tex2, NULL, &vec1, &vec2, 0xffffffff );

are set just like you described... so my only suggestion is try re-installing an older version of the SDK (personally I think the SDKs are getting progressively worse so having the latest is not necessarily the best).
You could also maybe check and make sure that the refrences on MSDN you are checking are not "Archived Content".... I remember I wrote a DXFile program and then when I got a newer SDK version they had COMPLETELY changed the system to load/save X files so I had to change everything.... so it is possible they have completely changed the sprite interface and the archived content is still the first thing to pop up in a search.... look around the site some more and see....

##### Share on other sites
Well I should really read things more carefully.

The recent one works fine as long as you pay attention to the parameters being passed.

In the version I have, it allows you to specify movement by 3 separate 2d vectors, should you scaling/rotation vectors you can add them. Its quite simple once you read it more carefully.

Sorry to ask such a simple question :)

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 28
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634111
• Total Posts
3015574
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!