Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've recently starting with Direct X; I've been using Rasertek's tutorials, and Frank Luna's book. One thing thats just out of this world to me is how much effort it is to initialize DX11: the swap chain and everything.

So...maybe to give myself a little bit of peace, is it mostly always going to be the same? I mean in Rasertek's tutorials it's like 8 different files, while nicely laid out seems to be a bit much; but I guess is it just required? It just seems a little long and hard to understand (the swap chain and everything).....but I guess my questions are:

  1. Why is it so long, unlike OpenGL's initialization to start drawing which is 1/100th the size (it seems like)?

  2. Is it basically going to be the same (Swap Chain, Message Handlers, etc) for all DX APIs (I'm working with DX11)?

share|improve this question
up vote 1 down vote accepted

D3D10+ expose a much lower-level view of the driver/card than D3D9 did -- there are a number of nice advantages to this (control, consistency) but they come with costs, and one of those costs is that the API is much more verbose. Fortunately it's not hard to encapsulate all that verbosity away so you only need to deal with it once or twice.

For D3D10 and up, the general process will be quite similar. 9 is, as I noted, much different and a lot simpler. If you're using D3D11, you should be good to go for quite some time now.

share|improve this answer
Gotcha. It's just crazy having like 4 different Classes JUST to initialize something, Im going through the classes and MSDN docs to understand everything. but man... lol – user6465 May 5 '11 at 15:28
It's overwhelming at first, but you can just wrap it all up behind a nice interface relatively easily. – Josh Petrie May 5 '11 at 15:31
I feel kinda bad copy and pasting some of the stuff (like swap chain).....but it seems like alot of it is that way. Like there are LOTS of repeatable stuff. – user6465 May 5 '11 at 16:07

DX10/11 requires more than DX9, because they have DXGI. However, there is a shortcut function. More importantly, the initialization to start drawing is pretty trivial, compared to what you're going to have to go through to load assets, etc.

share|improve this answer
I wish there was an easier way, but I think Rasertek's tutorials he/she is setting up everything for future tutorials......which makes sense at why it's so long. – user6465 May 5 '11 at 13:37
Also what is this shortcut function you speak of? – user6465 May 5 '11 at 14:14
The function he linked is a shortcut, of sorts. You still need to fill out the description structures, but D3D11CreateDeviceAndSwapChain is much easier to use than manually creating the device and swap chain. – Josh Petrie May 5 '11 at 15:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.