Newbie Seeking Guidance on DirectX

Started by
8 comments, last by katsu 13 years ago
Hello, I am "new" (apparently I'd made an account a long time ago but never used it) and have been casually browsing about recently!

I've been putzing about with C++ for quite some time, but have recently become interested in the 3d side of things, and have chosen DirectX as my language for the job. However, I am seeing that Dx11 is fairly new, and have had a lot of trouble finding any tutorials on this. I figure that if I am learning anew, I'd might as well start with the newest one, rather than learn a previous version, and then unlearn it to keep up with the times. Any books on the topic are up for preorder, and as has been mentioned here, the tutorials on directxtutorials.com are less than functional.

So! My question is, are there any good resources on programming in directx11?

Thanks.
Advertisement
Turorial07 from the DirectX SDK is my favourite example because it is clean but have everything you need to get started with your own engine. It does not use a bloated framework so that you can easily put everything in a class and use it as a self registering ActiveX component that you can call from your favourite language.

You need to include some libraries before you can compile it:
http://msdn.microsoft.com/en-us/library/ee416327%28VS.85%29.aspx
lol i doubt you will find any good tutorial on directX11. Ofcourse you can try the examples from the sdk, but apparently microsoft isnt writting very good code in the examples or i just cant handle 1400 lines of code in single file :D. Nevermind i advise you to learn directx9, because it has so much books about it. So far i think that the Frank d. Luna book A shader approach or something is the best book out there and with it i made very good game so far. When you learn directx9 and some good directx11 books show up you can easily switch.
DirectX10 wouldn't be a better alternative? I am not too sure about how they all differ from each other, but it seemed like 9 and 10 differ greatly, but 10 and 11 don't differ as much from each other. I am not trying to dispute, just want to be sure I have a good grasp of what and why I pick! DirectX9 is pretty old and I wanna be sure I learn it with good reason since there's been a big push to get rid of it lately.

DirectX 11 is backward compatible with DirectX 10.0 hardware so that DirectX 10 is only for Vista users that I haven't seen for years.
Right now the best location for finding information on DX11 is the DX SDK, if you aren't comfortable trying to figure it out from that then I would just put your plans on hold until May when "Practical Rendering and Computation with Direct3D 11" comes out which is written by some guys from this site.

Forget DX10; with the advent of DX11 it is effectively a 'dead' API; DX11 will work on DX9, DX10 and DX11 level hardware via feature levels. DX11 works fine on Win7 and Vista as well.

Forget DX9; with XPs market share diving into the ground there is just no good reason to learn the API these days and as it's nothing like DX11 so it's practically useless as well.

In short; SDK or wait for the book as the best options :)
I cracked open the built in samples and tutorials, but instantly hit a brick wall trying to replicate the work in a new project. I'm not used to coding in a graphical editor much less VS, much less VS2010 (my last VS was 6!), so I am probably setting it up stupidly. Can't even google the errors:

[font="Consolas"][size="1"][font="Consolas"][size="1"]1>main.obj : error LNK2019: unresolved external symbol _D3DX11CompileFromFileW@44 referenced in function "long __cdecl CompileShaderFromFile(wchar_t *,char const *,char const *,struct ID3D10Blob * *)" (?CompileShaderFromFile@@YAJPA_WPBD1PAPAUID3D10Blob@@@Z)
[font="Consolas"][size="1"][font="Consolas"][size="1"]

1>main.obj : error LNK2019: unresolved external symbol _D3D11CreateDeviceAndSwapChain@48 referenced in function "long __cdecl InitDevice(void)" (?InitDevice@@YAJXZ)

So maybe I should just wait since I'm getting so tripped up right away. That was one of the two books I was going to order anyways. And I'd rather not be the guy who asks for help every other line of code!


[/font][/font][/font][/font]
I'd say you might want to brush up on some C++ first, to kind of be able to rework a lot of shit. I'm on a directx9 kicks and while it's great, I'd probably think you are right to go with dx11.

I would think you should hold out for Frank Luna's next book on DX11:
http://www.amazon.com/Introduction-3d-Game-Programming-Directx/dp/1449603408/ref=sr_1_1?ie=UTF8&qid=1300671158&sr=8-1

His books are really nice, I'd also recommend going through tutorials on www.rastertek.com as well as www.directxtutorial.com

For my next project I'm going to be going with XNA to save time, I feel like I understand a lot of what's going on under the hood of DX but it's a painful process to massage everything out of DirectX.

If I were you, I'd bone up on C++ and learn as much XNA 4.0 3D graphics stuff as possible until Frank Luna's book comes out this summer. Just my opinion though, do what works best!
These are the most common errors to get stuck with.

Link errors to the DirectX methods are caused by not having the libraries included in each compilation mode in the project settings.
At:
Property pages - Configuration Properties - Linker - Input - Additional Dependencies
Write:
d3dcompiler.lib dxerr.lib dxguid.lib d3dx9.lib d3d9.lib dxgi.lib d3d10_1.lib d3d10.lib d3dx10.lib winmm.lib comctl32.lib dxgi.lib d3dx11.lib d3d11.lib
For "All configurations".

Link errors in your own code are usually caused by not writing YourClassName:: before the declaration of a routine.

Not finding a method in the same class is usually caused by not declaring the calling routine in the class header.

These are the most common errors to get stuck with.

Link errors to the DirectX methods are caused by not having the libraries included in each compilation mode in the project settings.
At:
Property pages - Configuration Properties - Linker - Input - Additional Dependencies
Write:
d3dcompiler.lib dxerr.lib dxguid.lib d3dx9.lib d3d9.lib dxgi.lib d3d10_1.lib d3d10.lib d3dx10.lib winmm.lib comctl32.lib dxgi.lib d3dx11.lib d3d11.lib
For "All configurations".

Link errors in your own code are usually caused by not writing YourClassName:: before the declaration of a routine.

Not finding a method in the same class is usually caused by not declaring the calling routine in the class header.


Ahhh that was it, I missed that step in the setup tutorial. Thanks.

At this point I just wanted to get it running enough that I could putz around with it and become a bit familiar with it while I wait 1-2 months for those awesome books to come out. This will also give me time to re-familiarize myself with Visual Studio.

This topic is closed to new replies.

Advertisement