Archived

This topic is now archived and is closed to further replies.

Haytil

DirectX and Backwards Compatibility

Recommended Posts

Ok, I have two game programming books. The first one, which I''ve done through, did DirectX 8. The second one, which I''m starting, is Lamothe''s Tricks of the Windows game Programming gurus, which uses DirectX 7. Now I know from the post earlier on that DirectX is backwards compatible, so I don''t have to install DirectX 7 SDK now that I already have DirectX 8 SDK installed. My question is: For the libraries and include files, do I: A) Use the same library names as found in Tricks of the Windows Game Programmng Gurus? Or do I use other libraries, given the new DirectX I''m using? B) For the include paths, do I just set the same paths for DirectX 8 when using DirectX 7 functions? Thanks -Guavir_mucca

Share this post


Link to post
Share on other sites
In order to develop your software using DirectX 7.0 you will have to install the DirectX 7.0 SDK. But if you just want to run the program, then yes the runtime libraries are backwards compatible. I hope this answers your question.

Share this post


Link to post
Share on other sites
Sure you can use DirectX 7 for 2d graphics. In fact when version 8 came out, that is what Microsoft recommended to do for 2d graphics. However, you may want to look into using Direct3D for 2d graphics. It''s relatively easy to write a simple engine which uses textured quads. You just need to use an orthogonal projection matrix. Then, since the "sprites" would be rendered polygons, you can take advantage of hardware accelerated rotation, scaling, alpha blending, etc.

Share this post


Link to post
Share on other sites
Just keep in mind that once you send those sprites to the 3d hardware as textures, any transformations which occur will make it more difficult to do pixel-perfect collision detection. (Since the color buffer doesn't "live" in system memory and therefore getting it back risks sucking up all of your card's bandwidth shuttling around the color buffer.)

Of course, assuming that isn't an issue for you, then go right ahead. You also need to make a few sacrifices in order to have efficient 2d sprites -- for example powers-of-two textures that can fit inside of the video card's VRAM. Now, DX9 might handle all of this kind of stuff for you (I haven't used its sprite routines) so YMMV.

EDIT: Here's an old thread where I was asking about how to do what I mentioned above.

[edited by - FenrirWolf on October 7, 2003 9:00:04 PM]

Share this post


Link to post
Share on other sites
> In order to develop your software using DirectX 7.0 you will have to install the DirectX 7.0 SDK.

DirectDraw shouldn''t be a problem. The 9.0 Summer Update for instance still has ddraw.h and ddraw.lib.

Not sure what the story is with old D3D. They have d3d.h, which goes back all the way to the beginning, but no d3dim.lib. But they do include the old d3dx.lib. I don''t know what the story is there. It''s been a while since I''ve used that stuff.

Share this post


Link to post
Share on other sites