Dronz
Dronz

Reputation: 2097

What's DirectX9's equivalent of LPDIRECT3DDEVICE8 etc?

I have a game written for DirectX8, which I'm trying to update to build under DirectX9. I hear DirectX8 isn't supported by MS and DirectX9 is supposed to allow me to do what was done in DirectX8. So I'm starting by changing all things 8 to 9, but LPDIRECT3DDEVICE9 doesn't seem to exist. So is there (and what is) an equivalent to LPDIRECT3DDEVICE8 in DirectX9?

I also see D3DCAPS8 has no D3DCAPS9 equivalent. (edit: Oh wait, it's just in a new header file D3D9Caps.h.)

And I am also not getting LPD3DXSPRITE defined, though I see it in discussions of DirectX9. Hmm.

Perhaps what I really need is the equivalents for the header files d3dx9.h and D3DX8Math.h.

To be clear, I don't want to try to use any DirectX9 features, except the hopefully-existing DirectX8 reverse compatibility.

Upvotes: 0

Views: 716

Answers (2)

Preet Kukreti
Preet Kukreti

Reputation: 8607

An LPDIRECT3DDEVICE8 is just a struct IDirect3DDevice8*. those LP* macro definitions seem to be deprecated in 9, so use the I* equivalents.

D3dx9core.h includes the sprite class you are looking for.

These might also be useful:

Upvotes: 1

Dronz
Dronz

Reputation: 2097

Ok, it seems that the main answer to my question, was something like:

Having the DirectX9 SDK installed results in a default or ported project file in Visual Studio 2010 being able to find some DirectX header files, but not others. Moreover, while there are equivalent structures for most or all DirectX8 structures in DirectX9, which header files they are in and what those headers are called, may have changed. Mainly, as Preet Kukreti wrote, some have moved to D3dx9core.h, which is one of the headers that may not be findable without editing the project configuration. In VS 2010, go to your project's Property Pages under Properties from the Project tab, then select VC++ Directories, and under Include Directories, add to the existing string ;path, where path is the path to your include folder in the SDK.

(BTW, don't use Windows 7 Search to find the path, because it is nearly useless. If you want to actually search your computer for files, download and use Agent Ransack instead, which will find it in about 1 second versus potential hours of frustration fighting Windows Search.)

Mine was in: C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3dx9math.h

Upvotes: 0

Related Questions