Sign in to follow this  

ID3DXSprite help

This topic is 4858 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 am getting these errors: C:\Program Files\Microsoft Visual Studio\MyProjects\Game\main.cpp(115) : error C2065: 'ID3DXSprite' : undeclared identifier C:\Program Files\Microsoft Visual Studio\MyProjects\Game\main.cpp(115) : error C2065: 'pSprite' : undeclared identifier C:\Program Files\Microsoft Visual Studio\MyProjects\Game\main.cpp(115) : error C2106: '=' : left operand must be l-value C:\Program Files\Microsoft Visual Studio\MyProjects\Game\main.cpp(117) : error C2065: 'D3DXCreateSprite' : undeclared identifier But the code I used was: ID3DXSprite *pSprite = NULL; if(FAILED(D3DXCreateSprite(g_pD3DDevice, &pSprite))) { // Error } So what's up?

Share this post


Link to post
Share on other sites
Quote:
Original post by Tertsi
and also replace this: ID3DXSprite *pSprite

with:
LPD3DXSPRITE Sprite;


Same thing


LPD3DXSPRITE is a typedef for a ID3DXSprite pointer.

And Roble: you must be already including d3d9.h, but to use any of d3dx (notice the x) functions or interfaces (everything that starts with either ID3DX or D3DX) you need to include the direct3d extention library - d3dx9.h

Also, including d3dx9.h automatically includes d3d9.h anyways...

Share this post


Link to post
Share on other sites
Thanks guys! It turns out that I forgot to include some pretty crucial lib files. And yeah, I know that LPD3DXSPRITE and ID3DXSPRITE are interchangeable, that's just the one I chose. :p

Share this post


Link to post
Share on other sites

This topic is 4858 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this