├── .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 25 | #include 26 | 27 | // Link library dependencies 28 | #pragma comment(lib, "d3d11.lib") 29 | #pragma comment(lib, "dxgi.lib") 30 | #pragma comment(lib, "d3dcompiler.lib") 31 | #pragma comment(lib, "winmm.lib") 32 | -------------------------------------------------------------------------------- /DirectXTemplateLib/inc/Game.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief The Game class is the abstract base class for DirecX 11 demos. 3 | */ 4 | #pragma once 5 | 6 | #include 7 | 8 | class Window; 9 | 10 | class Game 11 | { 12 | public: 13 | /** 14 | * Create the DirectX demo in the specified window. 15 | */ 16 | Game( Window& window ); 17 | virtual ~Game(); 18 | 19 | /** 20 | * Initialize the DirectX Runtime. 21 | */ 22 | virtual bool Initialize(); 23 | 24 | /** 25 | * Load content required for the demo. 26 | */ 27 | virtual bool LoadContent() = 0; 28 | 29 | /** 30 | * Unload demo specific content that was loaded in LoadContent. 31 | */ 32 | virtual void UnloadContent() = 0; 33 | 34 | /** 35 | * Cleanup the DirectX runtime. 36 | */ 37 | virtual void Cleanup(); 38 | 39 | protected: 40 | friend class Window; 41 | 42 | // The window associated with this demo. 43 | Window& m_Window; 44 | 45 | // Direct3D device and swap chain. 46 | Microsoft::WRL::ComPtr m_d3dDevice; 47 | Microsoft::WRL::ComPtr m_d3dDeviceContext; 48 | Microsoft::WRL::ComPtr m_d3dSwapChain; 49 | 50 | // Render target view for the back buffer of the swap chain. 51 | Microsoft::WRL::ComPtr m_d3dRenderTargetView; 52 | // Depth/stencil view for use as a depth buffer. 53 | Microsoft::WRL::ComPtr m_d3dDepthStencilView; 54 | // A texture to associate to the depth stencil view. 55 | Microsoft::WRL::ComPtr m_d3dDepthStencilBuffer; 56 | 57 | // Define the functionality of the depth/stencil stages. 58 | Microsoft::WRL::ComPtr m_d3dDepthStencilState; 59 | // Define the functionality of the rasterizer stage. 60 | Microsoft::WRL::ComPtr m_d3dRasterizerState; 61 | // Present parameters used by the IDXGISwapChain1::Present1 method 62 | DXGI_PRESENT_PARAMETERS m_PresentParameters; 63 | 64 | /** 65 | * Clear the contents of the back buffer, depth buffer, and stencil buffer. 66 | * This function is usually called before anything is rendered to the screen. 67 | */ 68 | void Clear( const FLOAT clearColor[4], FLOAT clearDepth, UINT8 clearStencil ); 69 | /** 70 | * Swap the contents of the back buffer to the front. 71 | * This function is usually called after everything has been rendered. 72 | */ 73 | void Present(); 74 | 75 | /** 76 | * Update the game logic. 77 | */ 78 | virtual void OnUpdate( UpdateEventArgs& e ); 79 | 80 | /** 81 | * Render stuff. 82 | */ 83 | virtual void OnRender( RenderEventArgs& e ); 84 | 85 | /** 86 | * Invoked by the registered window when a key is pressed 87 | * while the window has focus. 88 | */ 89 | virtual void OnKeyPressed( KeyEventArgs& e ); 90 | 91 | /** 92 | * Invoked when a key on the keyboard is released. 93 | */ 94 | virtual void OnKeyReleased( KeyEventArgs& e ); 95 | 96 | /** 97 | * Invoked when the mouse is moved over the registered window. 98 | */ 99 | virtual void OnMouseMoved( MouseMotionEventArgs& e ); 100 | 101 | /** 102 | * Invoked when a mouse button is pressed over the registered window. 103 | */ 104 | virtual void OnMouseButtonPressed( MouseButtonEventArgs& e ); 105 | 106 | /** 107 | * Invoked when a mouse button is released over the registered window. 108 | */ 109 | virtual void OnMouseButtonReleased( MouseButtonEventArgs& e ); 110 | 111 | /** 112 | * Invoked when the mouse wheel is scrolled while the registered window has focus. 113 | */ 114 | virtual void OnMouseWheel( MouseWheelEventArgs& e ); 115 | 116 | /** 117 | * Invoked when the attached window is resized. 118 | */ 119 | virtual void OnResize( ResizeEventArgs& e ); 120 | 121 | /** 122 | * Invoked when the registered window instance is destroyed. 123 | */ 124 | virtual void OnWindowDestroy(); 125 | 126 | private: 127 | 128 | // Resize the front and back buffers associated with the swap chain. 129 | bool ResizeSwapChain( int width, int height ); 130 | 131 | bool m_bIsInitialized; 132 | 133 | }; -------------------------------------------------------------------------------- /DirectXTemplateLib/inc/Mesh.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief A mesh class that can be used to draw geometry to the screen. 3 | */ 4 | #pragma once 5 | 6 | #include 7 | 8 | // Vertex struct holding position, normal vector, and texture mapping information. 9 | struct VertexPositionNormalTexture 10 | { 11 | VertexPositionNormalTexture() 12 | { } 13 | 14 | VertexPositionNormalTexture( const DirectX::XMFLOAT3& position, const DirectX::XMFLOAT3& normal, const DirectX::XMFLOAT2& textureCoordinate) 15 | : position(position), 16 | normal(normal), 17 | textureCoordinate(textureCoordinate) 18 | { } 19 | 20 | VertexPositionNormalTexture( DirectX::FXMVECTOR position, DirectX::FXMVECTOR normal, DirectX::FXMVECTOR textureCoordinate) 21 | { 22 | XMStoreFloat3(&this->position, position); 23 | XMStoreFloat3(&this->normal, normal); 24 | XMStoreFloat2(&this->textureCoordinate, textureCoordinate); 25 | } 26 | 27 | DirectX::XMFLOAT3 position; 28 | DirectX::XMFLOAT3 normal; 29 | DirectX::XMFLOAT2 textureCoordinate; 30 | 31 | static const int InputElementCount = 3; 32 | static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount]; 33 | }; 34 | 35 | typedef std::vector VertexCollection; 36 | typedef std::vector IndexCollection; 37 | 38 | class Mesh 39 | { 40 | public: 41 | 42 | void Draw( ID3D11DeviceContext* pDeviceContext ); 43 | 44 | static std::unique_ptr CreateCube( ID3D11DeviceContext* deviceContext, float size = 1, bool rhcoords = true); 45 | static std::unique_ptr CreateSphere( ID3D11DeviceContext* deviceContext, float diameter = 1, size_t tessellation = 16, bool rhcoords = true); 46 | static std::unique_ptr CreateCone( ID3D11DeviceContext* deviceContext, float diameter = 1, float height = 1, size_t tessellation = 32, bool rhcoords = true); 47 | static std::unique_ptr CreateTorus( ID3D11DeviceContext* deviceContext, float diameter = 1, float thickness = 0.333f, size_t tessellation = 32, bool rhcoords = true); 48 | 49 | protected: 50 | 51 | private: 52 | friend struct std::default_delete; 53 | 54 | Mesh(); 55 | Mesh( const Mesh& copy ); 56 | virtual ~Mesh(); 57 | 58 | void Initialize( ID3D11DeviceContext* deviceContext, VertexCollection& vertices, IndexCollection& indices, bool rhcoords ); 59 | 60 | Microsoft::WRL::ComPtr m_VertexBuffer; 61 | Microsoft::WRL::ComPtr m_IndexBuffer; 62 | 63 | UINT m_IndexCount; 64 | }; -------------------------------------------------------------------------------- /DirectXTemplateLib/inc/Window.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief A window for our application. 3 | */ 4 | #pragma once 5 | 6 | #include 7 | 8 | // Forward-declare the DirectXTemplate class. 9 | class Game; 10 | 11 | class Window 12 | { 13 | public: 14 | 15 | /** 16 | * Get a handle to this window's instance. 17 | * @returns The handle to the window instance or nullptr if this is not a valid window. 18 | */ 19 | HWND get_WindowHandle() const; 20 | 21 | /** 22 | * Destroy this window. 23 | */ 24 | void Destroy(); 25 | 26 | /** 27 | * @brief Check to see if this is a valid window handle. 28 | * @returns false if this window instance does not refer to a valid window. 29 | */ 30 | bool IsValid() const; 31 | 32 | const std::string& get_WindowName() const; 33 | 34 | int get_ClientWidth() const; 35 | int get_ClientHeight() const; 36 | 37 | /** 38 | * Should this window be rendered with vertical refresh synchronization. 39 | */ 40 | bool get_VSync() const; 41 | 42 | /** 43 | * Is this a windowed window or full-screen? 44 | */ 45 | bool get_Windowed() const; 46 | 47 | protected: 48 | // The Window procedure needs to call protected methods of this class. 49 | friend LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); 50 | 51 | // Only the application can create a window. 52 | friend class Application; 53 | // The DirectXTemplate class needs to register itself with a window. 54 | friend class Game; 55 | 56 | Window(); 57 | Window( HWND hWnd, const std::string& windowName, int clientWidth, int clientHeight, bool vSync, bool windowed ); 58 | virtual ~Window(); 59 | 60 | // Register a DirectXTemplate with this window. This allows 61 | // the window to callback functions in the DirectXTemplate class and notify 62 | // the demo that the window has been destroyed. 63 | bool RegisterDirectXTemplate( Game* pTemplate ); 64 | 65 | // Update and Draw can only be called by the application. 66 | virtual void OnUpdate( UpdateEventArgs& e ); 67 | virtual void OnRender( RenderEventArgs& e ); 68 | 69 | // A keyboard key was pressed 70 | virtual void OnKeyPressed( KeyEventArgs& e ); 71 | // A keyboard key was released 72 | virtual void OnKeyReleased( KeyEventArgs& e ); 73 | 74 | // The mouse was moved 75 | virtual void OnMouseMoved( MouseMotionEventArgs& e ); 76 | // A button on the mouse was pressed 77 | virtual void OnMouseButtonPressed( MouseButtonEventArgs& e ); 78 | // A button on the mouse was released 79 | virtual void OnMouseButtonReleased( MouseButtonEventArgs& e ); 80 | // The mouse wheel was moved. 81 | virtual void OnMouseWheel( MouseWheelEventArgs& e ); 82 | 83 | // The window was resized. 84 | virtual void OnResize( ResizeEventArgs& e ); 85 | 86 | private: 87 | // Windows should not be copied. 88 | Window( const Window& copy ); 89 | 90 | HWND m_hWnd; 91 | 92 | std::string m_WindowName; 93 | int m_ClientWidth; 94 | int m_ClientHeight; 95 | bool m_VSync; 96 | bool m_bWindowed; 97 | 98 | Game* m_pGame; 99 | }; -------------------------------------------------------------------------------- /DirectXTemplateLib/lib/.gitignore: -------------------------------------------------------------------------------- 1 | /DirectXTemplateLib.lib 2 | /DirectXTemplateLib.res 3 | /DirectXTemplateLibd.lib 4 | -------------------------------------------------------------------------------- /DirectXTemplateLib/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by DirectXTemplateLib.rc 4 | // 5 | #define APP_ICIN 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 | -------------------------------------------------------------------------------- /DirectXTemplateLib/src/DirectXTemplateLibPCH.cpp: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /DirectXTemplateLib/src/Window.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | Window::Window() 6 | : m_hWnd(nullptr) 7 | , m_ClientWidth( 0 ) 8 | , m_ClientHeight( 0 ) 9 | , m_VSync( true ) 10 | , m_bWindowed( true ) 11 | , m_pGame( nullptr ) 12 | {} 13 | 14 | Window::Window( HWND hWnd, const std::string& windowName, int clientWidth, int clientHeight, bool vSync, bool windowed ) 15 | : m_hWnd( hWnd ) 16 | , m_WindowName( windowName ) 17 | , m_ClientWidth( clientWidth ) 18 | , m_ClientHeight( clientHeight ) 19 | , m_VSync( vSync ) 20 | , m_bWindowed( windowed ) 21 | , m_pGame( nullptr ) 22 | { 23 | 24 | } 25 | 26 | Window::~Window() 27 | { 28 | Destroy(); 29 | } 30 | 31 | HWND Window::get_WindowHandle() const 32 | { 33 | return m_hWnd; 34 | } 35 | 36 | const std::string& Window::get_WindowName() const 37 | { 38 | return m_WindowName; 39 | } 40 | 41 | void Window::Destroy() 42 | { 43 | if ( m_pGame ) 44 | { 45 | // Notify the registered DirectX template that the window is being destroyed. 46 | m_pGame->OnWindowDestroy(); 47 | m_pGame = nullptr; 48 | } 49 | if ( m_hWnd ) 50 | { 51 | DestroyWindow(m_hWnd); 52 | m_hWnd = nullptr; 53 | } 54 | } 55 | 56 | bool Window::IsValid() const 57 | { 58 | return ( m_hWnd != nullptr ); 59 | } 60 | 61 | int Window::get_ClientWidth() const 62 | { 63 | return m_ClientWidth; 64 | } 65 | 66 | int Window::get_ClientHeight() const 67 | { 68 | return m_ClientHeight; 69 | } 70 | 71 | bool Window::get_VSync() const 72 | { 73 | return m_VSync; 74 | } 75 | 76 | bool Window::get_Windowed() const 77 | { 78 | return m_bWindowed; 79 | } 80 | 81 | bool Window::RegisterDirectXTemplate( Game* pTemplate ) 82 | { 83 | if ( !m_pGame ) 84 | { 85 | m_pGame = pTemplate; 86 | 87 | return true; 88 | } 89 | 90 | return false; 91 | } 92 | 93 | void Window::OnUpdate( UpdateEventArgs& e ) 94 | { 95 | if ( m_pGame ) 96 | { 97 | m_pGame->OnUpdate( e ); 98 | } 99 | } 100 | 101 | void Window::OnRender( RenderEventArgs& e ) 102 | { 103 | if ( m_pGame ) 104 | { 105 | m_pGame->OnRender( e ); 106 | } 107 | } 108 | 109 | void Window::OnKeyPressed( KeyEventArgs& e ) 110 | { 111 | if ( m_pGame ) 112 | { 113 | m_pGame->OnKeyPressed( e ); 114 | } 115 | } 116 | 117 | void Window::OnKeyReleased( KeyEventArgs& e ) 118 | { 119 | if ( m_pGame ) 120 | { 121 | m_pGame->OnKeyReleased( e ); 122 | } 123 | } 124 | 125 | // The mouse was moved 126 | void Window::OnMouseMoved( MouseMotionEventArgs& e ) 127 | { 128 | if ( m_pGame ) 129 | { 130 | m_pGame->OnMouseMoved( e ); 131 | } 132 | } 133 | 134 | // A button on the mouse was pressed 135 | void Window::OnMouseButtonPressed( MouseButtonEventArgs& e ) 136 | { 137 | if ( m_pGame ) 138 | { 139 | m_pGame->OnMouseButtonPressed( e ); 140 | } 141 | } 142 | 143 | // A button on the mouse was released 144 | void Window::OnMouseButtonReleased( MouseButtonEventArgs& e ) 145 | { 146 | if ( m_pGame ) 147 | { 148 | m_pGame->OnMouseButtonReleased( e ); 149 | } 150 | } 151 | 152 | // The mouse wheel was moved. 153 | void Window::OnMouseWheel( MouseWheelEventArgs& e ) 154 | { 155 | if ( m_pGame ) 156 | { 157 | m_pGame->OnMouseWheel( e ); 158 | } 159 | } 160 | 161 | void Window::OnResize( ResizeEventArgs& e ) 162 | { 163 | // Update the client size. 164 | if ( e.Width <= 0 ) e.Width = 1; 165 | if ( e.Height <= 0 ) e.Height = 1; 166 | 167 | m_ClientWidth = e.Width; 168 | m_ClientHeight = e.Height; 169 | 170 | if ( m_pGame ) 171 | { 172 | m_pGame->OnResize( e ); 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jeremiah van Oosten 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Texture and Lighting in DirectX 12 2 | 3 | The source code repository for https://www.3dgep.com/texturing-lighting-directx-11/ 4 | 5 | ## Controls 6 | 7 | | Key | Action | 8 | |:---:|--------| 9 | | `W` | Move camera forward | 10 | | `A` | Move camera left | 11 | | `S` | Move camera backward | 12 | | `D` | Move camera right | 13 | | `Q` | Pan camera up | 14 | | `E` | Pan camera down | 15 | | `Esc` | Close application | 16 | | `Alt`+`Enter` | Toggle fullscreen mode | 17 | -------------------------------------------------------------------------------- /TextureAndLighting/TextureAndLighting.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 | {217b2e8f-b336-4115-b778-6c63c3e45d5e} 18 | 19 | 20 | {a4cb3897-d368-4d2f-aff2-e884dd9db72f} 21 | hlsl 22 | 23 | 24 | 25 | 26 | Source Files 27 | 28 | 29 | Source Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | 36 | 37 | Header Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | 44 | 45 | Data\Shaders 46 | 47 | 48 | Data\Shaders 49 | 50 | 51 | Data\Shaders 52 | 53 | 54 | -------------------------------------------------------------------------------- /TextureAndLighting/TextureAndLighting.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(OutDir) 5 | 6 | 7 | $(OutDir) 8 | 9 | -------------------------------------------------------------------------------- /TextureAndLighting/data/Shaders/InstancedVertexShader.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer PerFrame : register( b0 ) 2 | { 3 | matrix ViewProjectionMatrix; 4 | } 5 | 6 | struct AppData 7 | { 8 | // Per-vertex data 9 | float3 Position : POSITION; 10 | float3 Normal : NORMAL; 11 | float2 TexCoord : TEXCOORD; 12 | // Per-instance data 13 | matrix Matrix : WORLDMATRIX; 14 | matrix InverseTranspose : INVERSETRANSPOSEWORLDMATRIX; 15 | }; 16 | 17 | struct VertexShaderOutput 18 | { 19 | float4 PositionWS : TEXCOORD1; 20 | float3 NormalWS : TEXCOORD2; 21 | float2 TexCoord : TEXCOORD0; 22 | float4 Position : SV_Position; 23 | }; 24 | 25 | VertexShaderOutput InstancedVertexShader( AppData IN ) 26 | { 27 | VertexShaderOutput OUT; 28 | 29 | matrix MVP = mul( ViewProjectionMatrix, IN.Matrix ); 30 | 31 | OUT.Position = mul( MVP, float4( IN.Position, 1.0f ) ); 32 | OUT.PositionWS = mul( IN.Matrix, float4( IN.Position, 1.0f ) ); 33 | OUT.NormalWS = mul( (float3x3)IN.InverseTranspose, IN.Normal ); 34 | OUT.TexCoord = IN.TexCoord; 35 | 36 | return OUT; 37 | } -------------------------------------------------------------------------------- /TextureAndLighting/data/Shaders/SimpleVertexShader.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer PerObject : register( b0 ) 2 | { 3 | matrix WorldMatrix; 4 | matrix InverseTransposeWorldMatrix; 5 | matrix WorldViewProjectionMatrix; 6 | } 7 | 8 | struct AppData 9 | { 10 | float3 Position : POSITION; 11 | float3 Normal : NORMAL; 12 | float2 TexCoord : TEXCOORD; 13 | }; 14 | 15 | struct VertexShaderOutput 16 | { 17 | float4 PositionWS : TEXCOORD1; 18 | float3 NormalWS : TEXCOORD2; 19 | float2 TexCoord : TEXCOORD0; 20 | float4 Position : SV_Position; 21 | }; 22 | 23 | VertexShaderOutput SimpleVertexShader( AppData IN ) 24 | { 25 | VertexShaderOutput OUT; 26 | 27 | OUT.Position = mul( WorldViewProjectionMatrix, float4( IN.Position, 1.0f ) ); 28 | OUT.PositionWS = mul( WorldMatrix, float4( IN.Position, 1.0f ) ); 29 | OUT.NormalWS = mul( (float3x3)InverseTransposeWorldMatrix, IN.Normal ); 30 | OUT.TexCoord = IN.TexCoord; 31 | 32 | return OUT; 33 | } -------------------------------------------------------------------------------- /TextureAndLighting/data/Textures/Directx9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/TextureAndLighting/data/Textures/Directx9.png -------------------------------------------------------------------------------- /TextureAndLighting/data/Textures/Mona_Lisa.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/TextureAndLighting/data/Textures/Mona_Lisa.dds -------------------------------------------------------------------------------- /TextureAndLighting/data/Textures/Mona_Lisa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/TextureAndLighting/data/Textures/Mona_Lisa.jpg -------------------------------------------------------------------------------- /TextureAndLighting/data/Textures/earth.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/TextureAndLighting/data/Textures/earth.dds -------------------------------------------------------------------------------- /TextureAndLighting/inc/.gitignore: -------------------------------------------------------------------------------- 1 | /SimplePixelShader_d.h 2 | /SimpleVertexShader_d.h 3 | /SimplePixelShader.h 4 | /SimpleVertexShader.h 5 | /TexturedLitPixelShader.h 6 | /TexturedLitPixelShader_d.h 7 | /TexturedLitVertexShader.h 8 | /TexturedLitVertexShader_d.h 9 | /InstancedVertexShader.h 10 | /InstancedVertexShader_d.h 11 | -------------------------------------------------------------------------------- /TextureAndLighting/inc/TextureAndLightingPCH.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // DirectX Tool Kit 6 | #include 7 | #include 8 | 9 | #include -------------------------------------------------------------------------------- /TextureAndLighting/src/TextureAndLightingPCH.cpp: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /TextureAndLighting/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | const char* g_WindowName = "Texture and Lighting Demo"; 8 | int g_WindowWidth = 800; 9 | int g_WindowHeight = 600; 10 | bool g_VSync = false; 11 | bool g_Windowed = true; 12 | 13 | int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE prevInstance, LPWSTR cmdLine, int cmdShow ) 14 | { 15 | UNREFERENCED_PARAMETER( prevInstance ); 16 | UNREFERENCED_PARAMETER( cmdLine ); 17 | 18 | Application::Create(hInstance); 19 | Application& app = Application::Get(); 20 | 21 | Window& window = app.CreateRenderWindow( g_WindowName, g_WindowWidth, g_WindowHeight, g_VSync, g_Windowed ); 22 | 23 | TextureAndLightingDemo* pDemo = new TextureAndLightingDemo(window); 24 | 25 | if ( !pDemo->Initialize() ) 26 | { 27 | return -1; 28 | } 29 | 30 | if ( !pDemo->LoadContent() ) 31 | { 32 | return -1; 33 | } 34 | 35 | int exitCode = app.Run(); 36 | 37 | pDemo->UnloadContent(); 38 | pDemo->Cleanup(); 39 | 40 | delete pDemo; 41 | 42 | return exitCode; 43 | } -------------------------------------------------------------------------------- /extern/DirectXTK/Audio/DirectXTKAudio_Desktop_2010_DXSDK.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 6 | h;hpp;hxx;hm;inl;inc;xsd 7 | 8 | 9 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 10 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 11 | 12 | 13 | 14 | 15 | Inc 16 | 17 | 18 | Inc 19 | 20 | 21 | Inc 22 | 23 | 24 | Inc 25 | 26 | 27 | 28 | 29 | Src 30 | 31 | 32 | Src 33 | 34 | 35 | Src 36 | 37 | 38 | Src 39 | 40 | 41 | Src 42 | 43 | 44 | Src 45 | 46 | 47 | Src 48 | 49 | 50 | Src 51 | 52 | 53 | -------------------------------------------------------------------------------- /extern/DirectXTK/Audio/DirectXTKAudio_Desktop_2012_DXSDK.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 6 | h;hpp;hxx;hm;inl;inc;xsd 7 | 8 | 9 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 10 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 11 | 12 | 13 | 14 | 15 | Inc 16 | 17 | 18 | Inc 19 | 20 | 21 | Inc 22 | 23 | 24 | Inc 25 | 26 | 27 | 28 | 29 | Src 30 | 31 | 32 | Src 33 | 34 | 35 | Src 36 | 37 | 38 | Src 39 | 40 | 41 | Src 42 | 43 | 44 | Src 45 | 46 | 47 | Src 48 | 49 | 50 | Src 51 | 52 | 53 | -------------------------------------------------------------------------------- /extern/DirectXTK/Audio/DirectXTKAudio_Desktop_2012_Win8.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 6 | h;hpp;hxx;hm;inl;inc;xsd 7 | 8 | 9 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 10 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 11 | 12 | 13 | 14 | 15 | Inc 16 | 17 | 18 | Inc 19 | 20 | 21 | Inc 22 | 23 | 24 | Inc 25 | 26 | 27 | 28 | 29 | Src 30 | 31 | 32 | Src 33 | 34 | 35 | Src 36 | 37 | 38 | Src 39 | 40 | 41 | Src 42 | 43 | 44 | Src 45 | 46 | 47 | Src 48 | 49 | 50 | Src 51 | 52 | 53 | -------------------------------------------------------------------------------- /extern/DirectXTK/Audio/DirectXTKAudio_Desktop_2013_DXSDK.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 6 | h;hpp;hxx;hm;inl;inc;xsd 7 | 8 | 9 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 10 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 11 | 12 | 13 | 14 | 15 | Inc 16 | 17 | 18 | Inc 19 | 20 | 21 | Inc 22 | 23 | 24 | Inc 25 | 26 | 27 | 28 | 29 | Src 30 | 31 | 32 | Src 33 | 34 | 35 | Src 36 | 37 | 38 | Src 39 | 40 | 41 | Src 42 | 43 | 44 | Src 45 | 46 | 47 | Src 48 | 49 | 50 | Src 51 | 52 | 53 | -------------------------------------------------------------------------------- /extern/DirectXTK/Audio/DirectXTKAudio_Desktop_2013_Win8.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 6 | h;hpp;hxx;hm;inl;inc;xsd 7 | 8 | 9 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 10 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 11 | 12 | 13 | 14 | 15 | Inc 16 | 17 | 18 | Inc 19 | 20 | 21 | Inc 22 | 23 | 24 | Inc 25 | 26 | 27 | 28 | 29 | Src 30 | 31 | 32 | Src 33 | 34 | 35 | Src 36 | 37 | 38 | Src 39 | 40 | 41 | Src 42 | 43 | 44 | Src 45 | 46 | 47 | Src 48 | 49 | 50 | Src 51 | 52 | 53 | -------------------------------------------------------------------------------- /extern/DirectXTK/Audio/WAVFileReader.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: WAVFileReader.h 3 | // 4 | // Functions for loading WAV audio files 5 | // 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 7 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 8 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 9 | // PARTICULAR PURPOSE. 10 | // 11 | // Copyright (c) Microsoft Corporation. All rights reserved. 12 | // 13 | // http://go.microsoft.com/fwlink/?LinkId=248929 14 | //------------------------------------------------------------------------------------- 15 | 16 | #pragma once 17 | 18 | #pragma warning(push) 19 | #pragma warning(disable : 4005) 20 | #include 21 | #pragma warning(pop) 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | namespace DirectX 29 | { 30 | HRESULT LoadWAVAudioInMemory( _In_reads_bytes_(wavDataSize) const uint8_t* wavData, 31 | _In_ size_t wavDataSize, 32 | _Outptr_ const WAVEFORMATEX** wfx, 33 | _Outptr_ const uint8_t** startAudio, 34 | _Out_ uint32_t* audioBytes ); 35 | 36 | HRESULT LoadWAVAudioFromFile( _In_z_ const wchar_t* szFileName, 37 | _Inout_ std::unique_ptr& wavData, 38 | _Outptr_ const WAVEFORMATEX** wfx, 39 | _Outptr_ const uint8_t** startAudio, 40 | _Out_ uint32_t* audioBytes ); 41 | 42 | struct WAVData 43 | { 44 | const WAVEFORMATEX* wfx; 45 | const uint8_t* startAudio; 46 | uint32_t audioBytes; 47 | uint32_t loopStart; 48 | uint32_t loopLength; 49 | const uint32_t* seek; // Note: XMA Seek data is Big-Endian 50 | uint32_t seekCount; 51 | }; 52 | 53 | HRESULT LoadWAVAudioInMemoryEx( _In_reads_bytes_(wavDataSize) const uint8_t* wavData, 54 | _In_ size_t wavDataSize, _Out_ WAVData& result ); 55 | 56 | HRESULT LoadWAVAudioFromFileEx( _In_z_ const wchar_t* szFileName, 57 | _Inout_ std::unique_ptr& wavData, 58 | _Out_ WAVData& result ); 59 | } -------------------------------------------------------------------------------- /extern/DirectXTK/Audio/WaveBankReader.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: WaveBankReader.h 3 | // 4 | // Functions for loading audio data from Wave Banks 5 | // 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 7 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 8 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 9 | // PARTICULAR PURPOSE. 10 | // 11 | // Copyright (c) Microsoft Corporation. All rights reserved. 12 | // 13 | // http://go.microsoft.com/fwlink/?LinkId=248929 14 | //------------------------------------------------------------------------------------- 15 | 16 | #pragma once 17 | 18 | #pragma warning(push) 19 | #pragma warning(disable : 4005) 20 | #include 21 | #pragma warning(pop) 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | namespace DirectX 29 | { 30 | class WaveBankReader 31 | { 32 | public: 33 | WaveBankReader(); 34 | ~WaveBankReader(); 35 | 36 | HRESULT Open( _In_z_ const wchar_t* szFileName ); 37 | 38 | uint32_t Find( _In_z_ const char* name ) const; 39 | 40 | bool IsPrepared(); 41 | void WaitOnPrepare(); 42 | 43 | bool HasNames() const; 44 | bool IsStreamingBank() const; 45 | 46 | #if defined(_XBOX_ONE) && defined(_TITLE) 47 | bool HasXMA() const; 48 | #endif 49 | 50 | const char* BankName() const; 51 | 52 | uint32_t Count() const; 53 | 54 | uint32_t BankAudioSize() const; 55 | 56 | HRESULT GetFormat( _In_ uint32_t index, _Out_ WAVEFORMATEX* pFormat, _In_ size_t maxsize ) const; 57 | 58 | HRESULT GetWaveData( _In_ uint32_t index, _Outptr_ const uint8_t** pData, _Out_ uint32_t& dataSize ) const; 59 | 60 | HRESULT GetSeekTable( _In_ uint32_t index, _Out_ const uint32_t** pData, _Out_ uint32_t& dataCount, _Out_ uint32_t& tag ) const; 61 | 62 | HANDLE GetAsyncHandle() const; 63 | 64 | struct Metadata 65 | { 66 | uint32_t duration; 67 | uint32_t loopStart; 68 | uint32_t loopLength; 69 | uint32_t offsetBytes; 70 | uint32_t lengthBytes; 71 | }; 72 | HRESULT GetMetadata( _In_ uint32_t index, _Out_ Metadata& metadata ) const; 73 | 74 | private: 75 | // Private implementation. 76 | class Impl; 77 | 78 | std::unique_ptr pImpl; 79 | 80 | // Prevent copying. 81 | WaveBankReader(WaveBankReader const&); 82 | WaveBankReader& operator= (WaveBankReader const&); 83 | }; 84 | } 85 | -------------------------------------------------------------------------------- /extern/DirectXTK/DirectXTK_Desktop_2010.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2010", "DirectXTK_Desktop_2010.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32 18 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64 19 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64 20 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32 21 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32 22 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64 23 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64 24 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU 25 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU 26 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU 27 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU 28 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU 29 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU 30 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU 31 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU 32 | EndGlobalSection 33 | GlobalSection(SolutionProperties) = preSolution 34 | HideSolutionNode = FALSE 35 | EndGlobalSection 36 | EndGlobal 37 | -------------------------------------------------------------------------------- /extern/DirectXTK/DirectXTK_Desktop_2010_DXSDK.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2010", "DirectXTK_Desktop_2010.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2010_DXSDK", "Audio\DirectXTKAudio_Desktop_2010_DXSDK.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xwbtool_Desktop_2010", "XWBTool\xwbtool_Desktop_2010.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Mixed Platforms = Debug|Mixed Platforms 15 | Debug|Win32 = Debug|Win32 16 | Debug|x64 = Debug|x64 17 | Release|Mixed Platforms = Release|Mixed Platforms 18 | Release|Win32 = Release|Win32 19 | Release|x64 = Release|x64 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 23 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|x64 24 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32 25 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32 26 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64 27 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64 28 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|x64 29 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|x64 30 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32 31 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32 32 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64 33 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64 34 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 35 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 36 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU 37 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU 38 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU 39 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU 40 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 41 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU 42 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU 43 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU 44 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU 45 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU 46 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 47 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|x64 48 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32 49 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32 50 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64 51 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64 52 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|x64 53 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|x64 54 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32 55 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32 56 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64 57 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64 58 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 59 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|x64 60 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32 61 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32 62 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64 63 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64 64 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|x64 65 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|x64 66 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32 67 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32 68 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64 69 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64 70 | EndGlobalSection 71 | GlobalSection(SolutionProperties) = preSolution 72 | HideSolutionNode = FALSE 73 | EndGlobalSection 74 | EndGlobal 75 | -------------------------------------------------------------------------------- /extern/DirectXTK/DirectXTK_Desktop_2013.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2013", "DirectXTK_Desktop_2013.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2013_Win8", "Audio\DirectXTKAudio_Desktop_2013_Win8.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XWBTool_Desktop_2013", "XWBTool\XWBTool_Desktop_2013.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Mixed Platforms = Debug|Mixed Platforms 17 | Debug|Win32 = Debug|Win32 18 | Debug|x64 = Debug|x64 19 | Release|Mixed Platforms = Release|Mixed Platforms 20 | Release|Win32 = Release|Win32 21 | Release|x64 = Release|x64 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 25 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 26 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32 27 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32 28 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64 29 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64 30 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 31 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32 32 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32 33 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32 34 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64 35 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64 36 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 37 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 38 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU 39 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU 40 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU 41 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU 42 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 43 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU 44 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU 45 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU 46 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU 47 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU 48 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 49 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32 50 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32 51 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32 52 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64 53 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64 54 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32 55 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32 56 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32 57 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32 58 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64 59 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64 60 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 61 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 62 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32 63 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32 64 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64 65 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64 66 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 67 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32 68 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32 69 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32 70 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64 71 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64 72 | EndGlobalSection 73 | GlobalSection(SolutionProperties) = preSolution 74 | HideSolutionNode = FALSE 75 | EndGlobalSection 76 | EndGlobal 77 | -------------------------------------------------------------------------------- /extern/DirectXTK/DirectXTK_Desktop_2013_DXSDK.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2013", "DirectXTK_Desktop_2013.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2013_DXSDK", "Audio\DirectXTKAudio_Desktop_2013_DXSDK.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xwbtool_Desktop_2013", "XWBTool\xwbtool_Desktop_2013.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Mixed Platforms = Debug|Mixed Platforms 17 | Debug|Win32 = Debug|Win32 18 | Debug|x64 = Debug|x64 19 | Release|Mixed Platforms = Release|Mixed Platforms 20 | Release|Win32 = Release|Win32 21 | Release|x64 = Release|x64 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 25 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 26 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32 27 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32 28 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64 29 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64 30 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 31 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32 32 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32 33 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32 34 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64 35 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64 36 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 37 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 38 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU 39 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU 40 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU 41 | {7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU 42 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 43 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU 44 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU 45 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU 46 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU 47 | {7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU 48 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 49 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32 50 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32 51 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32 52 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64 53 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64 54 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32 55 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32 56 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32 57 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32 58 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64 59 | {4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64 60 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 61 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 62 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32 63 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32 64 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64 65 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64 66 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 67 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32 68 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32 69 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32 70 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64 71 | {C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64 72 | EndGlobalSection 73 | GlobalSection(SolutionProperties) = preSolution 74 | HideSolutionNode = FALSE 75 | EndGlobalSection 76 | EndGlobal 77 | -------------------------------------------------------------------------------- /extern/DirectXTK/DirectXTK_Windows8.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 11 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Windows8", "DirectXTK_Windows8.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|ARM = Debug|ARM 9 | Debug|Win32 = Debug|Win32 10 | Debug|x64 = Debug|x64 11 | Release|ARM = Release|ARM 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.ActiveCfg = Debug|ARM 17 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.Build.0 = Debug|ARM 18 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32 19 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32 20 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64 21 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64 22 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.ActiveCfg = Release|ARM 23 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.Build.0 = Release|ARM 24 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32 25 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32 26 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64 27 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /extern/DirectXTK/DirectXTK_Windows81.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Windows81", "DirectXTK_Windows81.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|ARM = Debug|ARM 11 | Debug|Win32 = Debug|Win32 12 | Debug|x64 = Debug|x64 13 | Release|ARM = Release|ARM 14 | Release|Win32 = Release|Win32 15 | Release|x64 = Release|x64 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.ActiveCfg = Debug|ARM 19 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.Build.0 = Debug|ARM 20 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32 22 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64 23 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64 24 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.ActiveCfg = Release|ARM 25 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.Build.0 = Release|ARM 26 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32 27 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32 28 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64 29 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /extern/DirectXTK/DirectXTK_WindowsPhone8.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Express 2012 for Windows Phone 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_WindowsPhone8", "DirectXTK_WindowsPhone8.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|ARM = Debug|ARM 9 | Debug|Win32 = Debug|Win32 10 | Release|ARM = Release|ARM 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.ActiveCfg = Debug|ARM 15 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.Build.0 = Debug|ARM 16 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32 18 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.ActiveCfg = Release|ARM 19 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.Build.0 = Release|ARM 20 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32 21 | {E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /extern/DirectXTK/DirectXTK_XboxOneADK.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_XboxOneADK", "DirectXTK_XboxOneADK.vcxproj", "{FD9AA386-2D48-41FF-94A7-930AACE17980}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Durango = Debug|Durango 9 | Profile|Durango = Profile|Durango 10 | Release|Durango = Release|Durango 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {FD9AA386-2D48-41FF-94A7-930AACE17980}.Debug|Durango.ActiveCfg = Debug|Durango 14 | {FD9AA386-2D48-41FF-94A7-930AACE17980}.Debug|Durango.Build.0 = Debug|Durango 15 | {FD9AA386-2D48-41FF-94A7-930AACE17980}.Profile|Durango.ActiveCfg = Profile|Durango 16 | {FD9AA386-2D48-41FF-94A7-930AACE17980}.Profile|Durango.Build.0 = Profile|Durango 17 | {FD9AA386-2D48-41FF-94A7-930AACE17980}.Release|Durango.ActiveCfg = Release|Durango 18 | {FD9AA386-2D48-41FF-94A7-930AACE17980}.Release|Durango.Build.0 = Release|Durango 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /extern/DirectXTK/DirectXTK_XboxOneXDK.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_XboxOneXDK", "DirectXTK_XboxOneXDK.vcxproj", "{82343615-EC75-4D49-9AA9-74C8C864D3B4}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug_MonoD3D|Durango = Debug_MonoD3D|Durango 9 | Debug|Durango = Debug|Durango 10 | Profile_MonoD3D|Durango = Profile_MonoD3D|Durango 11 | Profile|Durango = Profile|Durango 12 | Release_MonoD3D|Durango = Release_MonoD3D|Durango 13 | Release|Durango = Release|Durango 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Debug_MonoD3D|Durango.ActiveCfg = Debug_MonoD3D|Durango 17 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Debug_MonoD3D|Durango.Build.0 = Debug_MonoD3D|Durango 18 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Debug|Durango.ActiveCfg = Debug|Durango 19 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Debug|Durango.Build.0 = Debug|Durango 20 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Profile_MonoD3D|Durango.ActiveCfg = Profile_MonoD3D|Durango 21 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Profile_MonoD3D|Durango.Build.0 = Profile_MonoD3D|Durango 22 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Profile|Durango.ActiveCfg = Profile|Durango 23 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Profile|Durango.Build.0 = Profile|Durango 24 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Release_MonoD3D|Durango.ActiveCfg = Release_MonoD3D|Durango 25 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Release_MonoD3D|Durango.Build.0 = Release_MonoD3D|Durango 26 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Release|Durango.ActiveCfg = Release|Durango 27 | {82343615-EC75-4D49-9AA9-74C8C864D3B4}.Release|Durango.Build.0 = Release|Durango 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /extern/DirectXTK/Inc/CommonStates.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: CommonStates.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC 17 | #include 18 | #else 19 | #include 20 | #endif 21 | 22 | #include 23 | 24 | 25 | namespace DirectX 26 | { 27 | class CommonStates 28 | { 29 | public: 30 | explicit CommonStates(_In_ ID3D11Device* device); 31 | CommonStates(CommonStates&& moveFrom); 32 | CommonStates& operator= (CommonStates&& moveFrom); 33 | virtual ~CommonStates(); 34 | 35 | // Blend states. 36 | ID3D11BlendState* Opaque() const; 37 | ID3D11BlendState* AlphaBlend() const; 38 | ID3D11BlendState* Additive() const; 39 | ID3D11BlendState* NonPremultiplied() const; 40 | 41 | // Depth stencil states. 42 | ID3D11DepthStencilState* DepthNone() const; 43 | ID3D11DepthStencilState* DepthDefault() const; 44 | ID3D11DepthStencilState* DepthRead() const; 45 | 46 | // Rasterizer states. 47 | ID3D11RasterizerState* CullNone() const; 48 | ID3D11RasterizerState* CullClockwise() const; 49 | ID3D11RasterizerState* CullCounterClockwise() const; 50 | ID3D11RasterizerState* Wireframe() const; 51 | 52 | // Sampler states. 53 | ID3D11SamplerState* PointWrap() const; 54 | ID3D11SamplerState* PointClamp() const; 55 | ID3D11SamplerState* LinearWrap() const; 56 | ID3D11SamplerState* LinearClamp() const; 57 | ID3D11SamplerState* AnisotropicWrap() const; 58 | ID3D11SamplerState* AnisotropicClamp() const; 59 | 60 | private: 61 | // Private implementation. 62 | class Impl; 63 | 64 | std::shared_ptr pImpl; 65 | 66 | // Prevent copying. 67 | CommonStates(CommonStates const&); 68 | CommonStates& operator= (CommonStates const&); 69 | }; 70 | } 71 | -------------------------------------------------------------------------------- /extern/DirectXTK/Inc/DirectXHelpers.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: DirectXHelpers.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC 17 | #include 18 | #define NO_D3D11_DEBUG_NAME 19 | #else 20 | #include 21 | #endif 22 | 23 | #if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) ) 24 | #pragma comment(lib,"dxguid.lib") 25 | #endif 26 | 27 | #include 28 | 29 | #pragma warning(push) 30 | #pragma warning(disable : 4005) 31 | #include 32 | #pragma warning(pop) 33 | 34 | // 35 | // The core Direct3D headers provide the following helper C++ classes 36 | // CD3D11_RECT 37 | // CD3D11_BOX 38 | // CD3D11_DEPTH_STENCIL_DESC 39 | // CD3D11_BLEND_DESC, CD3D11_BLEND_DESC1 40 | // CD3D11_RASTERIZER_DESC, CD3D11_RASTERIZER_DESC1 41 | // CD3D11_BUFFER_DESC 42 | // CD3D11_TEXTURE1D_DESC 43 | // CD3D11_TEXTURE2D_DESC 44 | // CD3D11_TEXTURE3D_DESC 45 | // CD3D11_SHADER_RESOURCE_VIEW_DESC 46 | // CD3D11_RENDER_TARGET_VIEW_DESC 47 | // CD3D11_VIEWPORT 48 | // CD3D11_DEPTH_STENCIL_VIEW_DESC 49 | // CD3D11_UNORDERED_ACCESS_VIEW_DESC 50 | // CD3D11_SAMPLER_DESC 51 | // CD3D11_QUERY_DESC 52 | // CD3D11_COUNTER_DESC 53 | // 54 | 55 | 56 | namespace DirectX 57 | { 58 | // simliar to std::lock_guard for exception-safe Direct3D 11 resource locking 59 | class MapGuard : public D3D11_MAPPED_SUBRESOURCE 60 | { 61 | public: 62 | MapGuard( _In_ ID3D11DeviceContext* context, 63 | _In_ ID3D11Resource *resource, 64 | _In_ UINT subresource, 65 | _In_ D3D11_MAP mapType, 66 | _In_ UINT mapFlags ) 67 | : mContext(context), mResource(resource), mSubresource(subresource) 68 | { 69 | HRESULT hr = mContext->Map( resource, subresource, mapType, mapFlags, this ); 70 | if (FAILED(hr)) 71 | { 72 | throw std::exception(); 73 | } 74 | } 75 | 76 | ~MapGuard() 77 | { 78 | mContext->Unmap( mResource, mSubresource ); 79 | } 80 | 81 | uint8_t* get() const 82 | { 83 | return reinterpret_cast( pData ); 84 | } 85 | uint8_t* get(size_t slice) const 86 | { 87 | return reinterpret_cast( pData ) + ( slice * DepthPitch ); 88 | } 89 | 90 | uint8_t* scanline(size_t row) const 91 | { 92 | return reinterpret_cast( pData ) + ( row * RowPitch ); 93 | } 94 | uint8_t* scanline(size_t slice, size_t row) const 95 | { 96 | return reinterpret_cast( pData ) + ( slice * DepthPitch ) + ( row * RowPitch ); 97 | } 98 | 99 | private: 100 | ID3D11DeviceContext* mContext; 101 | ID3D11Resource* mResource; 102 | UINT mSubresource; 103 | 104 | MapGuard(MapGuard const&); 105 | MapGuard& operator= (MapGuard const&); 106 | }; 107 | 108 | 109 | // Helper sets a D3D resource name string (used by PIX and debug layer leak reporting). 110 | template 111 | inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_z_ const char (&name)[TNameLength]) 112 | { 113 | #if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) ) 114 | resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name); 115 | #else 116 | UNREFERENCED_PARAMETER(resource); 117 | UNREFERENCED_PARAMETER(name); 118 | #endif 119 | } 120 | } -------------------------------------------------------------------------------- /extern/DirectXTK/Inc/GeometricPrimitive.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: GeometricPrimitive.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC 17 | #include 18 | #else 19 | #include 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | namespace DirectX 29 | { 30 | #if (DIRECTXMATH_VERSION < 305) && !defined(XM_CALLCONV) 31 | #define XM_CALLCONV __fastcall 32 | typedef const XMVECTOR& HXMVECTOR; 33 | typedef const XMMATRIX& FXMMATRIX; 34 | #endif 35 | 36 | class IEffect; 37 | 38 | class GeometricPrimitive 39 | { 40 | public: 41 | ~GeometricPrimitive(); 42 | 43 | // Factory methods. 44 | static std::unique_ptr CreateCube (_In_ ID3D11DeviceContext* deviceContext, float size = 1, bool rhcoords = true); 45 | static std::unique_ptr CreateSphere (_In_ ID3D11DeviceContext* deviceContext, float diameter = 1, size_t tessellation = 16, bool rhcoords = true); 46 | static std::unique_ptr CreateGeoSphere (_In_ ID3D11DeviceContext* deviceContext, float diameter = 1, size_t tessellation = 3, bool rhcoords = true); 47 | static std::unique_ptr CreateCylinder (_In_ ID3D11DeviceContext* deviceContext, float height = 1, float diameter = 1, size_t tessellation = 32, bool rhcoords = true); 48 | static std::unique_ptr CreateCone (_In_ ID3D11DeviceContext* deviceContext, float diameter = 1, float height = 1, size_t tessellation = 32, bool rhcoords = true); 49 | static std::unique_ptr CreateTorus (_In_ ID3D11DeviceContext* deviceContext, float diameter = 1, float thickness = 0.333f, size_t tessellation = 32, bool rhcoords = true); 50 | static std::unique_ptr CreateTetrahedron (_In_ ID3D11DeviceContext* deviceContext, float size = 1, bool rhcoords = true); 51 | static std::unique_ptr CreateOctahedron (_In_ ID3D11DeviceContext* deviceContext, float size = 1, bool rhcoords = true); 52 | static std::unique_ptr CreateDodecahedron (_In_ ID3D11DeviceContext* deviceContext, float size = 1, bool rhcoords = true); 53 | static std::unique_ptr CreateIcosahedron (_In_ ID3D11DeviceContext* deviceContext, float size = 1, bool rhcoords = true); 54 | static std::unique_ptr CreateTeapot (_In_ ID3D11DeviceContext* deviceContext, float size = 1, size_t tessellation = 8, bool rhcoords = true); 55 | 56 | // Draw the primitive. 57 | void XM_CALLCONV Draw(FXMMATRIX world, CXMMATRIX view, CXMMATRIX projection, FXMVECTOR color = Colors::White, _In_opt_ ID3D11ShaderResourceView* texture = nullptr, bool wireframe = false, _In_opt_ std::function setCustomState = nullptr); 58 | 59 | // Draw the primitive using a custom effect. 60 | void Draw( _In_ IEffect* effect, _In_ ID3D11InputLayout* inputLayout, bool alpha = false, bool wireframe = false, _In_opt_ std::function setCustomState = nullptr ); 61 | 62 | // Create input layout for drawing with a custom effect. 63 | void CreateInputLayout( _In_ IEffect* effect, _Outptr_ ID3D11InputLayout** inputLayout ); 64 | 65 | private: 66 | GeometricPrimitive(); 67 | 68 | // Private implementation. 69 | class Impl; 70 | 71 | std::unique_ptr pImpl; 72 | 73 | // Prevent copying. 74 | GeometricPrimitive(GeometricPrimitive const&); 75 | GeometricPrimitive& operator= (GeometricPrimitive const&); 76 | }; 77 | } 78 | -------------------------------------------------------------------------------- /extern/DirectXTK/Inc/ScreenGrab.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: ScreenGrab.h 3 | // 4 | // Function for capturing a 2D texture and saving it to a file (aka a 'screenshot' 5 | // when used on a Direct3D 11 Render Target). 6 | // 7 | // Note these functions are useful as a light-weight runtime screen grabber. For 8 | // full-featured texture capture, DDS writer, and texture processing pipeline, 9 | // see the 'Texconv' sample and the 'DirectXTex' library. 10 | // 11 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 12 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 13 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 14 | // PARTICULAR PURPOSE. 15 | // 16 | // Copyright (c) Microsoft Corporation. All rights reserved. 17 | // 18 | // http://go.microsoft.com/fwlink/?LinkId=248926 19 | // http://go.microsoft.com/fwlink/?LinkId=248929 20 | //-------------------------------------------------------------------------------------- 21 | 22 | #ifdef _MSC_VER 23 | #pragma once 24 | #endif 25 | 26 | #if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC 27 | #include 28 | #else 29 | #include 30 | #endif 31 | 32 | #include 33 | 34 | #pragma warning(push) 35 | #pragma warning(disable : 4005) 36 | #include 37 | #pragma warning(pop) 38 | 39 | #include 40 | 41 | namespace DirectX 42 | { 43 | HRESULT SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext, 44 | _In_ ID3D11Resource* pSource, 45 | _In_z_ LPCWSTR fileName ); 46 | 47 | #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) 48 | 49 | HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext, 50 | _In_ ID3D11Resource* pSource, 51 | _In_ REFGUID guidContainerFormat, 52 | _In_z_ LPCWSTR fileName, 53 | _In_opt_ const GUID* targetFormat = nullptr, 54 | _In_opt_ std::function setCustomProps = nullptr ); 55 | 56 | #endif 57 | } -------------------------------------------------------------------------------- /extern/DirectXTK/Inc/SpriteBatch.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: SpriteBatch.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC 17 | #include 18 | #else 19 | #include 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | namespace DirectX 29 | { 30 | #if (DIRECTXMATH_VERSION < 305) && !defined(XM_CALLCONV) 31 | #define XM_CALLCONV __fastcall 32 | typedef const XMVECTOR& HXMVECTOR; 33 | typedef const XMMATRIX& FXMMATRIX; 34 | #endif 35 | 36 | enum SpriteSortMode 37 | { 38 | SpriteSortMode_Deferred, 39 | SpriteSortMode_Immediate, 40 | SpriteSortMode_Texture, 41 | SpriteSortMode_BackToFront, 42 | SpriteSortMode_FrontToBack, 43 | }; 44 | 45 | 46 | enum SpriteEffects 47 | { 48 | SpriteEffects_None = 0, 49 | SpriteEffects_FlipHorizontally = 1, 50 | SpriteEffects_FlipVertically = 2, 51 | SpriteEffects_FlipBoth = SpriteEffects_FlipHorizontally | SpriteEffects_FlipVertically, 52 | }; 53 | 54 | 55 | class SpriteBatch 56 | { 57 | public: 58 | explicit SpriteBatch(_In_ ID3D11DeviceContext* deviceContext); 59 | SpriteBatch(SpriteBatch&& moveFrom); 60 | SpriteBatch& operator= (SpriteBatch&& moveFrom); 61 | virtual ~SpriteBatch(); 62 | 63 | // Begin/End a batch of sprite drawing operations. 64 | void XM_CALLCONV Begin(SpriteSortMode sortMode = SpriteSortMode_Deferred, _In_opt_ ID3D11BlendState* blendState = nullptr, _In_opt_ ID3D11SamplerState* samplerState = nullptr, _In_opt_ ID3D11DepthStencilState* depthStencilState = nullptr, _In_opt_ ID3D11RasterizerState* rasterizerState = nullptr, _In_opt_ std::function setCustomShaders = nullptr, FXMMATRIX transformMatrix = MatrixIdentity); 65 | void End(); 66 | 67 | // Draw overloads specifying position, origin and scale as XMFLOAT2. 68 | void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, FXMVECTOR color = Colors::White); 69 | void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, XMFLOAT2 const& origin = Float2Zero, float scale = 1, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0); 70 | void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color, float rotation, XMFLOAT2 const& origin, XMFLOAT2 const& scale, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0); 71 | 72 | // Draw overloads specifying position, origin and scale via the first two components of an XMVECTOR. 73 | void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, FXMVECTOR color = Colors::White); 74 | void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, FXMVECTOR origin = g_XMZero, float scale = 1, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0); 75 | void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color, float rotation, FXMVECTOR origin, GXMVECTOR scale, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0); 76 | 77 | // Draw overloads specifying position as a RECT. 78 | void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, RECT const& destinationRectangle, FXMVECTOR color = Colors::White); 79 | void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, RECT const& destinationRectangle, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, XMFLOAT2 const& origin = Float2Zero, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0); 80 | 81 | // Rotation mode to be applied to the sprite transformation 82 | void SetRotation( DXGI_MODE_ROTATION mode ); 83 | DXGI_MODE_ROTATION GetRotation() const; 84 | 85 | private: 86 | // Private implementation. 87 | class Impl; 88 | 89 | std::unique_ptr pImpl; 90 | 91 | static const XMMATRIX MatrixIdentity; 92 | static const XMFLOAT2 Float2Zero; 93 | 94 | // Prevent copying. 95 | SpriteBatch(SpriteBatch const&); 96 | SpriteBatch& operator= (SpriteBatch const&); 97 | }; 98 | } 99 | -------------------------------------------------------------------------------- /extern/DirectXTK/Inc/SpriteFont.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: SpriteFont.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #include "SpriteBatch.h" 17 | 18 | 19 | namespace DirectX 20 | { 21 | class SpriteFont 22 | { 23 | public: 24 | struct Glyph; 25 | 26 | SpriteFont(_In_ ID3D11Device* device, _In_z_ wchar_t const* fileName); 27 | SpriteFont(_In_ ID3D11Device* device, _In_reads_bytes_(dataSize) uint8_t const* dataBlob, _In_ size_t dataSize); 28 | SpriteFont(_In_ ID3D11ShaderResourceView* texture, _In_reads_(glyphCount) Glyph const* glyphs, _In_ size_t glyphCount, _In_ float lineSpacing); 29 | 30 | SpriteFont(SpriteFont&& moveFrom); 31 | SpriteFont& operator= (SpriteFont&& moveFrom); 32 | virtual ~SpriteFont(); 33 | 34 | void XM_CALLCONV DrawString(_In_ SpriteBatch* spriteBatch, _In_z_ wchar_t const* text, XMFLOAT2 const& position, FXMVECTOR color = Colors::White, float rotation = 0, XMFLOAT2 const& origin = Float2Zero, float scale = 1, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0); 35 | void XM_CALLCONV DrawString(_In_ SpriteBatch* spriteBatch, _In_z_ wchar_t const* text, XMFLOAT2 const& position, FXMVECTOR color, float rotation, XMFLOAT2 const& origin, XMFLOAT2 const& scale, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0); 36 | void XM_CALLCONV DrawString(_In_ SpriteBatch* spriteBatch, _In_z_ wchar_t const* text, FXMVECTOR position, FXMVECTOR color = Colors::White, float rotation = 0, FXMVECTOR origin = g_XMZero, float scale = 1, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0); 37 | void XM_CALLCONV DrawString(_In_ SpriteBatch* spriteBatch, _In_z_ wchar_t const* text, FXMVECTOR position, FXMVECTOR color, float rotation, FXMVECTOR origin, GXMVECTOR scale, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0); 38 | 39 | XMVECTOR MeasureString(_In_z_ wchar_t const* text) const; 40 | 41 | float GetLineSpacing() const; 42 | void SetLineSpacing(float spacing); 43 | 44 | wchar_t GetDefaultCharacter() const; 45 | void SetDefaultCharacter(wchar_t character); 46 | 47 | bool ContainsCharacter(wchar_t character) const; 48 | 49 | 50 | // Describes a single character glyph. 51 | struct Glyph 52 | { 53 | uint32_t Character; 54 | RECT Subrect; 55 | float XOffset; 56 | float YOffset; 57 | float XAdvance; 58 | }; 59 | 60 | 61 | private: 62 | // Private implementation. 63 | class Impl; 64 | 65 | std::unique_ptr pImpl; 66 | 67 | static const XMFLOAT2 Float2Zero; 68 | 69 | // Prevent copying. 70 | SpriteFont(SpriteFont const&); 71 | SpriteFont& operator= (SpriteFont const&); 72 | }; 73 | } 74 | -------------------------------------------------------------------------------- /extern/DirectXTK/Inc/XboxDDSTextureLoader.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: XboxDDSTextureLoader.h 3 | // 4 | // Functions for loading a DDS texture using the XBOX extended header and creating a 5 | // Direct3D11.X runtime resource for it via the CreatePlacement APIs 6 | // 7 | // Note these functions will not load standard DDS files. Use the DDSTextureLoader 8 | // module in the DirectXTex package or as part of the DirectXTK library to load 9 | // these files which use standard Direct3D 11 resource creation APIs. 10 | // 11 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 12 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 13 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 14 | // PARTICULAR PURPOSE. 15 | // 16 | // Copyright (c) Microsoft Corporation. All rights reserved. 17 | // 18 | // http://go.microsoft.com/fwlink/?LinkId=248926 19 | // http://go.microsoft.com/fwlink/?LinkId=248929 20 | //-------------------------------------------------------------------------------------- 21 | 22 | #ifdef _MSC_VER 23 | #pragma once 24 | #endif 25 | 26 | #if !defined(_XBOX_ONE) || !defined(_TITLE) 27 | #error This module only supports Xbox One exclusive apps 28 | #endif 29 | 30 | #if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC 31 | #include 32 | #else 33 | #include 34 | #endif 35 | 36 | #include 37 | 38 | namespace Xbox 39 | { 40 | enum DDS_ALPHA_MODE 41 | { 42 | DDS_ALPHA_MODE_UNKNOWN = 0, 43 | DDS_ALPHA_MODE_STRAIGHT = 1, 44 | DDS_ALPHA_MODE_PREMULTIPLIED = 2, 45 | DDS_ALPHA_MODE_OPAQUE = 3, 46 | DDS_ALPHA_MODE_CUSTOM = 4, 47 | }; 48 | 49 | HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device1* d3dDevice, 50 | _In_ ID3DXboxPerformanceDevice* perfDevice, 51 | _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData, 52 | _In_ size_t ddsDataSize, 53 | _Outptr_opt_ ID3D11Resource** texture, 54 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 55 | _Outptr_ void** grfxMemory, 56 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr, 57 | _In_ bool forceSRGB = false 58 | ); 59 | 60 | HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device1* d3dDevice, 61 | _In_ ID3DXboxPerformanceDevice* perfDevice, 62 | _In_z_ const wchar_t* szFileName, 63 | _Outptr_opt_ ID3D11Resource** texture, 64 | _Outptr_opt_ ID3D11ShaderResourceView** textureView, 65 | _Outptr_ void** grfxMemory, 66 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr, 67 | _In_ bool forceSRGB = false 68 | ); 69 | } -------------------------------------------------------------------------------- /extern/DirectXTK/MakeSpriteFont/BitmapImporter.cs: -------------------------------------------------------------------------------- 1 | // DirectXTK MakeSpriteFont tool 2 | // 3 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 4 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 5 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 6 | // PARTICULAR PURPOSE. 7 | // 8 | // Copyright (c) Microsoft Corporation. All rights reserved. 9 | // 10 | // http://go.microsoft.com/fwlink/?LinkId=248929 11 | 12 | using System; 13 | using System.Linq; 14 | using System.Collections.Generic; 15 | using System.Drawing; 16 | using System.Drawing.Imaging; 17 | 18 | namespace MakeSpriteFont 19 | { 20 | // Extracts font glyphs from a specially marked 2D bitmap. Characters should be 21 | // arranged in a grid ordered from top left to bottom right. Monochrome characters 22 | // should use white for solid areas and black for transparent areas. To include 23 | // multicolored characters, add an alpha channel to the bitmap and use that to 24 | // control which parts of the character are solid. The spaces between characters 25 | // and around the edges of the grid should be filled with bright pink (red=255, 26 | // green=0, blue=255). It doesn't matter if your grid includes lots of wasted space, 27 | // because the converter will rearrange characters, packing as tightly as possible. 28 | public class BitmapImporter : IFontImporter 29 | { 30 | // Properties hold the imported font data. 31 | public IEnumerable Glyphs { get; private set; } 32 | 33 | public float LineSpacing { get; private set; } 34 | 35 | 36 | public void Import(CommandLineOptions options) 37 | { 38 | // Load the source bitmap. 39 | Bitmap bitmap; 40 | 41 | try 42 | { 43 | bitmap = new Bitmap(options.SourceFont); 44 | } 45 | catch 46 | { 47 | throw new Exception(string.Format("Unable to load '{0}'.", options.SourceFont)); 48 | } 49 | 50 | // Convert to our desired pixel format. 51 | bitmap = BitmapUtils.ChangePixelFormat(bitmap, PixelFormat.Format32bppArgb); 52 | 53 | // What characters are included in this font? 54 | var characters = CharacterRegion.Flatten(options.CharacterRegions).ToArray(); 55 | int characterIndex = 0; 56 | char currentCharacter = '\0'; 57 | 58 | // Split the source image into a list of individual glyphs. 59 | var glyphList = new List(); 60 | 61 | Glyphs = glyphList; 62 | LineSpacing = 0; 63 | 64 | foreach (Rectangle rectangle in FindGlyphs(bitmap)) 65 | { 66 | if (characterIndex < characters.Length) 67 | currentCharacter = characters[characterIndex++]; 68 | else 69 | currentCharacter++; 70 | 71 | glyphList.Add(new Glyph(currentCharacter, bitmap, rectangle)); 72 | 73 | LineSpacing = Math.Max(LineSpacing, rectangle.Height); 74 | } 75 | 76 | // If the bitmap doesn't already have an alpha channel, create one now. 77 | if (BitmapUtils.IsAlphaEntirely(255, bitmap)) 78 | { 79 | BitmapUtils.ConvertGreyToAlpha(bitmap); 80 | } 81 | } 82 | 83 | 84 | // Searches a 2D bitmap for characters that are surrounded by a marker pink color. 85 | static IEnumerable FindGlyphs(Bitmap bitmap) 86 | { 87 | using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly)) 88 | { 89 | for (int y = 1; y < bitmap.Height; y++) 90 | { 91 | for (int x = 1; x < bitmap.Width; x++) 92 | { 93 | // Look for the top left corner of a character (a pixel that is not pink, but was pink immediately to the left and above it) 94 | if (!IsMarkerColor(bitmapData[x, y]) && 95 | IsMarkerColor(bitmapData[x - 1, y]) && 96 | IsMarkerColor(bitmapData[x, y - 1])) 97 | { 98 | // Measure the size of this character. 99 | int w = 1, h = 1; 100 | 101 | while ((x + w < bitmap.Width) && !IsMarkerColor(bitmapData[x + w, y])) 102 | { 103 | w++; 104 | } 105 | 106 | while ((y + h < bitmap.Height) && !IsMarkerColor(bitmapData[x, y + h])) 107 | { 108 | h++; 109 | } 110 | 111 | yield return new Rectangle(x, y, w, h); 112 | } 113 | } 114 | } 115 | } 116 | } 117 | 118 | 119 | // Checks whether a color is the magic magenta marker value. 120 | static bool IsMarkerColor(Color color) 121 | { 122 | return color.ToArgb() == Color.Magenta.ToArgb(); 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /extern/DirectXTK/MakeSpriteFont/CharacterRegion.cs: -------------------------------------------------------------------------------- 1 | // DirectXTK MakeSpriteFont tool 2 | // 3 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 4 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 5 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 6 | // PARTICULAR PURPOSE. 7 | // 8 | // Copyright (c) Microsoft Corporation. All rights reserved. 9 | // 10 | // http://go.microsoft.com/fwlink/?LinkId=248929 11 | 12 | using System; 13 | using System.Linq; 14 | using System.ComponentModel; 15 | using System.Globalization; 16 | using System.Collections.Generic; 17 | 18 | namespace MakeSpriteFont 19 | { 20 | // Describes a range of consecutive characters that should be included in the font. 21 | [TypeConverter(typeof(CharacterRegionTypeConverter))] 22 | public class CharacterRegion 23 | { 24 | // Constructor. 25 | public CharacterRegion(char start, char end) 26 | { 27 | if (start > end) 28 | throw new ArgumentException(); 29 | 30 | this.Start = start; 31 | this.End = end; 32 | } 33 | 34 | 35 | // Fields. 36 | public char Start; 37 | public char End; 38 | 39 | 40 | // Enumerates all characters within the region. 41 | public IEnumerable Characters 42 | { 43 | get 44 | { 45 | for (char c = Start; c <= End; c++) 46 | { 47 | yield return c; 48 | } 49 | } 50 | } 51 | 52 | 53 | // Flattens a list of character regions into a combined list of individual characters. 54 | public static IEnumerable Flatten(IEnumerable regions) 55 | { 56 | if (regions.Any()) 57 | { 58 | // If we have any regions, flatten them and remove duplicates. 59 | return regions.SelectMany(region => region.Characters).Distinct(); 60 | } 61 | else 62 | { 63 | // If no regions were specified, use the default. 64 | return defaultRegion.Characters; 65 | } 66 | } 67 | 68 | 69 | // Default to just the base ASCII character set. 70 | static CharacterRegion defaultRegion = new CharacterRegion(' ', '~'); 71 | } 72 | 73 | 74 | 75 | // Custom type converter enables CommandLineParser to parse CharacterRegion command line options. 76 | public class CharacterRegionTypeConverter : TypeConverter 77 | { 78 | public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) 79 | { 80 | return sourceType == typeof(string); 81 | } 82 | 83 | 84 | public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) 85 | { 86 | // Input must be a string. 87 | string source = value as string; 88 | 89 | if (string.IsNullOrEmpty(source)) 90 | { 91 | throw new ArgumentException(); 92 | } 93 | 94 | // Supported input formats: 95 | // A 96 | // A-Z 97 | // 32-127 98 | // 0x20-0x7F 99 | 100 | char[] split = source.Split('-') 101 | .Select(ConvertCharacter) 102 | .ToArray(); 103 | 104 | switch (split.Length) 105 | { 106 | case 1: 107 | // Only a single character (eg. "a"). 108 | return new CharacterRegion(split[0], split[0]); 109 | 110 | case 2: 111 | // Range of characters (eg. "a-z"). 112 | return new CharacterRegion(split[0], split[1]); 113 | 114 | default: 115 | throw new ArgumentException(); 116 | } 117 | } 118 | 119 | 120 | static char ConvertCharacter(string value) 121 | { 122 | if (value.Length == 1) 123 | { 124 | // Single character directly specifies a codepoint. 125 | return value[0]; 126 | } 127 | else 128 | { 129 | // Otherwise it must be an integer (eg. "32" or "0x20"). 130 | return (char)(int)intConverter.ConvertFromInvariantString(value); 131 | } 132 | } 133 | 134 | 135 | static TypeConverter intConverter = TypeDescriptor.GetConverter(typeof(int)); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /extern/DirectXTK/MakeSpriteFont/CommandLineOptions.cs: -------------------------------------------------------------------------------- 1 | // DirectXTK MakeSpriteFont tool 2 | // 3 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 4 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 5 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 6 | // PARTICULAR PURPOSE. 7 | // 8 | // Copyright (c) Microsoft Corporation. All rights reserved. 9 | // 10 | // http://go.microsoft.com/fwlink/?LinkId=248929 11 | 12 | using System.Collections.Generic; 13 | using System.Drawing; 14 | 15 | namespace MakeSpriteFont 16 | { 17 | // Available output texture formats. 18 | public enum TextureFormat 19 | { 20 | Auto, 21 | Rgba32, 22 | Bgra4444, 23 | CompressedMono, 24 | } 25 | 26 | 27 | // Options telling the tool what to do. 28 | public class CommandLineOptions 29 | { 30 | // Input can be either a system (TrueType) font or a specially marked bitmap file. 31 | [CommandLineParser.Required] 32 | public string SourceFont; 33 | 34 | 35 | // Output spritefont binary. 36 | [CommandLineParser.Required] 37 | public string OutputFile; 38 | 39 | 40 | // Which characters to include in the font (eg. "/CharacterRegion:0x20-0x7F /CharacterRegion:0x123") 41 | [CommandLineParser.Name("CharacterRegion")] 42 | public readonly List CharacterRegions = new List(); 43 | 44 | 45 | // Fallback character used when asked to render a codepoint that is not 46 | // included in the font. If zero, missing characters throw exceptions. 47 | public readonly int DefaultCharacter = 0; 48 | 49 | 50 | // Size and style for TrueType fonts (ignored when converting a bitmap font). 51 | public float FontSize = 23; 52 | 53 | public FontStyle FontStyle = FontStyle.Regular; 54 | 55 | 56 | // Spacing overrides. Zero is default spacing, negative closer together, positive further apart. 57 | public float LineSpacing = 0; 58 | public float CharacterSpacing = 0; 59 | 60 | 61 | // Use smooth or sharp antialiasing mode for TrueType rasterization? 62 | public bool Sharp = false; 63 | 64 | 65 | // What format should the output texture be? 66 | public TextureFormat TextureFormat = TextureFormat.Auto; 67 | 68 | 69 | // By default, font textures use premultiplied alpha format. Set this if you want interpolative alpha instead. 70 | public bool NoPremultiply = false; 71 | 72 | 73 | // Dumps the generated sprite texture to a bitmap file (useful for debugging). 74 | public string DebugOutputSpriteSheet = null; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /extern/DirectXTK/MakeSpriteFont/Glyph.cs: -------------------------------------------------------------------------------- 1 | // DirectXTK MakeSpriteFont tool 2 | // 3 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 4 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 5 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 6 | // PARTICULAR PURPOSE. 7 | // 8 | // Copyright (c) Microsoft Corporation. All rights reserved. 9 | // 10 | // http://go.microsoft.com/fwlink/?LinkId=248929 11 | 12 | using System.Drawing; 13 | 14 | namespace MakeSpriteFont 15 | { 16 | // Represents a single character within a font. 17 | public class Glyph 18 | { 19 | // Constructor. 20 | public Glyph(char character, Bitmap bitmap, Rectangle? subrect = null) 21 | { 22 | this.Character = character; 23 | this.Bitmap = bitmap; 24 | this.Subrect = subrect.GetValueOrDefault(new Rectangle(0, 0, bitmap.Width, bitmap.Height)); 25 | } 26 | 27 | 28 | // Unicode codepoint. 29 | public char Character; 30 | 31 | 32 | // Glyph image data (may only use a portion of a larger bitmap). 33 | public Bitmap Bitmap; 34 | public Rectangle Subrect; 35 | 36 | 37 | // Layout information. 38 | public float XOffset; 39 | public float YOffset; 40 | 41 | public float XAdvance; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /extern/DirectXTK/MakeSpriteFont/GlyphCropper.cs: -------------------------------------------------------------------------------- 1 | // DirectXTK MakeSpriteFont tool 2 | // 3 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 4 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 5 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 6 | // PARTICULAR PURPOSE. 7 | // 8 | // Copyright (c) Microsoft Corporation. All rights reserved. 9 | // 10 | // http://go.microsoft.com/fwlink/?LinkId=248929 11 | 12 | using System.Drawing; 13 | 14 | namespace MakeSpriteFont 15 | { 16 | // Crops unused space from around the edge of a glyph bitmap. 17 | public static class GlyphCropper 18 | { 19 | public static void Crop(Glyph glyph) 20 | { 21 | // Crop the top. 22 | while ((glyph.Subrect.Height > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Y, glyph.Subrect.Width, 1))) 23 | { 24 | glyph.Subrect.Y++; 25 | glyph.Subrect.Height--; 26 | 27 | glyph.YOffset++; 28 | } 29 | 30 | // Crop the bottom. 31 | while ((glyph.Subrect.Height > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Bottom - 1, glyph.Subrect.Width, 1))) 32 | { 33 | glyph.Subrect.Height--; 34 | } 35 | 36 | // Crop the left. 37 | while ((glyph.Subrect.Width > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Y, 1, glyph.Subrect.Height))) 38 | { 39 | glyph.Subrect.X++; 40 | glyph.Subrect.Width--; 41 | 42 | glyph.XOffset++; 43 | } 44 | 45 | // Crop the right. 46 | while ((glyph.Subrect.Width > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.Right - 1, glyph.Subrect.Y, 1, glyph.Subrect.Height))) 47 | { 48 | glyph.Subrect.Width--; 49 | 50 | glyph.XAdvance++; 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /extern/DirectXTK/MakeSpriteFont/IFontImporter.cs: -------------------------------------------------------------------------------- 1 | // DirectXTK MakeSpriteFont tool 2 | // 3 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 4 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 5 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 6 | // PARTICULAR PURPOSE. 7 | // 8 | // Copyright (c) Microsoft Corporation. All rights reserved. 9 | // 10 | // http://go.microsoft.com/fwlink/?LinkId=248929 11 | 12 | using System.Collections.Generic; 13 | 14 | namespace MakeSpriteFont 15 | { 16 | // Importer interface allows the conversion tool to support multiple source font formats. 17 | public interface IFontImporter 18 | { 19 | void Import(CommandLineOptions options); 20 | 21 | IEnumerable Glyphs { get; } 22 | 23 | float LineSpacing { get; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /extern/DirectXTK/MakeSpriteFont/MakeSpriteFont.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {7329B02D-C504-482A-A156-181D48CE493C} 9 | Exe 10 | Properties 11 | MakeSpriteFont 12 | MakeSpriteFont 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | true 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | full 22 | AnyCPU 23 | prompt 24 | 25 | 26 | bin\Release\ 27 | TRACE 28 | true 29 | pdbonly 30 | AnyCPU 31 | prompt 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 60 | -------------------------------------------------------------------------------- /extern/DirectXTK/MakeSpriteFont/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | // 8 | // http://go.microsoft.com/fwlink/?LinkId=248929 9 | 10 | using System.Reflection; 11 | using System.Runtime.CompilerServices; 12 | using System.Runtime.InteropServices; 13 | 14 | // General Information about an assembly is controlled through the following 15 | // set of attributes. Change these attribute values to modify the information 16 | // associated with an assembly. 17 | [assembly: AssemblyTitle("MakeSpriteFont")] 18 | [assembly: AssemblyDescription("")] 19 | [assembly: AssemblyConfiguration("")] 20 | [assembly: AssemblyCompany("Microsoft Corporation")] 21 | [assembly: AssemblyProduct("MakeSpriteFont")] 22 | [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved")] 23 | [assembly: AssemblyTrademark("")] 24 | [assembly: AssemblyCulture("")] 25 | 26 | // Setting ComVisible to false makes the types in this assembly not visible 27 | // to COM components. If you need to access a type in this assembly from 28 | // COM, set the ComVisible attribute to true on that type. 29 | [assembly: ComVisible(false)] 30 | 31 | // The following GUID is for the ID of the typelib if this project is exposed to COM 32 | [assembly: Guid("12c0da00-f622-41f2-ab8f-1b4e19aa2a6f")] 33 | 34 | // Version information for an assembly consists of the following four values: 35 | // 36 | // Major Version 37 | // Minor Version 38 | // Build Number 39 | // Revision 40 | // 41 | // You can specify all the values or you can default the Build and Revision Numbers 42 | // by using the '*' as shown below: 43 | // [assembly: AssemblyVersion("1.0.*")] 44 | [assembly: AssemblyVersion("1.0.0.0")] 45 | [assembly: AssemblyFileVersion("1.0.0.0")] 46 | -------------------------------------------------------------------------------- /extern/DirectXTK/Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/extern/DirectXTK/Readme.txt -------------------------------------------------------------------------------- /extern/DirectXTK/Src/AlignedNew.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: AlignedNew.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #include 17 | #include 18 | 19 | 20 | namespace DirectX 21 | { 22 | // Derive from this to customize operator new and delete for 23 | // types that have special heap alignment requirements. 24 | // 25 | // Example usage: 26 | // 27 | // __declspec(align(16)) struct MyAlignedType : public AlignedNew 28 | 29 | template 30 | struct AlignedNew 31 | { 32 | // Allocate aligned memory. 33 | static void* operator new (size_t size) 34 | { 35 | const size_t alignment = __alignof(TDerived); 36 | 37 | static_assert(alignment > 8, "AlignedNew is only useful for types with > 8 byte alignment. Did you forget a __declspec(align) on TDerived?"); 38 | 39 | void* ptr = _aligned_malloc(size, alignment); 40 | 41 | if (!ptr) 42 | throw std::bad_alloc(); 43 | 44 | return ptr; 45 | } 46 | 47 | 48 | // Free aligned memory. 49 | static void operator delete (void* ptr) 50 | { 51 | _aligned_free(ptr); 52 | } 53 | 54 | 55 | // Array overloads. 56 | static void* operator new[] (size_t size) 57 | { 58 | return operator new(size); 59 | } 60 | 61 | 62 | static void operator delete[] (void* ptr) 63 | { 64 | operator delete(ptr); 65 | } 66 | }; 67 | } 68 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/BinaryReader.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: BinaryReader.cpp 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #include "pch.h" 15 | 16 | #include "BinaryReader.h" 17 | 18 | using namespace DirectX; 19 | 20 | 21 | // Constructor reads from the filesystem. 22 | BinaryReader::BinaryReader(_In_z_ wchar_t const* fileName) 23 | { 24 | size_t dataSize; 25 | 26 | HRESULT hr = ReadEntireFile(fileName, mOwnedData, &dataSize); 27 | if ( FAILED(hr) ) 28 | { 29 | DebugTrace( "BinaryReader failed (%08X) to load '%S'\n", hr, fileName ); 30 | throw std::exception( "BinaryReader" ); 31 | } 32 | 33 | mPos = mOwnedData.get(); 34 | mEnd = mOwnedData.get() + dataSize; 35 | } 36 | 37 | 38 | // Constructor reads from an existing memory buffer. 39 | BinaryReader::BinaryReader(_In_reads_bytes_(dataSize) uint8_t const* dataBlob, size_t dataSize) 40 | { 41 | mPos = dataBlob; 42 | mEnd = dataBlob + dataSize; 43 | } 44 | 45 | 46 | // Reads from the filesystem into memory. 47 | HRESULT BinaryReader::ReadEntireFile(_In_z_ wchar_t const* fileName, _Inout_ std::unique_ptr& data, _Out_ size_t* dataSize) 48 | { 49 | // Open the file. 50 | #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) 51 | ScopedHandle hFile(safe_handle(CreateFile2(fileName, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr))); 52 | #else 53 | ScopedHandle hFile(safe_handle(CreateFileW(fileName, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr))); 54 | #endif 55 | 56 | if (!hFile) 57 | return HRESULT_FROM_WIN32(GetLastError()); 58 | 59 | // Get the file size. 60 | LARGE_INTEGER fileSize = { 0 }; 61 | 62 | #if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) 63 | FILE_STANDARD_INFO fileInfo; 64 | 65 | if (!GetFileInformationByHandleEx(hFile.get(), FileStandardInfo, &fileInfo, sizeof(fileInfo))) 66 | { 67 | return HRESULT_FROM_WIN32(GetLastError()); 68 | } 69 | 70 | fileSize = fileInfo.EndOfFile; 71 | #else 72 | GetFileSizeEx(hFile.get(), &fileSize); 73 | #endif 74 | 75 | // File is too big for 32-bit allocation, so reject read. 76 | if (fileSize.HighPart > 0) 77 | return E_FAIL; 78 | 79 | // Create enough space for the file data. 80 | data.reset(new uint8_t[fileSize.LowPart]); 81 | 82 | if (!data) 83 | return E_OUTOFMEMORY; 84 | 85 | // Read the data in. 86 | DWORD bytesRead = 0; 87 | 88 | if (!ReadFile(hFile.get(), data.get(), fileSize.LowPart, &bytesRead, nullptr)) 89 | { 90 | return HRESULT_FROM_WIN32(GetLastError()); 91 | } 92 | 93 | if (bytesRead < fileSize.LowPart) 94 | return E_FAIL; 95 | 96 | *dataSize = bytesRead; 97 | 98 | return S_OK; 99 | } 100 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/BinaryReader.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: BinaryReader.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include "PlatformHelpers.h" 21 | 22 | 23 | namespace DirectX 24 | { 25 | // Helper for reading binary data, either from the filesystem a memory buffer. 26 | class BinaryReader 27 | { 28 | public: 29 | explicit BinaryReader(_In_z_ wchar_t const* fileName); 30 | BinaryReader(_In_reads_bytes_(dataSize) uint8_t const* dataBlob, size_t dataSize); 31 | 32 | 33 | // Reads a single value. 34 | template T const& Read() 35 | { 36 | return *ReadArray(1); 37 | } 38 | 39 | 40 | // Reads an array of values. 41 | template T const* ReadArray(size_t elementCount) 42 | { 43 | static_assert(std::is_pod::value, "Can only read plain-old-data types"); 44 | 45 | uint8_t const* newPos = mPos + sizeof(T) * elementCount; 46 | 47 | if (newPos > mEnd) 48 | throw std::exception("End of file"); 49 | 50 | auto result = reinterpret_cast(mPos); 51 | 52 | mPos = newPos; 53 | 54 | return result; 55 | } 56 | 57 | 58 | // Lower level helper reads directly from the filesystem into memory. 59 | static HRESULT ReadEntireFile(_In_z_ wchar_t const* fileName, _Inout_ std::unique_ptr& data, _Out_ size_t* dataSize); 60 | 61 | 62 | private: 63 | // The data currently being read. 64 | uint8_t const* mPos; 65 | uint8_t const* mEnd; 66 | 67 | std::unique_ptr mOwnedData; 68 | 69 | 70 | // Prevent copying. 71 | BinaryReader(BinaryReader const&); 72 | BinaryReader& operator= (BinaryReader const&); 73 | }; 74 | } 75 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/ConstantBuffer.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: ConstantBuffer.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #include "DirectXHelpers.h" 17 | #include "PlatformHelpers.h" 18 | 19 | 20 | namespace DirectX 21 | { 22 | // Strongly typed wrapper around a D3D constant buffer. 23 | template 24 | class ConstantBuffer 25 | { 26 | public: 27 | // Constructor. 28 | ConstantBuffer() {} 29 | explicit ConstantBuffer(_In_ ID3D11Device* device) 30 | { 31 | Create( device ); 32 | } 33 | 34 | 35 | void Create(_In_ ID3D11Device* device) 36 | { 37 | D3D11_BUFFER_DESC desc = { 0 }; 38 | 39 | desc.ByteWidth = sizeof(T); 40 | desc.Usage = D3D11_USAGE_DYNAMIC; 41 | desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; 42 | desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; 43 | 44 | ThrowIfFailed( 45 | device->CreateBuffer(&desc, nullptr, mConstantBuffer.ReleaseAndGetAddressOf() ) 46 | ); 47 | 48 | SetDebugObjectName(mConstantBuffer.Get(), "DirectXTK"); 49 | } 50 | 51 | 52 | // Writes new data into the constant buffer. 53 | void SetData(_In_ ID3D11DeviceContext* deviceContext, T const& value) 54 | { 55 | assert( mConstantBuffer.Get() != 0 ); 56 | 57 | D3D11_MAPPED_SUBRESOURCE mappedResource; 58 | 59 | ThrowIfFailed( 60 | deviceContext->Map(mConstantBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource) 61 | ); 62 | 63 | *(T*)mappedResource.pData = value; 64 | 65 | deviceContext->Unmap(mConstantBuffer.Get(), 0); 66 | } 67 | 68 | 69 | // Looks up the underlying D3D constant buffer. 70 | ID3D11Buffer* GetBuffer() 71 | { 72 | return mConstantBuffer.Get(); 73 | } 74 | 75 | 76 | private: 77 | // The underlying D3D object. 78 | Microsoft::WRL::ComPtr mConstantBuffer; 79 | 80 | 81 | // Prevent copying. 82 | ConstantBuffer(ConstantBuffer const&); 83 | ConstantBuffer& operator= (ConstantBuffer const&); 84 | }; 85 | } 86 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/DemandCreate.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: DemandCreate.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #include "PlatformHelpers.h" 17 | 18 | 19 | namespace DirectX 20 | { 21 | // Helper for lazily creating a D3D resource. 22 | template 23 | static T* DemandCreate(Microsoft::WRL::ComPtr& comPtr, std::mutex& mutex, TCreateFunc createFunc) 24 | { 25 | T* result = comPtr.Get(); 26 | 27 | // Double-checked lock pattern. 28 | MemoryBarrier(); 29 | 30 | if (!result) 31 | { 32 | std::lock_guard lock(mutex); 33 | 34 | result = comPtr.Get(); 35 | 36 | if (!result) 37 | { 38 | // Create the new object. 39 | ThrowIfFailed( 40 | createFunc(&result) 41 | ); 42 | 43 | MemoryBarrier(); 44 | 45 | comPtr.Attach(result); 46 | } 47 | } 48 | 49 | return result; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/PlatformHelpers.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: PlatformHelpers.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #pragma warning(disable : 4324 4481) 17 | 18 | #include 19 | 20 | 21 | namespace DirectX 22 | { 23 | // Helper utility converts D3D API failures into exceptions. 24 | inline void ThrowIfFailed(HRESULT hr) 25 | { 26 | if (FAILED(hr)) 27 | { 28 | throw std::exception(); 29 | } 30 | } 31 | 32 | 33 | // Helper for output debug tracing 34 | inline void DebugTrace( _In_z_ _Printf_format_string_ const char* format, ... ) 35 | { 36 | #ifdef _DEBUG 37 | va_list args; 38 | va_start( args, format ); 39 | 40 | char buff[1024]={0}; 41 | vsprintf_s( buff, format, args ); 42 | OutputDebugStringA( buff ); 43 | #else 44 | UNREFERENCED_PARAMETER( format ); 45 | #endif 46 | } 47 | 48 | 49 | // Helper smart-pointers 50 | struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } }; 51 | 52 | typedef public std::unique_ptr ScopedHandle; 53 | 54 | inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; } 55 | } 56 | 57 | 58 | #if defined(_MSC_VER) && (_MSC_VER < 1610) 59 | 60 | // Emulate the C++0x mutex and lock_guard types when building with Visual Studio versions < 2012. 61 | namespace std 62 | { 63 | class mutex 64 | { 65 | public: 66 | mutex() { InitializeCriticalSection(&mCriticalSection); } 67 | ~mutex() { DeleteCriticalSection(&mCriticalSection); } 68 | 69 | void lock() { EnterCriticalSection(&mCriticalSection); } 70 | void unlock() { LeaveCriticalSection(&mCriticalSection); } 71 | bool try_lock() { return TryEnterCriticalSection(&mCriticalSection) != 0; } 72 | 73 | private: 74 | CRITICAL_SECTION mCriticalSection; 75 | 76 | mutex(mutex const&); 77 | mutex& operator= (mutex const&); 78 | }; 79 | 80 | 81 | template 82 | class lock_guard 83 | { 84 | public: 85 | typedef Mutex mutex_type; 86 | 87 | explicit lock_guard(mutex_type& mutex) 88 | : mMutex(mutex) 89 | { 90 | mMutex.lock(); 91 | } 92 | 93 | ~lock_guard() 94 | { 95 | mMutex.unlock(); 96 | } 97 | 98 | private: 99 | mutex_type& mMutex; 100 | 101 | lock_guard(lock_guard const&); 102 | lock_guard& operator= (lock_guard const&); 103 | }; 104 | } 105 | 106 | #else // _MSC_VER < 1610 107 | 108 | #include 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/ScreenGrab.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpvanoosten/LearningDirectX11/5e29ae0fa08ea96eb3b9d438af744346ec139446/extern/DirectXTK/Src/ScreenGrab.cpp -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/AlphaTestEffect.fx: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | // 8 | // http://go.microsoft.com/fwlink/?LinkId=248929 9 | // http://create.msdn.com/en-US/education/catalog/sample/stock_effects 10 | 11 | 12 | Texture2D Texture : register(t0); 13 | sampler Sampler : register(s0); 14 | 15 | 16 | cbuffer Parameters : register(b0) 17 | { 18 | float4 DiffuseColor : packoffset(c0); 19 | float4 AlphaTest : packoffset(c1); 20 | float3 FogColor : packoffset(c2); 21 | float4 FogVector : packoffset(c3); 22 | float4x4 WorldViewProj : packoffset(c4); 23 | }; 24 | 25 | 26 | #include "Structures.fxh" 27 | #include "Common.fxh" 28 | 29 | 30 | // Vertex shader: basic. 31 | VSOutputTx VSAlphaTest(VSInputTx vin) 32 | { 33 | VSOutputTx vout; 34 | 35 | CommonVSOutput cout = ComputeCommonVSOutput(vin.Position); 36 | SetCommonVSOutputParams; 37 | 38 | vout.TexCoord = vin.TexCoord; 39 | 40 | return vout; 41 | } 42 | 43 | 44 | // Vertex shader: no fog. 45 | VSOutputTxNoFog VSAlphaTestNoFog(VSInputTx vin) 46 | { 47 | VSOutputTxNoFog vout; 48 | 49 | CommonVSOutput cout = ComputeCommonVSOutput(vin.Position); 50 | SetCommonVSOutputParamsNoFog; 51 | 52 | vout.TexCoord = vin.TexCoord; 53 | 54 | return vout; 55 | } 56 | 57 | 58 | // Vertex shader: vertex color. 59 | VSOutputTx VSAlphaTestVc(VSInputTxVc vin) 60 | { 61 | VSOutputTx vout; 62 | 63 | CommonVSOutput cout = ComputeCommonVSOutput(vin.Position); 64 | SetCommonVSOutputParams; 65 | 66 | vout.TexCoord = vin.TexCoord; 67 | vout.Diffuse *= vin.Color; 68 | 69 | return vout; 70 | } 71 | 72 | 73 | // Vertex shader: vertex color, no fog. 74 | VSOutputTxNoFog VSAlphaTestVcNoFog(VSInputTxVc vin) 75 | { 76 | VSOutputTxNoFog vout; 77 | 78 | CommonVSOutput cout = ComputeCommonVSOutput(vin.Position); 79 | SetCommonVSOutputParamsNoFog; 80 | 81 | vout.TexCoord = vin.TexCoord; 82 | vout.Diffuse *= vin.Color; 83 | 84 | return vout; 85 | } 86 | 87 | 88 | // Pixel shader: less/greater compare function. 89 | float4 PSAlphaTestLtGt(PSInputTx pin) : SV_Target0 90 | { 91 | float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse; 92 | 93 | clip((color.a < AlphaTest.x) ? AlphaTest.z : AlphaTest.w); 94 | 95 | ApplyFog(color, pin.Specular.w); 96 | 97 | return color; 98 | } 99 | 100 | 101 | // Pixel shader: less/greater compare function, no fog. 102 | float4 PSAlphaTestLtGtNoFog(PSInputTxNoFog pin) : SV_Target0 103 | { 104 | float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse; 105 | 106 | clip((color.a < AlphaTest.x) ? AlphaTest.z : AlphaTest.w); 107 | 108 | return color; 109 | } 110 | 111 | 112 | // Pixel shader: equal/notequal compare function. 113 | float4 PSAlphaTestEqNe(PSInputTx pin) : SV_Target0 114 | { 115 | float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse; 116 | 117 | clip((abs(color.a - AlphaTest.x) < AlphaTest.y) ? AlphaTest.z : AlphaTest.w); 118 | 119 | ApplyFog(color, pin.Specular.w); 120 | 121 | return color; 122 | } 123 | 124 | 125 | // Pixel shader: equal/notequal compare function, no fog. 126 | float4 PSAlphaTestEqNeNoFog(PSInputTxNoFog pin) : SV_Target0 127 | { 128 | float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse; 129 | 130 | clip((abs(color.a - AlphaTest.x) < AlphaTest.y) ? AlphaTest.z : AlphaTest.w); 131 | 132 | return color; 133 | } 134 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/Common.fxh: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | // 8 | // http://go.microsoft.com/fwlink/?LinkId=248929 9 | // http://create.msdn.com/en-US/education/catalog/sample/stock_effects 10 | 11 | 12 | float ComputeFogFactor(float4 position) 13 | { 14 | return saturate(dot(position, FogVector)); 15 | } 16 | 17 | 18 | void ApplyFog(inout float4 color, float fogFactor) 19 | { 20 | color.rgb = lerp(color.rgb, FogColor * color.a, fogFactor); 21 | } 22 | 23 | 24 | void AddSpecular(inout float4 color, float3 specular) 25 | { 26 | color.rgb += specular * color.a; 27 | } 28 | 29 | 30 | struct CommonVSOutput 31 | { 32 | float4 Pos_ps; 33 | float4 Diffuse; 34 | float3 Specular; 35 | float FogFactor; 36 | }; 37 | 38 | 39 | CommonVSOutput ComputeCommonVSOutput(float4 position) 40 | { 41 | CommonVSOutput vout; 42 | 43 | vout.Pos_ps = mul(position, WorldViewProj); 44 | vout.Diffuse = DiffuseColor; 45 | vout.Specular = 0; 46 | vout.FogFactor = ComputeFogFactor(position); 47 | 48 | return vout; 49 | } 50 | 51 | 52 | #define SetCommonVSOutputParams \ 53 | vout.PositionPS = cout.Pos_ps; \ 54 | vout.Diffuse = cout.Diffuse; \ 55 | vout.Specular = float4(cout.Specular, cout.FogFactor); 56 | 57 | 58 | #define SetCommonVSOutputParamsNoFog \ 59 | vout.PositionPS = cout.Pos_ps; \ 60 | vout.Diffuse = cout.Diffuse; 61 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/Compiled/BasicEffect_PSBasic.inc: -------------------------------------------------------------------------------- 1 | #if 0 2 | // 3 | // Generated by Microsoft (R) D3D Shader Disassembler 4 | // 5 | // 6 | // Input signature: 7 | // 8 | // Name Index Mask Register SysValue Format Used 9 | // -------------------- ----- ------ -------- -------- ------- ------ 10 | // COLOR 0 xyzw 0 NONE float xyzw 11 | // COLOR 1 xyzw 1 NONE float w 12 | // 13 | // 14 | // Output signature: 15 | // 16 | // Name Index Mask Register SysValue Format Used 17 | // -------------------- ----- ------ -------- -------- ------- ------ 18 | // SV_Target 0 xyzw 0 TARGET float xyzw 19 | // 20 | // 21 | // Constant buffer to DX9 shader constant mappings: 22 | // 23 | // Target Reg Buffer Start Reg # of Regs Data Conversion 24 | // ---------- ------- --------- --------- ---------------------- 25 | // c0 cb0 13 1 ( FLT, FLT, FLT, FLT) 26 | // 27 | // 28 | // Level9 shader bytecode: 29 | // 30 | ps_2_0 31 | dcl t0 32 | dcl t1 33 | mad r0.xyz, c0, t0.w, -t0 34 | mov r1.xyz, t0 35 | mad r0.xyz, t1.w, r0, r1 36 | mov r0.w, t0.w 37 | mov oC0, r0 38 | 39 | // approximately 5 instruction slots used 40 | ps_4_0 41 | dcl_constantbuffer cb0[14], immediateIndexed 42 | dcl_input_ps linear v0.xyzw 43 | dcl_input_ps linear v1.w 44 | dcl_output o0.xyzw 45 | dcl_temps 1 46 | mad r0.xyz, cb0[13].xyzx, v0.wwww, -v0.xyzx 47 | mad o0.xyz, v1.wwww, r0.xyzx, v0.xyzx 48 | mov o0.w, v0.w 49 | ret 50 | // Approximately 0 instruction slots used 51 | #endif 52 | 53 | const BYTE BasicEffect_PSBasic[] = 54 | { 55 | 68, 88, 66, 67, 132, 106, 56 | 64, 52, 44, 8, 201, 31, 57 | 156, 78, 243, 147, 144, 166, 58 | 2, 49, 1, 0, 0, 0, 59 | 4, 2, 0, 0, 4, 0, 60 | 0, 0, 48, 0, 0, 0, 61 | 212, 0, 0, 0, 136, 1, 62 | 0, 0, 208, 1, 0, 0, 63 | 65, 111, 110, 57, 156, 0, 64 | 0, 0, 156, 0, 0, 0, 65 | 0, 2, 255, 255, 108, 0, 66 | 0, 0, 48, 0, 0, 0, 67 | 1, 0, 36, 0, 0, 0, 68 | 48, 0, 0, 0, 48, 0, 69 | 0, 0, 36, 0, 0, 0, 70 | 48, 0, 0, 0, 13, 0, 71 | 1, 0, 0, 0, 0, 0, 72 | 0, 0, 0, 2, 255, 255, 73 | 31, 0, 0, 2, 0, 0, 74 | 0, 128, 0, 0, 15, 176, 75 | 31, 0, 0, 2, 0, 0, 76 | 0, 128, 1, 0, 15, 176, 77 | 4, 0, 0, 4, 0, 0, 78 | 7, 128, 0, 0, 228, 160, 79 | 0, 0, 255, 176, 0, 0, 80 | 228, 177, 1, 0, 0, 2, 81 | 1, 0, 7, 128, 0, 0, 82 | 228, 176, 4, 0, 0, 4, 83 | 0, 0, 7, 128, 1, 0, 84 | 255, 176, 0, 0, 228, 128, 85 | 1, 0, 228, 128, 1, 0, 86 | 0, 2, 0, 0, 8, 128, 87 | 0, 0, 255, 176, 1, 0, 88 | 0, 2, 0, 8, 15, 128, 89 | 0, 0, 228, 128, 255, 255, 90 | 0, 0, 83, 72, 68, 82, 91 | 172, 0, 0, 0, 64, 0, 92 | 0, 0, 43, 0, 0, 0, 93 | 89, 0, 0, 4, 70, 142, 94 | 32, 0, 0, 0, 0, 0, 95 | 14, 0, 0, 0, 98, 16, 96 | 0, 3, 242, 16, 16, 0, 97 | 0, 0, 0, 0, 98, 16, 98 | 0, 3, 130, 16, 16, 0, 99 | 1, 0, 0, 0, 101, 0, 100 | 0, 3, 242, 32, 16, 0, 101 | 0, 0, 0, 0, 104, 0, 102 | 0, 2, 1, 0, 0, 0, 103 | 50, 0, 0, 11, 114, 0, 104 | 16, 0, 0, 0, 0, 0, 105 | 70, 130, 32, 0, 0, 0, 106 | 0, 0, 13, 0, 0, 0, 107 | 246, 31, 16, 0, 0, 0, 108 | 0, 0, 70, 18, 16, 128, 109 | 65, 0, 0, 0, 0, 0, 110 | 0, 0, 50, 0, 0, 9, 111 | 114, 32, 16, 0, 0, 0, 112 | 0, 0, 246, 31, 16, 0, 113 | 1, 0, 0, 0, 70, 2, 114 | 16, 0, 0, 0, 0, 0, 115 | 70, 18, 16, 0, 0, 0, 116 | 0, 0, 54, 0, 0, 5, 117 | 130, 32, 16, 0, 0, 0, 118 | 0, 0, 58, 16, 16, 0, 119 | 0, 0, 0, 0, 62, 0, 120 | 0, 1, 73, 83, 71, 78, 121 | 64, 0, 0, 0, 2, 0, 122 | 0, 0, 8, 0, 0, 0, 123 | 56, 0, 0, 0, 0, 0, 124 | 0, 0, 0, 0, 0, 0, 125 | 3, 0, 0, 0, 0, 0, 126 | 0, 0, 15, 15, 0, 0, 127 | 56, 0, 0, 0, 1, 0, 128 | 0, 0, 0, 0, 0, 0, 129 | 3, 0, 0, 0, 1, 0, 130 | 0, 0, 15, 8, 0, 0, 131 | 67, 79, 76, 79, 82, 0, 132 | 171, 171, 79, 83, 71, 78, 133 | 44, 0, 0, 0, 1, 0, 134 | 0, 0, 8, 0, 0, 0, 135 | 32, 0, 0, 0, 0, 0, 136 | 0, 0, 0, 0, 0, 0, 137 | 3, 0, 0, 0, 0, 0, 138 | 0, 0, 15, 0, 0, 0, 139 | 83, 86, 95, 84, 97, 114, 140 | 103, 101, 116, 0, 171, 171 141 | }; 142 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/Compiled/BasicEffect_PSBasicNoFog.inc: -------------------------------------------------------------------------------- 1 | #if 0 2 | // 3 | // Generated by Microsoft (R) D3D Shader Disassembler 4 | // 5 | // 6 | // Input signature: 7 | // 8 | // Name Index Mask Register SysValue Format Used 9 | // -------------------- ----- ------ -------- -------- ------- ------ 10 | // COLOR 0 xyzw 0 NONE float xyzw 11 | // 12 | // 13 | // Output signature: 14 | // 15 | // Name Index Mask Register SysValue Format Used 16 | // -------------------- ----- ------ -------- -------- ------- ------ 17 | // SV_Target 0 xyzw 0 TARGET float xyzw 18 | // 19 | // 20 | // Level9 shader bytecode: 21 | // 22 | ps_2_0 23 | dcl t0 24 | mov oC0, t0 25 | 26 | // approximately 1 instruction slot used 27 | ps_4_0 28 | dcl_input_ps linear v0.xyzw 29 | dcl_output o0.xyzw 30 | mov o0.xyzw, v0.xyzw 31 | ret 32 | // Approximately 0 instruction slots used 33 | #endif 34 | 35 | const BYTE BasicEffect_PSBasicNoFog[] = 36 | { 37 | 68, 88, 66, 67, 218, 245, 38 | 81, 3, 21, 86, 134, 132, 39 | 242, 64, 147, 169, 186, 94, 40 | 60, 67, 1, 0, 0, 0, 41 | 32, 1, 0, 0, 4, 0, 42 | 0, 0, 48, 0, 0, 0, 43 | 124, 0, 0, 0, 188, 0, 44 | 0, 0, 236, 0, 0, 0, 45 | 65, 111, 110, 57, 68, 0, 46 | 0, 0, 68, 0, 0, 0, 47 | 0, 2, 255, 255, 32, 0, 48 | 0, 0, 36, 0, 0, 0, 49 | 0, 0, 36, 0, 0, 0, 50 | 36, 0, 0, 0, 36, 0, 51 | 0, 0, 36, 0, 0, 0, 52 | 36, 0, 0, 2, 255, 255, 53 | 31, 0, 0, 2, 0, 0, 54 | 0, 128, 0, 0, 15, 176, 55 | 1, 0, 0, 2, 0, 8, 56 | 15, 128, 0, 0, 228, 176, 57 | 255, 255, 0, 0, 83, 72, 58 | 68, 82, 56, 0, 0, 0, 59 | 64, 0, 0, 0, 14, 0, 60 | 0, 0, 98, 16, 0, 3, 61 | 242, 16, 16, 0, 0, 0, 62 | 0, 0, 101, 0, 0, 3, 63 | 242, 32, 16, 0, 0, 0, 64 | 0, 0, 54, 0, 0, 5, 65 | 242, 32, 16, 0, 0, 0, 66 | 0, 0, 70, 30, 16, 0, 67 | 0, 0, 0, 0, 62, 0, 68 | 0, 1, 73, 83, 71, 78, 69 | 40, 0, 0, 0, 1, 0, 70 | 0, 0, 8, 0, 0, 0, 71 | 32, 0, 0, 0, 0, 0, 72 | 0, 0, 0, 0, 0, 0, 73 | 3, 0, 0, 0, 0, 0, 74 | 0, 0, 15, 15, 0, 0, 75 | 67, 79, 76, 79, 82, 0, 76 | 171, 171, 79, 83, 71, 78, 77 | 44, 0, 0, 0, 1, 0, 78 | 0, 0, 8, 0, 0, 0, 79 | 32, 0, 0, 0, 0, 0, 80 | 0, 0, 0, 0, 0, 0, 81 | 3, 0, 0, 0, 0, 0, 82 | 0, 0, 15, 0, 0, 0, 83 | 83, 86, 95, 84, 97, 114, 84 | 103, 101, 116, 0, 171, 171 85 | }; 86 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/Compiled/BasicEffect_PSBasicTxNoFog.inc: -------------------------------------------------------------------------------- 1 | #if 0 2 | // 3 | // Generated by Microsoft (R) D3D Shader Disassembler 4 | // 5 | // 6 | // Input signature: 7 | // 8 | // Name Index Mask Register SysValue Format Used 9 | // -------------------- ----- ------ -------- -------- ------- ------ 10 | // COLOR 0 xyzw 0 NONE float xyzw 11 | // TEXCOORD 0 xy 1 NONE float xy 12 | // 13 | // 14 | // Output signature: 15 | // 16 | // Name Index Mask Register SysValue Format Used 17 | // -------------------- ----- ------ -------- -------- ------- ------ 18 | // SV_Target 0 xyzw 0 TARGET float xyzw 19 | // 20 | // 21 | // Sampler/Resource to DX9 shader sampler mappings: 22 | // 23 | // Target Sampler Source Sampler Source Resource 24 | // -------------- --------------- ---------------- 25 | // s0 s0 t0 26 | // 27 | // 28 | // Level9 shader bytecode: 29 | // 30 | ps_2_0 31 | dcl t0 32 | dcl t1.xy 33 | dcl_2d s0 34 | texld r0, t1, s0 35 | mul r0, r0, t0 36 | mov oC0, r0 37 | 38 | // approximately 3 instruction slots used (1 texture, 2 arithmetic) 39 | ps_4_0 40 | dcl_constantbuffer cb0[1], immediateIndexed 41 | dcl_sampler s0, mode_default 42 | dcl_resource_texture2d (float,float,float,float) t0 43 | dcl_input_ps linear v0.xyzw 44 | dcl_input_ps linear v1.xy 45 | dcl_output o0.xyzw 46 | dcl_temps 1 47 | sample r0.xyzw, v1.xyxx, t0.xyzw, s0 48 | mul o0.xyzw, r0.xyzw, v0.xyzw 49 | ret 50 | // Approximately 0 instruction slots used 51 | #endif 52 | 53 | const BYTE BasicEffect_PSBasicTxNoFog[] = 54 | { 55 | 68, 88, 66, 67, 62, 231, 56 | 156, 88, 145, 159, 172, 51, 57 | 164, 207, 207, 254, 124, 230, 58 | 155, 106, 1, 0, 0, 0, 59 | 232, 1, 0, 0, 4, 0, 60 | 0, 0, 48, 0, 0, 0, 61 | 184, 0, 0, 0, 100, 1, 62 | 0, 0, 180, 1, 0, 0, 63 | 65, 111, 110, 57, 128, 0, 64 | 0, 0, 128, 0, 0, 0, 65 | 0, 2, 255, 255, 88, 0, 66 | 0, 0, 40, 0, 0, 0, 67 | 0, 0, 40, 0, 0, 0, 68 | 40, 0, 0, 0, 40, 0, 69 | 1, 0, 36, 0, 0, 0, 70 | 40, 0, 0, 0, 0, 0, 71 | 0, 2, 255, 255, 31, 0, 72 | 0, 2, 0, 0, 0, 128, 73 | 0, 0, 15, 176, 31, 0, 74 | 0, 2, 0, 0, 0, 128, 75 | 1, 0, 3, 176, 31, 0, 76 | 0, 2, 0, 0, 0, 144, 77 | 0, 8, 15, 160, 66, 0, 78 | 0, 3, 0, 0, 15, 128, 79 | 1, 0, 228, 176, 0, 8, 80 | 228, 160, 5, 0, 0, 3, 81 | 0, 0, 15, 128, 0, 0, 82 | 228, 128, 0, 0, 228, 176, 83 | 1, 0, 0, 2, 0, 8, 84 | 15, 128, 0, 0, 228, 128, 85 | 255, 255, 0, 0, 83, 72, 86 | 68, 82, 164, 0, 0, 0, 87 | 64, 0, 0, 0, 41, 0, 88 | 0, 0, 89, 0, 0, 4, 89 | 70, 142, 32, 0, 0, 0, 90 | 0, 0, 1, 0, 0, 0, 91 | 90, 0, 0, 3, 0, 96, 92 | 16, 0, 0, 0, 0, 0, 93 | 88, 24, 0, 4, 0, 112, 94 | 16, 0, 0, 0, 0, 0, 95 | 85, 85, 0, 0, 98, 16, 96 | 0, 3, 242, 16, 16, 0, 97 | 0, 0, 0, 0, 98, 16, 98 | 0, 3, 50, 16, 16, 0, 99 | 1, 0, 0, 0, 101, 0, 100 | 0, 3, 242, 32, 16, 0, 101 | 0, 0, 0, 0, 104, 0, 102 | 0, 2, 1, 0, 0, 0, 103 | 69, 0, 0, 9, 242, 0, 104 | 16, 0, 0, 0, 0, 0, 105 | 70, 16, 16, 0, 1, 0, 106 | 0, 0, 70, 126, 16, 0, 107 | 0, 0, 0, 0, 0, 96, 108 | 16, 0, 0, 0, 0, 0, 109 | 56, 0, 0, 7, 242, 32, 110 | 16, 0, 0, 0, 0, 0, 111 | 70, 14, 16, 0, 0, 0, 112 | 0, 0, 70, 30, 16, 0, 113 | 0, 0, 0, 0, 62, 0, 114 | 0, 1, 73, 83, 71, 78, 115 | 72, 0, 0, 0, 2, 0, 116 | 0, 0, 8, 0, 0, 0, 117 | 56, 0, 0, 0, 0, 0, 118 | 0, 0, 0, 0, 0, 0, 119 | 3, 0, 0, 0, 0, 0, 120 | 0, 0, 15, 15, 0, 0, 121 | 62, 0, 0, 0, 0, 0, 122 | 0, 0, 0, 0, 0, 0, 123 | 3, 0, 0, 0, 1, 0, 124 | 0, 0, 3, 3, 0, 0, 125 | 67, 79, 76, 79, 82, 0, 126 | 84, 69, 88, 67, 79, 79, 127 | 82, 68, 0, 171, 79, 83, 128 | 71, 78, 44, 0, 0, 0, 129 | 1, 0, 0, 0, 8, 0, 130 | 0, 0, 32, 0, 0, 0, 131 | 0, 0, 0, 0, 0, 0, 132 | 0, 0, 3, 0, 0, 0, 133 | 0, 0, 0, 0, 15, 0, 134 | 0, 0, 83, 86, 95, 84, 135 | 97, 114, 103, 101, 116, 0, 136 | 171, 171 137 | }; 138 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/Compiled/BasicEffect_PSBasicVertexLightingNoFog.inc: -------------------------------------------------------------------------------- 1 | #if 0 2 | // 3 | // Generated by Microsoft (R) D3D Shader Disassembler 4 | // 5 | // 6 | // Input signature: 7 | // 8 | // Name Index Mask Register SysValue Format Used 9 | // -------------------- ----- ------ -------- -------- ------- ------ 10 | // COLOR 0 xyzw 0 NONE float xyzw 11 | // COLOR 1 xyzw 1 NONE float xyz 12 | // 13 | // 14 | // Output signature: 15 | // 16 | // Name Index Mask Register SysValue Format Used 17 | // -------------------- ----- ------ -------- -------- ------- ------ 18 | // SV_Target 0 xyzw 0 TARGET float xyzw 19 | // 20 | // 21 | // Level9 shader bytecode: 22 | // 23 | ps_2_0 24 | dcl t0 25 | dcl t1 26 | mov r0, t0 27 | mad r0.xyz, t1, r0.w, r0 28 | mov r0.w, t0.w 29 | mov oC0, r0 30 | 31 | // approximately 4 instruction slots used 32 | ps_4_0 33 | dcl_input_ps linear v0.xyzw 34 | dcl_input_ps linear v1.xyz 35 | dcl_output o0.xyzw 36 | mad o0.xyz, v1.xyzx, v0.wwww, v0.xyzx 37 | mov o0.w, v0.w 38 | ret 39 | // Approximately 0 instruction slots used 40 | #endif 41 | 42 | const BYTE BasicEffect_PSBasicVertexLightingNoFog[] = 43 | { 44 | 68, 88, 66, 67, 196, 161, 45 | 90, 12, 111, 37, 237, 2, 46 | 236, 93, 13, 113, 105, 60, 47 | 150, 154, 1, 0, 0, 0, 48 | 160, 1, 0, 0, 4, 0, 49 | 0, 0, 48, 0, 0, 0, 50 | 180, 0, 0, 0, 36, 1, 51 | 0, 0, 108, 1, 0, 0, 52 | 65, 111, 110, 57, 124, 0, 53 | 0, 0, 124, 0, 0, 0, 54 | 0, 2, 255, 255, 88, 0, 55 | 0, 0, 36, 0, 0, 0, 56 | 0, 0, 36, 0, 0, 0, 57 | 36, 0, 0, 0, 36, 0, 58 | 0, 0, 36, 0, 0, 0, 59 | 36, 0, 0, 2, 255, 255, 60 | 31, 0, 0, 2, 0, 0, 61 | 0, 128, 0, 0, 15, 176, 62 | 31, 0, 0, 2, 0, 0, 63 | 0, 128, 1, 0, 15, 176, 64 | 1, 0, 0, 2, 0, 0, 65 | 15, 128, 0, 0, 228, 176, 66 | 4, 0, 0, 4, 0, 0, 67 | 7, 128, 1, 0, 228, 176, 68 | 0, 0, 255, 128, 0, 0, 69 | 228, 128, 1, 0, 0, 2, 70 | 0, 0, 8, 128, 0, 0, 71 | 255, 176, 1, 0, 0, 2, 72 | 0, 8, 15, 128, 0, 0, 73 | 228, 128, 255, 255, 0, 0, 74 | 83, 72, 68, 82, 104, 0, 75 | 0, 0, 64, 0, 0, 0, 76 | 26, 0, 0, 0, 98, 16, 77 | 0, 3, 242, 16, 16, 0, 78 | 0, 0, 0, 0, 98, 16, 79 | 0, 3, 114, 16, 16, 0, 80 | 1, 0, 0, 0, 101, 0, 81 | 0, 3, 242, 32, 16, 0, 82 | 0, 0, 0, 0, 50, 0, 83 | 0, 9, 114, 32, 16, 0, 84 | 0, 0, 0, 0, 70, 18, 85 | 16, 0, 1, 0, 0, 0, 86 | 246, 31, 16, 0, 0, 0, 87 | 0, 0, 70, 18, 16, 0, 88 | 0, 0, 0, 0, 54, 0, 89 | 0, 5, 130, 32, 16, 0, 90 | 0, 0, 0, 0, 58, 16, 91 | 16, 0, 0, 0, 0, 0, 92 | 62, 0, 0, 1, 73, 83, 93 | 71, 78, 64, 0, 0, 0, 94 | 2, 0, 0, 0, 8, 0, 95 | 0, 0, 56, 0, 0, 0, 96 | 0, 0, 0, 0, 0, 0, 97 | 0, 0, 3, 0, 0, 0, 98 | 0, 0, 0, 0, 15, 15, 99 | 0, 0, 56, 0, 0, 0, 100 | 1, 0, 0, 0, 0, 0, 101 | 0, 0, 3, 0, 0, 0, 102 | 1, 0, 0, 0, 15, 7, 103 | 0, 0, 67, 79, 76, 79, 104 | 82, 0, 171, 171, 79, 83, 105 | 71, 78, 44, 0, 0, 0, 106 | 1, 0, 0, 0, 8, 0, 107 | 0, 0, 32, 0, 0, 0, 108 | 0, 0, 0, 0, 0, 0, 109 | 0, 0, 3, 0, 0, 0, 110 | 0, 0, 0, 0, 15, 0, 111 | 0, 0, 83, 86, 95, 84, 112 | 97, 114, 103, 101, 116, 0, 113 | 171, 171 114 | }; 115 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/Compiled/DGSLUnlit_main.inc: -------------------------------------------------------------------------------- 1 | #if 0 2 | // 3 | // Generated by Microsoft (R) D3D Shader Disassembler 4 | // 5 | // 6 | // Input signature: 7 | // 8 | // Name Index Mask Register SysValue Format Used 9 | // -------------------- ----- ------ -------- -------- ------- ------ 10 | // SV_POSITION 0 xyzw 0 POS float 11 | // COLOR 0 xyzw 1 NONE float xyzw 12 | // TEXCOORD 0 xy 2 NONE float 13 | // TEXCOORD 1 xyz 3 NONE float 14 | // TEXCOORD 2 xyz 4 NONE float 15 | // TEXCOORD 3 xyz 5 NONE float 16 | // TEXCOORD 4 xyzw 6 NONE float 17 | // TEXCOORD 5 xyz 7 NONE float 18 | // 19 | // 20 | // Output signature: 21 | // 22 | // Name Index Mask Register SysValue Format Used 23 | // -------------------- ----- ------ -------- -------- ------- ------ 24 | // SV_Target 0 xyzw 0 TARGET float xyzw 25 | // 26 | // 27 | // Level9 shader bytecode: 28 | // 29 | ps_2_0 30 | dcl t0 31 | mov oC0, t0 32 | 33 | // approximately 1 instruction slot used 34 | ps_4_0 35 | dcl_input_ps linear v1.xyzw 36 | dcl_output o0.xyzw 37 | mov o0.xyzw, v1.xyzw 38 | ret 39 | // Approximately 0 instruction slots used 40 | #endif 41 | 42 | const BYTE DGSLUnlit_main[] = 43 | { 44 | 68, 88, 66, 67, 105, 73, 45 | 81, 57, 5, 7, 232, 104, 46 | 47, 198, 245, 104, 91, 126, 47 | 113, 199, 1, 0, 0, 0, 48 | 220, 1, 0, 0, 4, 0, 49 | 0, 0, 48, 0, 0, 0, 50 | 124, 0, 0, 0, 188, 0, 51 | 0, 0, 168, 1, 0, 0, 52 | 65, 111, 110, 57, 68, 0, 53 | 0, 0, 68, 0, 0, 0, 54 | 0, 2, 255, 255, 32, 0, 55 | 0, 0, 36, 0, 0, 0, 56 | 0, 0, 36, 0, 0, 0, 57 | 36, 0, 0, 0, 36, 0, 58 | 0, 0, 36, 0, 0, 0, 59 | 36, 0, 0, 2, 255, 255, 60 | 31, 0, 0, 2, 0, 0, 61 | 0, 128, 0, 0, 15, 176, 62 | 1, 0, 0, 2, 0, 8, 63 | 15, 128, 0, 0, 228, 176, 64 | 255, 255, 0, 0, 83, 72, 65 | 68, 82, 56, 0, 0, 0, 66 | 64, 0, 0, 0, 14, 0, 67 | 0, 0, 98, 16, 0, 3, 68 | 242, 16, 16, 0, 1, 0, 69 | 0, 0, 101, 0, 0, 3, 70 | 242, 32, 16, 0, 0, 0, 71 | 0, 0, 54, 0, 0, 5, 72 | 242, 32, 16, 0, 0, 0, 73 | 0, 0, 70, 30, 16, 0, 74 | 1, 0, 0, 0, 62, 0, 75 | 0, 1, 73, 83, 71, 78, 76 | 228, 0, 0, 0, 8, 0, 77 | 0, 0, 8, 0, 0, 0, 78 | 200, 0, 0, 0, 0, 0, 79 | 0, 0, 1, 0, 0, 0, 80 | 3, 0, 0, 0, 0, 0, 81 | 0, 0, 15, 0, 0, 0, 82 | 212, 0, 0, 0, 0, 0, 83 | 0, 0, 0, 0, 0, 0, 84 | 3, 0, 0, 0, 1, 0, 85 | 0, 0, 15, 15, 0, 0, 86 | 218, 0, 0, 0, 0, 0, 87 | 0, 0, 0, 0, 0, 0, 88 | 3, 0, 0, 0, 2, 0, 89 | 0, 0, 3, 0, 0, 0, 90 | 218, 0, 0, 0, 1, 0, 91 | 0, 0, 0, 0, 0, 0, 92 | 3, 0, 0, 0, 3, 0, 93 | 0, 0, 7, 0, 0, 0, 94 | 218, 0, 0, 0, 2, 0, 95 | 0, 0, 0, 0, 0, 0, 96 | 3, 0, 0, 0, 4, 0, 97 | 0, 0, 7, 0, 0, 0, 98 | 218, 0, 0, 0, 3, 0, 99 | 0, 0, 0, 0, 0, 0, 100 | 3, 0, 0, 0, 5, 0, 101 | 0, 0, 7, 0, 0, 0, 102 | 218, 0, 0, 0, 4, 0, 103 | 0, 0, 0, 0, 0, 0, 104 | 3, 0, 0, 0, 6, 0, 105 | 0, 0, 15, 0, 0, 0, 106 | 218, 0, 0, 0, 5, 0, 107 | 0, 0, 0, 0, 0, 0, 108 | 3, 0, 0, 0, 7, 0, 109 | 0, 0, 7, 0, 0, 0, 110 | 83, 86, 95, 80, 79, 83, 111 | 73, 84, 73, 79, 78, 0, 112 | 67, 79, 76, 79, 82, 0, 113 | 84, 69, 88, 67, 79, 79, 114 | 82, 68, 0, 171, 79, 83, 115 | 71, 78, 44, 0, 0, 0, 116 | 1, 0, 0, 0, 8, 0, 117 | 0, 0, 32, 0, 0, 0, 118 | 0, 0, 0, 0, 0, 0, 119 | 0, 0, 3, 0, 0, 0, 120 | 0, 0, 0, 0, 15, 0, 121 | 0, 0, 83, 86, 95, 84, 122 | 97, 114, 103, 101, 116, 0, 123 | 171, 171 124 | }; 125 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/Compiled/SpriteEffect_SpritePixelShader.inc: -------------------------------------------------------------------------------- 1 | #if 0 2 | // 3 | // Generated by Microsoft (R) D3D Shader Disassembler 4 | // 5 | // 6 | // Input signature: 7 | // 8 | // Name Index Mask Register SysValue Format Used 9 | // -------------------- ----- ------ -------- -------- ------- ------ 10 | // COLOR 0 xyzw 0 NONE float xyzw 11 | // TEXCOORD 0 xy 1 NONE float xy 12 | // 13 | // 14 | // Output signature: 15 | // 16 | // Name Index Mask Register SysValue Format Used 17 | // -------------------- ----- ------ -------- -------- ------- ------ 18 | // SV_Target 0 xyzw 0 TARGET float xyzw 19 | // 20 | // 21 | // Sampler/Resource to DX9 shader sampler mappings: 22 | // 23 | // Target Sampler Source Sampler Source Resource 24 | // -------------- --------------- ---------------- 25 | // s0 s0 t0 26 | // 27 | // 28 | // Level9 shader bytecode: 29 | // 30 | ps_2_0 31 | dcl t0 32 | dcl t1.xy 33 | dcl_2d s0 34 | texld r0, t1, s0 35 | mul r0, r0, t0 36 | mov oC0, r0 37 | 38 | // approximately 3 instruction slots used (1 texture, 2 arithmetic) 39 | ps_4_0 40 | dcl_constantbuffer cb0[1], immediateIndexed 41 | dcl_sampler s0, mode_default 42 | dcl_resource_texture2d (float,float,float,float) t0 43 | dcl_input_ps linear v0.xyzw 44 | dcl_input_ps linear v1.xy 45 | dcl_output o0.xyzw 46 | dcl_temps 1 47 | sample r0.xyzw, v1.xyxx, t0.xyzw, s0 48 | mul o0.xyzw, r0.xyzw, v0.xyzw 49 | ret 50 | // Approximately 0 instruction slots used 51 | #endif 52 | 53 | const BYTE SpriteEffect_SpritePixelShader[] = 54 | { 55 | 68, 88, 66, 67, 62, 231, 56 | 156, 88, 145, 159, 172, 51, 57 | 164, 207, 207, 254, 124, 230, 58 | 155, 106, 1, 0, 0, 0, 59 | 232, 1, 0, 0, 4, 0, 60 | 0, 0, 48, 0, 0, 0, 61 | 184, 0, 0, 0, 100, 1, 62 | 0, 0, 180, 1, 0, 0, 63 | 65, 111, 110, 57, 128, 0, 64 | 0, 0, 128, 0, 0, 0, 65 | 0, 2, 255, 255, 88, 0, 66 | 0, 0, 40, 0, 0, 0, 67 | 0, 0, 40, 0, 0, 0, 68 | 40, 0, 0, 0, 40, 0, 69 | 1, 0, 36, 0, 0, 0, 70 | 40, 0, 0, 0, 0, 0, 71 | 0, 2, 255, 255, 31, 0, 72 | 0, 2, 0, 0, 0, 128, 73 | 0, 0, 15, 176, 31, 0, 74 | 0, 2, 0, 0, 0, 128, 75 | 1, 0, 3, 176, 31, 0, 76 | 0, 2, 0, 0, 0, 144, 77 | 0, 8, 15, 160, 66, 0, 78 | 0, 3, 0, 0, 15, 128, 79 | 1, 0, 228, 176, 0, 8, 80 | 228, 160, 5, 0, 0, 3, 81 | 0, 0, 15, 128, 0, 0, 82 | 228, 128, 0, 0, 228, 176, 83 | 1, 0, 0, 2, 0, 8, 84 | 15, 128, 0, 0, 228, 128, 85 | 255, 255, 0, 0, 83, 72, 86 | 68, 82, 164, 0, 0, 0, 87 | 64, 0, 0, 0, 41, 0, 88 | 0, 0, 89, 0, 0, 4, 89 | 70, 142, 32, 0, 0, 0, 90 | 0, 0, 1, 0, 0, 0, 91 | 90, 0, 0, 3, 0, 96, 92 | 16, 0, 0, 0, 0, 0, 93 | 88, 24, 0, 4, 0, 112, 94 | 16, 0, 0, 0, 0, 0, 95 | 85, 85, 0, 0, 98, 16, 96 | 0, 3, 242, 16, 16, 0, 97 | 0, 0, 0, 0, 98, 16, 98 | 0, 3, 50, 16, 16, 0, 99 | 1, 0, 0, 0, 101, 0, 100 | 0, 3, 242, 32, 16, 0, 101 | 0, 0, 0, 0, 104, 0, 102 | 0, 2, 1, 0, 0, 0, 103 | 69, 0, 0, 9, 242, 0, 104 | 16, 0, 0, 0, 0, 0, 105 | 70, 16, 16, 0, 1, 0, 106 | 0, 0, 70, 126, 16, 0, 107 | 0, 0, 0, 0, 0, 96, 108 | 16, 0, 0, 0, 0, 0, 109 | 56, 0, 0, 7, 242, 32, 110 | 16, 0, 0, 0, 0, 0, 111 | 70, 14, 16, 0, 0, 0, 112 | 0, 0, 70, 30, 16, 0, 113 | 0, 0, 0, 0, 62, 0, 114 | 0, 1, 73, 83, 71, 78, 115 | 72, 0, 0, 0, 2, 0, 116 | 0, 0, 8, 0, 0, 0, 117 | 56, 0, 0, 0, 0, 0, 118 | 0, 0, 0, 0, 0, 0, 119 | 3, 0, 0, 0, 0, 0, 120 | 0, 0, 15, 15, 0, 0, 121 | 62, 0, 0, 0, 0, 0, 122 | 0, 0, 0, 0, 0, 0, 123 | 3, 0, 0, 0, 1, 0, 124 | 0, 0, 3, 3, 0, 0, 125 | 67, 79, 76, 79, 82, 0, 126 | 84, 69, 88, 67, 79, 79, 127 | 82, 68, 0, 171, 79, 83, 128 | 71, 78, 44, 0, 0, 0, 129 | 1, 0, 0, 0, 8, 0, 130 | 0, 0, 32, 0, 0, 0, 131 | 0, 0, 0, 0, 0, 0, 132 | 0, 0, 3, 0, 0, 0, 133 | 0, 0, 0, 0, 15, 0, 134 | 0, 0, 83, 86, 95, 84, 135 | 97, 114, 103, 101, 116, 0, 136 | 171, 171 137 | }; 138 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/DGSLLambert.hlsl: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | 8 | // 9 | // This file was generated by exporting HLSL from Visual Studio's default "Lambert" material, and then modified to handle both texture scenarios, multiple lights, and work with FL 9.x 10 | // \Common7\IDE\Extensions\Microsoft\VsGraphics\Assets\Effects\Lambert.dgsl 11 | // 12 | 13 | Texture2D Texture1 : register( t0 ); 14 | 15 | SamplerState TexSampler : register( s0 ); 16 | 17 | cbuffer MaterialVars : register (b0) 18 | { 19 | float4 MaterialAmbient; 20 | float4 MaterialDiffuse; 21 | float4 MaterialSpecular; 22 | float4 MaterialEmissive; 23 | float MaterialSpecularPower; 24 | }; 25 | 26 | cbuffer LightVars : register (b1) 27 | { 28 | float4 AmbientLight; 29 | float4 LightColor[4]; 30 | float4 LightAttenuation[4]; 31 | float3 LightDirection[4]; 32 | float LightSpecularIntensity[4]; 33 | uint IsPointLight[4]; 34 | uint ActiveLights; 35 | } 36 | 37 | cbuffer ObjectVars : register(b2) 38 | { 39 | float4x4 LocalToWorld4x4; 40 | float4x4 LocalToProjected4x4; 41 | float4x4 WorldToLocal4x4; 42 | float4x4 WorldToView4x4; 43 | float4x4 UVTransform4x4; 44 | float3 EyePosition; 45 | }; 46 | 47 | cbuffer MiscVars : register(b3) 48 | { 49 | float ViewportWidth; 50 | float ViewportHeight; 51 | float Time; 52 | }; 53 | 54 | struct V2P 55 | { 56 | float4 pos : SV_POSITION; 57 | float4 diffuse : COLOR; 58 | float2 uv : TEXCOORD0; 59 | float3 worldNorm : TEXCOORD1; 60 | float3 worldPos : TEXCOORD2; 61 | float3 toEye : TEXCOORD3; 62 | float4 tangent : TEXCOORD4; 63 | float3 normal : TEXCOORD5; 64 | }; 65 | 66 | struct P2F 67 | { 68 | float4 fragment : SV_Target; 69 | }; 70 | 71 | // 72 | // lambert lighting function 73 | // 74 | float3 LambertLighting( 75 | float3 lightNormal, 76 | float3 surfaceNormal, 77 | float3 lightColor, 78 | float3 pixelColor 79 | ) 80 | { 81 | // compute amount of contribution per light 82 | float diffuseAmount = saturate(dot(lightNormal, surfaceNormal)); 83 | float3 diffuse = diffuseAmount * lightColor * pixelColor; 84 | return diffuse; 85 | } 86 | 87 | // 88 | // combines a float3 RGB value with an alpha value into a float4 89 | // 90 | float4 CombineRGBWithAlpha(float3 rgb, float a) 91 | { 92 | return float4(rgb.r, rgb.g, rgb.b, a); 93 | } 94 | 95 | P2F main(V2P pixel) 96 | { 97 | P2F result; 98 | 99 | float3 worldNormal = normalize(pixel.worldNorm); 100 | 101 | float3 local3 = MaterialAmbient.rgb * AmbientLight.rgb; 102 | [unroll] 103 | for (int i = 0; i < 4; i++) 104 | { 105 | local3 += LambertLighting(LightDirection[i], worldNormal, LightColor[i].rgb, pixel.diffuse.rgb); 106 | } 107 | 108 | local3 = saturate(local3); 109 | result.fragment = CombineRGBWithAlpha(local3, pixel.diffuse.a); 110 | 111 | return result; 112 | } 113 | 114 | P2F mainTk(V2P pixel) 115 | { 116 | P2F result; 117 | 118 | float3 worldNormal = normalize(pixel.worldNorm); 119 | 120 | float3 local3 = MaterialAmbient.rgb * AmbientLight.rgb; 121 | [unroll] 122 | for (int i = 0; i < 4; i++) 123 | { 124 | local3 += LambertLighting(LightDirection[i], worldNormal, LightColor[i].rgb, pixel.diffuse.rgb); 125 | } 126 | 127 | local3 = saturate(local3); 128 | result.fragment = CombineRGBWithAlpha(local3, pixel.diffuse.a); 129 | 130 | if (result.fragment.a == 0.0f) discard; 131 | 132 | return result; 133 | } 134 | 135 | P2F mainTx(V2P pixel) 136 | { 137 | P2F result; 138 | 139 | float3 worldNormal = normalize(pixel.worldNorm); 140 | 141 | float3 local3 = MaterialAmbient.rgb * AmbientLight.rgb; 142 | [unroll] 143 | for (int i = 0; i < 4; i++) 144 | { 145 | local3 += LambertLighting(LightDirection[i], worldNormal, LightColor[i].rgb, pixel.diffuse.rgb); 146 | } 147 | 148 | local3 = saturate(local3); 149 | float3 local4 = Texture1.Sample(TexSampler, pixel.uv).rgb * local3; 150 | float local5 = Texture1.Sample(TexSampler, pixel.uv).a * pixel.diffuse.a; 151 | result.fragment = CombineRGBWithAlpha(local4, local5); 152 | 153 | return result; 154 | } 155 | 156 | P2F mainTxTk(V2P pixel) 157 | { 158 | P2F result; 159 | 160 | float3 worldNormal = normalize(pixel.worldNorm); 161 | 162 | float3 local3 = MaterialAmbient.rgb * AmbientLight.rgb; 163 | [unroll] 164 | for (int i = 0; i < 4; i++) 165 | { 166 | local3 += LambertLighting(LightDirection[i], worldNormal, LightColor[i].rgb, pixel.diffuse.rgb); 167 | } 168 | 169 | local3 = saturate(local3); 170 | float3 local4 = Texture1.Sample(TexSampler, pixel.uv).rgb * local3; 171 | float local5 = Texture1.Sample(TexSampler, pixel.uv).a * pixel.diffuse.a; 172 | result.fragment = CombineRGBWithAlpha(local4, local5); 173 | 174 | if (result.fragment.a == 0.0f) discard; 175 | 176 | return result; 177 | } 178 | 179 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/DGSLUnlit.hlsl: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | 8 | // 9 | // This file was generated by exporting HLSL from Visual Studio's default "Unlit" material, and then modified to handle both texture scenarios 10 | // \Common7\IDE\Extensions\Microsoft\VsGraphics\Assets\Effects\Unlit.dgsl 11 | // 12 | 13 | Texture2D Texture1 : register( t0 ); 14 | 15 | SamplerState TexSampler : register( s0 ); 16 | 17 | cbuffer MaterialVars : register (b0) 18 | { 19 | float4 MaterialAmbient; 20 | float4 MaterialDiffuse; 21 | float4 MaterialSpecular; 22 | float4 MaterialEmissive; 23 | float MaterialSpecularPower; 24 | }; 25 | 26 | cbuffer LightVars : register (b1) 27 | { 28 | float4 AmbientLight; 29 | float4 LightColor[4]; 30 | float4 LightAttenuation[4]; 31 | float3 LightDirection[4]; 32 | float LightSpecularIntensity[4]; 33 | uint IsPointLight[4]; 34 | uint ActiveLights; 35 | } 36 | 37 | cbuffer ObjectVars : register(b2) 38 | { 39 | float4x4 LocalToWorld4x4; 40 | float4x4 LocalToProjected4x4; 41 | float4x4 WorldToLocal4x4; 42 | float4x4 WorldToView4x4; 43 | float4x4 UVTransform4x4; 44 | float3 EyePosition; 45 | }; 46 | 47 | cbuffer MiscVars : register(b3) 48 | { 49 | float ViewportWidth; 50 | float ViewportHeight; 51 | float Time; 52 | }; 53 | 54 | struct V2P 55 | { 56 | float4 pos : SV_POSITION; 57 | float4 diffuse : COLOR; 58 | float2 uv : TEXCOORD0; 59 | float3 worldNorm : TEXCOORD1; 60 | float3 worldPos : TEXCOORD2; 61 | float3 toEye : TEXCOORD3; 62 | float4 tangent : TEXCOORD4; 63 | float3 normal : TEXCOORD5; 64 | }; 65 | 66 | struct P2F 67 | { 68 | float4 fragment : SV_Target; 69 | }; 70 | 71 | // 72 | // combines a float3 RGB value with an alpha value into a float4 73 | // 74 | float4 CombineRGBWithAlpha(float3 rgb, float a) 75 | { 76 | return float4(rgb.r, rgb.g, rgb.b, a); 77 | } 78 | 79 | P2F main(V2P pixel) 80 | { 81 | P2F result; 82 | 83 | result.fragment = pixel.diffuse; 84 | 85 | return result; 86 | } 87 | 88 | P2F mainTk(V2P pixel) 89 | { 90 | P2F result; 91 | 92 | result.fragment = pixel.diffuse; 93 | if (result.fragment.a == 0.0f) discard; 94 | 95 | return result; 96 | } 97 | 98 | P2F mainTx(V2P pixel) 99 | { 100 | P2F result; 101 | 102 | // we need to normalize incoming vectors 103 | float3 surfaceNormal = normalize(pixel.normal); 104 | float3 surfaceTangent = normalize(pixel.tangent.xyz); 105 | float3 worldNormal = normalize(pixel.worldNorm); 106 | float3 toEyeVector = normalize(pixel.toEye); 107 | 108 | // construct tangent matrix 109 | float3x3 localToTangent = transpose(float3x3(surfaceTangent, cross(surfaceNormal, surfaceTangent) * pixel.tangent.w, surfaceNormal)); 110 | float3x3 worldToTangent = mul((float3x3)WorldToLocal4x4, localToTangent); 111 | 112 | // transform some vectors into tangent space 113 | float3 tangentLightDir = normalize(mul(LightDirection[0], worldToTangent)); 114 | float3 tangentToEyeVec = normalize(mul(toEyeVector, worldToTangent)); 115 | 116 | // BEGIN GENERATED CODE 117 | float3 local3 = pixel.diffuse.rgb * Texture1.Sample(TexSampler, pixel.uv).rgb; 118 | float local4 = pixel.diffuse.a * Texture1.Sample(TexSampler, pixel.uv).a; 119 | result.fragment = CombineRGBWithAlpha(local3, local4); 120 | // END GENERATED CODE 121 | 122 | return result; 123 | } 124 | 125 | P2F mainTxTk(V2P pixel) 126 | { 127 | P2F result; 128 | 129 | // we need to normalize incoming vectors 130 | float3 surfaceNormal = normalize(pixel.normal); 131 | float3 surfaceTangent = normalize(pixel.tangent.xyz); 132 | float3 worldNormal = normalize(pixel.worldNorm); 133 | float3 toEyeVector = normalize(pixel.toEye); 134 | 135 | // construct tangent matrix 136 | float3x3 localToTangent = transpose(float3x3(surfaceTangent, cross(surfaceNormal, surfaceTangent) * pixel.tangent.w, surfaceNormal)); 137 | float3x3 worldToTangent = mul((float3x3)WorldToLocal4x4, localToTangent); 138 | 139 | // transform some vectors into tangent space 140 | float3 tangentLightDir = normalize(mul(LightDirection[0], worldToTangent)); 141 | float3 tangentToEyeVec = normalize(mul(toEyeVector, worldToTangent)); 142 | 143 | // BEGIN GENERATED CODE 144 | float3 local3 = pixel.diffuse.rgb * Texture1.Sample(TexSampler, pixel.uv).rgb; 145 | float local4 = pixel.diffuse.a * Texture1.Sample(TexSampler, pixel.uv).a; 146 | result.fragment = CombineRGBWithAlpha(local3, local4); 147 | // END GENERATED CODE 148 | 149 | if (result.fragment.a == 0.0f) discard; 150 | 151 | return result; 152 | } 153 | 154 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/DualTextureEffect.fx: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | // 8 | // http://go.microsoft.com/fwlink/?LinkId=248929 9 | // http://create.msdn.com/en-US/education/catalog/sample/stock_effects 10 | 11 | 12 | Texture2D Texture : register(t0); 13 | Texture2D Texture2 : register(t1); 14 | 15 | sampler Sampler : register(s0); 16 | sampler Sampler2 : register(s1); 17 | 18 | 19 | cbuffer Parameters : register(b0) 20 | { 21 | float4 DiffuseColor : packoffset(c0); 22 | float3 FogColor : packoffset(c1); 23 | float4 FogVector : packoffset(c2); 24 | float4x4 WorldViewProj : packoffset(c3); 25 | }; 26 | 27 | 28 | #include "Structures.fxh" 29 | #include "Common.fxh" 30 | 31 | 32 | // Vertex shader: basic. 33 | VSOutputTx2 VSDualTexture(VSInputTx2 vin) 34 | { 35 | VSOutputTx2 vout; 36 | 37 | CommonVSOutput cout = ComputeCommonVSOutput(vin.Position); 38 | SetCommonVSOutputParams; 39 | 40 | vout.TexCoord = vin.TexCoord; 41 | vout.TexCoord2 = vin.TexCoord2; 42 | 43 | return vout; 44 | } 45 | 46 | 47 | // Vertex shader: no fog. 48 | VSOutputTx2NoFog VSDualTextureNoFog(VSInputTx2 vin) 49 | { 50 | VSOutputTx2NoFog vout; 51 | 52 | CommonVSOutput cout = ComputeCommonVSOutput(vin.Position); 53 | SetCommonVSOutputParamsNoFog; 54 | 55 | vout.TexCoord = vin.TexCoord; 56 | vout.TexCoord2 = vin.TexCoord2; 57 | 58 | return vout; 59 | } 60 | 61 | 62 | // Vertex shader: vertex color. 63 | VSOutputTx2 VSDualTextureVc(VSInputTx2Vc vin) 64 | { 65 | VSOutputTx2 vout; 66 | 67 | CommonVSOutput cout = ComputeCommonVSOutput(vin.Position); 68 | SetCommonVSOutputParams; 69 | 70 | vout.TexCoord = vin.TexCoord; 71 | vout.TexCoord2 = vin.TexCoord2; 72 | vout.Diffuse *= vin.Color; 73 | 74 | return vout; 75 | } 76 | 77 | 78 | // Vertex shader: vertex color, no fog. 79 | VSOutputTx2NoFog VSDualTextureVcNoFog(VSInputTx2Vc vin) 80 | { 81 | VSOutputTx2NoFog vout; 82 | 83 | CommonVSOutput cout = ComputeCommonVSOutput(vin.Position); 84 | SetCommonVSOutputParamsNoFog; 85 | 86 | vout.TexCoord = vin.TexCoord; 87 | vout.TexCoord2 = vin.TexCoord2; 88 | vout.Diffuse *= vin.Color; 89 | 90 | return vout; 91 | } 92 | 93 | 94 | // Pixel shader: basic. 95 | float4 PSDualTexture(PSInputTx2 pin) : SV_Target0 96 | { 97 | float4 color = Texture.Sample(Sampler, pin.TexCoord); 98 | float4 overlay = Texture2.Sample(Sampler2, pin.TexCoord2); 99 | 100 | color.rgb *= 2; 101 | color *= overlay * pin.Diffuse; 102 | 103 | ApplyFog(color, pin.Specular.w); 104 | 105 | return color; 106 | } 107 | 108 | 109 | // Pixel shader: no fog. 110 | float4 PSDualTextureNoFog(PSInputTx2NoFog pin) : SV_Target0 111 | { 112 | float4 color = Texture.Sample(Sampler, pin.TexCoord); 113 | float4 overlay = Texture2.Sample(Sampler2, pin.TexCoord2); 114 | 115 | color.rgb *= 2; 116 | color *= overlay * pin.Diffuse; 117 | 118 | return color; 119 | } 120 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/EnvironmentMapEffect.fx: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | // 8 | // http://go.microsoft.com/fwlink/?LinkId=248929 9 | // http://create.msdn.com/en-US/education/catalog/sample/stock_effects 10 | 11 | 12 | Texture2D Texture : register(t0); 13 | TextureCube EnvironmentMap : register(t1); 14 | 15 | sampler Sampler : register(s0); 16 | sampler EnvMapSampler : register(s1); 17 | 18 | 19 | cbuffer Parameters : register(b0) 20 | { 21 | float3 EnvironmentMapSpecular : packoffset(c0); 22 | float EnvironmentMapAmount : packoffset(c1.x); 23 | float FresnelFactor : packoffset(c1.y); 24 | 25 | float4 DiffuseColor : packoffset(c2); 26 | float3 EmissiveColor : packoffset(c3); 27 | 28 | float3 LightDirection[3] : packoffset(c4); 29 | float3 LightDiffuseColor[3] : packoffset(c7); 30 | 31 | float3 EyePosition : packoffset(c10); 32 | 33 | float3 FogColor : packoffset(c11); 34 | float4 FogVector : packoffset(c12); 35 | 36 | float4x4 World : packoffset(c13); 37 | float3x3 WorldInverseTranspose : packoffset(c17); 38 | float4x4 WorldViewProj : packoffset(c20); 39 | }; 40 | 41 | 42 | // We don't use these parameters, but Lighting.fxh won't compile without them. 43 | #define SpecularPower 0 44 | #define SpecularColor 0 45 | #define LightSpecularColor float3(0, 0, 0) 46 | 47 | 48 | #include "Structures.fxh" 49 | #include "Common.fxh" 50 | #include "Lighting.fxh" 51 | 52 | 53 | float ComputeFresnelFactor(float3 eyeVector, float3 worldNormal) 54 | { 55 | float viewAngle = dot(eyeVector, worldNormal); 56 | 57 | return pow(max(1 - abs(viewAngle), 0), FresnelFactor) * EnvironmentMapAmount; 58 | } 59 | 60 | 61 | VSOutputTxEnvMap ComputeEnvMapVSOutput(VSInputNmTx vin, uniform bool useFresnel, uniform int numLights) 62 | { 63 | VSOutputTxEnvMap vout; 64 | 65 | float4 pos_ws = mul(vin.Position, World); 66 | float3 eyeVector = normalize(EyePosition - pos_ws.xyz); 67 | float3 worldNormal = normalize(mul(vin.Normal, WorldInverseTranspose)); 68 | 69 | ColorPair lightResult = ComputeLights(eyeVector, worldNormal, numLights); 70 | 71 | vout.PositionPS = mul(vin.Position, WorldViewProj); 72 | vout.Diffuse = float4(lightResult.Diffuse, DiffuseColor.a); 73 | 74 | if (useFresnel) 75 | vout.Specular.rgb = ComputeFresnelFactor(eyeVector, worldNormal); 76 | else 77 | vout.Specular.rgb = EnvironmentMapAmount; 78 | 79 | vout.Specular.a = ComputeFogFactor(vin.Position); 80 | vout.TexCoord = vin.TexCoord; 81 | vout.EnvCoord = reflect(-eyeVector, worldNormal); 82 | 83 | return vout; 84 | } 85 | 86 | 87 | // Vertex shader: basic. 88 | VSOutputTxEnvMap VSEnvMap(VSInputNmTx vin) 89 | { 90 | return ComputeEnvMapVSOutput(vin, false, 3); 91 | } 92 | 93 | 94 | // Vertex shader: fresnel. 95 | VSOutputTxEnvMap VSEnvMapFresnel(VSInputNmTx vin) 96 | { 97 | return ComputeEnvMapVSOutput(vin, true, 3); 98 | } 99 | 100 | 101 | // Vertex shader: one light. 102 | VSOutputTxEnvMap VSEnvMapOneLight(VSInputNmTx vin) 103 | { 104 | return ComputeEnvMapVSOutput(vin, false, 1); 105 | } 106 | 107 | 108 | // Vertex shader: one light, fresnel. 109 | VSOutputTxEnvMap VSEnvMapOneLightFresnel(VSInputNmTx vin) 110 | { 111 | return ComputeEnvMapVSOutput(vin, true, 1); 112 | } 113 | 114 | 115 | // Pixel shader: basic. 116 | float4 PSEnvMap(PSInputTxEnvMap pin) : SV_Target0 117 | { 118 | float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse; 119 | float4 envmap = EnvironmentMap.Sample(EnvMapSampler, pin.EnvCoord) * color.a; 120 | 121 | color.rgb = lerp(color.rgb, envmap.rgb, pin.Specular.rgb); 122 | 123 | ApplyFog(color, pin.Specular.w); 124 | 125 | return color; 126 | } 127 | 128 | 129 | // Pixel shader: no fog. 130 | float4 PSEnvMapNoFog(PSInputTxEnvMap pin) : SV_Target0 131 | { 132 | float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse; 133 | float4 envmap = EnvironmentMap.Sample(EnvMapSampler, pin.EnvCoord) * color.a; 134 | 135 | color.rgb = lerp(color.rgb, envmap.rgb, pin.Specular.rgb); 136 | 137 | return color; 138 | } 139 | 140 | 141 | // Pixel shader: specular. 142 | float4 PSEnvMapSpecular(PSInputTxEnvMap pin) : SV_Target0 143 | { 144 | float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse; 145 | float4 envmap = EnvironmentMap.Sample(EnvMapSampler, pin.EnvCoord) * color.a; 146 | 147 | color.rgb = lerp(color.rgb, envmap.rgb, pin.Specular.rgb); 148 | color.rgb += EnvironmentMapSpecular * envmap.a; 149 | 150 | ApplyFog(color, pin.Specular.w); 151 | 152 | return color; 153 | } 154 | 155 | 156 | // Pixel shader: specular, no fog. 157 | float4 PSEnvMapSpecularNoFog(PSInputTxEnvMap pin) : SV_Target0 158 | { 159 | float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse; 160 | float4 envmap = EnvironmentMap.Sample(EnvMapSampler, pin.EnvCoord) * color.a; 161 | 162 | color.rgb = lerp(color.rgb, envmap.rgb, pin.Specular.rgb); 163 | color.rgb += EnvironmentMapSpecular * envmap.a; 164 | 165 | return color; 166 | } 167 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/Lighting.fxh: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | // 8 | // http://go.microsoft.com/fwlink/?LinkId=248929 9 | // http://create.msdn.com/en-US/education/catalog/sample/stock_effects 10 | 11 | 12 | struct ColorPair 13 | { 14 | float3 Diffuse; 15 | float3 Specular; 16 | }; 17 | 18 | 19 | ColorPair ComputeLights(float3 eyeVector, float3 worldNormal, uniform int numLights) 20 | { 21 | float3x3 lightDirections = 0; 22 | float3x3 lightDiffuse = 0; 23 | float3x3 lightSpecular = 0; 24 | float3x3 halfVectors = 0; 25 | 26 | [unroll] 27 | for (int i = 0; i < numLights; i++) 28 | { 29 | lightDirections[i] = LightDirection[i]; 30 | lightDiffuse[i] = LightDiffuseColor[i]; 31 | lightSpecular[i] = LightSpecularColor[i]; 32 | 33 | halfVectors[i] = normalize(eyeVector - lightDirections[i]); 34 | } 35 | 36 | float3 dotL = mul(-lightDirections, worldNormal); 37 | float3 dotH = mul(halfVectors, worldNormal); 38 | 39 | float3 zeroL = step(0, dotL); 40 | 41 | float3 diffuse = zeroL * dotL; 42 | float3 specular = pow(max(dotH, 0) * zeroL, SpecularPower); 43 | 44 | ColorPair result; 45 | 46 | result.Diffuse = mul(diffuse, lightDiffuse) * DiffuseColor.rgb + EmissiveColor; 47 | result.Specular = mul(specular, lightSpecular) * SpecularColor; 48 | 49 | return result; 50 | } 51 | 52 | 53 | CommonVSOutput ComputeCommonVSOutputWithLighting(float4 position, float3 normal, uniform int numLights) 54 | { 55 | CommonVSOutput vout; 56 | 57 | float4 pos_ws = mul(position, World); 58 | float3 eyeVector = normalize(EyePosition - pos_ws.xyz); 59 | float3 worldNormal = normalize(mul(normal, WorldInverseTranspose)); 60 | 61 | ColorPair lightResult = ComputeLights(eyeVector, worldNormal, numLights); 62 | 63 | vout.Pos_ps = mul(position, WorldViewProj); 64 | vout.Diffuse = float4(lightResult.Diffuse, DiffuseColor.a); 65 | vout.Specular = lightResult.Specular; 66 | vout.FogFactor = ComputeFogFactor(position); 67 | 68 | return vout; 69 | } 70 | 71 | 72 | struct CommonVSOutputPixelLighting 73 | { 74 | float4 Pos_ps; 75 | float3 Pos_ws; 76 | float3 Normal_ws; 77 | float FogFactor; 78 | }; 79 | 80 | 81 | CommonVSOutputPixelLighting ComputeCommonVSOutputPixelLighting(float4 position, float3 normal) 82 | { 83 | CommonVSOutputPixelLighting vout; 84 | 85 | vout.Pos_ps = mul(position, WorldViewProj); 86 | vout.Pos_ws = mul(position, World).xyz; 87 | vout.Normal_ws = normalize(mul(normal, WorldInverseTranspose)); 88 | vout.FogFactor = ComputeFogFactor(position); 89 | 90 | return vout; 91 | } 92 | 93 | 94 | #define SetCommonVSOutputParamsPixelLighting \ 95 | vout.PositionPS = cout.Pos_ps; \ 96 | vout.PositionWS = float4(cout.Pos_ws, cout.FogFactor); \ 97 | vout.NormalWS = cout.Normal_ws; 98 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/SpriteEffect.fx: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | // 8 | // http://go.microsoft.com/fwlink/?LinkId=248929 9 | // http://create.msdn.com/en-US/education/catalog/sample/stock_effects 10 | 11 | 12 | Texture2D Texture : register(t0); 13 | sampler TextureSampler : register(s0); 14 | 15 | 16 | cbuffer Parameters : register(b0) 17 | { 18 | row_major float4x4 MatrixTransform; 19 | }; 20 | 21 | 22 | void SpriteVertexShader(inout float4 color : COLOR0, 23 | inout float2 texCoord : TEXCOORD0, 24 | inout float4 position : SV_Position) 25 | { 26 | position = mul(position, MatrixTransform); 27 | } 28 | 29 | 30 | float4 SpritePixelShader(float4 color : COLOR0, 31 | float2 texCoord : TEXCOORD0) : SV_Target0 32 | { 33 | return Texture.Sample(TextureSampler, texCoord) * color; 34 | } 35 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/Shaders/Structures.fxh: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved. 7 | // 8 | // http://go.microsoft.com/fwlink/?LinkId=248929 9 | // http://create.msdn.com/en-US/education/catalog/sample/stock_effects 10 | 11 | 12 | // Vertex shader input structures. 13 | 14 | struct VSInput 15 | { 16 | float4 Position : SV_Position; 17 | }; 18 | 19 | struct VSInputVc 20 | { 21 | float4 Position : SV_Position; 22 | float4 Color : COLOR; 23 | }; 24 | 25 | struct VSInputTx 26 | { 27 | float4 Position : SV_Position; 28 | float2 TexCoord : TEXCOORD0; 29 | }; 30 | 31 | struct VSInputTxVc 32 | { 33 | float4 Position : SV_Position; 34 | float2 TexCoord : TEXCOORD0; 35 | float4 Color : COLOR; 36 | }; 37 | 38 | struct VSInputNm 39 | { 40 | float4 Position : SV_Position; 41 | float3 Normal : NORMAL; 42 | }; 43 | 44 | struct VSInputNmVc 45 | { 46 | float4 Position : SV_Position; 47 | float3 Normal : NORMAL; 48 | float4 Color : COLOR; 49 | }; 50 | 51 | struct VSInputNmTx 52 | { 53 | float4 Position : SV_Position; 54 | float3 Normal : NORMAL; 55 | float2 TexCoord : TEXCOORD0; 56 | }; 57 | 58 | struct VSInputNmTxVc 59 | { 60 | float4 Position : SV_Position; 61 | float3 Normal : NORMAL; 62 | float2 TexCoord : TEXCOORD0; 63 | float4 Color : COLOR; 64 | }; 65 | 66 | struct VSInputTx2 67 | { 68 | float4 Position : SV_Position; 69 | float2 TexCoord : TEXCOORD0; 70 | float2 TexCoord2 : TEXCOORD1; 71 | }; 72 | 73 | struct VSInputTx2Vc 74 | { 75 | float4 Position : SV_Position; 76 | float2 TexCoord : TEXCOORD0; 77 | float2 TexCoord2 : TEXCOORD1; 78 | float4 Color : COLOR; 79 | }; 80 | 81 | struct VSInputNmTxWeights 82 | { 83 | float4 Position : SV_Position; 84 | float3 Normal : NORMAL; 85 | float2 TexCoord : TEXCOORD0; 86 | uint4 Indices : BLENDINDICES0; 87 | float4 Weights : BLENDWEIGHT0; 88 | }; 89 | 90 | 91 | 92 | // Vertex shader output structures. 93 | 94 | struct VSOutput 95 | { 96 | float4 Diffuse : COLOR0; 97 | float4 Specular : COLOR1; 98 | float4 PositionPS : SV_Position; 99 | }; 100 | 101 | struct VSOutputNoFog 102 | { 103 | float4 Diffuse : COLOR0; 104 | float4 PositionPS : SV_Position; 105 | }; 106 | 107 | struct VSOutputTx 108 | { 109 | float4 Diffuse : COLOR0; 110 | float4 Specular : COLOR1; 111 | float2 TexCoord : TEXCOORD0; 112 | float4 PositionPS : SV_Position; 113 | }; 114 | 115 | struct VSOutputTxNoFog 116 | { 117 | float4 Diffuse : COLOR0; 118 | float2 TexCoord : TEXCOORD0; 119 | float4 PositionPS : SV_Position; 120 | }; 121 | 122 | struct VSOutputPixelLighting 123 | { 124 | float4 PositionWS : TEXCOORD0; 125 | float3 NormalWS : TEXCOORD1; 126 | float4 Diffuse : COLOR0; 127 | float4 PositionPS : SV_Position; 128 | }; 129 | 130 | struct VSOutputPixelLightingTx 131 | { 132 | float2 TexCoord : TEXCOORD0; 133 | float4 PositionWS : TEXCOORD1; 134 | float3 NormalWS : TEXCOORD2; 135 | float4 Diffuse : COLOR0; 136 | float4 PositionPS : SV_Position; 137 | }; 138 | 139 | struct VSOutputTx2 140 | { 141 | float4 Diffuse : COLOR0; 142 | float4 Specular : COLOR1; 143 | float2 TexCoord : TEXCOORD0; 144 | float2 TexCoord2 : TEXCOORD1; 145 | float4 PositionPS : SV_Position; 146 | }; 147 | 148 | struct VSOutputTx2NoFog 149 | { 150 | float4 Diffuse : COLOR0; 151 | float2 TexCoord : TEXCOORD0; 152 | float2 TexCoord2 : TEXCOORD1; 153 | float4 PositionPS : SV_Position; 154 | }; 155 | 156 | struct VSOutputTxEnvMap 157 | { 158 | float4 Diffuse : COLOR0; 159 | float4 Specular : COLOR1; 160 | float2 TexCoord : TEXCOORD0; 161 | float3 EnvCoord : TEXCOORD1; 162 | float4 PositionPS : SV_Position; 163 | }; 164 | 165 | 166 | 167 | // Pixel shader input structures. 168 | 169 | struct PSInput 170 | { 171 | float4 Diffuse : COLOR0; 172 | float4 Specular : COLOR1; 173 | }; 174 | 175 | struct PSInputNoFog 176 | { 177 | float4 Diffuse : COLOR0; 178 | }; 179 | 180 | struct PSInputTx 181 | { 182 | float4 Diffuse : COLOR0; 183 | float4 Specular : COLOR1; 184 | float2 TexCoord : TEXCOORD0; 185 | }; 186 | 187 | struct PSInputTxNoFog 188 | { 189 | float4 Diffuse : COLOR0; 190 | float2 TexCoord : TEXCOORD0; 191 | }; 192 | 193 | struct PSInputPixelLighting 194 | { 195 | float4 PositionWS : TEXCOORD0; 196 | float3 NormalWS : TEXCOORD1; 197 | float4 Diffuse : COLOR0; 198 | }; 199 | 200 | struct PSInputPixelLightingTx 201 | { 202 | float2 TexCoord : TEXCOORD0; 203 | float4 PositionWS : TEXCOORD1; 204 | float3 NormalWS : TEXCOORD2; 205 | float4 Diffuse : COLOR0; 206 | }; 207 | 208 | struct PSInputTx2 209 | { 210 | float4 Diffuse : COLOR0; 211 | float4 Specular : COLOR1; 212 | float2 TexCoord : TEXCOORD0; 213 | float2 TexCoord2 : TEXCOORD1; 214 | }; 215 | 216 | struct PSInputTx2NoFog 217 | { 218 | float4 Diffuse : COLOR0; 219 | float2 TexCoord : TEXCOORD0; 220 | float2 TexCoord2 : TEXCOORD1; 221 | }; 222 | 223 | struct PSInputTxEnvMap 224 | { 225 | float4 Diffuse : COLOR0; 226 | float4 Specular : COLOR1; 227 | float2 TexCoord : TEXCOORD0; 228 | float3 EnvCoord : TEXCOORD1; 229 | }; 230 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/SharedResourcePool.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: SharedResourcePool.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #include 17 | #include 18 | 19 | #include "PlatformHelpers.h" 20 | 21 | 22 | namespace DirectX 23 | { 24 | // Pool manager ensures that only a single TData instance is created for each unique TKey. 25 | // This is used to avoid duplicate resource creation, so that for instance a caller can 26 | // create any number of SpriteBatch instances, but these can internally share shaders and 27 | // vertex buffer if more than one SpriteBatch uses the same underlying D3D device. 28 | template 29 | class SharedResourcePool 30 | { 31 | public: 32 | SharedResourcePool() 33 | : mResourceMap(std::make_shared()) 34 | { } 35 | 36 | 37 | // Allocates or looks up the shared TData instance for the specified key. 38 | std::shared_ptr DemandCreate(TKey key) 39 | { 40 | std::lock_guard lock(mResourceMap->mutex); 41 | 42 | // Return an existing instance? 43 | auto pos = mResourceMap->find(key); 44 | 45 | if (pos != mResourceMap->end()) 46 | { 47 | auto existingValue = pos->second.lock(); 48 | 49 | if (existingValue) 50 | return existingValue; 51 | else 52 | mResourceMap->erase(pos); 53 | } 54 | 55 | // Allocate a new instance. 56 | auto newValue = std::make_shared(key, mResourceMap); 57 | 58 | mResourceMap->insert(std::make_pair(key, newValue)); 59 | 60 | return newValue; 61 | } 62 | 63 | 64 | private: 65 | // Keep track of all allocated TData instances. 66 | struct ResourceMap : public std::map> 67 | { 68 | std::mutex mutex; 69 | }; 70 | 71 | std::shared_ptr mResourceMap; 72 | 73 | 74 | // Wrap TData with our own subclass, so we can hook the destructor 75 | // to remove instances from our pool before they are freed. 76 | struct WrappedData : public TData 77 | { 78 | WrappedData(TKey key, std::shared_ptr const& resourceMap) 79 | : mKey(key), 80 | mResourceMap(resourceMap), 81 | TData(key) 82 | { } 83 | 84 | ~WrappedData() 85 | { 86 | std::lock_guard lock(mResourceMap->mutex); 87 | 88 | auto pos = mResourceMap->find(mKey); 89 | 90 | // Check for weak reference expiry before erasing, in case DemandCreate runs on 91 | // a different thread at the same time as a previous instance is being destroyed. 92 | // We mustn't erase replacement objects that have just been added! 93 | if (pos != mResourceMap->end() && pos->second.expired()) 94 | { 95 | mResourceMap->erase(pos); 96 | } 97 | } 98 | 99 | TKey mKey; 100 | std::shared_ptr mResourceMap; 101 | }; 102 | 103 | 104 | // Prevent copying. 105 | SharedResourcePool(SharedResourcePool const&); 106 | SharedResourcePool& operator= (SharedResourcePool const&); 107 | }; 108 | } 109 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/pch.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: pch.cpp 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #include "pch.h" 15 | -------------------------------------------------------------------------------- /extern/DirectXTK/Src/pch.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: pch.h 3 | // 4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | // PARTICULAR PURPOSE. 8 | // 9 | // Copyright (c) Microsoft Corporation. All rights reserved. 10 | // 11 | // http://go.microsoft.com/fwlink/?LinkId=248929 12 | //-------------------------------------------------------------------------------------- 13 | 14 | #pragma once 15 | 16 | #if !defined(WIN32_LEAN_AND_MEAN) 17 | #define WIN32_LEAN_AND_MEAN 18 | #endif 19 | 20 | #if !defined(NOMINMAX) 21 | #define NOMINMAX 22 | #endif 23 | 24 | #if defined(_XBOX_ONE) && defined(_TITLE) && MONOLITHIC 25 | #include 26 | #define DCOMMON_H_INCLUDED 27 | #define NO_D3D11_DEBUG_NAME 28 | #else 29 | #include 30 | #endif 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | // VS 2010's stdint.h conflicts with intsafe.h 45 | #pragma warning(push) 46 | #pragma warning(disable : 4005) 47 | #include 48 | #include 49 | #pragma warning(pop) 50 | 51 | #include 52 | 53 | namespace DirectX 54 | { 55 | #if (DIRECTXMATH_VERSION < 305) && !defined(XM_CALLCONV) 56 | #define XM_CALLCONV __fastcall 57 | typedef const XMVECTOR& HXMVECTOR; 58 | typedef const XMMATRIX& FXMMATRIX; 59 | #endif 60 | } -------------------------------------------------------------------------------- /extern/DirectXTK/Windows81SDKVS12_x64.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(ProgramFiles)\Windows Kits\8.1\bin\x64;$(ExecutablePath) 7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(IncludePath) 8 | $(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(LibraryPath) 9 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(ExcludePath) 10 | 11 | 12 | -------------------------------------------------------------------------------- /extern/DirectXTK/Windows81SDKVS12_x86.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(ProgramFiles)\Windows Kits\8.1\bin\x86;$(ExecutablePath) 7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(IncludePath) 8 | $(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x86;$(LibraryPath) 9 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(ExcludePath) 10 | 11 | 12 | -------------------------------------------------------------------------------- /extern/DirectXTK/Windows81SDK_x64.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(ProgramFiles)\Windows Kits\8.1\bin\x86;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH) 7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(FrameworkSDKDir)\include; 8 | $(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(FrameworkSDKDir)\lib\x64 9 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib; 10 | 11 | 12 | -------------------------------------------------------------------------------- /extern/DirectXTK/Windows81SDK_x86.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(ProgramFiles)\Windows Kits\8.1\bin\x86;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH) 7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(FrameworkSDKDir)\include; 8 | $(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x86;$(FrameworkSDKDir)\lib 9 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib; 10 | 11 | 12 | -------------------------------------------------------------------------------- /extern/DirectXTK/XWBTool/xwbtool_Desktop_2010.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /extern/DirectXTK/XWBTool/xwbtool_Desktop_2012.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /extern/DirectXTK/XWBTool/xwbtool_Desktop_2013.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | --------------------------------------------------------------------------------