Saturday, February 5, 2011

DirectX 10 ProgrammingTutorial 1.1

DirectX is a collection of APIs(Application Programming Interfaces) that give you advanced control of video, sound,  and input on the Windows system. ***NOTE*** DirectX 10 is only available for Windows versions Vista and later. The hardest part of starting with DirectX so far for me has been, well, starting with DirectX. I'll get the code in word for word from some book or tutorial and get a whole slew of errors. I kept thinking it was poor authoring or something but I realized I just did not know how to set DirectX up properly for my IDE.  To start out you should go here to download the DirectX10 SDK.  Also, so that you can create shaders which will be needed as we progress through DX, I recommend downloading NVIDIA's FX Composer 2.5.

There are a few ways we could start but I like the way Allen Sharrod started in Ultimate Game Programming with DirectX, Second Edition so that is how I will start. But first, let's get VC++ set up for DirectX. If you have your skeleton file created from the last tutorial you should now:

1. Go to Project->Properties->Configuration Properties->VC++ Directories->Include Directories.
2. Select the down arrow and then edit.
3. Click the folder Icon. Click the ... button.
4. Navigate to the folder you installed the DirectX 10 SDK to.
5. Navigate into the folder to the Include folder.
6. Click Select Folder click OK.
7. Repeat steps 1-6 for the Library Directories navigating to the lib/x86 folder.
8. Go to Project->Properties->Configuration Properties->Linker->Input
9. Select Additional Dependencies
10. Select the down arrow, then edit
11. Add "d3d10.lib; d3dx10.lib" not including the quotes.
12. Accept the changes and you are done. You should now be able to start working on our first DirectX Program!

No comments:

Post a Comment