id3dxsprite confusion

Started by
3 comments, last by dpro 18 years, 8 months ago
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?
Advertisement
Are you sure your IDE isn't confusing it with some older version of the id3dxsprite?
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).
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....
The cheese stands alone.
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 :)

This topic is closed to new replies.

Advertisement