This is a starter boilerplate app for DirectX 2D games.
You'll need to have DirectX 9 and Visual Studio installed in order to run the demo. Also, as this is a Windows app, it'll only work on Windows.
- Clone the repo -
git clone https://github.com/chesterhow/directx-boilerplate.git - Open and run in Visual Studio
I highly recommend creating a new project of your own instead of renaming the files in this repo.
Lets get started.
- Create a new project in Visual Studio
- Navigate to Project > Properties
-
Switch Configuration to All Configurations
-
On the left, navigate to Configuration Properties > VC++ Directories
-
On the right, select Include Directories, open the dropdown and click Edit
-
Enter
$(DXSDK_DIR)\Includeand click OK -
Still on the right, select Library Directories, open the dropdown and click Edit
-
Enter
$(DXSDK_DIR)\Lib\x86and click OK -
On the left, navigate to Configuration Properties > Linker > Input
-
On the right, select Additional Dependencies, open the dropdown and click Edit
-
Enter the following, each on a new line and click OK
d3d9.lib
d3dx9.lib
winmm.lib
xinput.lib
- Click Apply
- Switch Configuration to Release
- On the left, navigate to Configuration Properties > C/C++ > Code Generation
- On the right, select Runtime Library, open the dropdown and select Multi-threaded (/MT)
- Click OK
- Copy the
spritesandsrcdirectories from this repo into your project directory - Navigate to Project > Add Existing Item
- Add all files from the
srcdirectory
Make the following changes in the respective files
- Replace
CLASS_NAMEandGAME_TITLEwith your desired names
- Rename the file to the name of your game
- Replace all occurances of samplegame with the name of your game
- Replace all occurances of samplegame with the name of your game
And with that, you now have a working DirectX 2D app. The rest is on you :)
Feel free to submit an issue if you encounter any bugs, or create a pull request if you would like to contribute.
See LICENSE