ID3DXSprite help

Started by
3 comments, last by Roble 19 years, 7 months ago
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?
I M Teh n00B11!!!1
Advertisement
Are you including d3dx.h in your source file? Or is it d3dx9.h...It's been a while...
The sprite interface requires both;
#include <d3d9.h>
#include <d3dx9.h>
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...
[size=2]aliak.net
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
I M Teh n00B11!!!1

This topic is closed to new replies.

Advertisement