views:

1021

answers:

6
+8  Q: 

Learning DirectX

I want to learn to do some DirectX 9 and 10 programming in C++. Could anyone suggest me some good books to start with for a beginner in DirectX and at the same time, some reference books for DirectX 9 and 10?

I have a background in standard C++ programming and I want to know what are the prerequisites to be able to program with DirectX.

  1. Are there certain books or websites that by your experience could help me get going?
  2. What do you believe is the best book on DirectX C++ programming (recent or old)?
+2  A: 

I found that Riemers tutorials were a good place to get started with DirectX and XNA in C++ and C#. He also published a book on the same topics covered in the tutorials I believe.

That looks like a really nice site for DirectX. Nice to know that Microsoft’s Game Studio 2.0 is free too!
Partial
@Partial Game Studio is actually just an addon for visual studio that provides the ability to port games to the XBox360 and Zune. The current version is 3.1 now. If you're looking for more XNA-specific tutorials, you can look at the Education section of the XNA Creators Club site: http://creators.xna.com/ .
@vonture I don't mean to nitpick but you're not entirely correct. In XNA uou do not port the game to either Xbox360 or Zune, you create a specific version for each platform. Also, you can create games for Windows as well. I would definately recommend taking a look at the Creators Club site as well, but also worth mentioning is http://www.ziggyware.com/ which is frequently updated with various XNA related tutorials and articles.
Tchami
A: 

There are plenty at Amazon.

mcandre
Can you suggest a book in particular from Amazon?
Partial
mcandre
And from personal experience?
Partial
mcandre
+4  A: 

If you're familiar with C++ I would recommend you take at look at the latest DirectX SDK straight away. It contains a lot of samples, ranging from beginner to advanced. Your best starting point would be the tutorial samples (15 of them) which take you from the basics of windows programming, through rendering a triangle over 3d transformations, shader programming, lighting and textures.

You can find the latest DirectX SDK here

There's lots of books about DirectX, but if you're familiar with C++ (or progamming in general) you shouldn't have many problems with diving straight into the SDK. One thing to keep in mind is that there are quite a few changes going from DirectX 9 to 10 (going from a fixed function pipeline to a programmable pipeline and DXUT to name a few), and DirectX 10 is only supported on Vista onwards, so you won't be able to run it on XP. If you're not familiar with windows programming I think DirectX 10 might be a bit easier to learn, since it has removed some of the nitty gritty tedious stuff you had to deal with in DirectX 9.

Tchami
I already have the SDK and have some knowledge of C++ and I think that starting from the tutorials in SDK could be a good thing. The only problem I see is to understand certain terms in detail such as those pipelines you mentioned.
Partial
I wouldn't worry about that for now. Don't get me wrong. Understanding the pipeline is very important, but it's not something you need to worry yourself too much with in the beginning. DirectX is a BIG API, and learning all the aspects of it takes time. A lot of time :)
Tchami
+12  A: 

My suggestion would be to go through the tutorials included with the DirectX SDK for DirectX10 or DirectX9. There are also good tutorials online, that step through the basics a bit more slowly.

The main stumbling block is often learning and understanding the math involved in 3D graphics. 3D Math Primer for Games and Graphics Development is a good book for this, if you don't have a strong mathematics background. There are also many sources online, although it's easy to get confused by reading a website geared towards OpenGL if you're learning DirectX, since many of specifics in the math are different (due to left handed vs. right handed coordinate systems).

Reed Copsey
2D and 3D math... got to love those vectors :P
Partial
Thanks for the book suggestion!
Partial
A: 

Well if you want to start out as a beginner, you get Beginning DirectX 10 Game Programming.

If you want to go more advanced, you get Advanced DirectX 10 Game Programming.

You wanna know more than that? You look in microsoft's available documentation on the API.

Key sites are msdn.microsoft.com (Microsoft Developer Network) , technet.microsoft.com (Microsoft Technical Network). Microsoft has forums on msdn and they can help you there.

Good luck, I'm still learning about DirectX 10 as well, and don't forget OpenGL because it's very important too. OpenGL 3.0 is coming out soon.

You can code in whatever language that will compile under the .NET framework.

Choose from options like VB.NET, C++, C#, Delphi, there are others that I don't know.

DirectX, by default, doesn't support .NET development. There is no need to work in a .NET language. It's COM based, so you can use any programming language that works with COM, but is usually done in C#. .NET development with DirectX requires either Managed DirectX (which is not very nice) or a 3rd party wrapper like SlimDX (which is very, very nice).
Reed Copsey
+1 for comment!
Partial
To be honest, I have "Beginning DirectX 10 Game Programming" but found it lack detailed explanations and was not for a beginner like me in DirectX :( Found many global variables too in the examples and in a object oriented language like C++ I don't understand how the author could be showing a beginner to use global variables (not very nice).
Partial
@Partial, use of global variables in samples can be because it allows you follow the 'flow' of the application more; having 20 classes to handle all kind of things will probably confuse beginners. If you're proficient in OO programming then it shouldn't be too hard to make an 'OO' shell.
Chaoz
+5  A: 

In my opinion, the best book to learn DirectX in C++ is Frank Luna's Introduction to 3D Game Programming : I have the DX9.0c edition, but he recently published the DX10 edition. This book was recommended to me by an engine programmer at EA, and it's really stellar.

Here's a summary of the DX9.0c edition:

  • Part I - Mathematical Prerequisites
    • Vector Algebra
    • Matrix Algebra
    • Transformation and planes
  • Part II - Direct3D foundations
    • Direct3D Initalization
    • Timing, Direct Input, and Animation and Sprites
    • The Rendering Pipeline
    • Drawing in Direct3D - Part I
    • Drawing in Direct3D - Part II
    • Color
    • Lighting
    • Texturing
    • Blending
    • Stenciling
  • Part III - Applied Direct3D and the D3DX Library
    • Meshes
    • Meshes Hierarchy Animation - Part I
    • Meshes Hierarchy Animation - Part II
    • Terrain Rendering - Part I
    • Terrain Rendering - Part II
    • Particle Systems
    • Picking
    • Advanced Texturing - Part I
    • Advanced Texturing - Part II
  • Appendix A - Introduction to Windows Programming
  • Appendix B - High-Level Shading Language Reference

Of course, the SDK samples and tutorials are excellent, but not nearly as thorough as a good book.

Dr_Asik
+1 for Luna. I've had the DirectX book since the first edition and they're all fantastic.
Hooray Im Helping