Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've done a reasonable number of small hobby projects using DirectX 9 but it's time to move to DirectX 11 now.

I have Frank Luna'a book on 3D programming using DirectX 10 but nothing on DirectX 11. I believe they are pretty similar, but was wondering if anyone could enumerate the main differences at a code level that I'll need to be aware of (or point to an existing source).

share|improve this question
    
    
I heard that DX10 was really different and not backward compatible with DX9, while DX11 was backward compatible with DX9. –  jokoon Mar 29 '11 at 11:12
    
DX10 is quite different from DX9 but DX11 is fairly similar to DX10, I just wanted to know what the differences were. Strangely though, DX11 will work with DX9 hardware but DX10 won't ;) –  JohnB Mar 29 '11 at 12:36
add comment

3 Answers

up vote 14 down vote accepted

The SDK documentation has a section on migrating to 11 that covers coming from both 9 and 10. There's also the D3D11 features page.

One of the single biggest changes in terms of API shape between 10 and 11 is that 11 moves a bunch of methods from the device itself to a new interface called a device context (ID3D11DeviceContext specifically), in order to support the new multi-threading features.

Once you are aware of the change, though, it's quite easy to adapt to: where you would have in 10 called "someDevice->Draw()" you will instead get the immediate context for the device and call "immediateContext->Draw()."

The other big change is that the Effects API is pulled out of core and made an independent source distribution you must compile and link yourself. You may also notice some D3DX interfaces and functions that have been deprecated or removed.

Beyond that, there are a handful of new parameters to some functions and a handful of extra fields in structures, et cetera. For example, the buffer description object in 11 has an extra StructureByteStride field that isn't in 10, and device creation involves passing feature level information. Plus there are the obvious and aforementioned changes in interface names (10s replaced with 11s).

share|improve this answer
    
Thanks, just what I needed. I looked for some official guide to what had changed but somehow didn't manage to find it. Thank you for this answer and the other people who took the time to help with good answers too :) –  JohnB Mar 28 '11 at 19:44
    
That's funny how one forget those stuff quickly. I especially hated the effect compilation and it took me few days to make it work. But i did not include it into my answer... –  Notabene Mar 28 '11 at 21:07
    
I was going to post this as a question but realized that your answer already covers most of my concerns, although I'd like some confirmation. For someone who's only worked with DX9 but is looking to upgrade his knowledge, picking up a DX11 book will not only teach me about DX11 (obviously) but also give me enough knowledge to work with DX10 if needed? –  David Gouveia Apr 5 '12 at 23:20
    
Yeah, pretty much. –  Josh Petrie Apr 6 '12 at 1:21
add comment

There will be no need to change. Directx11 only adds new features. You will just changing numbers from ID3D10 to ID3D11 etc.


DirectX11 adds (if not talking about hyped HW tessalation) Direct Compute: API for the GPGPU, with excelent connection to the graphics pipe line (i cant say this about CUDA, or openCL). And possibility of multiple RW textures and buffers on a pixel shader, which opens lots of new possibilities.

share|improve this answer
add comment

I think the main difference is that, in DX11 the DXFont is gone, other than that it's pretty much as notabene said. You should be fine with that DX10 book. I used that one when moving to DX11 and I had no problems. You will need to go and look at the msdn from time to time though, there are some minor differences in the API a some places IIRC.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.