- In Visual C++ create a new Win32 Application.
- File > New
- From the Projects tab select Win32 Application
- Enter a name for your project such as “DX Project 1”
- Select a folder for the location of your source code files
- Click Next
- Select the empty project option.
- Click Finish
- Make sure that your project settings are correct.
- Project > Settings...
- On the Link tab, make sure that "d3d8.lib" is in the list of Object/Library Modules. If it isn’t simply type it in.
- Make sure that your search paths are correct.
- Tools > Options > Directories Tab
- In the "Show directories for" drop-down, select "include files".
- If it does not exist already, add the following path: <SDK INSTALL PATH>/include.
- Make sure that this path is at the top of the list by clicking on the up arrow button (if needed).
- In the "Show directories for" drop-down, select "library files".
- If it does not exist already, add the following path: <SDK INSTALL PATH>/lib.
- Make sure that this path is at the top of the list by clicking on the up arrow button (if needed).
- Add the source code.
- File > New
- From the Files tab, select C++ Source File
- Enter a filename such as “Main.cpp”
- Copy the code segment below, and then paste it into your new file.
- Build and Run the program.
- Press F7 to build your project
- Press F5 to run