1
\$\begingroup\$

Preface:

I purchased Programming an RTS in DirectX recently, and I know the code uses DirectX 9, but it has fantastic reviews and is apparently one of the best books you can get on beginning DirectX.

Question:

To my understanding, DirectX is just a means of displaying graphics to the scene. I will still have to code any games in C++ using game logic code, input, etc. Was I naive in thinking I could read the book with the MSDN tutorial site open for DirectX 10, and convert all of the samples to DirectX 10, or is that gonna be extremely difficult for me to do? Also, is DirectX 9 still relevant, or would it really behoove me to go about converting to DX 10?

Thanks!

\$\endgroup\$

3 Answers 3

3
\$\begingroup\$

It is important to note that the DirectX API is independent of the DirectX Hardware. That is to say that a DirectX 11 video card can still be accessed through the DirectX 9 API.

Much legacy code still uses the DirectX 9 API, and as I recall, Direct X is a backwards compatible API, so your code targeting DirectX 9 should run on a machine with DirectX 11 installed.

To asnwer your specific questions, DirectX is an API to facilitate running high performance graphics and sound on the computer. You will still write your game logic in C/C++, as I recall DirectX has some classes for dealing with user input as well. With respect to API changes between 9, 10, and 11 I do not really know, but I cannot imagine that a good programmer would have difficulty figuring it out, given a well written book and MSDN. I should also mention here, that I don't do much native DirectX programming, so take my words about API changes with a grain of salt.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks for the insight. Yep, there is DirectInput, but I haven't begun the book yet so I don't know its current state. I know the networking API provided by DirectX is now deprecated, not sure about the rest. \$\endgroup\$ Nov 16, 2010 at 17:02
2
\$\begingroup\$

While I haven't read the book in question, you're absolutely right (IMHO) that one graphics API can be fairly easily substituted for another without seriously impacting all the other stuff you need to do.

As to whether DX9 is relevant - there are a lot of XP users around still... really depends on your audience. If it's mostly just for personal consumption, I'd say go with DX10/11.

\$\endgroup\$
2
  • \$\begingroup\$ Yes this is what I thought. I probably won't have too many issues converting to DirectX 10. As for your post, are you implying DirectX 10 and 11 are Vista+ only? \$\endgroup\$ Nov 16, 2010 at 17:03
  • 1
    \$\begingroup\$ Yes. While there are attempts at getting DX10 to work on XP, official support requires Vista as the underlying driver model is quite different. \$\endgroup\$
    – JasonD
    Nov 16, 2010 at 17:19
2
\$\begingroup\$

To the best of my knowledge, there is no fixed function pipeline in DirectX 10/11. That means the way you interact with the API has changed very dramatically on some levels. If your book delves into the the ins and outs of vertex and pixel shaders and programmable hardware, then it might not be that big a difference. But if your book is mainly based on utilization of that fixed function pipeline, you're in for a general shift of paradigms when/if you make a transition.

If you really want to stick to this book, it won't do any harm to just pull all the stuff off using DX9 because learning is never a bad thing. But if you really want to make a transition towards DX10/11 further down the road, be ready to invest quite some time.

\$\endgroup\$
2
  • \$\begingroup\$ If the book concentrates on the fixed-function pipeline, I'd say that's an extra reason to avoid following it... \$\endgroup\$
    – JasonD
    Nov 16, 2010 at 17:18
  • \$\begingroup\$ Not sure if it does, but he took the time to convert the code from the 2006 book to compile with Visual Studio 2008 so I'd say its still a good book to learn from! Link -> cjgraphic.com/?page=rts-book \$\endgroup\$ Nov 16, 2010 at 18:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .