Jump to content
  • Advertisement
Sign in to follow this  
dpro

id3dxsprite confusion

This topic is 4847 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 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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

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