├── .gitignore
├── DirectX.sln
├── DirectXTemplate
├── DirectXTemplate.rc
├── DirectXTemplate.vcxproj
├── DirectXTemplate.vcxproj.filters
├── DirectXTemplate.vcxproj.user
├── Resources
│ └── Icons
│ │ └── icon.ico
├── bin
│ └── D3Dcompiler_46.dll
├── data
│ └── Shaders
│ │ ├── SimplePixelShader.hlsl
│ │ └── SimpleVertexShader.hlsl
├── inc
│ ├── DirectXTemplatePCH.h
│ ├── SimplePixelShader.h
│ └── SimpleVertexShader.h
├── resource.h
└── src
│ ├── DirectXTemplatePCH.cpp
│ └── main.cpp
├── DirectXTemplateLib
├── DirectXTemplateLib.rc
├── DirectXTemplateLib.vcxproj
├── DirectXTemplateLib.vcxproj.filters
├── Resources
│ └── Icons
│ │ └── icon.ico
├── inc
│ ├── Application.h
│ ├── Camera.h
│ ├── DirectXTemplateLibPCH.h
│ ├── Events.h
│ ├── Game.h
│ ├── KeyCodes.h
│ ├── Mesh.h
│ └── Window.h
├── lib
│ └── .gitignore
├── resource.h
└── src
│ ├── Application.cpp
│ ├── Camera.cpp
│ ├── DirectXTemplateLibPCH.cpp
│ ├── Game.cpp
│ ├── Mesh.cpp
│ └── Window.cpp
├── LICENSE
├── README.md
├── TextureAndLighting
├── TextureAndLighting.vcxproj
├── TextureAndLighting.vcxproj.filters
├── TextureAndLighting.vcxproj.user
├── data
│ ├── Shaders
│ │ ├── InstancedVertexShader.hlsl
│ │ ├── SimpleVertexShader.hlsl
│ │ └── TexturedLitPixelShader.hlsl
│ └── Textures
│ │ ├── Directx9.png
│ │ ├── Mona_Lisa.dds
│ │ ├── Mona_Lisa.jpg
│ │ └── earth.dds
├── inc
│ ├── .gitignore
│ ├── TextureAndLightingDemo.h
│ └── TextureAndLightingPCH.h
└── src
│ ├── TextureAndLightingDemo.cpp
│ ├── TextureAndLightingPCH.cpp
│ └── main.cpp
└── extern
└── DirectXTK
├── Audio
├── AudioEngine.cpp
├── DirectXTKAudio_Desktop_2010_DXSDK.vcxproj
├── DirectXTKAudio_Desktop_2010_DXSDK.vcxproj.filters
├── DirectXTKAudio_Desktop_2012_DXSDK.vcxproj
├── DirectXTKAudio_Desktop_2012_DXSDK.vcxproj.filters
├── DirectXTKAudio_Desktop_2012_Win8.vcxproj
├── DirectXTKAudio_Desktop_2012_Win8.vcxproj.filters
├── DirectXTKAudio_Desktop_2013_DXSDK.vcxproj
├── DirectXTKAudio_Desktop_2013_DXSDK.vcxproj.filters
├── DirectXTKAudio_Desktop_2013_Win8.vcxproj
├── DirectXTKAudio_Desktop_2013_Win8.vcxproj.filters
├── DynamicSoundEffectInstance.cpp
├── SoundCommon.cpp
├── SoundCommon.h
├── SoundEffect.cpp
├── SoundEffectInstance.cpp
├── WAVFileReader.cpp
├── WAVFileReader.h
├── WaveBank.cpp
├── WaveBankReader.cpp
└── WaveBankReader.h
├── DirectXTK_Desktop_2010.sln
├── DirectXTK_Desktop_2010.vcxproj
├── DirectXTK_Desktop_2010.vcxproj.filters
├── DirectXTK_Desktop_2010_DXSDK.sln
├── DirectXTK_Desktop_2012.sln
├── DirectXTK_Desktop_2012.vcxproj
├── DirectXTK_Desktop_2012.vcxproj.filters
├── DirectXTK_Desktop_2012_DXSDK.sln
├── DirectXTK_Desktop_2013.sln
├── DirectXTK_Desktop_2013.vcxproj
├── DirectXTK_Desktop_2013.vcxproj.filters
├── DirectXTK_Desktop_2013_DXSDK.sln
├── DirectXTK_Windows8.sln
├── DirectXTK_Windows8.vcxproj
├── DirectXTK_Windows8.vcxproj.filters
├── DirectXTK_Windows81.sln
├── DirectXTK_Windows81.vcxproj
├── DirectXTK_Windows81.vcxproj.filters
├── DirectXTK_WindowsPhone8.sln
├── DirectXTK_WindowsPhone8.vcxproj
├── DirectXTK_WindowsPhone8.vcxproj.filters
├── DirectXTK_XboxOneADK.sln
├── DirectXTK_XboxOneADK.vcxproj
├── DirectXTK_XboxOneADK.vcxproj.filters
├── DirectXTK_XboxOneXDK.sln
├── DirectXTK_XboxOneXDK.vcxproj
├── DirectXTK_XboxOneXDK.vcxproj.filters
├── Inc
├── Audio.h
├── CommonStates.h
├── DDSTextureLoader.h
├── DirectXHelpers.h
├── Effects.h
├── GeometricPrimitive.h
├── Model.h
├── PrimitiveBatch.h
├── ScreenGrab.h
├── SimpleMath.h
├── SimpleMath.inl
├── SpriteBatch.h
├── SpriteFont.h
├── VertexTypes.h
├── WICTextureLoader.h
└── XboxDDSTextureLoader.h
├── MakeSpriteFont
├── BitmapImporter.cs
├── BitmapUtils.cs
├── CharacterRegion.cs
├── CommandLineOptions.cs
├── CommandLineParser.cs
├── Glyph.cs
├── GlyphCropper.cs
├── GlyphPacker.cs
├── IFontImporter.cs
├── MakeSpriteFont.csproj
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── SpriteFontWriter.cs
└── TrueTypeImporter.cs
├── Microsoft Permissive License.rtf
├── Readme.txt
├── Src
├── AlignedNew.h
├── AlphaTestEffect.cpp
├── BasicEffect.cpp
├── Bezier.h
├── BinaryReader.cpp
├── BinaryReader.h
├── CommonStates.cpp
├── ConstantBuffer.h
├── DDSTextureLoader.cpp
├── DGSLEffect.cpp
├── DGSLEffectFactory.cpp
├── DemandCreate.h
├── DualTextureEffect.cpp
├── EffectCommon.cpp
├── EffectCommon.h
├── EffectFactory.cpp
├── EnvironmentMapEffect.cpp
├── GeometricPrimitive.cpp
├── Model.cpp
├── ModelLoadCMO.cpp
├── ModelLoadSDKMESH.cpp
├── PlatformHelpers.h
├── PrimitiveBatch.cpp
├── ScreenGrab.cpp
├── Shaders
│ ├── AlphaTestEffect.fx
│ ├── BasicEffect.fx
│ ├── Common.fxh
│ ├── CompileShaders.cmd
│ ├── Compiled
│ │ ├── AlphaTestEffect_PSAlphaTestEqNe.inc
│ │ ├── AlphaTestEffect_PSAlphaTestEqNeNoFog.inc
│ │ ├── AlphaTestEffect_PSAlphaTestLtGt.inc
│ │ ├── AlphaTestEffect_PSAlphaTestLtGtNoFog.inc
│ │ ├── AlphaTestEffect_VSAlphaTest.inc
│ │ ├── AlphaTestEffect_VSAlphaTestNoFog.inc
│ │ ├── AlphaTestEffect_VSAlphaTestVc.inc
│ │ ├── AlphaTestEffect_VSAlphaTestVcNoFog.inc
│ │ ├── BasicEffect_PSBasic.inc
│ │ ├── BasicEffect_PSBasicNoFog.inc
│ │ ├── BasicEffect_PSBasicPixelLighting.inc
│ │ ├── BasicEffect_PSBasicPixelLightingTx.inc
│ │ ├── BasicEffect_PSBasicTx.inc
│ │ ├── BasicEffect_PSBasicTxNoFog.inc
│ │ ├── BasicEffect_PSBasicVertexLighting.inc
│ │ ├── BasicEffect_PSBasicVertexLightingNoFog.inc
│ │ ├── BasicEffect_PSBasicVertexLightingTx.inc
│ │ ├── BasicEffect_PSBasicVertexLightingTxNoFog.inc
│ │ ├── BasicEffect_VSBasic.inc
│ │ ├── BasicEffect_VSBasicNoFog.inc
│ │ ├── BasicEffect_VSBasicOneLight.inc
│ │ ├── BasicEffect_VSBasicOneLightTx.inc
│ │ ├── BasicEffect_VSBasicOneLightTxVc.inc
│ │ ├── BasicEffect_VSBasicOneLightVc.inc
│ │ ├── BasicEffect_VSBasicPixelLighting.inc
│ │ ├── BasicEffect_VSBasicPixelLightingTx.inc
│ │ ├── BasicEffect_VSBasicPixelLightingTxVc.inc
│ │ ├── BasicEffect_VSBasicPixelLightingVc.inc
│ │ ├── BasicEffect_VSBasicTx.inc
│ │ ├── BasicEffect_VSBasicTxNoFog.inc
│ │ ├── BasicEffect_VSBasicTxVc.inc
│ │ ├── BasicEffect_VSBasicTxVcNoFog.inc
│ │ ├── BasicEffect_VSBasicVc.inc
│ │ ├── BasicEffect_VSBasicVcNoFog.inc
│ │ ├── BasicEffect_VSBasicVertexLighting.inc
│ │ ├── BasicEffect_VSBasicVertexLightingTx.inc
│ │ ├── BasicEffect_VSBasicVertexLightingTxVc.inc
│ │ ├── BasicEffect_VSBasicVertexLightingVc.inc
│ │ ├── DGSLEffect_main.inc
│ │ ├── DGSLEffect_main1Bones.inc
│ │ ├── DGSLEffect_main1BonesVc.inc
│ │ ├── DGSLEffect_main2Bones.inc
│ │ ├── DGSLEffect_main2BonesVc.inc
│ │ ├── DGSLEffect_main4Bones.inc
│ │ ├── DGSLEffect_main4BonesVc.inc
│ │ ├── DGSLEffect_mainVc.inc
│ │ ├── DGSLLambert_main.inc
│ │ ├── DGSLLambert_mainTk.inc
│ │ ├── DGSLLambert_mainTx.inc
│ │ ├── DGSLLambert_mainTxTk.inc
│ │ ├── DGSLPhong_main.inc
│ │ ├── DGSLPhong_mainTk.inc
│ │ ├── DGSLPhong_mainTx.inc
│ │ ├── DGSLPhong_mainTxTk.inc
│ │ ├── DGSLUnlit_main.inc
│ │ ├── DGSLUnlit_mainTk.inc
│ │ ├── DGSLUnlit_mainTx.inc
│ │ ├── DGSLUnlit_mainTxTk.inc
│ │ ├── DualTextureEffect_PSDualTexture.inc
│ │ ├── DualTextureEffect_PSDualTextureNoFog.inc
│ │ ├── DualTextureEffect_VSDualTexture.inc
│ │ ├── DualTextureEffect_VSDualTextureNoFog.inc
│ │ ├── DualTextureEffect_VSDualTextureVc.inc
│ │ ├── DualTextureEffect_VSDualTextureVcNoFog.inc
│ │ ├── EnvironmentMapEffect_PSEnvMap.inc
│ │ ├── EnvironmentMapEffect_PSEnvMapNoFog.inc
│ │ ├── EnvironmentMapEffect_PSEnvMapSpecular.inc
│ │ ├── EnvironmentMapEffect_PSEnvMapSpecularNoFog.inc
│ │ ├── EnvironmentMapEffect_VSEnvMap.inc
│ │ ├── EnvironmentMapEffect_VSEnvMapFresnel.inc
│ │ ├── EnvironmentMapEffect_VSEnvMapOneLight.inc
│ │ ├── EnvironmentMapEffect_VSEnvMapOneLightFresnel.inc
│ │ ├── SkinnedEffect_PSSkinnedPixelLighting.inc
│ │ ├── SkinnedEffect_PSSkinnedVertexLighting.inc
│ │ ├── SkinnedEffect_PSSkinnedVertexLightingNoFog.inc
│ │ ├── SkinnedEffect_VSSkinnedOneLightFourBones.inc
│ │ ├── SkinnedEffect_VSSkinnedOneLightOneBone.inc
│ │ ├── SkinnedEffect_VSSkinnedOneLightTwoBones.inc
│ │ ├── SkinnedEffect_VSSkinnedPixelLightingFourBones.inc
│ │ ├── SkinnedEffect_VSSkinnedPixelLightingOneBone.inc
│ │ ├── SkinnedEffect_VSSkinnedPixelLightingTwoBones.inc
│ │ ├── SkinnedEffect_VSSkinnedVertexLightingFourBones.inc
│ │ ├── SkinnedEffect_VSSkinnedVertexLightingOneBone.inc
│ │ ├── SkinnedEffect_VSSkinnedVertexLightingTwoBones.inc
│ │ ├── SpriteEffect_SpritePixelShader.inc
│ │ └── SpriteEffect_SpriteVertexShader.inc
│ ├── DGSLEffect.fx
│ ├── DGSLLambert.hlsl
│ ├── DGSLPhong.hlsl
│ ├── DGSLUnlit.hlsl
│ ├── DualTextureEffect.fx
│ ├── EnvironmentMapEffect.fx
│ ├── Lighting.fxh
│ ├── SkinnedEffect.fx
│ ├── SpriteEffect.fx
│ └── Structures.fxh
├── SharedResourcePool.h
├── SkinnedEffect.cpp
├── SpriteBatch.cpp
├── SpriteFont.cpp
├── TeapotData.inc
├── VertexTypes.cpp
├── WICTextureLoader.cpp
├── XboxDDSTextureLoader.cpp
├── dds.h
├── pch.cpp
└── pch.h
├── Windows81SDKVS12_x64.props
├── Windows81SDKVS12_x86.props
├── Windows81SDK_x64.props
├── Windows81SDK_x86.props
└── XWBTool
├── xwbtool.cpp
├── xwbtool_Desktop_2010.vcxproj
├── xwbtool_Desktop_2010.vcxproj.filters
├── xwbtool_Desktop_2012.vcxproj
├── xwbtool_Desktop_2012.vcxproj.filters
├── xwbtool_Desktop_2013.vcxproj
└── xwbtool_Desktop_2013.vcxproj.filters
/DirectX.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTemplate", "DirectXTemplate\DirectXTemplate.vcxproj", "{59BBB3E9-F10F-4AFD-BB4A-A693F382462E}"
5 | EndProject
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TextureAndLighting", "TextureAndLighting\TextureAndLighting.vcxproj", "{D0571515-ACB8-4746-866E-A3782DB42B92}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4} = {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}
9 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E} = {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}
10 | EndProjectSection
11 | EndProject
12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTemplateLib", "DirectXTemplateLib\DirectXTemplateLib.vcxproj", "{4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}"
13 | EndProject
14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2012", "extern\DirectXTK\DirectXTK_Desktop_2012.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
15 | EndProject
16 | Global
17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
18 | Debug|Win32 = Debug|Win32
19 | Debug|x64 = Debug|x64
20 | Profile|Win32 = Profile|Win32
21 | Profile|x64 = Profile|x64
22 | Release|Win32 = Release|Win32
23 | Release|x64 = Release|x64
24 | EndGlobalSection
25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
26 | {59BBB3E9-F10F-4AFD-BB4A-A693F382462E}.Debug|Win32.ActiveCfg = Debug|Win32
27 | {59BBB3E9-F10F-4AFD-BB4A-A693F382462E}.Debug|Win32.Build.0 = Debug|Win32
28 | {59BBB3E9-F10F-4AFD-BB4A-A693F382462E}.Debug|x64.ActiveCfg = Debug|Win32
29 | {59BBB3E9-F10F-4AFD-BB4A-A693F382462E}.Profile|Win32.ActiveCfg = Release|Win32
30 | {59BBB3E9-F10F-4AFD-BB4A-A693F382462E}.Profile|Win32.Build.0 = Release|Win32
31 | {59BBB3E9-F10F-4AFD-BB4A-A693F382462E}.Profile|x64.ActiveCfg = Release|Win32
32 | {59BBB3E9-F10F-4AFD-BB4A-A693F382462E}.Release|Win32.ActiveCfg = Release|Win32
33 | {59BBB3E9-F10F-4AFD-BB4A-A693F382462E}.Release|Win32.Build.0 = Release|Win32
34 | {59BBB3E9-F10F-4AFD-BB4A-A693F382462E}.Release|x64.ActiveCfg = Release|Win32
35 | {D0571515-ACB8-4746-866E-A3782DB42B92}.Debug|Win32.ActiveCfg = Debug|Win32
36 | {D0571515-ACB8-4746-866E-A3782DB42B92}.Debug|Win32.Build.0 = Debug|Win32
37 | {D0571515-ACB8-4746-866E-A3782DB42B92}.Debug|x64.ActiveCfg = Debug|Win32
38 | {D0571515-ACB8-4746-866E-A3782DB42B92}.Profile|Win32.ActiveCfg = Release|Win32
39 | {D0571515-ACB8-4746-866E-A3782DB42B92}.Profile|Win32.Build.0 = Release|Win32
40 | {D0571515-ACB8-4746-866E-A3782DB42B92}.Profile|x64.ActiveCfg = Release|Win32
41 | {D0571515-ACB8-4746-866E-A3782DB42B92}.Release|Win32.ActiveCfg = Release|Win32
42 | {D0571515-ACB8-4746-866E-A3782DB42B92}.Release|Win32.Build.0 = Release|Win32
43 | {D0571515-ACB8-4746-866E-A3782DB42B92}.Release|x64.ActiveCfg = Release|Win32
44 | {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}.Debug|Win32.ActiveCfg = Debug|Win32
45 | {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}.Debug|Win32.Build.0 = Debug|Win32
46 | {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}.Debug|x64.ActiveCfg = Debug|Win32
47 | {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}.Profile|Win32.ActiveCfg = Release|Win32
48 | {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}.Profile|Win32.Build.0 = Release|Win32
49 | {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}.Profile|x64.ActiveCfg = Release|Win32
50 | {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}.Release|Win32.ActiveCfg = Release|Win32
51 | {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}.Release|Win32.Build.0 = Release|Win32
52 | {4C48BA51-B7D3-4EFC-BE48-EFE19101A9F4}.Release|x64.ActiveCfg = Release|Win32
53 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
54 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
55 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
56 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
57 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|Win32.ActiveCfg = Release|Win32
58 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|Win32.Build.0 = Release|Win32
59 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|x64.ActiveCfg = Release|x64
60 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Profile|x64.Build.0 = Release|x64
61 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
62 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
63 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
64 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
65 | EndGlobalSection
66 | GlobalSection(SolutionProperties) = preSolution
67 | HideSolutionNode = FALSE
68 | EndGlobalSection
69 | EndGlobal
70 |
--------------------------------------------------------------------------------
/DirectXTemplate/DirectXTemplate.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/DirectXTemplate/DirectXTemplate.rc
--------------------------------------------------------------------------------
/DirectXTemplate/DirectXTemplate.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 | {a92e6161-2b26-41cd-b887-0b96c3df1c82}
18 |
19 |
20 | {d5e823fb-c8db-4460-a591-45c05134a5e8}
21 |
22 |
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 |
32 |
33 | Header Files
34 |
35 |
36 | Header Files
37 |
38 |
39 |
40 |
41 | Data\Shaders
42 |
43 |
44 | Data\Shaders
45 |
46 |
47 |
48 |
49 | Resource Files
50 |
51 |
52 |
53 |
54 | Resource Files
55 |
56 |
57 |
--------------------------------------------------------------------------------
/DirectXTemplate/DirectXTemplate.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/DirectXTemplate/Resources/Icons/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/DirectXTemplate/Resources/Icons/icon.ico
--------------------------------------------------------------------------------
/DirectXTemplate/bin/D3Dcompiler_46.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/DirectXTemplate/bin/D3Dcompiler_46.dll
--------------------------------------------------------------------------------
/DirectXTemplate/data/Shaders/SimplePixelShader.hlsl:
--------------------------------------------------------------------------------
1 | struct PixelShaderInput
2 | {
3 | float4 color : COLOR;
4 | };
5 |
6 | float4 SimplePixelShader( PixelShaderInput IN ) : SV_TARGET
7 | {
8 | return IN.color;
9 | }
--------------------------------------------------------------------------------
/DirectXTemplate/data/Shaders/SimpleVertexShader.hlsl:
--------------------------------------------------------------------------------
1 | cbuffer PerApplication : register( b0 )
2 | {
3 | matrix projectionMatrix;
4 | }
5 |
6 | cbuffer PerFrame : register( b1 )
7 | {
8 | matrix viewMatrix;
9 | }
10 |
11 | cbuffer PerObject : register( b2 )
12 | {
13 | matrix worldMatrix;
14 | }
15 |
16 | struct AppData
17 | {
18 | float3 position : POSITION;
19 | float3 color: COLOR;
20 | };
21 |
22 | struct VertexShaderOutput
23 | {
24 | float4 color : COLOR;
25 | float4 position : SV_POSITION;
26 | };
27 |
28 | VertexShaderOutput SimpleVertexShader( AppData IN )
29 | {
30 | VertexShaderOutput OUT;
31 |
32 | matrix mvp = mul( projectionMatrix, mul( viewMatrix, worldMatrix ) );
33 | OUT.position = mul( mvp, float4( IN.position, 1.0f ) );
34 | OUT.color = float4( IN.color, 1.0f );
35 |
36 | return OUT;
37 | }
--------------------------------------------------------------------------------
/DirectXTemplate/inc/DirectXTemplatePCH.h:
--------------------------------------------------------------------------------
1 | // System includes
2 | #include
3 |
4 | // DirectX includes
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | // STL includes
11 | #include
12 | #include
13 | #include
14 |
15 | // Link library dependencies
16 | #pragma comment(lib, "d3d11.lib")
17 | #pragma comment(lib, "dxgi.lib")
18 | #pragma comment(lib, "d3dcompiler.lib")
19 | #pragma comment(lib, "winmm.lib")
20 |
21 | // Safely release a COM object.
22 | template
23 | inline void SafeRelease( T& ptr )
24 | {
25 | if ( ptr != NULL )
26 | {
27 | ptr->Release();
28 | ptr = NULL;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/DirectXTemplate/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by DirectXTemplate.rc
4 | //
5 | #define IDI_ICON1 101
6 | #define APP_ICON 101
7 |
8 | // Next default values for new objects
9 | //
10 | #ifdef APSTUDIO_INVOKED
11 | #ifndef APSTUDIO_READONLY_SYMBOLS
12 | #define _APS_NEXT_RESOURCE_VALUE 102
13 | #define _APS_NEXT_COMMAND_VALUE 40001
14 | #define _APS_NEXT_CONTROL_VALUE 1001
15 | #define _APS_NEXT_SYMED_VALUE 101
16 | #endif
17 | #endif
18 |
--------------------------------------------------------------------------------
/DirectXTemplate/src/DirectXTemplatePCH.cpp:
--------------------------------------------------------------------------------
1 | #include
--------------------------------------------------------------------------------
/DirectXTemplateLib/DirectXTemplateLib.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/DirectXTemplateLib/DirectXTemplateLib.rc
--------------------------------------------------------------------------------
/DirectXTemplateLib/DirectXTemplateLib.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 | Header Files
23 |
24 |
25 | Header Files
26 |
27 |
28 | Header Files
29 |
30 |
31 | Header Files
32 |
33 |
34 | Header Files
35 |
36 |
37 | Header Files
38 |
39 |
40 | Header Files
41 |
42 |
43 | Header Files
44 |
45 |
46 |
47 |
48 | Source Files
49 |
50 |
51 | Source Files
52 |
53 |
54 | Source Files
55 |
56 |
57 | Source Files
58 |
59 |
60 | Source Files
61 |
62 |
63 | Source Files
64 |
65 |
66 |
67 |
68 | Resource Files
69 |
70 |
71 |
72 |
73 | Resource Files
74 |
75 |
76 |
--------------------------------------------------------------------------------
/DirectXTemplateLib/Resources/Icons/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/DirectXTemplateLib/Resources/Icons/icon.ico
--------------------------------------------------------------------------------
/DirectXTemplateLib/inc/Application.h:
--------------------------------------------------------------------------------
1 | /**
2 | * The application class is used to create windows for our application.
3 | */
4 | #pragma once
5 |
6 | class Window;
7 |
8 | class Application
9 | {
10 | public:
11 |
12 | /**
13 | * Create the application singleton with the application instance handle.
14 | */
15 | static void Create( HINSTANCE hInst );
16 |
17 | /**
18 | * Destroy the application instance and all windows created by this application instance.
19 | */
20 | static void Destroy();
21 | /**
22 | * Get the application singleton.
23 | */
24 | static Application& Get();
25 |
26 | /**
27 | * Create a new DirectX11 render window instance.
28 | * @param windowName The name of the window. This name will appear in the title bar of the window. This name should be unique.
29 | * @param clientWidth The width (in pixels) of the window's client area.
30 | * @param clientHeight The height (in pixels) of the window's client area.
31 | * @param vSync Should the rendering be synchronized with the vertical refresh rate of the screen.
32 | * @param windowed If true, the window will be created in windowed mode. If false, the window will be created full-screen.
33 | * @returns The created window instance. If an error occurred while creating the window an invalid
34 | * window instance is returned. If a window with the given name already exists, that window will be
35 | * returned.
36 | */
37 | Window& CreateRenderWindow( const std::string& windowName, int clientWidth, int clientHeight, bool vSync = false, bool windowed = true );
38 |
39 | /**
40 | * Destroy a window given the window name.
41 | */
42 | void DestroyWindow( const std::string& windowName );
43 | /**
44 | * Destroy a window given the window reference.
45 | */
46 | void DestroyWindow( Window& window );
47 |
48 | /**
49 | * Find a window by the window name.
50 | */
51 | Window& GetWindowByName( const std::string& windowName );
52 |
53 | /**
54 | * Run the application loop and message pump.
55 | * @return The error code if an error occurred.
56 | */
57 | int Run();
58 |
59 | /**
60 | * Request to quit the application and close all windows.
61 | * @param exitCode The error code to return to the invoking process.
62 | */
63 | void Quit(int exitCode = 0);
64 |
65 | protected:
66 |
67 | // Create an application instance.
68 | Application( HINSTANCE hInst );
69 | // Destroy the aplication instance and all windows associated with this application.
70 | virtual ~Application();
71 |
72 | private:
73 | // The application instance handle that this application was created with.
74 | HINSTANCE m_hInstance;
75 |
76 | // Return this invalid window when either an error occurs when creating a window
77 | // or the user asks for window by name but no window with that name exists.
78 | static Window ms_InvalidWindow;
79 | };
--------------------------------------------------------------------------------
/DirectXTemplateLib/inc/Camera.h:
--------------------------------------------------------------------------------
1 | /**
2 | * A DirectX camera class.
3 | */
4 | #pragma once
5 |
6 | class Camera
7 | {
8 | public:
9 |
10 | // When performing transformations on the camera,
11 | // it is sometimes useful to express which space this
12 | // transformation should be applied.
13 | enum Space
14 | {
15 | LocalSpace,
16 | WorldSpace,
17 | };
18 |
19 | // Express whether this is a left-handed coordinate system (commonly used for DirectX)
20 | // or a right-handed coordinate system (commonly used for OpenGL).
21 | enum Handedness
22 | {
23 | LeftHanded,
24 | RightHanded
25 | };
26 |
27 | Camera(Handedness handedness = LeftHanded);
28 | virtual ~Camera();
29 |
30 | void set_Viewport( D3D11_VIEWPORT viewport );
31 | D3D11_VIEWPORT get_Viewport() const;
32 |
33 | void XM_CALLCONV set_LookAt( DirectX::FXMVECTOR eye, DirectX::FXMVECTOR target, DirectX::FXMVECTOR up );
34 | DirectX::XMMATRIX get_ViewMatrix() const;
35 | DirectX::XMMATRIX get_InverseViewMatrix() const;
36 |
37 | /**
38 | * Set the camera to a perspective projection matrix.
39 | * @param fovy The vertical field of view in degrees.
40 | * @param aspect The aspect ratio of the screen.
41 | * @param zNear The distance to the near clipping plane.
42 | * @param zFar The distance to the far clipping plane.
43 | */
44 | void set_Projection( float fovy, float aspect, float zNear, float zFar );
45 | DirectX::XMMATRIX get_ProjectionMatrix() const;
46 | DirectX::XMMATRIX get_InverseProjectionMatrix() const;
47 |
48 | /**
49 | * Set the camera's position in world-space.
50 | */
51 | void XM_CALLCONV set_Translation( DirectX::FXMVECTOR translation );
52 | DirectX::XMVECTOR get_Translation() const;
53 |
54 | /**
55 | * Set the camera's rotation in world-space.
56 | * @param rotation The rotation quaternion.
57 | */
58 | void set_Rotation( DirectX::FXMVECTOR rotation );
59 | /**
60 | * Query the camera's rotation.
61 | * @returns The camera's rotation quaternion.
62 | */
63 | DirectX::XMVECTOR get_Rotation() const;
64 |
65 | void XM_CALLCONV Translate( DirectX::FXMVECTOR translation, Space space = LocalSpace );
66 | void Rotate( DirectX::FXMVECTOR quaternion );
67 |
68 | protected:
69 | virtual void UpdateViewMatrix() const;
70 | virtual void UpdateInverseViewMatrix() const;
71 | virtual void UpdateProjectionMatrix() const;
72 | virtual void UpdateInverseProjectionMatrix() const;
73 |
74 | // This data must be aligned otherwise the SSE intrinsics fail
75 | // and throw exceptions.
76 | __declspec(align(16)) struct AlignedData
77 | {
78 | // World-space position of the camera.
79 | DirectX::XMVECTOR m_Translation;
80 | // World-space rotation of the camera.
81 | // THIS IS A QUATERNION!!!!
82 | DirectX::XMVECTOR m_Rotation;
83 |
84 | DirectX::XMMATRIX m_ViewMatrix, m_InverseViewMatrix;
85 | DirectX::XMMATRIX m_ProjectionMatrix, m_InverseProjectionMatrix;
86 | };
87 | AlignedData* pData;
88 |
89 | // projection parameters
90 | float m_vFoV; // Vertical field of view.
91 | float m_AspectRatio; // Aspect ratio
92 | float m_zNear; // Near clip distance
93 | float m_zFar; // Far clip distance.
94 |
95 | D3D11_VIEWPORT m_Viewport;
96 |
97 | // True if the view matrix needs to be updated.
98 | mutable bool m_ViewDirty, m_InverseViewDirty;
99 | // True if the projection matrix needs to be updated.
100 | mutable bool m_ProjectionDirty, m_InverseProjectionDirty;
101 |
102 | Handedness m_Handedness;
103 |
104 | private:
105 |
106 | };
--------------------------------------------------------------------------------
/DirectXTemplateLib/inc/DirectXTemplateLibPCH.h:
--------------------------------------------------------------------------------
1 | // System includes
2 | #include
3 | // Windows Runtime Template Library
4 | #include
5 |
6 | // DirectX includes
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | // Declare the XM_CALLCONV macro if we are using an old version of the DirectX Math library.
13 | // For more information about DirecX Math Library internals, see http://msdn.microsoft.com/en-us/library/windows/desktop/ee418728(v=vs.85).aspx
14 | #if (DIRECTXMATH_VERSION < 305) && !defined(XM_CALLCONV)
15 | #define XM_CALLCONV __fastcall
16 | typedef const DirectX::XMVECTOR& HXMVECTOR;
17 | typedef const DirectX::XMMATRIX& FXMMATRIX;
18 | #endif
19 |
20 | // STL includes
21 | #include
22 | #include
23 | #include
24 | #include