diff --git a/.gitignore b/.gitignore index ac42ea82..a11f9238 100644 --- a/.gitignore +++ b/.gitignore @@ -49,4 +49,28 @@ Temp*/ #ignore build log file BuildErrors.log #ignore certification test results -Source/CertificationTests/Results/* \ No newline at end of file +Source/CertificationTests/Results/* +/External +/packages +/Source/VisualStudio +/Source/Tools +/Source/Tests +/Source/SharpDX.XInput +/Source/SharpDX.XAudio2 +/Source/SharpDX.RawInput +/Source/SharpDX.MediaFoundation +/Source/SharpDX.Mathematics +/Source/SharpDX.DXGI +/Source/SharpDX.DirectSound +/Source/SharpDX.DirectManipulation +/Source/SharpDX.DirectInput +/Source/SharpDX.DirectComposition +/Source/SharpDX.Direct3D9 +/Source/SharpDX.Direct3D12 +/Source/SharpDX.Direct3D11.Effects +/Source/SharpDX.Direct3D11 +/Source/SharpDX.Direct2D1 +/Source/SharpDX.Desktop +/Source/SharpDX.D3DCompiler +/Source/SharpDX.Animation +/Source/SharpDX diff --git a/SharpDX.sln b/SharpDX.sln index 03b24498..182d222c 100644 --- a/SharpDX.sln +++ b/SharpDX.sln @@ -1,1246 +1,1598 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30501.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sources", "Sources", "{CC8DB471-0644-430D-9D4B-808A2475BEC0}" - ProjectSection(SolutionItems) = preProject - Source\Mapping.Direct3D1x.xml = Source\Mapping.Direct3D1x.xml - Source\Mapping.xml = Source\Mapping.xml - Source\SharedAssemblyInfo.cs = Source\SharedAssemblyInfo.cs - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{F1AF9A3B-7856-46C9-992A-391E5455BF1F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX", "Source\SharpDX\SharpDX.csproj", "{D0BCD56A-41C4-4A4E-8590-26864CED07FF}" - ProjectSection(ProjectDependencies) = postProject - {31F85A16-CB01-4456-BE3C-76E9FF3A1343} = {31F85A16-CB01-4456-BE3C-76E9FF3A1343} - {4E2D9A17-2195-4A51-AAE3-924517440293} = {4E2D9A17-2195-4A51-AAE3-924517440293} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.D3DCompiler", "Source\SharpDX.D3DCompiler\SharpDX.D3DCompiler.csproj", "{361D3F81-A48A-47F2-80DF-CA4F9536CB4E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct2D1", "Source\SharpDX.Direct2D1\SharpDX.Direct2D1.csproj", "{C97878F4-1510-4BBA-8153-BD71DA7D50D8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D10", "Source\SharpDX.Direct3D10\SharpDX.Direct3D10.csproj", "{618AFA87-81A8-4B1C-8876-5457D49F2DEF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D11", "Source\SharpDX.Direct3D11\SharpDX.Direct3D11.csproj", "{736DFB52-1AFE-4EFF-9710-89046AB5B1F9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.DirectSound", "Source\SharpDX.DirectSound\SharpDX.DirectSound.csproj", "{E927F2D5-8E27-462A-8687-CB207EE01164}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.DXGI", "Source\SharpDX.DXGI\SharpDX.DXGI.csproj", "{3FC6DE77-B412-4101-9E64-6B9AA831179B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.XAudio2", "Source\SharpDX.XAudio2\SharpDX.XAudio2.csproj", "{4995127E-0B8E-45B8-80C4-6BAC1BBE3783}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D9", "Source\SharpDX.Direct3D9\SharpDX.Direct3D9.csproj", "{B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.DirectInput", "Source\SharpDX.DirectInput\SharpDX.DirectInput.csproj", "{112F146B-7C01-490B-B943-EA9341ACCAF2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SharpDX.WP8", "Source\SharpDX.WP8\SharpDX.WP8.vcxproj", "{C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCli", "Source\Tools\SharpCli\SharpCli.csproj", "{4E2D9A17-2195-4A51-AAE3-924517440293}" - ProjectSection(ProjectDependencies) = postProject - {5E597A82-9DE9-4BA5-AD76-51202190E951} = {5E597A82-9DE9-4BA5-AD76-51202190E951} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpGen", "Source\Tools\SharpGen\SharpGen.csproj", "{31F85A16-CB01-4456-BE3C-76E9FF3A1343}" - ProjectSection(ProjectDependencies) = postProject - {5E597A82-9DE9-4BA5-AD76-51202190E951} = {5E597A82-9DE9-4BA5-AD76-51202190E951} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpPak", "Source\Tools\SharpPak\SharpPak.csproj", "{5E597A82-9DE9-4BA5-AD76-51202190E951}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Documentation", "Documentation\Documentation.csproj", "{9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{57C5C966-ADB2-43F2-BB54-99BCB56C9F10}" - ProjectSection(SolutionItems) = preProject - ChangeLog.txt = ChangeLog.txt - README.markdown = README.markdown - ReleaseNotes.html = ReleaseNotes.html - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{1B526C0E-EE4A-4E8F-BF8F-8C7397FB4918}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.XACT3", "Source\SharpDX.XACT3\SharpDX.XACT3.csproj", "{4939860C-5D5B-4D56-89C8-1980A9EBB392}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.RawInput", "Source\SharpDX.RawInput\SharpDX.RawInput.csproj", "{05D17A7B-F200-48C0-B8F9-B7211665A17F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.XInput", "Source\SharpDX.XInput\SharpDX.XInput.csproj", "{764D7CE5-F78B-432E-A849-E40BA44522D6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{E462D87D-C180-4114-B8C8-914E6735BF44}" - ProjectSection(SolutionItems) = preProject - Source\Install.ps1 = Source\Install.ps1 - Build\SharpDX.build = Build\SharpDX.build - Build\SharpDX.PostSettings.targets = Build\SharpDX.PostSettings.targets - Build\SharpDX.PreSettings.targets = Build\SharpDX.PreSettings.targets - Build\SharpDX.targets = Build\SharpDX.targets - Build\SharpDX.Toolkit.targets = Build\SharpDX.Toolkit.targets - Source\uninstall.ps1 = Source\uninstall.ps1 - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Tests", "Source\Tests\SharpDX.Tests\SharpDX.Tests.csproj", "{931FA266-E756-41CA-9736-8B29235DC999}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Animation", "Source\SharpDX.Animation\SharpDX.Animation.csproj", "{874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.MediaFoundation", "Source\SharpDX.MediaFoundation\SharpDX.MediaFoundation.csproj", "{CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D11.Effects", "Source\SharpDX.Direct3D11.Effects\SharpDX.Direct3D11.Effects.csproj", "{BBB50A46-3291-4C62-B884-D1AB64F71EA5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Toolkit", "Toolkit", "{529B140D-B91D-49EA-B173-9ADD6AB2A2A3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Graphics", "Source\Toolkit\SharpDX.Toolkit.Graphics\SharpDX.Toolkit.Graphics.csproj", "{53EF08A7-4224-434C-A62C-F29807C1C750}" - ProjectSection(ProjectDependencies) = postProject - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702} = {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702} - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8} = {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Graphics.Tests", "Source\Tests\SharpDX.Toolkit.Graphics.Tests\SharpDX.Toolkit.Graphics.Tests.csproj", "{4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit", "Source\Toolkit\SharpDX.Toolkit\SharpDX.Toolkit.csproj", "{9FF0707C-75BB-4984-A01F-B9EAAD293F6C}" - ProjectSection(ProjectDependencies) = postProject - {49E4485F-3A2A-4C35-A159-12ECCFC00396} = {49E4485F-3A2A-4C35-A159-12ECCFC00396} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Compiler", "Source\Toolkit\SharpDX.Toolkit.Compiler\SharpDX.Toolkit.Compiler.csproj", "{8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tkfxc", "Source\Toolkit\tkfxc\tkfxc.csproj", "{BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpGitLog", "Source\Tools\SharpGitLog\SharpGitLog.csproj", "{15BA35B5-3E54-4715-8857-36F4F96F51FB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tkfont", "Source\Toolkit\tkfont\tkfont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Game", "Source\Toolkit\SharpDX.Toolkit.Game\SharpDX.Toolkit.Game.csproj", "{B2516A23-1A99-4263-964A-B820FD07FA80}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Input", "Source\Toolkit\SharpDX.Toolkit.Input\SharpDX.Toolkit.Input.csproj", "{46452614-6B06-400F-A74C-1632C79B762C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.CompilerTask", "Source\Toolkit\SharpDX.Toolkit.CompilerTask\SharpDX.Toolkit.CompilerTask.csproj", "{90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tkmodel", "Source\Toolkit\tkmodel\tkmodel.csproj", "{76FD0713-F217-4485-89B3-C6423DB46C58}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Yaml", "Source\Toolkit\SharpDX.Toolkit.Yaml\SharpDX.Toolkit.Yaml.csproj", "{ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Audio", "Source\Toolkit\SharpDX.Toolkit.Audio\SharpDX.Toolkit.Audio.csproj", "{1FA327C8-6C48-4FFC-9235-B98B7521B79D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.DirectComposition", "Source\SharpDX.DirectComposition\SharpDX.DirectComposition.csproj", "{FBE5DD99-00A0-4FED-A116-941A46A0C0D0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.DirectManipulation", "Source\SharpDX.DirectManipulation\SharpDX.DirectManipulation.csproj", "{F826CCCE-4B72-47F4-9493-DFCB51C106B7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Mathematics", "Source\SharpDX.Mathematics\SharpDX.Mathematics.csproj", "{49E4485F-3A2A-4C35-A159-12ECCFC00396}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Tests", "Source\Tests\SharpDX.Toolkit.Tests\SharpDX.Toolkit.Tests.csproj", "{EEFFFBCA-06D3-447E-85B0-E49FC5676744}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Desktop", "Source\SharpDX.Desktop\SharpDX.Desktop.csproj", "{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|DIRECTX11_2 = Debug|DIRECTX11_2 - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Net20 = Debug|Net20 - Debug|Net40 = Debug|Net40 - Debug|Win8 = Debug|Win8 - Debug|WP81 = Debug|WP81 - Debug|WP8-ARM = Debug|WP8-ARM - Debug|WP8-x86 = Debug|WP8-x86 - Release|DIRECTX11_2 = Release|DIRECTX11_2 - Release|Mixed Platforms = Release|Mixed Platforms - Release|Net20 = Release|Net20 - Release|Net40 = Release|Net40 - Release|Win8 = Release|Win8 - Release|WP81 = Release|WP81 - Release|WP8-ARM = Release|WP8-ARM - Release|WP8-x86 = Release|WP8-x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Net20.ActiveCfg = Debug|Net20 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Net20.Build.0 = Debug|Net20 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Net40.ActiveCfg = Debug|Net40 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Net40.Build.0 = Debug|Net40 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Win8.ActiveCfg = Debug|Win8 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Win8.Build.0 = Debug|Win8 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP81.ActiveCfg = Debug|WP81 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP81.Build.0 = Debug|WP81 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Net20.ActiveCfg = Release|Net20 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Net20.Build.0 = Release|Net20 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Net40.ActiveCfg = Release|Net40 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Net40.Build.0 = Release|Net40 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Win8.ActiveCfg = Release|Win8 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Win8.Build.0 = Release|Win8 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP81.ActiveCfg = Release|WP81 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP81.Build.0 = Release|WP81 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Net20.ActiveCfg = Debug|Net20 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Net20.Build.0 = Debug|Net20 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Net40.ActiveCfg = Debug|Net40 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Net40.Build.0 = Debug|Net40 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Win8.ActiveCfg = Debug|Win8 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Win8.Build.0 = Debug|Win8 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|WP81.ActiveCfg = Debug|WP81 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|WP81.Build.0 = Debug|WP81 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Net20.ActiveCfg = Release|Net20 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Net20.Build.0 = Release|Net20 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Net40.ActiveCfg = Release|Net40 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Net40.Build.0 = Release|Net40 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Win8.ActiveCfg = Release|Win8 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Win8.Build.0 = Release|Win8 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|WP81.ActiveCfg = Release|WP81 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|WP81.Build.0 = Release|WP81 - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Net20.ActiveCfg = Debug|Net20 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Net20.Build.0 = Debug|Net20 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Net40.ActiveCfg = Debug|Net40 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Net40.Build.0 = Debug|Net40 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Win8.ActiveCfg = Debug|Win8 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Win8.Build.0 = Debug|Win8 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|WP81.ActiveCfg = Debug|WP81 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|WP81.Build.0 = Debug|WP81 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Net20.ActiveCfg = Release|Net20 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Net20.Build.0 = Release|Net20 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Net40.ActiveCfg = Release|Net40 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Net40.Build.0 = Release|Net40 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Win8.ActiveCfg = Release|Win8 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Win8.Build.0 = Release|Win8 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|WP81.ActiveCfg = Release|WP81 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|WP81.Build.0 = Release|WP81 - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Net20.ActiveCfg = Debug|Net20 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Net20.Build.0 = Debug|Net20 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Net40.ActiveCfg = Debug|Net40 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Net40.Build.0 = Debug|Net40 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|Win8.ActiveCfg = Debug|Win8 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|WP81.ActiveCfg = Debug|WP81 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Net20.ActiveCfg = Release|Net20 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Net20.Build.0 = Release|Net20 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Net40.ActiveCfg = Release|Net40 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Net40.Build.0 = Release|Net40 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|Win8.ActiveCfg = Release|Win8 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|WP81.ActiveCfg = Release|WP81 - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {618AFA87-81A8-4B1C-8876-5457D49F2DEF}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Net20.ActiveCfg = Debug|Net20 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Net20.Build.0 = Debug|Net20 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Net40.ActiveCfg = Debug|Net40 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Net40.Build.0 = Debug|Net40 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Win8.ActiveCfg = Debug|Win8 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Win8.Build.0 = Debug|Win8 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP81.ActiveCfg = Debug|WP81 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP81.Build.0 = Debug|WP81 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Net20.ActiveCfg = Release|Net20 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Net20.Build.0 = Release|Net20 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Net40.ActiveCfg = Release|Net40 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Net40.Build.0 = Release|Net40 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Win8.ActiveCfg = Release|Win8 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Win8.Build.0 = Release|Win8 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP81.ActiveCfg = Release|WP81 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP81.Build.0 = Release|WP81 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Net20.ActiveCfg = Debug|Net20 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Net20.Build.0 = Debug|Net20 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Net40.ActiveCfg = Debug|Net40 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Net40.Build.0 = Debug|Net40 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Win8.ActiveCfg = Debug|Win8 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|WP81.ActiveCfg = Debug|WP81 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Net20.ActiveCfg = Release|Net20 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Net20.Build.0 = Release|Net20 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Net40.ActiveCfg = Release|Net40 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Net40.Build.0 = Release|Net40 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Win8.ActiveCfg = Release|Win8 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|WP81.ActiveCfg = Release|WP81 - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Net20.ActiveCfg = Debug|Net20 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Net20.Build.0 = Debug|Net20 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Net40.ActiveCfg = Debug|Net40 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Net40.Build.0 = Debug|Net40 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Win8.ActiveCfg = Debug|Win8 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Win8.Build.0 = Debug|Win8 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP81.ActiveCfg = Debug|WP81 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP81.Build.0 = Debug|WP81 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Net20.ActiveCfg = Release|Net20 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Net20.Build.0 = Release|Net20 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Net40.ActiveCfg = Release|Net40 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Net40.Build.0 = Release|Net40 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Win8.ActiveCfg = Release|Win8 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Win8.Build.0 = Release|Win8 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP81.ActiveCfg = Release|WP81 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP81.Build.0 = Release|WP81 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Net20.ActiveCfg = Debug|Net20 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Net20.Build.0 = Debug|Net20 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Net40.ActiveCfg = Debug|Net40 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Net40.Build.0 = Debug|Net40 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Win8.ActiveCfg = Debug|Win8 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Win8.Build.0 = Debug|Win8 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP81.ActiveCfg = Debug|WP81 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP81.Build.0 = Debug|WP81 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Net20.ActiveCfg = Release|Net20 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Net20.Build.0 = Release|Net20 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Net40.ActiveCfg = Release|Net40 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Net40.Build.0 = Release|Net40 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Win8.ActiveCfg = Release|Win8 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Win8.Build.0 = Release|Win8 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP81.ActiveCfg = Release|WP81 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP81.Build.0 = Release|WP81 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Net20.ActiveCfg = Debug|Net20 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Net20.Build.0 = Debug|Net20 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Net40.ActiveCfg = Debug|Net40 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Net40.Build.0 = Debug|Net40 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Win8.ActiveCfg = Debug|Win8 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|WP81.ActiveCfg = Debug|WP81 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Net20.ActiveCfg = Release|Net20 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Net20.Build.0 = Release|Net20 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Net40.ActiveCfg = Release|Net40 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Net40.Build.0 = Release|Net40 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Win8.ActiveCfg = Release|Win8 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|WP81.ActiveCfg = Release|WP81 - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Net20.ActiveCfg = Debug|Net20 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Net20.Build.0 = Debug|Net20 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Net40.ActiveCfg = Debug|Net40 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Net40.Build.0 = Debug|Net40 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Win8.ActiveCfg = Debug|Win8 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|WP81.ActiveCfg = Debug|WP81 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Net20.ActiveCfg = Release|Net20 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Net20.Build.0 = Release|Net20 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Net40.ActiveCfg = Release|Net40 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Net40.Build.0 = Release|Net40 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Win8.ActiveCfg = Release|Win8 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|WP81.ActiveCfg = Release|WP81 - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|DIRECTX11_2.ActiveCfg = Debug|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|Net20.ActiveCfg = Debug|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|Net40.ActiveCfg = Debug|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|Win8.ActiveCfg = Debug|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|WP81.ActiveCfg = Debug|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|WP8-ARM.ActiveCfg = Debug|ARM - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|WP8-ARM.Build.0 = Debug|ARM - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|WP8-x86.ActiveCfg = Debug|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Debug|WP8-x86.Build.0 = Debug|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|DIRECTX11_2.ActiveCfg = Release|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|Mixed Platforms.Build.0 = Release|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|Net20.ActiveCfg = Release|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|Net40.ActiveCfg = Release|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|Win8.ActiveCfg = Release|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|WP81.ActiveCfg = Release|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|WP8-ARM.ActiveCfg = Release|ARM - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|WP8-ARM.Build.0 = Release|ARM - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|WP8-x86.ActiveCfg = Release|Win32 - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4}.Release|WP8-x86.Build.0 = Release|Win32 - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Net20.ActiveCfg = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Net20.Build.0 = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Net40.ActiveCfg = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Net40.Build.0 = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Win8.ActiveCfg = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP81.ActiveCfg = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP81.Build.0 = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP8-ARM.Build.0 = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP8-x86.Build.0 = Debug|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|DIRECTX11_2.Build.0 = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Net20.ActiveCfg = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Net20.Build.0 = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Net40.ActiveCfg = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Net40.Build.0 = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Win8.ActiveCfg = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Win8.Build.0 = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP81.ActiveCfg = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP81.Build.0 = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP8-ARM.ActiveCfg = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP8-ARM.Build.0 = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP8-x86.ActiveCfg = Release|Any CPU - {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP8-x86.Build.0 = Release|Any CPU - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Net20.ActiveCfg = Debug|Net20 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Net20.Build.0 = Debug|Net20 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Net40.ActiveCfg = Debug|Net40 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Net40.Build.0 = Debug|Net40 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Win8.ActiveCfg = Debug|Win8 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Win8.Build.0 = Debug|Win8 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP81.ActiveCfg = Debug|WP81 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP81.Build.0 = Debug|WP81 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Net20.ActiveCfg = Release|Net20 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Net20.Build.0 = Release|Net20 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Net40.ActiveCfg = Release|Net40 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Net40.Build.0 = Release|Net40 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Win8.ActiveCfg = Release|Win8 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Win8.Build.0 = Release|Win8 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP81.ActiveCfg = Release|WP81 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP81.Build.0 = Release|WP81 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Net20.ActiveCfg = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Net20.Build.0 = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Net40.ActiveCfg = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Net40.Build.0 = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Win8.ActiveCfg = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|WP81.ActiveCfg = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|WP81.Build.0 = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|DIRECTX11_2.Build.0 = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Net20.ActiveCfg = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Net20.Build.0 = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Net40.ActiveCfg = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Net40.Build.0 = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Win8.ActiveCfg = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Win8.Build.0 = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|WP81.ActiveCfg = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|WP81.Build.0 = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|WP8-ARM.ActiveCfg = Release|Any CPU - {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|WP8-x86.ActiveCfg = Release|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Net20.ActiveCfg = Debug|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Net40.ActiveCfg = Debug|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Win8.ActiveCfg = Debug|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|WP81.ActiveCfg = Debug|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Net20.ActiveCfg = Release|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Net40.ActiveCfg = Release|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Win8.ActiveCfg = Release|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|WP81.ActiveCfg = Release|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|WP8-ARM.ActiveCfg = Release|Any CPU - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|WP8-x86.ActiveCfg = Release|Any CPU - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|Net20.ActiveCfg = Debug|Net20 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|Net20.Build.0 = Debug|Net20 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|Net40.ActiveCfg = Debug|Net40 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|Net40.Build.0 = Debug|Net40 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|Win8.ActiveCfg = Debug|Win8 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|WP81.ActiveCfg = Debug|WP81 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|Net20.ActiveCfg = Release|Net20 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|Net20.Build.0 = Release|Net20 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|Net40.ActiveCfg = Release|Net40 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|Net40.Build.0 = Release|Net40 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|Win8.ActiveCfg = Release|Win8 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|WP81.ActiveCfg = Release|WP81 - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {4939860C-5D5B-4D56-89C8-1980A9EBB392}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Net20.ActiveCfg = Debug|Net20 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Net20.Build.0 = Debug|Net20 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Net40.ActiveCfg = Debug|Net40 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Net40.Build.0 = Debug|Net40 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Win8.ActiveCfg = Debug|Win8 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|WP81.ActiveCfg = Debug|WP81 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Net20.ActiveCfg = Release|Net20 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Net20.Build.0 = Release|Net20 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Net40.ActiveCfg = Release|Net40 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Net40.Build.0 = Release|Net40 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Win8.ActiveCfg = Release|Win8 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|WP81.ActiveCfg = Release|WP81 - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Net20.ActiveCfg = Debug|Net20 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Net20.Build.0 = Debug|Net20 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Net40.ActiveCfg = Debug|Net40 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Net40.Build.0 = Debug|Net40 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Win8.ActiveCfg = Debug|Win8 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Win8.Build.0 = Debug|Win8 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|WP81.ActiveCfg = Debug|WP81 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Net20.ActiveCfg = Release|Net20 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Net20.Build.0 = Release|Net20 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Net40.ActiveCfg = Release|Net40 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Net40.Build.0 = Release|Net40 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Win8.ActiveCfg = Release|Win8 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Win8.Build.0 = Release|Win8 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|WP81.ActiveCfg = Release|WP81 - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Net20.ActiveCfg = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Net20.Build.0 = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Net40.ActiveCfg = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Net40.Build.0 = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Win8.ActiveCfg = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|WP81.ActiveCfg = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Release|Net20.ActiveCfg = Release|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Release|Net40.ActiveCfg = Release|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Release|Win8.ActiveCfg = Release|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Release|WP81.ActiveCfg = Release|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Release|WP8-ARM.ActiveCfg = Release|Any CPU - {931FA266-E756-41CA-9736-8B29235DC999}.Release|WP8-x86.ActiveCfg = Release|Any CPU - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Net20.ActiveCfg = Debug|Net20 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Net20.Build.0 = Debug|Net20 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Net40.ActiveCfg = Debug|Net40 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Win8.ActiveCfg = Debug|Win8 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|WP81.ActiveCfg = Debug|WP81 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Net20.ActiveCfg = Release|Net20 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Net40.ActiveCfg = Release|Net40 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Win8.ActiveCfg = Release|Win8 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|WP81.ActiveCfg = Release|WP81 - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Net20.ActiveCfg = Debug|Net20 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Net20.Build.0 = Debug|Net20 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Net40.ActiveCfg = Debug|Net40 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Net40.Build.0 = Debug|Net40 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Win8.ActiveCfg = Debug|Win8 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Win8.Build.0 = Debug|Win8 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP81.ActiveCfg = Debug|WP81 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP81.Build.0 = Debug|WP81 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Net20.ActiveCfg = Release|Net20 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Net20.Build.0 = Release|Net20 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Net40.ActiveCfg = Release|Net40 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Net40.Build.0 = Release|Net40 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Win8.ActiveCfg = Release|Win8 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Win8.Build.0 = Release|Win8 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP81.ActiveCfg = Release|WP81 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP81.Build.0 = Release|WP81 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Net20.ActiveCfg = Debug|Net20 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Net20.Build.0 = Debug|Net20 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Net40.ActiveCfg = Debug|Net40 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Net40.Build.0 = Debug|Net40 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Win8.ActiveCfg = Debug|Win8 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|WP81.ActiveCfg = Debug|WP81 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Net20.ActiveCfg = Release|Net20 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Net20.Build.0 = Release|Net20 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Net40.ActiveCfg = Release|Net40 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Net40.Build.0 = Release|Net40 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Win8.ActiveCfg = Release|Win8 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|WP81.ActiveCfg = Release|WP81 - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Net20.ActiveCfg = Debug|Net20 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Net20.Build.0 = Debug|Net20 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Net40.ActiveCfg = Debug|Net40 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Net40.Build.0 = Debug|Net40 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Win8.ActiveCfg = Debug|Win8 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Win8.Build.0 = Debug|Win8 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP81.ActiveCfg = Debug|WP81 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP81.Build.0 = Debug|WP81 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Net20.ActiveCfg = Release|Net20 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Net20.Build.0 = Release|Net20 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Net40.ActiveCfg = Release|Net40 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Net40.Build.0 = Release|Net40 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Win8.ActiveCfg = Release|Win8 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Win8.Build.0 = Release|Win8 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP81.ActiveCfg = Release|WP81 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP81.Build.0 = Release|WP81 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Net20.ActiveCfg = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Net20.Build.0 = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Net40.ActiveCfg = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Net40.Build.0 = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Win8.ActiveCfg = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|WP81.ActiveCfg = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Net20.ActiveCfg = Release|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Net20.Build.0 = Release|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Net40.ActiveCfg = Release|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Net40.Build.0 = Release|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Win8.ActiveCfg = Release|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|WP81.ActiveCfg = Release|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|WP8-ARM.ActiveCfg = Release|Any CPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|WP8-x86.ActiveCfg = Release|Any CPU - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Net20.ActiveCfg = Debug|Net20 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Net20.Build.0 = Debug|Net20 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Net40.ActiveCfg = Debug|Net40 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Net40.Build.0 = Debug|Net40 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Win8.ActiveCfg = Debug|Win8 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Win8.Build.0 = Debug|Win8 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP81.ActiveCfg = Debug|WP81 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP81.Build.0 = Debug|WP81 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Net20.ActiveCfg = Release|Net20 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Net20.Build.0 = Release|Net20 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Net40.ActiveCfg = Release|Net40 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Net40.Build.0 = Release|Net40 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Win8.ActiveCfg = Release|Win8 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Win8.Build.0 = Release|Win8 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP81.ActiveCfg = Release|WP81 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP81.Build.0 = Release|WP81 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Net20.ActiveCfg = Debug|Net20 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Net20.Build.0 = Debug|Net20 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Net40.ActiveCfg = Debug|Net40 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Net40.Build.0 = Debug|Net40 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Win8.ActiveCfg = Debug|Win8 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|WP81.ActiveCfg = Debug|WP81 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Net20.ActiveCfg = Release|Net20 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Net20.Build.0 = Release|Net20 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Net40.ActiveCfg = Release|Net40 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Net40.Build.0 = Release|Net40 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Win8.ActiveCfg = Release|Win8 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|WP81.ActiveCfg = Release|WP81 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Net20.ActiveCfg = Debug|Net20 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Net20.Build.0 = Debug|Net20 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Net40.ActiveCfg = Debug|Net40 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Net40.Build.0 = Debug|Net40 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Win8.ActiveCfg = Debug|Win8 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|WP81.ActiveCfg = Debug|WP81 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Net20.ActiveCfg = Release|Net20 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Net20.Build.0 = Release|Net20 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Net40.ActiveCfg = Release|Net40 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Net40.Build.0 = Release|Net40 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Win8.ActiveCfg = Release|Win8 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|WP81.ActiveCfg = Release|WP81 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Net20.ActiveCfg = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Net20.Build.0 = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Net40.ActiveCfg = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Net40.Build.0 = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Win8.ActiveCfg = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Win8.Build.0 = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|WP81.ActiveCfg = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|WP81.Build.0 = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|DIRECTX11_2.Build.0 = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Net20.ActiveCfg = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Net20.Build.0 = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Net40.ActiveCfg = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Net40.Build.0 = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Win8.ActiveCfg = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Win8.Build.0 = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|WP81.ActiveCfg = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|WP81.Build.0 = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|WP8-ARM.ActiveCfg = Release|Any CPU - {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|WP8-x86.ActiveCfg = Release|Any CPU - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Net20.ActiveCfg = Debug|Net20 - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Net20.Build.0 = Debug|Net20 - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Net40.ActiveCfg = Debug|Net40 - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Net40.Build.0 = Debug|Net40 - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win8.ActiveCfg = Debug|Win8 - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|WP81.ActiveCfg = Debug|WP81 - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {7329B02D-C504-482A-A156-181D48CE493C}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|Net20.ActiveCfg = Release|Net20 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|Net20.Build.0 = Release|Net20 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|Net40.ActiveCfg = Release|Net40 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|Net40.Build.0 = Release|Net40 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|Win8.ActiveCfg = Release|Win8 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|WP81.ActiveCfg = Release|WP81 - {7329B02D-C504-482A-A156-181D48CE493C}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {7329B02D-C504-482A-A156-181D48CE493C}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Net20.ActiveCfg = Debug|Net20 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Net20.Build.0 = Debug|Net20 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Net40.ActiveCfg = Debug|Net40 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Net40.Build.0 = Debug|Net40 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Win8.ActiveCfg = Debug|Win8 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Win8.Build.0 = Debug|Win8 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP81.ActiveCfg = Debug|WP81 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP81.Build.0 = Debug|WP81 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Net20.ActiveCfg = Release|Net20 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Net20.Build.0 = Release|Net20 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Net40.ActiveCfg = Release|Net40 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Net40.Build.0 = Release|Net40 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Win8.ActiveCfg = Release|Win8 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Win8.Build.0 = Release|Win8 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP81.ActiveCfg = Release|WP81 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP81.Build.0 = Release|WP81 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Net20.ActiveCfg = Debug|Net20 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Net20.Build.0 = Debug|Net20 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Net40.ActiveCfg = Debug|Net40 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Net40.Build.0 = Debug|Net40 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Win8.ActiveCfg = Debug|Win8 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Win8.Build.0 = Debug|Win8 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP81.ActiveCfg = Debug|WP81 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP81.Build.0 = Debug|WP81 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|Net20.ActiveCfg = Release|Net20 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|Net20.Build.0 = Release|Net20 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|Net40.ActiveCfg = Release|Net40 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|Net40.Build.0 = Release|Net40 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|Win8.ActiveCfg = Release|Win8 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|Win8.Build.0 = Release|Win8 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP81.ActiveCfg = Release|WP81 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP81.Build.0 = Release|WP81 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Net20.ActiveCfg = Debug|Net20 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Net40.ActiveCfg = Debug|Net40 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Net40.Build.0 = Debug|Net40 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Win8.ActiveCfg = Debug|Win8 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|WP81.ActiveCfg = Debug|WP81 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Net20.ActiveCfg = Release|Net20 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Net40.ActiveCfg = Release|Net40 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Net40.Build.0 = Release|Net40 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Win8.ActiveCfg = Release|Win8 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|WP81.ActiveCfg = Release|WP81 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Net20.ActiveCfg = Debug|Net20 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Net20.Build.0 = Debug|Net20 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Net40.ActiveCfg = Debug|Net40 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Net40.Build.0 = Debug|Net40 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Win8.ActiveCfg = Debug|Win8 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|WP81.ActiveCfg = Debug|WP81 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Net20.ActiveCfg = Release|Net20 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Net20.Build.0 = Release|Net20 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Net40.ActiveCfg = Release|Net40 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Net40.Build.0 = Release|Net40 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Win8.ActiveCfg = Release|Win8 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|WP81.ActiveCfg = Release|WP81 - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Net20.ActiveCfg = Debug|Net20 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Net20.Build.0 = Debug|Net20 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Net40.ActiveCfg = Debug|Net40 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Net40.Build.0 = Debug|Net40 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Win8.ActiveCfg = Debug|Win8 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Win8.Build.0 = Debug|Win8 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP81.ActiveCfg = Debug|WP81 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP81.Build.0 = Debug|WP81 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Net20.ActiveCfg = Release|Net20 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Net20.Build.0 = Release|Net20 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Net40.ActiveCfg = Release|Net40 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Net40.Build.0 = Release|Net40 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Win8.ActiveCfg = Release|Win8 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Win8.Build.0 = Release|Win8 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP81.ActiveCfg = Release|WP81 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP81.Build.0 = Release|WP81 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Net20.ActiveCfg = Debug|Net20 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Net20.Build.0 = Debug|Net20 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Net40.ActiveCfg = Debug|Net40 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Net40.Build.0 = Debug|Net40 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Win8.ActiveCfg = Debug|Win8 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Win8.Build.0 = Debug|Win8 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP81.ActiveCfg = Debug|WP81 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP81.Build.0 = Debug|WP81 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Net20.ActiveCfg = Release|Net20 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Net20.Build.0 = Release|Net20 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Net40.ActiveCfg = Release|Net40 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Net40.Build.0 = Release|Net40 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Win8.ActiveCfg = Release|Win8 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Win8.Build.0 = Release|Win8 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP81.ActiveCfg = Release|WP81 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP81.Build.0 = Release|WP81 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Net20.ActiveCfg = Debug|Net20 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Net40.ActiveCfg = Debug|Net40 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Win8.ActiveCfg = Debug|Win8 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|WP81.ActiveCfg = Debug|WP81 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Net20.ActiveCfg = Release|Net20 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Net40.ActiveCfg = Release|Net40 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Win8.ActiveCfg = Release|Win8 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|WP81.ActiveCfg = Release|WP81 - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Net20.ActiveCfg = Debug|Net20 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Net40.ActiveCfg = Debug|Net40 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Win8.ActiveCfg = Debug|Win8 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|WP81.ActiveCfg = Debug|WP81 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Net20.ActiveCfg = Release|Net20 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Net40.ActiveCfg = Release|Net40 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Win8.ActiveCfg = Release|Win8 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|WP81.ActiveCfg = Release|WP81 - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Mixed Platforms.ActiveCfg = Debug|Win8 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Mixed Platforms.Build.0 = Debug|Win8 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Net20.ActiveCfg = Debug|Net20 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Net20.Build.0 = Debug|Net20 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Net40.ActiveCfg = Debug|Net40 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Net40.Build.0 = Debug|Net40 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Win8.ActiveCfg = Debug|Win8 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Win8.Build.0 = Debug|Win8 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP81.ActiveCfg = Debug|WP81 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP81.Build.0 = Debug|WP81 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Mixed Platforms.ActiveCfg = Release|Win8 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Mixed Platforms.Build.0 = Release|Win8 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Net20.ActiveCfg = Release|Net20 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Net20.Build.0 = Release|Net20 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Net40.ActiveCfg = Release|Net40 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Net40.Build.0 = Release|Net40 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Win8.ActiveCfg = Release|Win8 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Win8.Build.0 = Release|Win8 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP81.ActiveCfg = Release|WP81 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP81.Build.0 = Release|WP81 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP8-ARM.Build.0 = Release|WP8-ARM - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 - {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP8-x86.Build.0 = Release|WP8-x86 - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Net20.ActiveCfg = Debug|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Net40.ActiveCfg = Debug|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Win8.ActiveCfg = Debug|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|WP81.ActiveCfg = Debug|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Net20.ActiveCfg = Release|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Net40.ActiveCfg = Release|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Win8.ActiveCfg = Release|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|WP81.ActiveCfg = Release|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|WP8-ARM.ActiveCfg = Release|Any CPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|WP8-x86.ActiveCfg = Release|Any CPU - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Net20.ActiveCfg = Debug|Net20 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Net20.Build.0 = Debug|Net20 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Net40.ActiveCfg = Debug|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Net40.Build.0 = Debug|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Win8.ActiveCfg = Debug|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|WP81.ActiveCfg = Debug|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|WP8-ARM.ActiveCfg = Debug|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|WP8-x86.ActiveCfg = Debug|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Mixed Platforms.ActiveCfg = Release|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Net20.ActiveCfg = Release|Net20 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Net20.Build.0 = Release|Net20 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Net40.ActiveCfg = Release|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Net40.Build.0 = Release|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Win8.ActiveCfg = Release|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|WP81.ActiveCfg = Release|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|WP8-ARM.ActiveCfg = Release|Net40 - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|WP8-x86.ActiveCfg = Release|Net40 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {D0BCD56A-41C4-4A4E-8590-26864CED07FF} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {361D3F81-A48A-47F2-80DF-CA4F9536CB4E} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {C97878F4-1510-4BBA-8153-BD71DA7D50D8} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {618AFA87-81A8-4B1C-8876-5457D49F2DEF} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {736DFB52-1AFE-4EFF-9710-89046AB5B1F9} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {E927F2D5-8E27-462A-8687-CB207EE01164} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {3FC6DE77-B412-4101-9E64-6B9AA831179B} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {4995127E-0B8E-45B8-80C4-6BAC1BBE3783} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {112F146B-7C01-490B-B943-EA9341ACCAF2} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {C6AE9847-3089-4FE4-91DF-B1A3EE115CF4} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {4E2D9A17-2195-4A51-AAE3-924517440293} = {F1AF9A3B-7856-46C9-992A-391E5455BF1F} - {31F85A16-CB01-4456-BE3C-76E9FF3A1343} = {F1AF9A3B-7856-46C9-992A-391E5455BF1F} - {5E597A82-9DE9-4BA5-AD76-51202190E951} = {F1AF9A3B-7856-46C9-992A-391E5455BF1F} - {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB} = {57C5C966-ADB2-43F2-BB54-99BCB56C9F10} - {4939860C-5D5B-4D56-89C8-1980A9EBB392} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {05D17A7B-F200-48C0-B8F9-B7211665A17F} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {764D7CE5-F78B-432E-A849-E40BA44522D6} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {931FA266-E756-41CA-9736-8B29235DC999} = {1B526C0E-EE4A-4E8F-BF8F-8C7397FB4918} - {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {BBB50A46-3291-4C62-B884-D1AB64F71EA5} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {53EF08A7-4224-434C-A62C-F29807C1C750} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9} = {1B526C0E-EE4A-4E8F-BF8F-8C7397FB4918} - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {15BA35B5-3E54-4715-8857-36F4F96F51FB} = {F1AF9A3B-7856-46C9-992A-391E5455BF1F} - {7329B02D-C504-482A-A156-181D48CE493C} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {B2516A23-1A99-4263-964A-B820FD07FA80} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {46452614-6B06-400F-A74C-1632C79B762C} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {76FD0713-F217-4485-89B3-C6423DB46C58} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {1FA327C8-6C48-4FFC-9235-B98B7521B79D} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} - {FBE5DD99-00A0-4FED-A116-941A46A0C0D0} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {F826CCCE-4B72-47F4-9493-DFCB51C106B7} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {49E4485F-3A2A-4C35-A159-12ECCFC00396} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - {EEFFFBCA-06D3-447E-85B0-E49FC5676744} = {1B526C0E-EE4A-4E8F-BF8F-8C7397FB4918} - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sources", "Sources", "{CC8DB471-0644-430D-9D4B-808A2475BEC0}" + ProjectSection(SolutionItems) = preProject + Source\Mapping.Direct3D1x.xml = Source\Mapping.Direct3D1x.xml + Source\Mapping.xml = Source\Mapping.xml + Source\SharedAssemblyInfo.cs = Source\SharedAssemblyInfo.cs + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{F1AF9A3B-7856-46C9-992A-391E5455BF1F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX", "Source\SharpDX\SharpDX.csproj", "{D0BCD56A-41C4-4A4E-8590-26864CED07FF}" + ProjectSection(ProjectDependencies) = postProject + {31F85A16-CB01-4456-BE3C-76E9FF3A1343} = {31F85A16-CB01-4456-BE3C-76E9FF3A1343} + {4E2D9A17-2195-4A51-AAE3-924517440293} = {4E2D9A17-2195-4A51-AAE3-924517440293} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.D3DCompiler", "Source\SharpDX.D3DCompiler\SharpDX.D3DCompiler.csproj", "{361D3F81-A48A-47F2-80DF-CA4F9536CB4E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct2D1", "Source\SharpDX.Direct2D1\SharpDX.Direct2D1.csproj", "{C97878F4-1510-4BBA-8153-BD71DA7D50D8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D11", "Source\SharpDX.Direct3D11\SharpDX.Direct3D11.csproj", "{736DFB52-1AFE-4EFF-9710-89046AB5B1F9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.DirectSound", "Source\SharpDX.DirectSound\SharpDX.DirectSound.csproj", "{E927F2D5-8E27-462A-8687-CB207EE01164}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.DXGI", "Source\SharpDX.DXGI\SharpDX.DXGI.csproj", "{3FC6DE77-B412-4101-9E64-6B9AA831179B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.XAudio2", "Source\SharpDX.XAudio2\SharpDX.XAudio2.csproj", "{4995127E-0B8E-45B8-80C4-6BAC1BBE3783}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D9", "Source\SharpDX.Direct3D9\SharpDX.Direct3D9.csproj", "{B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.DirectInput", "Source\SharpDX.DirectInput\SharpDX.DirectInput.csproj", "{112F146B-7C01-490B-B943-EA9341ACCAF2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCli", "Source\Tools\SharpCli\SharpCli.csproj", "{4E2D9A17-2195-4A51-AAE3-924517440293}" + ProjectSection(ProjectDependencies) = postProject + {5E597A82-9DE9-4BA5-AD76-51202190E951} = {5E597A82-9DE9-4BA5-AD76-51202190E951} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpGen", "Source\Tools\SharpGen\SharpGen.csproj", "{31F85A16-CB01-4456-BE3C-76E9FF3A1343}" + ProjectSection(ProjectDependencies) = postProject + {5E597A82-9DE9-4BA5-AD76-51202190E951} = {5E597A82-9DE9-4BA5-AD76-51202190E951} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpPak", "Source\Tools\SharpPak\SharpPak.csproj", "{5E597A82-9DE9-4BA5-AD76-51202190E951}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Documentation", "Documentation\Documentation.csproj", "{9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{57C5C966-ADB2-43F2-BB54-99BCB56C9F10}" + ProjectSection(SolutionItems) = preProject + ChangeLog.txt = ChangeLog.txt + README.markdown = README.markdown + ReleaseNotes.html = ReleaseNotes.html + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{1B526C0E-EE4A-4E8F-BF8F-8C7397FB4918}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.RawInput", "Source\SharpDX.RawInput\SharpDX.RawInput.csproj", "{05D17A7B-F200-48C0-B8F9-B7211665A17F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.XInput", "Source\SharpDX.XInput\SharpDX.XInput.csproj", "{764D7CE5-F78B-432E-A849-E40BA44522D6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{E462D87D-C180-4114-B8C8-914E6735BF44}" + ProjectSection(SolutionItems) = preProject + Source\Install.ps1 = Source\Install.ps1 + Build\SharpDX.build = Build\SharpDX.build + Build\SharpDX.PostSettings.targets = Build\SharpDX.PostSettings.targets + Build\SharpDX.PreSettings.targets = Build\SharpDX.PreSettings.targets + Build\SharpDX.targets = Build\SharpDX.targets + Build\SharpDX.Toolkit.targets = Build\SharpDX.Toolkit.targets + Source\uninstall.ps1 = Source\uninstall.ps1 + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Tests", "Source\Tests\SharpDX.Tests\SharpDX.Tests.csproj", "{931FA266-E756-41CA-9736-8B29235DC999}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Animation", "Source\SharpDX.Animation\SharpDX.Animation.csproj", "{874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.MediaFoundation", "Source\SharpDX.MediaFoundation\SharpDX.MediaFoundation.csproj", "{CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Direct3D11.Effects", "Source\SharpDX.Direct3D11.Effects\SharpDX.Direct3D11.Effects.csproj", "{BBB50A46-3291-4C62-B884-D1AB64F71EA5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Toolkit", "Toolkit", "{529B140D-B91D-49EA-B173-9ADD6AB2A2A3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Graphics", "Source\Toolkit\SharpDX.Toolkit.Graphics\SharpDX.Toolkit.Graphics.csproj", "{53EF08A7-4224-434C-A62C-F29807C1C750}" + ProjectSection(ProjectDependencies) = postProject + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702} = {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702} + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8} = {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Graphics.Tests", "Source\Tests\SharpDX.Toolkit.Graphics.Tests\SharpDX.Toolkit.Graphics.Tests.csproj", "{4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit", "Source\Toolkit\SharpDX.Toolkit\SharpDX.Toolkit.csproj", "{9FF0707C-75BB-4984-A01F-B9EAAD293F6C}" + ProjectSection(ProjectDependencies) = postProject + {49E4485F-3A2A-4C35-A159-12ECCFC00396} = {49E4485F-3A2A-4C35-A159-12ECCFC00396} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Compiler", "Source\Toolkit\SharpDX.Toolkit.Compiler\SharpDX.Toolkit.Compiler.csproj", "{8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tkfxc", "Source\Toolkit\tkfxc\tkfxc.csproj", "{BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpGitLog", "Source\Tools\SharpGitLog\SharpGitLog.csproj", "{15BA35B5-3E54-4715-8857-36F4F96F51FB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tkfont", "Source\Toolkit\tkfont\tkfont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Game", "Source\Toolkit\SharpDX.Toolkit.Game\SharpDX.Toolkit.Game.csproj", "{B2516A23-1A99-4263-964A-B820FD07FA80}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Input", "Source\Toolkit\SharpDX.Toolkit.Input\SharpDX.Toolkit.Input.csproj", "{46452614-6B06-400F-A74C-1632C79B762C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.CompilerTask", "Source\Toolkit\SharpDX.Toolkit.CompilerTask\SharpDX.Toolkit.CompilerTask.csproj", "{90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tkmodel", "Source\Toolkit\tkmodel\tkmodel.csproj", "{76FD0713-F217-4485-89B3-C6423DB46C58}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Yaml", "Source\Toolkit\SharpDX.Toolkit.Yaml\SharpDX.Toolkit.Yaml.csproj", "{ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Audio", "Source\Toolkit\SharpDX.Toolkit.Audio\SharpDX.Toolkit.Audio.csproj", "{1FA327C8-6C48-4FFC-9235-B98B7521B79D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.DirectComposition", "Source\SharpDX.DirectComposition\SharpDX.DirectComposition.csproj", "{FBE5DD99-00A0-4FED-A116-941A46A0C0D0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.DirectManipulation", "Source\SharpDX.DirectManipulation\SharpDX.DirectManipulation.csproj", "{F826CCCE-4B72-47F4-9493-DFCB51C106B7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Mathematics", "Source\SharpDX.Mathematics\SharpDX.Mathematics.csproj", "{49E4485F-3A2A-4C35-A159-12ECCFC00396}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Toolkit.Tests", "Source\Tests\SharpDX.Toolkit.Tests\SharpDX.Toolkit.Tests.csproj", "{EEFFFBCA-06D3-447E-85B0-E49FC5676744}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Desktop", "Source\SharpDX.Desktop\SharpDX.Desktop.csproj", "{5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Aftermath", "Aftermath", "{2C909E10-3315-48B3-85A2-52EC41977FC6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Velvet.Library.Common", "..\..\..\SVN\Projects\Aftermath\libraries\Velvet.Library.Common\Velvet.Library.Common.csproj", "{58ECA41D-A812-4CA7-AF43-61248BF38ADA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Velvet.Library.Common.WPF", "..\..\..\SVN\Projects\Aftermath\libraries\Velvet.Library.Common.WPF\Velvet.Library.Common.WPF.csproj", "{3FF81E9B-5515-4732-BD82-35E993568F5F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Velvet.Library.Game.Engine", "..\..\..\SVN\Projects\Aftermath\libraries\Velvet.Library.Game.Engine\Velvet.Library.Game.Engine.csproj", "{86F7C9E9-9248-4C52-A555-5B615A5C8E81}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Velvet.Library.Graphics", "..\..\..\SVN\Projects\Aftermath\libraries\Velvet.Library.Graphics\Velvet.Library.Graphics.csproj", "{C16CC339-2EF3-4245-AE46-0EB0C075D6B9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Velvet.Library.Render.Abstract", "..\..\..\SVN\Projects\Aftermath\libraries\Velvet.Library.Render.Abstract\Velvet.Library.Render.Abstract.csproj", "{502A2A15-5941-4838-B645-E37FDB93F3F2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Velvet.Library.Render.Forms.DirectX", "..\..\..\SVN\Projects\Aftermath\libraries\Velvet.Library.Render.Forms.DirectX\Velvet.Library.Render.Forms.DirectX.csproj", "{79E91E94-4182-4F91-8FF6-EC68DFA4B375}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Velvet.Library.UserInterface.Abstract", "..\..\..\SVN\Projects\Aftermath\libraries\Velvet.Library.UserInterface.Abstract\Velvet.Library.UserInterface.Abstract.csproj", "{101F52CD-1E89-460D-B8FD-1B8DEA3F428C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aftermath", "..\..\..\SVN\Projects\Aftermath\trunk\Aftermath\Aftermath.csproj", "{93515065-A548-4D58-B1AC-D0FCDD23717E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aftermath.Common", "..\..\..\SVN\Projects\Aftermath\trunk\Aftermath.Common\Aftermath.Common.csproj", "{85E43240-94F8-4176-846F-FBFD7C288FF5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|DIRECTX11_2 = Debug|DIRECTX11_2 + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Net20 = Debug|Net20 + Debug|Net40 = Debug|Net40 + Debug|Win8 = Debug|Win8 + Debug|WP81 = Debug|WP81 + Debug|WP8-ARM = Debug|WP8-ARM + Debug|WP8-x86 = Debug|WP8-x86 + Release|Any CPU = Release|Any CPU + Release|DIRECTX11_2 = Release|DIRECTX11_2 + Release|Mixed Platforms = Release|Mixed Platforms + Release|Net20 = Release|Net20 + Release|Net40 = Release|Net40 + Release|Win8 = Release|Win8 + Release|WP81 = Release|WP81 + Release|WP8-ARM = Release|WP8-ARM + Release|WP8-x86 = Release|WP8-x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Net20.ActiveCfg = Debug|Net20 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Net20.Build.0 = Debug|Net20 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Net40.ActiveCfg = Debug|Net40 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Net40.Build.0 = Debug|Net40 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Win8.ActiveCfg = Debug|Win8 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|Win8.Build.0 = Debug|Win8 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP81.ActiveCfg = Debug|WP81 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP81.Build.0 = Debug|WP81 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Net20.ActiveCfg = Release|Net20 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Net20.Build.0 = Release|Net20 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Net40.ActiveCfg = Release|Net40 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Net40.Build.0 = Release|Net40 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Win8.ActiveCfg = Release|Win8 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|Win8.Build.0 = Release|Win8 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP81.ActiveCfg = Release|WP81 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP81.Build.0 = Release|WP81 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {D0BCD56A-41C4-4A4E-8590-26864CED07FF}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Net20.ActiveCfg = Debug|Net20 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Net20.Build.0 = Debug|Net20 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Net40.ActiveCfg = Debug|Net40 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Net40.Build.0 = Debug|Net40 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Win8.ActiveCfg = Debug|Win8 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|Win8.Build.0 = Debug|Win8 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|WP81.ActiveCfg = Debug|WP81 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|WP81.Build.0 = Debug|WP81 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Net20.ActiveCfg = Release|Net20 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Net20.Build.0 = Release|Net20 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Net40.ActiveCfg = Release|Net40 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Net40.Build.0 = Release|Net40 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Win8.ActiveCfg = Release|Win8 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|Win8.Build.0 = Release|Win8 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|WP81.ActiveCfg = Release|WP81 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|WP81.Build.0 = Release|WP81 + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Net20.ActiveCfg = Debug|Net20 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Net20.Build.0 = Debug|Net20 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Net40.ActiveCfg = Debug|Net40 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Net40.Build.0 = Debug|Net40 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Win8.ActiveCfg = Debug|Win8 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|Win8.Build.0 = Debug|Win8 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|WP81.ActiveCfg = Debug|WP81 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|WP81.Build.0 = Debug|WP81 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Net20.ActiveCfg = Release|Net20 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Net20.Build.0 = Release|Net20 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Net40.ActiveCfg = Release|Net40 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Net40.Build.0 = Release|Net40 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Win8.ActiveCfg = Release|Win8 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|Win8.Build.0 = Release|Win8 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|WP81.ActiveCfg = Release|WP81 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|WP81.Build.0 = Release|WP81 + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {C97878F4-1510-4BBA-8153-BD71DA7D50D8}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Net20.ActiveCfg = Debug|Net20 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Net20.Build.0 = Debug|Net20 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Net40.ActiveCfg = Debug|Net40 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Net40.Build.0 = Debug|Net40 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Win8.ActiveCfg = Debug|Win8 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|Win8.Build.0 = Debug|Win8 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP81.ActiveCfg = Debug|WP81 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP81.Build.0 = Debug|WP81 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Net20.ActiveCfg = Release|Net20 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Net20.Build.0 = Release|Net20 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Net40.ActiveCfg = Release|Net40 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Net40.Build.0 = Release|Net40 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Win8.ActiveCfg = Release|Win8 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|Win8.Build.0 = Release|Win8 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP81.ActiveCfg = Release|WP81 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP81.Build.0 = Release|WP81 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Net20.ActiveCfg = Debug|Net20 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Net20.Build.0 = Debug|Net20 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Net40.ActiveCfg = Debug|Net40 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Net40.Build.0 = Debug|Net40 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|Win8.ActiveCfg = Debug|Win8 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|WP81.ActiveCfg = Debug|WP81 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {E927F2D5-8E27-462A-8687-CB207EE01164}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Net20.ActiveCfg = Release|Net20 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Net20.Build.0 = Release|Net20 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Net40.ActiveCfg = Release|Net40 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Net40.Build.0 = Release|Net40 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|Win8.ActiveCfg = Release|Win8 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|WP81.ActiveCfg = Release|WP81 + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {E927F2D5-8E27-462A-8687-CB207EE01164}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Net20.ActiveCfg = Debug|Net20 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Net20.Build.0 = Debug|Net20 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Net40.ActiveCfg = Debug|Net40 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Net40.Build.0 = Debug|Net40 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Win8.ActiveCfg = Debug|Win8 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|Win8.Build.0 = Debug|Win8 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP81.ActiveCfg = Debug|WP81 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP81.Build.0 = Debug|WP81 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Net20.ActiveCfg = Release|Net20 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Net20.Build.0 = Release|Net20 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Net40.ActiveCfg = Release|Net40 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Net40.Build.0 = Release|Net40 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Win8.ActiveCfg = Release|Win8 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|Win8.Build.0 = Release|Win8 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP81.ActiveCfg = Release|WP81 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP81.Build.0 = Release|WP81 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {3FC6DE77-B412-4101-9E64-6B9AA831179B}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Net20.ActiveCfg = Debug|Net20 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Net20.Build.0 = Debug|Net20 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Net40.ActiveCfg = Debug|Net40 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Net40.Build.0 = Debug|Net40 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Win8.ActiveCfg = Debug|Win8 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|Win8.Build.0 = Debug|Win8 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP81.ActiveCfg = Debug|WP81 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP81.Build.0 = Debug|WP81 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Net20.ActiveCfg = Release|Net20 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Net20.Build.0 = Release|Net20 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Net40.ActiveCfg = Release|Net40 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Net40.Build.0 = Release|Net40 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Win8.ActiveCfg = Release|Win8 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|Win8.Build.0 = Release|Win8 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP81.ActiveCfg = Release|WP81 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP81.Build.0 = Release|WP81 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Net20.ActiveCfg = Debug|Net20 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Net20.Build.0 = Debug|Net20 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Net40.ActiveCfg = Debug|Net40 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Net40.Build.0 = Debug|Net40 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|Win8.ActiveCfg = Debug|Win8 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|WP81.ActiveCfg = Debug|WP81 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Net20.ActiveCfg = Release|Net20 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Net20.Build.0 = Release|Net20 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Net40.ActiveCfg = Release|Net40 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Net40.Build.0 = Release|Net40 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|Win8.ActiveCfg = Release|Win8 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|WP81.ActiveCfg = Release|WP81 + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Net20.ActiveCfg = Debug|Net20 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Net20.Build.0 = Debug|Net20 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Net40.ActiveCfg = Debug|Net40 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Net40.Build.0 = Debug|Net40 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|Win8.ActiveCfg = Debug|Win8 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|WP81.ActiveCfg = Debug|WP81 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Net20.ActiveCfg = Release|Net20 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Net20.Build.0 = Release|Net20 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Net40.ActiveCfg = Release|Net40 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Net40.Build.0 = Release|Net40 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|Win8.ActiveCfg = Release|Win8 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|WP81.ActiveCfg = Release|WP81 + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {112F146B-7C01-490B-B943-EA9341ACCAF2}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Net20.ActiveCfg = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Net20.Build.0 = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Net40.ActiveCfg = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Net40.Build.0 = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|Win8.ActiveCfg = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP81.ActiveCfg = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP81.Build.0 = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Any CPU.Build.0 = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Net20.ActiveCfg = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Net20.Build.0 = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Net40.ActiveCfg = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Net40.Build.0 = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Win8.ActiveCfg = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|Win8.Build.0 = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP81.ActiveCfg = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP81.Build.0 = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP8-ARM.Build.0 = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {4E2D9A17-2195-4A51-AAE3-924517440293}.Release|WP8-x86.Build.0 = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Any CPU.Build.0 = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Net20.ActiveCfg = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Net20.Build.0 = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Net40.ActiveCfg = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Net40.Build.0 = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Win8.ActiveCfg = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|Win8.Build.0 = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP81.ActiveCfg = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP81.Build.0 = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Any CPU.ActiveCfg = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Any CPU.Build.0 = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Net20.ActiveCfg = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Net20.Build.0 = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Net40.ActiveCfg = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Net40.Build.0 = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Win8.ActiveCfg = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|Win8.Build.0 = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP81.ActiveCfg = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP81.Build.0 = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP8-ARM.Build.0 = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {31F85A16-CB01-4456-BE3C-76E9FF3A1343}.Release|WP8-x86.Build.0 = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Net20.ActiveCfg = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Net20.Build.0 = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Net40.ActiveCfg = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Net40.Build.0 = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|Win8.ActiveCfg = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|WP81.ActiveCfg = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|WP81.Build.0 = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Any CPU.Build.0 = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Net20.ActiveCfg = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Net20.Build.0 = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Net40.ActiveCfg = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Net40.Build.0 = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Win8.ActiveCfg = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|Win8.Build.0 = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|WP81.ActiveCfg = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|WP81.Build.0 = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {5E597A82-9DE9-4BA5-AD76-51202190E951}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Net20.ActiveCfg = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Net40.ActiveCfg = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|Win8.ActiveCfg = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|WP81.ActiveCfg = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Any CPU.Build.0 = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Net20.ActiveCfg = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Net40.ActiveCfg = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|Win8.ActiveCfg = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|WP81.ActiveCfg = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Net20.ActiveCfg = Debug|Net20 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Net20.Build.0 = Debug|Net20 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Net40.ActiveCfg = Debug|Net40 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Net40.Build.0 = Debug|Net40 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|Win8.ActiveCfg = Debug|Win8 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|WP81.ActiveCfg = Debug|WP81 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Net20.ActiveCfg = Release|Net20 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Net20.Build.0 = Release|Net20 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Net40.ActiveCfg = Release|Net40 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Net40.Build.0 = Release|Net40 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|Win8.ActiveCfg = Release|Win8 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|WP81.ActiveCfg = Release|WP81 + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {05D17A7B-F200-48C0-B8F9-B7211665A17F}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Net20.ActiveCfg = Debug|Net20 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Net20.Build.0 = Debug|Net20 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Net40.ActiveCfg = Debug|Net40 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Net40.Build.0 = Debug|Net40 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Win8.ActiveCfg = Debug|Win8 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|Win8.Build.0 = Debug|Win8 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|WP81.ActiveCfg = Debug|WP81 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Net20.ActiveCfg = Release|Net20 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Net20.Build.0 = Release|Net20 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Net40.ActiveCfg = Release|Net40 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Net40.Build.0 = Release|Net40 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Win8.ActiveCfg = Release|Win8 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|Win8.Build.0 = Release|Win8 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|WP81.ActiveCfg = Release|WP81 + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {764D7CE5-F78B-432E-A849-E40BA44522D6}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Net20.ActiveCfg = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Net20.Build.0 = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Net40.ActiveCfg = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Net40.Build.0 = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|Win8.ActiveCfg = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|WP81.ActiveCfg = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Release|Any CPU.ActiveCfg = Release|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Release|Net20.ActiveCfg = Release|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Release|Net40.ActiveCfg = Release|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Release|Win8.ActiveCfg = Release|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Release|WP81.ActiveCfg = Release|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {931FA266-E756-41CA-9736-8B29235DC999}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Net20.ActiveCfg = Debug|Net20 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Net20.Build.0 = Debug|Net20 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Net40.ActiveCfg = Debug|Net40 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|Win8.ActiveCfg = Debug|Win8 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|WP81.ActiveCfg = Debug|WP81 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Net20.ActiveCfg = Release|Net20 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Net40.ActiveCfg = Release|Net40 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|Win8.ActiveCfg = Release|Win8 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|WP81.ActiveCfg = Release|WP81 + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Net20.ActiveCfg = Debug|Net20 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Net20.Build.0 = Debug|Net20 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Net40.ActiveCfg = Debug|Net40 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Net40.Build.0 = Debug|Net40 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Win8.ActiveCfg = Debug|Win8 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|Win8.Build.0 = Debug|Win8 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP81.ActiveCfg = Debug|WP81 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP81.Build.0 = Debug|WP81 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Net20.ActiveCfg = Release|Net20 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Net20.Build.0 = Release|Net20 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Net40.ActiveCfg = Release|Net40 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Net40.Build.0 = Release|Net40 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Win8.ActiveCfg = Release|Win8 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|Win8.Build.0 = Release|Win8 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP81.ActiveCfg = Release|WP81 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP81.Build.0 = Release|WP81 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Net20.ActiveCfg = Debug|Net20 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Net20.Build.0 = Debug|Net20 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Net40.ActiveCfg = Debug|Net40 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Net40.Build.0 = Debug|Net40 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|Win8.ActiveCfg = Debug|Win8 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|WP81.ActiveCfg = Debug|WP81 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Net20.ActiveCfg = Release|Net20 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Net20.Build.0 = Release|Net20 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Net40.ActiveCfg = Release|Net40 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Net40.Build.0 = Release|Net40 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|Win8.ActiveCfg = Release|Win8 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|WP81.ActiveCfg = Release|WP81 + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {BBB50A46-3291-4C62-B884-D1AB64F71EA5}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Net20.ActiveCfg = Debug|Net20 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Net20.Build.0 = Debug|Net20 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Net40.ActiveCfg = Debug|Net40 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Net40.Build.0 = Debug|Net40 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Win8.ActiveCfg = Debug|Win8 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|Win8.Build.0 = Debug|Win8 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP81.ActiveCfg = Debug|WP81 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP81.Build.0 = Debug|WP81 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Net20.ActiveCfg = Release|Net20 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Net20.Build.0 = Release|Net20 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Net40.ActiveCfg = Release|Net40 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Net40.Build.0 = Release|Net40 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Win8.ActiveCfg = Release|Win8 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|Win8.Build.0 = Release|Win8 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP81.ActiveCfg = Release|WP81 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP81.Build.0 = Release|WP81 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {53EF08A7-4224-434C-A62C-F29807C1C750}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Net20.ActiveCfg = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Net20.Build.0 = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Net40.ActiveCfg = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Net40.Build.0 = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|Win8.ActiveCfg = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|WP81.ActiveCfg = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Any CPU.Build.0 = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Net20.ActiveCfg = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Net20.Build.0 = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Net40.ActiveCfg = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Net40.Build.0 = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|Win8.ActiveCfg = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|WP81.ActiveCfg = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Net20.ActiveCfg = Debug|Net20 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Net20.Build.0 = Debug|Net20 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Net40.ActiveCfg = Debug|Net40 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Net40.Build.0 = Debug|Net40 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Win8.ActiveCfg = Debug|Win8 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|Win8.Build.0 = Debug|Win8 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP81.ActiveCfg = Debug|WP81 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP81.Build.0 = Debug|WP81 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Net20.ActiveCfg = Release|Net20 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Net20.Build.0 = Release|Net20 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Net40.ActiveCfg = Release|Net40 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Net40.Build.0 = Release|Net40 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Win8.ActiveCfg = Release|Win8 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|Win8.Build.0 = Release|Win8 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP81.ActiveCfg = Release|WP81 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP81.Build.0 = Release|WP81 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Net20.ActiveCfg = Debug|Net20 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Net20.Build.0 = Debug|Net20 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Net40.ActiveCfg = Debug|Net40 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Net40.Build.0 = Debug|Net40 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|Win8.ActiveCfg = Debug|Win8 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|WP81.ActiveCfg = Debug|WP81 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Net20.ActiveCfg = Release|Net20 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Net20.Build.0 = Release|Net20 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Net40.ActiveCfg = Release|Net40 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Net40.Build.0 = Release|Net40 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|Win8.ActiveCfg = Release|Win8 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|WP81.ActiveCfg = Release|WP81 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Net20.ActiveCfg = Debug|Net20 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Net20.Build.0 = Debug|Net20 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Net40.ActiveCfg = Debug|Net40 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Net40.Build.0 = Debug|Net40 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|Win8.ActiveCfg = Debug|Win8 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|WP81.ActiveCfg = Debug|WP81 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Net20.ActiveCfg = Release|Net20 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Net20.Build.0 = Release|Net20 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Net40.ActiveCfg = Release|Net40 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Net40.Build.0 = Release|Net40 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|Win8.ActiveCfg = Release|Win8 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|WP81.ActiveCfg = Release|WP81 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Net20.ActiveCfg = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Net20.Build.0 = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Net40.ActiveCfg = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Net40.Build.0 = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Win8.ActiveCfg = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|Win8.Build.0 = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|WP81.ActiveCfg = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|WP81.Build.0 = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Any CPU.Build.0 = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Net20.ActiveCfg = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Net20.Build.0 = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Net40.ActiveCfg = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Net40.Build.0 = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Win8.ActiveCfg = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|Win8.Build.0 = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|WP81.ActiveCfg = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|WP81.Build.0 = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {15BA35B5-3E54-4715-8857-36F4F96F51FB}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Net20.ActiveCfg = Debug|Net20 + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Net20.Build.0 = Debug|Net20 + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Net40.ActiveCfg = Debug|Net40 + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Net40.Build.0 = Debug|Net40 + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win8.ActiveCfg = Debug|Win8 + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|WP81.ActiveCfg = Debug|WP81 + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {7329B02D-C504-482A-A156-181D48CE493C}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {7329B02D-C504-482A-A156-181D48CE493C}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|Net20.ActiveCfg = Release|Net20 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|Net20.Build.0 = Release|Net20 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|Net40.ActiveCfg = Release|Net40 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|Net40.Build.0 = Release|Net40 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|Win8.ActiveCfg = Release|Win8 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|WP81.ActiveCfg = Release|WP81 + {7329B02D-C504-482A-A156-181D48CE493C}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {7329B02D-C504-482A-A156-181D48CE493C}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Net20.ActiveCfg = Debug|Net20 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Net20.Build.0 = Debug|Net20 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Net40.ActiveCfg = Debug|Net40 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Net40.Build.0 = Debug|Net40 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Win8.ActiveCfg = Debug|Win8 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|Win8.Build.0 = Debug|Win8 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP81.ActiveCfg = Debug|WP81 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP81.Build.0 = Debug|WP81 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Net20.ActiveCfg = Release|Net20 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Net20.Build.0 = Release|Net20 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Net40.ActiveCfg = Release|Net40 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Net40.Build.0 = Release|Net40 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Win8.ActiveCfg = Release|Win8 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|Win8.Build.0 = Release|Win8 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP81.ActiveCfg = Release|WP81 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP81.Build.0 = Release|WP81 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {B2516A23-1A99-4263-964A-B820FD07FA80}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Net20.ActiveCfg = Debug|Net20 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Net20.Build.0 = Debug|Net20 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Net40.ActiveCfg = Debug|Net40 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Net40.Build.0 = Debug|Net40 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Win8.ActiveCfg = Debug|Win8 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|Win8.Build.0 = Debug|Win8 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP81.ActiveCfg = Debug|WP81 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP81.Build.0 = Debug|WP81 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {46452614-6B06-400F-A74C-1632C79B762C}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {46452614-6B06-400F-A74C-1632C79B762C}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|Net20.ActiveCfg = Release|Net20 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|Net20.Build.0 = Release|Net20 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|Net40.ActiveCfg = Release|Net40 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|Net40.Build.0 = Release|Net40 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|Win8.ActiveCfg = Release|Win8 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|Win8.Build.0 = Release|Win8 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP81.ActiveCfg = Release|WP81 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP81.Build.0 = Release|WP81 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {46452614-6B06-400F-A74C-1632C79B762C}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Net20.ActiveCfg = Debug|Net20 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Net40.ActiveCfg = Debug|Net40 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Net40.Build.0 = Debug|Net40 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|Win8.ActiveCfg = Debug|Win8 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|WP81.ActiveCfg = Debug|WP81 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Net20.ActiveCfg = Release|Net20 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Net40.ActiveCfg = Release|Net40 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Net40.Build.0 = Release|Net40 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|Win8.ActiveCfg = Release|Win8 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|WP81.ActiveCfg = Release|WP81 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Net20.ActiveCfg = Debug|Net20 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Net20.Build.0 = Debug|Net20 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Net40.ActiveCfg = Debug|Net40 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Net40.Build.0 = Debug|Net40 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|Win8.ActiveCfg = Debug|Win8 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|WP81.ActiveCfg = Debug|WP81 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {76FD0713-F217-4485-89B3-C6423DB46C58}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Net20.ActiveCfg = Release|Net20 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Net20.Build.0 = Release|Net20 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Net40.ActiveCfg = Release|Net40 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Net40.Build.0 = Release|Net40 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|Win8.ActiveCfg = Release|Win8 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|WP81.ActiveCfg = Release|WP81 + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {76FD0713-F217-4485-89B3-C6423DB46C58}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Net20.ActiveCfg = Debug|Net20 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Net20.Build.0 = Debug|Net20 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Net40.ActiveCfg = Debug|Net40 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Net40.Build.0 = Debug|Net40 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Win8.ActiveCfg = Debug|Win8 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|Win8.Build.0 = Debug|Win8 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP81.ActiveCfg = Debug|WP81 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP81.Build.0 = Debug|WP81 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Net20.ActiveCfg = Release|Net20 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Net20.Build.0 = Release|Net20 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Net40.ActiveCfg = Release|Net40 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Net40.Build.0 = Release|Net40 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Win8.ActiveCfg = Release|Win8 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|Win8.Build.0 = Release|Win8 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP81.ActiveCfg = Release|WP81 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP81.Build.0 = Release|WP81 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|DIRECTX11_2.Build.0 = Debug|DIRECTX11_2 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Net20.ActiveCfg = Debug|Net20 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Net20.Build.0 = Debug|Net20 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Net40.ActiveCfg = Debug|Net40 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Net40.Build.0 = Debug|Net40 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Win8.ActiveCfg = Debug|Win8 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|Win8.Build.0 = Debug|Win8 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP81.ActiveCfg = Debug|WP81 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP81.Build.0 = Debug|WP81 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Net20.ActiveCfg = Release|Net20 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Net20.Build.0 = Release|Net20 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Net40.ActiveCfg = Release|Net40 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Net40.Build.0 = Release|Net40 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Win8.ActiveCfg = Release|Win8 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|Win8.Build.0 = Release|Win8 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP81.ActiveCfg = Release|WP81 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP81.Build.0 = Release|WP81 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Net20.ActiveCfg = Debug|Net20 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Net40.ActiveCfg = Debug|Net40 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|Win8.ActiveCfg = Debug|Win8 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|WP81.ActiveCfg = Debug|WP81 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Net20.ActiveCfg = Release|Net20 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Net40.ActiveCfg = Release|Net40 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|Win8.ActiveCfg = Release|Win8 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|WP81.ActiveCfg = Release|WP81 + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Any CPU.ActiveCfg = Debug|WP8-ARM + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Mixed Platforms.ActiveCfg = Debug|WP8-x86 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Mixed Platforms.Build.0 = Debug|WP8-x86 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Net20.ActiveCfg = Debug|Net20 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Net40.ActiveCfg = Debug|Net40 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|Win8.ActiveCfg = Debug|Win8 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|WP81.ActiveCfg = Debug|WP81 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Any CPU.ActiveCfg = Release|WP8-ARM + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Mixed Platforms.ActiveCfg = Release|WP8-x86 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Mixed Platforms.Build.0 = Release|WP8-x86 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Net20.ActiveCfg = Release|Net20 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Net40.ActiveCfg = Release|Net40 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|Win8.ActiveCfg = Release|Win8 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|WP81.ActiveCfg = Release|WP81 + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {F826CCCE-4B72-47F4-9493-DFCB51C106B7}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Any CPU.ActiveCfg = Debug|WP8-x86 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Mixed Platforms.ActiveCfg = Debug|Win8 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Mixed Platforms.Build.0 = Debug|Win8 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Net20.ActiveCfg = Debug|Net20 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Net20.Build.0 = Debug|Net20 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Net40.ActiveCfg = Debug|Net40 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Net40.Build.0 = Debug|Net40 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Win8.ActiveCfg = Debug|Win8 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|Win8.Build.0 = Debug|Win8 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP81.ActiveCfg = Debug|WP81 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP81.Build.0 = Debug|WP81 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP8-ARM.ActiveCfg = Debug|WP8-ARM + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP8-ARM.Build.0 = Debug|WP8-ARM + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP8-x86.ActiveCfg = Debug|WP8-x86 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Debug|WP8-x86.Build.0 = Debug|WP8-x86 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Any CPU.ActiveCfg = Release|WP8-x86 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Mixed Platforms.ActiveCfg = Release|Win8 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Mixed Platforms.Build.0 = Release|Win8 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Net20.ActiveCfg = Release|Net20 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Net20.Build.0 = Release|Net20 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Net40.ActiveCfg = Release|Net40 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Net40.Build.0 = Release|Net40 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Win8.ActiveCfg = Release|Win8 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|Win8.Build.0 = Release|Win8 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP81.ActiveCfg = Release|WP81 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP81.Build.0 = Release|WP81 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP8-ARM.ActiveCfg = Release|WP8-ARM + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP8-ARM.Build.0 = Release|WP8-ARM + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP8-x86.ActiveCfg = Release|WP8-x86 + {49E4485F-3A2A-4C35-A159-12ECCFC00396}.Release|WP8-x86.Build.0 = Release|WP8-x86 + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Net20.ActiveCfg = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Net40.ActiveCfg = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|Win8.ActiveCfg = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|WP81.ActiveCfg = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Any CPU.Build.0 = Release|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Net20.ActiveCfg = Release|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Net40.ActiveCfg = Release|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|Win8.ActiveCfg = Release|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|WP81.ActiveCfg = Release|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Any CPU.ActiveCfg = Debug|Net20 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|DIRECTX11_2.ActiveCfg = Debug|DIRECTX11_2 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Net20.ActiveCfg = Debug|Net20 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Net20.Build.0 = Debug|Net20 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Net40.ActiveCfg = Debug|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Net40.Build.0 = Debug|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|Win8.ActiveCfg = Debug|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|WP81.ActiveCfg = Debug|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|WP8-ARM.ActiveCfg = Debug|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Debug|WP8-x86.ActiveCfg = Debug|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Any CPU.ActiveCfg = Release|Net20 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|DIRECTX11_2.ActiveCfg = Release|DIRECTX11_2 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|DIRECTX11_2.Build.0 = Release|DIRECTX11_2 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Mixed Platforms.ActiveCfg = Release|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Net20.ActiveCfg = Release|Net20 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Net20.Build.0 = Release|Net20 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Net40.ActiveCfg = Release|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Net40.Build.0 = Release|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|Win8.ActiveCfg = Release|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|WP81.ActiveCfg = Release|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|WP8-ARM.ActiveCfg = Release|Net40 + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B}.Release|WP8-x86.ActiveCfg = Release|Net40 + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|Net20.ActiveCfg = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|Net20.Build.0 = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|Net40.ActiveCfg = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|Net40.Build.0 = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|Win8.ActiveCfg = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|Win8.Build.0 = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|WP81.ActiveCfg = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|WP81.Build.0 = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|Any CPU.Build.0 = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|Net20.ActiveCfg = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|Net20.Build.0 = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|Net40.ActiveCfg = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|Net40.Build.0 = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|Win8.ActiveCfg = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|Win8.Build.0 = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|WP81.ActiveCfg = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|WP81.Build.0 = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|WP8-ARM.Build.0 = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {58ECA41D-A812-4CA7-AF43-61248BF38ADA}.Release|WP8-x86.Build.0 = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|Net20.ActiveCfg = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|Net20.Build.0 = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|Net40.ActiveCfg = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|Net40.Build.0 = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|Win8.ActiveCfg = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|Win8.Build.0 = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|WP81.ActiveCfg = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|WP81.Build.0 = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|Any CPU.Build.0 = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|Net20.ActiveCfg = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|Net20.Build.0 = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|Net40.ActiveCfg = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|Net40.Build.0 = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|Win8.ActiveCfg = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|Win8.Build.0 = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|WP81.ActiveCfg = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|WP81.Build.0 = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|WP8-ARM.Build.0 = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {3FF81E9B-5515-4732-BD82-35E993568F5F}.Release|WP8-x86.Build.0 = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|Net20.ActiveCfg = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|Net20.Build.0 = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|Net40.ActiveCfg = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|Net40.Build.0 = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|Win8.ActiveCfg = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|Win8.Build.0 = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|WP81.ActiveCfg = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|WP81.Build.0 = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|Any CPU.Build.0 = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|Net20.ActiveCfg = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|Net20.Build.0 = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|Net40.ActiveCfg = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|Net40.Build.0 = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|Win8.ActiveCfg = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|Win8.Build.0 = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|WP81.ActiveCfg = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|WP81.Build.0 = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|WP8-ARM.Build.0 = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {86F7C9E9-9248-4C52-A555-5B615A5C8E81}.Release|WP8-x86.Build.0 = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|Net20.ActiveCfg = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|Net20.Build.0 = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|Net40.ActiveCfg = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|Net40.Build.0 = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|Win8.ActiveCfg = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|Win8.Build.0 = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|WP81.ActiveCfg = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|WP81.Build.0 = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|Any CPU.Build.0 = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|Net20.ActiveCfg = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|Net20.Build.0 = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|Net40.ActiveCfg = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|Net40.Build.0 = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|Win8.ActiveCfg = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|Win8.Build.0 = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|WP81.ActiveCfg = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|WP81.Build.0 = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|WP8-ARM.Build.0 = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9}.Release|WP8-x86.Build.0 = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|Net20.ActiveCfg = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|Net20.Build.0 = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|Net40.ActiveCfg = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|Net40.Build.0 = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|Win8.ActiveCfg = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|Win8.Build.0 = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|WP81.ActiveCfg = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|WP81.Build.0 = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|Any CPU.Build.0 = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|Net20.ActiveCfg = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|Net20.Build.0 = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|Net40.ActiveCfg = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|Net40.Build.0 = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|Win8.ActiveCfg = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|Win8.Build.0 = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|WP81.ActiveCfg = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|WP81.Build.0 = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|WP8-ARM.Build.0 = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {502A2A15-5941-4838-B645-E37FDB93F3F2}.Release|WP8-x86.Build.0 = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|Net20.ActiveCfg = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|Net20.Build.0 = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|Net40.ActiveCfg = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|Net40.Build.0 = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|Win8.ActiveCfg = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|Win8.Build.0 = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|WP81.ActiveCfg = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|WP81.Build.0 = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|Any CPU.Build.0 = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|Net20.ActiveCfg = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|Net20.Build.0 = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|Net40.ActiveCfg = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|Net40.Build.0 = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|Win8.ActiveCfg = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|Win8.Build.0 = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|WP81.ActiveCfg = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|WP81.Build.0 = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|WP8-ARM.Build.0 = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {79E91E94-4182-4F91-8FF6-EC68DFA4B375}.Release|WP8-x86.Build.0 = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|Net20.ActiveCfg = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|Net20.Build.0 = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|Net40.ActiveCfg = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|Net40.Build.0 = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|Win8.ActiveCfg = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|Win8.Build.0 = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|WP81.ActiveCfg = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|WP81.Build.0 = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|Any CPU.Build.0 = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|Net20.ActiveCfg = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|Net20.Build.0 = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|Net40.ActiveCfg = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|Net40.Build.0 = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|Win8.ActiveCfg = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|Win8.Build.0 = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|WP81.ActiveCfg = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|WP81.Build.0 = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|WP8-ARM.Build.0 = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C}.Release|WP8-x86.Build.0 = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|Net20.ActiveCfg = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|Net20.Build.0 = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|Net40.ActiveCfg = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|Net40.Build.0 = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|Win8.ActiveCfg = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|Win8.Build.0 = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|WP81.ActiveCfg = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|WP81.Build.0 = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|Any CPU.Build.0 = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|Net20.ActiveCfg = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|Net20.Build.0 = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|Net40.ActiveCfg = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|Net40.Build.0 = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|Win8.ActiveCfg = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|Win8.Build.0 = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|WP81.ActiveCfg = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|WP81.Build.0 = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|WP8-ARM.Build.0 = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {93515065-A548-4D58-B1AC-D0FCDD23717E}.Release|WP8-x86.Build.0 = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|DIRECTX11_2.ActiveCfg = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|DIRECTX11_2.Build.0 = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|Net20.ActiveCfg = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|Net20.Build.0 = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|Net40.ActiveCfg = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|Net40.Build.0 = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|Win8.ActiveCfg = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|Win8.Build.0 = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|WP81.ActiveCfg = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|WP81.Build.0 = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|WP8-ARM.ActiveCfg = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|WP8-ARM.Build.0 = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|WP8-x86.ActiveCfg = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Debug|WP8-x86.Build.0 = Debug|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|Any CPU.Build.0 = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|DIRECTX11_2.ActiveCfg = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|DIRECTX11_2.Build.0 = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|Net20.ActiveCfg = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|Net20.Build.0 = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|Net40.ActiveCfg = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|Net40.Build.0 = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|Win8.ActiveCfg = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|Win8.Build.0 = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|WP81.ActiveCfg = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|WP81.Build.0 = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|WP8-ARM.ActiveCfg = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|WP8-ARM.Build.0 = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|WP8-x86.ActiveCfg = Release|Any CPU + {85E43240-94F8-4176-846F-FBFD7C288FF5}.Release|WP8-x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D0BCD56A-41C4-4A4E-8590-26864CED07FF} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {361D3F81-A48A-47F2-80DF-CA4F9536CB4E} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {C97878F4-1510-4BBA-8153-BD71DA7D50D8} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {736DFB52-1AFE-4EFF-9710-89046AB5B1F9} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {E927F2D5-8E27-462A-8687-CB207EE01164} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {3FC6DE77-B412-4101-9E64-6B9AA831179B} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {4995127E-0B8E-45B8-80C4-6BAC1BBE3783} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {B4D984DF-85B8-4BBF-8C3B-5CEF905F40D9} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {112F146B-7C01-490B-B943-EA9341ACCAF2} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {4E2D9A17-2195-4A51-AAE3-924517440293} = {F1AF9A3B-7856-46C9-992A-391E5455BF1F} + {31F85A16-CB01-4456-BE3C-76E9FF3A1343} = {F1AF9A3B-7856-46C9-992A-391E5455BF1F} + {5E597A82-9DE9-4BA5-AD76-51202190E951} = {F1AF9A3B-7856-46C9-992A-391E5455BF1F} + {9AA405CA-B7FD-44D0-9EBC-21F5D0F44DEB} = {57C5C966-ADB2-43F2-BB54-99BCB56C9F10} + {05D17A7B-F200-48C0-B8F9-B7211665A17F} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {764D7CE5-F78B-432E-A849-E40BA44522D6} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {931FA266-E756-41CA-9736-8B29235DC999} = {1B526C0E-EE4A-4E8F-BF8F-8C7397FB4918} + {874DEC63-9AB9-4A09-B1EA-E8FB1F1B68A1} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {CA21A201-078B-4EBE-A2AB-C3B1FFEC99F9} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {BBB50A46-3291-4C62-B884-D1AB64F71EA5} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {53EF08A7-4224-434C-A62C-F29807C1C750} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9} = {1B526C0E-EE4A-4E8F-BF8F-8C7397FB4918} + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {15BA35B5-3E54-4715-8857-36F4F96F51FB} = {F1AF9A3B-7856-46C9-992A-391E5455BF1F} + {7329B02D-C504-482A-A156-181D48CE493C} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {B2516A23-1A99-4263-964A-B820FD07FA80} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {46452614-6B06-400F-A74C-1632C79B762C} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {76FD0713-F217-4485-89B3-C6423DB46C58} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {1FA327C8-6C48-4FFC-9235-B98B7521B79D} = {529B140D-B91D-49EA-B173-9ADD6AB2A2A3} + {FBE5DD99-00A0-4FED-A116-941A46A0C0D0} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {F826CCCE-4B72-47F4-9493-DFCB51C106B7} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {49E4485F-3A2A-4C35-A159-12ECCFC00396} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {EEFFFBCA-06D3-447E-85B0-E49FC5676744} = {1B526C0E-EE4A-4E8F-BF8F-8C7397FB4918} + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B} = {CC8DB471-0644-430D-9D4B-808A2475BEC0} + {58ECA41D-A812-4CA7-AF43-61248BF38ADA} = {2C909E10-3315-48B3-85A2-52EC41977FC6} + {3FF81E9B-5515-4732-BD82-35E993568F5F} = {2C909E10-3315-48B3-85A2-52EC41977FC6} + {86F7C9E9-9248-4C52-A555-5B615A5C8E81} = {2C909E10-3315-48B3-85A2-52EC41977FC6} + {C16CC339-2EF3-4245-AE46-0EB0C075D6B9} = {2C909E10-3315-48B3-85A2-52EC41977FC6} + {502A2A15-5941-4838-B645-E37FDB93F3F2} = {2C909E10-3315-48B3-85A2-52EC41977FC6} + {79E91E94-4182-4F91-8FF6-EC68DFA4B375} = {2C909E10-3315-48B3-85A2-52EC41977FC6} + {101F52CD-1E89-460D-B8FD-1B8DEA3F428C} = {2C909E10-3315-48B3-85A2-52EC41977FC6} + {93515065-A548-4D58-B1AC-D0FCDD23717E} = {2C909E10-3315-48B3-85A2-52EC41977FC6} + {85E43240-94F8-4176-846F-FBFD7C288FF5} = {2C909E10-3315-48B3-85A2-52EC41977FC6} + EndGlobalSection +EndGlobal diff --git a/SharpDX.sln.DotSettings b/SharpDX.sln.DotSettings index 2174e0fb..4a291000 100644 --- a/SharpDX.sln.DotSettings +++ b/SharpDX.sln.DotSettings @@ -82,7 +82,9 @@ THE SOFTWARE. <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> $object$_On$event$ <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + True True + True True True True diff --git a/Source/Mapping.xml b/Source/Mapping.xml index 94a9a936..617df18a 100644 --- a/Source/Mapping.xml +++ b/Source/Mapping.xml @@ -23,61 +23,29 @@ - - - $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc11\overrides\wp8--> - $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc11\overrides - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\Setup\VC\ProductDir;Include - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows Phone\v8.0\InstallationFolder;Include - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows Phone\v8.0\InstallationFolder;Include\abi - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows Phone\v8.0\InstallationFolder;Include\mincore - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows Phone\v8.0\InstallationFolder;Include\minwin - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows Phone\v8.0\InstallationFolder;Include\wrl - - - - - - $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides - $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides\wp81 - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\Setup\VC\ProductDir;include - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\WindowsPhoneApp\v8.1\InstallationFolder;Include - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\WindowsPhoneApp\v8.1\InstallationFolder;Include\abi - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\WindowsPhoneApp\v8.1\InstallationFolder;Include\mincore - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\WindowsPhoneApp\v8.1\InstallationFolder;Include\minwin - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\WindowsPhoneApp\v8.1\InstallationFolder;Include\wrl - - - - - - $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc11\overrides\shared - $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc11\overrides\um - $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc11\overrides - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\Setup\VC\ProductDir;Include - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot;Include\shared - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot;Include\um - - - - $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides\shared - $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides\um - $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\Setup\VC\ProductDir;Include - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot81;Include\shared - =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot81;Include\um - - + + $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides\shared + $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides\um + $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides + =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\Setup\VC\ProductDir;Include + =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10;Include\10.0.10586.0\shared + =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10;Include\10.0.10586.0\um + + + $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides\shared + $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides\um + $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc12\overrides + =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\Setup\VC\ProductDir;Include + =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10;Include\10.0.10586.0\shared + =HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10;Include\10.0.10586.0\um + + - - - $(DXSDK_DIR)\include - + + $(DXSDK_DIR)\include $(THIS_CONFIG_PATH)\..\External\gccxml\share\gccxml-0.9\vc10\Include @@ -109,20 +77,6 @@ - - - // For WP8 we need to force to use include headers for WPPhone App only - #define WINAPI_FAMILY WINAPI_FAMILY_PHONE_APP - - - - - - // For WP8.1 we need to force to use include headers for MetroApp only - #define WINAPI_FAMILY WINAPI_FAMILY_PHONE_APP - - - // Use unicode @@ -137,66 +91,51 @@ #define __unaligned __attribute((__unaligned)) - - - enum __SAL_YesNo {}; - - - SharpDX\Mapping.xml SharpDX.DXGI\Mapping.xml - - - SharpDX.D3DCompiler\Mapping.xml - + SharpDX.D3DCompiler\Mapping.xml Mapping.Direct3D1x.xml - + SharpDX.Direct3D11\Mapping.xml - - SharpDX.Direct3D11.Effects\Mapping.xml + SharpDX.Direct3D11.Effects\Mapping.xml - - - SharpDX.Animation\Mapping.xml - SharpDX.DirectComposition\Mapping.xml - SharpDX.DirectManipulation\Mapping.xml - + + + SharpDX.Animation\Mapping.xml + SharpDX.DirectComposition\Mapping.xml + SharpDX.DirectManipulation\Mapping.xml + - SharpDX.Direct3D9\Mapping.xml - + SharpDX.Direct3D9\Mapping.xml SharpDX.XAudio2\Mapping.xml SharpDX.MediaFoundation\Mapping.xml - - SharpDX.Direct2D1\Mapping.xml - - - - SharpDX.DirectInput\Mapping.xml - SharpDX.DirectSound\Mapping.xml - SharpDX.XACT3\Mapping.xml - - - - - SharpDX.XInput\Mapping.xml - SharpDX.RawInput\Mapping.xml - + SharpDX.Direct2D1\Mapping.xml + + + + SharpDX.DirectInput\Mapping.xml + SharpDX.DirectSound\Mapping.xml + + + + SharpDX.XInput\Mapping.xml + SharpDX.RawInput\Mapping.xml \ No newline at end of file diff --git a/Source/Tests/SharpDX.Toolkit.Graphics.Tests/Program.cs b/Source/Tests/SharpDX.Toolkit.Graphics.Tests/Program.cs index 91c672c9..1845f20e 100644 --- a/Source/Tests/SharpDX.Toolkit.Graphics.Tests/Program.cs +++ b/Source/Tests/SharpDX.Toolkit.Graphics.Tests/Program.cs @@ -18,16 +18,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using SharpDX.Direct3D; -using SharpDX.Direct3D11; -using SharpDX.IO; -using SharpDX.WIC; - namespace SharpDX.Toolkit.Graphics.Tests { public class Program diff --git a/Source/Tests/SharpDX.Toolkit.Graphics.Tests/SharpDX.Toolkit.Graphics.Tests.csproj b/Source/Tests/SharpDX.Toolkit.Graphics.Tests/SharpDX.Toolkit.Graphics.Tests.csproj index 89a6ebdb..cda7fcae 100644 --- a/Source/Tests/SharpDX.Toolkit.Graphics.Tests/SharpDX.Toolkit.Graphics.Tests.csproj +++ b/Source/Tests/SharpDX.Toolkit.Graphics.Tests/SharpDX.Toolkit.Graphics.Tests.csproj @@ -1,132 +1,133 @@ - - - - - Debug - AnyCPU - {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9} - Exe - Properties - SharpDX.Toolkit.Graphics.Tests - SharpDX.Toolkit.Graphics.Tests - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - x86 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - x86 - - - - - - - ..\..\..\External\NUnit\nunit.framework.dll - - - - - - - - - - - - - - - - - - - - - - - - - {361d3f81-a48a-47f2-80df-ca4f9536cb4e} - SharpDX.D3DCompiler - - - {c97878f4-1510-4bba-8153-bd71da7d50d8} - SharpDX.Direct2D1 - - - {736dfb52-1afe-4eff-9710-89046ab5b1f9} - SharpDX.Direct3D11 - - - {3fc6de77-b412-4101-9e64-6b9aa831179b} - SharpDX.DXGI - - - {49e4485f-3a2a-4c35-a159-12eccfc00396} - SharpDX.Mathematics - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - - - {8bfff9d1-84ec-4fba-9beb-710ecf1857a8} - SharpDX.Toolkit.Compiler - - - {53ef08a7-4224-434c-a62c-f29807c1c750} - SharpDX.Toolkit.Graphics - - - {9ff0707c-75bb-4984-a01f-b9eaad293f6c} - SharpDX.Toolkit - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - PreserveNewest - - - + + + + + Debug + AnyCPU + {4E0E6A4D-930D-4660-8DE0-E30FF1F9F4A9} + Exe + Properties + SharpDX.Toolkit.Graphics.Tests + SharpDX.Toolkit.Graphics.Tests + v4.5.2 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + x86 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + x86 + false + + + + + + + ..\..\..\External\NUnit\nunit.framework.dll + + + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + ..\..\..\Bin\DirectX11_2-net40\SharpDX.D3DCompiler.dll + + + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct2D1.dll + + + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct3D11.dll + + + ..\..\..\Bin\DirectX11_2-net40\SharpDX.DXGI.dll + + + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Mathematics.dll + + + + + + + + + + + + + + + + + + + + + + + + + + {8bfff9d1-84ec-4fba-9beb-710ecf1857a8} + SharpDX.Toolkit.Compiler + + + {53ef08a7-4224-434c-a62c-f29807c1c750} + SharpDX.Toolkit.Graphics + + + {9ff0707c-75bb-4984-a01f-b9eaad293f6c} + SharpDX.Toolkit + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + PreserveNewest + + + + + + + --> \ No newline at end of file diff --git a/Source/Tests/SharpDX.Toolkit.Tests/SharpDX.Toolkit.Tests.csproj b/Source/Tests/SharpDX.Toolkit.Tests/SharpDX.Toolkit.Tests.csproj index b9750540..c67d037f 100644 --- a/Source/Tests/SharpDX.Toolkit.Tests/SharpDX.Toolkit.Tests.csproj +++ b/Source/Tests/SharpDX.Toolkit.Tests/SharpDX.Toolkit.Tests.csproj @@ -1,74 +1,73 @@ - - - - - Debug - AnyCPU - {EEFFFBCA-06D3-447E-85B0-E49FC5676744} - Library - Properties - SharpDX.Toolkit.Tests - SharpDX.Toolkit.Tests - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\External\NUnit\nunit.framework.dll - - - - - - - - - - - - - - {736dfb52-1afe-4eff-9710-89046ab5b1f9} - SharpDX.Direct3D11 - - - {49e4485f-3a2a-4c35-a159-12eccfc00396} - SharpDX.Mathematics - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - - - {9ff0707c-75bb-4984-a01f-b9eaad293f6c} - SharpDX.Toolkit - - - + + + + + Debug + AnyCPU + {EEFFFBCA-06D3-447E-85B0-E49FC5676744} + Library + Properties + SharpDX.Toolkit.Tests + SharpDX.Toolkit.Tests + v4.5.2 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + ..\..\..\External\NUnit\nunit.framework.dll + + + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct3D11.dll + + + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Mathematics.dll + + + + + + + + + + + + + + {9ff0707c-75bb-4984-a01f-b9eaad293f6c} + SharpDX.Toolkit + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Audio/AudioManager.cs b/Source/Toolkit/SharpDX.Toolkit.Audio/AudioManager.cs index 92f8c779..bb32222e 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Audio/AudioManager.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Audio/AudioManager.cs @@ -617,7 +617,7 @@ private void CreateMasteringLimitier() { try { - masteringLimiter = new MasteringLimiter(); + masteringLimiter = new MasteringLimiter(device); masteringLimiter.Parameter = masteringLimiterParameters; MasteringVoice.SetEffectChain(new EffectDescriptor(masteringLimiter)); } @@ -642,7 +642,7 @@ private void CreateReverbSubmixVoice() try { - reverb = new Reverb(); + reverb = new Reverb(device); ReverbVoice.SetEffectChain(new EffectDescriptor(reverb, 1)); ReverbVoice.SetEffectParameters(0, reverbParameters); } diff --git a/Source/Toolkit/SharpDX.Toolkit.Audio/SharpDX.Toolkit.Audio.csproj b/Source/Toolkit/SharpDX.Toolkit.Audio/SharpDX.Toolkit.Audio.csproj index 1ca3066c..a052b70e 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Audio/SharpDX.Toolkit.Audio.csproj +++ b/Source/Toolkit/SharpDX.Toolkit.Audio/SharpDX.Toolkit.Audio.csproj @@ -1,77 +1,96 @@ - - - - - 8.0.30703 - 2.0 - {1FA327C8-6C48-4FFC-9235-B98B7521B79D} - SharpDX.Toolkit.Audio - SharpDX.Toolkit.Audio - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - {49e4485f-3a2a-4c35-a159-12eccfc00396} - SharpDX.Mathematics - - - {4995127e-0b8e-45b8-80c4-6bac1bbe3783} - SharpDX.XAudio2 - False - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - False - - - {b2516a23-1a99-4263-964a-b820fd07fa80} - SharpDX.Toolkit.Game - False - - - {9ff0707c-75bb-4984-a01f-b9eaad293f6c} - SharpDX.Toolkit - False - - - - - - + + + + + 8.0.30703 + 2.0 + {1FA327C8-6C48-4FFC-9235-B98B7521B79D} + SharpDX.Toolkit.Audio + SharpDX.Toolkit.Audio + v4.5.2 + + + + false + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + {b2516a23-1a99-4263-964a-b820fd07fa80} + SharpDX.Toolkit.Game + False + + + {9ff0707c-75bb-4984-a01f-b9eaad293f6c} + SharpDX.Toolkit + + + + + + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Mathematics.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.XAudio2.dll + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Audio/SoundEffectInstance.cs b/Source/Toolkit/SharpDX.Toolkit.Audio/SoundEffectInstance.cs index 5852dc63..58e6e13d 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Audio/SoundEffectInstance.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Audio/SoundEffectInstance.cs @@ -446,7 +446,7 @@ private void Apply3D(Vector3 listenerForward, Vector3 listenerUp, Vector3 listen { Type = FilterType.LowPassFilter, // see XAudio2CutoffFrequencyToRadians() in XAudio2.h for more information on the formula used here - Frequency = 2.0f * (float)Math.Sin(X3DAudio.PI / 6.0f * dspSettings.LpfDirectCoefficient), + Frequency = 2.0f * (float)Math.Sin(Math.PI / 6.0f * dspSettings.LpfDirectCoefficient), OneOverQ = 1.0f }; @@ -458,7 +458,7 @@ private void Apply3D(Vector3 listenerForward, Vector3 listenerUp, Vector3 listen { Type = FilterType.LowPassFilter, // see XAudio2CutoffFrequencyToRadians() in XAudio2.h for more information on the formula used here - Frequency = 2.0f * (float)Math.Sin(X3DAudio.PI / 6.0f * dspSettings.LpfReverbCoefficient), + Frequency = 2.0f * (float)Math.Sin(Math.PI / 6.0f * dspSettings.LpfReverbCoefficient), OneOverQ = 1.0f }; diff --git a/Source/Toolkit/SharpDX.Toolkit.Compiler/Font/TrueTypeImporter.cs b/Source/Toolkit/SharpDX.Toolkit.Compiler/Font/TrueTypeImporter.cs index d0e90269..7b6bcf0d 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Compiler/Font/TrueTypeImporter.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Compiler/Font/TrueTypeImporter.cs @@ -22,7 +22,6 @@ using System.Collections.Generic; using SharpDX.Direct2D1; using SharpDX.DirectWrite; -using SharpDX.Mathematics; using Factory = SharpDX.DirectWrite.Factory; namespace SharpDX.Toolkit.Graphics @@ -169,7 +168,7 @@ private Glyph ImportGlyph(Factory factory, FontFace fontFace, char character, Fo 0.0f)) { - var bounds = new Mathematics.Rectangle(0, 0, pixelWidth, pixelHeight); + var bounds = new SharpDX.Rectangle(0, 0, pixelWidth, pixelHeight); bitmap = new Bitmap(bounds.Width, bounds.Height, PixelFormat.Format32bppArgb); if (renderingMode == RenderingMode.Aliased) diff --git a/Source/Toolkit/SharpDX.Toolkit.Compiler/Model/ModelCompiler.cs b/Source/Toolkit/SharpDX.Toolkit.Compiler/Model/ModelCompiler.cs index d781c511..3a7691f1 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Compiler/Model/ModelCompiler.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Compiler/Model/ModelCompiler.cs @@ -434,7 +434,7 @@ private void ProcessAnimations() foreach (var key in channel.ScalingKeys) { var keyFrame = GetKeyFrame((float)(key.Time / ticksPerSecond), keyFrames); - keyFrame.Value = new CompositeTransform(ConvertVector(key.Value), Mathematics.Quaternion.Identity, Vector3.Zero); + keyFrame.Value = new CompositeTransform(ConvertVector(key.Value), Quaternion.Identity, Vector3.Zero); } } @@ -511,7 +511,7 @@ private void LinearKeyFrameReduction(LinkedList keyFrames) var actual = current.Value; if ((interpolated.Translation - actual.Translation).LengthSquared() < TranslationThreshold && - Mathematics.Quaternion.Dot(interpolated.Rotation, actual.Rotation) > RotationThreshold && + Quaternion.Dot(interpolated.Rotation, actual.Rotation) > RotationThreshold && (interpolated.Scale - actual.Scale).LengthSquared() < TranslationThreshold) { keyFrames.Remove(node); @@ -960,10 +960,10 @@ private unsafe static Matrix ConvertMatrix(Matrix4x4 sourceMatrix) return Matrix.Transpose(*(Matrix*)&sourceMatrix); } - private static SharpDX.Mathematics.Quaternion ConvertQuaternion(Assimp.Quaternion value) + private static Quaternion ConvertQuaternion(Assimp.Quaternion value) { // Assimp quaternions are stored in wxyz order - return new SharpDX.Mathematics.Quaternion(value.X, value.Y, value.Z, value.W); + return new Quaternion(value.X, value.Y, value.Z, value.W); } private TextureAddressMode ConvertWrapMode(TextureWrapMode wrapMode) diff --git a/Source/Toolkit/SharpDX.Toolkit.Compiler/SharpDX.Toolkit.Compiler.csproj b/Source/Toolkit/SharpDX.Toolkit.Compiler/SharpDX.Toolkit.Compiler.csproj index eda443a8..684428c5 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Compiler/SharpDX.Toolkit.Compiler.csproj +++ b/Source/Toolkit/SharpDX.Toolkit.Compiler/SharpDX.Toolkit.Compiler.csproj @@ -1,115 +1,132 @@ - - - - - 8.0.30703 - 2.0 - {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8} - SharpDX.Toolkit - SharpDX.Toolkit.Compiler - - - - ..\..\..\External\AssimpNet-3.1\Bin\$(SharpDXPlatform)\AssimpNet.dll - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {361d3f81-a48a-47f2-80df-ca4f9536cb4e} - SharpDX.D3DCompiler - False - - - {c97878f4-1510-4bba-8153-bd71da7d50d8} - SharpDX.Direct2D1 - - - {736dfb52-1afe-4eff-9710-89046ab5b1f9} - SharpDX.Direct3D11 - - - {3FC6DE77-B412-4101-9E64-6B9AA831179B} - SharpDX.DXGI - - - {49e4485f-3a2a-4c35-a159-12eccfc00396} - SharpDX.Mathematics - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - False - - - {9ff0707c-75bb-4984-a01f-b9eaad293f6c} - SharpDX.Toolkit - False - - - - - - - - - - - Assimp32.dll - PreserveNewest - - - Assimp64.dll - PreserveNewest - - - + + + + + 8.0.30703 + 2.0 + {8BFFF9D1-84EC-4FBA-9BEB-710ECF1857A8} + SharpDX.Toolkit + SharpDX.Toolkit.Compiler + v4.5.2 + + + + false + + + false + + + false + + + false + + + false + + + false + + + + ..\..\..\External\AssimpNet-3.1\Bin\$(SharpDXPlatform)\AssimpNet.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.D3DCompiler.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct2D1.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct3D11.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.DXGI.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Mathematics.dll + + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Assimp32.dll + PreserveNewest + + + Assimp64.dll + PreserveNewest + + + + + {9ff0707c-75bb-4984-a01f-b9eaad293f6c} + SharpDX.Toolkit + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.CompilerTask/SharpDX.Toolkit.CompilerTask.csproj b/Source/Toolkit/SharpDX.Toolkit.CompilerTask/SharpDX.Toolkit.CompilerTask.csproj index 307a834a..2ebf5a6b 100644 --- a/Source/Toolkit/SharpDX.Toolkit.CompilerTask/SharpDX.Toolkit.CompilerTask.csproj +++ b/Source/Toolkit/SharpDX.Toolkit.CompilerTask/SharpDX.Toolkit.CompilerTask.csproj @@ -1,65 +1,81 @@ - - - - - 8.0.30703 - 2.0 - {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4} - SharpDX.Toolkit - SharpDX.Toolkit.CompilerTask - - - - - - ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Microsoft.Build.Framework.dll - - - ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Microsoft.Build.Tasks.v4.0.dll - - - ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Microsoft.Build.Utilities.v4.0.dll - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - {D0BCD56A-41C4-4A4E-8590-26864CED07FF} - SharpDX - False - - - {8bfff9d1-84ec-4fba-9beb-710ecf1857a8} - SharpDX.Toolkit.Compiler - False - - - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C} - SharpDX.Toolkit - False - - - + + + + + 8.0.30703 + 2.0 + {90F4C7BC-7A08-4C0F-A5D7-ED9D1D3900D4} + SharpDX.Toolkit + SharpDX.Toolkit.CompilerTask + + + v4.5.2 + + + false + + + false + + + false + + + false + + + false + + + false + + + + ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Microsoft.Build.Framework.dll + + + ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Microsoft.Build.Tasks.v4.0.dll + + + ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Microsoft.Build.Utilities.v4.0.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + {8bfff9d1-84ec-4fba-9beb-710ecf1857a8} + SharpDX.Toolkit.Compiler + + + {9ff0707c-75bb-4984-a01f-b9eaad293f6c} + SharpDX.Toolkit + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Game/Desktop/GameWindowDesktop.cs b/Source/Toolkit/SharpDX.Toolkit.Game/Desktop/GameWindowDesktop.cs index ec950290..9e7f4673 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Game/Desktop/GameWindowDesktop.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Game/Desktop/GameWindowDesktop.cs @@ -18,7 +18,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using Rectangle = SharpDX.Mathematics.Rectangle; #if !W8CORE using System; using System.Threading; diff --git a/Source/Toolkit/SharpDX.Toolkit.Game/Desktop/ToolkitHwndHost.cs b/Source/Toolkit/SharpDX.Toolkit.Game/Desktop/ToolkitHwndHost.cs index dcf80457..fb36310a 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Game/Desktop/ToolkitHwndHost.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Game/Desktop/ToolkitHwndHost.cs @@ -20,6 +20,7 @@ #if !W8CORE && NET35Plus using System; +using System.Reflection; using System.Runtime.InteropServices; using System.Windows.Interop; @@ -27,7 +28,44 @@ namespace SharpDX.Toolkit { internal class ToolkitHwndHost : HwndHost { - private readonly HandleRef childHandle; + private readonly HandleRef childHandle; + + #region | Native | + + [DllImport("user32.dll", EntryPoint = "GetWindowLong", CharSet = CharSet.Unicode)] + private static extern IntPtr GetWindowLong32(HandleRef hwnd, WindowLongType index); + + [DllImport("user32.dll", EntryPoint = "GetWindowLongPtr", CharSet = CharSet.Unicode)] + private static extern IntPtr GetWindowLong64(HandleRef hwnd, WindowLongType index); + + [DllImport("user32.dll", EntryPoint = "SetWindowLong", CharSet = CharSet.Unicode)] + private static extern IntPtr SetWindowLong32(HandleRef hwnd, WindowLongType index, IntPtr wndProc); + + [DllImport("user32.dll", EntryPoint = "SetWindowLongPtr", CharSet = CharSet.Unicode)] + private static extern IntPtr SetWindowLongPtr64(HandleRef hwnd, WindowLongType index, IntPtr wndProc); + + [DllImport("user32.dll", CharSet = CharSet.Unicode)] + public static extern IntPtr SetParent(HandleRef hWnd, IntPtr hWndParent); + + [DllImport("user32.dll", CharSet = CharSet.Unicode)] + private static extern bool ShowWindow(HandleRef hWnd, int mCmdShow); + + public static IntPtr GetWindowLong(HandleRef hWnd, WindowLongType index) + { + if (IntPtr.Size == 4) return GetWindowLong32(hWnd, index); + return GetWindowLong64(hWnd, index); + } + public static IntPtr SetWindowLong(HandleRef hwnd, WindowLongType index, IntPtr wndProcPtr) + { + if (IntPtr.Size == 4) return SetWindowLong32(hwnd, index, wndProcPtr); + return SetWindowLongPtr64(hwnd, index, wndProcPtr); + } + public static bool ShowWindow(HandleRef hWnd, bool windowVisible) + { + return ShowWindow(hWnd, windowVisible ? 1 : 0); + } + + #endregion public ToolkitHwndHost(IntPtr childHandle) { @@ -36,25 +74,25 @@ public ToolkitHwndHost(IntPtr childHandle) protected override HandleRef BuildWindowCore(HandleRef hwndParent) { - int style = (Win32Native.GetWindowLong(childHandle, Win32Native.WindowLongType.Style)).ToInt32(); + int style = GetWindowLong(childHandle, WindowLongType.Style).ToInt32(); // Removes Caption bar and the sizing border style = style & ~WS_CAPTION & ~WS_THICKFRAME; // Must be a child window to be hosted style |= WS_CHILD; - Win32Native.SetWindowLong(childHandle, Win32Native.WindowLongType.Style, new IntPtr(style)); + SetWindowLong(childHandle, WindowLongType.Style, new IntPtr(style)); //MoveWindow(childHandle, 0, 0, (int)ActualWidth, (int)ActualHeight, true); - Win32Native.SetParent(childHandle, hwndParent.Handle); + SetParent(childHandle, hwndParent.Handle); - Win32Native.ShowWindow(childHandle, false); + ShowWindow(childHandle, false); return childHandle; } protected override void DestroyWindowCore(HandleRef hwnd) { - Win32Native.SetParent(childHandle, IntPtr.Zero); + SetParent(childHandle, IntPtr.Zero); } protected override void OnRenderSizeChanged(System.Windows.SizeChangedInfo sizeInfo) @@ -65,8 +103,19 @@ protected override void OnRenderSizeChanged(System.Windows.SizeChangedInfo sizeI // ReSharper disable InconsistentNaming private const int WS_CAPTION = unchecked(0x00C00000); private const int WS_THICKFRAME = unchecked(0x00040000); - private const int WS_CHILD = unchecked(0x40000000); - // ReSharper restore InconsistentNaming + private const int WS_CHILD = unchecked(0x40000000); + // ReSharper restore InconsistentNaming + + public enum WindowLongType + { + UserData = -21, + ExtendedStyle = -20, + Style = -16, + Id = -12, + HwndParent = -8, + HInstance = -6, + WndProc = -4, + } } } #endif \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Game/Game.cs b/Source/Toolkit/SharpDX.Toolkit.Game/Game.cs index dfa1b66c..168b8404 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Game/Game.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Game/Game.cs @@ -20,7 +20,7 @@ using System; using System.Collections.Generic; - +using System.Threading; using SharpDX.Collections; using SharpDX.Toolkit.Collections; using SharpDX.Toolkit.Content; @@ -432,8 +432,13 @@ public void Tick() // If this instance is not active, sleep for an inactive sleep time if (!IsActive) - { - Utilities.Sleep(inactiveSleepTime); + { + // NOTE SmartK8: Next best thing +#if WIN8METRO + Task.Delay(inactiveSleepTime).Wait(); +#else + Thread.Sleep(inactiveSleepTime); +#endif } // Update the timer @@ -476,8 +481,16 @@ public void Tick() { // check if we can sleep the thread to free CPU resources var sleepTime = TargetElapsedTime - accumulatedElapsedGameTime; - if (sleepTime > TimeSpan.Zero) - Utilities.Sleep(sleepTime); + if(sleepTime > TimeSpan.Zero) + { + // NOTE SmartK8: Next best thing +#if WIN8METRO + Task.Delay(sleepTime).Wait(); +#else + Thread.Sleep(sleepTime); +#endif + + } return; } diff --git a/Source/Toolkit/SharpDX.Toolkit.Game/GraphicsDeviceManager.cs b/Source/Toolkit/SharpDX.Toolkit.Game/GraphicsDeviceManager.cs index f6d4ceef..e503094d 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Game/GraphicsDeviceManager.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Game/GraphicsDeviceManager.cs @@ -1,934 +1,940 @@ -// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using System.Collections.Generic; - -using SharpDX.Direct3D; -using SharpDX.Direct3D11; -using SharpDX.DXGI; -using SharpDX.Toolkit.Graphics; - -namespace SharpDX.Toolkit -{ - /// - /// Manages the lifecycle. - /// - public class GraphicsDeviceManager : Component, IGraphicsDeviceManager, IGraphicsDeviceService - { - #region Fields - - /// - /// Default width for the back buffer. - /// - public static readonly int DefaultBackBufferWidth = 800; - - /// - /// Default height for the back buffer. - /// - public static readonly int DefaultBackBufferHeight = 480; - - private Game game; - - private bool deviceSettingsChanged; - - private FeatureLevel preferredGraphicsProfile; - - private bool isFullScreen; - - private bool preferMultiSampling; - - private PixelFormat preferredBackBufferFormat; - - private int preferredBackBufferHeight; - - private int preferredBackBufferWidth; - - private DepthFormat preferredDepthStencilFormat; - - private int preferredFullScreenOutputIndex; - - private bool depthBufferShaderResource; - - private DisplayOrientation supportedOrientations; - - private bool synchronizeWithVerticalRetrace; - - private bool isChangingDevice; - - private int resizedBackBufferWidth; - - private int resizedBackBufferHeight; - - private bool isBackBufferToResize = false; - - private DisplayOrientation currentWindowOrientation; - - private bool beginDrawOk; - - private IGraphicsDeviceFactory graphicsDeviceFactory; - - private bool isReallyFullScreen; - - private GraphicsDevice graphicsDevice; - private Rational preferredRefreshRate; - - #endregion - - #region Constructors and Destructors - - /// - /// Initializes a new instance of the class. - /// - /// The game. - /// The game instance cannot be null. - public GraphicsDeviceManager(Game game) - { - this.game = game; - if (this.game == null) - { - throw new ArgumentNullException("game"); - } - - // Defines all default values - SynchronizeWithVerticalRetrace = true; - PreferredBackBufferFormat = DXGI.Format.R8G8B8A8_UNorm; - PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8; - preferredBackBufferWidth = DefaultBackBufferWidth; - preferredBackBufferHeight = DefaultBackBufferHeight; - preferredRefreshRate = new Rational(60, 1); - PreferMultiSampling = false; - PreferredGraphicsProfile = new[] - { -#if WP8 - // By default on WP8, only run in 9.3 to make sure - // that we are not going to use 11.1 features when - // running from the debugger. - FeatureLevel.Level_9_3, -#else -#if DIRECTX11_1 - FeatureLevel.Level_11_1, -#endif - FeatureLevel.Level_11_0, - FeatureLevel.Level_10_1, - FeatureLevel.Level_10_0, - FeatureLevel.Level_9_3, - FeatureLevel.Level_9_2, - FeatureLevel.Level_9_1, -#endif - }; - - // Register the services to the registry - game.Services.AddService(typeof(IGraphicsDeviceManager), this); - game.Services.AddService(typeof(IGraphicsDeviceService), this); - - graphicsDeviceFactory = (IGraphicsDeviceFactory)game.Services.GetService(typeof(IGraphicsDeviceFactory)); - if (graphicsDeviceFactory == null) - { - throw new InvalidOperationException("IGraphicsDeviceFactory is not registered as a service"); - } - - game.WindowCreated += GameOnWindowCreated; - } - - private void GameOnWindowCreated(object sender, EventArgs eventArgs) - { - game.Window.ClientSizeChanged += Window_ClientSizeChanged; - game.Window.OrientationChanged += Window_OrientationChanged; - } - - #endregion - - #region Public Events - - public event EventHandler DeviceCreated; - - public event EventHandler DeviceDisposing; - - public event EventHandler DeviceLost; - - public event EventHandler DeviceChangeBegin; - - public event EventHandler DeviceChangeEnd; - - public event EventHandler PreparingDeviceSettings; - - #endregion - - #region Public Properties - - public GraphicsDevice GraphicsDevice - { - get - { - return graphicsDevice; - } - internal set - { - graphicsDevice = value; - } - } - - /// - /// Gets or sets the list of graphics profile to select from the best feature to the lower feature. See remarks. - /// - /// The graphics profile. - /// - /// By default, the PreferredGraphicsProfile is set to { , - /// , - /// , - /// , - /// , - /// , - /// } - /// - public FeatureLevel[] PreferredGraphicsProfile { get; set; } - - /// - /// Sets the preferred graphics profile. - /// - /// The levels. - /// - public void SetPreferredGraphicsProfile(params FeatureLevel[] levels) - { - PreferredGraphicsProfile = levels; - } - - /// - /// Gets or sets a value indicating whether this instance is full screen. - /// - /// true if this instance is full screen; otherwise, false. - public bool IsFullScreen - { - get - { - return isFullScreen; - } - - set - { - if (isFullScreen != value) - { - isFullScreen = value; - deviceSettingsChanged = true; - } - } - } - - /// - /// Gets or sets a value indicating whether [prefer multi sampling]. - /// - /// true if [prefer multi sampling]; otherwise, false. - public bool PreferMultiSampling - { - get - { - return preferMultiSampling; - } - - set - { - if (preferMultiSampling != value) - { - preferMultiSampling = value; - deviceSettingsChanged = true; - } - } - } - - /// - /// Gets or sets the device creation flags that will be used to create the - /// - /// The device creation flags. - public DeviceCreationFlags DeviceCreationFlags { get; set; } - - /// - /// Gets or sets the preferred back buffer format. - /// - /// The preferred back buffer format. - public PixelFormat PreferredBackBufferFormat - { - get - { - return preferredBackBufferFormat; - } - - set - { - if (preferredBackBufferFormat != value) - { - preferredBackBufferFormat = value; - deviceSettingsChanged = true; - } - } - } - - /// - /// Gets or sets the preferred refresh rate (Default is 60fps). - /// - /// The preferred refresh rate. - public Rational PreferredRefreshRate - { - get { return preferredRefreshRate; } - set - { - if(preferredRefreshRate != value) - { - preferredRefreshRate = value; - deviceSettingsChanged = true; - } - } - } - - /// - /// Gets or sets the height of the preferred back buffer. - /// - /// The height of the preferred back buffer. - public int PreferredBackBufferHeight - { - get - { - return preferredBackBufferHeight; - } - - set - { - if (preferredBackBufferHeight != value) - { - preferredBackBufferHeight = value; - isBackBufferToResize = false; - deviceSettingsChanged = true; - } - } - } - - /// - /// Gets or sets the width of the preferred back buffer. - /// - /// The width of the preferred back buffer. - public int PreferredBackBufferWidth - { - get - { - return preferredBackBufferWidth; - } - - set - { - if (preferredBackBufferWidth != value) - { - preferredBackBufferWidth = value; - isBackBufferToResize = false; - deviceSettingsChanged = true; - } - } - } - - /// - /// Gets or sets the preferred depth stencil format. - /// - /// The preferred depth stencil format. - public DepthFormat PreferredDepthStencilFormat - { - get - { - return preferredDepthStencilFormat; - } - - set - { - if (preferredDepthStencilFormat != value) - { - preferredDepthStencilFormat = value; - deviceSettingsChanged = true; - } - } - } - - /// - /// The output (monitor) index to use when switching to fullscreen mode. Doesn't have any effect when windowed mode is used. - /// - public int PreferredFullScreenOutputIndex - { - get { return preferredFullScreenOutputIndex; } - - set - { - if (preferredFullScreenOutputIndex != value) - { - preferredFullScreenOutputIndex = value; - deviceSettingsChanged = true; - } - } - } - - /// - /// Gets or sets a value indicating whether the DepthBuffer should be created with the ShaderResource flag. Default is false. - /// - public bool DepthBufferShaderResource - { - get { return depthBufferShaderResource; } - set - { - if(depthBufferShaderResource != value) - { - depthBufferShaderResource = value; - deviceSettingsChanged = true; - } - } - } - - /// - /// Gets or sets the supported orientations. - /// - /// The supported orientations. - public DisplayOrientation SupportedOrientations - { - get - { - return supportedOrientations; - } - - set - { - if (supportedOrientations != value) - { - supportedOrientations = value; - deviceSettingsChanged = true; - } - } - } - - /// - /// Gets or sets a value indicating whether [synchronize with vertical retrace]. - /// - /// true if [synchronize with vertical retrace]; otherwise, false. - public bool SynchronizeWithVerticalRetrace - { - get - { - return synchronizeWithVerticalRetrace; - } - set - { - if (synchronizeWithVerticalRetrace != value) - { - synchronizeWithVerticalRetrace = value; - deviceSettingsChanged = true; - } - } - } - - #endregion - - #region Public Methods and Operators - - /// - /// Applies the changes from this instance and change or create the according to the new values. - /// - public void ApplyChanges() - { - if (GraphicsDevice == null || deviceSettingsChanged) - { - ChangeOrCreateDevice(false); - } - } - - bool IGraphicsDeviceManager.BeginDraw() - { - beginDrawOk = false; - if (GraphicsDevice == null) - { - return false; - } - - switch (GraphicsDevice.GraphicsDeviceStatus) - { - case GraphicsDeviceStatus.Normal: - // Before drawing, we should clear the state to make sure that there is no unstable graphics device states (On some WP8 devices for example) - // An application should not rely on previous state (last frame...etc.) after BeginDraw. - GraphicsDevice.ClearState(); - - // By default, we setup the render target to the back buffer, and the viewport as well. - if (GraphicsDevice.BackBuffer != null) - { - GraphicsDevice.SetRenderTargets(GraphicsDevice.DepthStencilBuffer, GraphicsDevice.BackBuffer); - GraphicsDevice.SetViewport(0, 0, GraphicsDevice.BackBuffer.Width, GraphicsDevice.BackBuffer.Height); - } - - break; - default: - Utilities.Sleep(TimeSpan.FromMilliseconds(20)); - try - { - OnDeviceLost(this, EventArgs.Empty); - ChangeOrCreateDevice(true); - } - catch (Exception) - { - return false; - } - break; - } - - beginDrawOk = true; - return true; - } - - void IGraphicsDeviceManager.CreateDevice() - { - // Force the creation of the device - ChangeOrCreateDevice(true); - } - - void IGraphicsDeviceManager.EndDraw() - { - if (beginDrawOk && GraphicsDevice != null) - { - try - { - GraphicsDevice.Present(); - } - catch (SharpDXException ex) - { - // If this is not a DeviceRemoved or DeviceReset, than throw an exception - if (ex.ResultCode != DXGI.ResultCode.DeviceRemoved && ex.ResultCode != DXGI.ResultCode.DeviceReset) - { - throw; - } - } - } - } - - #endregion - - protected static DisplayOrientation SelectOrientation(DisplayOrientation orientation, int width, int height, bool allowLandscapeLeftAndRight) - { - if (orientation != DisplayOrientation.Default) - { - return orientation; - } - - if (width <= height) - { - return DisplayOrientation.Portrait; - } - - if (allowLandscapeLeftAndRight) - { - return DisplayOrientation.LandscapeRight | DisplayOrientation.LandscapeLeft; - } - - return DisplayOrientation.LandscapeLeft; - } - - protected override void Dispose(bool disposeManagedResources) - { - if (disposeManagedResources) - { - if (game != null) - { - if (game.Services.GetService(typeof(IGraphicsDeviceService)) == this) - { - game.Services.RemoveService(typeof(IGraphicsDeviceService)); - } - - game.Window.ClientSizeChanged -= Window_ClientSizeChanged; - game.Window.OrientationChanged -= Window_OrientationChanged; - } - - Utilities.Dispose(ref graphicsDevice); - } - - base.Dispose(disposeManagedResources); - } - - /// - /// Determines whether this instance is compatible with the the specified new . - /// - /// The new device info. - /// true if this instance this instance is compatible with the the specified new ; otherwise, false. - protected virtual bool CanResetDevice(GraphicsDeviceInformation newDeviceInfo) - { - // By default, a reset is compatible when we stay under the same graphics profile. - return GraphicsDevice.Features.Level == newDeviceInfo.GraphicsProfile; - } - - /// - /// Finds the best device that is compatible with the preferences defined in this instance. - /// - /// if set to true a device can be selected from any existing adapters, otherwise, it will select only from default adapter. - /// The graphics device information. - protected virtual GraphicsDeviceInformation FindBestDevice(bool anySuitableDevice) - { - // Setup preferred parameters before passing them to the factory - var preferredParameters = new GameGraphicsParameters - { - PreferredBackBufferWidth = PreferredBackBufferWidth, - PreferredBackBufferHeight = PreferredBackBufferHeight, - PreferredBackBufferFormat = PreferredBackBufferFormat, - PreferredDepthStencilFormat = PreferredDepthStencilFormat, - PreferredRefreshRate = PreferredRefreshRate, - IsFullScreen = IsFullScreen, - PreferredFullScreenOutputIndex = PreferredFullScreenOutputIndex, - DepthBufferShaderResource = DepthBufferShaderResource, - PreferMultiSampling = PreferMultiSampling, - SynchronizeWithVerticalRetrace = SynchronizeWithVerticalRetrace, - PreferredGraphicsProfile = (FeatureLevel[])PreferredGraphicsProfile.Clone(), - }; - - // Setup resized value if there is a resize pending - if (!IsFullScreen && isBackBufferToResize) - { - preferredParameters.PreferredBackBufferWidth = resizedBackBufferWidth; - preferredParameters.PreferredBackBufferHeight = resizedBackBufferHeight; - } - - var devices = graphicsDeviceFactory.FindBestDevices(preferredParameters); - if (devices.Count == 0) - { - throw new InvalidOperationException("No screen modes found"); - } - - RankDevices(devices); - - if (devices.Count == 0) - { - throw new InvalidOperationException("No screen modes found after ranking"); - } - - return devices[0]; - } - - /// - /// Ranks a list of before creating a new device. - /// - /// The list of devices that can be reorder. - protected virtual void RankDevices(List foundDevices) - { - // Don't sort if there is a single device (mostly for XAML/WP8) - if (foundDevices.Count == 1) - { - return; - } - - foundDevices.Sort( - (left, right) => - { - var leftParams = left.PresentationParameters; - var rightParams = right.PresentationParameters; - - var leftAdapter = left.Adapter; - var rightAdapter = right.Adapter; - - // Sort by GraphicsProfile - if (left.GraphicsProfile != right.GraphicsProfile) - { - return left.GraphicsProfile <= right.GraphicsProfile ? 1 : -1; - } - - // Sort by FullScreen mode - if (leftParams.IsFullScreen != rightParams.IsFullScreen) - { - return IsFullScreen != leftParams.IsFullScreen ? 1 : -1; - } - - // Sort by BackBufferFormat - int leftFormat = CalculateRankForFormat(leftParams.BackBufferFormat); - int rightFormat = CalculateRankForFormat(rightParams.BackBufferFormat); - if (leftFormat != rightFormat) - { - return leftFormat >= rightFormat ? 1 : -1; - } - - // Sort by MultiSampleCount - if (leftParams.MultiSampleCount != rightParams.MultiSampleCount) - { - return leftParams.MultiSampleCount <= rightParams.MultiSampleCount ? 1 : -1; - } - - // Sort by AspectRatio - var targetAspectRatio = (PreferredBackBufferWidth == 0) || (PreferredBackBufferHeight == 0) ? (float)DefaultBackBufferWidth / DefaultBackBufferHeight : (float)PreferredBackBufferWidth / PreferredBackBufferHeight; - var leftDiffRatio = Math.Abs(((float)leftParams.BackBufferWidth / leftParams.BackBufferHeight) - targetAspectRatio); - var rightDiffRatio = Math.Abs(((float)rightParams.BackBufferWidth / rightParams.BackBufferHeight) - targetAspectRatio); - if (Math.Abs(leftDiffRatio - rightDiffRatio) > 0.2f) - { - return leftDiffRatio >= rightDiffRatio ? 1 : -1; - } - - // Sort by PixelCount - int leftPixelCount; - int rightPixelCount; - if (IsFullScreen) - { - if ((PreferredBackBufferWidth == 0) || (PreferredBackBufferHeight == 0)) - { - // assume we got here only adapters that have the needed number of outputs: - var leftOutput = leftAdapter.GetOutputAt(PreferredFullScreenOutputIndex); - var rightOutput = rightAdapter.GetOutputAt(PreferredFullScreenOutputIndex); - - leftPixelCount = leftOutput.CurrentDisplayMode.Width * leftOutput.CurrentDisplayMode.Height; - rightPixelCount = rightOutput.CurrentDisplayMode.Width * rightOutput.CurrentDisplayMode.Height; - } - else - { - leftPixelCount = rightPixelCount = PreferredBackBufferWidth * PreferredBackBufferHeight; - } - } - else if ((PreferredBackBufferWidth == 0) || (PreferredBackBufferHeight == 0)) - { - leftPixelCount = rightPixelCount = DefaultBackBufferWidth * DefaultBackBufferHeight; - } - else - { - leftPixelCount = rightPixelCount = PreferredBackBufferWidth * PreferredBackBufferHeight; - } - - int leftDeltaPixelCount = Math.Abs((leftParams.BackBufferWidth * leftParams.BackBufferHeight) - leftPixelCount); - int rightDeltaPixelCount = Math.Abs((rightParams.BackBufferWidth * rightParams.BackBufferHeight) - rightPixelCount); - if (leftDeltaPixelCount != rightDeltaPixelCount) - { - return leftDeltaPixelCount >= rightDeltaPixelCount ? 1 : -1; - } - - // Sort by default Adapter, default adapter first - if (left.Adapter != right.Adapter) - { - if (left.Adapter.IsDefaultAdapter) - { - return -1; - } - - if (right.Adapter.IsDefaultAdapter) - { - return 1; - } - } - - return 0; - }); - } - - private int CalculateRankForFormat(DXGI.Format format) - { - if (format == PreferredBackBufferFormat) - { - return 0; - } - - if (CalculateFormatSize(format) == CalculateFormatSize(PreferredBackBufferFormat)) - { - return 1; - } - - return int.MaxValue; - } - - private int CalculateFormatSize(DXGI.Format format) - { - switch (format) - { - case DXGI.Format.R8G8B8A8_UNorm: - case DXGI.Format.R8G8B8A8_UNorm_SRgb: - case DXGI.Format.B8G8R8A8_UNorm: - case DXGI.Format.B8G8R8A8_UNorm_SRgb: - case DXGI.Format.R10G10B10A2_UNorm: - return 32; - - case DXGI.Format.B5G6R5_UNorm: - case DXGI.Format.B5G5R5A1_UNorm: - return 16; - } - - return 0; - } - - protected virtual void OnDeviceCreated(object sender, EventArgs args) - { - RaiseEvent(DeviceCreated, sender, args); - } - - protected virtual void OnDeviceDisposing(object sender, EventArgs args) - { - RaiseEvent(DeviceDisposing, sender, args); - } - - protected virtual void OnDeviceLost(object sender, EventArgs args) - { - RaiseEvent(DeviceLost, sender, args); - } - - protected virtual void OnDeviceChangeBegin(object sender, EventArgs args) - { - RaiseEvent(DeviceChangeBegin, sender, args); - } - - protected virtual void OnDeviceChangeEnd(object sender, EventArgs args) - { - RaiseEvent(DeviceChangeEnd, sender, args); - } - - protected virtual void OnPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs args) - { - RaiseEvent(PreparingDeviceSettings, sender, args); - } - - private void RaiseEvent(EventHandler handler, object sender, T args) - where T : EventArgs - { - if (handler != null) - handler(sender, args); - } - - private void Window_ClientSizeChanged(object sender, EventArgs e) - { - if (!isChangingDevice && ((game.Window.ClientBounds.Height != 0) || (game.Window.ClientBounds.Width != 0))) - { - resizedBackBufferWidth = game.Window.ClientBounds.Width; - resizedBackBufferHeight = game.Window.ClientBounds.Height; - isBackBufferToResize = true; - ChangeOrCreateDevice(false); - } - } - - private void Window_OrientationChanged(object sender, EventArgs e) - { - if ((!isChangingDevice && ((game.Window.ClientBounds.Height != 0) || (game.Window.ClientBounds.Width != 0))) && (game.Window.CurrentOrientation != currentWindowOrientation)) - { - ChangeOrCreateDevice(false); - } - } - - private void GraphicsDevice_Disposing(object sender, EventArgs e) - { - // Clears the GraphicsDevice - GraphicsDevice = null; - - OnDeviceDisposing(sender, e); - } - - private void CreateDevice(GraphicsDeviceInformation newInfo) - { - Utilities.Dispose(ref graphicsDevice); - - newInfo.PresentationParameters.IsFullScreen = isFullScreen; - newInfo.PresentationParameters.PresentationInterval = SynchronizeWithVerticalRetrace ? PresentInterval.One : PresentInterval.Immediate; - newInfo.DeviceCreationFlags = DeviceCreationFlags; - - OnPreparingDeviceSettings(this, new PreparingDeviceSettingsEventArgs(newInfo)); - - // this.ValidateGraphicsDeviceInformation(newInfo); - GraphicsDevice = graphicsDeviceFactory.CreateDevice(newInfo); - - GraphicsDevice.Disposing += GraphicsDevice_Disposing; - - OnDeviceCreated(this, EventArgs.Empty); - } - - private void ChangeOrCreateDevice(bool forceCreate) - { - if (forceCreate) - { - // Make sure that all GraphicsAdapter are cleared and removed when device is disposed. - // and re-initialized them - GraphicsAdapter.Reset(); - } - - isChangingDevice = true; - int width = game.Window.ClientBounds.Width; - int height = game.Window.ClientBounds.Height; - - OnDeviceChangeBegin(this, EventArgs.Empty); - - bool isBeginScreenDeviceChange = false; - try - { - // Notifies the game window for the new orientation - game.Window.SetSupportedOrientations(SelectOrientation(supportedOrientations, PreferredBackBufferWidth, PreferredBackBufferHeight, true)); - - var graphicsDeviceInformation = FindBestDevice(forceCreate); - game.Window.BeginScreenDeviceChange(graphicsDeviceInformation.PresentationParameters.IsFullScreen); - isBeginScreenDeviceChange = true; - bool needToCreateNewDevice = true; - - // If we are not forced to create a new device and this is already an existing GraphicsDevice - // try to reset and resize it. - if (!forceCreate && GraphicsDevice != null) - { - OnPreparingDeviceSettings(this, new PreparingDeviceSettingsEventArgs(graphicsDeviceInformation)); - if (CanResetDevice(graphicsDeviceInformation)) - { - try - { - var newWidth = graphicsDeviceInformation.PresentationParameters.BackBufferWidth; - var newHeight = graphicsDeviceInformation.PresentationParameters.BackBufferHeight; - var newFormat = graphicsDeviceInformation.PresentationParameters.BackBufferFormat; - var newOutputIndex = graphicsDeviceInformation.PresentationParameters.PreferredFullScreenOutputIndex; - - GraphicsDevice.Presenter.PrefferedFullScreenOutputIndex = newOutputIndex; - GraphicsDevice.Presenter.Resize(newWidth, newHeight, newFormat, graphicsDeviceInformation.PresentationParameters.RefreshRate); - - // Change full screen if needed - GraphicsDevice.Presenter.IsFullScreen = graphicsDeviceInformation.PresentationParameters.IsFullScreen; - - needToCreateNewDevice = false; - } - catch (Exception ex) - { - System.Diagnostics.Debug.WriteLine(ex); - } - } - } - - // If we still need to create a device, then we need to create it - if (needToCreateNewDevice) - { - CreateDevice(graphicsDeviceInformation); - } - - var presentationParameters = GraphicsDevice.Presenter.Description; - isReallyFullScreen = presentationParameters.IsFullScreen; - if (presentationParameters.BackBufferWidth != 0) - { - width = presentationParameters.BackBufferWidth; - } - - if (presentationParameters.BackBufferHeight != 0) - { - height = presentationParameters.BackBufferHeight; - } - - deviceSettingsChanged = false; - - OnDeviceChangeEnd(this, EventArgs.Empty); - } - finally - { - if (isBeginScreenDeviceChange) - { - game.Window.EndScreenDeviceChange(width, height); - } - - currentWindowOrientation = game.Window.CurrentOrientation; - isChangingDevice = false; - } - } - } +// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.Threading; +using SharpDX.Direct3D; +using SharpDX.Direct3D11; +using SharpDX.DXGI; +using SharpDX.Toolkit.Graphics; + +namespace SharpDX.Toolkit +{ + /// + /// Manages the lifecycle. + /// + public class GraphicsDeviceManager : Component, IGraphicsDeviceManager, IGraphicsDeviceService + { + #region Fields + + /// + /// Default width for the back buffer. + /// + public static readonly int DefaultBackBufferWidth = 800; + + /// + /// Default height for the back buffer. + /// + public static readonly int DefaultBackBufferHeight = 480; + + private Game game; + + private bool deviceSettingsChanged; + + private FeatureLevel preferredGraphicsProfile; + + private bool isFullScreen; + + private bool preferMultiSampling; + + private PixelFormat preferredBackBufferFormat; + + private int preferredBackBufferHeight; + + private int preferredBackBufferWidth; + + private DepthFormat preferredDepthStencilFormat; + + private int preferredFullScreenOutputIndex; + + private bool depthBufferShaderResource; + + private DisplayOrientation supportedOrientations; + + private bool synchronizeWithVerticalRetrace; + + private bool isChangingDevice; + + private int resizedBackBufferWidth; + + private int resizedBackBufferHeight; + + private bool isBackBufferToResize = false; + + private DisplayOrientation currentWindowOrientation; + + private bool beginDrawOk; + + private IGraphicsDeviceFactory graphicsDeviceFactory; + + private bool isReallyFullScreen; + + private GraphicsDevice graphicsDevice; + private Rational preferredRefreshRate; + + #endregion + + #region Constructors and Destructors + + /// + /// Initializes a new instance of the class. + /// + /// The game. + /// The game instance cannot be null. + public GraphicsDeviceManager(Game game) + { + this.game = game; + if (this.game == null) + { + throw new ArgumentNullException("game"); + } + + // Defines all default values + SynchronizeWithVerticalRetrace = true; + PreferredBackBufferFormat = DXGI.Format.R8G8B8A8_UNorm; + PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8; + preferredBackBufferWidth = DefaultBackBufferWidth; + preferredBackBufferHeight = DefaultBackBufferHeight; + preferredRefreshRate = new Rational(60, 1); + PreferMultiSampling = false; + PreferredGraphicsProfile = new[] + { +#if WP8 + // By default on WP8, only run in 9.3 to make sure + // that we are not going to use 11.1 features when + // running from the debugger. + FeatureLevel.Level_9_3, +#else +#if DIRECTX11_1 + FeatureLevel.Level_11_1, +#endif + FeatureLevel.Level_11_0, + FeatureLevel.Level_10_1, + FeatureLevel.Level_10_0, + FeatureLevel.Level_9_3, + FeatureLevel.Level_9_2, + FeatureLevel.Level_9_1, +#endif + }; + + // Register the services to the registry + game.Services.AddService(typeof(IGraphicsDeviceManager), this); + game.Services.AddService(typeof(IGraphicsDeviceService), this); + + graphicsDeviceFactory = (IGraphicsDeviceFactory)game.Services.GetService(typeof(IGraphicsDeviceFactory)); + if (graphicsDeviceFactory == null) + { + throw new InvalidOperationException("IGraphicsDeviceFactory is not registered as a service"); + } + + game.WindowCreated += GameOnWindowCreated; + } + + private void GameOnWindowCreated(object sender, EventArgs eventArgs) + { + game.Window.ClientSizeChanged += Window_ClientSizeChanged; + game.Window.OrientationChanged += Window_OrientationChanged; + } + + #endregion + + #region Public Events + + public event EventHandler DeviceCreated; + + public event EventHandler DeviceDisposing; + + public event EventHandler DeviceLost; + + public event EventHandler DeviceChangeBegin; + + public event EventHandler DeviceChangeEnd; + + public event EventHandler PreparingDeviceSettings; + + #endregion + + #region Public Properties + + public GraphicsDevice GraphicsDevice + { + get + { + return graphicsDevice; + } + internal set + { + graphicsDevice = value; + } + } + + /// + /// Gets or sets the list of graphics profile to select from the best feature to the lower feature. See remarks. + /// + /// The graphics profile. + /// + /// By default, the PreferredGraphicsProfile is set to { , + /// , + /// , + /// , + /// , + /// , + /// } + /// + public FeatureLevel[] PreferredGraphicsProfile { get; set; } + + /// + /// Sets the preferred graphics profile. + /// + /// The levels. + /// + public void SetPreferredGraphicsProfile(params FeatureLevel[] levels) + { + PreferredGraphicsProfile = levels; + } + + /// + /// Gets or sets a value indicating whether this instance is full screen. + /// + /// true if this instance is full screen; otherwise, false. + public bool IsFullScreen + { + get + { + return isFullScreen; + } + + set + { + if (isFullScreen != value) + { + isFullScreen = value; + deviceSettingsChanged = true; + } + } + } + + /// + /// Gets or sets a value indicating whether [prefer multi sampling]. + /// + /// true if [prefer multi sampling]; otherwise, false. + public bool PreferMultiSampling + { + get + { + return preferMultiSampling; + } + + set + { + if (preferMultiSampling != value) + { + preferMultiSampling = value; + deviceSettingsChanged = true; + } + } + } + + /// + /// Gets or sets the device creation flags that will be used to create the + /// + /// The device creation flags. + public DeviceCreationFlags DeviceCreationFlags { get; set; } + + /// + /// Gets or sets the preferred back buffer format. + /// + /// The preferred back buffer format. + public PixelFormat PreferredBackBufferFormat + { + get + { + return preferredBackBufferFormat; + } + + set + { + if (preferredBackBufferFormat != value) + { + preferredBackBufferFormat = value; + deviceSettingsChanged = true; + } + } + } + + /// + /// Gets or sets the preferred refresh rate (Default is 60fps). + /// + /// The preferred refresh rate. + public Rational PreferredRefreshRate + { + get { return preferredRefreshRate; } + set + { + if(preferredRefreshRate != value) + { + preferredRefreshRate = value; + deviceSettingsChanged = true; + } + } + } + + /// + /// Gets or sets the height of the preferred back buffer. + /// + /// The height of the preferred back buffer. + public int PreferredBackBufferHeight + { + get + { + return preferredBackBufferHeight; + } + + set + { + if (preferredBackBufferHeight != value) + { + preferredBackBufferHeight = value; + isBackBufferToResize = false; + deviceSettingsChanged = true; + } + } + } + + /// + /// Gets or sets the width of the preferred back buffer. + /// + /// The width of the preferred back buffer. + public int PreferredBackBufferWidth + { + get + { + return preferredBackBufferWidth; + } + + set + { + if (preferredBackBufferWidth != value) + { + preferredBackBufferWidth = value; + isBackBufferToResize = false; + deviceSettingsChanged = true; + } + } + } + + /// + /// Gets or sets the preferred depth stencil format. + /// + /// The preferred depth stencil format. + public DepthFormat PreferredDepthStencilFormat + { + get + { + return preferredDepthStencilFormat; + } + + set + { + if (preferredDepthStencilFormat != value) + { + preferredDepthStencilFormat = value; + deviceSettingsChanged = true; + } + } + } + + /// + /// The output (monitor) index to use when switching to fullscreen mode. Doesn't have any effect when windowed mode is used. + /// + public int PreferredFullScreenOutputIndex + { + get { return preferredFullScreenOutputIndex; } + + set + { + if (preferredFullScreenOutputIndex != value) + { + preferredFullScreenOutputIndex = value; + deviceSettingsChanged = true; + } + } + } + + /// + /// Gets or sets a value indicating whether the DepthBuffer should be created with the ShaderResource flag. Default is false. + /// + public bool DepthBufferShaderResource + { + get { return depthBufferShaderResource; } + set + { + if(depthBufferShaderResource != value) + { + depthBufferShaderResource = value; + deviceSettingsChanged = true; + } + } + } + + /// + /// Gets or sets the supported orientations. + /// + /// The supported orientations. + public DisplayOrientation SupportedOrientations + { + get + { + return supportedOrientations; + } + + set + { + if (supportedOrientations != value) + { + supportedOrientations = value; + deviceSettingsChanged = true; + } + } + } + + /// + /// Gets or sets a value indicating whether [synchronize with vertical retrace]. + /// + /// true if [synchronize with vertical retrace]; otherwise, false. + public bool SynchronizeWithVerticalRetrace + { + get + { + return synchronizeWithVerticalRetrace; + } + set + { + if (synchronizeWithVerticalRetrace != value) + { + synchronizeWithVerticalRetrace = value; + deviceSettingsChanged = true; + } + } + } + + #endregion + + #region Public Methods and Operators + + /// + /// Applies the changes from this instance and change or create the according to the new values. + /// + public void ApplyChanges() + { + if (GraphicsDevice == null || deviceSettingsChanged) + { + ChangeOrCreateDevice(false); + } + } + + bool IGraphicsDeviceManager.BeginDraw() + { + beginDrawOk = false; + if (GraphicsDevice == null) + { + return false; + } + + switch (GraphicsDevice.GraphicsDeviceStatus) + { + case GraphicsDeviceStatus.Normal: + // Before drawing, we should clear the state to make sure that there is no unstable graphics device states (On some WP8 devices for example) + // An application should not rely on previous state (last frame...etc.) after BeginDraw. + GraphicsDevice.ClearState(); + + // By default, we setup the render target to the back buffer, and the viewport as well. + if (GraphicsDevice.BackBuffer != null) + { + GraphicsDevice.SetRenderTargets(GraphicsDevice.DepthStencilBuffer, GraphicsDevice.BackBuffer); + GraphicsDevice.SetViewport(0, 0, GraphicsDevice.BackBuffer.Width, GraphicsDevice.BackBuffer.Height); + } + + break; + default: + // NOTE SmartK8: Next best thing +#if WIN8METRO + Task.Delay(TimeSpan.FromMilliseconds(20)).Wait(); +#else + Thread.Sleep(TimeSpan.FromMilliseconds(20)); +#endif + + try + { + OnDeviceLost(this, EventArgs.Empty); + ChangeOrCreateDevice(true); + } + catch (Exception) + { + return false; + } + break; + } + + beginDrawOk = true; + return true; + } + + void IGraphicsDeviceManager.CreateDevice() + { + // Force the creation of the device + ChangeOrCreateDevice(true); + } + + void IGraphicsDeviceManager.EndDraw() + { + if (beginDrawOk && GraphicsDevice != null) + { + try + { + GraphicsDevice.Present(); + } + catch (SharpDXException ex) + { + // If this is not a DeviceRemoved or DeviceReset, than throw an exception + if (ex.ResultCode != DXGI.ResultCode.DeviceRemoved && ex.ResultCode != DXGI.ResultCode.DeviceReset) + { + throw; + } + } + } + } + + #endregion + + protected static DisplayOrientation SelectOrientation(DisplayOrientation orientation, int width, int height, bool allowLandscapeLeftAndRight) + { + if (orientation != DisplayOrientation.Default) + { + return orientation; + } + + if (width <= height) + { + return DisplayOrientation.Portrait; + } + + if (allowLandscapeLeftAndRight) + { + return DisplayOrientation.LandscapeRight | DisplayOrientation.LandscapeLeft; + } + + return DisplayOrientation.LandscapeLeft; + } + + protected override void Dispose(bool disposeManagedResources) + { + if (disposeManagedResources) + { + if (game != null) + { + if (game.Services.GetService(typeof(IGraphicsDeviceService)) == this) + { + game.Services.RemoveService(typeof(IGraphicsDeviceService)); + } + + game.Window.ClientSizeChanged -= Window_ClientSizeChanged; + game.Window.OrientationChanged -= Window_OrientationChanged; + } + + Utilities.Dispose(ref graphicsDevice); + } + + base.Dispose(disposeManagedResources); + } + + /// + /// Determines whether this instance is compatible with the the specified new . + /// + /// The new device info. + /// true if this instance this instance is compatible with the the specified new ; otherwise, false. + protected virtual bool CanResetDevice(GraphicsDeviceInformation newDeviceInfo) + { + // By default, a reset is compatible when we stay under the same graphics profile. + return GraphicsDevice.Features.Level == newDeviceInfo.GraphicsProfile; + } + + /// + /// Finds the best device that is compatible with the preferences defined in this instance. + /// + /// if set to true a device can be selected from any existing adapters, otherwise, it will select only from default adapter. + /// The graphics device information. + protected virtual GraphicsDeviceInformation FindBestDevice(bool anySuitableDevice) + { + // Setup preferred parameters before passing them to the factory + var preferredParameters = new GameGraphicsParameters + { + PreferredBackBufferWidth = PreferredBackBufferWidth, + PreferredBackBufferHeight = PreferredBackBufferHeight, + PreferredBackBufferFormat = PreferredBackBufferFormat, + PreferredDepthStencilFormat = PreferredDepthStencilFormat, + PreferredRefreshRate = PreferredRefreshRate, + IsFullScreen = IsFullScreen, + PreferredFullScreenOutputIndex = PreferredFullScreenOutputIndex, + DepthBufferShaderResource = DepthBufferShaderResource, + PreferMultiSampling = PreferMultiSampling, + SynchronizeWithVerticalRetrace = SynchronizeWithVerticalRetrace, + PreferredGraphicsProfile = (FeatureLevel[])PreferredGraphicsProfile.Clone(), + }; + + // Setup resized value if there is a resize pending + if (!IsFullScreen && isBackBufferToResize) + { + preferredParameters.PreferredBackBufferWidth = resizedBackBufferWidth; + preferredParameters.PreferredBackBufferHeight = resizedBackBufferHeight; + } + + var devices = graphicsDeviceFactory.FindBestDevices(preferredParameters); + if (devices.Count == 0) + { + throw new InvalidOperationException("No screen modes found"); + } + + RankDevices(devices); + + if (devices.Count == 0) + { + throw new InvalidOperationException("No screen modes found after ranking"); + } + + return devices[0]; + } + + /// + /// Ranks a list of before creating a new device. + /// + /// The list of devices that can be reorder. + protected virtual void RankDevices(List foundDevices) + { + // Don't sort if there is a single device (mostly for XAML/WP8) + if (foundDevices.Count == 1) + { + return; + } + + foundDevices.Sort( + (left, right) => + { + var leftParams = left.PresentationParameters; + var rightParams = right.PresentationParameters; + + var leftAdapter = left.Adapter; + var rightAdapter = right.Adapter; + + // Sort by GraphicsProfile + if (left.GraphicsProfile != right.GraphicsProfile) + { + return left.GraphicsProfile <= right.GraphicsProfile ? 1 : -1; + } + + // Sort by FullScreen mode + if (leftParams.IsFullScreen != rightParams.IsFullScreen) + { + return IsFullScreen != leftParams.IsFullScreen ? 1 : -1; + } + + // Sort by BackBufferFormat + int leftFormat = CalculateRankForFormat(leftParams.BackBufferFormat); + int rightFormat = CalculateRankForFormat(rightParams.BackBufferFormat); + if (leftFormat != rightFormat) + { + return leftFormat >= rightFormat ? 1 : -1; + } + + // Sort by MultiSampleCount + if (leftParams.MultiSampleCount != rightParams.MultiSampleCount) + { + return leftParams.MultiSampleCount <= rightParams.MultiSampleCount ? 1 : -1; + } + + // Sort by AspectRatio + var targetAspectRatio = (PreferredBackBufferWidth == 0) || (PreferredBackBufferHeight == 0) ? (float)DefaultBackBufferWidth / DefaultBackBufferHeight : (float)PreferredBackBufferWidth / PreferredBackBufferHeight; + var leftDiffRatio = Math.Abs(((float)leftParams.BackBufferWidth / leftParams.BackBufferHeight) - targetAspectRatio); + var rightDiffRatio = Math.Abs(((float)rightParams.BackBufferWidth / rightParams.BackBufferHeight) - targetAspectRatio); + if (Math.Abs(leftDiffRatio - rightDiffRatio) > 0.2f) + { + return leftDiffRatio >= rightDiffRatio ? 1 : -1; + } + + // Sort by PixelCount + int leftPixelCount; + int rightPixelCount; + if (IsFullScreen) + { + if ((PreferredBackBufferWidth == 0) || (PreferredBackBufferHeight == 0)) + { + // assume we got here only adapters that have the needed number of outputs: + var leftOutput = leftAdapter.GetOutputAt(PreferredFullScreenOutputIndex); + var rightOutput = rightAdapter.GetOutputAt(PreferredFullScreenOutputIndex); + + leftPixelCount = leftOutput.CurrentDisplayMode.Width * leftOutput.CurrentDisplayMode.Height; + rightPixelCount = rightOutput.CurrentDisplayMode.Width * rightOutput.CurrentDisplayMode.Height; + } + else + { + leftPixelCount = rightPixelCount = PreferredBackBufferWidth * PreferredBackBufferHeight; + } + } + else if ((PreferredBackBufferWidth == 0) || (PreferredBackBufferHeight == 0)) + { + leftPixelCount = rightPixelCount = DefaultBackBufferWidth * DefaultBackBufferHeight; + } + else + { + leftPixelCount = rightPixelCount = PreferredBackBufferWidth * PreferredBackBufferHeight; + } + + int leftDeltaPixelCount = Math.Abs((leftParams.BackBufferWidth * leftParams.BackBufferHeight) - leftPixelCount); + int rightDeltaPixelCount = Math.Abs((rightParams.BackBufferWidth * rightParams.BackBufferHeight) - rightPixelCount); + if (leftDeltaPixelCount != rightDeltaPixelCount) + { + return leftDeltaPixelCount >= rightDeltaPixelCount ? 1 : -1; + } + + // Sort by default Adapter, default adapter first + if (left.Adapter != right.Adapter) + { + if (left.Adapter.IsDefaultAdapter) + { + return -1; + } + + if (right.Adapter.IsDefaultAdapter) + { + return 1; + } + } + + return 0; + }); + } + + private int CalculateRankForFormat(DXGI.Format format) + { + if (format == PreferredBackBufferFormat) + { + return 0; + } + + if (CalculateFormatSize(format) == CalculateFormatSize(PreferredBackBufferFormat)) + { + return 1; + } + + return int.MaxValue; + } + + private int CalculateFormatSize(DXGI.Format format) + { + switch (format) + { + case DXGI.Format.R8G8B8A8_UNorm: + case DXGI.Format.R8G8B8A8_UNorm_SRgb: + case DXGI.Format.B8G8R8A8_UNorm: + case DXGI.Format.B8G8R8A8_UNorm_SRgb: + case DXGI.Format.R10G10B10A2_UNorm: + return 32; + + case DXGI.Format.B5G6R5_UNorm: + case DXGI.Format.B5G5R5A1_UNorm: + return 16; + } + + return 0; + } + + protected virtual void OnDeviceCreated(object sender, EventArgs args) + { + RaiseEvent(DeviceCreated, sender, args); + } + + protected virtual void OnDeviceDisposing(object sender, EventArgs args) + { + RaiseEvent(DeviceDisposing, sender, args); + } + + protected virtual void OnDeviceLost(object sender, EventArgs args) + { + RaiseEvent(DeviceLost, sender, args); + } + + protected virtual void OnDeviceChangeBegin(object sender, EventArgs args) + { + RaiseEvent(DeviceChangeBegin, sender, args); + } + + protected virtual void OnDeviceChangeEnd(object sender, EventArgs args) + { + RaiseEvent(DeviceChangeEnd, sender, args); + } + + protected virtual void OnPreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs args) + { + RaiseEvent(PreparingDeviceSettings, sender, args); + } + + private void RaiseEvent(EventHandler handler, object sender, T args) + where T : EventArgs + { + if (handler != null) + handler(sender, args); + } + + private void Window_ClientSizeChanged(object sender, EventArgs e) + { + if (!isChangingDevice && ((game.Window.ClientBounds.Height != 0) || (game.Window.ClientBounds.Width != 0))) + { + resizedBackBufferWidth = game.Window.ClientBounds.Width; + resizedBackBufferHeight = game.Window.ClientBounds.Height; + isBackBufferToResize = true; + ChangeOrCreateDevice(false); + } + } + + private void Window_OrientationChanged(object sender, EventArgs e) + { + if ((!isChangingDevice && ((game.Window.ClientBounds.Height != 0) || (game.Window.ClientBounds.Width != 0))) && (game.Window.CurrentOrientation != currentWindowOrientation)) + { + ChangeOrCreateDevice(false); + } + } + + private void GraphicsDevice_Disposing(object sender, EventArgs e) + { + // Clears the GraphicsDevice + GraphicsDevice = null; + + OnDeviceDisposing(sender, e); + } + + private void CreateDevice(GraphicsDeviceInformation newInfo) + { + Utilities.Dispose(ref graphicsDevice); + + newInfo.PresentationParameters.IsFullScreen = isFullScreen; + newInfo.PresentationParameters.PresentationInterval = SynchronizeWithVerticalRetrace ? PresentInterval.One : PresentInterval.Immediate; + newInfo.DeviceCreationFlags = DeviceCreationFlags; + + OnPreparingDeviceSettings(this, new PreparingDeviceSettingsEventArgs(newInfo)); + + // this.ValidateGraphicsDeviceInformation(newInfo); + GraphicsDevice = graphicsDeviceFactory.CreateDevice(newInfo); + + GraphicsDevice.Disposing += GraphicsDevice_Disposing; + + OnDeviceCreated(this, EventArgs.Empty); + } + + private void ChangeOrCreateDevice(bool forceCreate) + { + if (forceCreate) + { + // Make sure that all GraphicsAdapter are cleared and removed when device is disposed. + // and re-initialized them + GraphicsAdapter.Reset(); + } + + isChangingDevice = true; + int width = game.Window.ClientBounds.Width; + int height = game.Window.ClientBounds.Height; + + OnDeviceChangeBegin(this, EventArgs.Empty); + + bool isBeginScreenDeviceChange = false; + try + { + // Notifies the game window for the new orientation + game.Window.SetSupportedOrientations(SelectOrientation(supportedOrientations, PreferredBackBufferWidth, PreferredBackBufferHeight, true)); + + var graphicsDeviceInformation = FindBestDevice(forceCreate); + game.Window.BeginScreenDeviceChange(graphicsDeviceInformation.PresentationParameters.IsFullScreen); + isBeginScreenDeviceChange = true; + bool needToCreateNewDevice = true; + + // If we are not forced to create a new device and this is already an existing GraphicsDevice + // try to reset and resize it. + if (!forceCreate && GraphicsDevice != null) + { + OnPreparingDeviceSettings(this, new PreparingDeviceSettingsEventArgs(graphicsDeviceInformation)); + if (CanResetDevice(graphicsDeviceInformation)) + { + try + { + var newWidth = graphicsDeviceInformation.PresentationParameters.BackBufferWidth; + var newHeight = graphicsDeviceInformation.PresentationParameters.BackBufferHeight; + var newFormat = graphicsDeviceInformation.PresentationParameters.BackBufferFormat; + var newOutputIndex = graphicsDeviceInformation.PresentationParameters.PreferredFullScreenOutputIndex; + + GraphicsDevice.Presenter.PrefferedFullScreenOutputIndex = newOutputIndex; + GraphicsDevice.Presenter.Resize(newWidth, newHeight, newFormat, graphicsDeviceInformation.PresentationParameters.RefreshRate); + + // Change full screen if needed + GraphicsDevice.Presenter.IsFullScreen = graphicsDeviceInformation.PresentationParameters.IsFullScreen; + + needToCreateNewDevice = false; + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex); + } + } + } + + // If we still need to create a device, then we need to create it + if (needToCreateNewDevice) + { + CreateDevice(graphicsDeviceInformation); + } + + var presentationParameters = GraphicsDevice.Presenter.Description; + isReallyFullScreen = presentationParameters.IsFullScreen; + if (presentationParameters.BackBufferWidth != 0) + { + width = presentationParameters.BackBufferWidth; + } + + if (presentationParameters.BackBufferHeight != 0) + { + height = presentationParameters.BackBufferHeight; + } + + deviceSettingsChanged = false; + + OnDeviceChangeEnd(this, EventArgs.Empty); + } + finally + { + if (isBeginScreenDeviceChange) + { + game.Window.EndScreenDeviceChange(width, height); + } + + currentWindowOrientation = game.Window.CurrentOrientation; + isChangingDevice = false; + } + } + } } \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Game/SharpDX.Toolkit.Game.csproj b/Source/Toolkit/SharpDX.Toolkit.Game/SharpDX.Toolkit.Game.csproj index ce920d78..adeb4942 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Game/SharpDX.Toolkit.Game.csproj +++ b/Source/Toolkit/SharpDX.Toolkit.Game/SharpDX.Toolkit.Game.csproj @@ -1,134 +1,153 @@ - - - - - 8.0.30703 - 2.0 - {B2516A23-1A99-4263-964A-B820FD07FA80} - SharpDX.Toolkit - SharpDX.Toolkit.Game - - - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {736dfb52-1afe-4eff-9710-89046ab5b1f9} - SharpDX.Direct3D11 - False - - - {3fc6de77-b412-4101-9e64-6b9aa831179b} - SharpDX.DXGI - False - - - {49e4485f-3a2a-4c35-a159-12eccfc00396} - SharpDX.Mathematics - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - False - - - {53ef08a7-4224-434c-a62c-f29807c1c750} - SharpDX.Toolkit.Graphics - False - - - {9ff0707c-75bb-4984-a01f-b9eaad293f6c} - SharpDX.Toolkit - False - - - - - - - {b4d984df-85b8-4bbf-8c3b-5cef905f40d9} - SharpDX.Direct3D9 - - - - - - - - - {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B} - SharpDX.Desktop - - - - - - - - + + + + + 8.0.30703 + 2.0 + {B2516A23-1A99-4263-964A-B820FD07FA80} + SharpDX.Toolkit + SharpDX.Toolkit.Game + v4.5.2 + + + + false + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {53ef08a7-4224-434c-a62c-f29807c1c750} + SharpDX.Toolkit.Graphics + False + + + {9ff0707c-75bb-4984-a01f-b9eaad293f6c} + SharpDX.Toolkit + False + + + + + + + {b4d984df-85b8-4bbf-8c3b-5cef905f40d9} + SharpDX.Direct3D9 + + + + + + + + + {5F8DB9E8-FFAE-475F-AC2E-FE2DC5B15A1B} + SharpDX.Desktop + + + + + + + + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct3D11.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.DXGI.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Mathematics.dll + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/Buffer.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/Buffer.cs index f94fcbc5..c22c9987 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/Buffer.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/Buffer.cs @@ -311,7 +311,7 @@ public void GetData(ref TData toData) where TData : struct /// ID3D11DeviceContext::Map public unsafe void GetData(Buffer stagingTexture, ref TData toData) where TData : struct { - GetData(stagingTexture, new DataPointer(Interop.Fixed(ref toData), Utilities.SizeOf())); + GetData(stagingTexture, new DataPointer(Native.Fixed(ref toData), Utilities.SizeOf())); } /// @@ -329,7 +329,7 @@ public unsafe void GetData(Buffer stagingTexture, ref TData toData) where /// ID3D11DeviceContext::Map public unsafe void GetData(Buffer stagingTexture, TData[] toData) where TData : struct { - GetData(stagingTexture, new DataPointer(Interop.Fixed(toData), toData.Length * Utilities.SizeOf())); + GetData(stagingTexture, new DataPointer(Native.Fixed(toData), toData.Length * Utilities.SizeOf())); } /// @@ -438,7 +438,7 @@ public void SetData(DataPointer fromData, int offsetInBytes = 0, SetDataOptions /// ID3D11DeviceContext::Map public unsafe void SetData(GraphicsDevice device, ref TData fromData, int offsetInBytes = 0, SetDataOptions options = SetDataOptions.Discard) where TData : struct { - SetData(device, new DataPointer(Interop.Fixed(ref fromData), Utilities.SizeOf()), offsetInBytes, options); + SetData(device, new DataPointer(Native.Fixed(ref fromData), Utilities.SizeOf()), offsetInBytes, options); } /// @@ -460,8 +460,8 @@ public unsafe void SetData(GraphicsDevice device, ref TData fromData, int /// ID3D11DeviceContext::Map public unsafe void SetData(GraphicsDevice device, TData[] fromData, int startIndex = 0, int elementCount = 0, int offsetInBytes = 0, SetDataOptions options = SetDataOptions.Discard) where TData : struct { - var sizeOfT = Interop.SizeOf(); - var sourcePtr = (IntPtr)((byte*) Interop.Fixed(fromData) + startIndex*sizeOfT); + var sizeOfT = Native.SizeOf(); + var sourcePtr = (IntPtr)((byte*)Native.Fixed(fromData) + startIndex*sizeOfT); var sizeOfData = (elementCount == 0 ? fromData.Length : elementCount)*sizeOfT; SetData(device, new DataPointer(sourcePtr, sizeOfData), offsetInBytes, options); } @@ -704,7 +704,7 @@ public static unsafe Buffer New(GraphicsDevice device, ref T value, Buffer viewFormat = CheckPixelFormat(bufferFlags, elementSize, viewFormat); var description = NewDescription(bufferSize, elementSize, bufferFlags, usage); - return new Buffer(device, description, bufferFlags, viewFormat, (IntPtr)Interop.Fixed(ref value)); + return new Buffer(device, description, bufferFlags, viewFormat, (IntPtr)Native.Fixed(ref value)); } /// @@ -744,7 +744,7 @@ public static unsafe Buffer New(GraphicsDevice device, T[] initialValue, B viewFormat = CheckPixelFormat(bufferFlags, elementSize, viewFormat); var description = NewDescription(bufferSize, elementSize, bufferFlags, usage); - return new Buffer(device, description, bufferFlags, viewFormat, (IntPtr)Interop.Fixed(initialValue)); + return new Buffer(device, description, bufferFlags, viewFormat, (IntPtr)Native.Fixed(initialValue)); } /// @@ -766,7 +766,7 @@ public static unsafe Buffer New(GraphicsDevice device, byte[] initialValue, int viewFormat = CheckPixelFormat(bufferFlags, elementSize, viewFormat); var description = NewDescription(bufferSize, elementSize, bufferFlags, usage); - return new Buffer(device, description, bufferFlags, viewFormat, (IntPtr)Interop.Fixed(initialValue)); + return new Buffer(device, description, bufferFlags, viewFormat, (IntPtr)Native.Fixed(initialValue)); } /// @@ -841,7 +841,7 @@ protected override void Dispose(bool disposeManagedResources) /// Initializes the specified device arg. /// /// The resource. - protected override void Initialize(Direct3D11.DeviceChild resource) + protected sealed override void Initialize(Direct3D11.DeviceChild resource) { base.Initialize(resource); diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/EffectPass.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/EffectPass.cs index c2baf314..5723050e 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/EffectPass.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/EffectPass.cs @@ -1,1238 +1,1260 @@ -// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Runtime.InteropServices; -using SharpDX.Direct3D11; -using SharpDX.Mathematics; -using SharpDX.Toolkit.Diagnostics; - -namespace SharpDX.Toolkit.Graphics -{ - /// - /// Contains rendering state for drawing with an effect; an effect can contain one or more passes. - /// - public sealed class EffectPass : ComponentBase - { - private const int StageCount = 6; - - internal const int MaximumResourceCountPerStage = - Direct3D11.CommonShaderStage.ConstantBufferApiSlotCount + // Constant buffer - Direct3D11.CommonShaderStage.InputResourceSlotCount + // ShaderResourceView - Direct3D11.ComputeShaderStage.UnorderedAccessViewSlotCount + // UnorderedAccessView - Direct3D11.CommonShaderStage.SamplerSlotCount; // SamplerStates; - - /// - /// Declared 128 UAV counters for SetUnordere - /// - private static readonly int[] UnchangedUAVCounters = - { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, - }; - - /// - /// Gets the attributes associated with this pass. - /// - /// The attributes. - public readonly PropertyCollection Properties; - - /// - /// The parent effect of this pass. - /// - public readonly Effect Effect; - - private readonly EffectData.Pass pass; - private readonly GraphicsDevice graphicsDevice; - - private PipelineBlock pipeline; - - private BlendState blendState; - private bool hasBlendState = false; - private Color4 blendStateColor; - private bool hasBlendStateColor; - private uint blendStateSampleMask; - - private DepthStencilState depthStencilState; - private bool hasDepthStencilState = false; - private int depthStencilReference; - private bool hasDepthStencilReference = false; - - private bool hasRasterizerState = false; - private RasterizerState rasterizerState; - - private InputSignatureManager inputSignatureManager; - private InputLayoutPair currentInputLayoutPair; - - internal EffectTechnique Technique; - - private const bool EnableDebug = false; - internal TextWriter DebugLog = new StringWriter(); - - /// - /// Initializes a new instance of the class. - /// - /// The logger used to log errors. - /// The effect. - /// The technique. - /// The pass. - /// The name. - internal EffectPass(Logger logger, Effect effect, EffectTechnique technique, EffectData.Pass pass, string name) - : base(name) - { - this.Technique = technique; - this.pass = pass; - this.Effect = effect; - this.graphicsDevice = effect.GraphicsDevice; - pipeline = new PipelineBlock() - { - Stages = new StageBlock[EffectPass.StageCount], - }; - - Properties = PrepareProperties(logger, pass.Properties); - IsSubPass = pass.IsSubPass; - // Don't create SubPasses collection for subpass. - if (!IsSubPass) - SubPasses = new EffectPassCollection(); - } - - /// - /// Gets the sub-pass attached to a global pass. - /// - /// - /// As a subpass cannot have subpass, if this pass is already a subpass, this field is null. - /// - public readonly EffectPassCollection SubPasses; - - /// - /// Gets a boolean indicating if this pass is a subpass. - /// - public readonly bool IsSubPass; - - /// - /// Gets or sets the state of the blend. - /// - /// The state of the blend. - public BlendState BlendState - { - get { return blendState; } - set - { - blendState = value; - hasBlendState = true; - } - } - - /// - /// Gets or sets the color of the blend state. - /// - /// The color of the blend state. - public Color4 BlendStateColor - { - get { return blendStateColor; } - set - { - blendStateColor = value; - hasBlendStateColor = true; - } - } - - /// - /// Gets or sets the blend state sample mask. - /// - /// The blend state sample mask. - public uint BlendStateSampleMask - { - get { return blendStateSampleMask; } - set { blendStateSampleMask = value; } - } - - /// - /// Gets or sets the state of the depth stencil. - /// - /// The state of the depth stencil. - public DepthStencilState DepthStencilState - { - get { return depthStencilState; } - set - { - depthStencilState = value; - hasDepthStencilState = true; - } - } - - /// - /// Gets or sets the depth stencil reference. - /// - /// The depth stencil reference. - public int DepthStencilReference - { - get { return depthStencilReference; } - set - { - depthStencilReference = value; - hasDepthStencilReference = true; - } - } - - /// - /// Gets or sets the state of the rasterizer. - /// - /// The state of the rasterizer. - public RasterizerState RasterizerState - { - get { return rasterizerState; } - set - { - rasterizerState = value; - hasRasterizerState = true; - } - } - /// - /// Applies this pass to the device pipeline. - /// - /// - /// This method is responsible to: - ///
    - ///
  • Setup the shader on each stage.
  • - ///
  • Upload constant buffers with dirty flag
  • - ///
  • Set all input constant buffers, shader resource view, unordered access views and sampler states to the stage.
  • - ///
- ///
- public void Apply() - { - // Give a chance to the effect callback to prepare this pass before it is actually applied (the OnApply can completely - // change the pass and use for example a subpass). - var realPass = Effect.OnApply(this); - realPass.ApplyInternal(); - - // Applies global state if we have applied a subpass (that will eventually override states setup by realPass) - if (realPass != this) - { - ApplyStates(); - } - } - - /// - /// Un-Applies this pass to the device pipeline by unbinding all resources/views previously bound by this pass. This is not mandatory to call this method, unless you want to explicitly unbind - /// resource views that were bound by this pass. - /// - /// if set to true this will unbind all resources; otherwise false will unbind only ShaderResourceView and UnorderedAccessView. Default is false. - public unsafe void UnApply(bool fullUnApply = false) - { - // If nothing to clear, return immediately - if (graphicsDevice.CurrentPass == null) - { - return; - } - - // Sets the current pass on the graphics device - graphicsDevice.CurrentPass = null; - - // ---------------------------------------------- - // Iterate on each stage to setup all inputs - // ---------------------------------------------- - for (int stageIndex = 0; stageIndex < pipeline.Stages.Length; stageIndex++) - { - var stageBlock = pipeline.Stages[stageIndex]; - if (stageBlock == null) - { - continue; - } - - var shaderStage = stageBlock.ShaderStage; - - // ---------------------------------------------- - // Setup the shader for this stage. - // ---------------------------------------------- - if (fullUnApply) - { - shaderStage.SetShader(null, null, 0); - } - - // If Shader is a null shader, then skip further processing - if (stageBlock.Index < 0) - { - continue; - } - - var mergerStage = pipeline.OutputMergerStage; - - // ---------------------------------------------- - // Reset ShaderResourceView - // ---------------------------------------------- - RawSlotLinkSet localLink = stageBlock.ShaderResourceViewSlotLinks; - SlotLink* pLinks = localLink.Links; - for (int i = 0; i < localLink.Count; i++) - { - shaderStage.SetShaderResources(pLinks->SlotIndex, pLinks->SlotCount, graphicsDevice.ResetSlotsPointers); - pLinks++; - } - - // ---------------------------------------------- - // Reset UnorderedAccessView - // ---------------------------------------------- - localLink = stageBlock.UnorderedAccessViewSlotLinks; - pLinks = localLink.Links; - - if (stageBlock.Type == EffectShaderType.Compute) - { - for (int i = 0; i < localLink.Count; i++) - { - shaderStage.SetUnorderedAccessViews(pLinks->SlotIndex, pLinks->SlotCount, graphicsDevice.ResetSlotsPointers, pLinks->UavInitialCount); - pLinks++; - } - } - else - { - // Otherwise, for OutputMergerStage. - for (int i = 0; i < localLink.Count; i++) - { - mergerStage.SetUnorderedAccessViewsKeepRTV(pLinks->SlotIndex, pLinks->SlotCount, graphicsDevice.ResetSlotsPointers, pLinks->UavInitialCount); - pLinks++; - } - } - - if (fullUnApply) - { - // ---------------------------------------------- - // Reset Constant Buffers - // ---------------------------------------------- - localLink = stageBlock.ConstantBufferSlotLinks; - pLinks = localLink.Links; - for (int i = 0; i < localLink.Count; i++) - { - shaderStage.SetConstantBuffers(pLinks->SlotIndex, pLinks->SlotCount, graphicsDevice.ResetSlotsPointers); - pLinks++; - } - } - } - - if (fullUnApply) - { - // ---------------------------------------------- - // Set the blend state - // ---------------------------------------------- - if (hasBlendState) - { - graphicsDevice.SetBlendState(null); - } - - // ---------------------------------------------- - // Set the depth stencil state - // ---------------------------------------------- - if (hasDepthStencilState) - { - graphicsDevice.SetDepthStencilState(null); - } - - // ---------------------------------------------- - // Set the rasterizer state - // ---------------------------------------------- - if (hasRasterizerState) - { - graphicsDevice.SetRasterizerState(null); - } - } - } - - /// - /// Internal apply. - /// - private unsafe void ApplyInternal() - { - // By default, we set the Current technique - Effect.CurrentTechnique = Technique; - - // Sets the current pass on the graphics device - graphicsDevice.CurrentPass = this; - - var pLinks = pipeline.CopySlotLinks.Links; - var pPointers = pipeline.PointersBuffer; - var pUAVs = pipeline.UAVBuffer; - var constantBuffers = Effect.ResourceLinker.ConstantBuffers; - - // --------------------------------------------------------------------- - // Handle sparse input resources and update their continuous counterpart. - // --------------------------------------------------------------------- - var resourceLinkerPointers = Effect.ResourceLinker.Pointers; - var resourceLinkerUAVCounts = Effect.ResourceLinker.UAVCounts; - for (int i = 0; i < pipeline.CopySlotLinks.Count; i++) - { - var pWritePtr = pPointers + pLinks->SlotIndex; - int slotIndex = pLinks->GlobalIndex; - if (pLinks->UavInitialCount == IntPtr.Zero) - { - for (int j = 0; j < pLinks->SlotCount; j++, slotIndex++) - { - *pWritePtr++ = resourceLinkerPointers[slotIndex]; - } - } - else - { - var pWriteUAVPtr = pUAVs + pLinks->SlotIndex; - for (int j = 0; j < pLinks->SlotCount; j++, slotIndex++) - { - *pWritePtr++ = resourceLinkerPointers[slotIndex]; - *pWriteUAVPtr++ = resourceLinkerUAVCounts[slotIndex]; - } - } - pLinks++; - } - - // ---------------------------------------------- - // Iterate on each stage to setup all inputs - // ---------------------------------------------- - for (int stageIndex = 0; stageIndex < pipeline.Stages.Length; stageIndex++) - { - var stageBlock = pipeline.Stages[stageIndex]; - if (stageBlock == null) - { - continue; - } - - var shaderStage = stageBlock.ShaderStage; - - // ---------------------------------------------- - // Setup the shader for this stage. - // ---------------------------------------------- - shaderStage.SetShader(stageBlock.Shader, null, 0); - - // If Shader is a null shader, then skip further processing - if (stageBlock.Index < 0) - { - continue; - } - - var mergerStage = pipeline.OutputMergerStage; - - // ---------------------------------------------- - // Setup Constant Buffers - // ---------------------------------------------- - - // Upload all constant buffers to the GPU they have been modified. - for (int i = 0; i < stageBlock.ConstantBufferLinks.Length; i++) - { - var constantBufferLink = stageBlock.ConstantBufferLinks[i]; - var constantBuffer = constantBufferLink.ConstantBuffer; - if (constantBuffer.IsDirty) - { - constantBuffers[constantBufferLink.ResourceIndex].SetData(Effect.GraphicsDevice, new DataPointer(constantBuffer.BackingBuffer.DataPointer, constantBuffer.BackingBuffer.Size)); - constantBuffer.IsDirty = false; - } - } - - var localLink = stageBlock.ConstantBufferSlotLinks; - pLinks = localLink.Links; - for (int i = 0; i < localLink.Count; i++) - { - shaderStage.SetConstantBuffers(pLinks->SlotIndex, pLinks->SlotCount, pLinks->Pointer); - pLinks++; - } - - // ---------------------------------------------- - // Setup ShaderResourceView - // ---------------------------------------------- - localLink = stageBlock.ShaderResourceViewSlotLinks; - pLinks = localLink.Links; - for (int i = 0; i < localLink.Count; i++) - { - shaderStage.SetShaderResources(pLinks->SlotIndex, pLinks->SlotCount, pLinks->Pointer); - pLinks++; - } - - // ---------------------------------------------- - // Setup UnorderedAccessView - // ---------------------------------------------- - localLink = stageBlock.UnorderedAccessViewSlotLinks; - pLinks = localLink.Links; - - if (stageBlock.Type == EffectShaderType.Compute) - { - for (int i = 0; i < localLink.Count; i++) - { - shaderStage.SetUnorderedAccessViews(pLinks->SlotIndex, pLinks->SlotCount, pLinks->Pointer, pLinks->UavInitialCount); - pLinks++; - } - } - else - { - // Otherwise, for OutputMergerStage. - for (int i = 0; i < localLink.Count; i++) - { - mergerStage.SetUnorderedAccessViewsKeepRTV(pLinks->SlotIndex, pLinks->SlotCount, pLinks->Pointer, pLinks->UavInitialCount); - pLinks++; - } - } - - // ---------------------------------------------- - // Setup SamplerStates - // ---------------------------------------------- - localLink = stageBlock.SamplerStateSlotLinks; - pLinks = localLink.Links; - for (int i = 0; i < localLink.Count; i++) - { - shaderStage.SetSamplers(pLinks->SlotIndex, pLinks->SlotCount, pLinks->Pointer); - pLinks++; - } - } - - ApplyStates(); - } - - private void ApplyStates() - { - // ---------------------------------------------- - // Set the blend state - // ---------------------------------------------- - if (hasBlendState) - { - if (hasBlendStateColor) - { - graphicsDevice.SetBlendState(blendState, BlendStateColor, blendStateSampleMask); - } - else - { - graphicsDevice.SetBlendState(blendState); - } - } - - // ---------------------------------------------- - // Set the depth stencil state - // ---------------------------------------------- - if (hasDepthStencilState) - { - if (hasDepthStencilReference) - { - graphicsDevice.SetDepthStencilState(depthStencilState, DepthStencilReference); - } - else - { - graphicsDevice.SetDepthStencilState(depthStencilState); - } - } - - // ---------------------------------------------- - // Set the rasterizer state - // ---------------------------------------------- - if (hasRasterizerState) - { - graphicsDevice.SetRasterizerState(rasterizerState); - } - } - - /// - /// Initializes this pass. - /// - /// The logger. - /// - internal void Initialize(Logger logger) - { - // Gets the output merger stage. - pipeline.OutputMergerStage = ((Direct3D11.DeviceContext) Effect.GraphicsDevice).OutputMerger; - - for (int i = 0; i < StageCount; i++) - { - var shaderType = (EffectShaderType) i; - var link = pass.Pipeline[shaderType]; - if (link == null) - continue; - - if (link.IsImport) - { - throw new InvalidOperationException(string.Format("Unable to resolve imported shader [{0}] for stage [{1}]", link.ImportName, shaderType)); - } - - var stageBlock = new StageBlock(shaderType); - pipeline.Stages[i] = stageBlock; - - stageBlock.Index = link.Index; - stageBlock.ShaderStage = Effect.GraphicsDevice.ShaderStages[i]; - stageBlock.StreamOutputElements = link.StreamOutputElements; - stageBlock.StreamOutputRasterizedStream = link.StreamOutputRasterizedStream; - - InitStageBlock(stageBlock, logger); - } - } - - /// - /// Initializes the stage block. - /// - /// The stage block. - /// The logger. - private void InitStageBlock(StageBlock stageBlock, Logger logger) - { - // If null shader, then skip init - var shaderIndex = stageBlock.Index; - if (shaderIndex < 0) - { - return; - } - - string errorProfile; - stageBlock.Shader = Effect.Pool.GetOrCompileShader(stageBlock.Type, shaderIndex, stageBlock.StreamOutputRasterizedStream, stageBlock.StreamOutputElements, out errorProfile); - - if (stageBlock.Shader == null) - { - logger.Error( - "Unsupported shader profile [{0} / {1}] on current GraphicsDevice [{2}] in (effect [{3}] Technique [{4}] Pass: [{5}])", - stageBlock.Type, - errorProfile, - graphicsDevice.Features.Level, - Effect.Name, - Technique.Name, - Name); - return; - } - - var shaderRaw = Effect.Pool.RegisteredShaders[shaderIndex]; - - // Cache the input signature - if (shaderRaw.Type == EffectShaderType.Vertex) - { - inputSignatureManager = graphicsDevice.GetOrCreateInputSignatureManager(shaderRaw.InputSignature.Bytecode, shaderRaw.InputSignature.Hashcode); - } - - for (int i = 0; i < shaderRaw.ConstantBuffers.Count; i++) - { - var constantBufferRaw = shaderRaw.ConstantBuffers[i]; - - // Constant buffers with a null size are skipped - if (constantBufferRaw.Size == 0) - continue; - - var constantBuffer = Effect.GetOrCreateConstantBuffer(Effect.GraphicsDevice, constantBufferRaw); - // IF constant buffer is null, it means that there is a conflict - if (constantBuffer == null) - { - logger.Error("Constant buffer [{0}] cannot have multiple size or different content declaration inside the same effect pool", constantBufferRaw.Name); - continue; - } - - // Test if this constant buffer is not already part of the effect - if (Effect.ConstantBuffers[constantBufferRaw.Name] == null) - { - // Add the declared constant buffer to the effect shader. - Effect.ConstantBuffers.Add(constantBuffer); - - // Declare all parameter from constant buffer at the effect level. - foreach (var parameter in constantBuffer.Parameters) - { - var previousParameter = Effect.Parameters[parameter.Name]; - if (previousParameter == null) - { - // Add an effect parameter linked to the appropriate constant buffer at the effect level. - Effect.Parameters.Add(new EffectParameter((EffectData.ValueTypeParameter) parameter.ParameterDescription, constantBuffer)); - } - else if (parameter.ParameterDescription != previousParameter.ParameterDescription || parameter.buffer != previousParameter.buffer) - { - // If registered parameters is different - logger.Error("Parameter [{0}] defined in Constant buffer [{0}] is already defined by another constant buffer with the definition [{2}]", parameter, constantBuffer.Name, previousParameter); - } - } - } - } - - var constantBufferLinks = new List(); - - // Declare all resource parameters at the effect level. - foreach (var parameterRaw in shaderRaw.ResourceParameters) - { - EffectParameter parameter; - var previousParameter = Effect.Parameters[parameterRaw.Name]; - - // Skip empty constant buffers. - if (parameterRaw.Type == EffectParameterType.ConstantBuffer && Effect.ConstantBuffers[parameterRaw.Name] == null) - { - continue; - } - - int resourceIndex = Effect.ResourceLinker.Count; - - if (previousParameter == null) - { - parameter = new EffectParameter(parameterRaw, EffectResourceTypeHelper.ConvertFromParameterType(parameterRaw.Type), Effect.ResourceLinker.Count, Effect.ResourceLinker); - Effect.Parameters.Add(parameter); - - Effect.ResourceLinker.Count += parameterRaw.Count; - } - else - { - if (CompareResourceParameter(parameterRaw, (EffectData.ResourceParameter) previousParameter.ParameterDescription)) - { - // If registered parameters is different - logger.Error("Resource Parameter [{0}] is already defined with a different definition [{1}]", parameterRaw, previousParameter.ParameterDescription); - } - parameter = previousParameter; - } - - // For constant buffers, we need to store explicit link - if (parameter.ResourceType == EffectResourceType.ConstantBuffer) - { - constantBufferLinks.Add(new ConstantBufferLink(Effect.ConstantBuffers[parameter.Name], parameter)); - } - - if (stageBlock.Parameters == null) - { - stageBlock.Parameters = new List(shaderRaw.ResourceParameters.Count); - } - - stageBlock.Parameters.Add(new ParameterBinding(parameter, parameterRaw.Slot)); - } - - stageBlock.ConstantBufferLinks = constantBufferLinks.ToArray(); - } - - /// - /// Optimizes the slot links. - /// - /// The stage block. - private void PrepareSlotLinks(ref StageBlock stageBlock) - { - // Allocate slots only when needed - stageBlock.Slots = new List[1 + (int)EffectResourceType.UnorderedAccessView]; - - // Retrieve Constant buffer resource index as It has been updated by the reordering of resources - for (int i = 0; i < stageBlock.ConstantBufferLinks.Length; i++) - { - stageBlock.ConstantBufferLinks[i].ResourceIndex = stageBlock.ConstantBufferLinks[i].Parameter.Offset; - } - - // Compute default slot links link - foreach (var parameterBinding in stageBlock.Parameters) - { - var parameter = parameterBinding.Parameter; - - var slots = stageBlock.Slots[(int)parameter.ResourceType]; - if (slots == null) - { - slots = new List(); - stageBlock.Slots[(int)parameter.ResourceType] = slots; - } - - var parameterRaw = (EffectData.ResourceParameter)parameter.ParameterDescription; - - var range = new SlotLinkSet() { SlotCount = parameterRaw.Count, SlotIndex = parameterBinding.Slot }; - slots.Add(range); - range.Links.Add(new SlotLink(parameter.Offset, 0, parameterRaw.Count)); - } - - if (EnableDebug) - { - DebugLog.WriteLine("*** Before OptimizeSlotLinks ****"); - PrintLinks(ref stageBlock); - } - - // Optimize all slots - foreach (var slotRangePerResourceType in stageBlock.Slots) - { - if (slotRangePerResourceType == null) - continue; - - var previousRange = slotRangePerResourceType[0]; - - for (int i = 1; i < slotRangePerResourceType.Count; i++) - { - var currentRange = slotRangePerResourceType[i]; - int endIndex = previousRange.SlotIndex + previousRange.SlotCount; - - var delta = (currentRange.SlotIndex - endIndex); - - // If there is at maximum a 1 - if (delta <= 1) - { - foreach (var slotLink in currentRange.Links) - { - var previousLink = previousRange.Links[previousRange.Links.Count - 1]; - // Merge consecutive individual slot link - if ((previousLink.GlobalIndex + previousLink.SlotCount) == slotLink.GlobalIndex && (previousLink.SlotIndex + previousLink.SlotCount) == (currentRange.SlotIndex + slotLink.SlotIndex)) - { - previousLink.SlotCount += slotLink.SlotCount; - previousRange.Links[previousRange.Links.Count - 1] = previousLink; - } - else - { - previousRange.Links.Add(new SlotLink(slotLink.GlobalIndex, (slotLink.SlotIndex + previousRange.SlotCount + delta), slotLink.SlotCount)); - } - } - - // Update the total slot count - previousRange.SlotCount += (short)(delta + currentRange.SlotCount); - - slotRangePerResourceType.RemoveAt(i); - i--; - } - else - { - previousRange = currentRange; - } - } - } - - if (EnableDebug) - { - DebugLog.WriteLine("*** After OptimizeSlotLinks ****"); - PrintLinks(ref stageBlock); - } - } - - /// - /// Computes the slot links. - /// - internal unsafe void ComputeSlotLinks() - { - // Total size allocated for the unmanaged buffers. - int slotTotalMemory = 0; - - // Offset in bytes to the all SlotLinks to resource - int singleSlotLinksOffset = 0; - - // Offset in bytes to the begin of buffer pointers - int pointerBuffersOffset = 0; - - // ---------------------------------------------------------------------------------- - // 0 pass: Prepare all slot links - // ---------------------------------------------------------------------------------- - foreach (var stageBlockVar in pipeline.Stages) - { - var stageBlock = stageBlockVar; - - if (stageBlock == null || stageBlock.Parameters == null) - continue; - - PrepareSlotLinks(ref stageBlock); - } - - // ---------------------------------------------------------------------------------- - // 1st pass: calculate memory for all SlotLinks and buffer of pointers for each stage - // ---------------------------------------------------------------------------------- - int totalPointerCount = 0; - foreach (var stageBlockVar in pipeline.Stages) - { - var stageBlock = stageBlockVar; - - if (stageBlock == null || stageBlock.Slots == null) - continue; - - for (int resourceType = 0; resourceType < stageBlock.Slots.Length; resourceType++) - { - var slotLinkSetList = stageBlock.Slots[resourceType]; - if (slotLinkSetList == null) - { - continue; - } - - // Allocate memory for slotlinks per type - singleSlotLinksOffset += slotLinkSetList.Count * Utilities.SizeOf(); - - // Allocate memory for each single slot links - foreach (var slotLinkSet in slotLinkSetList) - { - // Optimization: If there is only 1 slot link set, than we can use direct reference to EffectResourceLinker - // else we need to use an intermediate buffer - if (!slotLinkSet.IsDirectSlot) - { - pointerBuffersOffset += slotLinkSet.Links.Count * Utilities.SizeOf(); - slotTotalMemory += slotLinkSet.SlotCount * Utilities.SizeOf(); // +PointerResources - slotTotalMemory += slotLinkSet.SlotCount * sizeof(int); // + UAVCounts - totalPointerCount += slotLinkSet.SlotCount; - } - } - } - } - - slotTotalMemory += singleSlotLinksOffset; - slotTotalMemory += pointerBuffersOffset; - - pointerBuffersOffset += singleSlotLinksOffset; - - // Allocate all memory - pipeline.GlobalSlotPointer = Effect.DisposeCollector.Collect(Utilities.AllocateMemory(slotTotalMemory)); - - // Clear this memory - Utilities.ClearMemory(pipeline.GlobalSlotPointer, 0, slotTotalMemory); - - // Calculate address of slotlinks - pipeline.CopySlotLinks.Links = (SlotLink*) ((byte*) pipeline.GlobalSlotPointer + singleSlotLinksOffset); - - // Calculate address of buffer pointers - pipeline.PointersBuffer = (IntPtr*) ((byte*) pipeline.GlobalSlotPointer + pointerBuffersOffset); - pipeline.UAVBuffer = (int*)((byte*)pipeline.PointersBuffer + totalPointerCount * Utilities.SizeOf()); - - // Initialize default UAVCounts to -1 - for (int i = 0; i < totalPointerCount; i++) - { - pipeline.UAVBuffer[i] = -1; - } - - if (EnableDebug) - { - DebugLog.WriteLine("Memory Layout for Effect [{0}] Pass [{1}]", Effect.Name, Name); - DebugLog.WriteLine("Global SlotLinks Native Buffer [0x{0:X} - 0x{1:X}] ({2} bytes)", pipeline.GlobalSlotPointer.ToInt64(), new IntPtr((byte*)pipeline.GlobalSlotPointer + slotTotalMemory).ToInt64(), slotTotalMemory); - - DebugLog.WriteLine("SlotLinks Per Type [0x{0:X} - 0x{1:X}] ({2} bytes)", pipeline.GlobalSlotPointer.ToInt64(), new IntPtr(pipeline.CopySlotLinks.Links).ToInt64(), singleSlotLinksOffset); - - DebugLog.WriteLine("SlotLinks Copy [0x{0:X} - 0x{1:X}] ({2} bytes)", new IntPtr(pipeline.CopySlotLinks.Links).ToInt64(), new IntPtr(pipeline.PointersBuffer).ToInt64(), pointerBuffersOffset - singleSlotLinksOffset); - - DebugLog.WriteLine("Slot Copy Pointers [0x{0:X} - 0x{1:X}] ({2} bytes)", new IntPtr(pipeline.PointersBuffer).ToInt64(), new IntPtr((byte*)pipeline.GlobalSlotPointer + slotTotalMemory).ToInt64(), slotTotalMemory - pointerBuffersOffset); - DebugLog.WriteLine(""); - DebugLog.Flush(); - } - - // ---------------------------------------------------------------------------------- - // 2nd pass: calculate memory for all SlotLinks and buffer of pointers for each stage - // ---------------------------------------------------------------------------------- - var globalSoftLink = (SlotLink*) pipeline.GlobalSlotPointer; - - var slotLinks = pipeline.CopySlotLinks.Links; - - int currentPointerIndex = 0; - - foreach (var stageBlock in pipeline.Stages) - { - if (stageBlock == null) - continue; - - if (stageBlock.Slots == null) - continue; - - for (int resourceType = 0; resourceType < stageBlock.Slots.Length; resourceType++) - { - var slotLinkSetList = stageBlock.Slots[resourceType]; - if (slotLinkSetList == null) - continue; - - var slotLinksPerType = globalSoftLink; - - bool isUAV = false; - switch ((EffectResourceType) resourceType) - { - case EffectResourceType.ConstantBuffer: - stageBlock.ConstantBufferSlotLinks.Count = slotLinkSetList.Count; - stageBlock.ConstantBufferSlotLinks.Links = slotLinksPerType; - break; - case EffectResourceType.ShaderResourceView: - stageBlock.ShaderResourceViewSlotLinks.Count = slotLinkSetList.Count; - stageBlock.ShaderResourceViewSlotLinks.Links = slotLinksPerType; - break; - case EffectResourceType.UnorderedAccessView: - stageBlock.UnorderedAccessViewSlotLinks.Count = slotLinkSetList.Count; - stageBlock.UnorderedAccessViewSlotLinks.Links = slotLinksPerType; - isUAV = true; - break; - case EffectResourceType.SamplerState: - stageBlock.SamplerStateSlotLinks.Count = slotLinkSetList.Count; - stageBlock.SamplerStateSlotLinks.Links = slotLinksPerType; - break; - } - - globalSoftLink += slotLinkSetList.Count; - - // Allocate memory for each single slot links - foreach (var slotLinkSet in slotLinkSetList) - { - // Calculate the memory offset from the beginning of the - - slotLinksPerType->SlotIndex = slotLinkSet.SlotIndex; - slotLinksPerType->SlotCount = slotLinkSet.SlotCount; - if (slotLinkSet.IsDirectSlot) - { - slotLinksPerType->Pointer = (IntPtr) (Effect.ResourceLinker.Pointers + slotLinkSet.Links[0].GlobalIndex); - - // Special case for UAV initial counters - if (isUAV) - { - slotLinksPerType->UavInitialCount = (IntPtr)(Effect.ResourceLinker.UAVCounts + slotLinkSet.Links[0].GlobalIndex); - } - } - else - { - slotLinksPerType->Pointer = (IntPtr)((byte*)pipeline.PointersBuffer + currentPointerIndex * Utilities.SizeOf()); - - // Special case for UAV initial counters - if (isUAV) - { - slotLinksPerType->UavInitialCount = (IntPtr)((byte*)pipeline.UAVBuffer + currentPointerIndex * Utilities.SizeOf()); - } - - foreach (SlotLink localLink in slotLinkSet.Links) - { - var slotLink = localLink; - - // Make slotIndex absolute - slotLink.SlotIndex = slotLink.SlotIndex + currentPointerIndex; - *slotLinks++ = slotLink; - pipeline.CopySlotLinks.Count++; - } - - currentPointerIndex += slotLinkSet.SlotCount; - } - - slotLinksPerType++; - } - } - } - } - - private void PrintLinks(ref StageBlock stageBlock) - { - DebugLog.WriteLine(" |- Stage [{0}]", stageBlock.Shader.GetType().Name); - for (int resourceTypeIndex = 0; resourceTypeIndex < stageBlock.Slots.Length; resourceTypeIndex++) - { - var resourceType = (EffectResourceType)resourceTypeIndex; - var slotRangePerResourceType = stageBlock.Slots[resourceTypeIndex]; - if (slotRangePerResourceType == null) - { - continue; - } - - DebugLog.WriteLine(" |- ResourceType [{0}]", resourceType); - foreach (var slotLinkSet in slotRangePerResourceType) - { - DebugLog.WriteLine(" |- SlotRange Slot [{0}] Count [{1}] (IsDirect: {2})", slotLinkSet.SlotIndex, slotLinkSet.SlotCount, slotLinkSet.IsDirectSlot); - foreach (var slotLink in slotLinkSet.Links) - { - DebugLog.WriteLine(" |- Resource [{0}] Index [{1}] Count[{2}]", slotLink.GlobalIndex, slotLink.SlotIndex, slotLink.SlotCount); - } - } - } - } - - private bool CompareResourceParameter(EffectData.ResourceParameter left, EffectData.ResourceParameter right) - { - return (left.Class != right.Class || left.Type != right.Type || left.Count != right.Count); - } - - private PropertyCollection PrepareProperties(Logger logger, CommonData.PropertyCollection properties) - { - var passProperties = new PropertyCollection(); - - foreach (var property in properties) - { - switch (property.Key) - { - case EffectData.PropertyKeys.Blending: - BlendState = graphicsDevice.BlendStates[(string)property.Value]; - if (BlendState == null) - logger.Error("Unable to find registered BlendState [{0}]", (string)property.Value); - break; - case EffectData.PropertyKeys.BlendingColor: - BlendStateColor = (Color4)(Vector4)property.Value; - break; - case EffectData.PropertyKeys.BlendingSampleMask: - BlendStateSampleMask = (uint)property.Value; - break; - - case EffectData.PropertyKeys.DepthStencil: - DepthStencilState = graphicsDevice.DepthStencilStates[(string)property.Value]; - if (DepthStencilState == null) - logger.Error("Unable to find registered DepthStencilState [{0}]", (string)property.Value); - break; - case EffectData.PropertyKeys.DepthStencilReference: - DepthStencilReference = (int)property.Value; - break; - - case EffectData.PropertyKeys.Rasterizer: - RasterizerState = graphicsDevice.RasterizerStates[(string)property.Value]; - if (RasterizerState == null) - logger.Error("Unable to find registered RasterizerState [{0}]", (string)property.Value); - break; - default: - passProperties[new PropertyKey(property.Key)] = property.Value; - break; - } - } - - return passProperties; - } - - - private readonly Dictionary LocalInputLayoutCache = new Dictionary(); - - internal InputLayout GetInputLayout(VertexInputLayout layout) - { - if (layout == null) - return null; - - if (!ReferenceEquals(currentInputLayoutPair.VertexInputLayout, layout)) - { - // Use a local cache to speed up retrieval - if (!LocalInputLayoutCache.TryGetValue(layout, out currentInputLayoutPair)) - { - inputSignatureManager.GetOrCreate(layout, out currentInputLayoutPair); - LocalInputLayoutCache.Add(layout, currentInputLayoutPair); - } - } - return currentInputLayoutPair.InputLayout; - } - - #region Nested type: PipelineBlock - - private struct PipelineBlock - { - public IntPtr GlobalSlotPointer; - - public OutputMergerStage OutputMergerStage; - public unsafe IntPtr* PointersBuffer; - public unsafe int* UAVBuffer; - public RawSlotLinkSet CopySlotLinks; - public StageBlock[] Stages; - } - - private struct ParameterBinding - { - public ParameterBinding(EffectParameter parameter, int slot) - { - Parameter = parameter; - Slot = slot; - } - - public readonly EffectParameter Parameter; - - public readonly int Slot; - } - - #endregion - - #region Nested type: RawSlotLinkSet - - private struct RawSlotLinkSet - { - /// - /// Number of SlotLinks. - /// - public int Count; - - /// - /// SlotLink* ptr; - /// - public unsafe SlotLink* Links; - } - - #endregion - - #region Nested type: SlotLink - - // The CLR seems to have a bug when using an explicit layout and adding this object - // to a list. The object is not correctly copied! - [StructLayout(LayoutKind.Sequential)] - private struct SlotLink - { - public SlotLink(int globalIndex, int slotIndex, int slotCount) - { - Pointer = new IntPtr(globalIndex); - SlotIndex = slotIndex; - SlotCount = slotCount; - UavInitialCount = IntPtr.Zero; - } - - public IntPtr Pointer; - - public int SlotIndex; - - public int SlotCount; - - public IntPtr UavInitialCount; - - public int GlobalIndex - { - get - { - return Pointer.ToInt32(); - } - } - } - - #endregion - - #region Nested type: SlotLinkSet - - private class SlotLinkSet - { - public List Links; - public short SlotCount; - public int SlotIndex; - - public SlotLinkSet() - { - Links = new List(); - } - - public bool IsDirectSlot - { - get { return Links.Count == 1; } - } - } - - #endregion - - #region Nested type: StageBlock - - private class StageBlock - { - public List Parameters; - - public RawSlotLinkSet ConstantBufferSlotLinks; - public ConstantBufferLink[] ConstantBufferLinks; - public int Index; - public RawSlotLinkSet SamplerStateSlotLinks; - - public DeviceChild Shader; - - public RawSlotLinkSet ShaderResourceViewSlotLinks; - - public CommonShaderStage ShaderStage; - public List[] Slots; - public EffectShaderType Type; - public RawSlotLinkSet UnorderedAccessViewSlotLinks; - - public StreamOutputElement[] StreamOutputElements; - - public int StreamOutputRasterizedStream; - - public StageBlock(EffectShaderType type) - { - Type = type; - } - } - - private struct ConstantBufferLink - { - public ConstantBufferLink(EffectConstantBuffer constantBuffer, EffectParameter parameter) - { - ConstantBuffer = constantBuffer; - Parameter = parameter; - ResourceIndex = 0; - } - - public readonly EffectConstantBuffer ConstantBuffer; - - public readonly EffectParameter Parameter; - - public int ResourceIndex; - } - - #endregion - } +// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; +using SharpDX.Direct3D11; +using SharpDX.Mathematics; +using SharpDX.Toolkit.Diagnostics; + +namespace SharpDX.Toolkit.Graphics +{ + /// + /// Contains rendering state for drawing with an effect; an effect can contain one or more passes. + /// + public sealed class EffectPass : ComponentBase + { + private const int StageCount = 6; + + internal const int MaximumResourceCountPerStage = + Direct3D11.CommonShaderStage.ConstantBufferApiSlotCount + // Constant buffer + Direct3D11.CommonShaderStage.InputResourceSlotCount + // ShaderResourceView + Direct3D11.ComputeShaderStage.UnorderedAccessViewSlotCount + // UnorderedAccessView + Direct3D11.CommonShaderStage.SamplerSlotCount; // SamplerStates; + + /// + /// Declared 128 UAV counters for SetUnordere + /// + private static readonly int[] UnchangedUAVCounters = + { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + , -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + , -1, -1, -1, + }; + + /// + /// Gets the attributes associated with this pass. + /// + /// The attributes. + public readonly PropertyCollection Properties; + + /// + /// The parent effect of this pass. + /// + public readonly Effect Effect; + + private readonly EffectData.Pass pass; + private readonly GraphicsDevice graphicsDevice; + + private PipelineBlock pipeline; + + private BlendState blendState; + private bool hasBlendState = false; + private Color4 blendStateColor; + private bool hasBlendStateColor; + private uint blendStateSampleMask; + + private DepthStencilState depthStencilState; + private bool hasDepthStencilState = false; + private int depthStencilReference; + private bool hasDepthStencilReference = false; + + private bool hasRasterizerState = false; + private RasterizerState rasterizerState; + + private InputSignatureManager inputSignatureManager; + private InputLayoutPair currentInputLayoutPair; + + internal EffectTechnique Technique; + + private const bool EnableDebug = false; + internal TextWriter DebugLog = new StringWriter(); + + /// + /// Initializes a new instance of the class. + /// + /// The logger used to log errors. + /// The effect. + /// The technique. + /// The pass. + /// The name. + internal EffectPass(Logger logger, Effect effect, EffectTechnique technique, EffectData.Pass pass, string name) + : base(name) + { + this.Technique = technique; + this.pass = pass; + this.Effect = effect; + this.graphicsDevice = effect.GraphicsDevice; + pipeline = new PipelineBlock() + { + Stages = new StageBlock[EffectPass.StageCount], + }; + + Properties = PrepareProperties(logger, pass.Properties); + IsSubPass = pass.IsSubPass; + // Don't create SubPasses collection for subpass. + if (!IsSubPass) + SubPasses = new EffectPassCollection(); + } + + /// + /// Gets the sub-pass attached to a global pass. + /// + /// + /// As a subpass cannot have subpass, if this pass is already a subpass, this field is null. + /// + public readonly EffectPassCollection SubPasses; + + /// + /// Gets a boolean indicating if this pass is a subpass. + /// + public readonly bool IsSubPass; + + /// + /// Gets or sets the state of the blend. + /// + /// The state of the blend. + public BlendState BlendState + { + get { return blendState; } + set + { + blendState = value; + hasBlendState = true; + } + } + + /// + /// Gets or sets the color of the blend state. + /// + /// The color of the blend state. + public Color4 BlendStateColor + { + get { return blendStateColor; } + set + { + blendStateColor = value; + hasBlendStateColor = true; + } + } + + /// + /// Gets or sets the blend state sample mask. + /// + /// The blend state sample mask. + public uint BlendStateSampleMask + { + get { return blendStateSampleMask; } + set { blendStateSampleMask = value; } + } + + /// + /// Gets or sets the state of the depth stencil. + /// + /// The state of the depth stencil. + public DepthStencilState DepthStencilState + { + get { return depthStencilState; } + set + { + depthStencilState = value; + hasDepthStencilState = true; + } + } + + /// + /// Gets or sets the depth stencil reference. + /// + /// The depth stencil reference. + public int DepthStencilReference + { + get { return depthStencilReference; } + set + { + depthStencilReference = value; + hasDepthStencilReference = true; + } + } + + /// + /// Gets or sets the state of the rasterizer. + /// + /// The state of the rasterizer. + public RasterizerState RasterizerState + { + get { return rasterizerState; } + set + { + rasterizerState = value; + hasRasterizerState = true; + } + } + /// + /// Applies this pass to the device pipeline. + /// + /// + /// This method is responsible to: + ///
    + ///
  • Setup the shader on each stage.
  • + ///
  • Upload constant buffers with dirty flag
  • + ///
  • Set all input constant buffers, shader resource view, unordered access views and sampler states to the stage.
  • + ///
+ ///
+ public void Apply() + { + // Give a chance to the effect callback to prepare this pass before it is actually applied (the OnApply can completely + // change the pass and use for example a subpass). + var realPass = Effect.OnApply(this); + realPass.ApplyInternal(); + + // Applies global state if we have applied a subpass (that will eventually override states setup by realPass) + if (realPass != this) + { + ApplyStates(); + } + } + + /// + /// Un-Applies this pass to the device pipeline by unbinding all resources/views previously bound by this pass. This is not mandatory to call this method, unless you want to explicitly unbind + /// resource views that were bound by this pass. + /// + /// if set to true this will unbind all resources; otherwise false will unbind only ShaderResourceView and UnorderedAccessView. Default is false. + public unsafe void UnApply(bool fullUnApply = false) + { + // If nothing to clear, return immediately + if (graphicsDevice.CurrentPass == null) + { + return; + } + + // Sets the current pass on the graphics device + graphicsDevice.CurrentPass = null; + + // ---------------------------------------------- + // Iterate on each stage to setup all inputs + // ---------------------------------------------- + for (int stageIndex = 0; stageIndex < pipeline.Stages.Length; stageIndex++) + { + var stageBlock = pipeline.Stages[stageIndex]; + if (stageBlock == null) + { + continue; + } + + var shaderStage = stageBlock.ShaderStage; + + // ---------------------------------------------- + // Setup the shader for this stage. + // ---------------------------------------------- + if (fullUnApply) + { + shaderStage.SetShader(null, null, 0); + } + + // If Shader is a null shader, then skip further processing + if (stageBlock.Index < 0) + { + continue; + } + + var mergerStage = pipeline.OutputMergerStage; + + // ---------------------------------------------- + // Reset ShaderResourceView + // ---------------------------------------------- + RawSlotLinkSet localLink = stageBlock.ShaderResourceViewSlotLinks; + SlotLink* pLinks = localLink.Links; + + for (int i = 0; i < localLink.Count; i++) + { + // NOTE SmartK8 : Calls internal method + MethodInfo setShaderResources = shaderStage.GetType().GetMethod("SetShaderResources", BindingFlags.NonPublic | BindingFlags.Instance); + setShaderResources.Invoke(shaderStage, new Object[] { pLinks->SlotIndex, pLinks->SlotCount, graphicsDevice.ResetSlotsPointers }); + pLinks++; + } + + // ---------------------------------------------- + // Reset UnorderedAccessView + // ---------------------------------------------- + localLink = stageBlock.UnorderedAccessViewSlotLinks; + pLinks = localLink.Links; + + if (stageBlock.Type == EffectShaderType.Compute) + { + for (int i = 0; i < localLink.Count; i++) + { + // NOTE SmartK8 : Calls internal method + MethodInfo setUnorderedAccessViews = shaderStage.GetType().GetMethod("SetUnorderedAccessViews", BindingFlags.NonPublic | BindingFlags.Instance); + setUnorderedAccessViews.Invoke(shaderStage, new Object[] { pLinks->SlotIndex, pLinks->SlotCount, graphicsDevice.ResetSlotsPointers }); + pLinks++; + } + } + else + { + // Otherwise, for OutputMergerStage. + for (int i = 0; i < localLink.Count; i++) + { + // NOTE SmartK8 : Calls internal method + MethodInfo setUnorderedAccessViews = mergerStage.GetType().GetMethod("SetUnorderedAccessViews", BindingFlags.NonPublic | BindingFlags.Instance); + setUnorderedAccessViews.Invoke(mergerStage, new Object[] { pLinks->SlotIndex, pLinks->SlotCount, graphicsDevice.ResetSlotsPointers, pLinks->UavInitialCount }); + pLinks++; + } + } + + if (fullUnApply) + { + // ---------------------------------------------- + // Reset Constant Buffers + // ---------------------------------------------- + localLink = stageBlock.ConstantBufferSlotLinks; + pLinks = localLink.Links; + + for (int i = 0; i < localLink.Count; i++) + { + // NOTE SmartK8 : Calls internal method + MethodInfo setConstantBuffers = shaderStage.GetType().GetMethod("SetConstantBuffers", BindingFlags.NonPublic | BindingFlags.Instance); + setConstantBuffers.Invoke(shaderStage, new Object[] { pLinks->SlotIndex, pLinks->SlotCount, graphicsDevice.ResetSlotsPointers }); + pLinks++; + } + } + } + + if (fullUnApply) + { + // ---------------------------------------------- + // Set the blend state + // ---------------------------------------------- + if (hasBlendState) + { + graphicsDevice.SetBlendState(null); + } + + // ---------------------------------------------- + // Set the depth stencil state + // ---------------------------------------------- + if (hasDepthStencilState) + { + graphicsDevice.SetDepthStencilState(null); + } + + // ---------------------------------------------- + // Set the rasterizer state + // ---------------------------------------------- + if (hasRasterizerState) + { + graphicsDevice.SetRasterizerState(null); + } + } + } + + /// + /// Internal apply. + /// + private unsafe void ApplyInternal() + { + // By default, we set the Current technique + Effect.CurrentTechnique = Technique; + + // Sets the current pass on the graphics device + graphicsDevice.CurrentPass = this; + + var pLinks = pipeline.CopySlotLinks.Links; + var pPointers = pipeline.PointersBuffer; + var pUAVs = pipeline.UAVBuffer; + var constantBuffers = Effect.ResourceLinker.ConstantBuffers; + + // --------------------------------------------------------------------- + // Handle sparse input resources and update their continuous counterpart. + // --------------------------------------------------------------------- + var resourceLinkerPointers = Effect.ResourceLinker.Pointers; + var resourceLinkerUAVCounts = Effect.ResourceLinker.UAVCounts; + for (int i = 0; i < pipeline.CopySlotLinks.Count; i++) + { + var pWritePtr = pPointers + pLinks->SlotIndex; + int slotIndex = pLinks->GlobalIndex; + if (pLinks->UavInitialCount == IntPtr.Zero) + { + for (int j = 0; j < pLinks->SlotCount; j++, slotIndex++) + { + *pWritePtr++ = resourceLinkerPointers[slotIndex]; + } + } + else + { + var pWriteUAVPtr = pUAVs + pLinks->SlotIndex; + for (int j = 0; j < pLinks->SlotCount; j++, slotIndex++) + { + *pWritePtr++ = resourceLinkerPointers[slotIndex]; + *pWriteUAVPtr++ = resourceLinkerUAVCounts[slotIndex]; + } + } + pLinks++; + } + + // ---------------------------------------------- + // Iterate on each stage to setup all inputs + // ---------------------------------------------- + for (int stageIndex = 0; stageIndex < pipeline.Stages.Length; stageIndex++) + { + var stageBlock = pipeline.Stages[stageIndex]; + if (stageBlock == null) + { + continue; + } + + var shaderStage = stageBlock.ShaderStage; + + // ---------------------------------------------- + // Setup the shader for this stage. + // ---------------------------------------------- + shaderStage.SetShader(stageBlock.Shader, null, 0); + + // If Shader is a null shader, then skip further processing + if (stageBlock.Index < 0) + { + continue; + } + + var mergerStage = pipeline.OutputMergerStage; + + // ---------------------------------------------- + // Setup Constant Buffers + // ---------------------------------------------- + + // Upload all constant buffers to the GPU they have been modified. + for (int i = 0; i < stageBlock.ConstantBufferLinks.Length; i++) + { + var constantBufferLink = stageBlock.ConstantBufferLinks[i]; + var constantBuffer = constantBufferLink.ConstantBuffer; + if (constantBuffer.IsDirty) + { + constantBuffers[constantBufferLink.ResourceIndex].SetData(Effect.GraphicsDevice, new DataPointer(constantBuffer.BackingBuffer.DataPointer, constantBuffer.BackingBuffer.Size)); + constantBuffer.IsDirty = false; + } + } + + var localLink = stageBlock.ConstantBufferSlotLinks; + pLinks = localLink.Links; + for (int i = 0; i < localLink.Count; i++) + { + // NOTE SmartK8 : Calls internal method + MethodInfo setConstantBuffers = shaderStage.GetType().GetMethod("SetConstantBuffers", BindingFlags.NonPublic | BindingFlags.Instance); + setConstantBuffers.Invoke(shaderStage, new Object[] { pLinks->SlotIndex, pLinks->SlotCount, pLinks->Pointer }); + pLinks++; + } + + // ---------------------------------------------- + // Setup ShaderResourceView + // ---------------------------------------------- + localLink = stageBlock.ShaderResourceViewSlotLinks; + pLinks = localLink.Links; + for (int i = 0; i < localLink.Count; i++) + { + // NOTE SmartK8 : Calls internal method + MethodInfo setShaderResources = shaderStage.GetType().GetMethod("SetShaderResources", BindingFlags.NonPublic | BindingFlags.Instance); + setShaderResources.Invoke(shaderStage, new Object[] { pLinks->SlotIndex, pLinks->SlotCount, pLinks->Pointer }); + pLinks++; + } + + // ---------------------------------------------- + // Setup UnorderedAccessView + // ---------------------------------------------- + localLink = stageBlock.UnorderedAccessViewSlotLinks; + pLinks = localLink.Links; + + if (stageBlock.Type == EffectShaderType.Compute) + { + for (int i = 0; i < localLink.Count; i++) + { + // NOTE SmartK8 : Calls internal method + MethodInfo setUnorderedAccessViews = mergerStage.GetType().GetMethod("SetUnorderedAccessViews", BindingFlags.NonPublic | BindingFlags.Instance); + setUnorderedAccessViews.Invoke(mergerStage, new Object[] { pLinks->SlotIndex, pLinks->SlotCount, pLinks->Pointer, pLinks->UavInitialCount }); + pLinks++; + } + } + else + { + // Otherwise, for OutputMergerStage. + for (int i = 0; i < localLink.Count; i++) + { + // NOTE SmartK8 : Calls internal method + MethodInfo setUnorderedAccessViews = mergerStage.GetType().GetMethod("SetUnorderedAccessViews", BindingFlags.NonPublic | BindingFlags.Instance); + setUnorderedAccessViews.Invoke(mergerStage, new Object[] { pLinks->SlotIndex, pLinks->SlotCount, pLinks->Pointer, pLinks->UavInitialCount }); + pLinks++; + } + } + + // ---------------------------------------------- + // Setup SamplerStates + // ---------------------------------------------- + localLink = stageBlock.SamplerStateSlotLinks; + pLinks = localLink.Links; + for (int i = 0; i < localLink.Count; i++) + { + // NOTE SmartK8 : Calls internal method + MethodInfo setSamplers = shaderStage.GetType().GetMethod("SetSamplers", BindingFlags.NonPublic | BindingFlags.Instance); + setSamplers.Invoke(shaderStage, new Object[] { pLinks->SlotIndex, pLinks->SlotCount, pLinks->Pointer }); + pLinks++; + } + } + + ApplyStates(); + } + + private void ApplyStates() + { + // ---------------------------------------------- + // Set the blend state + // ---------------------------------------------- + if (hasBlendState) + { + if (hasBlendStateColor) + { + graphicsDevice.SetBlendState(blendState, BlendStateColor, blendStateSampleMask); + } + else + { + graphicsDevice.SetBlendState(blendState); + } + } + + // ---------------------------------------------- + // Set the depth stencil state + // ---------------------------------------------- + if (hasDepthStencilState) + { + if (hasDepthStencilReference) + { + graphicsDevice.SetDepthStencilState(depthStencilState, DepthStencilReference); + } + else + { + graphicsDevice.SetDepthStencilState(depthStencilState); + } + } + + // ---------------------------------------------- + // Set the rasterizer state + // ---------------------------------------------- + if (hasRasterizerState) + { + graphicsDevice.SetRasterizerState(rasterizerState); + } + } + + /// + /// Initializes this pass. + /// + /// The logger. + /// + internal void Initialize(Logger logger) + { + // Gets the output merger stage. + pipeline.OutputMergerStage = ((Direct3D11.DeviceContext) Effect.GraphicsDevice).OutputMerger; + + for (int i = 0; i < StageCount; i++) + { + var shaderType = (EffectShaderType) i; + var link = pass.Pipeline[shaderType]; + if (link == null) + continue; + + if (link.IsImport) + { + throw new InvalidOperationException(string.Format("Unable to resolve imported shader [{0}] for stage [{1}]", link.ImportName, shaderType)); + } + + var stageBlock = new StageBlock(shaderType); + pipeline.Stages[i] = stageBlock; + + stageBlock.Index = link.Index; + stageBlock.ShaderStage = Effect.GraphicsDevice.ShaderStages[i]; + stageBlock.StreamOutputElements = link.StreamOutputElements; + stageBlock.StreamOutputRasterizedStream = link.StreamOutputRasterizedStream; + + InitStageBlock(stageBlock, logger); + } + } + + /// + /// Initializes the stage block. + /// + /// The stage block. + /// The logger. + private void InitStageBlock(StageBlock stageBlock, Logger logger) + { + // If null shader, then skip init + var shaderIndex = stageBlock.Index; + if (shaderIndex < 0) + { + return; + } + + string errorProfile; + stageBlock.Shader = Effect.Pool.GetOrCompileShader(stageBlock.Type, shaderIndex, stageBlock.StreamOutputRasterizedStream, stageBlock.StreamOutputElements, out errorProfile); + + if (stageBlock.Shader == null) + { + logger.Error( + "Unsupported shader profile [{0} / {1}] on current GraphicsDevice [{2}] in (effect [{3}] Technique [{4}] Pass: [{5}])", + stageBlock.Type, + errorProfile, + graphicsDevice.Features.Level, + Effect.Name, + Technique.Name, + Name); + return; + } + + var shaderRaw = Effect.Pool.RegisteredShaders[shaderIndex]; + + // Cache the input signature + if (shaderRaw.Type == EffectShaderType.Vertex) + { + inputSignatureManager = graphicsDevice.GetOrCreateInputSignatureManager(shaderRaw.InputSignature.Bytecode, shaderRaw.InputSignature.Hashcode); + } + + for (int i = 0; i < shaderRaw.ConstantBuffers.Count; i++) + { + var constantBufferRaw = shaderRaw.ConstantBuffers[i]; + + // Constant buffers with a null size are skipped + if (constantBufferRaw.Size == 0) + continue; + + var constantBuffer = Effect.GetOrCreateConstantBuffer(Effect.GraphicsDevice, constantBufferRaw); + // IF constant buffer is null, it means that there is a conflict + if (constantBuffer == null) + { + logger.Error("Constant buffer [{0}] cannot have multiple size or different content declaration inside the same effect pool", constantBufferRaw.Name); + continue; + } + + // Test if this constant buffer is not already part of the effect + if (Effect.ConstantBuffers[constantBufferRaw.Name] == null) + { + // Add the declared constant buffer to the effect shader. + Effect.ConstantBuffers.Add(constantBuffer); + + // Declare all parameter from constant buffer at the effect level. + foreach (var parameter in constantBuffer.Parameters) + { + var previousParameter = Effect.Parameters[parameter.Name]; + if (previousParameter == null) + { + // Add an effect parameter linked to the appropriate constant buffer at the effect level. + Effect.Parameters.Add(new EffectParameter((EffectData.ValueTypeParameter) parameter.ParameterDescription, constantBuffer)); + } + else if (parameter.ParameterDescription != previousParameter.ParameterDescription || parameter.buffer != previousParameter.buffer) + { + // If registered parameters is different + logger.Error("Parameter [{0}] defined in Constant buffer [{0}] is already defined by another constant buffer with the definition [{2}]", parameter, constantBuffer.Name, previousParameter); + } + } + } + } + + var constantBufferLinks = new List(); + + // Declare all resource parameters at the effect level. + foreach (var parameterRaw in shaderRaw.ResourceParameters) + { + EffectParameter parameter; + var previousParameter = Effect.Parameters[parameterRaw.Name]; + + // Skip empty constant buffers. + if (parameterRaw.Type == EffectParameterType.ConstantBuffer && Effect.ConstantBuffers[parameterRaw.Name] == null) + { + continue; + } + + int resourceIndex = Effect.ResourceLinker.Count; + + if (previousParameter == null) + { + parameter = new EffectParameter(parameterRaw, EffectResourceTypeHelper.ConvertFromParameterType(parameterRaw.Type), Effect.ResourceLinker.Count, Effect.ResourceLinker); + Effect.Parameters.Add(parameter); + + Effect.ResourceLinker.Count += parameterRaw.Count; + } + else + { + if (CompareResourceParameter(parameterRaw, (EffectData.ResourceParameter) previousParameter.ParameterDescription)) + { + // If registered parameters is different + logger.Error("Resource Parameter [{0}] is already defined with a different definition [{1}]", parameterRaw, previousParameter.ParameterDescription); + } + parameter = previousParameter; + } + + // For constant buffers, we need to store explicit link + if (parameter.ResourceType == EffectResourceType.ConstantBuffer) + { + constantBufferLinks.Add(new ConstantBufferLink(Effect.ConstantBuffers[parameter.Name], parameter)); + } + + if (stageBlock.Parameters == null) + { + stageBlock.Parameters = new List(shaderRaw.ResourceParameters.Count); + } + + stageBlock.Parameters.Add(new ParameterBinding(parameter, parameterRaw.Slot)); + } + + stageBlock.ConstantBufferLinks = constantBufferLinks.ToArray(); + } + + /// + /// Optimizes the slot links. + /// + /// The stage block. + private void PrepareSlotLinks(ref StageBlock stageBlock) + { + // Allocate slots only when needed + stageBlock.Slots = new List[1 + (int)EffectResourceType.UnorderedAccessView]; + + // Retrieve Constant buffer resource index as It has been updated by the reordering of resources + for (int i = 0; i < stageBlock.ConstantBufferLinks.Length; i++) + { + stageBlock.ConstantBufferLinks[i].ResourceIndex = stageBlock.ConstantBufferLinks[i].Parameter.Offset; + } + + // Compute default slot links link + foreach (var parameterBinding in stageBlock.Parameters) + { + var parameter = parameterBinding.Parameter; + + var slots = stageBlock.Slots[(int)parameter.ResourceType]; + if (slots == null) + { + slots = new List(); + stageBlock.Slots[(int)parameter.ResourceType] = slots; + } + + var parameterRaw = (EffectData.ResourceParameter)parameter.ParameterDescription; + + var range = new SlotLinkSet() { SlotCount = parameterRaw.Count, SlotIndex = parameterBinding.Slot }; + slots.Add(range); + range.Links.Add(new SlotLink(parameter.Offset, 0, parameterRaw.Count)); + } + + if (EnableDebug) + { + DebugLog.WriteLine("*** Before OptimizeSlotLinks ****"); + PrintLinks(ref stageBlock); + } + + // Optimize all slots + foreach (var slotRangePerResourceType in stageBlock.Slots) + { + if (slotRangePerResourceType == null) + continue; + + var previousRange = slotRangePerResourceType[0]; + + for (int i = 1; i < slotRangePerResourceType.Count; i++) + { + var currentRange = slotRangePerResourceType[i]; + int endIndex = previousRange.SlotIndex + previousRange.SlotCount; + + var delta = (currentRange.SlotIndex - endIndex); + + // If there is at maximum a 1 + if (delta <= 1) + { + foreach (var slotLink in currentRange.Links) + { + var previousLink = previousRange.Links[previousRange.Links.Count - 1]; + // Merge consecutive individual slot link + if ((previousLink.GlobalIndex + previousLink.SlotCount) == slotLink.GlobalIndex && (previousLink.SlotIndex + previousLink.SlotCount) == (currentRange.SlotIndex + slotLink.SlotIndex)) + { + previousLink.SlotCount += slotLink.SlotCount; + previousRange.Links[previousRange.Links.Count - 1] = previousLink; + } + else + { + previousRange.Links.Add(new SlotLink(slotLink.GlobalIndex, (slotLink.SlotIndex + previousRange.SlotCount + delta), slotLink.SlotCount)); + } + } + + // Update the total slot count + previousRange.SlotCount += (short)(delta + currentRange.SlotCount); + + slotRangePerResourceType.RemoveAt(i); + i--; + } + else + { + previousRange = currentRange; + } + } + } + + if (EnableDebug) + { + DebugLog.WriteLine("*** After OptimizeSlotLinks ****"); + PrintLinks(ref stageBlock); + } + } + + /// + /// Computes the slot links. + /// + internal unsafe void ComputeSlotLinks() + { + // Total size allocated for the unmanaged buffers. + int slotTotalMemory = 0; + + // Offset in bytes to the all SlotLinks to resource + int singleSlotLinksOffset = 0; + + // Offset in bytes to the begin of buffer pointers + int pointerBuffersOffset = 0; + + // ---------------------------------------------------------------------------------- + // 0 pass: Prepare all slot links + // ---------------------------------------------------------------------------------- + foreach (var stageBlockVar in pipeline.Stages) + { + var stageBlock = stageBlockVar; + + if (stageBlock == null || stageBlock.Parameters == null) + continue; + + PrepareSlotLinks(ref stageBlock); + } + + // ---------------------------------------------------------------------------------- + // 1st pass: calculate memory for all SlotLinks and buffer of pointers for each stage + // ---------------------------------------------------------------------------------- + int totalPointerCount = 0; + foreach (var stageBlockVar in pipeline.Stages) + { + var stageBlock = stageBlockVar; + + if (stageBlock == null || stageBlock.Slots == null) + continue; + + for (int resourceType = 0; resourceType < stageBlock.Slots.Length; resourceType++) + { + var slotLinkSetList = stageBlock.Slots[resourceType]; + if (slotLinkSetList == null) + { + continue; + } + + // Allocate memory for slotlinks per type + singleSlotLinksOffset += slotLinkSetList.Count * Utilities.SizeOf(); + + // Allocate memory for each single slot links + foreach (var slotLinkSet in slotLinkSetList) + { + // Optimization: If there is only 1 slot link set, than we can use direct reference to EffectResourceLinker + // else we need to use an intermediate buffer + if (!slotLinkSet.IsDirectSlot) + { + pointerBuffersOffset += slotLinkSet.Links.Count * Utilities.SizeOf(); + slotTotalMemory += slotLinkSet.SlotCount * Utilities.SizeOf(); // +PointerResources + slotTotalMemory += slotLinkSet.SlotCount * sizeof(int); // + UAVCounts + totalPointerCount += slotLinkSet.SlotCount; + } + } + } + } + + slotTotalMemory += singleSlotLinksOffset; + slotTotalMemory += pointerBuffersOffset; + + pointerBuffersOffset += singleSlotLinksOffset; + + // Allocate all memory + pipeline.GlobalSlotPointer = Effect.DisposeCollector.Collect(Utilities.AllocateMemory(slotTotalMemory)); + + // Clear this memory + Utilities.ClearMemory(pipeline.GlobalSlotPointer, 0, slotTotalMemory); + + // Calculate address of slotlinks + pipeline.CopySlotLinks.Links = (SlotLink*) ((byte*) pipeline.GlobalSlotPointer + singleSlotLinksOffset); + + // Calculate address of buffer pointers + pipeline.PointersBuffer = (IntPtr*) ((byte*) pipeline.GlobalSlotPointer + pointerBuffersOffset); + pipeline.UAVBuffer = (int*)((byte*)pipeline.PointersBuffer + totalPointerCount * Utilities.SizeOf()); + + // Initialize default UAVCounts to -1 + for (int i = 0; i < totalPointerCount; i++) + { + pipeline.UAVBuffer[i] = -1; + } + + if (EnableDebug) + { + DebugLog.WriteLine("Memory Layout for Effect [{0}] Pass [{1}]", Effect.Name, Name); + DebugLog.WriteLine("Global SlotLinks Native Buffer [0x{0:X} - 0x{1:X}] ({2} bytes)", pipeline.GlobalSlotPointer.ToInt64(), new IntPtr((byte*)pipeline.GlobalSlotPointer + slotTotalMemory).ToInt64(), slotTotalMemory); + + DebugLog.WriteLine("SlotLinks Per Type [0x{0:X} - 0x{1:X}] ({2} bytes)", pipeline.GlobalSlotPointer.ToInt64(), new IntPtr(pipeline.CopySlotLinks.Links).ToInt64(), singleSlotLinksOffset); + + DebugLog.WriteLine("SlotLinks Copy [0x{0:X} - 0x{1:X}] ({2} bytes)", new IntPtr(pipeline.CopySlotLinks.Links).ToInt64(), new IntPtr(pipeline.PointersBuffer).ToInt64(), pointerBuffersOffset - singleSlotLinksOffset); + + DebugLog.WriteLine("Slot Copy Pointers [0x{0:X} - 0x{1:X}] ({2} bytes)", new IntPtr(pipeline.PointersBuffer).ToInt64(), new IntPtr((byte*)pipeline.GlobalSlotPointer + slotTotalMemory).ToInt64(), slotTotalMemory - pointerBuffersOffset); + DebugLog.WriteLine(""); + DebugLog.Flush(); + } + + // ---------------------------------------------------------------------------------- + // 2nd pass: calculate memory for all SlotLinks and buffer of pointers for each stage + // ---------------------------------------------------------------------------------- + var globalSoftLink = (SlotLink*) pipeline.GlobalSlotPointer; + + var slotLinks = pipeline.CopySlotLinks.Links; + + int currentPointerIndex = 0; + + foreach (var stageBlock in pipeline.Stages) + { + if (stageBlock == null) + continue; + + if (stageBlock.Slots == null) + continue; + + for (int resourceType = 0; resourceType < stageBlock.Slots.Length; resourceType++) + { + var slotLinkSetList = stageBlock.Slots[resourceType]; + if (slotLinkSetList == null) + continue; + + var slotLinksPerType = globalSoftLink; + + bool isUAV = false; + switch ((EffectResourceType) resourceType) + { + case EffectResourceType.ConstantBuffer: + stageBlock.ConstantBufferSlotLinks.Count = slotLinkSetList.Count; + stageBlock.ConstantBufferSlotLinks.Links = slotLinksPerType; + break; + case EffectResourceType.ShaderResourceView: + stageBlock.ShaderResourceViewSlotLinks.Count = slotLinkSetList.Count; + stageBlock.ShaderResourceViewSlotLinks.Links = slotLinksPerType; + break; + case EffectResourceType.UnorderedAccessView: + stageBlock.UnorderedAccessViewSlotLinks.Count = slotLinkSetList.Count; + stageBlock.UnorderedAccessViewSlotLinks.Links = slotLinksPerType; + isUAV = true; + break; + case EffectResourceType.SamplerState: + stageBlock.SamplerStateSlotLinks.Count = slotLinkSetList.Count; + stageBlock.SamplerStateSlotLinks.Links = slotLinksPerType; + break; + } + + globalSoftLink += slotLinkSetList.Count; + + // Allocate memory for each single slot links + foreach (var slotLinkSet in slotLinkSetList) + { + // Calculate the memory offset from the beginning of the + + slotLinksPerType->SlotIndex = slotLinkSet.SlotIndex; + slotLinksPerType->SlotCount = slotLinkSet.SlotCount; + if (slotLinkSet.IsDirectSlot) + { + slotLinksPerType->Pointer = (IntPtr) (Effect.ResourceLinker.Pointers + slotLinkSet.Links[0].GlobalIndex); + + // Special case for UAV initial counters + if (isUAV) + { + slotLinksPerType->UavInitialCount = (IntPtr)(Effect.ResourceLinker.UAVCounts + slotLinkSet.Links[0].GlobalIndex); + } + } + else + { + slotLinksPerType->Pointer = (IntPtr)((byte*)pipeline.PointersBuffer + currentPointerIndex * Utilities.SizeOf()); + + // Special case for UAV initial counters + if (isUAV) + { + slotLinksPerType->UavInitialCount = (IntPtr)((byte*)pipeline.UAVBuffer + currentPointerIndex * Utilities.SizeOf()); + } + + foreach (SlotLink localLink in slotLinkSet.Links) + { + var slotLink = localLink; + + // Make slotIndex absolute + slotLink.SlotIndex = slotLink.SlotIndex + currentPointerIndex; + *slotLinks++ = slotLink; + pipeline.CopySlotLinks.Count++; + } + + currentPointerIndex += slotLinkSet.SlotCount; + } + + slotLinksPerType++; + } + } + } + } + + private void PrintLinks(ref StageBlock stageBlock) + { + DebugLog.WriteLine(" |- Stage [{0}]", stageBlock.Shader.GetType().Name); + for (int resourceTypeIndex = 0; resourceTypeIndex < stageBlock.Slots.Length; resourceTypeIndex++) + { + var resourceType = (EffectResourceType)resourceTypeIndex; + var slotRangePerResourceType = stageBlock.Slots[resourceTypeIndex]; + if (slotRangePerResourceType == null) + { + continue; + } + + DebugLog.WriteLine(" |- ResourceType [{0}]", resourceType); + foreach (var slotLinkSet in slotRangePerResourceType) + { + DebugLog.WriteLine(" |- SlotRange Slot [{0}] Count [{1}] (IsDirect: {2})", slotLinkSet.SlotIndex, slotLinkSet.SlotCount, slotLinkSet.IsDirectSlot); + foreach (var slotLink in slotLinkSet.Links) + { + DebugLog.WriteLine(" |- Resource [{0}] Index [{1}] Count[{2}]", slotLink.GlobalIndex, slotLink.SlotIndex, slotLink.SlotCount); + } + } + } + } + + private bool CompareResourceParameter(EffectData.ResourceParameter left, EffectData.ResourceParameter right) + { + return (left.Class != right.Class || left.Type != right.Type || left.Count != right.Count); + } + + private PropertyCollection PrepareProperties(Logger logger, CommonData.PropertyCollection properties) + { + var passProperties = new PropertyCollection(); + + foreach (var property in properties) + { + switch (property.Key) + { + case EffectData.PropertyKeys.Blending: + BlendState = graphicsDevice.BlendStates[(string)property.Value]; + if (BlendState == null) + logger.Error("Unable to find registered BlendState [{0}]", (string)property.Value); + break; + case EffectData.PropertyKeys.BlendingColor: + BlendStateColor = (Color4)(Vector4)property.Value; + break; + case EffectData.PropertyKeys.BlendingSampleMask: + BlendStateSampleMask = (uint)property.Value; + break; + + case EffectData.PropertyKeys.DepthStencil: + DepthStencilState = graphicsDevice.DepthStencilStates[(string)property.Value]; + if (DepthStencilState == null) + logger.Error("Unable to find registered DepthStencilState [{0}]", (string)property.Value); + break; + case EffectData.PropertyKeys.DepthStencilReference: + DepthStencilReference = (int)property.Value; + break; + + case EffectData.PropertyKeys.Rasterizer: + RasterizerState = graphicsDevice.RasterizerStates[(string)property.Value]; + if (RasterizerState == null) + logger.Error("Unable to find registered RasterizerState [{0}]", (string)property.Value); + break; + default: + passProperties[new PropertyKey(property.Key)] = property.Value; + break; + } + } + + return passProperties; + } + + + private readonly Dictionary LocalInputLayoutCache = new Dictionary(); + + internal InputLayout GetInputLayout(VertexInputLayout layout) + { + if (layout == null) + return null; + + if (!ReferenceEquals(currentInputLayoutPair.VertexInputLayout, layout)) + { + // Use a local cache to speed up retrieval + if (!LocalInputLayoutCache.TryGetValue(layout, out currentInputLayoutPair)) + { + inputSignatureManager.GetOrCreate(layout, out currentInputLayoutPair); + LocalInputLayoutCache.Add(layout, currentInputLayoutPair); + } + } + return currentInputLayoutPair.InputLayout; + } + + #region Nested type: PipelineBlock + + private struct PipelineBlock + { + public IntPtr GlobalSlotPointer; + + public OutputMergerStage OutputMergerStage; + public unsafe IntPtr* PointersBuffer; + public unsafe int* UAVBuffer; + public RawSlotLinkSet CopySlotLinks; + public StageBlock[] Stages; + } + + private struct ParameterBinding + { + public ParameterBinding(EffectParameter parameter, int slot) + { + Parameter = parameter; + Slot = slot; + } + + public readonly EffectParameter Parameter; + + public readonly int Slot; + } + + #endregion + + #region Nested type: RawSlotLinkSet + + private struct RawSlotLinkSet + { + /// + /// Number of SlotLinks. + /// + public int Count; + + /// + /// SlotLink* ptr; + /// + public unsafe SlotLink* Links; + } + + #endregion + + #region Nested type: SlotLink + + // The CLR seems to have a bug when using an explicit layout and adding this object + // to a list. The object is not correctly copied! + [StructLayout(LayoutKind.Sequential)] + private struct SlotLink + { + public SlotLink(int globalIndex, int slotIndex, int slotCount) + { + Pointer = new IntPtr(globalIndex); + SlotIndex = slotIndex; + SlotCount = slotCount; + UavInitialCount = IntPtr.Zero; + } + + public IntPtr Pointer; + + public int SlotIndex; + + public int SlotCount; + + public IntPtr UavInitialCount; + + public int GlobalIndex + { + get + { + return Pointer.ToInt32(); + } + } + } + + #endregion + + #region Nested type: SlotLinkSet + + private class SlotLinkSet + { + public List Links; + public short SlotCount; + public int SlotIndex; + + public SlotLinkSet() + { + Links = new List(); + } + + public bool IsDirectSlot + { + get { return Links.Count == 1; } + } + } + + #endregion + + #region Nested type: StageBlock + + private class StageBlock + { + public List Parameters; + + public RawSlotLinkSet ConstantBufferSlotLinks; + public ConstantBufferLink[] ConstantBufferLinks; + public int Index; + public RawSlotLinkSet SamplerStateSlotLinks; + + public DeviceChild Shader; + + public RawSlotLinkSet ShaderResourceViewSlotLinks; + + public CommonShaderStage ShaderStage; + public List[] Slots; + public EffectShaderType Type; + public RawSlotLinkSet UnorderedAccessViewSlotLinks; + + public StreamOutputElement[] StreamOutputElements; + + public int StreamOutputRasterizedStream; + + public StageBlock(EffectShaderType type) + { + Type = type; + } + } + + private struct ConstantBufferLink + { + public ConstantBufferLink(EffectConstantBuffer constantBuffer, EffectParameter parameter) + { + ConstantBuffer = constantBuffer; + Parameter = parameter; + ResourceIndex = 0; + } + + public readonly EffectConstantBuffer ConstantBuffer; + + public readonly EffectParameter Parameter; + + public int ResourceIndex; + } + + #endregion + } } \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/GraphicsDevice.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/GraphicsDevice.cs index 37960342..2af54d7b 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/GraphicsDevice.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/GraphicsDevice.cs @@ -1,1549 +1,1556 @@ -// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using SharpDX.Direct3D; -using SharpDX.Direct3D11; -using System; -using System.Collections.Generic; -using SharpDX.Mathematics; -using SharpDX.Toolkit.Collections; -using Device = SharpDX.Direct3D11.Device; - -namespace SharpDX.Toolkit.Graphics -{ - /// - /// This class is a front end to and . - /// - public class GraphicsDevice : Component - { - private readonly Dictionary sharedDataPerDevice; - private readonly Dictionary sharedDataPerDeviceContext = new Dictionary(); - internal Device Device; - internal DeviceContext Context; - internal CommonShaderStage[] ShaderStages; - private readonly ViewportF[] viewports = new ViewportF[16]; - internal IntPtr ResetSlotsPointers { get; private set; } - private int maxSlotCountForVertexBuffer; - - private const int SimultaneousRenderTargetCount = OutputMergerStage.SimultaneousRenderTargetCount; - private readonly RenderTargetView[] currentRenderTargetViews = new RenderTargetView[SimultaneousRenderTargetCount]; - private RenderTargetView currentRenderTargetView; - private int actualRenderTargetViewCount; - private DepthStencilView currentDepthStencilView; - - private readonly PrimitiveQuad primitiveQuad; - - private VertexInputLayout currentVertexInputLayout; - internal EffectPass CurrentPass; - - private readonly Dictionary inputSignatureCache; - - /// - /// Gets the features supported by this . - /// - public readonly GraphicsDeviceFeatures Features; - - /// - /// Default effect pool shared between all deferred GraphicsDevice instances. - /// - public readonly EffectPool DefaultEffectPool; - - /// - /// Gets the for immediate rendering. - /// - public readonly GraphicsDevice MainDevice; - - /// - /// Gets whether this is running in debug. - /// - public readonly bool IsDebugMode; - - /// - /// Gets whether this is a deferred context. - /// - public readonly bool IsDeferred; - - /// - /// Gets the registered for this graphics device. - /// - public readonly BlendStateCollection BlendStates; - - /// - /// Gets the registered for this graphics device. - /// - public readonly DepthStencilStateCollection DepthStencilStates; - - /// - /// Gets the registered for this graphics device. - /// - public readonly SamplerStateCollection SamplerStates; - - /// - /// Gets the registered for this graphics device. - /// - public readonly RasterizerStateCollection RasterizerStates; - - internal InputAssemblerStage InputAssemblerStage; - internal VertexShaderStage VertexShaderStage; - internal DomainShaderStage DomainShaderStage; - internal HullShaderStage HullShaderStage; - internal GeometryShaderStage GeometryShaderStage; - internal RasterizerStage RasterizerStage; - internal PixelShaderStage PixelShaderStage; - internal OutputMergerStage OutputMergerStage; - internal ComputeShaderStage ComputeShaderStage; - - internal readonly bool needWorkAroundForUpdateSubResource; - - protected GraphicsDevice(DriverType type, DeviceCreationFlags flags = DeviceCreationFlags.None, params FeatureLevel[] featureLevels) - : this((featureLevels != null && featureLevels.Length > 0) ? new Device(type, flags, featureLevels) : new Device(type, flags)) - { - } - - protected GraphicsDevice(GraphicsAdapter adapter, DeviceCreationFlags flags = DeviceCreationFlags.None, params FeatureLevel[] featureLevels) - : this((featureLevels != null && featureLevels.Length > 0) ? new Device(adapter, flags, featureLevels) : new Device(adapter, flags), adapter) - { - } - - protected GraphicsDevice(SharpDX.Direct3D11.Device existingDevice, GraphicsAdapter adapter = null) - { - Device = ToDispose(existingDevice); - Adapter = adapter; - - // If the adapter is null, then try to locate back the adapter - if (adapter == null) - { - try - { - using (var dxgiDevice = Device.QueryInterface()) - { - using (var dxgiAdapter = dxgiDevice.Adapter) - { - var deviceId = dxgiAdapter.Description.DeviceId; - - foreach (var graphicsAdapter in GraphicsAdapter.Adapters) - { - if (deviceId == graphicsAdapter.Description.DeviceId) - { - Adapter = graphicsAdapter; - break; - } - } - } - } - } - catch (Exception ex) - { - } - } - - EffectPools = new ObservableCollection(); - - IsDebugMode = (Device.CreationFlags & DeviceCreationFlags.Debug) != 0; - MainDevice = this; - Context = Device.ImmediateContext; - IsDeferred = false; - Features = new GraphicsDeviceFeatures(Device); - AutoViewportFromRenderTargets = true; // By default - - // Global cache for all input signatures inside a GraphicsDevice. - inputSignatureCache = new Dictionary(); - sharedDataPerDevice = new Dictionary(); - - // Create default Effect pool - DefaultEffectPool = EffectPool.New(this, "Default"); - - // Create all default states - BlendStates = ToDispose(new BlendStateCollection(this)); - DepthStencilStates = ToDispose(new DepthStencilStateCollection(this)); - SamplerStates = ToDispose(new SamplerStateCollection(this)); - RasterizerStates = ToDispose(new RasterizerStateCollection(this)); - - Initialize(); - - // Create Internal Effect - primitiveQuad = ToDispose(new PrimitiveQuad(this)); - } - - protected GraphicsDevice(GraphicsDevice mainDevice, DeviceContext deferredContext) - { - Device = mainDevice.Device; - Adapter = mainDevice.Adapter; - IsDebugMode = (Device.CreationFlags & DeviceCreationFlags.Debug) != 0; - MainDevice = mainDevice; - Context = deferredContext; - IsDeferred = true; - Features = mainDevice.Features; - - // Create default Effect pool - EffectPools = mainDevice.EffectPools; - DefaultEffectPool = mainDevice.DefaultEffectPool; - - // Copy the Global cache for all input signatures inside a GraphicsDevice. - inputSignatureCache = mainDevice.inputSignatureCache; - sharedDataPerDevice = mainDevice.sharedDataPerDevice; - - // Copy the reset vertex buffer - ResetSlotsPointers = mainDevice.ResetSlotsPointers; - - // Create all default states - BlendStates = mainDevice.BlendStates; - DepthStencilStates = mainDevice.DepthStencilStates; - SamplerStates = mainDevice.SamplerStates; - RasterizerStates = mainDevice.RasterizerStates; - - // Setup the workaround flag - needWorkAroundForUpdateSubResource = IsDeferred && !Features.HasDriverCommandLists; - Initialize(); - - // Create Internal Effect - primitiveQuad = ToDispose(new PrimitiveQuad(this)); - } - - /// - /// Initializes this instance. - /// - private void Initialize() - { - // Default null VertexBuffers used to reset - if (ResetSlotsPointers == IntPtr.Zero) - { - // CommonShaderStage.InputResourceSlotCount is the maximum of resources bindable in the whole pipeline - ResetSlotsPointers = ToDispose(Utilities.AllocateClearedMemory(Utilities.SizeOf() * CommonShaderStage.InputResourceSlotCount)); - } - - InputAssemblerStage = Context.InputAssembler; - VertexShaderStage = Context.VertexShader; - DomainShaderStage = Context.DomainShader; - HullShaderStage = Context.HullShader; - GeometryShaderStage = Context.GeometryShader; - RasterizerStage = Context.Rasterizer; - PixelShaderStage = Context.PixelShader; - OutputMergerStage = Context.OutputMerger; - ComputeShaderStage = Context.ComputeShader; - - // Precompute shader stages - ShaderStages = new CommonShaderStage[] - { - Context.VertexShader, - Context.HullShader, - Context.DomainShader, - Context.GeometryShader, - Context.PixelShader, - Context.ComputeShader - }; - - Performance = new GraphicsPerformance(this); - } - - /// - /// Check if a feature level is supported by a primary adapter. - /// - /// The feature level. - /// true if the primary adapter is supporting this feature level; otherwise, false. - public static bool IsProfileSupported(FeatureLevel featureLevel) - { - return SharpDX.Direct3D11.Device.IsSupportedFeatureLevel(featureLevel); - } - - /// - /// Gets the adapter associated with this device. - /// - public readonly GraphicsAdapter Adapter; - - /// - /// Gets the effect pools. - /// - /// The effect pools. - public ObservableCollection EffectPools { get; private set; } - - /// - /// Gets the back buffer sets by the current setup on this device. - /// - /// The back buffer. The returned value may be null if no are setup on this device. - public RenderTarget2D BackBuffer - { - get { return Presenter != null ? Presenter.BackBuffer : null; } - } - - /// - /// Gets the depth stencil buffer sets by the current setup on this device. - /// - /// The depth stencil buffer. The returned value may be null if no are setup on this device or no depth buffer was allocated. - public DepthStencilBuffer DepthStencilBuffer - { - get { return Presenter != null ? Presenter.DepthStencilBuffer : null; } - } - - /// - /// Gets or sets the current presenter use by the method. - /// - /// The current presenter. - public GraphicsPresenter Presenter { get; set; } - - /// - /// Gets or sets a value indicating whether the viewport is automatically calculated and set when a render target is set. Default is true. - /// - /// true if the viewport is automatically calculated and set when a render target is set; otherwise, false. - public bool AutoViewportFromRenderTargets { get; set; } - - /// - /// Gets the status of this device. - /// - /// ff476526 - /// GetDeviceRemovedReason - /// GetDeviceRemovedReason - /// HRESULT ID3D11Device::GetDeviceRemovedReason() - public GraphicsDeviceStatus GraphicsDeviceStatus - { - get - { - var result = ((Device)MainDevice).DeviceRemovedReason; - if (result == DXGI.ResultCode.DeviceRemoved) - { - return GraphicsDeviceStatus.Removed; - } - - if (result == DXGI.ResultCode.DeviceReset) - { - return GraphicsDeviceStatus.Reset; - } - - if (result == DXGI.ResultCode.DeviceHung) - { - return GraphicsDeviceStatus.Hung; - } - - if (result == DXGI.ResultCode.DriverInternalError) - { - return GraphicsDeviceStatus.InternalError; - } - - if (result == DXGI.ResultCode.InvalidCall) - { - return GraphicsDeviceStatus.InvalidCall; - } - - if (result.Code < 0) - { - return GraphicsDeviceStatus.Reset; - } - - return GraphicsDeviceStatus.Normal; - } - } - - /// - /// Gets the access to performance profiler. - /// - /// The access to performance profiler. - public GraphicsPerformance Performance { get; private set; } - - /// - /// Gets the default quad primitive to issue draw commands. - /// - /// The default quad primitive to issue draw commands. - public PrimitiveQuad Quad - { - get - { - return primitiveQuad; - } - } - - /// - /// Clears the default render target and depth stencil buffer attached to the current . - /// - /// Set this color value in all buffers. - /// Cannot clear without a Presenter set on this instance - public void Clear(Color4 color) - { - var options = currentRenderTargetView != null ? ClearOptions.Target : (ClearOptions)0; - - if (currentDepthStencilView != null) - { - var textureView = currentDepthStencilView.Tag as TextureView; - DepthStencilBuffer depthStencilBuffer; - - if (textureView == null || (depthStencilBuffer = textureView.Texture as DepthStencilBuffer) == null) - { - throw new InvalidOperationException("Clear on a custom DepthStencilView is not supported by this method. Use Clear(DepthStencilView) directly"); - } - - options |= depthStencilBuffer.HasStencil ? ClearOptions.DepthBuffer | ClearOptions.Stencil : ClearOptions.DepthBuffer; - - } - - Clear(options, color, 1f, 0); - } - - /// - /// Clears the default render target and depth stencil buffer attached to the current . - /// - /// Options for clearing a buffer. - /// Set this four-component color value in the buffer. - /// Set this depth value in the buffer. - /// Set this stencil value in the buffer. - public void Clear(ClearOptions options, Color4 color, float depth, int stencil) - { - if ((options & ClearOptions.Target) != 0) - { - if (currentRenderTargetView == null) - { - throw new InvalidOperationException("No default render target view setup. Call SetRenderTargets before calling this method."); - } - Clear(currentRenderTargetView, color); - } - - if ((options & (ClearOptions.Stencil | ClearOptions.DepthBuffer)) != 0) - { - if (currentDepthStencilView == null) - { - throw new InvalidOperationException("No default depth stencil view setup. Call SetRenderTargets before calling this method."); - } - - var flags = (options & ClearOptions.DepthBuffer) != 0 ? DepthStencilClearFlags.Depth : 0; - if ((options & ClearOptions.Stencil) != 0) - { - flags |= DepthStencilClearFlags.Stencil; - } - - Clear(currentDepthStencilView, flags, depth, (byte)stencil); - } - } - - /// - /// Clears the default render target and depth stencil buffer attached to the current . - /// - /// Options for clearing a buffer. - /// Set this four-component color value in the buffer. - /// Set this depth value in the buffer. - /// Set this stencil value in the buffer. - public void Clear(ClearOptions options, Vector4 color, float depth, int stencil) - { - Clear(options, (Color4)color, depth, stencil); - } - - /// - /// Clears a render target view by setting all the elements in a render target to one value. - /// - /// The render target view. - /// A 4-component array that represents the color to fill the render target with. - ///

Applications that wish to clear a render target to a specific integer value bit pattern should render a screen-aligned quad instead of using this method. The reason for this is because this method accepts as input a floating point value, which may not have the same bit pattern as the original integer.

Differences between Direct3D 9 and Direct3D 11/10:

Unlike Direct3D 9, the full extent of the resource view is always cleared. Viewport and scissor settings are not applied.

?

- /// ff476388 - /// void ID3D11DeviceContext::ClearRenderTargetView([In] ID3D11RenderTargetView* pRenderTargetView,[In] const SHARPDX_COLOR4* ColorRGBA) - /// ID3D11DeviceContext::ClearRenderTargetView - public void Clear(SharpDX.Direct3D11.RenderTargetView renderTargetView, Color4 colorRGBA) - { - Context.ClearRenderTargetView(renderTargetView, colorRGBA); - } - - /// - /// Clears the depth-stencil resource. - /// - ///

Pointer to the depth stencil to be cleared.

- ///

Identify the type of data to clear (see ).

- ///

Clear the depth buffer with this value. This value will be clamped between 0 and 1.

- ///

Clear the stencil buffer with this value.

- /// - ///

Differences between Direct3D 9 and Direct3D 11/10:

Unlike Direct3D 9, the full extent of the resource view is always cleared. Viewport and scissor settings are not applied.

?

- ///
- /// ff476387 - /// void ID3D11DeviceContext::ClearDepthStencilView([In] ID3D11DepthStencilView* pDepthStencilView,[In] D3D11_CLEAR_FLAG ClearFlags,[In] float Depth,[In] unsigned char Stencil) - /// ID3D11DeviceContext::ClearDepthStencilView - public void Clear(SharpDX.Direct3D11.DepthStencilView depthStencilView, SharpDX.Direct3D11.DepthStencilClearFlags clearFlags, float depth, byte stencil) - { - Context.ClearDepthStencilView(depthStencilView, clearFlags, depth, stencil); - } - - /// - /// Clears an unordered access resource with bit-precise values. - /// - /// The buffer to clear. - /// The value used to clear. - /// - ///

This API copies the lower ni bits from each array element i to the corresponding channel, where ni is the number of bits in the ith channel of the resource format (for example, R8G8B8_FLOAT has 8 bits for the first 3 channels). This works on any UAV with no format conversion. For a raw or structured buffer view, only the first array element value is used.

- ///
- /// ff476391 - /// void ID3D11DeviceContext::ClearUnorderedAccessViewUint([In] ID3D11UnorderedAccessView* pUnorderedAccessView,[In] const unsigned int* Values) - /// ID3D11DeviceContext::ClearUnorderedAccessViewUint - public void Clear(UnorderedAccessView view, Int4 value) - { - Context.ClearUnorderedAccessView(view, value); - } - - /// - /// Clears an unordered access resource with a float value. - /// - /// The buffer to clear. - /// The value used to clear. - /// - ///

This API works on FLOAT, UNORM, and SNORM unordered access views (UAVs), with format conversion from FLOAT to *NORM where appropriate. On other UAVs, the operation is invalid and the call will not reach the driver.

- ///
- /// ff476390 - /// void ID3D11DeviceContext::ClearUnorderedAccessViewFloat([In] ID3D11UnorderedAccessView* pUnorderedAccessView,[In] const float* Values) - /// ID3D11DeviceContext::ClearUnorderedAccessViewFloat - public void Clear(UnorderedAccessView view, Vector4 value) - { - Context.ClearUnorderedAccessView(view, value); - } - - /// - /// Copies the content of this resource to another . - /// - /// The resource to copy from. - /// The resource to copy to. - /// See the unmanaged documentation for usage and restrictions. - /// ff476392 - /// void ID3D11DeviceContext::CopyResource([In] ID3D11Resource* pDstResource,[In] ID3D11Resource* pSrcResource) - /// ID3D11DeviceContext::CopyResource - public void Copy(Direct3D11.Resource fromResource, Direct3D11.Resource toResource) - { - Context.CopyResource(fromResource, toResource); - } - - /// - /// Copy a region from a source resource to a destination resource. - /// - /// - /// The source box must be within the size of the source resource. The destination offsets, (x, y, and z) allow the source box to be offset when writing into the destination resource; however, the dimensions of the source box and the offsets must be within the size of the resource. If the resources are buffers, all coordinates are in bytes; if the resources are textures, all coordinates are in texels. {{D3D11CalcSubresource}} is a helper function for calculating subresource indexes. CopySubresourceRegion performs the copy on the GPU (similar to a memcpy by the CPU). As a consequence, the source and destination resources: Must be different subresources (although they can be from the same resource). Must be the same type. Must have compatible DXGI formats (identical or from the same type group). For example, a DXGI_FORMAT_R32G32B32_FLOAT texture can be copied to an DXGI_FORMAT_R32G32B32_UINT texture since both of these formats are in the DXGI_FORMAT_R32G32B32_TYPELESS group. May not be currently mapped. CopySubresourceRegion only supports copy; it does not support any stretch, color key, blend, or format conversions. An application that needs to copy an entire resource should use instead. CopySubresourceRegion is an asynchronous call which may be added to the command-buffer queue, this attempts to remove pipeline stalls that may occur when copying data. See performance considerations for more details. Note??If you use CopySubresourceRegion with a depth-stencil buffer or a multisampled resource, you must copy the whole subresource. In this situation, you must pass 0 to the DstX, DstY, and DstZ parameters and NULL to the pSrcBox parameter. In addition, source and destination resources, which are represented by the pSrcResource and pDstResource parameters, should have identical sample count values. Example The following code snippet copies a box (located at (120,100),(200,220)) from a source texture into a region (10,20),(90,140) in a destination texture. - /// D3D11_BOX sourceRegion; - /// sourceRegion.left = 120; - /// sourceRegion.right = 200; - /// sourceRegion.top = 100; - /// sourceRegion.bottom = 220; - /// sourceRegion.front = 0; - /// sourceRegion.back = 1; pd3dDeviceContext->CopySubresourceRegion( pDestTexture, 0, 10, 20, 0, pSourceTexture, 0, &sourceRegion ); - /// - /// Notice, that for a 2D texture, front and back are set to 0 and 1 respectively. - /// - /// A reference to the source resource (see ). - /// Source subresource index. - /// A reference to the destination resource (see ). - /// Destination subresource index. - /// The x-coordinate of the upper left corner of the destination region. - /// The y-coordinate of the upper left corner of the destination region. For a 1D subresource, this must be zero. - /// The z-coordinate of the upper left corner of the destination region. For a 1D or 2D subresource, this must be zero. - /// ff476394 - /// void ID3D11DeviceContext::CopySubresourceRegion([In] ID3D11Resource* pDstResource,[In] unsigned int DstSubresource,[In] unsigned int DstX,[In] unsigned int DstY,[In] unsigned int DstZ,[In] ID3D11Resource* pSrcResource,[In] unsigned int SrcSubresource,[In, Optional] const D3D11_BOX* pSrcBox) - /// ID3D11DeviceContext::CopySubresourceRegion - public void Copy(SharpDX.Direct3D11.Resource source, int sourceSubresource, SharpDX.Direct3D11.Resource destination, int destinationSubResource, int dstX = 0, int dstY = 0, int dstZ = 0) - { - Context.CopySubresourceRegion(source, sourceSubresource, null, destination, destinationSubResource, dstX, dstY, dstZ); - } - - /// - /// Copy a region from a source resource to a destination resource. - /// - /// - /// The source box must be within the size of the source resource. The destination offsets, (x, y, and z) allow the source box to be offset when writing into the destination resource; however, the dimensions of the source box and the offsets must be within the size of the resource. If the resources are buffers, all coordinates are in bytes; if the resources are textures, all coordinates are in texels. {{D3D11CalcSubresource}} is a helper function for calculating subresource indexes. CopySubresourceRegion performs the copy on the GPU (similar to a memcpy by the CPU). As a consequence, the source and destination resources: Must be different subresources (although they can be from the same resource). Must be the same type. Must have compatible DXGI formats (identical or from the same type group). For example, a DXGI_FORMAT_R32G32B32_FLOAT texture can be copied to an DXGI_FORMAT_R32G32B32_UINT texture since both of these formats are in the DXGI_FORMAT_R32G32B32_TYPELESS group. May not be currently mapped. CopySubresourceRegion only supports copy; it does not support any stretch, color key, blend, or format conversions. An application that needs to copy an entire resource should use instead. CopySubresourceRegion is an asynchronous call which may be added to the command-buffer queue, this attempts to remove pipeline stalls that may occur when copying data. See performance considerations for more details. Note??If you use CopySubresourceRegion with a depth-stencil buffer or a multisampled resource, you must copy the whole subresource. In this situation, you must pass 0 to the DstX, DstY, and DstZ parameters and NULL to the pSrcBox parameter. In addition, source and destination resources, which are represented by the pSrcResource and pDstResource parameters, should have identical sample count values. Example The following code snippet copies a box (located at (120,100),(200,220)) from a source texture into a region (10,20),(90,140) in a destination texture. - /// D3D11_BOX sourceRegion; - /// sourceRegion.left = 120; - /// sourceRegion.right = 200; - /// sourceRegion.top = 100; - /// sourceRegion.bottom = 220; - /// sourceRegion.front = 0; - /// sourceRegion.back = 1; pd3dDeviceContext->CopySubresourceRegion( pDestTexture, 0, 10, 20, 0, pSourceTexture, 0, &sourceRegion ); - /// - /// Notice, that for a 2D texture, front and back are set to 0 and 1 respectively. - /// - /// A reference to the source resource (see ). - /// Source subresource index. - /// A reference to a 3D box (see ) that defines the source subresources that can be copied. If NULL, the entire source subresource is copied. The box must fit within the source resource. - /// A reference to the destination resource (see ). - /// Destination subresource index. - /// The x-coordinate of the upper left corner of the destination region. - /// The y-coordinate of the upper left corner of the destination region. For a 1D subresource, this must be zero. - /// The z-coordinate of the upper left corner of the destination region. For a 1D or 2D subresource, this must be zero. - /// ff476394 - /// void ID3D11DeviceContext::CopySubresourceRegion([In] ID3D11Resource* pDstResource,[In] unsigned int DstSubresource,[In] unsigned int DstX,[In] unsigned int DstY,[In] unsigned int DstZ,[In] ID3D11Resource* pSrcResource,[In] unsigned int SrcSubresource,[In, Optional] const D3D11_BOX* pSrcBox) - /// ID3D11DeviceContext::CopySubresourceRegion - public void Copy(SharpDX.Direct3D11.Resource source, int sourceSubresource, SharpDX.Direct3D11.ResourceRegion sourceRegion, SharpDX.Direct3D11.Resource destination, int destinationSubResource, int dstX = 0, int dstY = 0, int dstZ = 0) - { - Context.CopySubresourceRegion(source, sourceSubresource, sourceRegion, destination, destinationSubResource, dstX, dstY, dstZ); - } - - /// - /// Copy a multisampled resource into a non-multisampled resource. - /// - /// - /// This API is most useful when re-using the resulting render target of one render pass as an input to a second render pass. The source and destination resources must be the same resource type and have the same dimensions. In addition, they must have compatible formats. There are three scenarios for this: ScenarioRequirements Source and destination are prestructured and typedBoth the source and destination must have identical formats and that format must be specified in the Format parameter. One resource is prestructured and typed and the other is prestructured and typelessThe typed resource must have a format that is compatible with the typeless resource (i.e. the typed resource is DXGI_FORMAT_R32_FLOAT and the typeless resource is DXGI_FORMAT_R32_TYPELESS). The format of the typed resource must be specified in the Format parameter. Source and destination are prestructured and typelessBoth the source and destination must have the same typeless format (i.e. both must have DXGI_FORMAT_R32_TYPELESS), and the Format parameter must specify a format that is compatible with the source and destination (i.e. if both are DXGI_FORMAT_R32_TYPELESS then DXGI_FORMAT_R32_FLOAT could be specified in the Format parameter). For example, given the DXGI_FORMAT_R16G16B16A16_TYPELESS format: The source (or dest) format could be DXGI_FORMAT_R16G16B16A16_UNORM The dest (or source) format could be DXGI_FORMAT_R16G16B16A16_FLOAT ? - /// - /// Source resource. Must be multisampled. - /// >The source subresource of the source resource. - /// Destination resource. Must be a created with the flag and be single-sampled. See . - /// A zero-based index, that identifies the destination subresource. Use {{D3D11CalcSubresource}} to calculate the index. - /// A that indicates how the multisampled resource will be resolved to a single-sampled resource. See remarks. - /// void ID3D11DeviceContext::ResolveSubresource([In] ID3D11Resource* pDstResource,[In] int DstSubresource,[In] ID3D11Resource* pSrcResource,[In] int SrcSubresource,[In] DXGI_FORMAT Format) - public void Copy(SharpDX.Direct3D11.Resource source, int sourceSubresource, SharpDX.Direct3D11.Resource destination, int destinationSubresource, SharpDX.DXGI.Format format) - { - Context.ResolveSubresource(source, sourceSubresource, destination, destinationSubresource, format); - } - - /// - ///

Copies data from a buffer holding variable length data.

- ///
- ///

Pointer to an of a Structured Buffer resource created with either or specified when the UAV was created. These types of resources have hidden counters tracking "how many" records have been written.

- ///

Pointer to . This can be any buffer resource that other copy commands, such as or , are able to write to.

- ///

Offset from the start of pDstBuffer to write 32-bit UINT structure (vertex) count from pSrcView.

- /// ff476393 - /// void ID3D11DeviceContext::CopyStructureCount([In] ID3D11Buffer* pDstBuffer,[In] unsigned int DstAlignedByteOffset,[In] ID3D11UnorderedAccessView* pSrcView) - /// ID3D11DeviceContext::CopyStructureCount - public void CopyCount(SharpDX.Direct3D11.UnorderedAccessView sourceView, SharpDX.Direct3D11.Buffer destinationBuffer, int offsetInBytes = 0) - { - Context.CopyStructureCount(destinationBuffer, offsetInBytes, sourceView); - } - - /// - ///

Restore all default settings.

- ///
- /// - ///

This method resets any device context to the default settings. This sets all input/output resource slots, shaders, input layouts, predications, scissor rectangles, depth-stencil state, rasterizer state, blend state, sampler state, and viewports to null. The primitive topology is set to UNDEFINED.

For a scenario where you would like to clear a list of commands recorded so far, call and throw away the resulting .

- ///
- /// ff476389 - /// void ID3D11DeviceContext::ClearState() - /// ID3D11DeviceContext::ClearState - public void ClearState() - { - Context.ClearState(); - } - - private PrimitiveTopology PrimitiveType - { - set - { - InputAssemblerStage.PrimitiveTopology = value; - } - } - - /// - ///

Draw indexed, non-instanced primitives.

- ///
- /// Type of the primitive to draw. - ///

Number of indices to draw.

- ///

The location of the first index read by the GPU from the index buffer.

- ///

A value added to each index before reading a vertex from the vertex buffer.

- /// - ///

A draw API submits work to the rendering pipeline.

If the sum of both indices is negative, the result of the function call is undefined.

- ///
- /// ff476409 - /// void ID3D11DeviceContext::DrawIndexed([In] unsigned int IndexCount,[In] unsigned int StartIndexLocation,[In] int BaseVertexLocation) - /// ID3D11DeviceContext::DrawIndexed - public void DrawIndexed(PrimitiveType primitiveType, int indexCount, int startIndexLocation = 0, int baseVertexLocation = 0) - { - SetupInputLayout(); - - PrimitiveType = primitiveType; - Context.DrawIndexed(indexCount, startIndexLocation, baseVertexLocation); - } - - /// - ///

Draw non-indexed, non-instanced primitives.

- ///
- /// Type of the primitive to draw. - ///

Number of vertices to draw.

- ///

Index of the first vertex, which is usually an offset in a vertex buffer; it could also be used as the first vertex id generated for a shader parameter marked with the SV_TargetId system-value semantic.

- /// - ///

A draw API submits work to the rendering pipeline.

The vertex data for a draw call normally comes from a vertex buffer that is bound to the pipeline. However, you could also provide the vertex data from a shader that has vertex data marked with the SV_VertexId system-value semantic.

- ///
- /// ff476407 - /// void ID3D11DeviceContext::Draw([In] unsigned int VertexCount,[In] unsigned int StartVertexLocation) - /// ID3D11DeviceContext::Draw - public void Draw(PrimitiveType primitiveType, int vertexCount, int startVertexLocation = 0) - { - SetupInputLayout(); - - PrimitiveType = primitiveType; - Context.Draw(vertexCount, startVertexLocation); - } - - /// - ///

Draw indexed, instanced primitives.

- ///
- /// Type of the primitive to draw. - ///

Number of indices read from the index buffer for each instance.

- ///

Number of instances to draw.

- ///

The location of the first index read by the GPU from the index buffer.

- ///

A value added to each index before reading a vertex from the vertex buffer.

- ///

A value added to each index before reading per-instance data from a vertex buffer.

- /// - ///

A draw API submits work to the rendering pipeline.

Instancing may extend performance by reusing the same geometry to draw multiple objects in a scene. One example of instancing could be to draw the same object with different positions and colors. Indexing requires multiple vertex buffers: at least one for per-vertex data and a second buffer for per-instance data.

- ///
- /// ff476410 - /// void ID3D11DeviceContext::DrawIndexedInstanced([In] unsigned int IndexCountPerInstance,[In] unsigned int InstanceCount,[In] unsigned int StartIndexLocation,[In] int BaseVertexLocation,[In] unsigned int StartInstanceLocation) - /// ID3D11DeviceContext::DrawIndexedInstanced - public void DrawIndexedInstanced(PrimitiveType primitiveType, int indexCountPerInstance, int instanceCount, int startIndexLocation = 0, int baseVertexLocation = 0, int startInstanceLocation = 0) - { - SetupInputLayout(); - - PrimitiveType = primitiveType; - Context.DrawIndexedInstanced(indexCountPerInstance, instanceCount, startIndexLocation, baseVertexLocation, startInstanceLocation); - } - - /// - ///

Draw non-indexed, instanced primitives.

- ///
- /// Type of the primitive to draw. - ///

Number of vertices to draw.

- ///

Number of instances to draw.

- ///

Index of the first vertex.

- ///

A value added to each index before reading per-instance data from a vertex buffer.

- /// - ///

A draw API submits work to the rendering pipeline.

Instancing may extend performance by reusing the same geometry to draw multiple objects in a scene. One example of instancing could be to draw the same object with different positions and colors.

The vertex data for an instanced draw call normally comes from a vertex buffer that is bound to the pipeline. However, you could also provide the vertex data from a shader that has instanced data identified with a system-value semantic (SV_InstanceID).

- ///
- /// ff476412 - /// void ID3D11DeviceContext::DrawInstanced([In] unsigned int VertexCountPerInstance,[In] unsigned int InstanceCount,[In] unsigned int StartVertexLocation,[In] unsigned int StartInstanceLocation) - /// ID3D11DeviceContext::DrawInstanced - public void DrawInstanced(PrimitiveType primitiveType, int vertexCountPerInstance, int instanceCount, int startVertexLocation = 0, int startInstanceLocation = 0) - { - SetupInputLayout(); - - PrimitiveType = primitiveType; - Context.DrawInstanced(vertexCountPerInstance, instanceCount, startVertexLocation, startInstanceLocation); - } - - /// - ///

Draw geometry of an unknown size.

- ///
- /// Type of the primitive to draw. - /// - ///

A draw API submits work to the rendering pipeline. This API submits work of an unknown size that was processed by the input assembler, vertex shader, and stream-output stages; the work may or may not have gone through the geometry-shader stage.

After data has been streamed out to stream-output stage buffers, those buffers can be again bound to the Input Assembler stage at input slot 0 and DrawAuto will draw them without the application needing to know the amount of data that was written to the buffers. A measurement of the amount of data written to the SO stage buffers is maintained internally when the data is streamed out. This means that the CPU does not need to fetch the measurement before re-binding the data that was streamed as input data. Although this amount is tracked internally, it is still the responsibility of applications to use input layouts to describe the format of the data in the SO stage buffers so that the layouts are available when the buffers are again bound to the input assembler.

The following diagram shows the DrawAuto process.

Calling DrawAuto does not change the state of the streaming-output buffers that were bound again as inputs.

DrawAuto only works when drawing with one input buffer bound as an input to the IA stage at slot 0. Applications must create the SO buffer resource with both binding flags, and .

This API does not support indexing or instancing.

If an application needs to retrieve the size of the streaming-output buffer, it can query for statistics on streaming output by using .

- ///
- /// ff476408 - /// void ID3D11DeviceContext::DrawAuto() - /// ID3D11DeviceContext::DrawAuto - public void DrawAuto(PrimitiveType primitiveType) - { - SetupInputLayout(); - - PrimitiveType = primitiveType; - Context.DrawAuto(); - } - - /// - ///

Draw indexed, instanced, GPU-generated primitives.

- ///
- /// Type of the primitive to draw. - ///

A reference to an , which is a buffer containing the GPU generated primitives.

- ///

Offset in pBufferForArgs to the start of the GPU generated primitives.

- /// - ///

When an application creates a buffer that is associated with the interface that pBufferForArgs points to, the application must set the flag in the MiscFlags member of the structure that describes the buffer. To create the buffer, the application calls the method and in this call passes a reference to in the pDesc parameter.

- ///
- /// ff476411 - /// void ID3D11DeviceContext::DrawIndexedInstancedIndirect([In] ID3D11Buffer* pBufferForArgs,[In] unsigned int AlignedByteOffsetForArgs) - /// ID3D11DeviceContext::DrawIndexedInstancedIndirect - public void DrawIndexedInstanced(PrimitiveType primitiveType, SharpDX.Direct3D11.Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0) - { - SetupInputLayout(); - - PrimitiveType = primitiveType; - Context.DrawIndexedInstancedIndirect(argumentsBuffer, alignedByteOffsetForArgs); - } - - /// - ///

Draw instanced, GPU-generated primitives.

- ///
- /// Type of the primitive to draw. - ///

A reference to an , which is a buffer containing the GPU generated primitives.

- ///

Offset in pBufferForArgs to the start of the GPU generated primitives.

- /// - ///

When an application creates a buffer that is associated with the interface that pBufferForArgs points to, the application must set the flag in the MiscFlags member of the structure that describes the buffer. To create the buffer, the application calls the method and in this call passes a reference to in the pDesc parameter.

- ///
- /// ff476413 - /// void ID3D11DeviceContext::DrawInstancedIndirect([In] ID3D11Buffer* pBufferForArgs,[In] unsigned int AlignedByteOffsetForArgs) - /// ID3D11DeviceContext::DrawInstancedIndirect - public void DrawInstanced(PrimitiveType primitiveType, SharpDX.Direct3D11.Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0) - { - SetupInputLayout(); - - PrimitiveType = primitiveType; - Context.DrawInstancedIndirect(argumentsBuffer, alignedByteOffsetForArgs); - } - - /// - ///

Execute a command list from a thread group.

- ///
- ///

The number of groups dispatched in the x direction. ThreadGroupCountX must be less than (65535).

- ///

The number of groups dispatched in the y direction. ThreadGroupCountY must be less than (65535).

- ///

The number of groups dispatched in the z direction. ThreadGroupCountZ must be less than (65535). In feature level 10 the value for ThreadGroupCountZ must be 1.

- /// - ///

You call the Dispatch method to execute commands in a compute shader. A compute shader can be run on many threads in parallel, within a thread group. Index a particular thread, within a thread group using a 3D vector given by (x,y,z).

In the following illustration, assume a thread group with 50 threads where the size of the group is given by (5,5,2). A single thread is identified from a thread group with 50 threads in it, using the vector (4,1,1).

The following illustration shows the relationship between the parameters passed to , Dispatch(5,3,2), the values specified in the numthreads attribute, numthreads(10,8,3), and values that will passed to the compute shader for the thread-related system values - /// (SV_GroupIndex,SV_DispatchThreadID,SV_GroupThreadID,SV_GroupID).

- ///
- /// ff476405 - /// void ID3D11DeviceContext::Dispatch([In] unsigned int ThreadGroupCountX,[In] unsigned int ThreadGroupCountY,[In] unsigned int ThreadGroupCountZ) - /// ID3D11DeviceContext::Dispatch - public void Dispatch(int threadGroupCountX, int threadGroupCountY, int threadGroupCountZ) - { - Context.Dispatch(threadGroupCountX, threadGroupCountY, threadGroupCountZ); - } - - /// - ///

Execute a command list over one or more thread groups.

- ///
- ///

A reference to an , which must be loaded with data that matches the argument list for .

- ///

A byte-aligned offset between the start of the buffer and the arguments.

- /// - ///

You call the DispatchIndirect method to execute commands in a compute shader.

When an application creates a buffer that is associated with the interface that pBufferForArgs points to, the application must set the flag in the MiscFlags member of the structure that describes the buffer. To create the buffer, the application calls the method and in this call passes a reference to in the pDesc parameter.

- ///
- /// ff476406 - /// void ID3D11DeviceContext::DispatchIndirect([In] ID3D11Buffer* pBufferForArgs,[In] unsigned int AlignedByteOffsetForArgs) - /// ID3D11DeviceContext::DispatchIndirect - public void Dispatch(SharpDX.Direct3D11.Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0) - { - Context.DispatchIndirect(argumentsBuffer, alignedByteOffsetForArgs); - } - - /// - ///

Sends queued-up commands in the command buffer to the graphics processing unit (GPU).

- ///
- /// - ///

Most applications don't need to call this method. If an application calls this method when not necessary, it incurs a performance penalty. Each call to Flush incurs a significant amount of overhead.

When Microsoft Direct3D state-setting, present, or draw commands are called by an application, those commands are queued into an internal command buffer. Flush sends those commands to the GPU for processing. Typically, the Direct3D runtime sends these commands to the GPU automatically whenever the runtime determines that they need to be sent, such as when the command buffer is full or when an application maps a resource. Flush sends the commands manually.

We recommend that you use Flush when the CPU waits for an arbitrary amount of time (such as when you call the Sleep function).

Because Flush operates asynchronously, it can return either before or after the GPU finishes executing the queued graphics commands. However, the graphics commands eventually always complete. You can call the method with the value to create an event query; you can then use that event query in a call to the method to determine when the GPU is finished processing the graphics commands. - ///

Microsoft Direct3D?11 defers the destruction of objects. Therefore, an application can't rely upon objects immediately being destroyed. By calling Flush, you destroy any objects whose destruction was deferred. If an application requires synchronous destruction of an object, we recommend that the application release all its references, call , and then call Flush.

Deferred Destruction Issues with Flip Presentation Swap Chains

Direct3D?11 defers the destruction of objects like views and resources until it can efficiently destroy them. This deferred destruction can cause problems with flip presentation model swap chains. Flip presentation model swap chains have the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL flag set. When you create a flip presentation model swap chain, you can associate only one swap chain at a time with an , IWindow, or composition surface. If an application attempts to destroy a flip presentation model swap chain and replace it with another swap chain, the original swap chain is not destroyed when the application immediately frees all of the original swap chain's references.

Most applications typically use the method for the majority of scenarios where they replace new swap chain buffers for old swap chain buffers. However, if an application must actually destroy an old swap chain and create a new swap chain, the application must force the destruction of all objects that the application freed. To force the destruction, call (or otherwise ensure no views are bound to pipeline state), and then call Flush on the immediate context. You must force destruction before you call IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForImmersiveWindow, or IDXGIFactory2::CreateSwapChainForCompositionSurface again to create a new swap chain.

- ///
- /// ff476425 - /// void ID3D11DeviceContext::Flush() - /// ID3D11DeviceContext::Flush - public void Flush() - { - Context.Flush(); - } - - /// - /// Creates a new from an existing . - /// - /// An existing device. - /// A new instance of . - public static GraphicsDevice New(SharpDX.Direct3D11.Device existingDevice) - { - return new GraphicsDevice(existingDevice); - } - - /// - /// Creates a new using . - /// - /// The flags. - /// The feature levels. - /// A new instance of - public static GraphicsDevice New(DeviceCreationFlags flags = DeviceCreationFlags.None, params FeatureLevel[] featureLevels) - { - return New(DriverType.Hardware, flags, featureLevels); - } - - /// - /// Creates a new . - /// - /// The type. - /// The flags. - /// The feature levels. - /// A new instance of . - public static GraphicsDevice New(DriverType type, DeviceCreationFlags flags = DeviceCreationFlags.None, params FeatureLevel[] featureLevels) - { - if (type == DriverType.Hardware) - return new GraphicsDevice(GraphicsAdapter.Default, flags, featureLevels); - - return new GraphicsDevice(type, flags, featureLevels); - } - - /// - /// Creates a new . - /// - /// The graphics adapter to use. - /// The flags. - /// The feature levels. - /// A new instance of . - public static GraphicsDevice New(GraphicsAdapter adapter, DeviceCreationFlags flags = DeviceCreationFlags.None, params FeatureLevel[] featureLevels) - { - return new GraphicsDevice(adapter, flags, featureLevels); - } - - /// - /// Creates a new deferred . - /// - /// A deferred . - public GraphicsDevice NewDeferred() - { - return new GraphicsDevice(this, new DeviceContext(Device)); - } - - /// - ///

Sets the blend state of the output-merger stage.

- ///
- ///

Pointer to a blend-state interface (see ). Passing in null implies a default blend state. See remarks for further details.

- /// - ///

Blend state is used by the output-merger stage to determine how to blend together two pixel values. The two values are commonly the current pixel value and the pixel value already in the output render target. Use the blend operation to control where the two pixel values come from and how they are mathematically combined.

To create a blend-state interface, call .

Passing in null for the blend-state interface indicates to the runtime to set a default blending state. The following table indicates the default blending parameters.

StateDefault Value
AlphaToCoverageEnable
BlendEnable[8]
SrcBlend
DstBlend
BlendOp
SrcBlendAlpha
DstBlendAlpha
BlendOpAlpha
RenderTargetWriteMask[8][8]

?

A sample mask determines which samples get updated in all the active render targets. The mapping of bits in a sample mask to samples in a multisample render target is the responsibility of an individual application. A sample mask is always applied; it is independent of whether multisampling is enabled, and does not depend on whether an application uses multisample render targets.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

- ///
- /// ff476462 - /// void ID3D11DeviceContext::OMSetBlendState([In, Optional] ID3D11BlendState* pBlendState,[In, Optional] const SHARPDX_COLOR4* BlendFactor,[In] unsigned int SampleMask) - /// ID3D11DeviceContext::OMSetBlendState - public void SetBlendState(BlendState blendState) - { - if (blendState == null) - { - OutputMergerStage.SetBlendState(null, Color.White, -1); - } - else - { - OutputMergerStage.SetBlendState(blendState, blendState.BlendFactor, blendState.MultiSampleMask); - } - } - - /// - ///

Sets the blend state of the output-merger stage.

- ///
- ///

Pointer to a blend-state interface (see ). Passing in null implies a default blend state. See remarks for further details.

- ///

Array of blend factors, one for each RGBA component. This requires a blend state object that specifies the option.

- ///

32-bit sample coverage. The default value is 0xffffffff. See remarks.

- /// - ///

Blend state is used by the output-merger stage to determine how to blend together two pixel values. The two values are commonly the current pixel value and the pixel value already in the output render target. Use the blend operation to control where the two pixel values come from and how they are mathematically combined.

To create a blend-state interface, call .

Passing in null for the blend-state interface indicates to the runtime to set a default blending state. The following table indicates the default blending parameters.

StateDefault Value
AlphaToCoverageEnable
BlendEnable[8]
SrcBlend
DstBlend
BlendOp
SrcBlendAlpha
DstBlendAlpha
BlendOpAlpha
RenderTargetWriteMask[8][8]

?

A sample mask determines which samples get updated in all the active render targets. The mapping of bits in a sample mask to samples in a multisample render target is the responsibility of an individual application. A sample mask is always applied; it is independent of whether multisampling is enabled, and does not depend on whether an application uses multisample render targets.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

- ///
- /// ff476462 - /// void ID3D11DeviceContext::OMSetBlendState([In, Optional] ID3D11BlendState* pBlendState,[In, Optional] const SHARPDX_COLOR4* BlendFactor,[In] unsigned int SampleMask) - /// ID3D11DeviceContext::OMSetBlendState - public void SetBlendState(BlendState blendState, Color4 blendFactor, int multiSampleMask = -1) - { - if (blendState == null) - { - OutputMergerStage.SetBlendState(null, blendFactor, multiSampleMask); - } - else - { - OutputMergerStage.SetBlendState(blendState, blendFactor, multiSampleMask); - } - } - - /// - ///

Sets the blend state of the output-merger stage.

- ///
- ///

Pointer to a blend-state interface (see ). Passing in null implies a default blend state. See remarks for further details.

- ///

Array of blend factors, one for each RGBA component. This requires a blend state object that specifies the option.

- ///

32-bit sample coverage. The default value is 0xffffffff. See remarks.

- /// - ///

Blend state is used by the output-merger stage to determine how to blend together two pixel values. The two values are commonly the current pixel value and the pixel value already in the output render target. Use the blend operation to control where the two pixel values come from and how they are mathematically combined.

To create a blend-state interface, call .

Passing in null for the blend-state interface indicates to the runtime to set a default blending state. The following table indicates the default blending parameters.

StateDefault Value
AlphaToCoverageEnable
BlendEnable[8]
SrcBlend
DstBlend
BlendOp
SrcBlendAlpha
DstBlendAlpha
BlendOpAlpha
RenderTargetWriteMask[8][8]

?

A sample mask determines which samples get updated in all the active render targets. The mapping of bits in a sample mask to samples in a multisample render target is the responsibility of an individual application. A sample mask is always applied; it is independent of whether multisampling is enabled, and does not depend on whether an application uses multisample render targets.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

- ///
- /// ff476462 - /// void ID3D11DeviceContext::OMSetBlendState([In, Optional] ID3D11BlendState* pBlendState,[In, Optional] const SHARPDX_COLOR4* BlendFactor,[In] unsigned int SampleMask) - /// ID3D11DeviceContext::OMSetBlendState - public void SetBlendState(BlendState blendState, Color4 blendFactor, uint multiSampleMask = 0xFFFFFFFF) - { - SetBlendState(blendState, blendFactor, unchecked((int)multiSampleMask)); - } - - /// - /// Sets the depth-stencil state of the output-merger stage. - /// - ///

Pointer to a depth-stencil state interface (see ) to bind to the device. Set this to null to use the default state listed in .

- ///

Reference value to perform against when doing a depth-stencil test. See remarks.

- /// - ///

To create a depth-stencil state interface, call .

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

- ///
- /// ff476463 - /// void ID3D11DeviceContext::OMSetDepthStencilState([In, Optional] ID3D11DepthStencilState* pDepthStencilState,[In] unsigned int StencilRef) - /// ID3D11DeviceContext::OMSetDepthStencilState - public void SetDepthStencilState(DepthStencilState depthStencilState, int stencilReference = 0) - { - OutputMergerStage.SetDepthStencilState(depthStencilState, stencilReference); - } - - /// - ///

Sets the rasterizer state for the rasterizer stage of the pipeline.

- ///
- /// The rasterizer state to set on this device. - /// ff476479 - /// void ID3D11DeviceContext::RSSetState([In, Optional] ID3D11RasterizerState* pRasterizerState) - /// ID3D11DeviceContext::RSSetState - public void SetRasterizerState(RasterizerState rasterizerState) - { - RasterizerStage.State = rasterizerState; - } - - /// - /// Binds a single scissor rectangle to the rasterizer stage. - /// - /// The left. - /// The top. - /// The right. - /// The bottom. - /// - ///

All scissor rects must be set atomically as one operation. Any scissor rects not defined by the call are disabled.

The scissor rectangles will only be used if ScissorEnable is set to true in the rasterizer state (see ).

Which scissor rectangle to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader (see shader semantic syntax). If a geometry shader does not make use of the SV_ViewportArrayIndex semantic then Direct3D will use the first scissor rectangle in the array.

Each scissor rectangle in the array corresponds to a viewport in an array of viewports (see ).

- ///
- /// ff476478 - /// void ID3D11DeviceContext::RSSetScissorRects([In] unsigned int NumRects,[In, Buffer, Optional] const void* pRects) - /// ID3D11DeviceContext::RSSetScissorRects - public void SetScissorRectangles(int left, int top, int right, int bottom) - { - RasterizerStage.SetScissorRectangle(left, top, right, bottom); - } - - /// - /// Binds a set of scissor rectangles to the rasterizer stage. - /// - /// The set of scissor rectangles to bind. - /// - ///

All scissor rects must be set atomically as one operation. Any scissor rects not defined by the call are disabled.

The scissor rectangles will only be used if ScissorEnable is set to true in the rasterizer state (see ).

Which scissor rectangle to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader (see shader semantic syntax). If a geometry shader does not make use of the SV_ViewportArrayIndex semantic then Direct3D will use the first scissor rectangle in the array.

Each scissor rectangle in the array corresponds to a viewport in an array of viewports (see ).

- ///
- /// ff476478 - /// void ID3D11DeviceContext::RSSetScissorRects([In] unsigned int NumRects,[In, Buffer, Optional] const void* pRects) - /// ID3D11DeviceContext::RSSetScissorRects - public void SetScissorRectangles(params Rectangle[] scissorRectangles) - { - RasterizerStage.SetScissorRectangles(scissorRectangles); - } - - /// - /// Gets the main viewport. - /// - /// The main viewport. - public ViewportF Viewport - { - get - { - RasterizerStage.GetViewports(viewports); - return viewports[0]; - } - - set - { - SetViewport(value); - } - } - - /// - /// Gets the viewport. - /// - /// The index. - /// Returns a viewport bound to a specified render target - public ViewportF GetViewport(int index) - { - RasterizerStage.GetViewports(viewports); - return viewports[index]; - } - - /// - /// Binds a single viewport to the rasterizer stage. - /// - /// The x coordinate of the viewport. - /// The y coordinate of the viewport. - /// The width. - /// The height. - /// The min Z. - /// The max Z. - /// - ///

All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.

Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.

- ///
- /// ff476480 - /// void ID3D11DeviceContext::RSSetViewports([In] unsigned int NumViewports,[In, Buffer, Optional] const void* pViewports) - /// ID3D11DeviceContext::RSSetViewports - public void SetViewport(float x, float y, float width, float height, float minZ = 0.0f, float maxZ = 1.0f) - { - viewports[0] = new ViewportF(x, y, width, height, minZ, maxZ); - RasterizerStage.SetViewport(x, y, width, height, minZ, maxZ); - } - - /// - /// Binds a single viewport to the rasterizer stage. - /// - /// The viewport. - /// - ///

All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.

Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.

- ///
- /// ff476480 - /// void ID3D11DeviceContext::RSSetViewports([In] unsigned int NumViewports,[In, Buffer, Optional] const void* pViewports) - /// ID3D11DeviceContext::RSSetViewports - public void SetViewport(ViewportF viewport) - { - viewports[0] = viewport; - RasterizerStage.SetViewport(viewport); - } - - /// - /// Binds a set of viewports to the rasterizer stage. - /// - /// The set of viewports to bind. - /// - ///

All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.

Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.

- ///
- /// ff476480 - /// void ID3D11DeviceContext::RSSetViewports([In] unsigned int NumViewports,[In, Buffer, Optional] const void* pViewports) - /// ID3D11DeviceContext::RSSetViewports - public void SetViewports(params ViewportF[] viewports) - { - for (int i = 0; i < viewports.Length; i++) - this.viewports[i] = viewports[i]; - - RasterizerStage.SetViewports(this.viewports, viewports.Length); - } - - /// - /// Unbinds all depth-stencil buffer and render targets from the output-merger stage. - /// - /// ff476464 - /// void ID3D11DeviceContext::OMSetRenderTargets([In] unsigned int NumViews,[In] const void** ppRenderTargetViews,[In, Optional] ID3D11DepthStencilView* pDepthStencilView) - /// ID3D11DeviceContext::OMSetRenderTargets - public void ResetTargets() - { - for (int i = 0; i < currentRenderTargetViews.Length; i++) - currentRenderTargetViews[i] = null; - actualRenderTargetViewCount = 0; - currentRenderTargetView = null; - currentDepthStencilView = null; - OutputMergerStage.ResetTargets(); - } - - /// - /// Gets the render targets currently bound to the through this instance. - /// - /// The depth stencil view, may ne null. - /// An array of . - public RenderTargetView[] GetRenderTargets(out DepthStencilView depthStencilViewRef) - { - var renderTargets = new RenderTargetView[actualRenderTargetViewCount]; - for (int i = 0; i < actualRenderTargetViewCount; i++) - renderTargets[i] = currentRenderTargetViews[i]; - depthStencilViewRef = currentDepthStencilView; - return renderTargets; - } - - /// - ///

Bind one or more render targets atomically and the depth-stencil buffer to the output-merger stage.

- ///
- /// A set of render target views to bind. - /// - ///

The maximum number of active render targets a device can have active at any given time is set by a #define in D3D11.h called D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT. It is invalid to try to set the same subresource to multiple render target slots. Any render targets not defined by this call are set to null.

If any subresources are also currently bound for reading in a different stage or writing (perhaps in a different part of the pipeline), those bind points will be set to null, in order to prevent the same subresource from being read and written simultaneously in a single rendering operation.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

If the render-target views were created from an array resource type, then all of the render-target views must have the same array size. This restriction also applies to the depth-stencil view, its array size must match that of the render-target views being bound.

The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.

Any combination of the eight slots for render targets can have a render target set or not set.

The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.

- ///
- /// ff476464 - /// void ID3D11DeviceContext::OMSetRenderTargets([In] unsigned int NumViews,[In] const void** ppRenderTargetViews,[In, Optional] ID3D11DepthStencilView* pDepthStencilView) - /// ID3D11DeviceContext::OMSetRenderTargets - public void SetRenderTargets(params RenderTargetView[] renderTargetViews) - { - if (renderTargetViews == null) - { - throw new ArgumentNullException("renderTargetViews"); - } - - CommonSetRenderTargets(renderTargetViews); - currentDepthStencilView = null; - OutputMergerStage.SetTargets(renderTargetViews); - } - - /// - /// Binds a single render target to the output-merger stage. - /// - /// A view of the render target to bind. - /// - ///

The maximum number of active render targets a device can have active at any given time is set by a #define in D3D11.h called D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT. It is invalid to try to set the same subresource to multiple render target slots. Any render targets not defined by this call are set to null.

If any subresources are also currently bound for reading in a different stage or writing (perhaps in a different part of the pipeline), those bind points will be set to null, in order to prevent the same subresource from being read and written simultaneously in a single rendering operation.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

If the render-target views were created from an array resource type, then all of the render-target views must have the same array size. This restriction also applies to the depth-stencil view, its array size must match that of the render-target views being bound.

The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.

Any combination of the eight slots for render targets can have a render target set or not set.

The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.

- ///
- /// ff476464 - /// void ID3D11DeviceContext::OMSetRenderTargets([In] unsigned int NumViews,[In] const void** ppRenderTargetViews,[In, Optional] ID3D11DepthStencilView* pDepthStencilView) - /// ID3D11DeviceContext::OMSetRenderTargets - public void SetRenderTargets(RenderTargetView renderTargetView) - { - CommonSetRenderTargets(renderTargetView); - currentDepthStencilView = null; - OutputMergerStage.SetTargets(renderTargetView); - } - - /// - /// Binds a depth-stencil buffer and a set of render targets to the output-merger stage. - /// - /// A view of the depth-stencil buffer to bind. - /// A set of render target views to bind. - /// - ///

The maximum number of active render targets a device can have active at any given time is set by a #define in D3D11.h called D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT. It is invalid to try to set the same subresource to multiple render target slots. Any render targets not defined by this call are set to null.

If any subresources are also currently bound for reading in a different stage or writing (perhaps in a different part of the pipeline), those bind points will be set to null, in order to prevent the same subresource from being read and written simultaneously in a single rendering operation.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

If the render-target views were created from an array resource type, then all of the render-target views must have the same array size. This restriction also applies to the depth-stencil view, its array size must match that of the render-target views being bound.

The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.

Any combination of the eight slots for render targets can have a render target set or not set.

The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.

- ///
- /// ff476464 - /// void ID3D11DeviceContext::OMSetRenderTargets([In] unsigned int NumViews,[In] const void** ppRenderTargetViews,[In, Optional] ID3D11DepthStencilView* pDepthStencilView) - /// ID3D11DeviceContext::OMSetRenderTargets - public void SetRenderTargets(DepthStencilView depthStencilView, params RenderTargetView[] renderTargetViews) - { - if (renderTargetViews == null) - { - throw new ArgumentNullException("renderTargetViews"); - } - - CommonSetRenderTargets(renderTargetViews); - currentDepthStencilView = depthStencilView; - OutputMergerStage.SetTargets(depthStencilView, renderTargetViews); - } - - /// - /// Binds a depth-stencil buffer and a single render target to the output-merger stage. - /// - /// A view of the depth-stencil buffer to bind. - /// A view of the render target to bind. - /// - ///

The maximum number of active render targets a device can have active at any given time is set by a #define in D3D11.h called D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT. It is invalid to try to set the same subresource to multiple render target slots. Any render targets not defined by this call are set to null.

If any subresources are also currently bound for reading in a different stage or writing (perhaps in a different part of the pipeline), those bind points will be set to null, in order to prevent the same subresource from being read and written simultaneously in a single rendering operation.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

If the render-target views were created from an array resource type, then all of the render-target views must have the same array size. This restriction also applies to the depth-stencil view, its array size must match that of the render-target views being bound.

The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.

Any combination of the eight slots for render targets can have a render target set or not set.

The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.

- ///
- /// ff476464 - /// void ID3D11DeviceContext::OMSetRenderTargets([In] unsigned int NumViews,[In] const void** ppRenderTargetViews,[In, Optional] ID3D11DepthStencilView* pDepthStencilView) - /// ID3D11DeviceContext::OMSetRenderTargets - public void SetRenderTargets(DepthStencilView depthStencilView, RenderTargetView renderTargetView) - { - CommonSetRenderTargets(renderTargetView); - currentDepthStencilView = depthStencilView; - OutputMergerStage.SetTargets(depthStencilView, renderTargetView); - } - - /// - /// Resets the stream output targets bound to the StreamOutput stage. - /// - /// ff476484 - /// void ID3D11DeviceContext::SOSetTargets([In] unsigned int NumBuffers,[In, Buffer, Optional] const ID3D11Buffer** ppSOTargets,[In, Buffer, Optional] const unsigned int* pOffsets) - /// ID3D11DeviceContext::SOSetTargets - public void ResetStreamOutputTargets() - { - Context.StreamOutput.SetTargets(0, null, null); - } - - /// - /// Sets the stream output targets bound to the StreamOutput stage. - /// - /// The buffer to bind on the first stream output slot. - /// The offsets in bytes of the buffer. An offset of -1 will cause the stream output buffer to be appended, continuing after the last location written to the buffer in a previous stream output pass. - /// ff476484 - /// void ID3D11DeviceContext::SOSetTargets([In] unsigned int NumBuffers,[In, Buffer, Optional] const ID3D11Buffer** ppSOTargets,[In, Buffer, Optional] const unsigned int* pOffsets) - /// ID3D11DeviceContext::SOSetTargets - public unsafe void SetStreamOutputTarget(Buffer buffer, int offsets = -1) - { - Context.StreamOutput.SetTarget(buffer, offsets); - } - - /// - /// Sets the stream output targets bound to the StreamOutput stage. - /// - /// The buffers. - /// ff476484 - /// void ID3D11DeviceContext::SOSetTargets([In] unsigned int NumBuffers,[In, Buffer, Optional] const ID3D11Buffer** ppSOTargets,[In, Buffer, Optional] const unsigned int* pOffsets) - /// ID3D11DeviceContext::SOSetTargets - public void SetStreamOutputTargets(params StreamOutputBufferBinding[] buffers) - { - Context.StreamOutput.SetTargets(buffers); - } - - /// - ///

Bind an index buffer to the input-assembler stage.

- ///
- ///

A reference to an object, that contains indices. The index buffer must have been created with the flag.

- /// Set to true if indices are 32-bit values (integer size) or false if they are 16-bit values (short size) - /// Offset (in bytes) from the start of the index buffer to the first index to use. Default to 0 - /// - ///

For information about creating index buffers, see How to: Create an Index Buffer.

Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind null instead because a buffer cannot be bound as both an input and an output at the same time.

The debug layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

- ///
- /// ff476453 - /// void ID3D11DeviceContext::IASetIndexBuffer([In, Optional] ID3D11Buffer* pIndexBuffer,[In] DXGI_FORMAT Format,[In] unsigned int Offset) - /// ID3D11DeviceContext::IASetIndexBuffer - public void SetIndexBuffer(Buffer indexBuffer, bool is32Bit, int offset = 0) - { - InputAssemblerStage.SetIndexBuffer(indexBuffer, is32Bit ? DXGI.Format.R32_UInt : DXGI.Format.R16_UInt, offset); - } - - /// - /// Sets the vertex input layout. - /// - /// The input layout. - /// ff476454 - /// void ID3D11DeviceContext::IASetInputLayout([In, Optional] ID3D11InputLayout* pInputLayout) - /// ID3D11DeviceContext::IASetInputLayout - public void SetVertexInputLayout(VertexInputLayout inputLayout) - { - currentVertexInputLayout = inputLayout; - } - - /// - /// Bind a vertex buffer on the slot #0 of the input-assembler stage. - /// - /// The vertex buffer to bind to this slot. This vertex buffer must have been created with the flag. - /// The index is the number of vertex element between the first element of a vertex buffer and the first element that will be used. - /// - ///

For information about creating vertex buffers, see Create a Vertex Buffer.

Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind null instead because a buffer cannot be bound as both an input and an output at the same time.

The debug layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

- ///
- /// ff476456 - /// void ID3D11DeviceContext::IASetVertexBuffers([In] unsigned int StartSlot,[In] unsigned int NumBuffers,[In, Buffer] const void* ppVertexBuffers,[In, Buffer] const void* pStrides,[In, Buffer] const void* pOffsets) - /// ID3D11DeviceContext::IASetVertexBuffers - public void SetVertexBuffer(Buffer vertexBuffer, int vertexIndex = 0) where T : struct - { - SetVertexBuffer(0, vertexBuffer, vertexIndex); - } - - /// - /// Bind a vertex buffer to the input-assembler stage. - /// - /// The first input slot for binding. - /// The vertex buffer to bind to this slot. This vertex buffer must have been created with the flag. - /// The index is the number of vertex element between the first element of a vertex buffer and the first element that will be used. - /// - ///

For information about creating vertex buffers, see Create a Vertex Buffer.

Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind null instead because a buffer cannot be bound as both an input and an output at the same time.

The debug layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

- ///
- /// ff476456 - /// void ID3D11DeviceContext::IASetVertexBuffers([In] unsigned int StartSlot,[In] unsigned int NumBuffers,[In, Buffer] const void* ppVertexBuffers,[In, Buffer] const void* pStrides,[In, Buffer] const void* pOffsets) - /// ID3D11DeviceContext::IASetVertexBuffers - public unsafe void SetVertexBuffer(int slot, Buffer vertexBuffer, int vertexIndex = 0) where T : struct - { - IntPtr vertexBufferPtr = IntPtr.Zero; - int stride = Utilities.SizeOf(); - int offset = vertexIndex * stride; - if (vertexBuffer != null) - { - vertexBufferPtr = ((Direct3D11.Buffer)vertexBuffer).NativePointer; - - // Update the index of the last slot buffer bounded, used by ResetVertexBuffers - if ((slot + 1) > maxSlotCountForVertexBuffer) - maxSlotCountForVertexBuffer = slot + 1; - } - InputAssemblerStage.SetVertexBuffers(slot, 1, new IntPtr(&vertexBufferPtr), new IntPtr(&stride), new IntPtr(&offset)); - } - - /// - ///

Bind a vertex buffer to the input-assembler stage.

- ///
- /// The first input slot for binding. - /// The vertex buffer to bind to this slot. This vertex buffer must have been created with the flag. - /// The vertexStride is the size (in bytes) of the elements that are to be used from that vertex buffer. - /// The offset is the number of bytes between the first element of a vertex buffer and the first element that will be used. - /// - ///

For information about creating vertex buffers, see Create a Vertex Buffer.

Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind null instead because a buffer cannot be bound as both an input and an output at the same time.

The debug layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

- ///
- /// ff476456 - /// void ID3D11DeviceContext::IASetVertexBuffers([In] unsigned int StartSlot,[In] unsigned int NumBuffers,[In, Buffer] const void* ppVertexBuffers,[In, Buffer] const void* pStrides,[In, Buffer] const void* pOffsets) - /// ID3D11DeviceContext::IASetVertexBuffers - public unsafe void SetVertexBuffer(int slot, SharpDX.Direct3D11.Buffer vertexBuffer, int vertexStride, int offsetInBytes = 0) - { - IntPtr vertexBufferPtr = IntPtr.Zero; - if (vertexBuffer != null) - { - vertexBufferPtr = vertexBuffer.NativePointer; - - // Update the index of the last slot buffer bounded, used by ResetVertexBuffers - if ((slot + 1) > maxSlotCountForVertexBuffer) - maxSlotCountForVertexBuffer = slot + 1; - } - InputAssemblerStage.SetVertexBuffers(slot, 1, new IntPtr(&vertexBufferPtr), new IntPtr(&vertexStride), new IntPtr(&offsetInBytes)); - } - - /// - /// Resets all vertex buffers bounded to a slot range. By default, It clears all the bounded buffers. See remarks. - /// - /// - /// This is sometimes required to unding explicitly vertex buffers bounding to the input shader assembly, when a - /// vertex buffer is used as the output of the pipeline. - /// - /// ff476456 - /// void ID3D11DeviceContext::IASetVertexBuffers([In] unsigned int StartSlot,[In] unsigned int NumBuffers,[In, Buffer] const void* ppVertexBuffers,[In, Buffer] const void* pStrides,[In, Buffer] const void* pOffsets) - /// ID3D11DeviceContext::IASetVertexBuffers - public void ResetVertexBuffers() - { - if (maxSlotCountForVertexBuffer == 0) - return; - - InputAssemblerStage.SetVertexBuffers(0, maxSlotCountForVertexBuffer, ResetSlotsPointers, ResetSlotsPointers, ResetSlotsPointers); - - maxSlotCountForVertexBuffer = 0; - } - - /// - /// Presents the Backbuffer to the screen. - /// - /// - /// This method is only working if a is set on this device using property. - /// - /// bb174576 - /// HRESULT IDXGISwapChain::Present([In] unsigned int SyncInterval,[In] DXGI_PRESENT_FLAGS Flags) - /// IDXGISwapChain::Present - public void Present() - { - if (IsDeferred) - throw new InvalidOperationException("Cannot use Present on a deferred context"); - - if (Presenter != null) - { - try - { - Presenter.Present(); - } - catch (SharpDXException ex) - { - if (ex.ResultCode == DXGI.ResultCode.DeviceReset || ex.ResultCode == DXGI.ResultCode.DeviceRemoved) - { - // TODO: Implement device reset / removed - } - throw; - } - - } - } - - /// - /// Remove all shaders bounded to each stage. - /// - public void ResetShaderStages() - { - foreach (var commonShaderStage in ShaderStages) - { - commonShaderStage.SetShader(null, null, 0); - } - } - - public static implicit operator Device(GraphicsDevice from) - { - return from == null ? null : from.Device; - } - - public static implicit operator DeviceContext(GraphicsDevice from) - { - return from == null ? null : from.Context; - } - - private void SetupInputLayout() - { - if (CurrentPass == null) - throw new InvalidOperationException("Cannot perform a Draw/Dispatch operation without an EffectPass applied."); - - var inputLayout = CurrentPass.GetInputLayout(currentVertexInputLayout); - InputAssemblerStage.SetInputLayout(inputLayout); - } - - /// - /// A delegate called to create shareable data. See remarks. - /// - /// Type of the data to create. - /// A new instance of the data to share. - /// - /// Because this method is being called from a lock region, this method should not be time consuming. - /// - public delegate T CreateSharedData() where T : IDisposable; - - /// - /// Gets a shared data for this device context with a delegate to create the shared data if it is not present. - /// - /// Type of the shared data to get/create. - /// Type of the data to share. - /// The key of the shared data. - /// The shared data creator. - /// An instance of the shared data. The shared data will be disposed by this instance. - public T GetOrCreateSharedData(SharedDataType type, object key, CreateSharedData sharedDataCreator) where T : IDisposable - { - var dictionary = (type == SharedDataType.PerDevice) ? sharedDataPerDevice : sharedDataPerDeviceContext; - - lock (dictionary) - { - object localValue; - if (!dictionary.TryGetValue(key, out localValue)) - { - localValue = ToDispose(sharedDataCreator()); - dictionary.Add(key, localValue); - } - return (T)localValue; - } - } - - protected override void Dispose(bool disposeManagedResources) - { - if (disposeManagedResources) - { - if (Presenter != null) - { - - // Invalid for WinRT - throwing a "Value does not fall within the expected range" Exception -#if !WIN8METRO - // Make sure that the Presenter is reverted to window before shutting down - // otherwise the Direct3D11.Device will generate an exception on Dispose() - Presenter.IsFullScreen = false; -#endif - Presenter.Dispose(); - Presenter = null; - } - - // effect pools will be disposed only by the master graphics device - if(!IsDeferred) - { - // dispose EffectPools in reverse order as they will remove themselves from the list - for(var i = EffectPools.Count - 1; i >= 0; i--) - { - EffectPools[i].Dispose(); - } - - EffectPools = null; - } - } - - base.Dispose(disposeManagedResources); - } - - - /// - /// Gets or create an input signature manager for a particular signature. - /// - /// The signature bytecode. - /// The signature hashcode. - /// - internal InputSignatureManager GetOrCreateInputSignatureManager(byte[] signatureBytecode, int signatureHashcode) - { - var key = new InputSignatureKey(signatureBytecode, signatureHashcode); - - InputSignatureManager signatureManager; - - // Lock all input signatures, as they are shared between all shaders/graphics device instances. - lock (inputSignatureCache) - { - if (!inputSignatureCache.TryGetValue(key, out signatureManager)) - { - signatureManager = ToDispose(new InputSignatureManager(this, signatureBytecode)); - inputSignatureCache.Add(key, signatureManager); - } - } - - return signatureManager; - } - - private void CommonSetRenderTargets(RenderTargetView rtv) - { - currentRenderTargetViews[0] = rtv; - for (int i = 1; i < actualRenderTargetViewCount; i++) - currentRenderTargetViews[i] = null; - actualRenderTargetViewCount = 1; - currentRenderTargetView = rtv; - - // Setup the viewport from the rendertarget view - TextureView textureView; - if (AutoViewportFromRenderTargets && rtv != null && (textureView = rtv.Tag as TextureView) != null) - { - SetViewport(new ViewportF(0, 0, textureView.Width, textureView.Height)); - } - } - - private void CommonSetRenderTargets(RenderTargetView[] rtvs) - { - var rtv0 = rtvs.Length > 0 ? rtvs[0] : null; - for (int i = 0; i < rtvs.Length; i++) - currentRenderTargetViews[i] = rtvs[i]; - for (int i = rtvs.Length; i < actualRenderTargetViewCount; i++) - currentRenderTargetViews[i] = null; - actualRenderTargetViewCount = rtvs.Length; - currentRenderTargetView = rtv0; - - // Setup the viewport from the rendertarget view - TextureView textureView; - if (AutoViewportFromRenderTargets && rtv0 != null && (textureView = rtv0.Tag as TextureView) != null) - { - SetViewport(new ViewportF(0, 0, textureView.Width, textureView.Height)); - } - } - } -} +// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using SharpDX.Direct3D; +using SharpDX.Direct3D11; +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.InteropServices; +using SharpDX.Mathematics; +using SharpDX.Mathematics.Interop; +using SharpDX.Toolkit.Collections; +using Device = SharpDX.Direct3D11.Device; + +namespace SharpDX.Toolkit.Graphics +{ + /// + /// This class is a front end to and . + /// + public class GraphicsDevice : Component + { + private readonly Dictionary sharedDataPerDevice; + private readonly Dictionary sharedDataPerDeviceContext = new Dictionary(); + internal Device Device; + internal DeviceContext Context; + internal CommonShaderStage[] ShaderStages; + private readonly ViewportF[] viewports = new ViewportF[16]; + internal IntPtr ResetSlotsPointers { get; private set; } + private int maxSlotCountForVertexBuffer; + + private const int SimultaneousRenderTargetCount = OutputMergerStage.SimultaneousRenderTargetCount; + private readonly RenderTargetView[] currentRenderTargetViews = new RenderTargetView[SimultaneousRenderTargetCount]; + private RenderTargetView currentRenderTargetView; + private int actualRenderTargetViewCount; + private DepthStencilView currentDepthStencilView; + + private readonly PrimitiveQuad primitiveQuad; + + private VertexInputLayout currentVertexInputLayout; + internal EffectPass CurrentPass; + + private readonly Dictionary inputSignatureCache; + + /// + /// Gets the features supported by this . + /// + public readonly GraphicsDeviceFeatures Features; + + /// + /// Default effect pool shared between all deferred GraphicsDevice instances. + /// + public readonly EffectPool DefaultEffectPool; + + /// + /// Gets the for immediate rendering. + /// + public readonly GraphicsDevice MainDevice; + + /// + /// Gets whether this is running in debug. + /// + public readonly bool IsDebugMode; + + /// + /// Gets whether this is a deferred context. + /// + public readonly bool IsDeferred; + + /// + /// Gets the registered for this graphics device. + /// + public readonly BlendStateCollection BlendStates; + + /// + /// Gets the registered for this graphics device. + /// + public readonly DepthStencilStateCollection DepthStencilStates; + + /// + /// Gets the registered for this graphics device. + /// + public readonly SamplerStateCollection SamplerStates; + + /// + /// Gets the registered for this graphics device. + /// + public readonly RasterizerStateCollection RasterizerStates; + + internal InputAssemblerStage InputAssemblerStage; + internal VertexShaderStage VertexShaderStage; + internal DomainShaderStage DomainShaderStage; + internal HullShaderStage HullShaderStage; + internal GeometryShaderStage GeometryShaderStage; + internal RasterizerStage RasterizerStage; + internal PixelShaderStage PixelShaderStage; + internal OutputMergerStage OutputMergerStage; + internal ComputeShaderStage ComputeShaderStage; + + internal readonly bool needWorkAroundForUpdateSubResource; + + protected GraphicsDevice(DriverType type, DeviceCreationFlags flags = DeviceCreationFlags.None, params FeatureLevel[] featureLevels) + : this((featureLevels != null && featureLevels.Length > 0) ? new Device(type, flags, featureLevels) : new Device(type, flags)) + { + } + + protected GraphicsDevice(GraphicsAdapter adapter, DeviceCreationFlags flags = DeviceCreationFlags.None, params FeatureLevel[] featureLevels) + : this((featureLevels != null && featureLevels.Length > 0) ? new Device(adapter, flags, featureLevels) : new Device(adapter, flags), adapter) + { + } + + protected GraphicsDevice(SharpDX.Direct3D11.Device existingDevice, GraphicsAdapter adapter = null) + { + Device = ToDispose(existingDevice); + Adapter = adapter; + + // If the adapter is null, then try to locate back the adapter + if (adapter == null) + { + try + { + using (var dxgiDevice = Device.QueryInterface()) + { + using (var dxgiAdapter = dxgiDevice.Adapter) + { + var deviceId = dxgiAdapter.Description.DeviceId; + + foreach (var graphicsAdapter in GraphicsAdapter.Adapters) + { + if (deviceId == graphicsAdapter.Description.DeviceId) + { + Adapter = graphicsAdapter; + break; + } + } + } + } + } + catch (Exception ex) + { + } + } + + EffectPools = new ObservableCollection(); + + IsDebugMode = (Device.CreationFlags & DeviceCreationFlags.Debug) != 0; + MainDevice = this; + Context = Device.ImmediateContext; + IsDeferred = false; + Features = new GraphicsDeviceFeatures(Device); + AutoViewportFromRenderTargets = true; // By default + + // Global cache for all input signatures inside a GraphicsDevice. + inputSignatureCache = new Dictionary(); + sharedDataPerDevice = new Dictionary(); + + // Create default Effect pool + DefaultEffectPool = EffectPool.New(this, "Default"); + + // Create all default states + BlendStates = ToDispose(new BlendStateCollection(this)); + DepthStencilStates = ToDispose(new DepthStencilStateCollection(this)); + SamplerStates = ToDispose(new SamplerStateCollection(this)); + RasterizerStates = ToDispose(new RasterizerStateCollection(this)); + + Initialize(); + + // Create Internal Effect + primitiveQuad = ToDispose(new PrimitiveQuad(this)); + } + + protected GraphicsDevice(GraphicsDevice mainDevice, DeviceContext deferredContext) + { + Device = mainDevice.Device; + Adapter = mainDevice.Adapter; + IsDebugMode = (Device.CreationFlags & DeviceCreationFlags.Debug) != 0; + MainDevice = mainDevice; + Context = deferredContext; + IsDeferred = true; + Features = mainDevice.Features; + + // Create default Effect pool + EffectPools = mainDevice.EffectPools; + DefaultEffectPool = mainDevice.DefaultEffectPool; + + // Copy the Global cache for all input signatures inside a GraphicsDevice. + inputSignatureCache = mainDevice.inputSignatureCache; + sharedDataPerDevice = mainDevice.sharedDataPerDevice; + + // Copy the reset vertex buffer + ResetSlotsPointers = mainDevice.ResetSlotsPointers; + + // Create all default states + BlendStates = mainDevice.BlendStates; + DepthStencilStates = mainDevice.DepthStencilStates; + SamplerStates = mainDevice.SamplerStates; + RasterizerStates = mainDevice.RasterizerStates; + + // Setup the workaround flag + needWorkAroundForUpdateSubResource = IsDeferred && !Features.HasDriverCommandLists; + Initialize(); + + // Create Internal Effect + primitiveQuad = ToDispose(new PrimitiveQuad(this)); + } + + /// + /// Initializes this instance. + /// + private void Initialize() + { + // Default null VertexBuffers used to reset + if (ResetSlotsPointers == IntPtr.Zero) + { + // CommonShaderStage.InputResourceSlotCount is the maximum of resources bindable in the whole pipeline + ResetSlotsPointers = ToDispose(Utilities.AllocateClearedMemory(Utilities.SizeOf() * CommonShaderStage.InputResourceSlotCount)); + } + + InputAssemblerStage = Context.InputAssembler; + VertexShaderStage = Context.VertexShader; + DomainShaderStage = Context.DomainShader; + HullShaderStage = Context.HullShader; + GeometryShaderStage = Context.GeometryShader; + RasterizerStage = Context.Rasterizer; + PixelShaderStage = Context.PixelShader; + OutputMergerStage = Context.OutputMerger; + ComputeShaderStage = Context.ComputeShader; + + // Precompute shader stages + ShaderStages = new CommonShaderStage[] + { + Context.VertexShader, + Context.HullShader, + Context.DomainShader, + Context.GeometryShader, + Context.PixelShader, + Context.ComputeShader + }; + + Performance = new GraphicsPerformance(this); + } + + /// + /// Check if a feature level is supported by a primary adapter. + /// + /// The feature level. + /// true if the primary adapter is supporting this feature level; otherwise, false. + public static bool IsProfileSupported(FeatureLevel featureLevel) + { + return SharpDX.Direct3D11.Device.IsSupportedFeatureLevel(featureLevel); + } + + /// + /// Gets the adapter associated with this device. + /// + public readonly GraphicsAdapter Adapter; + + /// + /// Gets the effect pools. + /// + /// The effect pools. + public ObservableCollection EffectPools { get; private set; } + + /// + /// Gets the back buffer sets by the current setup on this device. + /// + /// The back buffer. The returned value may be null if no are setup on this device. + public RenderTarget2D BackBuffer + { + get { return Presenter != null ? Presenter.BackBuffer : null; } + } + + /// + /// Gets the depth stencil buffer sets by the current setup on this device. + /// + /// The depth stencil buffer. The returned value may be null if no are setup on this device or no depth buffer was allocated. + public DepthStencilBuffer DepthStencilBuffer + { + get { return Presenter != null ? Presenter.DepthStencilBuffer : null; } + } + + /// + /// Gets or sets the current presenter use by the method. + /// + /// The current presenter. + public GraphicsPresenter Presenter { get; set; } + + /// + /// Gets or sets a value indicating whether the viewport is automatically calculated and set when a render target is set. Default is true. + /// + /// true if the viewport is automatically calculated and set when a render target is set; otherwise, false. + public bool AutoViewportFromRenderTargets { get; set; } + + /// + /// Gets the status of this device. + /// + /// ff476526 + /// GetDeviceRemovedReason + /// GetDeviceRemovedReason + /// HRESULT ID3D11Device::GetDeviceRemovedReason() + public GraphicsDeviceStatus GraphicsDeviceStatus + { + get + { + var result = ((Device)MainDevice).DeviceRemovedReason; + if (result == DXGI.ResultCode.DeviceRemoved) + { + return GraphicsDeviceStatus.Removed; + } + + if (result == DXGI.ResultCode.DeviceReset) + { + return GraphicsDeviceStatus.Reset; + } + + if (result == DXGI.ResultCode.DeviceHung) + { + return GraphicsDeviceStatus.Hung; + } + + if (result == DXGI.ResultCode.DriverInternalError) + { + return GraphicsDeviceStatus.InternalError; + } + + if (result == DXGI.ResultCode.InvalidCall) + { + return GraphicsDeviceStatus.InvalidCall; + } + + if (result.Code < 0) + { + return GraphicsDeviceStatus.Reset; + } + + return GraphicsDeviceStatus.Normal; + } + } + + /// + /// Gets the access to performance profiler. + /// + /// The access to performance profiler. + public GraphicsPerformance Performance { get; private set; } + + /// + /// Gets the default quad primitive to issue draw commands. + /// + /// The default quad primitive to issue draw commands. + public PrimitiveQuad Quad + { + get + { + return primitiveQuad; + } + } + + /// + /// Clears the default render target and depth stencil buffer attached to the current . + /// + /// Set this color value in all buffers. + /// Cannot clear without a Presenter set on this instance + public void Clear(Color4 color) + { + var options = currentRenderTargetView != null ? ClearOptions.Target : (ClearOptions)0; + + if (currentDepthStencilView != null) + { + var textureView = currentDepthStencilView.Tag as TextureView; + DepthStencilBuffer depthStencilBuffer; + + if (textureView == null || (depthStencilBuffer = textureView.Texture as DepthStencilBuffer) == null) + { + throw new InvalidOperationException("Clear on a custom DepthStencilView is not supported by this method. Use Clear(DepthStencilView) directly"); + } + + options |= depthStencilBuffer.HasStencil ? ClearOptions.DepthBuffer | ClearOptions.Stencil : ClearOptions.DepthBuffer; + + } + + Clear(options, color, 1f, 0); + } + + /// + /// Clears the default render target and depth stencil buffer attached to the current . + /// + /// Options for clearing a buffer. + /// Set this four-component color value in the buffer. + /// Set this depth value in the buffer. + /// Set this stencil value in the buffer. + public void Clear(ClearOptions options, Color4 color, float depth, int stencil) + { + if ((options & ClearOptions.Target) != 0) + { + if (currentRenderTargetView == null) + { + throw new InvalidOperationException("No default render target view setup. Call SetRenderTargets before calling this method."); + } + Clear(currentRenderTargetView, color); + } + + if ((options & (ClearOptions.Stencil | ClearOptions.DepthBuffer)) != 0) + { + if (currentDepthStencilView == null) + { + throw new InvalidOperationException("No default depth stencil view setup. Call SetRenderTargets before calling this method."); + } + + var flags = (options & ClearOptions.DepthBuffer) != 0 ? DepthStencilClearFlags.Depth : 0; + if ((options & ClearOptions.Stencil) != 0) + { + flags |= DepthStencilClearFlags.Stencil; + } + + Clear(currentDepthStencilView, flags, depth, (byte)stencil); + } + } + + /// + /// Clears the default render target and depth stencil buffer attached to the current . + /// + /// Options for clearing a buffer. + /// Set this four-component color value in the buffer. + /// Set this depth value in the buffer. + /// Set this stencil value in the buffer. + public void Clear(ClearOptions options, Vector4 color, float depth, int stencil) + { + Clear(options, (Color4)color, depth, stencil); + } + + /// + /// Clears a render target view by setting all the elements in a render target to one value. + /// + /// The render target view. + /// A 4-component array that represents the color to fill the render target with. + ///

Applications that wish to clear a render target to a specific integer value bit pattern should render a screen-aligned quad instead of using this method. The reason for this is because this method accepts as input a floating point value, which may not have the same bit pattern as the original integer.

Differences between Direct3D 9 and Direct3D 11/10:

Unlike Direct3D 9, the full extent of the resource view is always cleared. Viewport and scissor settings are not applied.

?

+ /// ff476388 + /// void ID3D11DeviceContext::ClearRenderTargetView([In] ID3D11RenderTargetView* pRenderTargetView,[In] const SHARPDX_COLOR4* ColorRGBA) + /// ID3D11DeviceContext::ClearRenderTargetView + public void Clear(SharpDX.Direct3D11.RenderTargetView renderTargetView, Color4 colorRGBA) + { + Context.ClearRenderTargetView(renderTargetView, colorRGBA); + } + + /// + /// Clears the depth-stencil resource. + /// + ///

Pointer to the depth stencil to be cleared.

+ ///

Identify the type of data to clear (see ).

+ ///

Clear the depth buffer with this value. This value will be clamped between 0 and 1.

+ ///

Clear the stencil buffer with this value.

+ /// + ///

Differences between Direct3D 9 and Direct3D 11/10:

Unlike Direct3D 9, the full extent of the resource view is always cleared. Viewport and scissor settings are not applied.

?

+ ///
+ /// ff476387 + /// void ID3D11DeviceContext::ClearDepthStencilView([In] ID3D11DepthStencilView* pDepthStencilView,[In] D3D11_CLEAR_FLAG ClearFlags,[In] float Depth,[In] unsigned char Stencil) + /// ID3D11DeviceContext::ClearDepthStencilView + public void Clear(SharpDX.Direct3D11.DepthStencilView depthStencilView, SharpDX.Direct3D11.DepthStencilClearFlags clearFlags, float depth, byte stencil) + { + Context.ClearDepthStencilView(depthStencilView, clearFlags, depth, stencil); + } + + /// + /// Clears an unordered access resource with bit-precise values. + /// + /// The buffer to clear. + /// The value used to clear. + /// + ///

This API copies the lower ni bits from each array element i to the corresponding channel, where ni is the number of bits in the ith channel of the resource format (for example, R8G8B8_FLOAT has 8 bits for the first 3 channels). This works on any UAV with no format conversion. For a raw or structured buffer view, only the first array element value is used.

+ ///
+ /// ff476391 + /// void ID3D11DeviceContext::ClearUnorderedAccessViewUint([In] ID3D11UnorderedAccessView* pUnorderedAccessView,[In] const unsigned int* Values) + /// ID3D11DeviceContext::ClearUnorderedAccessViewUint + public void Clear(UnorderedAccessView view, Int4 value) + { + Context.ClearUnorderedAccessView(view, value); + } + + /// + /// Clears an unordered access resource with a float value. + /// + /// The buffer to clear. + /// The value used to clear. + /// + ///

This API works on FLOAT, UNORM, and SNORM unordered access views (UAVs), with format conversion from FLOAT to *NORM where appropriate. On other UAVs, the operation is invalid and the call will not reach the driver.

+ ///
+ /// ff476390 + /// void ID3D11DeviceContext::ClearUnorderedAccessViewFloat([In] ID3D11UnorderedAccessView* pUnorderedAccessView,[In] const float* Values) + /// ID3D11DeviceContext::ClearUnorderedAccessViewFloat + public void Clear(UnorderedAccessView view, Vector4 value) + { + Context.ClearUnorderedAccessView(view, value); + } + + /// + /// Copies the content of this resource to another . + /// + /// The resource to copy from. + /// The resource to copy to. + /// See the unmanaged documentation for usage and restrictions. + /// ff476392 + /// void ID3D11DeviceContext::CopyResource([In] ID3D11Resource* pDstResource,[In] ID3D11Resource* pSrcResource) + /// ID3D11DeviceContext::CopyResource + public void Copy(Direct3D11.Resource fromResource, Direct3D11.Resource toResource) + { + Context.CopyResource(fromResource, toResource); + } + + /// + /// Copy a region from a source resource to a destination resource. + /// + /// + /// The source box must be within the size of the source resource. The destination offsets, (x, y, and z) allow the source box to be offset when writing into the destination resource; however, the dimensions of the source box and the offsets must be within the size of the resource. If the resources are buffers, all coordinates are in bytes; if the resources are textures, all coordinates are in texels. {{D3D11CalcSubresource}} is a helper function for calculating subresource indexes. CopySubresourceRegion performs the copy on the GPU (similar to a memcpy by the CPU). As a consequence, the source and destination resources: Must be different subresources (although they can be from the same resource). Must be the same type. Must have compatible DXGI formats (identical or from the same type group). For example, a DXGI_FORMAT_R32G32B32_FLOAT texture can be copied to an DXGI_FORMAT_R32G32B32_UINT texture since both of these formats are in the DXGI_FORMAT_R32G32B32_TYPELESS group. May not be currently mapped. CopySubresourceRegion only supports copy; it does not support any stretch, color key, blend, or format conversions. An application that needs to copy an entire resource should use instead. CopySubresourceRegion is an asynchronous call which may be added to the command-buffer queue, this attempts to remove pipeline stalls that may occur when copying data. See performance considerations for more details. Note??If you use CopySubresourceRegion with a depth-stencil buffer or a multisampled resource, you must copy the whole subresource. In this situation, you must pass 0 to the DstX, DstY, and DstZ parameters and NULL to the pSrcBox parameter. In addition, source and destination resources, which are represented by the pSrcResource and pDstResource parameters, should have identical sample count values. Example The following code snippet copies a box (located at (120,100),(200,220)) from a source texture into a region (10,20),(90,140) in a destination texture. + /// D3D11_BOX sourceRegion; + /// sourceRegion.left = 120; + /// sourceRegion.right = 200; + /// sourceRegion.top = 100; + /// sourceRegion.bottom = 220; + /// sourceRegion.front = 0; + /// sourceRegion.back = 1; pd3dDeviceContext->CopySubresourceRegion( pDestTexture, 0, 10, 20, 0, pSourceTexture, 0, &sourceRegion ); + /// + /// Notice, that for a 2D texture, front and back are set to 0 and 1 respectively. + /// + /// A reference to the source resource (see ). + /// Source subresource index. + /// A reference to the destination resource (see ). + /// Destination subresource index. + /// The x-coordinate of the upper left corner of the destination region. + /// The y-coordinate of the upper left corner of the destination region. For a 1D subresource, this must be zero. + /// The z-coordinate of the upper left corner of the destination region. For a 1D or 2D subresource, this must be zero. + /// ff476394 + /// void ID3D11DeviceContext::CopySubresourceRegion([In] ID3D11Resource* pDstResource,[In] unsigned int DstSubresource,[In] unsigned int DstX,[In] unsigned int DstY,[In] unsigned int DstZ,[In] ID3D11Resource* pSrcResource,[In] unsigned int SrcSubresource,[In, Optional] const D3D11_BOX* pSrcBox) + /// ID3D11DeviceContext::CopySubresourceRegion + public void Copy(SharpDX.Direct3D11.Resource source, int sourceSubresource, SharpDX.Direct3D11.Resource destination, int destinationSubResource, int dstX = 0, int dstY = 0, int dstZ = 0) + { + Context.CopySubresourceRegion(source, sourceSubresource, null, destination, destinationSubResource, dstX, dstY, dstZ); + } + + /// + /// Copy a region from a source resource to a destination resource. + /// + /// + /// The source box must be within the size of the source resource. The destination offsets, (x, y, and z) allow the source box to be offset when writing into the destination resource; however, the dimensions of the source box and the offsets must be within the size of the resource. If the resources are buffers, all coordinates are in bytes; if the resources are textures, all coordinates are in texels. {{D3D11CalcSubresource}} is a helper function for calculating subresource indexes. CopySubresourceRegion performs the copy on the GPU (similar to a memcpy by the CPU). As a consequence, the source and destination resources: Must be different subresources (although they can be from the same resource). Must be the same type. Must have compatible DXGI formats (identical or from the same type group). For example, a DXGI_FORMAT_R32G32B32_FLOAT texture can be copied to an DXGI_FORMAT_R32G32B32_UINT texture since both of these formats are in the DXGI_FORMAT_R32G32B32_TYPELESS group. May not be currently mapped. CopySubresourceRegion only supports copy; it does not support any stretch, color key, blend, or format conversions. An application that needs to copy an entire resource should use instead. CopySubresourceRegion is an asynchronous call which may be added to the command-buffer queue, this attempts to remove pipeline stalls that may occur when copying data. See performance considerations for more details. Note??If you use CopySubresourceRegion with a depth-stencil buffer or a multisampled resource, you must copy the whole subresource. In this situation, you must pass 0 to the DstX, DstY, and DstZ parameters and NULL to the pSrcBox parameter. In addition, source and destination resources, which are represented by the pSrcResource and pDstResource parameters, should have identical sample count values. Example The following code snippet copies a box (located at (120,100),(200,220)) from a source texture into a region (10,20),(90,140) in a destination texture. + /// D3D11_BOX sourceRegion; + /// sourceRegion.left = 120; + /// sourceRegion.right = 200; + /// sourceRegion.top = 100; + /// sourceRegion.bottom = 220; + /// sourceRegion.front = 0; + /// sourceRegion.back = 1; pd3dDeviceContext->CopySubresourceRegion( pDestTexture, 0, 10, 20, 0, pSourceTexture, 0, &sourceRegion ); + /// + /// Notice, that for a 2D texture, front and back are set to 0 and 1 respectively. + /// + /// A reference to the source resource (see ). + /// Source subresource index. + /// A reference to a 3D box (see ) that defines the source subresources that can be copied. If NULL, the entire source subresource is copied. The box must fit within the source resource. + /// A reference to the destination resource (see ). + /// Destination subresource index. + /// The x-coordinate of the upper left corner of the destination region. + /// The y-coordinate of the upper left corner of the destination region. For a 1D subresource, this must be zero. + /// The z-coordinate of the upper left corner of the destination region. For a 1D or 2D subresource, this must be zero. + /// ff476394 + /// void ID3D11DeviceContext::CopySubresourceRegion([In] ID3D11Resource* pDstResource,[In] unsigned int DstSubresource,[In] unsigned int DstX,[In] unsigned int DstY,[In] unsigned int DstZ,[In] ID3D11Resource* pSrcResource,[In] unsigned int SrcSubresource,[In, Optional] const D3D11_BOX* pSrcBox) + /// ID3D11DeviceContext::CopySubresourceRegion + public void Copy(SharpDX.Direct3D11.Resource source, int sourceSubresource, SharpDX.Direct3D11.ResourceRegion sourceRegion, SharpDX.Direct3D11.Resource destination, int destinationSubResource, int dstX = 0, int dstY = 0, int dstZ = 0) + { + Context.CopySubresourceRegion(source, sourceSubresource, sourceRegion, destination, destinationSubResource, dstX, dstY, dstZ); + } + + /// + /// Copy a multisampled resource into a non-multisampled resource. + /// + /// + /// This API is most useful when re-using the resulting render target of one render pass as an input to a second render pass. The source and destination resources must be the same resource type and have the same dimensions. In addition, they must have compatible formats. There are three scenarios for this: ScenarioRequirements Source and destination are prestructured and typedBoth the source and destination must have identical formats and that format must be specified in the Format parameter. One resource is prestructured and typed and the other is prestructured and typelessThe typed resource must have a format that is compatible with the typeless resource (i.e. the typed resource is DXGI_FORMAT_R32_FLOAT and the typeless resource is DXGI_FORMAT_R32_TYPELESS). The format of the typed resource must be specified in the Format parameter. Source and destination are prestructured and typelessBoth the source and destination must have the same typeless format (i.e. both must have DXGI_FORMAT_R32_TYPELESS), and the Format parameter must specify a format that is compatible with the source and destination (i.e. if both are DXGI_FORMAT_R32_TYPELESS then DXGI_FORMAT_R32_FLOAT could be specified in the Format parameter). For example, given the DXGI_FORMAT_R16G16B16A16_TYPELESS format: The source (or dest) format could be DXGI_FORMAT_R16G16B16A16_UNORM The dest (or source) format could be DXGI_FORMAT_R16G16B16A16_FLOAT ? + /// + /// Source resource. Must be multisampled. + /// >The source subresource of the source resource. + /// Destination resource. Must be a created with the flag and be single-sampled. See . + /// A zero-based index, that identifies the destination subresource. Use {{D3D11CalcSubresource}} to calculate the index. + /// A that indicates how the multisampled resource will be resolved to a single-sampled resource. See remarks. + /// void ID3D11DeviceContext::ResolveSubresource([In] ID3D11Resource* pDstResource,[In] int DstSubresource,[In] ID3D11Resource* pSrcResource,[In] int SrcSubresource,[In] DXGI_FORMAT Format) + public void Copy(SharpDX.Direct3D11.Resource source, int sourceSubresource, SharpDX.Direct3D11.Resource destination, int destinationSubresource, SharpDX.DXGI.Format format) + { + Context.ResolveSubresource(source, sourceSubresource, destination, destinationSubresource, format); + } + + /// + ///

Copies data from a buffer holding variable length data.

+ ///
+ ///

Pointer to an of a Structured Buffer resource created with either or specified when the UAV was created. These types of resources have hidden counters tracking "how many" records have been written.

+ ///

Pointer to . This can be any buffer resource that other copy commands, such as or , are able to write to.

+ ///

Offset from the start of pDstBuffer to write 32-bit UINT structure (vertex) count from pSrcView.

+ /// ff476393 + /// void ID3D11DeviceContext::CopyStructureCount([In] ID3D11Buffer* pDstBuffer,[In] unsigned int DstAlignedByteOffset,[In] ID3D11UnorderedAccessView* pSrcView) + /// ID3D11DeviceContext::CopyStructureCount + public void CopyCount(SharpDX.Direct3D11.UnorderedAccessView sourceView, SharpDX.Direct3D11.Buffer destinationBuffer, int offsetInBytes = 0) + { + Context.CopyStructureCount(destinationBuffer, offsetInBytes, sourceView); + } + + /// + ///

Restore all default settings.

+ ///
+ /// + ///

This method resets any device context to the default settings. This sets all input/output resource slots, shaders, input layouts, predications, scissor rectangles, depth-stencil state, rasterizer state, blend state, sampler state, and viewports to null. The primitive topology is set to UNDEFINED.

For a scenario where you would like to clear a list of commands recorded so far, call and throw away the resulting .

+ ///
+ /// ff476389 + /// void ID3D11DeviceContext::ClearState() + /// ID3D11DeviceContext::ClearState + public void ClearState() + { + Context.ClearState(); + } + + private PrimitiveTopology PrimitiveType + { + set + { + InputAssemblerStage.PrimitiveTopology = value; + } + } + + /// + ///

Draw indexed, non-instanced primitives.

+ ///
+ /// Type of the primitive to draw. + ///

Number of indices to draw.

+ ///

The location of the first index read by the GPU from the index buffer.

+ ///

A value added to each index before reading a vertex from the vertex buffer.

+ /// + ///

A draw API submits work to the rendering pipeline.

If the sum of both indices is negative, the result of the function call is undefined.

+ ///
+ /// ff476409 + /// void ID3D11DeviceContext::DrawIndexed([In] unsigned int IndexCount,[In] unsigned int StartIndexLocation,[In] int BaseVertexLocation) + /// ID3D11DeviceContext::DrawIndexed + public void DrawIndexed(PrimitiveType primitiveType, int indexCount, int startIndexLocation = 0, int baseVertexLocation = 0) + { + SetupInputLayout(); + + PrimitiveType = primitiveType; + Context.DrawIndexed(indexCount, startIndexLocation, baseVertexLocation); + } + + /// + ///

Draw non-indexed, non-instanced primitives.

+ ///
+ /// Type of the primitive to draw. + ///

Number of vertices to draw.

+ ///

Index of the first vertex, which is usually an offset in a vertex buffer; it could also be used as the first vertex id generated for a shader parameter marked with the SV_TargetId system-value semantic.

+ /// + ///

A draw API submits work to the rendering pipeline.

The vertex data for a draw call normally comes from a vertex buffer that is bound to the pipeline. However, you could also provide the vertex data from a shader that has vertex data marked with the SV_VertexId system-value semantic.

+ ///
+ /// ff476407 + /// void ID3D11DeviceContext::Draw([In] unsigned int VertexCount,[In] unsigned int StartVertexLocation) + /// ID3D11DeviceContext::Draw + public void Draw(PrimitiveType primitiveType, int vertexCount, int startVertexLocation = 0) + { + SetupInputLayout(); + + PrimitiveType = primitiveType; + Context.Draw(vertexCount, startVertexLocation); + } + + /// + ///

Draw indexed, instanced primitives.

+ ///
+ /// Type of the primitive to draw. + ///

Number of indices read from the index buffer for each instance.

+ ///

Number of instances to draw.

+ ///

The location of the first index read by the GPU from the index buffer.

+ ///

A value added to each index before reading a vertex from the vertex buffer.

+ ///

A value added to each index before reading per-instance data from a vertex buffer.

+ /// + ///

A draw API submits work to the rendering pipeline.

Instancing may extend performance by reusing the same geometry to draw multiple objects in a scene. One example of instancing could be to draw the same object with different positions and colors. Indexing requires multiple vertex buffers: at least one for per-vertex data and a second buffer for per-instance data.

+ ///
+ /// ff476410 + /// void ID3D11DeviceContext::DrawIndexedInstanced([In] unsigned int IndexCountPerInstance,[In] unsigned int InstanceCount,[In] unsigned int StartIndexLocation,[In] int BaseVertexLocation,[In] unsigned int StartInstanceLocation) + /// ID3D11DeviceContext::DrawIndexedInstanced + public void DrawIndexedInstanced(PrimitiveType primitiveType, int indexCountPerInstance, int instanceCount, int startIndexLocation = 0, int baseVertexLocation = 0, int startInstanceLocation = 0) + { + SetupInputLayout(); + + PrimitiveType = primitiveType; + Context.DrawIndexedInstanced(indexCountPerInstance, instanceCount, startIndexLocation, baseVertexLocation, startInstanceLocation); + } + + /// + ///

Draw non-indexed, instanced primitives.

+ ///
+ /// Type of the primitive to draw. + ///

Number of vertices to draw.

+ ///

Number of instances to draw.

+ ///

Index of the first vertex.

+ ///

A value added to each index before reading per-instance data from a vertex buffer.

+ /// + ///

A draw API submits work to the rendering pipeline.

Instancing may extend performance by reusing the same geometry to draw multiple objects in a scene. One example of instancing could be to draw the same object with different positions and colors.

The vertex data for an instanced draw call normally comes from a vertex buffer that is bound to the pipeline. However, you could also provide the vertex data from a shader that has instanced data identified with a system-value semantic (SV_InstanceID).

+ ///
+ /// ff476412 + /// void ID3D11DeviceContext::DrawInstanced([In] unsigned int VertexCountPerInstance,[In] unsigned int InstanceCount,[In] unsigned int StartVertexLocation,[In] unsigned int StartInstanceLocation) + /// ID3D11DeviceContext::DrawInstanced + public void DrawInstanced(PrimitiveType primitiveType, int vertexCountPerInstance, int instanceCount, int startVertexLocation = 0, int startInstanceLocation = 0) + { + SetupInputLayout(); + + PrimitiveType = primitiveType; + Context.DrawInstanced(vertexCountPerInstance, instanceCount, startVertexLocation, startInstanceLocation); + } + + /// + ///

Draw geometry of an unknown size.

+ ///
+ /// Type of the primitive to draw. + /// + ///

A draw API submits work to the rendering pipeline. This API submits work of an unknown size that was processed by the input assembler, vertex shader, and stream-output stages; the work may or may not have gone through the geometry-shader stage.

After data has been streamed out to stream-output stage buffers, those buffers can be again bound to the Input Assembler stage at input slot 0 and DrawAuto will draw them without the application needing to know the amount of data that was written to the buffers. A measurement of the amount of data written to the SO stage buffers is maintained internally when the data is streamed out. This means that the CPU does not need to fetch the measurement before re-binding the data that was streamed as input data. Although this amount is tracked internally, it is still the responsibility of applications to use input layouts to describe the format of the data in the SO stage buffers so that the layouts are available when the buffers are again bound to the input assembler.

The following diagram shows the DrawAuto process.

Calling DrawAuto does not change the state of the streaming-output buffers that were bound again as inputs.

DrawAuto only works when drawing with one input buffer bound as an input to the IA stage at slot 0. Applications must create the SO buffer resource with both binding flags, and .

This API does not support indexing or instancing.

If an application needs to retrieve the size of the streaming-output buffer, it can query for statistics on streaming output by using .

+ ///
+ /// ff476408 + /// void ID3D11DeviceContext::DrawAuto() + /// ID3D11DeviceContext::DrawAuto + public void DrawAuto(PrimitiveType primitiveType) + { + SetupInputLayout(); + + PrimitiveType = primitiveType; + Context.DrawAuto(); + } + + /// + ///

Draw indexed, instanced, GPU-generated primitives.

+ ///
+ /// Type of the primitive to draw. + ///

A reference to an , which is a buffer containing the GPU generated primitives.

+ ///

Offset in pBufferForArgs to the start of the GPU generated primitives.

+ /// + ///

When an application creates a buffer that is associated with the interface that pBufferForArgs points to, the application must set the flag in the MiscFlags member of the structure that describes the buffer. To create the buffer, the application calls the method and in this call passes a reference to in the pDesc parameter.

+ ///
+ /// ff476411 + /// void ID3D11DeviceContext::DrawIndexedInstancedIndirect([In] ID3D11Buffer* pBufferForArgs,[In] unsigned int AlignedByteOffsetForArgs) + /// ID3D11DeviceContext::DrawIndexedInstancedIndirect + public void DrawIndexedInstanced(PrimitiveType primitiveType, SharpDX.Direct3D11.Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0) + { + SetupInputLayout(); + + PrimitiveType = primitiveType; + Context.DrawIndexedInstancedIndirect(argumentsBuffer, alignedByteOffsetForArgs); + } + + /// + ///

Draw instanced, GPU-generated primitives.

+ ///
+ /// Type of the primitive to draw. + ///

A reference to an , which is a buffer containing the GPU generated primitives.

+ ///

Offset in pBufferForArgs to the start of the GPU generated primitives.

+ /// + ///

When an application creates a buffer that is associated with the interface that pBufferForArgs points to, the application must set the flag in the MiscFlags member of the structure that describes the buffer. To create the buffer, the application calls the method and in this call passes a reference to in the pDesc parameter.

+ ///
+ /// ff476413 + /// void ID3D11DeviceContext::DrawInstancedIndirect([In] ID3D11Buffer* pBufferForArgs,[In] unsigned int AlignedByteOffsetForArgs) + /// ID3D11DeviceContext::DrawInstancedIndirect + public void DrawInstanced(PrimitiveType primitiveType, SharpDX.Direct3D11.Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0) + { + SetupInputLayout(); + + PrimitiveType = primitiveType; + Context.DrawInstancedIndirect(argumentsBuffer, alignedByteOffsetForArgs); + } + + /// + ///

Execute a command list from a thread group.

+ ///
+ ///

The number of groups dispatched in the x direction. ThreadGroupCountX must be less than (65535).

+ ///

The number of groups dispatched in the y direction. ThreadGroupCountY must be less than (65535).

+ ///

The number of groups dispatched in the z direction. ThreadGroupCountZ must be less than (65535). In feature level 10 the value for ThreadGroupCountZ must be 1.

+ /// + ///

You call the Dispatch method to execute commands in a compute shader. A compute shader can be run on many threads in parallel, within a thread group. Index a particular thread, within a thread group using a 3D vector given by (x,y,z).

In the following illustration, assume a thread group with 50 threads where the size of the group is given by (5,5,2). A single thread is identified from a thread group with 50 threads in it, using the vector (4,1,1).

The following illustration shows the relationship between the parameters passed to , Dispatch(5,3,2), the values specified in the numthreads attribute, numthreads(10,8,3), and values that will passed to the compute shader for the thread-related system values + /// (SV_GroupIndex,SV_DispatchThreadID,SV_GroupThreadID,SV_GroupID).

+ ///
+ /// ff476405 + /// void ID3D11DeviceContext::Dispatch([In] unsigned int ThreadGroupCountX,[In] unsigned int ThreadGroupCountY,[In] unsigned int ThreadGroupCountZ) + /// ID3D11DeviceContext::Dispatch + public void Dispatch(int threadGroupCountX, int threadGroupCountY, int threadGroupCountZ) + { + Context.Dispatch(threadGroupCountX, threadGroupCountY, threadGroupCountZ); + } + + /// + ///

Execute a command list over one or more thread groups.

+ ///
+ ///

A reference to an , which must be loaded with data that matches the argument list for .

+ ///

A byte-aligned offset between the start of the buffer and the arguments.

+ /// + ///

You call the DispatchIndirect method to execute commands in a compute shader.

When an application creates a buffer that is associated with the interface that pBufferForArgs points to, the application must set the flag in the MiscFlags member of the structure that describes the buffer. To create the buffer, the application calls the method and in this call passes a reference to in the pDesc parameter.

+ ///
+ /// ff476406 + /// void ID3D11DeviceContext::DispatchIndirect([In] ID3D11Buffer* pBufferForArgs,[In] unsigned int AlignedByteOffsetForArgs) + /// ID3D11DeviceContext::DispatchIndirect + public void Dispatch(SharpDX.Direct3D11.Buffer argumentsBuffer, int alignedByteOffsetForArgs = 0) + { + Context.DispatchIndirect(argumentsBuffer, alignedByteOffsetForArgs); + } + + /// + ///

Sends queued-up commands in the command buffer to the graphics processing unit (GPU).

+ ///
+ /// + ///

Most applications don't need to call this method. If an application calls this method when not necessary, it incurs a performance penalty. Each call to Flush incurs a significant amount of overhead.

When Microsoft Direct3D state-setting, present, or draw commands are called by an application, those commands are queued into an internal command buffer. Flush sends those commands to the GPU for processing. Typically, the Direct3D runtime sends these commands to the GPU automatically whenever the runtime determines that they need to be sent, such as when the command buffer is full or when an application maps a resource. Flush sends the commands manually.

We recommend that you use Flush when the CPU waits for an arbitrary amount of time (such as when you call the Sleep function).

Because Flush operates asynchronously, it can return either before or after the GPU finishes executing the queued graphics commands. However, the graphics commands eventually always complete. You can call the method with the value to create an event query; you can then use that event query in a call to the method to determine when the GPU is finished processing the graphics commands. + ///

Microsoft Direct3D?11 defers the destruction of objects. Therefore, an application can't rely upon objects immediately being destroyed. By calling Flush, you destroy any objects whose destruction was deferred. If an application requires synchronous destruction of an object, we recommend that the application release all its references, call , and then call Flush.

Deferred Destruction Issues with Flip Presentation Swap Chains

Direct3D?11 defers the destruction of objects like views and resources until it can efficiently destroy them. This deferred destruction can cause problems with flip presentation model swap chains. Flip presentation model swap chains have the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL flag set. When you create a flip presentation model swap chain, you can associate only one swap chain at a time with an , IWindow, or composition surface. If an application attempts to destroy a flip presentation model swap chain and replace it with another swap chain, the original swap chain is not destroyed when the application immediately frees all of the original swap chain's references.

Most applications typically use the method for the majority of scenarios where they replace new swap chain buffers for old swap chain buffers. However, if an application must actually destroy an old swap chain and create a new swap chain, the application must force the destruction of all objects that the application freed. To force the destruction, call (or otherwise ensure no views are bound to pipeline state), and then call Flush on the immediate context. You must force destruction before you call IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForImmersiveWindow, or IDXGIFactory2::CreateSwapChainForCompositionSurface again to create a new swap chain.

+ ///
+ /// ff476425 + /// void ID3D11DeviceContext::Flush() + /// ID3D11DeviceContext::Flush + public void Flush() + { + Context.Flush(); + } + + /// + /// Creates a new from an existing . + /// + /// An existing device. + /// A new instance of . + public static GraphicsDevice New(SharpDX.Direct3D11.Device existingDevice) + { + return new GraphicsDevice(existingDevice); + } + + /// + /// Creates a new using . + /// + /// The flags. + /// The feature levels. + /// A new instance of + public static GraphicsDevice New(DeviceCreationFlags flags = DeviceCreationFlags.None, params FeatureLevel[] featureLevels) + { + return New(DriverType.Hardware, flags, featureLevels); + } + + /// + /// Creates a new . + /// + /// The type. + /// The flags. + /// The feature levels. + /// A new instance of . + public static GraphicsDevice New(DriverType type, DeviceCreationFlags flags = DeviceCreationFlags.None, params FeatureLevel[] featureLevels) + { + if (type == DriverType.Hardware) + return new GraphicsDevice(GraphicsAdapter.Default, flags, featureLevels); + + return new GraphicsDevice(type, flags, featureLevels); + } + + /// + /// Creates a new . + /// + /// The graphics adapter to use. + /// The flags. + /// The feature levels. + /// A new instance of . + public static GraphicsDevice New(GraphicsAdapter adapter, DeviceCreationFlags flags = DeviceCreationFlags.None, params FeatureLevel[] featureLevels) + { + return new GraphicsDevice(adapter, flags, featureLevels); + } + + /// + /// Creates a new deferred . + /// + /// A deferred . + public GraphicsDevice NewDeferred() + { + return new GraphicsDevice(this, new DeviceContext(Device)); + } + + /// + ///

Sets the blend state of the output-merger stage.

+ ///
+ ///

Pointer to a blend-state interface (see ). Passing in null implies a default blend state. See remarks for further details.

+ /// + ///

Blend state is used by the output-merger stage to determine how to blend together two pixel values. The two values are commonly the current pixel value and the pixel value already in the output render target. Use the blend operation to control where the two pixel values come from and how they are mathematically combined.

To create a blend-state interface, call .

Passing in null for the blend-state interface indicates to the runtime to set a default blending state. The following table indicates the default blending parameters.

StateDefault Value
AlphaToCoverageEnable
BlendEnable[8]
SrcBlend
DstBlend
BlendOp
SrcBlendAlpha
DstBlendAlpha
BlendOpAlpha
RenderTargetWriteMask[8][8]

?

A sample mask determines which samples get updated in all the active render targets. The mapping of bits in a sample mask to samples in a multisample render target is the responsibility of an individual application. A sample mask is always applied; it is independent of whether multisampling is enabled, and does not depend on whether an application uses multisample render targets.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

+ ///
+ /// ff476462 + /// void ID3D11DeviceContext::OMSetBlendState([In, Optional] ID3D11BlendState* pBlendState,[In, Optional] const SHARPDX_COLOR4* BlendFactor,[In] unsigned int SampleMask) + /// ID3D11DeviceContext::OMSetBlendState + public void SetBlendState(BlendState blendState) + { + if (blendState == null) + { + OutputMergerStage.SetBlendState(null, Color.White, -1); + } + else + { + OutputMergerStage.SetBlendState(blendState, blendState.BlendFactor, blendState.MultiSampleMask); + } + } + + /// + ///

Sets the blend state of the output-merger stage.

+ ///
+ ///

Pointer to a blend-state interface (see ). Passing in null implies a default blend state. See remarks for further details.

+ ///

Array of blend factors, one for each RGBA component. This requires a blend state object that specifies the option.

+ ///

32-bit sample coverage. The default value is 0xffffffff. See remarks.

+ /// + ///

Blend state is used by the output-merger stage to determine how to blend together two pixel values. The two values are commonly the current pixel value and the pixel value already in the output render target. Use the blend operation to control where the two pixel values come from and how they are mathematically combined.

To create a blend-state interface, call .

Passing in null for the blend-state interface indicates to the runtime to set a default blending state. The following table indicates the default blending parameters.

StateDefault Value
AlphaToCoverageEnable
BlendEnable[8]
SrcBlend
DstBlend
BlendOp
SrcBlendAlpha
DstBlendAlpha
BlendOpAlpha
RenderTargetWriteMask[8][8]

?

A sample mask determines which samples get updated in all the active render targets. The mapping of bits in a sample mask to samples in a multisample render target is the responsibility of an individual application. A sample mask is always applied; it is independent of whether multisampling is enabled, and does not depend on whether an application uses multisample render targets.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

+ ///
+ /// ff476462 + /// void ID3D11DeviceContext::OMSetBlendState([In, Optional] ID3D11BlendState* pBlendState,[In, Optional] const SHARPDX_COLOR4* BlendFactor,[In] unsigned int SampleMask) + /// ID3D11DeviceContext::OMSetBlendState + public void SetBlendState(BlendState blendState, Color4 blendFactor, int multiSampleMask = -1) + { + if (blendState == null) + { + OutputMergerStage.SetBlendState(null, blendFactor, multiSampleMask); + } + else + { + OutputMergerStage.SetBlendState(blendState, blendFactor, multiSampleMask); + } + } + + /// + ///

Sets the blend state of the output-merger stage.

+ ///
+ ///

Pointer to a blend-state interface (see ). Passing in null implies a default blend state. See remarks for further details.

+ ///

Array of blend factors, one for each RGBA component. This requires a blend state object that specifies the option.

+ ///

32-bit sample coverage. The default value is 0xffffffff. See remarks.

+ /// + ///

Blend state is used by the output-merger stage to determine how to blend together two pixel values. The two values are commonly the current pixel value and the pixel value already in the output render target. Use the blend operation to control where the two pixel values come from and how they are mathematically combined.

To create a blend-state interface, call .

Passing in null for the blend-state interface indicates to the runtime to set a default blending state. The following table indicates the default blending parameters.

StateDefault Value
AlphaToCoverageEnable
BlendEnable[8]
SrcBlend
DstBlend
BlendOp
SrcBlendAlpha
DstBlendAlpha
BlendOpAlpha
RenderTargetWriteMask[8][8]

?

A sample mask determines which samples get updated in all the active render targets. The mapping of bits in a sample mask to samples in a multisample render target is the responsibility of an individual application. A sample mask is always applied; it is independent of whether multisampling is enabled, and does not depend on whether an application uses multisample render targets.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

+ ///
+ /// ff476462 + /// void ID3D11DeviceContext::OMSetBlendState([In, Optional] ID3D11BlendState* pBlendState,[In, Optional] const SHARPDX_COLOR4* BlendFactor,[In] unsigned int SampleMask) + /// ID3D11DeviceContext::OMSetBlendState + public void SetBlendState(BlendState blendState, Color4 blendFactor, uint multiSampleMask = 0xFFFFFFFF) + { + SetBlendState(blendState, blendFactor, unchecked((int)multiSampleMask)); + } + + /// + /// Sets the depth-stencil state of the output-merger stage. + /// + ///

Pointer to a depth-stencil state interface (see ) to bind to the device. Set this to null to use the default state listed in .

+ ///

Reference value to perform against when doing a depth-stencil test. See remarks.

+ /// + ///

To create a depth-stencil state interface, call .

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

+ ///
+ /// ff476463 + /// void ID3D11DeviceContext::OMSetDepthStencilState([In, Optional] ID3D11DepthStencilState* pDepthStencilState,[In] unsigned int StencilRef) + /// ID3D11DeviceContext::OMSetDepthStencilState + public void SetDepthStencilState(DepthStencilState depthStencilState, int stencilReference = 0) + { + OutputMergerStage.SetDepthStencilState(depthStencilState, stencilReference); + } + + /// + ///

Sets the rasterizer state for the rasterizer stage of the pipeline.

+ ///
+ /// The rasterizer state to set on this device. + /// ff476479 + /// void ID3D11DeviceContext::RSSetState([In, Optional] ID3D11RasterizerState* pRasterizerState) + /// ID3D11DeviceContext::RSSetState + public void SetRasterizerState(RasterizerState rasterizerState) + { + RasterizerStage.State = rasterizerState; + } + + /// + /// Binds a single scissor rectangle to the rasterizer stage. + /// + /// The left. + /// The top. + /// The right. + /// The bottom. + /// + ///

All scissor rects must be set atomically as one operation. Any scissor rects not defined by the call are disabled.

The scissor rectangles will only be used if ScissorEnable is set to true in the rasterizer state (see ).

Which scissor rectangle to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader (see shader semantic syntax). If a geometry shader does not make use of the SV_ViewportArrayIndex semantic then Direct3D will use the first scissor rectangle in the array.

Each scissor rectangle in the array corresponds to a viewport in an array of viewports (see ).

+ ///
+ /// ff476478 + /// void ID3D11DeviceContext::RSSetScissorRects([In] unsigned int NumRects,[In, Buffer, Optional] const void* pRects) + /// ID3D11DeviceContext::RSSetScissorRects + public void SetScissorRectangles(int left, int top, int right, int bottom) + { + RasterizerStage.SetScissorRectangle(left, top, right, bottom); + } + + /// + /// Binds a set of scissor rectangles to the rasterizer stage. + /// + /// The set of scissor rectangles to bind. + /// + ///

All scissor rects must be set atomically as one operation. Any scissor rects not defined by the call are disabled.

The scissor rectangles will only be used if ScissorEnable is set to true in the rasterizer state (see ).

Which scissor rectangle to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader (see shader semantic syntax). If a geometry shader does not make use of the SV_ViewportArrayIndex semantic then Direct3D will use the first scissor rectangle in the array.

Each scissor rectangle in the array corresponds to a viewport in an array of viewports (see ).

+ ///
+ /// ff476478 + /// void ID3D11DeviceContext::RSSetScissorRects([In] unsigned int NumRects,[In, Buffer, Optional] const void* pRects) + /// ID3D11DeviceContext::RSSetScissorRects + public void SetScissorRectangles(params Rectangle[] scissorRectangles) + { + RasterizerStage.SetScissorRectangles(scissorRectangles); + } + + /// + /// Gets the main viewport. + /// + /// The main viewport. + public ViewportF Viewport + { + get + { + RasterizerStage.GetViewports(viewports); + return viewports[0]; + } + + set + { + SetViewport(value); + } + } + + /// + /// Gets the viewport. + /// + /// The index. + /// Returns a viewport bound to a specified render target + public ViewportF GetViewport(int index) + { + RasterizerStage.GetViewports(viewports); + return viewports[index]; + } + + /// + /// Binds a single viewport to the rasterizer stage. + /// + /// The x coordinate of the viewport. + /// The y coordinate of the viewport. + /// The width. + /// The height. + /// The min Z. + /// The max Z. + /// + ///

All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.

Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.

+ ///
+ /// ff476480 + /// void ID3D11DeviceContext::RSSetViewports([In] unsigned int NumViewports,[In, Buffer, Optional] const void* pViewports) + /// ID3D11DeviceContext::RSSetViewports + public void SetViewport(float x, float y, float width, float height, float minZ = 0.0f, float maxZ = 1.0f) + { + viewports[0] = new ViewportF(x, y, width, height, minZ, maxZ); + RasterizerStage.SetViewport(x, y, width, height, minZ, maxZ); + } + + /// + /// Binds a single viewport to the rasterizer stage. + /// + /// The viewport. + /// + ///

All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.

Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.

+ ///
+ /// ff476480 + /// void ID3D11DeviceContext::RSSetViewports([In] unsigned int NumViewports,[In, Buffer, Optional] const void* pViewports) + /// ID3D11DeviceContext::RSSetViewports + public void SetViewport(ViewportF viewport) + { + viewports[0] = viewport; + RasterizerStage.SetViewport(viewport); + } + + /// + /// Binds a set of viewports to the rasterizer stage. + /// + /// The set of viewports to bind. + /// + ///

All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.

Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.

+ ///
+ /// ff476480 + /// void ID3D11DeviceContext::RSSetViewports([In] unsigned int NumViewports,[In, Buffer, Optional] const void* pViewports) + /// ID3D11DeviceContext::RSSetViewports + public void SetViewports(params ViewportF[] viewports) + { + for (int i = 0; i < viewports.Length; i++) + this.viewports[i] = viewports[i]; + + // NOTE SmartK8 : Calls internal method + MethodInfo setShaderResources = RasterizerStage.GetType().GetMethod("SetViewports", BindingFlags.NonPublic | BindingFlags.Instance); + setShaderResources.Invoke(RasterizerStage, new Object[] { viewports.Length, Marshal.UnsafeAddrOfPinnedArrayElement(viewports, 0) }); + } + + /// + /// Unbinds all depth-stencil buffer and render targets from the output-merger stage. + /// + /// ff476464 + /// void ID3D11DeviceContext::OMSetRenderTargets([In] unsigned int NumViews,[In] const void** ppRenderTargetViews,[In, Optional] ID3D11DepthStencilView* pDepthStencilView) + /// ID3D11DeviceContext::OMSetRenderTargets + public void ResetTargets() + { + for (int i = 0; i < currentRenderTargetViews.Length; i++) + currentRenderTargetViews[i] = null; + actualRenderTargetViewCount = 0; + currentRenderTargetView = null; + currentDepthStencilView = null; + OutputMergerStage.ResetTargets(); + } + + /// + /// Gets the render targets currently bound to the through this instance. + /// + /// The depth stencil view, may ne null. + /// An array of . + public RenderTargetView[] GetRenderTargets(out DepthStencilView depthStencilViewRef) + { + var renderTargets = new RenderTargetView[actualRenderTargetViewCount]; + for (int i = 0; i < actualRenderTargetViewCount; i++) + renderTargets[i] = currentRenderTargetViews[i]; + depthStencilViewRef = currentDepthStencilView; + return renderTargets; + } + + /// + ///

Bind one or more render targets atomically and the depth-stencil buffer to the output-merger stage.

+ ///
+ /// A set of render target views to bind. + /// + ///

The maximum number of active render targets a device can have active at any given time is set by a #define in D3D11.h called D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT. It is invalid to try to set the same subresource to multiple render target slots. Any render targets not defined by this call are set to null.

If any subresources are also currently bound for reading in a different stage or writing (perhaps in a different part of the pipeline), those bind points will be set to null, in order to prevent the same subresource from being read and written simultaneously in a single rendering operation.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

If the render-target views were created from an array resource type, then all of the render-target views must have the same array size. This restriction also applies to the depth-stencil view, its array size must match that of the render-target views being bound.

The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.

Any combination of the eight slots for render targets can have a render target set or not set.

The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.

+ ///
+ /// ff476464 + /// void ID3D11DeviceContext::OMSetRenderTargets([In] unsigned int NumViews,[In] const void** ppRenderTargetViews,[In, Optional] ID3D11DepthStencilView* pDepthStencilView) + /// ID3D11DeviceContext::OMSetRenderTargets + public void SetRenderTargets(params RenderTargetView[] renderTargetViews) + { + if (renderTargetViews == null) + { + throw new ArgumentNullException("renderTargetViews"); + } + + CommonSetRenderTargets(renderTargetViews); + currentDepthStencilView = null; + OutputMergerStage.SetTargets(renderTargetViews); + } + + /// + /// Binds a single render target to the output-merger stage. + /// + /// A view of the render target to bind. + /// + ///

The maximum number of active render targets a device can have active at any given time is set by a #define in D3D11.h called D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT. It is invalid to try to set the same subresource to multiple render target slots. Any render targets not defined by this call are set to null.

If any subresources are also currently bound for reading in a different stage or writing (perhaps in a different part of the pipeline), those bind points will be set to null, in order to prevent the same subresource from being read and written simultaneously in a single rendering operation.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

If the render-target views were created from an array resource type, then all of the render-target views must have the same array size. This restriction also applies to the depth-stencil view, its array size must match that of the render-target views being bound.

The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.

Any combination of the eight slots for render targets can have a render target set or not set.

The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.

+ ///
+ /// ff476464 + /// void ID3D11DeviceContext::OMSetRenderTargets([In] unsigned int NumViews,[In] const void** ppRenderTargetViews,[In, Optional] ID3D11DepthStencilView* pDepthStencilView) + /// ID3D11DeviceContext::OMSetRenderTargets + public void SetRenderTargets(RenderTargetView renderTargetView) + { + CommonSetRenderTargets(renderTargetView); + currentDepthStencilView = null; + OutputMergerStage.SetTargets(renderTargetView); + } + + /// + /// Binds a depth-stencil buffer and a set of render targets to the output-merger stage. + /// + /// A view of the depth-stencil buffer to bind. + /// A set of render target views to bind. + /// + ///

The maximum number of active render targets a device can have active at any given time is set by a #define in D3D11.h called D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT. It is invalid to try to set the same subresource to multiple render target slots. Any render targets not defined by this call are set to null.

If any subresources are also currently bound for reading in a different stage or writing (perhaps in a different part of the pipeline), those bind points will be set to null, in order to prevent the same subresource from being read and written simultaneously in a single rendering operation.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

If the render-target views were created from an array resource type, then all of the render-target views must have the same array size. This restriction also applies to the depth-stencil view, its array size must match that of the render-target views being bound.

The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.

Any combination of the eight slots for render targets can have a render target set or not set.

The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.

+ ///
+ /// ff476464 + /// void ID3D11DeviceContext::OMSetRenderTargets([In] unsigned int NumViews,[In] const void** ppRenderTargetViews,[In, Optional] ID3D11DepthStencilView* pDepthStencilView) + /// ID3D11DeviceContext::OMSetRenderTargets + public void SetRenderTargets(DepthStencilView depthStencilView, params RenderTargetView[] renderTargetViews) + { + if (renderTargetViews == null) + { + throw new ArgumentNullException("renderTargetViews"); + } + + CommonSetRenderTargets(renderTargetViews); + currentDepthStencilView = depthStencilView; + OutputMergerStage.SetTargets(depthStencilView, renderTargetViews); + } + + /// + /// Binds a depth-stencil buffer and a single render target to the output-merger stage. + /// + /// A view of the depth-stencil buffer to bind. + /// A view of the render target to bind. + /// + ///

The maximum number of active render targets a device can have active at any given time is set by a #define in D3D11.h called D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT. It is invalid to try to set the same subresource to multiple render target slots. Any render targets not defined by this call are set to null.

If any subresources are also currently bound for reading in a different stage or writing (perhaps in a different part of the pipeline), those bind points will be set to null, in order to prevent the same subresource from being read and written simultaneously in a single rendering operation.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

If the render-target views were created from an array resource type, then all of the render-target views must have the same array size. This restriction also applies to the depth-stencil view, its array size must match that of the render-target views being bound.

The pixel shader must be able to simultaneously render to at least eight separate render targets. All of these render targets must access the same type of resource: Buffer, Texture1D, Texture1DArray, Texture2D, Texture2DArray, Texture3D, or TextureCube. All render targets must have the same size in all dimensions (width and height, and depth for 3D or array size for *Array types). If render targets use multisample anti-aliasing, all bound render targets and depth buffer must be the same form of multisample resource (that is, the sample counts must be the same). Each render target can have a different data format. These render target formats are not required to have identical bit-per-element counts.

Any combination of the eight slots for render targets can have a render target set or not set.

The same resource view cannot be bound to multiple render target slots simultaneously. However, you can set multiple non-overlapping resource views of a single resource as simultaneous multiple render targets.

+ ///
+ /// ff476464 + /// void ID3D11DeviceContext::OMSetRenderTargets([In] unsigned int NumViews,[In] const void** ppRenderTargetViews,[In, Optional] ID3D11DepthStencilView* pDepthStencilView) + /// ID3D11DeviceContext::OMSetRenderTargets + public void SetRenderTargets(DepthStencilView depthStencilView, RenderTargetView renderTargetView) + { + CommonSetRenderTargets(renderTargetView); + currentDepthStencilView = depthStencilView; + OutputMergerStage.SetTargets(depthStencilView, renderTargetView); + } + + /// + /// Resets the stream output targets bound to the StreamOutput stage. + /// + /// ff476484 + /// void ID3D11DeviceContext::SOSetTargets([In] unsigned int NumBuffers,[In, Buffer, Optional] const ID3D11Buffer** ppSOTargets,[In, Buffer, Optional] const unsigned int* pOffsets) + /// ID3D11DeviceContext::SOSetTargets + public void ResetStreamOutputTargets() + { + // NOTE SmartK8 : Verify functionality + Context.StreamOutput.SetTargets(null); + } + + /// + /// Sets the stream output targets bound to the StreamOutput stage. + /// + /// The buffer to bind on the first stream output slot. + /// The offsets in bytes of the buffer. An offset of -1 will cause the stream output buffer to be appended, continuing after the last location written to the buffer in a previous stream output pass. + /// ff476484 + /// void ID3D11DeviceContext::SOSetTargets([In] unsigned int NumBuffers,[In, Buffer, Optional] const ID3D11Buffer** ppSOTargets,[In, Buffer, Optional] const unsigned int* pOffsets) + /// ID3D11DeviceContext::SOSetTargets + public unsafe void SetStreamOutputTarget(Buffer buffer, int offsets = -1) + { + Context.StreamOutput.SetTarget(buffer, offsets); + } + + /// + /// Sets the stream output targets bound to the StreamOutput stage. + /// + /// The buffers. + /// ff476484 + /// void ID3D11DeviceContext::SOSetTargets([In] unsigned int NumBuffers,[In, Buffer, Optional] const ID3D11Buffer** ppSOTargets,[In, Buffer, Optional] const unsigned int* pOffsets) + /// ID3D11DeviceContext::SOSetTargets + public void SetStreamOutputTargets(params StreamOutputBufferBinding[] buffers) + { + Context.StreamOutput.SetTargets(buffers); + } + + /// + ///

Bind an index buffer to the input-assembler stage.

+ ///
+ ///

A reference to an object, that contains indices. The index buffer must have been created with the flag.

+ /// Set to true if indices are 32-bit values (integer size) or false if they are 16-bit values (short size) + /// Offset (in bytes) from the start of the index buffer to the first index to use. Default to 0 + /// + ///

For information about creating index buffers, see How to: Create an Index Buffer.

Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind null instead because a buffer cannot be bound as both an input and an output at the same time.

The debug layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

+ ///
+ /// ff476453 + /// void ID3D11DeviceContext::IASetIndexBuffer([In, Optional] ID3D11Buffer* pIndexBuffer,[In] DXGI_FORMAT Format,[In] unsigned int Offset) + /// ID3D11DeviceContext::IASetIndexBuffer + public void SetIndexBuffer(Buffer indexBuffer, bool is32Bit, int offset = 0) + { + InputAssemblerStage.SetIndexBuffer(indexBuffer, is32Bit ? DXGI.Format.R32_UInt : DXGI.Format.R16_UInt, offset); + } + + /// + /// Sets the vertex input layout. + /// + /// The input layout. + /// ff476454 + /// void ID3D11DeviceContext::IASetInputLayout([In, Optional] ID3D11InputLayout* pInputLayout) + /// ID3D11DeviceContext::IASetInputLayout + public void SetVertexInputLayout(VertexInputLayout inputLayout) + { + currentVertexInputLayout = inputLayout; + } + + /// + /// Bind a vertex buffer on the slot #0 of the input-assembler stage. + /// + /// The vertex buffer to bind to this slot. This vertex buffer must have been created with the flag. + /// The index is the number of vertex element between the first element of a vertex buffer and the first element that will be used. + /// + ///

For information about creating vertex buffers, see Create a Vertex Buffer.

Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind null instead because a buffer cannot be bound as both an input and an output at the same time.

The debug layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

+ ///
+ /// ff476456 + /// void ID3D11DeviceContext::IASetVertexBuffers([In] unsigned int StartSlot,[In] unsigned int NumBuffers,[In, Buffer] const void* ppVertexBuffers,[In, Buffer] const void* pStrides,[In, Buffer] const void* pOffsets) + /// ID3D11DeviceContext::IASetVertexBuffers + public void SetVertexBuffer(Buffer vertexBuffer, int vertexIndex = 0) where T : struct + { + SetVertexBuffer(0, vertexBuffer, vertexIndex); + } + + /// + /// Bind a vertex buffer to the input-assembler stage. + /// + /// The first input slot for binding. + /// The vertex buffer to bind to this slot. This vertex buffer must have been created with the flag. + /// The index is the number of vertex element between the first element of a vertex buffer and the first element that will be used. + /// + ///

For information about creating vertex buffers, see Create a Vertex Buffer.

Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind null instead because a buffer cannot be bound as both an input and an output at the same time.

The debug layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

+ ///
+ /// ff476456 + /// void ID3D11DeviceContext::IASetVertexBuffers([In] unsigned int StartSlot,[In] unsigned int NumBuffers,[In, Buffer] const void* ppVertexBuffers,[In, Buffer] const void* pStrides,[In, Buffer] const void* pOffsets) + /// ID3D11DeviceContext::IASetVertexBuffers + public unsafe void SetVertexBuffer(int slot, Buffer vertexBuffer, int vertexIndex = 0) where T : struct + { + IntPtr vertexBufferPtr = IntPtr.Zero; + int stride = Utilities.SizeOf(); + int offset = vertexIndex * stride; + if (vertexBuffer != null) + { + vertexBufferPtr = ((Direct3D11.Buffer)vertexBuffer).NativePointer; + + // Update the index of the last slot buffer bounded, used by ResetVertexBuffers + if ((slot + 1) > maxSlotCountForVertexBuffer) + maxSlotCountForVertexBuffer = slot + 1; + } + InputAssemblerStage.SetVertexBuffers(slot, 1, new IntPtr(&vertexBufferPtr), new IntPtr(&stride), new IntPtr(&offset)); + } + + /// + ///

Bind a vertex buffer to the input-assembler stage.

+ ///
+ /// The first input slot for binding. + /// The vertex buffer to bind to this slot. This vertex buffer must have been created with the flag. + /// The vertexStride is the size (in bytes) of the elements that are to be used from that vertex buffer. + /// The offset is the number of bytes between the first element of a vertex buffer and the first element that will be used. + /// + ///

For information about creating vertex buffers, see Create a Vertex Buffer.

Calling this method using a buffer that is currently bound for writing (i.e. bound to the stream output pipeline stage) will effectively bind null instead because a buffer cannot be bound as both an input and an output at the same time.

The debug layer will generate a warning whenever a resource is prevented from being bound simultaneously as an input and an output, but this will not prevent invalid data from being used by the runtime.

The method will hold a reference to the interfaces passed in. This differs from the device state behavior in Direct3D 10.

+ ///
+ /// ff476456 + /// void ID3D11DeviceContext::IASetVertexBuffers([In] unsigned int StartSlot,[In] unsigned int NumBuffers,[In, Buffer] const void* ppVertexBuffers,[In, Buffer] const void* pStrides,[In, Buffer] const void* pOffsets) + /// ID3D11DeviceContext::IASetVertexBuffers + public unsafe void SetVertexBuffer(int slot, SharpDX.Direct3D11.Buffer vertexBuffer, int vertexStride, int offsetInBytes = 0) + { + IntPtr vertexBufferPtr = IntPtr.Zero; + if (vertexBuffer != null) + { + vertexBufferPtr = vertexBuffer.NativePointer; + + // Update the index of the last slot buffer bounded, used by ResetVertexBuffers + if ((slot + 1) > maxSlotCountForVertexBuffer) + maxSlotCountForVertexBuffer = slot + 1; + } + InputAssemblerStage.SetVertexBuffers(slot, 1, new IntPtr(&vertexBufferPtr), new IntPtr(&vertexStride), new IntPtr(&offsetInBytes)); + } + + /// + /// Resets all vertex buffers bounded to a slot range. By default, It clears all the bounded buffers. See remarks. + /// + /// + /// This is sometimes required to unding explicitly vertex buffers bounding to the input shader assembly, when a + /// vertex buffer is used as the output of the pipeline. + /// + /// ff476456 + /// void ID3D11DeviceContext::IASetVertexBuffers([In] unsigned int StartSlot,[In] unsigned int NumBuffers,[In, Buffer] const void* ppVertexBuffers,[In, Buffer] const void* pStrides,[In, Buffer] const void* pOffsets) + /// ID3D11DeviceContext::IASetVertexBuffers + public void ResetVertexBuffers() + { + if (maxSlotCountForVertexBuffer == 0) + return; + + // NOTE SmartK8: Verify functionality + InputAssemblerStage.SetVertexBuffers(0); + + maxSlotCountForVertexBuffer = 0; + } + + /// + /// Presents the Backbuffer to the screen. + /// + /// + /// This method is only working if a is set on this device using property. + /// + /// bb174576 + /// HRESULT IDXGISwapChain::Present([In] unsigned int SyncInterval,[In] DXGI_PRESENT_FLAGS Flags) + /// IDXGISwapChain::Present + public void Present() + { + if (IsDeferred) + throw new InvalidOperationException("Cannot use Present on a deferred context"); + + if (Presenter != null) + { + try + { + Presenter.Present(); + } + catch (SharpDXException ex) + { + if (ex.ResultCode == DXGI.ResultCode.DeviceReset || ex.ResultCode == DXGI.ResultCode.DeviceRemoved) + { + // TODO: Implement device reset / removed + } + throw; + } + + } + } + + /// + /// Remove all shaders bounded to each stage. + /// + public void ResetShaderStages() + { + foreach (var commonShaderStage in ShaderStages) + { + commonShaderStage.SetShader(null, null, 0); + } + } + + public static implicit operator Device(GraphicsDevice from) + { + return from == null ? null : from.Device; + } + + public static implicit operator DeviceContext(GraphicsDevice from) + { + return from == null ? null : from.Context; + } + + private void SetupInputLayout() + { + if (CurrentPass == null) + throw new InvalidOperationException("Cannot perform a Draw/Dispatch operation without an EffectPass applied."); + + var inputLayout = CurrentPass.GetInputLayout(currentVertexInputLayout); + InputAssemblerStage.InputLayout = inputLayout; // NOTE SmartK8: Verify functionality + } + + /// + /// A delegate called to create shareable data. See remarks. + /// + /// Type of the data to create. + /// A new instance of the data to share. + /// + /// Because this method is being called from a lock region, this method should not be time consuming. + /// + public delegate T CreateSharedData() where T : IDisposable; + + /// + /// Gets a shared data for this device context with a delegate to create the shared data if it is not present. + /// + /// Type of the shared data to get/create. + /// Type of the data to share. + /// The key of the shared data. + /// The shared data creator. + /// An instance of the shared data. The shared data will be disposed by this instance. + public T GetOrCreateSharedData(SharedDataType type, object key, CreateSharedData sharedDataCreator) where T : IDisposable + { + var dictionary = (type == SharedDataType.PerDevice) ? sharedDataPerDevice : sharedDataPerDeviceContext; + + lock (dictionary) + { + object localValue; + if (!dictionary.TryGetValue(key, out localValue)) + { + localValue = ToDispose(sharedDataCreator()); + dictionary.Add(key, localValue); + } + return (T)localValue; + } + } + + protected override void Dispose(bool disposeManagedResources) + { + if (disposeManagedResources) + { + if (Presenter != null) + { + + // Invalid for WinRT - throwing a "Value does not fall within the expected range" Exception +#if !WIN8METRO + // Make sure that the Presenter is reverted to window before shutting down + // otherwise the Direct3D11.Device will generate an exception on Dispose() + Presenter.IsFullScreen = false; +#endif + Presenter.Dispose(); + Presenter = null; + } + + // effect pools will be disposed only by the master graphics device + if(!IsDeferred) + { + // dispose EffectPools in reverse order as they will remove themselves from the list + for(var i = EffectPools.Count - 1; i >= 0; i--) + { + EffectPools[i].Dispose(); + } + + EffectPools = null; + } + } + + base.Dispose(disposeManagedResources); + } + + + /// + /// Gets or create an input signature manager for a particular signature. + /// + /// The signature bytecode. + /// The signature hashcode. + /// + internal InputSignatureManager GetOrCreateInputSignatureManager(byte[] signatureBytecode, int signatureHashcode) + { + var key = new InputSignatureKey(signatureBytecode, signatureHashcode); + + InputSignatureManager signatureManager; + + // Lock all input signatures, as they are shared between all shaders/graphics device instances. + lock (inputSignatureCache) + { + if (!inputSignatureCache.TryGetValue(key, out signatureManager)) + { + signatureManager = ToDispose(new InputSignatureManager(this, signatureBytecode)); + inputSignatureCache.Add(key, signatureManager); + } + } + + return signatureManager; + } + + private void CommonSetRenderTargets(RenderTargetView rtv) + { + currentRenderTargetViews[0] = rtv; + for (int i = 1; i < actualRenderTargetViewCount; i++) + currentRenderTargetViews[i] = null; + actualRenderTargetViewCount = 1; + currentRenderTargetView = rtv; + + // Setup the viewport from the rendertarget view + TextureView textureView; + if (AutoViewportFromRenderTargets && rtv != null && (textureView = rtv.Tag as TextureView) != null) + { + SetViewport(new ViewportF(0, 0, textureView.Width, textureView.Height)); + } + } + + private void CommonSetRenderTargets(RenderTargetView[] rtvs) + { + var rtv0 = rtvs.Length > 0 ? rtvs[0] : null; + for (int i = 0; i < rtvs.Length; i++) + currentRenderTargetViews[i] = rtvs[i]; + for (int i = rtvs.Length; i < actualRenderTargetViewCount; i++) + currentRenderTargetViews[i] = null; + actualRenderTargetViewCount = rtvs.Length; + currentRenderTargetView = rtv0; + + // Setup the viewport from the rendertarget view + TextureView textureView; + if (AutoViewportFromRenderTargets && rtv0 != null && (textureView = rtv0.Tag as TextureView) != null) + { + SetViewport(new ViewportF(0, 0, textureView.Width, textureView.Height)); + } + } + } +} diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/PrimitiveBatch.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/PrimitiveBatch.cs index aa428a51..af678182 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/PrimitiveBatch.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/PrimitiveBatch.cs @@ -129,7 +129,7 @@ public override void Begin() public unsafe void Draw(PrimitiveType topology, T[] vertices) { var mappedVertices = Draw(topology, false, IntPtr.Zero, 0, vertices.Length); - Utilities.CopyMemory(mappedVertices, (IntPtr)Interop.Fixed(vertices), vertices.Length * VertexSize) ; + Utilities.CopyMemory(mappedVertices, (IntPtr)Native.Fixed(vertices), vertices.Length * VertexSize) ; } /// @@ -140,8 +140,8 @@ public unsafe void Draw(PrimitiveType topology, T[] vertices) /// The vertices. public unsafe void DrawIndexed(PrimitiveType topology, short[] indices, T[] vertices) { - var mappedVertices = Draw(topology, true, (IntPtr)Interop.Fixed(indices), indices.Length, vertices.Length); - Utilities.CopyMemory(mappedVertices, (IntPtr)Interop.Fixed(vertices), vertices.Length * VertexSize) ; + var mappedVertices = Draw(topology, true, (IntPtr)Native.Fixed(indices), indices.Length, vertices.Length); + Utilities.CopyMemory(mappedVertices, (IntPtr)Native.Fixed(vertices), vertices.Length * VertexSize) ; } /// @@ -179,7 +179,7 @@ public unsafe void DrawTriangle(T v1, T v2, T v3) /// The v4. public unsafe void DrawQuad(T v1, T v2, T v3, T v4) { - var mappedVertices = (byte*)Draw(PrimitiveTopology.TriangleList, true, (IntPtr)Interop.Fixed(QuadIndices), 6, 4); + var mappedVertices = (byte*)Draw(PrimitiveTopology.TriangleList, true, (IntPtr)Native.Fixed(QuadIndices), 6, 4); Utilities.Write((IntPtr)mappedVertices, ref v1); mappedVertices += VertexSize; Utilities.Write((IntPtr)mappedVertices, ref v2); diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/PrimitiveQuad.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/PrimitiveQuad.cs index 2ebce981..edd4369d 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/PrimitiveQuad.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/PrimitiveQuad.cs @@ -68,7 +68,7 @@ public PrimitiveQuad(GraphicsDevice graphicsDevice) public GraphicsDevice GraphicsDevice { get; private set; } /// - /// Gets or sets the color. Default is . + /// Gets or sets the color. Default is . /// /// The color. public Color4 Color @@ -115,7 +115,7 @@ public void DrawRaw(bool fullScreenTriangle) // Reset the vertex buffer GraphicsDevice.SetVertexBuffer(0, null, 0); - GraphicsDevice.InputAssemblerStage.SetInputLayout(null); + GraphicsDevice.InputAssemblerStage.InputLayout = null; // NOTE SmartK8: Verify functionality } /// @@ -159,7 +159,7 @@ public void Draw(SharpDX.Direct3D11.ShaderResourceView texture, SharpDX.Direct3D // Reset the vertex buffer GraphicsDevice.SetVertexBuffer(0, null, 0); - GraphicsDevice.InputAssemblerStage.SetInputLayout(null); + GraphicsDevice.InputAssemblerStage.InputLayout = null; // NOTE SmartK8: Verify functionality GraphicsDevice.Context.PixelShader.SetShaderResource(0, null); } @@ -191,7 +191,7 @@ public void Draw(Effect effect, bool fullScreenTriangle = false) // Reset the vertex buffer GraphicsDevice.SetVertexBuffer(0, null, 0); - GraphicsDevice.InputAssemblerStage.SetInputLayout(null); + GraphicsDevice.InputAssemblerStage.InputLayout = null; // NOTE SmartK8: Verify functionality } /// diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/SharpDX.Toolkit.Graphics.csproj b/Source/Toolkit/SharpDX.Toolkit.Graphics/SharpDX.Toolkit.Graphics.csproj index 0cf1c861..649a1f52 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/SharpDX.Toolkit.Graphics.csproj +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/SharpDX.Toolkit.Graphics.csproj @@ -1,281 +1,297 @@ - - - - - 8.0.30703 - 2.0 - {53EF08A7-4224-434C-A62C-F29807C1C750} - SharpDX.Toolkit.Graphics - SharpDX.Toolkit.Graphics - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PrimitiveQuad.fx - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - AlphaTestEffect.fx - - - - true - BasicEffect.fx - - - - - true - DualTextureEffect.fx - - - true - EnvironmentMapEffect.fx - - - - - - - - - true - SkinnedEffect.fx - - - - true - SpriteEffect.fx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {c97878f4-1510-4bba-8153-bd71da7d50d8} - SharpDX.Direct2D1 - False - - - {736dfb52-1afe-4eff-9710-89046ab5b1f9} - SharpDX.Direct3D11 - False - - - {3fc6de77-b412-4101-9e64-6b9aa831179b} - SharpDX.DXGI - False - - - {49e4485f-3a2a-4c35-a159-12eccfc00396} - SharpDX.Mathematics - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - False - - - {9ff0707c-75bb-4984-a01f-b9eaad293f6c} - SharpDX.Toolkit - False - - - - - - - - - - - - - AlphaTestEffect.ByteCode.cs - - - BasicEffect.ByteCode.cs - - - DualTextureEffect.ByteCode.cs - - - EnvironmentMapEffect.ByteCode.cs - - - SkinnedEffect.ByteCode.cs - - - SpriteEffect.ByteCode.cs - - - PrimitiveQuad.cs - - - + + + + + 8.0.30703 + 2.0 + {53EF08A7-4224-434C-A62C-F29807C1C750} + SharpDX.Toolkit.Graphics + SharpDX.Toolkit.Graphics + v4.5.2 + + + + false + + + false + + + false + + + false + + + false + + + false + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PrimitiveQuad.fx + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + AlphaTestEffect.fx + + + + true + BasicEffect.fx + + + + + true + DualTextureEffect.fx + + + true + EnvironmentMapEffect.fx + + + + + + + + + true + SkinnedEffect.fx + + + + true + SpriteEffect.fx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AlphaTestEffect.ByteCode.cs + + + BasicEffect.ByteCode.cs + + + DualTextureEffect.ByteCode.cs + + + EnvironmentMapEffect.ByteCode.cs + + + SkinnedEffect.ByteCode.cs + + + SpriteEffect.ByteCode.cs + + + PrimitiveQuad.cs + + + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Desktop.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct2D1.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct3D11.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.DXGI.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Mathematics.dll + + + + + + + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C} + SharpDX.Toolkit + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteBatch.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteBatch.cs index 2c470c52..f779d99d 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteBatch.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteBatch.cs @@ -1,1135 +1,1136 @@ -// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// ----------------------------------------------------------------------------- -// The following code is a port of SpriteBatch from DirectXTk -// http://go.microsoft.com/fwlink/?LinkId=248929 -// ----------------------------------------------------------------------------- -// Microsoft Public License (Ms-PL) -// -// This license governs use of the accompanying software. If you use the -// software, you accept this license. If you do not accept the license, do not -// use the software. -// -// 1. Definitions -// The terms "reproduce," "reproduction," "derivative works," and -// "distribution" have the same meaning here as under U.S. copyright law. -// A "contribution" is the original software, or any additions or changes to -// the software. -// A "contributor" is any person that distributes its contribution under this -// license. -// "Licensed patents" are a contributor's patent claims that read directly on -// its contribution. -// -// 2. Grant of Rights -// (A) Copyright Grant- Subject to the terms of this license, including the -// license conditions and limitations in section 3, each contributor grants -// you a non-exclusive, worldwide, royalty-free copyright license to reproduce -// its contribution, prepare derivative works of its contribution, and -// distribute its contribution or any derivative works that you create. -// (B) Patent Grant- Subject to the terms of this license, including the license -// conditions and limitations in section 3, each contributor grants you a -// non-exclusive, worldwide, royalty-free license under its licensed patents to -// make, have made, use, sell, offer for sale, import, and/or otherwise dispose -// of its contribution in the software or derivative works of the contribution -// in the software. -// -// 3. Conditions and Limitations -// (A) No Trademark License- This license does not grant you rights to use any -// contributors' name, logo, or trademarks. -// (B) If you bring a patent claim against any contributor over patents that -// you claim are infringed by the software, your patent license from such -// contributor to the software ends automatically. -// (C) If you distribute any portion of the software, you must retain all -// copyright, patent, trademark, and attribution notices that are present in the -// software. -// (D) If you distribute any portion of the software in source code form, you -// may do so only under this license by including a complete copy of this -// license with your distribution. If you distribute any portion of the software -// in compiled or object code form, you may only do so under a license that -// complies with this license. -// (E) The software is licensed "as-is." You bear the risk of using it. The -// contributors give no express warranties, guarantees or conditions. You may -// have additional consumer rights under your local laws which this license -// cannot change. To the extent permitted under your local laws, the -// contributors exclude the implied warranties of merchantability, fitness for a -// particular purpose and non-infringement. -//-------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading; - -using SharpDX.Direct3D; -using SharpDX.Direct3D11; -using SharpDX.Mathematics; - -namespace SharpDX.Toolkit.Graphics -{ - /// - /// Renders a group of sprites. - /// - public partial class SpriteBatch : GraphicsResource - { - private const int MaxBatchSize = 2048; - private const int MinBatchSize = 128; - private const int InitialQueueSize = 64; - private const int VerticesPerSprite = 4; - private const int IndicesPerSprite = 6; - private const int MaxVertexCount = MaxBatchSize * VerticesPerSprite; - private const int MaxIndexCount = MaxBatchSize * IndicesPerSprite; - - private static readonly Vector2[] CornerOffsets = { Vector2.Zero, Vector2.UnitX, Vector2.UnitY, Vector2.One }; - private static readonly short[] indices; - private static Vector2 vector2Zero = Vector2.Zero; - private static Rectangle? nullRectangle; - - private readonly BackToFrontComparer backToFrontComparer = new BackToFrontComparer(); - private readonly EffectParameter effectMatrixTransform; - private readonly EffectParameter effectSampler; - private readonly FrontToBackComparer frontToBackComparer = new FrontToBackComparer(); - private readonly Buffer indexBuffer; - private readonly Effect spriteEffect; - private readonly EffectPass spriteEffectPass; - private readonly TextureComparer textureComparer = new TextureComparer(); - private readonly ResourceContext resourceContext; - private readonly VertexInputLayout vertexInputLayout; - private readonly Dictionary textureInfos = new Dictionary(128); - private readonly Resource tempResource = new Resource(IntPtr.Zero); - private readonly SharpDX.Direct3D11.Texture1D tempTexture1D = new SharpDX.Direct3D11.Texture1D(IntPtr.Zero); - private readonly SharpDX.Direct3D11.Texture2D tempTexture2D = new SharpDX.Direct3D11.Texture2D(IntPtr.Zero); - private readonly SharpDX.Direct3D11.Texture3D tempTexture3D = new SharpDX.Direct3D11.Texture3D(IntPtr.Zero); - private BlendState blendState; - - private Effect customEffect; - private EffectParameter customEffectMatrixTransform; - private EffectParameter customEffectSampler; - private EffectParameter customEffectTexture; - private DepthStencilState depthStencilState; - - private bool isBeginCalled; - private RasterizerState rasterizerState; - private SamplerState samplerState; - private int[] sortIndices; - private SpriteInfo[] sortedSprites; - private SpriteInfo[] spriteQueue; - private int spriteQueueCount; - private SpriteSortMode spriteSortMode; - private TextureInfo[] spriteTextures; - private DataBuffer x64TempBuffer; - - private Matrix transformMatrix; - - static SpriteBatch() - { - indices = new short[MaxIndexCount]; - int k = 0; - for (int i = 0; i < MaxIndexCount; k += VerticesPerSprite) - { - indices[i++] = (short)(k + 0); - indices[i++] = (short)(k + 1); - indices[i++] = (short)(k + 2); - indices[i++] = (short)(k + 1); - indices[i++] = (short)(k + 3); - indices[i++] = (short)(k + 2); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// The graphics device. - /// The batch capacity default to 2048 (minimum 2048). - public SpriteBatch(GraphicsDevice graphicsDevice, int batchCapacity = MaxBatchSize) : base(graphicsDevice) - { - if (batchCapacity < MaxBatchSize) batchCapacity = MaxBatchSize; - spriteQueue = new SpriteInfo[batchCapacity]; - spriteTextures = new TextureInfo[batchCapacity]; - - spriteEffect = ToDispose(new Effect(graphicsDevice, effectBytecode, graphicsDevice.DefaultEffectPool)); - spriteEffect.CurrentTechnique = spriteEffect.Techniques[0]; - spriteEffectPass = spriteEffect.CurrentTechnique.Passes[0]; - - effectMatrixTransform = spriteEffect.Parameters["MatrixTransform"]; - effectSampler = spriteEffect.Parameters["TextureSampler"]; - - // Creates the vertex buffer (shared by within a device context). - resourceContext = GraphicsDevice.GetOrCreateSharedData(SharedDataType.PerContext, "SpriteBatch.VertexBuffer", () => new ResourceContext(GraphicsDevice)); - - // Creates the vertex input layout (we don't need to cache them as they are already cached). - vertexInputLayout = VertexInputLayout.New(VertexBufferLayout.New(0)); - - // Creates the index buffer (shared within a Direct3D11 Device) - indexBuffer = GraphicsDevice.GetOrCreateSharedData(SharedDataType.PerDevice, "SpriteBatch.IndexBuffer", () => Buffer.Index.New(GraphicsDevice, indices)); - } - - /// - /// Begins a sprite batch operation using deferred sort and default state objects (BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise). - /// - public void Begin(SpriteSortMode spritemode = SpriteSortMode.Deferred, Effect effect = null) - { - Begin(spritemode, null, null, null, null, effect, Matrix.Identity); - } - - /// - /// Begins a sprite batch rendering using the specified sorting mode and blend state, sampler, depth stencil and rasterizer state objects, plus a custom effect. Passing null for any of the state objects selects the default default state objects (BlendState.AlphaBlend, DepthStencilState.None, RasterizerState.CullCounterClockwise, SamplerState.LinearClamp). Passing a null effect selects the default SpriteBatch Class shader. - /// - /// Sprite drawing order. - /// Blending options. - /// Texture sampling options. - /// Depth and stencil options. - /// Rasterization options. - /// Effect state options. - public void Begin(SpriteSortMode sortMode, BlendState blendState = null, SamplerState samplerState = null, DepthStencilState depthStencilState = null, RasterizerState rasterizerState = null, Effect effect = null) - { - Begin(sortMode, blendState, samplerState, depthStencilState, rasterizerState, effect, Matrix.Identity); - } - - /// - /// Begins a sprite batch rendering using the specified sorting mode and blend state, sampler, depth stencil, rasterizer state objects, plus a custom effect and a 2D transformation matrix. Passing null for any of the state objects selects the default default state objects (BlendState.AlphaBlend, DepthStencilState.None, RasterizerState.CullCounterClockwise, SamplerState.LinearClamp). Passing a null effect selects the default SpriteBatch Class shader. - /// - /// Sprite drawing order. - /// Blending options. - /// Texture sampling options. - /// Depth and stencil options. - /// Rasterization options. - /// Effect state options. - /// Transformation matrix for scale, rotate, translate options. - public void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix) - { - if (isBeginCalled) - { - throw new InvalidOperationException("End must be called before begin"); - } - - this.spriteSortMode = sortMode; - this.blendState = blendState; - this.samplerState = samplerState; - this.depthStencilState = depthStencilState; - this.rasterizerState = rasterizerState; - this.customEffect = effect; - this.transformMatrix = transformMatrix; - - // If custom effect is not null, get all its potential default parameters - if (customEffect != null) - { - customEffectMatrixTransform = customEffect.Parameters["MatrixTransform"]; - customEffectTexture = customEffect.Parameters["Texture"]; - customEffectSampler = customEffect.Parameters["TextureSampler"]; - } - - // Immediate mode, then prepare for rendering here instead of End() - if (sortMode == SpriteSortMode.Immediate) - { - if (resourceContext.IsInImmediateMode) - { - throw new InvalidOperationException("Only one SpriteBatch at a time can use SpriteSortMode.Immediate"); - } - - PrepareForRendering(); - - resourceContext.IsInImmediateMode = true; - } - - // Sets to true isBeginCalled - isBeginCalled = true; - } - - /// - /// Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, and color. - /// - /// A texture. - /// A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - /// - /// Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End. - /// - public void Draw(ShaderResourceView texture, RectangleF destinationRectangle, Color color) - { - DrawSprite(texture, ref destinationRectangle, false, ref nullRectangle, color, 0f, ref vector2Zero, SpriteEffects.None, 0f); - } - - /// - /// Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, color, rotation, origin, effects and layer. - /// - /// A texture. - /// A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. If this rectangle is not the same size as the source rectangle, the sprite will be scaled to fit. - /// A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - /// Specifies the angle (in radians) to rotate the sprite about its center. - /// The sprite origin; the default is (0,0) which represents the upper-left corner. - /// Effects to apply. - /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. - public void Draw(ShaderResourceView texture, RectangleF destinationRectangle, Rectangle? sourceRectangle, Color color) - { - DrawSprite(texture, ref destinationRectangle, false, ref sourceRectangle, color, 0f, ref vector2Zero, SpriteEffects.None, 0f); - } - - /// - /// Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, color, rotation, origin, effects and layer. - /// - /// A texture. - /// A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. If this rectangle is not the same size as the source rectangle, the sprite will be scaled to fit. - /// A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - /// Specifies the angle (in radians) to rotate the sprite about its center. - /// The sprite origin; the default is (0,0) which represents the upper-left corner. - /// Effects to apply. - /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. - public void Draw(ShaderResourceView texture, RectangleF destinationRectangle, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth) - { - DrawSprite(texture, ref destinationRectangle, false, ref sourceRectangle, color, rotation, ref origin, effects, layerDepth); - } - - /// - /// Adds a sprite to a batch of sprites for rendering using the specified texture, position and color. - /// - /// A texture. - /// The location (in screen coordinates) to draw the sprite. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - public void Draw(ShaderResourceView texture, Vector2 position, Color color) - { - var destination = new RectangleF(position.X, position.Y, 1f, 1f); - DrawSprite(texture, ref destination, true, ref nullRectangle, color, 0f, ref vector2Zero, SpriteEffects.None, 0f); - } - - /// - /// Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, and color. - /// - /// A texture. - /// The location (in screen coordinates) to draw the sprite. - /// A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - public void Draw(ShaderResourceView texture, Vector2 position, Rectangle? sourceRectangle, Color color) - { - var destination = new RectangleF(position.X, position.Y, 1f, 1f); - DrawSprite(texture, ref destination, true, ref sourceRectangle, color, 0f, ref vector2Zero, SpriteEffects.None, 0f); - } - - /// - /// Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer. - /// - /// A texture. - /// The location (in screen coordinates) to draw the sprite. - /// A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - /// Specifies the angle (in radians) to rotate the sprite about its center. - /// The sprite origin; the default is (0,0) which represents the upper-left corner. - /// Scale factor. - /// Effects to apply. - /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. - public void Draw(ShaderResourceView texture, Vector2 position, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) - { - var destination = new RectangleF(position.X, position.Y, scale, scale); - DrawSprite(texture, ref destination, true, ref sourceRectangle, color, rotation, ref origin, effects, layerDepth); - } - - /// - /// Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer. - /// - /// A texture. - /// The location (in screen coordinates) to draw the sprite. - /// A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - /// Specifies the angle (in radians) to rotate the sprite about its center. - /// The sprite origin; the default is (0,0) which represents the upper-left corner. - /// Scale factor. - /// Effects to apply. - /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. - public void Draw(ShaderResourceView texture, Vector2 position, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) - { - var destination = new RectangleF(position.X, position.Y, scale.X, scale.Y); - DrawSprite(texture, ref destination, true, ref sourceRectangle, color, rotation, ref origin, effects, layerDepth); - } - - /// Adds a string to a batch of sprites for rendering using the specified font, text, position, and color. - /// A font for displaying text. - /// A text string. - /// The location (in screen coordinates) to draw the sprite. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - public void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color) - { - if (spriteFont == null) - { - throw new ArgumentNullException("spriteFont"); - } - if (text == null) - { - throw new ArgumentNullException("text"); - } - var proxy = new SpriteFont.StringProxy(text); - - var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, 0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0f); - spriteFont.InternalDraw(ref proxy, ref drawCommand); - } - - /// Adds a string to a batch of sprites for rendering using the specified font, text, position, and color. - /// A font for displaying text. - /// Text string. - /// The location (in screen coordinates) to draw the sprite. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - public void DrawString(SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color) - { - if (spriteFont == null) - { - throw new ArgumentNullException("spriteFont"); - } - if (text == null) - { - throw new ArgumentNullException("text"); - } - var proxy = new SpriteFont.StringProxy(text); - var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, 0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0f); - spriteFont.InternalDraw(ref proxy, ref drawCommand); - } - - /// Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. - /// A font for displaying text. - /// A text string. - /// The location (in screen coordinates) to draw the sprite. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - /// Specifies the angle (in radians) to rotate the sprite about its center. - /// The sprite origin; the default is (0,0) which represents the upper-left corner. - /// Scale factor. - /// Effects to apply. - /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. - public void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) - { - if (spriteFont == null) - { - throw new ArgumentNullException("spriteFont"); - } - if (text == null) - { - throw new ArgumentNullException("text"); - } - var proxy = new SpriteFont.StringProxy(text); - var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, rotation, origin, scale, effects, layerDepth); - spriteFont.InternalDraw(ref proxy, ref drawCommand); - } - - /// Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. - /// A font for displaying text. - /// A text string. - /// The location (in screen coordinates) to draw the sprite. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - /// Specifies the angle (in radians) to rotate the sprite about its center. - /// The sprite origin; the default is (0,0) which represents the upper-left corner. - /// Scale factor. - /// Effects to apply. - /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. - public void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) - { - if (spriteFont == null) - { - throw new ArgumentNullException("spriteFont"); - } - if (text == null) - { - throw new ArgumentNullException("text"); - } - var proxy = new SpriteFont.StringProxy(text); - var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, rotation, origin, new Vector2(scale, scale), effects, layerDepth); - spriteFont.InternalDraw(ref proxy, ref drawCommand); - } - - /// Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. - /// A font for displaying text. - /// Text string. - /// The location (in screen coordinates) to draw the sprite. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - /// Specifies the angle (in radians) to rotate the sprite about its center. - /// The sprite origin; the default is (0,0) which represents the upper-left corner. - /// Scale factor. - /// Effects to apply. - /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. - public void DrawString(SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) - { - if (spriteFont == null) - { - throw new ArgumentNullException("spriteFont"); - } - if (text == null) - { - throw new ArgumentNullException("text"); - } - var proxy = new SpriteFont.StringProxy(text); - var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, rotation, origin, scale, effects, layerDepth); - spriteFont.InternalDraw(ref proxy, ref drawCommand); - } - - /// Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. - /// A font for displaying text. - /// Text string. - /// The location (in screen coordinates) to draw the sprite. - /// The color to tint a sprite. Use Color.White for full color with no tinting. - /// Specifies the angle (in radians) to rotate the sprite about its center. - /// The sprite origin; the default is (0,0) which represents the upper-left corner. - /// Scale factor. - /// Effects to apply. - /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. - public void DrawString(SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) - { - if (spriteFont == null) - { - throw new ArgumentNullException("spriteFont"); - } - if (text == null) - { - throw new ArgumentNullException("text"); - } - var proxy = new SpriteFont.StringProxy(text); - var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, rotation, origin, new Vector2(scale, scale), effects, layerDepth); - spriteFont.InternalDraw(ref proxy, ref drawCommand); - } - - /// - /// Flushes the sprite batch and restores the device state to how it was before Begin was called. - /// - public void End() - { - if (!isBeginCalled) - { - throw new InvalidOperationException("Begin must be called before End"); - } - - if (spriteSortMode == SpriteSortMode.Immediate) - { - resourceContext.IsInImmediateMode = false; - } - else if (spriteQueueCount > 0) - { - // Draw the queued sprites now. - if (resourceContext.IsInImmediateMode) - { - throw new InvalidOperationException("Cannot end one SpriteBatch while another is using SpriteSortMode.Immediate"); - } - - // If not immediate, then setup and render all sprites - PrepareForRendering(); - FlushBatch(); - } - - // Clear the custom effect so that it won't be used next Begin/End - if (customEffect != null) - { - customEffectMatrixTransform = null; - customEffectTexture = null; - customEffectSampler = null; - customEffect = null; - } - - // Clear stored texture infos - textureInfos.Clear(); - - // We are with begin pair - isBeginCalled = false; - } - - private void FlushBatch() - { - SpriteInfo[] spriteQueueForBatch; - - // If Deferred, then sprites are displayed in the same order they arrived - if (spriteSortMode == SpriteSortMode.Deferred) - { - spriteQueueForBatch = spriteQueue; - } - else - { - // Else Sort all sprites according to their sprite order mode. - SortSprites(); - spriteQueueForBatch = sortedSprites; - } - - // Iterate on all sprites and group batch per texture. - int offset = 0; - var previousTexture = default(TextureInfo); - for (int i = 0; i < spriteQueueCount; i++) - { - TextureInfo texture; - - if (spriteSortMode == SpriteSortMode.Deferred) - { - texture = spriteTextures[i]; - } - else - { - // Copy ordered sprites to the queue to batch - int index = sortIndices[i]; - spriteQueueForBatch[i] = spriteQueue[index]; - - // Get the texture indirectly - texture = spriteTextures[index]; - } - - if (texture.ShaderResourceView != previousTexture.ShaderResourceView) - { - if (i > offset) - { - DrawBatchPerTexture(ref previousTexture, spriteQueueForBatch, offset, i - offset); - } - - offset = i; - previousTexture = texture; - } - } - - // Draw the last batch - DrawBatchPerTexture(ref previousTexture, spriteQueueForBatch, offset, spriteQueueCount - offset); - - // Reset the queue. - Array.Clear(spriteTextures, 0, spriteQueueCount); - spriteQueueCount = 0; - - // When sorting is disabled, we persist mSortedSprites data from one batch to the next, to avoid - // unnecessary work in GrowSortedSprites. But we never reuse these when sorting, because re-sorting - // previously sorted items gives unstable ordering if some sprites have identical sort keys. - if (spriteSortMode != SpriteSortMode.Deferred) - { - Array.Clear(sortedSprites, 0, sortedSprites.Length); - } - } - - private void SortSprites() - { - IComparer comparer; - - switch (spriteSortMode) - { - case SpriteSortMode.Texture: - textureComparer.SpriteTextures = spriteTextures; - comparer = textureComparer; - break; - - case SpriteSortMode.BackToFront: - backToFrontComparer.SpriteQueue = spriteQueue; - comparer = backToFrontComparer; - break; - - case SpriteSortMode.FrontToBack: - frontToBackComparer.SpriteQueue = spriteQueue; - comparer = frontToBackComparer; - break; - default: - throw new NotSupportedException(); - } - - if ((sortIndices == null) || (sortIndices.Length < spriteQueueCount)) - { - sortIndices = new int[spriteQueueCount]; - sortedSprites = new SpriteInfo[spriteQueueCount]; - } - - // Reset all indices to the original order - for (int i = 0; i < spriteQueueCount; i++) - { - sortIndices[i] = i; - } - - Array.Sort(sortIndices, 0, spriteQueueCount, comparer); - } - - internal unsafe void DrawSprite(ShaderResourceView shaderResourceView, ref RectangleF destination, bool scaleDestination, ref Rectangle? sourceRectangle, Color color, float rotation, ref Vector2 origin, SpriteEffects effects, float depth) - { - // Check that texture is not null - if (shaderResourceView == null || shaderResourceView.NativePointer == IntPtr.Zero) - { - throw new ArgumentNullException("shaderResourceView"); - } - - // Make sure that Begin was called - if (!isBeginCalled) - { - throw new InvalidOperationException("Begin must be called before draw"); - } - - // Resize the buffer of SpriteInfo - if (spriteQueueCount >= spriteQueue.Length) - { - Array.Resize(ref spriteQueue, spriteQueue.Length*2); - } - - // Gets the resource information from the view (width, height). - // Cache the result in order to avoid this request if the texture is reused - // inside a same Begin/End block. - TextureInfo textureInfo; - if (!textureInfos.TryGetValue(shaderResourceView, out textureInfo)) - { - // otherwise go to the slow path - textureInfo.ShaderResourceView = shaderResourceView.NativePointer; - - // If this is a shader resource view from the toolkit - // go the fast path - var tkTexture = shaderResourceView.Tag as TextureView; - if (tkTexture != null) - { - textureInfo.Width = tkTexture.Width; - textureInfo.Height = tkTexture.Height; - } - else - { - IntPtr resourcePtr; - shaderResourceView.GetResource(out resourcePtr); - tempResource._nativePointer = (void*)resourcePtr; - switch (tempResource.Dimension) - { - case ResourceDimension.Texture1D: - tempTexture1D._nativePointer = (void*)resourcePtr; - textureInfo.Width = tempTexture1D.Description.Width; - textureInfo.Height = 1; - break; - case ResourceDimension.Texture2D: - tempTexture2D._nativePointer = (void*)resourcePtr; - var description2D = tempTexture2D.Description; - textureInfo.Width = description2D.Width; - textureInfo.Height = description2D.Height; - break; - case ResourceDimension.Texture3D: - tempTexture3D._nativePointer = (void*)resourcePtr; - var description3D = tempTexture3D.Description; - textureInfo.Width = description3D.Width; - textureInfo.Height = description3D.Height; - break; - default: - throw new ArgumentException("Invalid resource for texture. Must be Texture1D/2D/3D", "shaderResourceView"); - } - - // Then calculate the actual width of the view - // Use the first MostDetailedMip to calculate the actual size of this view - var mipIndex = shaderResourceView.Description.Texture1D.MostDetailedMip; - textureInfo.Width = Math.Max(1, textureInfo.Width >> mipIndex); - textureInfo.Height = Math.Max(1, textureInfo.Height >> mipIndex); - - // Release the resource retrieved by shaderResourceView.GetResource(out resourcePtr); - Marshal.Release(resourcePtr); - } - - textureInfos.Add(shaderResourceView, textureInfo); - } - - // Put values in next SpriteInfo - fixed (SpriteInfo* spriteInfo = &(spriteQueue[spriteQueueCount])) - { - float width; - float height; - - // If the source rectangle has a value, then use it. - if (sourceRectangle.HasValue) - { - Rectangle rectangle = sourceRectangle.Value; - spriteInfo->Source.X = rectangle.X; - spriteInfo->Source.Y = rectangle.Y; - width = rectangle.Width; - height = rectangle.Height; - } - else - { - // Else, use directly the size of the texture - spriteInfo->Source.X = 0.0f; - spriteInfo->Source.Y = 0.0f; - width = textureInfo.Width; - height = textureInfo.Height; - } - - // Sets the width and height - spriteInfo->Source.Width = width; - spriteInfo->Source.Height = height; - - // Scale the destination box - if (scaleDestination) - { - destination.Width *= width; - destination.Height *= height; - } - - // Sets the destination - spriteInfo->Destination = destination; - - // Copy all other values. - spriteInfo->Origin.X = origin.X; - spriteInfo->Origin.Y = origin.Y; - spriteInfo->Rotation = rotation; - spriteInfo->Depth = depth; - spriteInfo->SpriteEffects = effects; - spriteInfo->Color = color; - } - - // If we are in immediate mode, render the sprite directly - if (spriteSortMode == SpriteSortMode.Immediate) - { - DrawBatchPerTexture(ref textureInfo, spriteQueue, 0, 1); - } - else - { - if (spriteTextures.Length < spriteQueue.Length) - { - Array.Resize(ref spriteTextures, spriteQueue.Length); - } - spriteTextures[spriteQueueCount] = textureInfo; - spriteQueueCount++; - } - } - - private void DrawBatchPerTexture(ref TextureInfo texture, SpriteInfo[] sprites, int offset, int count) - { - var nativeShaderResourceViewPointer = texture.ShaderResourceView; - - if (customEffect != null) - { - var currentTechnique = customEffect.CurrentTechnique; - - int passCount = currentTechnique.Passes.Count; - for (int i = 0; i < passCount; i++) - { - // Sets the texture on the custom effect if the parameter exist - if (customEffectTexture != null) - { - customEffectTexture.SetResourcePointer(nativeShaderResourceViewPointer); - } - - var currentPass = currentTechnique.Passes[i]; - - // Apply the current pass - currentPass.Apply(); - - // Draw the batch of sprites - DrawBatchPerTextureAndPass(ref texture, sprites, offset, count); - - // unbind all pass resources as the texture can be used later as a render target - currentPass.UnApply(); - } - } - else - { - unsafe - { - // Sets the texture for this sprite effect. - // Use an optimized version in order to avoid to reapply the sprite effect here just to change texture - // We are calling directly the PixelShaderStage. We assume that the texture is on slot 0 as it is - // setup in the original BasicEffect.fx shader. - GraphicsDevice.PixelShaderStage.SetShaderResources(0, 1, new IntPtr(&nativeShaderResourceViewPointer)); - } - - DrawBatchPerTextureAndPass(ref texture, sprites, offset, count); - - // unbind the texture from pass as it can be used later as a render target - GraphicsDevice.PixelShaderStage.SetShaderResources(0, 1, GraphicsDevice.ResetSlotsPointers); - } - } - - private unsafe void DrawBatchPerTextureAndPass(ref TextureInfo texture, SpriteInfo[] sprites, int offset, int count) - { - float deltaX = 1f/(texture.Width); - float deltaY = 1f/(texture.Height); - while (count > 0) - { - // How many sprites do we want to draw? - int batchSize = count; - - // How many sprites does the D3D vertex buffer have room for? - int remainingSpace = MaxBatchSize - resourceContext.VertexBufferPosition; - if (batchSize > remainingSpace) - { - if (remainingSpace < MinBatchSize) - { - resourceContext.VertexBufferPosition = 0; - batchSize = (count < MaxBatchSize) ? count : MaxBatchSize; - } - else - { - batchSize = remainingSpace; - } - } - - // Sets the data directly to the buffer in memory - int offsetInBytes = resourceContext.VertexBufferPosition * VerticesPerSprite * Utilities.SizeOf(); - - var noOverwrite = resourceContext.VertexBufferPosition == 0 ? SetDataOptions.Discard : SetDataOptions.NoOverwrite; - - // ------------------------------------------------------------------------------------------------------------ - // CAUTION: Performance problem under x64 resolved by this special codepath: - // For some unknown reasons, It seems that writing directly to the pointer returned by the MapSubresource is - // extremely inefficient using x64 but using a temporary buffer and performing a mempcy to the locked region - // seems to be running at the same speed than x86 - // ------------------------------------------------------------------------------------------------------------ - if (IntPtr.Size == 8) - { - if (x64TempBuffer == null) - { - x64TempBuffer = ToDispose(new DataBuffer(Utilities.SizeOf() * MaxBatchSize * VerticesPerSprite)); - } - - // Perform the update of all vertices on a temporary buffer - var texturePtr = (VertexPositionColorTexture*)x64TempBuffer.DataPointer; - for (int i = 0; i < batchSize; i++) - { - UpdateVertexFromSpriteInfo(ref sprites[offset + i], ref texturePtr, deltaX, deltaY); - } - - // Then copy this buffer in one shot - resourceContext.VertexBuffer.SetData(GraphicsDevice, new DataPointer(x64TempBuffer.DataPointer, batchSize * VerticesPerSprite * Utilities.SizeOf()), offsetInBytes, noOverwrite); - } - else - { - // For x86 version, It seems that we can write directly to the buffer - // TODO: Need to check that this behavior is also running fine under WP8 - var deviceContext = (DeviceContext)GraphicsDevice; - try - { - var box = deviceContext.MapSubresource(resourceContext.VertexBuffer, 0, SetDataOptionsHelper.ConvertToMapMode(noOverwrite), MapFlags.None); - var pointer = (IntPtr)((byte*)box.DataPointer + offsetInBytes); - var texturePtr = (VertexPositionColorTexture*)pointer; - for(var i = 0; i < batchSize; i++) - UpdateVertexFromSpriteInfo(ref sprites[offset + i], ref texturePtr, deltaX, deltaY); - } - finally - { - deviceContext.UnmapSubresource(resourceContext.VertexBuffer, 0); - } - } - - // Draw from the specified index - int startIndex = resourceContext.VertexBufferPosition * IndicesPerSprite; - int indexCount = batchSize * IndicesPerSprite; - GraphicsDevice.DrawIndexed(PrimitiveType.TriangleList, indexCount, startIndex); - - // Update position, offset and remaining count - resourceContext.VertexBufferPosition += batchSize; - offset += batchSize; - count -= batchSize; - } - } - - private unsafe void UpdateVertexFromSpriteInfo(ref SpriteInfo spriteInfo, ref VertexPositionColorTexture* vertex, float deltaX, float deltaY) - { - - // Origin scale down to the size of the source texture - var origin = spriteInfo.Origin; - origin.X /= spriteInfo.Source.Width == 0f ? float.Epsilon : spriteInfo.Source.Width; - origin.Y /= spriteInfo.Source.Height == 0f ? float.Epsilon : spriteInfo.Source.Height; - - if(spriteInfo.Rotation != 0f) - { - var rotation = new Vector2((float)Math.Cos(spriteInfo.Rotation), (float)Math.Sin(spriteInfo.Rotation)); - for(int j = 0; j < 4; j++) - { - // Gets the corner and take into account the Flip mode. - var corner = CornerOffsets[j]; - // Calculate position on destination - var position = new Vector2((corner.X - origin.X) * spriteInfo.Destination.Width, (corner.Y - origin.Y) * spriteInfo.Destination.Height); - - // Apply rotation and destination offset - vertex->Position.X = spriteInfo.Destination.X + (position.X * rotation.X) - (position.Y * rotation.Y); - vertex->Position.Y = spriteInfo.Destination.Y + (position.X * rotation.Y) + (position.Y * rotation.X); - vertex->Position.Z = spriteInfo.Depth; - vertex->Color = spriteInfo.Color; - - corner = CornerOffsets[j ^ (int)spriteInfo.SpriteEffects]; - vertex->TextureCoordinate.X = (spriteInfo.Source.X + corner.X * spriteInfo.Source.Width) * deltaX; - vertex->TextureCoordinate.Y = (spriteInfo.Source.Y + corner.Y * spriteInfo.Source.Height) * deltaY; - vertex++; - } - } - else - { - for (int j = 0; j < 4; j++) - { - // Gets the corner and take into account the Flip mode. - var corner = CornerOffsets[j]; - // Calculate position on destination - var position = new Vector2((corner.X - origin.X) * spriteInfo.Destination.Width, (corner.Y - origin.Y) * spriteInfo.Destination.Height); - - // Apply rotation and destination offset - vertex->Position.X = spriteInfo.Destination.X + position.X; - vertex->Position.Y = spriteInfo.Destination.Y + position.Y; - vertex->Position.Z = spriteInfo.Depth; - vertex->Color = spriteInfo.Color; - - corner = CornerOffsets[j ^ (int)spriteInfo.SpriteEffects]; - vertex->TextureCoordinate.X = (spriteInfo.Source.X + corner.X * spriteInfo.Source.Width) * deltaX; - vertex->TextureCoordinate.Y = (spriteInfo.Source.Y + corner.Y * spriteInfo.Source.Height) * deltaY; - vertex++; - } - } - } - - private void PrepareForRendering() - { - // Setup states (Blend, DepthStencil, Rasterizer) - GraphicsDevice.SetBlendState(blendState ?? GraphicsDevice.BlendStates.AlphaBlend); - GraphicsDevice.SetDepthStencilState(depthStencilState ?? GraphicsDevice.DepthStencilStates.None); - GraphicsDevice.SetRasterizerState(rasterizerState ?? GraphicsDevice.RasterizerStates.CullBack); - - // Clear all shaders - GraphicsDevice.ResetShaderStages(); - - // Build ortho-projection matrix - ViewportF viewport = GraphicsDevice.Viewport; - float xRatio = (viewport.Width > 0) ? (1f/(viewport.Width)) : 0f; - float yRatio = (viewport.Height > 0) ? (-1f/(viewport.Height)) : 0f; - var matrix = new Matrix { M11 = xRatio * 2f, M22 = yRatio * 2f, M33 = 1f, M44 = 1f, M41 = -1f, M42 = 1f }; - - Matrix finalMatrix; - Matrix.Multiply(ref transformMatrix, ref matrix, out finalMatrix); - - // Use LinearClamp for sampler state - var localSamplerState = samplerState ?? GraphicsDevice.SamplerStates.LinearClamp; - - // Setup effect states and parameters: SamplerState and MatrixTransform - // Sets the sampler state - if (customEffect != null) - { - if (customEffect.CurrentTechnique == null) - throw new InvalidOperationException("CurrentTechnique is not set on custom effect"); - - if (customEffectSampler != null) - customEffectSampler.SetResource(localSamplerState); - - if (customEffectMatrixTransform != null) - customEffectMatrixTransform.SetValue(finalMatrix); - } - else - { - effectSampler.SetResource(localSamplerState); - effectMatrixTransform.SetValue(finalMatrix); - - // Apply the sprite effect globally - spriteEffectPass.Apply(); - } - - // Set VertexInputLayout - GraphicsDevice.SetVertexInputLayout(vertexInputLayout); - - // VertexBuffer - GraphicsDevice.SetVertexBuffer(resourceContext.VertexBuffer); - - // Index buffer - GraphicsDevice.SetIndexBuffer(indexBuffer, false); - - // If this is a deferred D3D context, reset position so the first Map call will use D3D11_MAP_WRITE_DISCARD. - if (GraphicsDevice.IsDeferred) - { - resourceContext.VertexBufferPosition = 0; - } - } - - #region Nested type: BackToFrontComparer - - private class BackToFrontComparer : IComparer - { - public SpriteInfo[] SpriteQueue; - - #region IComparer Members - - public int Compare(int left, int right) - { - return SpriteQueue[right].Depth.CompareTo(SpriteQueue[left].Depth); - } - - #endregion - } - - #endregion - - #region Nested type: FrontToBackComparer - - private class FrontToBackComparer : IComparer - { - public SpriteInfo[] SpriteQueue; - - #region IComparer Members - - public int Compare(int left, int right) - { - return SpriteQueue[left].Depth.CompareTo(SpriteQueue[right].Depth); - } - - #endregion - } - - #endregion - - #region Nested type: TextureComparer - - private class TextureComparer : IComparer - { - public TextureInfo[] SpriteTextures; - - #region IComparer Members - - public int Compare(int left, int right) - { - return SpriteTextures[left].ShaderResourceView.ToInt64().CompareTo(SpriteTextures[right].ShaderResourceView.ToInt64()); - } - - #endregion - } - - #endregion - - #region Nested type: SpriteInfo - - [StructLayout(LayoutKind.Sequential)] - private struct SpriteInfo - { - public RectangleF Source; - public RectangleF Destination; - public Vector2 Origin; - public float Rotation; - public float Depth; - public SpriteEffects SpriteEffects; - public Color Color; - } - - #endregion - - - /// - /// Use a ResourceContext per GraphicsDevice (DeviceContext) - /// - private class ResourceContext : Component - { - public readonly Buffer VertexBuffer; - - public int VertexBufferPosition; - - public bool IsInImmediateMode; - - public ResourceContext(GraphicsDevice device) - { - VertexBuffer = ToDispose(Buffer.Vertex.New(device, MaxVertexCount, ResourceUsage.Dynamic)); - } - } - - /// - /// Internal structure used to store texture information. - /// - private struct TextureInfo - { - public IntPtr ShaderResourceView; - - public int Width; - - public int Height; - } - } +// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// ----------------------------------------------------------------------------- +// The following code is a port of SpriteBatch from DirectXTk +// http://go.microsoft.com/fwlink/?LinkId=248929 +// ----------------------------------------------------------------------------- +// Microsoft Public License (Ms-PL) +// +// This license governs use of the accompanying software. If you use the +// software, you accept this license. If you do not accept the license, do not +// use the software. +// +// 1. Definitions +// The terms "reproduce," "reproduction," "derivative works," and +// "distribution" have the same meaning here as under U.S. copyright law. +// A "contribution" is the original software, or any additions or changes to +// the software. +// A "contributor" is any person that distributes its contribution under this +// license. +// "Licensed patents" are a contributor's patent claims that read directly on +// its contribution. +// +// 2. Grant of Rights +// (A) Copyright Grant- Subject to the terms of this license, including the +// license conditions and limitations in section 3, each contributor grants +// you a non-exclusive, worldwide, royalty-free copyright license to reproduce +// its contribution, prepare derivative works of its contribution, and +// distribute its contribution or any derivative works that you create. +// (B) Patent Grant- Subject to the terms of this license, including the license +// conditions and limitations in section 3, each contributor grants you a +// non-exclusive, worldwide, royalty-free license under its licensed patents to +// make, have made, use, sell, offer for sale, import, and/or otherwise dispose +// of its contribution in the software or derivative works of the contribution +// in the software. +// +// 3. Conditions and Limitations +// (A) No Trademark License- This license does not grant you rights to use any +// contributors' name, logo, or trademarks. +// (B) If you bring a patent claim against any contributor over patents that +// you claim are infringed by the software, your patent license from such +// contributor to the software ends automatically. +// (C) If you distribute any portion of the software, you must retain all +// copyright, patent, trademark, and attribution notices that are present in the +// software. +// (D) If you distribute any portion of the software in source code form, you +// may do so only under this license by including a complete copy of this +// license with your distribution. If you distribute any portion of the software +// in compiled or object code form, you may only do so under a license that +// complies with this license. +// (E) The software is licensed "as-is." You bear the risk of using it. The +// contributors give no express warranties, guarantees or conditions. You may +// have additional consumer rights under your local laws which this license +// cannot change. To the extent permitted under your local laws, the +// contributors exclude the implied warranties of merchantability, fitness for a +// particular purpose and non-infringement. +//-------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +using SharpDX.Direct3D; +using SharpDX.Direct3D11; +using SharpDX.Mathematics; + +namespace SharpDX.Toolkit.Graphics +{ + /// + /// Renders a group of sprites. + /// + public partial class SpriteBatch : GraphicsResource + { + private const int MaxBatchSize = 2048; + private const int MinBatchSize = 128; + private const int InitialQueueSize = 64; + private const int VerticesPerSprite = 4; + private const int IndicesPerSprite = 6; + private const int MaxVertexCount = MaxBatchSize * VerticesPerSprite; + private const int MaxIndexCount = MaxBatchSize * IndicesPerSprite; + + private static readonly Vector2[] CornerOffsets = { Vector2.Zero, Vector2.UnitX, Vector2.UnitY, Vector2.One }; + private static readonly short[] indices; + private static Vector2 vector2Zero = Vector2.Zero; + private static Rectangle? nullRectangle; + + private readonly BackToFrontComparer backToFrontComparer = new BackToFrontComparer(); + private readonly EffectParameter effectMatrixTransform; + private readonly EffectParameter effectSampler; + private readonly FrontToBackComparer frontToBackComparer = new FrontToBackComparer(); + private readonly Buffer indexBuffer; + private readonly Effect spriteEffect; + private readonly EffectPass spriteEffectPass; + private readonly TextureComparer textureComparer = new TextureComparer(); + private readonly ResourceContext resourceContext; + private readonly VertexInputLayout vertexInputLayout; + private readonly Dictionary textureInfos = new Dictionary(128); + private readonly Resource tempResource = new Resource(IntPtr.Zero); + private readonly SharpDX.Direct3D11.Texture1D tempTexture1D = new SharpDX.Direct3D11.Texture1D(IntPtr.Zero); + private readonly SharpDX.Direct3D11.Texture2D tempTexture2D = new SharpDX.Direct3D11.Texture2D(IntPtr.Zero); + private readonly SharpDX.Direct3D11.Texture3D tempTexture3D = new SharpDX.Direct3D11.Texture3D(IntPtr.Zero); + private BlendState blendState; + + private Effect customEffect; + private EffectParameter customEffectMatrixTransform; + private EffectParameter customEffectSampler; + private EffectParameter customEffectTexture; + private DepthStencilState depthStencilState; + + private bool isBeginCalled; + private RasterizerState rasterizerState; + private SamplerState samplerState; + private int[] sortIndices; + private SpriteInfo[] sortedSprites; + private SpriteInfo[] spriteQueue; + private int spriteQueueCount; + private SpriteSortMode spriteSortMode; + private TextureInfo[] spriteTextures; + private DataBuffer x64TempBuffer; + + private Matrix transformMatrix; + + static SpriteBatch() + { + indices = new short[MaxIndexCount]; + int k = 0; + for (int i = 0; i < MaxIndexCount; k += VerticesPerSprite) + { + indices[i++] = (short)(k + 0); + indices[i++] = (short)(k + 1); + indices[i++] = (short)(k + 2); + indices[i++] = (short)(k + 1); + indices[i++] = (short)(k + 3); + indices[i++] = (short)(k + 2); + } + } + + /// + /// Initializes a new instance of the class. + /// + /// The graphics device. + /// The batch capacity default to 2048 (minimum 2048). + public SpriteBatch(GraphicsDevice graphicsDevice, int batchCapacity = MaxBatchSize) : base(graphicsDevice) + { + if (batchCapacity < MaxBatchSize) batchCapacity = MaxBatchSize; + spriteQueue = new SpriteInfo[batchCapacity]; + spriteTextures = new TextureInfo[batchCapacity]; + + spriteEffect = ToDispose(new Effect(graphicsDevice, effectBytecode, graphicsDevice.DefaultEffectPool)); + spriteEffect.CurrentTechnique = spriteEffect.Techniques[0]; + spriteEffectPass = spriteEffect.CurrentTechnique.Passes[0]; + + effectMatrixTransform = spriteEffect.Parameters["MatrixTransform"]; + effectSampler = spriteEffect.Parameters["TextureSampler"]; + + // Creates the vertex buffer (shared by within a device context). + resourceContext = GraphicsDevice.GetOrCreateSharedData(SharedDataType.PerContext, "SpriteBatch.VertexBuffer", () => new ResourceContext(GraphicsDevice)); + + // Creates the vertex input layout (we don't need to cache them as they are already cached). + vertexInputLayout = VertexInputLayout.New(VertexBufferLayout.New(0)); + + // Creates the index buffer (shared within a Direct3D11 Device) + indexBuffer = GraphicsDevice.GetOrCreateSharedData(SharedDataType.PerDevice, "SpriteBatch.IndexBuffer", () => Buffer.Index.New(GraphicsDevice, indices)); + } + + /// + /// Begins a sprite batch operation using deferred sort and default state objects (BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise). + /// + public void Begin(SpriteSortMode spritemode = SpriteSortMode.Deferred, Effect effect = null) + { + Begin(spritemode, null, null, null, null, effect, Matrix.Identity); + } + + /// + /// Begins a sprite batch rendering using the specified sorting mode and blend state, sampler, depth stencil and rasterizer state objects, plus a custom effect. Passing null for any of the state objects selects the default default state objects (BlendState.AlphaBlend, DepthStencilState.None, RasterizerState.CullCounterClockwise, SamplerState.LinearClamp). Passing a null effect selects the default SpriteBatch Class shader. + /// + /// Sprite drawing order. + /// Blending options. + /// Texture sampling options. + /// Depth and stencil options. + /// Rasterization options. + /// Effect state options. + public void Begin(SpriteSortMode sortMode, BlendState blendState = null, SamplerState samplerState = null, DepthStencilState depthStencilState = null, RasterizerState rasterizerState = null, Effect effect = null) + { + Begin(sortMode, blendState, samplerState, depthStencilState, rasterizerState, effect, Matrix.Identity); + } + + /// + /// Begins a sprite batch rendering using the specified sorting mode and blend state, sampler, depth stencil, rasterizer state objects, plus a custom effect and a 2D transformation matrix. Passing null for any of the state objects selects the default default state objects (BlendState.AlphaBlend, DepthStencilState.None, RasterizerState.CullCounterClockwise, SamplerState.LinearClamp). Passing a null effect selects the default SpriteBatch Class shader. + /// + /// Sprite drawing order. + /// Blending options. + /// Texture sampling options. + /// Depth and stencil options. + /// Rasterization options. + /// Effect state options. + /// Transformation matrix for scale, rotate, translate options. + public void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix) + { + if (isBeginCalled) + { + throw new InvalidOperationException("End must be called before begin"); + } + + this.spriteSortMode = sortMode; + this.blendState = blendState; + this.samplerState = samplerState; + this.depthStencilState = depthStencilState; + this.rasterizerState = rasterizerState; + this.customEffect = effect; + this.transformMatrix = transformMatrix; + + // If custom effect is not null, get all its potential default parameters + if (customEffect != null) + { + customEffectMatrixTransform = customEffect.Parameters["MatrixTransform"]; + customEffectTexture = customEffect.Parameters["Texture"]; + customEffectSampler = customEffect.Parameters["TextureSampler"]; + } + + // Immediate mode, then prepare for rendering here instead of End() + if (sortMode == SpriteSortMode.Immediate) + { + if (resourceContext.IsInImmediateMode) + { + throw new InvalidOperationException("Only one SpriteBatch at a time can use SpriteSortMode.Immediate"); + } + + PrepareForRendering(); + + resourceContext.IsInImmediateMode = true; + } + + // Sets to true isBeginCalled + isBeginCalled = true; + } + + /// + /// Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, and color. + /// + /// A texture. + /// A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + /// + /// Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End. + /// + public void Draw(ShaderResourceView texture, RectangleF destinationRectangle, Color color) + { + DrawSprite(texture, ref destinationRectangle, false, ref nullRectangle, color, 0f, ref vector2Zero, SpriteEffects.None, 0f); + } + + /// + /// Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, color, rotation, origin, effects and layer. + /// + /// A texture. + /// A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. If this rectangle is not the same size as the source rectangle, the sprite will be scaled to fit. + /// A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + /// Specifies the angle (in radians) to rotate the sprite about its center. + /// The sprite origin; the default is (0,0) which represents the upper-left corner. + /// Effects to apply. + /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. + public void Draw(ShaderResourceView texture, RectangleF destinationRectangle, Rectangle? sourceRectangle, Color color) + { + DrawSprite(texture, ref destinationRectangle, false, ref sourceRectangle, color, 0f, ref vector2Zero, SpriteEffects.None, 0f); + } + + /// + /// Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, color, rotation, origin, effects and layer. + /// + /// A texture. + /// A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. If this rectangle is not the same size as the source rectangle, the sprite will be scaled to fit. + /// A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + /// Specifies the angle (in radians) to rotate the sprite about its center. + /// The sprite origin; the default is (0,0) which represents the upper-left corner. + /// Effects to apply. + /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. + public void Draw(ShaderResourceView texture, RectangleF destinationRectangle, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth) + { + DrawSprite(texture, ref destinationRectangle, false, ref sourceRectangle, color, rotation, ref origin, effects, layerDepth); + } + + /// + /// Adds a sprite to a batch of sprites for rendering using the specified texture, position and color. + /// + /// A texture. + /// The location (in screen coordinates) to draw the sprite. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + public void Draw(ShaderResourceView texture, Vector2 position, Color color) + { + var destination = new RectangleF(position.X, position.Y, 1f, 1f); + DrawSprite(texture, ref destination, true, ref nullRectangle, color, 0f, ref vector2Zero, SpriteEffects.None, 0f); + } + + /// + /// Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, and color. + /// + /// A texture. + /// The location (in screen coordinates) to draw the sprite. + /// A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + public void Draw(ShaderResourceView texture, Vector2 position, Rectangle? sourceRectangle, Color color) + { + var destination = new RectangleF(position.X, position.Y, 1f, 1f); + DrawSprite(texture, ref destination, true, ref sourceRectangle, color, 0f, ref vector2Zero, SpriteEffects.None, 0f); + } + + /// + /// Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer. + /// + /// A texture. + /// The location (in screen coordinates) to draw the sprite. + /// A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + /// Specifies the angle (in radians) to rotate the sprite about its center. + /// The sprite origin; the default is (0,0) which represents the upper-left corner. + /// Scale factor. + /// Effects to apply. + /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. + public void Draw(ShaderResourceView texture, Vector2 position, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) + { + var destination = new RectangleF(position.X, position.Y, scale, scale); + DrawSprite(texture, ref destination, true, ref sourceRectangle, color, rotation, ref origin, effects, layerDepth); + } + + /// + /// Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer. + /// + /// A texture. + /// The location (in screen coordinates) to draw the sprite. + /// A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + /// Specifies the angle (in radians) to rotate the sprite about its center. + /// The sprite origin; the default is (0,0) which represents the upper-left corner. + /// Scale factor. + /// Effects to apply. + /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. + public void Draw(ShaderResourceView texture, Vector2 position, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) + { + var destination = new RectangleF(position.X, position.Y, scale.X, scale.Y); + DrawSprite(texture, ref destination, true, ref sourceRectangle, color, rotation, ref origin, effects, layerDepth); + } + + /// Adds a string to a batch of sprites for rendering using the specified font, text, position, and color. + /// A font for displaying text. + /// A text string. + /// The location (in screen coordinates) to draw the sprite. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + public void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color) + { + if (spriteFont == null) + { + throw new ArgumentNullException("spriteFont"); + } + if (text == null) + { + throw new ArgumentNullException("text"); + } + var proxy = new SpriteFont.StringProxy(text); + + var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, 0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0f); + spriteFont.InternalDraw(ref proxy, ref drawCommand); + } + + /// Adds a string to a batch of sprites for rendering using the specified font, text, position, and color. + /// A font for displaying text. + /// Text string. + /// The location (in screen coordinates) to draw the sprite. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + public void DrawString(SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color) + { + if (spriteFont == null) + { + throw new ArgumentNullException("spriteFont"); + } + if (text == null) + { + throw new ArgumentNullException("text"); + } + var proxy = new SpriteFont.StringProxy(text); + var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, 0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0f); + spriteFont.InternalDraw(ref proxy, ref drawCommand); + } + + /// Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. + /// A font for displaying text. + /// A text string. + /// The location (in screen coordinates) to draw the sprite. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + /// Specifies the angle (in radians) to rotate the sprite about its center. + /// The sprite origin; the default is (0,0) which represents the upper-left corner. + /// Scale factor. + /// Effects to apply. + /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. + public void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) + { + if (spriteFont == null) + { + throw new ArgumentNullException("spriteFont"); + } + if (text == null) + { + throw new ArgumentNullException("text"); + } + var proxy = new SpriteFont.StringProxy(text); + var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, rotation, origin, scale, effects, layerDepth); + spriteFont.InternalDraw(ref proxy, ref drawCommand); + } + + /// Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. + /// A font for displaying text. + /// A text string. + /// The location (in screen coordinates) to draw the sprite. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + /// Specifies the angle (in radians) to rotate the sprite about its center. + /// The sprite origin; the default is (0,0) which represents the upper-left corner. + /// Scale factor. + /// Effects to apply. + /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. + public void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) + { + if (spriteFont == null) + { + throw new ArgumentNullException("spriteFont"); + } + if (text == null) + { + throw new ArgumentNullException("text"); + } + var proxy = new SpriteFont.StringProxy(text); + var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, rotation, origin, new Vector2(scale, scale), effects, layerDepth); + spriteFont.InternalDraw(ref proxy, ref drawCommand); + } + + /// Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. + /// A font for displaying text. + /// Text string. + /// The location (in screen coordinates) to draw the sprite. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + /// Specifies the angle (in radians) to rotate the sprite about its center. + /// The sprite origin; the default is (0,0) which represents the upper-left corner. + /// Scale factor. + /// Effects to apply. + /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. + public void DrawString(SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) + { + if (spriteFont == null) + { + throw new ArgumentNullException("spriteFont"); + } + if (text == null) + { + throw new ArgumentNullException("text"); + } + var proxy = new SpriteFont.StringProxy(text); + var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, rotation, origin, scale, effects, layerDepth); + spriteFont.InternalDraw(ref proxy, ref drawCommand); + } + + /// Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. + /// A font for displaying text. + /// Text string. + /// The location (in screen coordinates) to draw the sprite. + /// The color to tint a sprite. Use Color.White for full color with no tinting. + /// Specifies the angle (in radians) to rotate the sprite about its center. + /// The sprite origin; the default is (0,0) which represents the upper-left corner. + /// Scale factor. + /// Effects to apply. + /// The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. + public void DrawString(SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) + { + if (spriteFont == null) + { + throw new ArgumentNullException("spriteFont"); + } + if (text == null) + { + throw new ArgumentNullException("text"); + } + var proxy = new SpriteFont.StringProxy(text); + var drawCommand = new SpriteFont.InternalDrawCommand(this, position, color, rotation, origin, new Vector2(scale, scale), effects, layerDepth); + spriteFont.InternalDraw(ref proxy, ref drawCommand); + } + + /// + /// Flushes the sprite batch and restores the device state to how it was before Begin was called. + /// + public void End() + { + if (!isBeginCalled) + { + throw new InvalidOperationException("Begin must be called before End"); + } + + if (spriteSortMode == SpriteSortMode.Immediate) + { + resourceContext.IsInImmediateMode = false; + } + else if (spriteQueueCount > 0) + { + // Draw the queued sprites now. + if (resourceContext.IsInImmediateMode) + { + throw new InvalidOperationException("Cannot end one SpriteBatch while another is using SpriteSortMode.Immediate"); + } + + // If not immediate, then setup and render all sprites + PrepareForRendering(); + FlushBatch(); + } + + // Clear the custom effect so that it won't be used next Begin/End + if (customEffect != null) + { + customEffectMatrixTransform = null; + customEffectTexture = null; + customEffectSampler = null; + customEffect = null; + } + + // Clear stored texture infos + textureInfos.Clear(); + + // We are with begin pair + isBeginCalled = false; + } + + private void FlushBatch() + { + SpriteInfo[] spriteQueueForBatch; + + // If Deferred, then sprites are displayed in the same order they arrived + if (spriteSortMode == SpriteSortMode.Deferred) + { + spriteQueueForBatch = spriteQueue; + } + else + { + // Else Sort all sprites according to their sprite order mode. + SortSprites(); + spriteQueueForBatch = sortedSprites; + } + + // Iterate on all sprites and group batch per texture. + int offset = 0; + var previousTexture = default(TextureInfo); + for (int i = 0; i < spriteQueueCount; i++) + { + TextureInfo texture; + + if (spriteSortMode == SpriteSortMode.Deferred) + { + texture = spriteTextures[i]; + } + else + { + // Copy ordered sprites to the queue to batch + int index = sortIndices[i]; + spriteQueueForBatch[i] = spriteQueue[index]; + + // Get the texture indirectly + texture = spriteTextures[index]; + } + + if (texture.ShaderResourceView != previousTexture.ShaderResourceView) + { + if (i > offset) + { + DrawBatchPerTexture(ref previousTexture, spriteQueueForBatch, offset, i - offset); + } + + offset = i; + previousTexture = texture; + } + } + + // Draw the last batch + DrawBatchPerTexture(ref previousTexture, spriteQueueForBatch, offset, spriteQueueCount - offset); + + // Reset the queue. + Array.Clear(spriteTextures, 0, spriteQueueCount); + spriteQueueCount = 0; + + // When sorting is disabled, we persist mSortedSprites data from one batch to the next, to avoid + // unnecessary work in GrowSortedSprites. But we never reuse these when sorting, because re-sorting + // previously sorted items gives unstable ordering if some sprites have identical sort keys. + if (spriteSortMode != SpriteSortMode.Deferred) + { + Array.Clear(sortedSprites, 0, sortedSprites.Length); + } + } + + private void SortSprites() + { + IComparer comparer; + + switch (spriteSortMode) + { + case SpriteSortMode.Texture: + textureComparer.SpriteTextures = spriteTextures; + comparer = textureComparer; + break; + + case SpriteSortMode.BackToFront: + backToFrontComparer.SpriteQueue = spriteQueue; + comparer = backToFrontComparer; + break; + + case SpriteSortMode.FrontToBack: + frontToBackComparer.SpriteQueue = spriteQueue; + comparer = frontToBackComparer; + break; + default: + throw new NotSupportedException(); + } + + if ((sortIndices == null) || (sortIndices.Length < spriteQueueCount)) + { + sortIndices = new int[spriteQueueCount]; + sortedSprites = new SpriteInfo[spriteQueueCount]; + } + + // Reset all indices to the original order + for (int i = 0; i < spriteQueueCount; i++) + { + sortIndices[i] = i; + } + + Array.Sort(sortIndices, 0, spriteQueueCount, comparer); + } + + internal unsafe void DrawSprite(ShaderResourceView shaderResourceView, ref RectangleF destination, bool scaleDestination, ref Rectangle? sourceRectangle, Color color, float rotation, ref Vector2 origin, SpriteEffects effects, float depth) + { + // Check that texture is not null + if (shaderResourceView == null || shaderResourceView.NativePointer == IntPtr.Zero) + { + throw new ArgumentNullException("shaderResourceView"); + } + + // Make sure that Begin was called + if (!isBeginCalled) + { + throw new InvalidOperationException("Begin must be called before draw"); + } + + // Resize the buffer of SpriteInfo + if (spriteQueueCount >= spriteQueue.Length) + { + Array.Resize(ref spriteQueue, spriteQueue.Length*2); + } + + // Gets the resource information from the view (width, height). + // Cache the result in order to avoid this request if the texture is reused + // inside a same Begin/End block. + TextureInfo textureInfo; + if (!textureInfos.TryGetValue(shaderResourceView, out textureInfo)) + { + // otherwise go to the slow path + textureInfo.ShaderResourceView = shaderResourceView.NativePointer; + + // If this is a shader resource view from the toolkit + // go the fast path + var tkTexture = shaderResourceView.Tag as TextureView; + if (tkTexture != null) + { + textureInfo.Width = tkTexture.Width; + textureInfo.Height = tkTexture.Height; + } + else + { + // NOTE SmartK8: Verify functionality + tempResource.NativePointer = shaderResourceView.NativePointer; + + switch (tempResource.Dimension) + { + case ResourceDimension.Texture1D: + tempTexture1D.NativePointer = shaderResourceView.NativePointer; + textureInfo.Width = tempTexture1D.Description.Width; + textureInfo.Height = 1; + break; + case ResourceDimension.Texture2D: + tempTexture2D.NativePointer = shaderResourceView.NativePointer; + var description2D = tempTexture2D.Description; + textureInfo.Width = description2D.Width; + textureInfo.Height = description2D.Height; + break; + case ResourceDimension.Texture3D: + tempTexture3D.NativePointer = shaderResourceView.NativePointer; + var description3D = tempTexture3D.Description; + textureInfo.Width = description3D.Width; + textureInfo.Height = description3D.Height; + break; + default: + throw new ArgumentException("Invalid resource for texture. Must be Texture1D/2D/3D", "shaderResourceView"); + } + + // Then calculate the actual width of the view + // Use the first MostDetailedMip to calculate the actual size of this view + var mipIndex = shaderResourceView.Description.Texture1D.MostDetailedMip; + textureInfo.Width = Math.Max(1, textureInfo.Width >> mipIndex); + textureInfo.Height = Math.Max(1, textureInfo.Height >> mipIndex); + + // Release the resource retrieved by shaderResourceView.GetResource(out resourcePtr); + Marshal.Release(shaderResourceView.NativePointer); + } + + textureInfos.Add(shaderResourceView, textureInfo); + } + + // Put values in next SpriteInfo + fixed (SpriteInfo* spriteInfo = &(spriteQueue[spriteQueueCount])) + { + float width; + float height; + + // If the source rectangle has a value, then use it. + if (sourceRectangle.HasValue) + { + Rectangle rectangle = sourceRectangle.Value; + spriteInfo->Source.X = rectangle.X; + spriteInfo->Source.Y = rectangle.Y; + width = rectangle.Width; + height = rectangle.Height; + } + else + { + // Else, use directly the size of the texture + spriteInfo->Source.X = 0.0f; + spriteInfo->Source.Y = 0.0f; + width = textureInfo.Width; + height = textureInfo.Height; + } + + // Sets the width and height + spriteInfo->Source.Width = width; + spriteInfo->Source.Height = height; + + // Scale the destination box + if (scaleDestination) + { + destination.Width *= width; + destination.Height *= height; + } + + // Sets the destination + spriteInfo->Destination = destination; + + // Copy all other values. + spriteInfo->Origin.X = origin.X; + spriteInfo->Origin.Y = origin.Y; + spriteInfo->Rotation = rotation; + spriteInfo->Depth = depth; + spriteInfo->SpriteEffects = effects; + spriteInfo->Color = color; + } + + // If we are in immediate mode, render the sprite directly + if (spriteSortMode == SpriteSortMode.Immediate) + { + DrawBatchPerTexture(ref textureInfo, spriteQueue, 0, 1); + } + else + { + if (spriteTextures.Length < spriteQueue.Length) + { + Array.Resize(ref spriteTextures, spriteQueue.Length); + } + spriteTextures[spriteQueueCount] = textureInfo; + spriteQueueCount++; + } + } + + private unsafe void DrawBatchPerTexture(ref TextureInfo texture, SpriteInfo[] sprites, int offset, int count) + { + var nativeShaderResourceViewPointer = texture.ShaderResourceView; + + if (customEffect != null) + { + var currentTechnique = customEffect.CurrentTechnique; + + int passCount = currentTechnique.Passes.Count; + for (int i = 0; i < passCount; i++) + { + // Sets the texture on the custom effect if the parameter exist + if (customEffectTexture != null) + { + customEffectTexture.SetResourcePointer(nativeShaderResourceViewPointer); + } + + var currentPass = currentTechnique.Passes[i]; + + // Apply the current pass + currentPass.Apply(); + + // Draw the batch of sprites + DrawBatchPerTextureAndPass(ref texture, sprites, offset, count); + + // unbind all pass resources as the texture can be used later as a render target + currentPass.UnApply(); + } + } + else + { + // Sets the texture for this sprite effect. + // Use an optimized version in order to avoid to reapply the sprite effect here just to change texture + // We are calling directly the PixelShaderStage. We assume that the texture is on slot 0 as it is + // setup in the original BasicEffect.fx shader. + // NOTE SmartK8 : Calls internal method + MethodInfo setShaderResources = GraphicsDevice.PixelShaderStage.GetType().GetMethod("SetShaderResources", BindingFlags.NonPublic | BindingFlags.Instance); + setShaderResources.Invoke(GraphicsDevice.PixelShaderStage, new Object[] { 0, 1, new IntPtr(&nativeShaderResourceViewPointer) }); + + DrawBatchPerTextureAndPass(ref texture, sprites, offset, count); + + // unbind the texture from pass as it can be used later as a render target + // NOTE SmartK8 : Calls internal method + setShaderResources.Invoke(GraphicsDevice.PixelShaderStage, new Object[] { 0, 1, GraphicsDevice.ResetSlotsPointers }); + } + } + + private unsafe void DrawBatchPerTextureAndPass(ref TextureInfo texture, SpriteInfo[] sprites, int offset, int count) + { + float deltaX = 1f/(texture.Width); + float deltaY = 1f/(texture.Height); + while (count > 0) + { + // How many sprites do we want to draw? + int batchSize = count; + + // How many sprites does the D3D vertex buffer have room for? + int remainingSpace = MaxBatchSize - resourceContext.VertexBufferPosition; + if (batchSize > remainingSpace) + { + if (remainingSpace < MinBatchSize) + { + resourceContext.VertexBufferPosition = 0; + batchSize = (count < MaxBatchSize) ? count : MaxBatchSize; + } + else + { + batchSize = remainingSpace; + } + } + + // Sets the data directly to the buffer in memory + int offsetInBytes = resourceContext.VertexBufferPosition * VerticesPerSprite * Utilities.SizeOf(); + + var noOverwrite = resourceContext.VertexBufferPosition == 0 ? SetDataOptions.Discard : SetDataOptions.NoOverwrite; + + // ------------------------------------------------------------------------------------------------------------ + // CAUTION: Performance problem under x64 resolved by this special codepath: + // For some unknown reasons, It seems that writing directly to the pointer returned by the MapSubresource is + // extremely inefficient using x64 but using a temporary buffer and performing a mempcy to the locked region + // seems to be running at the same speed than x86 + // ------------------------------------------------------------------------------------------------------------ + if (IntPtr.Size == 8) + { + if (x64TempBuffer == null) + { + x64TempBuffer = ToDispose(new DataBuffer(Utilities.SizeOf() * MaxBatchSize * VerticesPerSprite)); + } + + // Perform the update of all vertices on a temporary buffer + var texturePtr = (VertexPositionColorTexture*)x64TempBuffer.DataPointer; + for (int i = 0; i < batchSize; i++) + { + UpdateVertexFromSpriteInfo(ref sprites[offset + i], ref texturePtr, deltaX, deltaY); + } + + // Then copy this buffer in one shot + resourceContext.VertexBuffer.SetData(GraphicsDevice, new DataPointer(x64TempBuffer.DataPointer, batchSize * VerticesPerSprite * Utilities.SizeOf()), offsetInBytes, noOverwrite); + } + else + { + // For x86 version, It seems that we can write directly to the buffer + // TODO: Need to check that this behavior is also running fine under WP8 + var deviceContext = (DeviceContext)GraphicsDevice; + try + { + var box = deviceContext.MapSubresource(resourceContext.VertexBuffer, 0, SetDataOptionsHelper.ConvertToMapMode(noOverwrite), MapFlags.None); + var pointer = (IntPtr)((byte*)box.DataPointer + offsetInBytes); + var texturePtr = (VertexPositionColorTexture*)pointer; + for(var i = 0; i < batchSize; i++) + UpdateVertexFromSpriteInfo(ref sprites[offset + i], ref texturePtr, deltaX, deltaY); + } + finally + { + deviceContext.UnmapSubresource(resourceContext.VertexBuffer, 0); + } + } + + // Draw from the specified index + int startIndex = resourceContext.VertexBufferPosition * IndicesPerSprite; + int indexCount = batchSize * IndicesPerSprite; + GraphicsDevice.DrawIndexed(PrimitiveType.TriangleList, indexCount, startIndex); + + // Update position, offset and remaining count + resourceContext.VertexBufferPosition += batchSize; + offset += batchSize; + count -= batchSize; + } + } + + private unsafe void UpdateVertexFromSpriteInfo(ref SpriteInfo spriteInfo, ref VertexPositionColorTexture* vertex, float deltaX, float deltaY) + { + + // Origin scale down to the size of the source texture + var origin = spriteInfo.Origin; + origin.X /= spriteInfo.Source.Width == 0f ? float.Epsilon : spriteInfo.Source.Width; + origin.Y /= spriteInfo.Source.Height == 0f ? float.Epsilon : spriteInfo.Source.Height; + + if(spriteInfo.Rotation != 0f) + { + var rotation = new Vector2((float)Math.Cos(spriteInfo.Rotation), (float)Math.Sin(spriteInfo.Rotation)); + for(int j = 0; j < 4; j++) + { + // Gets the corner and take into account the Flip mode. + var corner = CornerOffsets[j]; + // Calculate position on destination + var position = new Vector2((corner.X - origin.X) * spriteInfo.Destination.Width, (corner.Y - origin.Y) * spriteInfo.Destination.Height); + + // Apply rotation and destination offset + vertex->Position.X = spriteInfo.Destination.X + (position.X * rotation.X) - (position.Y * rotation.Y); + vertex->Position.Y = spriteInfo.Destination.Y + (position.X * rotation.Y) + (position.Y * rotation.X); + vertex->Position.Z = spriteInfo.Depth; + vertex->Color = spriteInfo.Color; + + corner = CornerOffsets[j ^ (int)spriteInfo.SpriteEffects]; + vertex->TextureCoordinate.X = (spriteInfo.Source.X + corner.X * spriteInfo.Source.Width) * deltaX; + vertex->TextureCoordinate.Y = (spriteInfo.Source.Y + corner.Y * spriteInfo.Source.Height) * deltaY; + vertex++; + } + } + else + { + for (int j = 0; j < 4; j++) + { + // Gets the corner and take into account the Flip mode. + var corner = CornerOffsets[j]; + // Calculate position on destination + var position = new Vector2((corner.X - origin.X) * spriteInfo.Destination.Width, (corner.Y - origin.Y) * spriteInfo.Destination.Height); + + // Apply rotation and destination offset + vertex->Position.X = spriteInfo.Destination.X + position.X; + vertex->Position.Y = spriteInfo.Destination.Y + position.Y; + vertex->Position.Z = spriteInfo.Depth; + vertex->Color = spriteInfo.Color; + + corner = CornerOffsets[j ^ (int)spriteInfo.SpriteEffects]; + vertex->TextureCoordinate.X = (spriteInfo.Source.X + corner.X * spriteInfo.Source.Width) * deltaX; + vertex->TextureCoordinate.Y = (spriteInfo.Source.Y + corner.Y * spriteInfo.Source.Height) * deltaY; + vertex++; + } + } + } + + private void PrepareForRendering() + { + // Setup states (Blend, DepthStencil, Rasterizer) + GraphicsDevice.SetBlendState(blendState ?? GraphicsDevice.BlendStates.AlphaBlend); + GraphicsDevice.SetDepthStencilState(depthStencilState ?? GraphicsDevice.DepthStencilStates.None); + GraphicsDevice.SetRasterizerState(rasterizerState ?? GraphicsDevice.RasterizerStates.CullBack); + + // Clear all shaders + GraphicsDevice.ResetShaderStages(); + + // Build ortho-projection matrix + ViewportF viewport = GraphicsDevice.Viewport; + float xRatio = (viewport.Width > 0) ? (1f/(viewport.Width)) : 0f; + float yRatio = (viewport.Height > 0) ? (-1f/(viewport.Height)) : 0f; + var matrix = new Matrix { M11 = xRatio * 2f, M22 = yRatio * 2f, M33 = 1f, M44 = 1f, M41 = -1f, M42 = 1f }; + + Matrix finalMatrix; + Matrix.Multiply(ref transformMatrix, ref matrix, out finalMatrix); + + // Use LinearClamp for sampler state + var localSamplerState = samplerState ?? GraphicsDevice.SamplerStates.LinearClamp; + + // Setup effect states and parameters: SamplerState and MatrixTransform + // Sets the sampler state + if (customEffect != null) + { + if (customEffect.CurrentTechnique == null) + throw new InvalidOperationException("CurrentTechnique is not set on custom effect"); + + if (customEffectSampler != null) + customEffectSampler.SetResource(localSamplerState); + + if (customEffectMatrixTransform != null) + customEffectMatrixTransform.SetValue(finalMatrix); + } + else + { + effectSampler.SetResource(localSamplerState); + effectMatrixTransform.SetValue(finalMatrix); + + // Apply the sprite effect globally + spriteEffectPass.Apply(); + } + + // Set VertexInputLayout + GraphicsDevice.SetVertexInputLayout(vertexInputLayout); + + // VertexBuffer + GraphicsDevice.SetVertexBuffer(resourceContext.VertexBuffer); + + // Index buffer + GraphicsDevice.SetIndexBuffer(indexBuffer, false); + + // If this is a deferred D3D context, reset position so the first Map call will use D3D11_MAP_WRITE_DISCARD. + if (GraphicsDevice.IsDeferred) + { + resourceContext.VertexBufferPosition = 0; + } + } + + #region Nested type: BackToFrontComparer + + private class BackToFrontComparer : IComparer + { + public SpriteInfo[] SpriteQueue; + + #region IComparer Members + + public int Compare(int left, int right) + { + return SpriteQueue[right].Depth.CompareTo(SpriteQueue[left].Depth); + } + + #endregion + } + + #endregion + + #region Nested type: FrontToBackComparer + + private class FrontToBackComparer : IComparer + { + public SpriteInfo[] SpriteQueue; + + #region IComparer Members + + public int Compare(int left, int right) + { + return SpriteQueue[left].Depth.CompareTo(SpriteQueue[right].Depth); + } + + #endregion + } + + #endregion + + #region Nested type: TextureComparer + + private class TextureComparer : IComparer + { + public TextureInfo[] SpriteTextures; + + #region IComparer Members + + public int Compare(int left, int right) + { + return SpriteTextures[left].ShaderResourceView.ToInt64().CompareTo(SpriteTextures[right].ShaderResourceView.ToInt64()); + } + + #endregion + } + + #endregion + + #region Nested type: SpriteInfo + + [StructLayout(LayoutKind.Sequential)] + private struct SpriteInfo + { + public RectangleF Source; + public RectangleF Destination; + public Vector2 Origin; + public float Rotation; + public float Depth; + public SpriteEffects SpriteEffects; + public Color Color; + } + + #endregion + + + /// + /// Use a ResourceContext per GraphicsDevice (DeviceContext) + /// + private class ResourceContext : Component + { + public readonly Buffer VertexBuffer; + + public int VertexBufferPosition; + + public bool IsInImmediateMode; + + public ResourceContext(GraphicsDevice device) + { + VertexBuffer = ToDispose(Buffer.Vertex.New(device, MaxVertexCount, ResourceUsage.Dynamic)); + } + } + + /// + /// Internal structure used to store texture information. + /// + private struct TextureInfo + { + public IntPtr ShaderResourceView; + + public int Width; + + public int Height; + } + } } \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture.cs index 669882da..7a7600ad 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture.cs @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Runtime.InteropServices; using SharpDX.DXGI; using SharpDX.Direct3D11; using SharpDX.IO; @@ -463,9 +464,10 @@ public static Texture New(GraphicsDevice graphicsDevice, TextureDescription desc /// public unsafe bool GetData(Texture stagingTexture, TData[] toData, int arraySlice = 0, int mipSlice = 0, bool doNotWait = false) where TData : struct { - return GetData(stagingTexture, new DataPointer((IntPtr)Interop.Fixed(toData), toData.Length * Utilities.SizeOf()), arraySlice, mipSlice, doNotWait); + return GetData(stagingTexture, new DataPointer((IntPtr)Native.Fixed(toData), toData.Length * Utilities.SizeOf()), arraySlice, mipSlice, doNotWait); } + /// /// Copies the content of this texture from GPU memory to a pointer on CPU memory using a specific staging resource. /// @@ -615,7 +617,7 @@ public void SetData(DataPointer fromData, int arraySlice = 0, int mipSlice = 0, /// public unsafe void SetData(GraphicsDevice device, TData[] fromData, int arraySlice = 0, int mipSlice = 0, ResourceRegion? region = null) where TData : struct { - SetData(device, new DataPointer((IntPtr)Interop.Fixed(fromData), fromData.Length * Utilities.SizeOf()), arraySlice, mipSlice, region); + SetData(device, new DataPointer((IntPtr)Native.Fixed(fromData), fromData.Length * Utilities.SizeOf()), arraySlice, mipSlice, region); } /// diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture1D.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture1D.cs index e82dbd78..68124823 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture1D.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture1D.cs @@ -151,7 +151,7 @@ public static Texture1D New(GraphicsDevice device, int width, MipMapCount mipCou /// public unsafe static Texture1D New(GraphicsDevice device, int width, PixelFormat format, T[] textureData, TextureFlags flags = TextureFlags.ShaderResource, ResourceUsage usage = ResourceUsage.Immutable) where T : struct { - return new Texture1D(device, NewDescription(width, format, flags, 1, 1, usage), GetDataBox(format, width, 1, 1, textureData, (IntPtr)Interop.Fixed(textureData))); + return new Texture1D(device, NewDescription(width, format, flags, 1, 1, usage), GetDataBox(format, width, 1, 1, textureData, (IntPtr)Native.Fixed(textureData))); } /// diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture2D.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture2D.cs index a0105f52..95467184 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture2D.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture2D.cs @@ -151,7 +151,7 @@ public static Texture2D New(GraphicsDevice device, int width, int height, MipMap /// public unsafe static Texture2D New(GraphicsDevice device, int width, int height, PixelFormat format, T[] textureData, TextureFlags flags = TextureFlags.ShaderResource, ResourceUsage usage = ResourceUsage.Immutable) where T : struct { - return New(device, width, height, 1, format, new [] { GetDataBox(format, width, height, 1, textureData, (IntPtr)Interop.Fixed(textureData)) }, flags, 1, usage); + return New(device, width, height, 1, format, new[] { GetDataBox(format, width, height, 1, textureData, (IntPtr)Native.Fixed(textureData)) }, flags, 1, usage); } /// diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture3D.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture3D.cs index 5280a6e8..fa0e5d2b 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture3D.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/Texture3D.cs @@ -154,7 +154,7 @@ public static Texture3D New(GraphicsDevice device, int width, int height, int de /// ID3D11Device::CreateTexture3D public unsafe static Texture3D New(GraphicsDevice device, int width, int height, int depth, PixelFormat format, T[] textureData, TextureFlags flags = TextureFlags.ShaderResource, ResourceUsage usage = ResourceUsage.Immutable) where T : struct { - return New(device, width, height, depth, 1, format, new[] { GetDataBox(format, width, height, depth, textureData, (IntPtr)Interop.Fixed(textureData)) }, flags, usage); + return New(device, width, height, depth, 1, format, new[] { GetDataBox(format, width, height, depth, textureData, (IntPtr)Native.Fixed(textureData)) }, flags, usage); } /// diff --git a/Source/Toolkit/SharpDX.Toolkit.Graphics/TextureCube.cs b/Source/Toolkit/SharpDX.Toolkit.Graphics/TextureCube.cs index 5cb5a6fd..ea7b46c2 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Graphics/TextureCube.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Graphics/TextureCube.cs @@ -152,12 +152,12 @@ public unsafe static TextureCube New(GraphicsDevice device, int size, PixelFo if (textureData.Length != 6) throw new ArgumentException("Invalid texture data. First dimension must be equal to 6", "textureData"); - var dataBox1 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Interop.Fixed(textureData[0])); - var dataBox2 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Interop.Fixed(textureData[1])); - var dataBox3 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Interop.Fixed(textureData[2])); - var dataBox4 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Interop.Fixed(textureData[3])); - var dataBox5 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Interop.Fixed(textureData[4])); - var dataBox6 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Interop.Fixed(textureData[5])); + var dataBox1 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Native.Fixed(textureData[0])); + var dataBox2 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Native.Fixed(textureData[1])); + var dataBox3 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Native.Fixed(textureData[2])); + var dataBox4 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Native.Fixed(textureData[3])); + var dataBox5 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Native.Fixed(textureData[4])); + var dataBox6 = GetDataBox(format, size, size, 1, textureData[0], (IntPtr)Native.Fixed(textureData[5])); return new TextureCube(device, NewTextureCubeDescription(size, format, flags | TextureFlags.ShaderResource, 1, usage), dataBox1, dataBox2, dataBox3, dataBox4, dataBox5, dataBox6); } diff --git a/Source/Toolkit/SharpDX.Toolkit.Input/PointerPlatformDesktopTouch.cs b/Source/Toolkit/SharpDX.Toolkit.Input/PointerPlatformDesktopTouch.cs index 9cac122f..87ebb363 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Input/PointerPlatformDesktopTouch.cs +++ b/Source/Toolkit/SharpDX.Toolkit.Input/PointerPlatformDesktopTouch.cs @@ -18,12 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using SharpDX.Mathematics; -using RectangleF = SharpDX.Mathematics.RectangleF; #if !W8CORE using System; using System.Collections.Generic; -using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; diff --git a/Source/Toolkit/SharpDX.Toolkit.Input/SharpDX.Toolkit.Input.csproj b/Source/Toolkit/SharpDX.Toolkit.Input/SharpDX.Toolkit.Input.csproj index cf8491f1..3c6b4ac5 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Input/SharpDX.Toolkit.Input.csproj +++ b/Source/Toolkit/SharpDX.Toolkit.Input/SharpDX.Toolkit.Input.csproj @@ -1,108 +1,127 @@ - - - - - 8.0.30703 - 2.0 - {46452614-6B06-400F-A74C-1632C79B762C} - SharpDX.Toolkit.Input - SharpDX.Toolkit.Input - - - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {736dfb52-1afe-4eff-9710-89046ab5b1f9} - SharpDX.Direct3D11 - False - - - {3fc6de77-b412-4101-9e64-6b9aa831179b} - SharpDX.DXGI - False - - - {49e4485f-3a2a-4c35-a159-12eccfc00396} - SharpDX.Mathematics - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - False - - - {53ef08a7-4224-434c-a62c-f29807c1c750} - SharpDX.Toolkit.Graphics - False - - - {9ff0707c-75bb-4984-a01f-b9eaad293f6c} - SharpDX.Toolkit - False - - - {B2516A23-1A99-4263-964A-B820FD07FA80} - SharpDX.Toolkit.Game - False - - - - - - + + + + + 8.0.30703 + 2.0 + {46452614-6B06-400F-A74C-1632C79B762C} + SharpDX.Toolkit.Input + SharpDX.Toolkit.Input + v4.5.2 + + + + false + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {53ef08a7-4224-434c-a62c-f29807c1c750} + SharpDX.Toolkit.Graphics + False + + + {9ff0707c-75bb-4984-a01f-b9eaad293f6c} + SharpDX.Toolkit + False + + + {B2516A23-1A99-4263-964A-B820FD07FA80} + SharpDX.Toolkit.Game + False + + + + + + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct3D11.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.DXGI.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Mathematics.dll + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Yaml/SharpDX.Toolkit.Yaml.csproj b/Source/Toolkit/SharpDX.Toolkit.Yaml/SharpDX.Toolkit.Yaml.csproj index dd72da08..71e2c1aa 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Yaml/SharpDX.Toolkit.Yaml.csproj +++ b/Source/Toolkit/SharpDX.Toolkit.Yaml/SharpDX.Toolkit.Yaml.csproj @@ -1,71 +1,92 @@ - - - - - 8.0.30703 - 2.0 - {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F} - SharpDX.Toolkit.Yaml - SharpDX.Toolkit.Yaml - - - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - {49e4485f-3a2a-4c35-a159-12eccfc00396} - SharpDX.Mathematics - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - False - - - {9ff0707c-75bb-4984-a01f-b9eaad293f6c} - SharpDX.Toolkit - False - - - {B2516A23-1A99-4263-964A-B820FD07FA80} - SharpDX.Toolkit.Game - False - - - - - - - - - False - ..\..\..\packages\SharpYaml.1.2.0\lib\SharpYaml.dll - False - - - + + + + + 8.0.30703 + 2.0 + {ED9F81D3-C2F1-47CA-A25C-8F2CEFE70D0F} + SharpDX.Toolkit.Yaml + SharpDX.Toolkit.Yaml + v4.5.2 + + + + false + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + {9ff0707c-75bb-4984-a01f-b9eaad293f6c} + SharpDX.Toolkit + False + + + {B2516A23-1A99-4263-964A-B820FD07FA80} + SharpDX.Toolkit.Game + False + + + + + Designer + + + + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Mathematics.dll + + + False + ..\..\..\packages\SharpYaml.1.2.0\lib\SharpYaml.dll + False + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit.Yaml/packages.config b/Source/Toolkit/SharpDX.Toolkit.Yaml/packages.config index 37b97494..b6d55a1a 100644 --- a/Source/Toolkit/SharpDX.Toolkit.Yaml/packages.config +++ b/Source/Toolkit/SharpDX.Toolkit.Yaml/packages.config @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit/CompositeTransform.cs b/Source/Toolkit/SharpDX.Toolkit/CompositeTransform.cs index da1d2774..bcd77cd4 100644 --- a/Source/Toolkit/SharpDX.Toolkit/CompositeTransform.cs +++ b/Source/Toolkit/SharpDX.Toolkit/CompositeTransform.cs @@ -18,7 +18,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using SharpDX.Mathematics; using System; using System.Globalization; using SharpDX.Toolkit; @@ -105,7 +104,7 @@ public static CompositeTransform Slerp(CompositeTransform start, CompositeTransf } /// - /// Performs an explicit conversion from to . + /// Performs an explicit conversion from to . /// /// The value. /// The result of the conversion. diff --git a/Source/Toolkit/SharpDX.Toolkit/Native.cs b/Source/Toolkit/SharpDX.Toolkit/Native.cs new file mode 100644 index 00000000..3a68dd29 --- /dev/null +++ b/Source/Toolkit/SharpDX.Toolkit/Native.cs @@ -0,0 +1,147 @@ +// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Reflection; + +namespace SharpDX +{ + /// + /// The implementation of this class is filled by InteropBuilder post-building-event. + /// + internal class Native + { + /// + /// Provides a fixed statement working with generics. + /// + /// + /// The data. + /// A fixed pointer to the referenced structure + /// + /// This is the only function in this class that is inlined in order to inline the fixed statement correctly. + /// + public static unsafe void* Fixed(ref T data) + { + throw new NotImplementedException(); + } + + public static unsafe void* Fixed(T[] data) + { + throw new NotImplementedException(); + } + + public static unsafe void* Cast(ref T data) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe void* CastOut(out T data) where T : struct + { + throw new NotImplementedException(); + } + + public static TCAST[] CastArray(T[] arrayData) + where T : struct + where TCAST : struct + { + throw new NotImplementedException(); + } + + public static unsafe void memcpy(void* pDest, void* pSrc, int count) + { + throw new NotImplementedException(); + } + + public static unsafe void memset(void* pDest, byte value, int count) + { + throw new NotImplementedException(); + } + + public static unsafe void* Read(void* pSrc, ref T data) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe T ReadInline(void* pSrc) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe void WriteInline(void* pDest, ref T data) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe void CopyInline(ref T data, void* pSrc) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe void CopyInline(void* pDest, ref T srcData) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe void CopyInlineOut(out T data, void* pSrc) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe void* ReadOut(void* pSrc, out T data) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe void* Read(void* pSrc, T[] data, int offset, int count) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe void* Read2D(void* pSrc, T[,] data, int offset, int count) where T : struct + { + throw new NotImplementedException(); + } + + public static int SizeOf() + { + throw new NotImplementedException(); + } + + public static unsafe void* Write(void* pDest, ref T data) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe void* Write(void* pDest, T[] data, int offset, int count) where T : struct + { + throw new NotImplementedException(); + } + + public static unsafe void* Write2D(void* pDest, T[,] data, int offset, int count) where T : struct + { + throw new NotImplementedException(); + } + + [Tag("SharpDX.ModuleInit")] + public static void ModuleInit() + { + // Console.WriteLine("SharpDX Initialized"); + } + } +} \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit/Serialization/BinarySerializer.Mathematics.cs b/Source/Toolkit/SharpDX.Toolkit/Serialization/BinarySerializer.Mathematics.cs index d83d1969..be139cbf 100644 --- a/Source/Toolkit/SharpDX.Toolkit/Serialization/BinarySerializer.Mathematics.cs +++ b/Source/Toolkit/SharpDX.Toolkit/Serialization/BinarySerializer.Mathematics.cs @@ -58,17 +58,17 @@ public void Serialize(ref Bool4 value) { if (Mode == SerializerMode.Write) { - Writer.Write(value.iX); - Writer.Write(value.iY); - Writer.Write(value.iZ); - Writer.Write(value.iW); + Writer.Write((Int32)(value.X ? 1 : 0)); + Writer.Write((Int32)(value.Y ? 1 : 0)); + Writer.Write((Int32)(value.Z ? 1 : 0)); + Writer.Write((Int32)(value.W ? 1 : 0)); } else { - value.iX = Reader.ReadInt32(); - value.iY = Reader.ReadInt32(); - value.iZ = Reader.ReadInt32(); - value.iW = Reader.ReadInt32(); + value.X = Reader.ReadInt32() != 0; + value.Y = Reader.ReadInt32() != 0; + value.Z = Reader.ReadInt32() != 0; + value.W = Reader.ReadInt32() != 0; } } diff --git a/Source/Toolkit/SharpDX.Toolkit/Serialization/BinarySerializer.cs b/Source/Toolkit/SharpDX.Toolkit/Serialization/BinarySerializer.cs index e8a71a63..e3441d55 100644 --- a/Source/Toolkit/SharpDX.Toolkit/Serialization/BinarySerializer.cs +++ b/Source/Toolkit/SharpDX.Toolkit/Serialization/BinarySerializer.cs @@ -1,2873 +1,2874 @@ -// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Text; -using SharpDX.IO; -using SharpDX.Mathematics; -using SharpDX.Multimedia; - -namespace SharpDX.Toolkit.Serialization -{ - /// - /// Serializer action. - /// - /// The value to read or write. - /// The serializer. - public delegate void SerializerAction(ref object value, BinarySerializer serializer); - - /// - /// This class provides serialization methods for types implementing the . - /// - /// - /// BinarySerializer is a basic binary serializer with the following features: - ///
    - ///
  • 10x times faster and smaller than default System Serialization and Xml Serialization.
  • - ///
  • Supports for all primitive types, array/List<T>/Dictionary of primitive types, custom data via (struct or class) and array/List/Dictionary of custom data.
  • - ///
  • Optimized binary format, data serialized to the strict minimum.
  • - ///
  • Should be compatible with Win8/WinRT, Desktop.
  • - ///
  • Not reflection based serializer, but fully compile time serializer.
  • - ///
  • Format could be read back from C/C++.
  • - /// - ///
- ///
- public partial class BinarySerializer : Component - { - private int chunkCount; - private Chunk[] chunks; - private Chunk currentChunk; - private readonly Dictionary dynamicMapToType; - private readonly Dictionary dynamicMapToFourCC; - private readonly Dictionary objectToPosition; - private readonly Dictionary positionToObject; - private Dictionary mapTag; - private int allowIdentityReferenceCount; - - // Fields used to serialize strings - private System.Text.Encoding encoding; - private System.Text.Encoder encoder; - private System.Text.Decoder decoder; - private const int LargeByteBufferSize = 1024; - private byte[] largeByteBuffer; - private int maxChars; // max # of chars we can put in _largeByteBuffer - private char[] largeCharBuffer; - private int maxCharSize; // From LargeByteBufferSize & Encoding - - public delegate void SerializerPrimitiveAction(ref T value); - - public delegate void SerializerTypeAction(ref T value, BinarySerializer serializer); - - - public delegate object ReadRef(BinarySerializer serializer); - - public delegate void WriteRef(object value, BinarySerializer serializer); - - - /// - /// Underlying stream this instance is reading/writing to. - /// - public Stream Stream { get; private set; } - - /// - /// Reader used to directly read from the underlying stream. - /// - public BinaryReader Reader { get; private set; } - - /// - /// Gets the reader and throws an exception if this serializer is in Write mode. - /// - /// The context object that requires a Reader. - /// A BinaryReader. - /// context - /// If this reader is not in read mode - public BinaryReader ReaderOnly(object context) - { - if (context == null) - { - throw new ArgumentNullException("context"); - } - if (Mode != SerializerMode.Read) - { - throw new InvalidOperationException(string.Format("[{0}] is only expecting Read-Only BinarySerializer", context.GetType().Name)); - } - return Reader; - } - - /// - /// Writer used to directly write to the underlying stream. - /// - public BinaryWriter Writer { get; private set; } - - public ArrayLengthType ArrayLengthType { get; set; } - - private SerializerMode mode; - - - /// - /// Initializes a new instance of the class. - /// - /// The stream to read or write to. - /// The read or write mode. - public BinarySerializer(Stream stream, SerializerMode mode) : this(stream, mode, SharpDX.Text.Encoding.ASCII) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The stream to read or write to. - /// The read or write mode. - /// Default encoding used for strings. This parameter can be overriden later using Encoding property. - public BinarySerializer(Stream stream, SerializerMode mode, System.Text.Encoding encoding) - { - // Setup the encoding used for strings. - Encoding = encoding; - - // Allocate dictionary used for dynamic serialization. - dynamicMapToType = new Dictionary(); - dynamicMapToFourCC = new Dictionary(); - - // For serializing reference - objectToPosition = new Dictionary(new IdentityEqualityComparer()); - positionToObject = new Dictionary(); - - // Allocate the chunk array and initial chunk. - chunks = new Chunk[8]; - Stream = stream; - - // Setup the mode. - Mode = mode; - CurrentChunk = new Chunk { ChunkIndexStart = 0 }; - - chunks[chunkCount] = CurrentChunk; - chunkCount++; - - - // Register all default dynamics. - foreach (var defaultDynamic in DefaultDynamics) - RegisterDynamic(defaultDynamic); - - RegisterPartialDynamics(); - } - - partial void RegisterPartialDynamics(); - - /// - /// Gets a tag value with the specified key. - /// - /// The tag key. - /// A tag value associated to a key - public object GetTag(object key) - { - if (mapTag == null) - return null; - object value; - mapTag.TryGetValue(key, out value); - return value; - } - - /// - /// Determines whether a tag with a specified key is already stored. - /// - /// The key. - /// true if a tag with a specified key is already stored; otherwise, false. - public bool HasTag(object key) - { - if (mapTag == null) - return false; - return mapTag.ContainsKey(key); - } - - /// - /// Removes a tag with the specified key. - /// - /// The key. - public void RemoveTag(object key) - { - if (mapTag == null) - return; - mapTag.Remove(key); - } - - /// - /// Sets a tag value with the specified key. - /// - /// The key. - /// The value. - /// - public void SetTag(object key, object value) - { - if (mapTag == null) - mapTag = new Dictionary(); - // Always remove previous key before inserting new one - mapTag.Remove(key); - mapTag.Add(key, value); - } - - /// - /// Gets or sets the serialization mode. - /// - /// The serialization mode. - public SerializerMode Mode - { - get { return mode; } - set - { - mode = value; - // Create Reader or writer - if (Mode == SerializerMode.Read) - { - Reader = Reader ?? new BinaryReader(Stream); - } - else - { - Writer = Writer ?? new BinaryWriter(Stream); - } - } - } - - /// - /// Gets or sets the encoding used to serialized strings. - /// - /// The encoding. - /// When setting a null encoding - public System.Text.Encoding Encoding - { - get { return encoding; } - set { - if (ReferenceEquals(value, null)) - throw new ArgumentNullException("value"); - - if (!ReferenceEquals(encoding, value)) - { - encoding = value; - encoder = encoding.GetEncoder(); - decoder = encoding.GetDecoder(); - maxCharSize = encoding.GetMaxCharCount(LargeByteBufferSize); - } - } - } - - /// - /// Enables to serialize an object only once using object reference. Default is false. - /// - /// true if [allow null]; otherwise, false. - /// If an invalid matching pair of true/false is detected. - public bool AllowIdentity - { - get { return allowIdentityReferenceCount > 0; } - set - { - allowIdentityReferenceCount += value ? 1 : -1; - if (allowIdentityReferenceCount < 0) - throw new InvalidOperationException("Invalid call to AllowIdentity. Must match true/false in pair."); - } - } - - /// - /// Register a dynamic serializer for a particular type implementing the interface and having the . - /// - /// Type of the element to serialize. - public void RegisterDynamic() where T : IDataSerializable, new() - { -#if W8CORE - var attribute = Utilities.GetCustomAttribute(typeof (T).GetTypeInfo()); -#else - var attribute = Utilities.GetCustomAttribute(typeof (T)); -#endif - if (attribute == null) - throw new ArgumentException("Type T doesn't have DynamicSerializerAttribute", "T"); - - RegisterDynamic(attribute.Id); - } - - /// - /// Register a dynamic serializer for a particular type implementing the interface. - /// - /// Type of the element to serialize. - /// The id to use for serializing T. - public void RegisterDynamic(FourCC id) where T : IDataSerializable, new() - { - RegisterDynamic(GetDynamic(id)); - } - - /// - /// Register a dynamic array serializer for a particular type implementing the interface. - /// - /// Type of the element in the array. - /// The id to use for serializing T[]. - public void RegisterDynamicArray(FourCC id) where T : IDataSerializable, new() - { - RegisterDynamic(GetDynamicArray(id)); - } - - /// - /// Register a dynamic List<T> serializer for a particular type implementing the interface. - /// - /// Type of the element in the List<T>. - /// The id to use for serializing List<T>. - public void RegisterDynamicList(FourCC id) where T : IDataSerializable, new() - { - RegisterDynamic(GetDynamicList(id)); - } - - /// - /// Register a dynamic serializer using an external action. - /// - /// Type of the element to serialize. - /// The id to use for serializing T. - /// The serializer. - public void RegisterDynamic(FourCC id, SerializerAction serializer) where T : new() - { - var dynamicSerializer = new Dynamic {Id = id, Type = typeof (T), DynamicSerializer = serializer}; - dynamicSerializer.Reader = dynamicSerializer.DynamicReader; - dynamicSerializer.Writer = dynamicSerializer.DynamicWriter; - RegisterDynamic(dynamicSerializer); - } - - private delegate void TypedSerializerAction(ref T value, BinarySerializer serializer); - - private void RegisterDynamic(FourCC id, TypedSerializerAction dynamicSerializer) where T : new() - { - var dyn = new Dynamic { Id = id, Type = typeof(T) }; - dyn.Reader = (serializer) => - { - T value = new T(); - dynamicSerializer(ref value, serializer); - return value; - }; - dyn.Writer = (value, serializer) => - { - T valueT = (T)value; - dynamicSerializer(ref valueT, serializer); - }; - RegisterDynamic(dyn); - } - - /// - /// Begin to serialize a a new chunk. - /// - /// The chunk id. - /// If the chuck to read is not the expecting chunk. - /// - /// A Chunk is an identifiable portion of data that will serialized. Chunk are useful to encapsulate a variable - /// data (and check for the presence of the chunk Id). Chunk are storing a 4 bytes identifier and the length of - /// the chunk before reading/writing actual data. - /// - public void BeginChunk(FourCC chunkId) - { - // Allocate new Chunk - if (chunks[chunkCount] == null) - { - CurrentChunk = new Chunk(); - chunks[chunkCount] = CurrentChunk; - } - else - { - CurrentChunk = chunks[chunkCount]; - } - - // Go to next chunk - chunkCount++; - - // Sets the current id - CurrentChunk.Id = chunkId; - - // Create a new chunk - if (Mode == SerializerMode.Write) - CurrentChunk.ChunkIndexStart = Stream.Position; - - if (chunkCount >= chunks.Length) - { - var temp = new Chunk[chunks.Length * 2]; - Array.Copy(chunks, temp, chunks.Length); - chunks = temp; - } - - if (Mode == SerializerMode.Write) - { - // Write the chunkId to the current chunk - Writer.Write((int) chunkId); - // write temporary null size - Writer.Write(0); - } - else - { - var chunkIdRead = Reader.ReadInt32(); - if (chunkIdRead != chunkId) - throw new InvalidChunkException(chunkIdRead, chunkId); - - uint sizeOfChunk = (uint)Reader.ReadUInt32(); - CurrentChunk.ChunkIndexEnd = Stream.Position + sizeOfChunk; - } - } - - - /// - /// Ends a chunk. - /// - /// If there EndChunk is called without a previous BeginChunk. - /// If the size of data read from the chunk is different from chunk size. - public void EndChunk() - { - if (chunkCount <= 1) - throw new InvalidOperationException("EndChunk() called without BeginChunk()"); - - var previousChunk = CurrentChunk; - chunkCount--; - CurrentChunk = chunks[chunkCount - 1]; - - if (Mode == SerializerMode.Write) - { - // Write the size of this chunk - long currentPosition = Stream.Position; - Stream.Position = previousChunk.ChunkIndexStart + 4; - Writer.Write((uint)(currentPosition - Stream.Position - 4)); - Stream.Position = currentPosition; - } - else - { - if (previousChunk.ChunkIndexEnd != Stream.Position) - throw new IOException(string.Format("Unexpected size when reading chunk [{0}]", CurrentChunk.Id)); - } - } - - - /// - /// Deserialize a data from the underlying stream. - /// - /// Type of the data to load. - /// An instance of the loaded data. - public T Load() where T : IDataSerializable, new() - { - ResetStoredReference(); - - Mode = SerializerMode.Read; - T value = default(T); - Serialize(ref value); - return value; - } - - /// - /// Serializes the specified value to the underlying stream. - /// - /// Type of the data to save. - /// The value to save. - public void Save(T value) where T : IDataSerializable, new() - { - ResetStoredReference(); - - Mode = SerializerMode.Write; - Serialize(ref value); - Flush(); - } - - /// - /// Flush the underlying - /// - public void Flush() - { - Writer.Flush(); - } - - /// - /// Serializes a dynamic value that can be nullable. - /// - /// Known type of the value to serialize. The known type is not the runtime type that will be actually serialized. - /// The value to serialize based on its runtime type. - public void SerializeDynamic(ref T value) - { - SerializeDynamic(ref value, SerializeFlags.Dynamic | SerializeFlags.Nullable); - } - - /// - /// Serializes a dynamic value. - /// - /// Known type of the value to serialize. The known type is not the runtime type that will be actually serialized. - /// The value to serialize based on its runtime type. - /// Type of serialization, see . - public void SerializeDynamic(ref T value, SerializeFlags serializeFlags) - { - int storeObjectRef; - if (SerializeIsNull(ref value, out storeObjectRef, serializeFlags | SerializeFlags.Dynamic)) - return; - - SerializeRawDynamic(ref value); - } - - /// - /// Serializes a static value implementing the interface. - /// - /// Type of the data to serialize. - /// The value to serialize - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref T value, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() - { - int storeObjectRef; - if (SerializeIsNull(ref value, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Read) - value = new T(); - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(value, storeObjectRef); - - value.Serialize(this); - } - - /// - /// Serializes a static value implementing the interface. Unlike , - /// this method doesn't allocate a new instance when reading but use the reference value. - /// - /// Type of the data to serialize. - /// The value to serialize - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void SerializeWithNoInstance(ref T value, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable - { - int storeObjectRef; - if (SerializeIsNull(ref value, out storeObjectRef, serializeFlags)) - return; - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(value, storeObjectRef); - - value.Serialize(this); - } - - /// - /// Serializes an enum value. - /// - /// Type of the enum to serialize. - /// The value to serialize - /// If type T is not an enum. - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public unsafe void SerializeEnum(ref T value) where T : struct, IComparable, IFormattable - { - if (!Utilities.IsEnum(typeof(T))) - throw new ArgumentException("T generic parameter must be a valid enum", "value"); - - var pValue = Interop.Fixed(ref value); - - switch (Utilities.SizeOf()) - { - case 1: - { - Serialize(ref *(byte*)pValue); - break; - } - case 2: - { - Serialize(ref *(short*)pValue); - break; - } - case 4: - { - Serialize(ref *(int*)pValue); - break; - } - case 8: - { - Serialize(ref *(long*)pValue); - break; - } - } - } - - /// - /// Serializes an array of primitives using serialization methods implemented by this instance for each item in the array. - /// - /// Type of the primitive data to serialize. - /// An array of primitive value to serialize - /// The serializer to user to serialize the T values. - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref T[] valueArray, SerializerPrimitiveAction serializer, SerializeFlags serializeFlags = SerializeFlags.Normal) - { - int storeObjectRef; - if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - WriteArrayLength((int)valueArray.Length); - for (int i = 0; i < valueArray.Length; i++) - serializer(ref valueArray[i]); - } - else - { - var count = ReadArrayLength(); - valueArray = new T[count]; - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - for (int index = 0; index < count; index++) - serializer(ref valueArray[index]); - } - } - - /// - /// Serializes count elements in an array of primitives using serialization methods implemented by this instance for each item in the array. - /// - /// Type of the primitive data to serialize. - /// An array of primitive value to serialize - /// Count elements to serialize. See remarks. - /// The serializer to user to serialize the T values. - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value.
- /// Caution: Also unlike the plain array version, the count is not serialized. This method is useful - /// when we want to serialize the count of an array separately from the array. - ///
- public void Serialize(ref T[] valueArray, int count, SerializerPrimitiveAction serializer, SerializeFlags serializeFlags = SerializeFlags.Normal) - { - int storeObjectRef; - if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - for (int i = 0; i < count; i++) - serializer(ref valueArray[i]); - } - else - { - valueArray = new T[count]; - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - for (int index = 0; index < count; index++) - serializer(ref valueArray[index]); - } - } - - /// - /// Serializes an array of static values that are implementing the interface. - /// - /// Type of the data to serialize. - /// An array of value to serialize - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref T[] valueArray, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() - { - int storeObjectRef; - if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - WriteArrayLength(valueArray.Length); - for (int i = 0; i < valueArray.Length; i++) - Serialize(ref valueArray[i], serializeFlags); - } - else - { - var count = ReadArrayLength(); - valueArray = new T[count]; - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - for (int index = 0; index < count; index++) - Serialize(ref valueArray[index], serializeFlags); - } - } - - /// - /// Serializes an array of static values that are implementing the interface. - /// - /// Type of the data to serialize. - /// An array of value to serialize - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void SerializeWithNoInstance(ref T[] valueArray, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable - { - int storeObjectRef; - if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - WriteArrayLength(valueArray.Length); - for (int i = 0; i < valueArray.Length; i++) - SerializeWithNoInstance(ref valueArray[i], serializeFlags); - } - else - { - var count = ReadArrayLength(); - valueArray = new T[count]; - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - for (int index = 0; index < count; index++) - SerializeWithNoInstance(ref valueArray[index], serializeFlags); - } - } - - /// - /// Serializes count elements in an array of static values that are implementing the interface. - /// - /// Type of the data to serialize. - /// An array of value to serialize - /// Count elements to serialize. See remarks. - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value.
- /// Caution: Also unlike the plain array version, the count is not serialized. This method is useful - /// when we want to serialize the count of an array separately from the array. - ///
- public void Serialize(ref T[] valueArray, int count, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() - { - int storeObjectRef; - if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - for (int i = 0; i < count; i++) - Serialize(ref valueArray[i], serializeFlags); - } - else - { - valueArray = new T[count]; - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - for (int index = 0; index < count; index++) - Serialize(ref valueArray[index], serializeFlags); - } - } - - /// - /// Serializes an array of bytes. - /// - /// An array of bytes to serialize - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref byte[] valueArray, SerializeFlags serializeFlags = SerializeFlags.Normal) - { - int storeObjectRef; - if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - WriteArrayLength(valueArray.Length); - Writer.Write(valueArray); - } - else - { - int count = ReadArrayLength(); - valueArray = new byte[count]; - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - Reader.Read(valueArray, 0, count); - } - } - - /// - /// Serializes an array of bytes. - /// - /// An array of bytes to serialize - /// Count elements to serialize. See remarks. - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value.
- /// Caution: Also unlike the plain array version, the count is not serialized. This method is useful - /// when we want to serialize the count of an array separately from the array. - ///
- public void Serialize(ref byte[] valueArray, int count, SerializeFlags serializeFlags = SerializeFlags.Normal) - { - int storeObjectRef; - if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - Writer.Write(valueArray, 0, count); - } - else - { - valueArray = new byte[count]; - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); - - Reader.Read(valueArray, 0, count); - } - } - - /// - /// Serializes a list of static values that are implementing the interface. - /// - /// Type of the data to serialize. - /// A list of value to serialize - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref List valueList, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() - { - int storeObjectRef; - if (SerializeIsNull(ref valueList, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); - - WriteArrayLength(valueList.Count); - foreach (var value in valueList) - { - T localValue = value; - Serialize(ref localValue); - } - } - else - { - var count = ReadArrayLength(); - valueList = new List(count); - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); - - for (int index = 0; index < count; index++) - { - var value = default(T); - Serialize(ref value); - valueList.Add(value); - } - } - } - - /// - /// Serializes a list of static values that are implementing the interface. - /// - /// Type of the data to serialize. - /// A list of value to serialize - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void SerializeThis(List valueList, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() - { - if (Mode == SerializerMode.Write) - { - WriteArrayLength(valueList.Count); - foreach (var value in valueList) - { - T localValue = value; - Serialize(ref localValue); - } - } - else - { - var count = ReadArrayLength(); - for (int index = 0; index < count; index++) - { - var value = default(T); - Serialize(ref value); - valueList.Add(value); - } - } - } - - /// - /// Serializes a list of primitive values using a specific serializer method from this instance. - /// - /// Type of the data to serialize. - /// A list of value to serialize - /// A method of this instance to serialize the primitive T type - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref List valueList, SerializerPrimitiveAction serializerMethod, SerializeFlags serializeFlags = SerializeFlags.Normal) - { - int storeObjectRef; - if (SerializeIsNull(ref valueList, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); - - WriteArrayLength(valueList.Count); - foreach (var value in valueList) - { - T localValue = value; - serializerMethod(ref localValue); - } - } - else - { - var count = ReadArrayLength(); - EnsureList(ref valueList, count); - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); - - for (int i = 0; i < count; i++) - { - var localValue = default(T); - serializerMethod(ref localValue); - valueList.Add(localValue); - } - } - } - - /// - /// Serializes count elements from a list of static values that are implementing the interface. - /// - /// Type of the data to serialize. - /// A list of value to serialize - /// Count elements to serialize. See remarks. - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value.
- /// Caution: Also unlike the plain array version, the count is not serialized. This method is useful - /// when we want to serialize the count of an array separately from the array. - ///
- public void Serialize(ref List valueList, int count, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() - { - int storeObjectRef; - if (SerializeIsNull(ref valueList, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); - - for (int i = 0; i < count; i++) - { - T localValue = valueList[i]; - Serialize(ref localValue, serializeFlags); - } - } - else - { - EnsureList(ref valueList, count); - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); - - for (int index = 0; index < count; index++) - { - var value = default(T); - Serialize(ref value, serializeFlags); - valueList.Add(value); - } - } - } - - /// - /// Serializes count elements from a list of primitive values using a specific serializer method from this instance. - /// - /// Type of the data to serialize. - /// A list of value to serialize - /// A method of this instance to serialize the primitive T type - /// Count elements to serialize. See remarks. - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value.
- /// Caution: Also unlike the plain array version, the count is not serialized. This method is useful - /// when we want to serialize the count of an array separately from the array. - ///
- public void Serialize(ref List valueList, int count, SerializerPrimitiveAction serializerMethod, SerializeFlags serializeFlags = SerializeFlags.Normal) - { - int storeObjectRef; - if (SerializeIsNull(ref valueList, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); - - for (int i = 0; i < count; i++) - { - T localValue = valueList[i]; - serializerMethod(ref localValue); - } - } - else - { - EnsureList(ref valueList, count); - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); - - for (int i = 0; i < count; i++) - { - var localValue = default(T); - serializerMethod(ref localValue); - valueList.Add(localValue); - } - } - } - - private void EnsureList(ref List valueList, int count) - { - // If there is a list provided, use it in place instead of allocating a new one - if (valueList != null) - { - valueList.Clear(); - if (valueList.Capacity < count) - { - valueList.Capacity = count; - } - } - else - { - valueList = new List(count); - } - } - - /// - /// Serializes a dictionary of key/values that are both implementing the interface. - /// - /// Type of key to serialize. - /// Type of value to serialize. - /// A dictionary to serialize - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref Dictionary dictionary, SerializeFlags serializeFlags = SerializeFlags.Normal) - where TKey : IDataSerializable, new() - where TValue : IDataSerializable, new() - { - int storeObjectRef; - if (SerializeIsNull(ref dictionary, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); - - WriteArrayLength(dictionary.Count); - foreach (var value in dictionary) - { - TKey localKey = value.Key; - TValue localValue = value.Value; - localKey.Serialize(this); - localValue.Serialize(this); - } - } - else - { - var count = ReadArrayLength(); - dictionary = new Dictionary(count); - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); - - for (int i = 0; i < count; i++) - { - TKey localKey = default(TKey); - TValue localValue = default(TValue); - localKey.Serialize(this); - localValue.Serialize(this); - dictionary.Add(localKey, localValue); - } - } - } - - /// - /// Serializes a dictionary of key/values. - /// - /// Type of key to serialize that is implementing the interface. - /// Type of primitive value with its associated serializer. - /// A dictionary to serialize - /// Serializer used for the TValue. - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref Dictionary dictionary, SerializerPrimitiveAction valueSerializer, SerializeFlags serializeFlags = SerializeFlags.Normal) where TKey : IDataSerializable, new() - { - int storeObjectRef; - if (SerializeIsNull(ref dictionary, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); - - WriteArrayLength(dictionary.Count); - foreach (var value in dictionary) - { - TKey localKey = value.Key; - TValue localValue = value.Value; - localKey.Serialize(this); - valueSerializer(ref localValue); - } - } - else - { - var count = ReadArrayLength(); - dictionary = new Dictionary(count); - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); - - for (int i = 0; i < count; i++) - { - TKey localKey = Utilities.IsValueType(typeof(TKey)) ? default(TKey) : new TKey(); - TValue localValue = default(TValue); - localKey.Serialize(this); - valueSerializer(ref localValue); - dictionary.Add(localKey, localValue); - } - } - } - - /// - /// Serializes a dictionary of key/values. - /// - /// Type of primitive value with its associated serializer. - /// Type of value to serialize that is implementing the interface. - /// A dictionary to serialize - /// Serializer used for the TKey. - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref Dictionary dictionary, SerializerPrimitiveAction keySerializer, SerializeFlags serializeFlags = SerializeFlags.Normal) where TValue : IDataSerializable, new() - { - int storeObjectRef; - if (SerializeIsNull(ref dictionary, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); - - WriteArrayLength(dictionary.Count); - foreach (var value in dictionary) - { - TKey localKey = value.Key; - TValue localValue = value.Value; - keySerializer(ref localKey); - localValue.Serialize(this); - } - } - else - { - var count = ReadArrayLength(); - dictionary = new Dictionary(count); - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); - - for (int i = 0; i < count; i++) - { - TKey localKey = default(TKey); - TValue localValue = Utilities.IsValueType(typeof(TValue)) ? default(TValue) : new TValue(); - keySerializer(ref localKey); - localValue.Serialize(this); - dictionary.Add(localKey, localValue); - } - } - } - - /// - /// Serializes a dictionary of key/values. - /// - /// Type of primitive key with its associated serializer. - /// Type of primitive value with its associated serializer. - /// A dictionary to serialize - /// Serializer used for the TKey. - /// Serializer used for the TValue. - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref Dictionary dictionary, SerializerPrimitiveAction keySerializer, SerializerPrimitiveAction valueSerializer, SerializeFlags serializeFlags = SerializeFlags.Normal) - { - int storeObjectRef; - if (SerializeIsNull(ref dictionary, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); - - WriteArrayLength(dictionary.Count); - foreach (var value in dictionary) - { - TKey localKey = value.Key; - TValue localValue = value.Value; - keySerializer(ref localKey); - valueSerializer(ref localValue); - } - } - else - { - var count = ReadArrayLength(); - dictionary = new Dictionary(count); - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); - - for (int i = 0; i < count; i++) - { - TKey localKey = default(TKey); - TValue localValue = default(TValue); - keySerializer(ref localKey); - valueSerializer(ref localValue); - dictionary.Add(localKey, localValue); - } - } - } - - /// - /// Serializes a single string value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// This string is serialized with the current set on this instance. - /// - public void Serialize(ref string value) - { - Serialize(ref value, false); - } - - /// - /// Serializes a single string value. - /// - /// The value to serialize - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// This string is serialized with the current set on this instance. - /// - public void Serialize(ref string value, SerializeFlags serializeFlags) - { - Serialize(ref value, false, serializeFlags); - } - - /// - /// Serializes a single string value. - /// - /// The value to serialize - /// Write a null byte at the end of the string. - /// Type of serialization, see . - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// This string is serialized with the current set on this instance. - /// - public void Serialize(ref string value, bool writeNullTerminatedString, SerializeFlags serializeFlags = SerializeFlags.Normal) - { - int storeObjectRef = -1; - // If len < 0, then we need to check for null/identity. - if (SerializeIsNull(ref value, out storeObjectRef, serializeFlags)) - return; - - if (Mode == SerializerMode.Write) - { - WriteString(value, writeNullTerminatedString, -1); - } - else - { - value = ReadString(writeNullTerminatedString, -1); - } - - // Store ObjectRef - if (storeObjectRef >= 0) StoreObjectRef(value, storeObjectRef); - } - - /// - /// Serializes a single fixed length string value. - /// - /// The value to serialize - /// Read/write a specific number of characters. - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// This string is serialized with the current set on this instance. - /// - public void Serialize(ref string value, int len) - { - if (Mode == SerializerMode.Write) - { - WriteString(value, false, len); - } - else - { - value = ReadString(false, len); - } - } - - /// - /// Serializes a single boolean value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref bool value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadBoolean(); - } - } - - /// - /// Serializes a single byte value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref byte value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadByte(); - } - } - - /// - /// Serializes a single sbyte value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref sbyte value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadSByte(); - } - } - - /// - /// Serializes a single short value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref short value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadInt16(); - } - } - - /// - /// Serializes a single ushort value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref ushort value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadUInt16(); - } - } - - /// - /// Serializes a single int value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref int value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadInt32(); - } - } - - /// - /// Serializes a single int as a packed value (from 1 byte to 5 byte. if value < 128, then 1 byte...etc.) - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void SerializePackedInt(ref int value) - { - if (Mode == SerializerMode.Write) - { - Write7BitEncodedInt(value); - } - else - { - value = Read7BitEncodedInt(); - } - } - - /// - /// Serializes a memory region. - /// - /// The pointer to an unmanaged memory region. For read operation, this pointer must be allocated by the caller. - /// If the end of stream was reached before reading all the bytes. - /// Note that depending on the serialization , this method reads or writes the value. - /// This method doesn't serialize the sizeInBytes of the region, so the size must be serialized separately. - /// - public void SerializeMemoryRegion(DataPointer dataRegion) - { - SerializeMemoryRegion(dataRegion.Pointer, dataRegion.Size); - } - - /// - /// Serializes a memory region. - /// - /// The data pointer. For read operation, this pointer must be allocated by the caller. - /// The size in bytes. See remarks. - /// If the end of stream was reached before reading all the bytes. - /// Note that depending on the serialization , this method reads or writes the value. - /// This method doesn't serialize the sizeInBytes of the region, so the size must be serialized separately. - /// - public unsafe void SerializeMemoryRegion(IntPtr dataPointer, int sizeInBytes) - { - // Provides optimized path for special streams - var fileStream = Stream as NativeFileStream; - if (fileStream != null) - { - if (Mode == SerializerMode.Write) - { - fileStream.Write(dataPointer, 0, sizeInBytes); - } - else - { - fileStream.Read(dataPointer, 0, sizeInBytes); - } - } - else if (Stream is DataStream) - { - if (Mode == SerializerMode.Write) - { - ((DataStream)Stream).Write(dataPointer, 0, sizeInBytes); - } - else - { - ((DataStream)Stream).Read(dataPointer, 0, sizeInBytes); - } - } - else - { - const int internalBufferSize = 32768; - - if (largeByteBuffer == null) - largeByteBuffer = new byte[internalBufferSize]; - - if (largeByteBuffer.Length < internalBufferSize) - largeByteBuffer = new byte[internalBufferSize]; - - if (Mode == SerializerMode.Write) - { - var remainingSize = sizeInBytes; - while (remainingSize > 0) - { - var maxSize = remainingSize < largeByteBuffer.Length ? remainingSize : largeByteBuffer.Length; - Utilities.Read(dataPointer, largeByteBuffer, 0, maxSize); - Stream.Write(largeByteBuffer, 0, maxSize); - - dataPointer = (IntPtr) ((byte*) dataPointer + maxSize); - remainingSize -= maxSize; - } - } - else - { - var remainingSize = sizeInBytes; - while (remainingSize > 0) - { - var maxSize = remainingSize < largeByteBuffer.Length ? remainingSize : largeByteBuffer.Length; - - if (Stream.Read(largeByteBuffer, 0, maxSize) != maxSize) - throw new EndOfStreamException(); - Utilities.Write(dataPointer, largeByteBuffer, 0, maxSize); - - dataPointer = (IntPtr)((byte*)dataPointer + maxSize); - remainingSize -= maxSize; - } - } - } - } - - /// - /// Serializes a single uint value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref uint value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadUInt32(); - } - } - - /// - /// Serializes a single long value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref long value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadInt64(); - } - } - - /// - /// Serializes a single ulong value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref ulong value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadUInt64(); - } - } - - /// - /// Serializes a single char value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref char value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadChar(); - } - } - - /// - /// Serializes a single float value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref float value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadSingle(); - } - } - - /// - /// Serializes a single double value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref double value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value); - } - else - { - value = Reader.ReadDouble(); - } - } - - /// - /// Serializes a single DateTime value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref DateTime value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value.ToBinary()); - } - else - { - value = new DateTime(Reader.ReadInt64()); - } - } - - /// - /// Serializes a single Guid value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref Guid value) - { - if (Mode == SerializerMode.Write) - { - Writer.Write(value.ToByteArray()); - } - else - { - value = new Guid(Reader.ReadBytes(16)); - } - } - - /// - /// Serializes a single value. - /// - /// The value to serialize - /// - /// Note that depending on the serialization , this method reads or writes the value. - /// - public void Serialize(ref FourCC value) - { - uint valueUint = (uint)value; - Serialize(ref valueUint); - - if (Mode == SerializerMode.Read) - { - value = valueUint; - } - } - - private bool SerializeIsNull(ref T value, out int storeObjectReference, SerializeFlags flags) - { - storeObjectReference = -1; - - // If value type, no null possible - if (Utilities.IsValueType(typeof(T))) - return false; - - bool isNullValue = ReferenceEquals(value, null); - if ((flags & SerializeFlags.Nullable) != 0 || allowIdentityReferenceCount > 0) - { - // Handle write - if (Mode == SerializerMode.Write) - { - // Handle reference - if (!isNullValue && allowIdentityReferenceCount > 0 && (flags & SerializeFlags.Dynamic) == 0) - { - int position; - if (objectToPosition.TryGetValue(value, out position)) - { - Writer.Write((byte)2); - Write7BitEncodedInt(position); - return true; - } - - // Register reference - objectToPosition.Add(value, (int)Stream.Position); - } - - Writer.Write((byte)(isNullValue ? 0 : 1)); - - return isNullValue; - } - else - { - // Handle read - value = default(T); - int objectPosition = (int)Stream.Position; - int objectReferenceHeader = Reader.ReadByte(); - switch (objectReferenceHeader) - { - case 1: - { - if (allowIdentityReferenceCount > 0 && (flags & SerializeFlags.Dynamic) == 0) - storeObjectReference = objectPosition; - } - break; - - case 2: - { - if (allowIdentityReferenceCount == 0) - throw new InvalidOperationException("Can't read serialized reference when SerializeReference is off"); - - // Read object position from stream - objectPosition = Read7BitEncodedInt(); - object localValue; - if (!positionToObject.TryGetValue(objectPosition, out localValue)) - throw new InvalidOperationException(string.Format("Can't find serialized reference at position [{0}]", objectPosition)); - - // Set Object Reference - value = (T) localValue; - - // Set it as null - objectReferenceHeader = 0; - } - break; - } - - return objectReferenceHeader == 0; - } - } - - // Null is not allowed - if (isNullValue && Mode == SerializerMode.Write) - { - throw new ArgumentNullException("value"); - } - - return false; - } - - private void SerializeRawDynamic(ref T value, bool noDynamic = false) - { - if (Mode == SerializerMode.Write) - { - var type = (noDynamic) ? typeof (T) : value.GetType(); - Dynamic dyn; - if (!dynamicMapToFourCC.TryGetValue(type, out dyn)) - throw new IOException(string.Format("Type [{0}] is not registered as dynamic", type)); - - // Write the id of the object - if (!noDynamic) - Writer.Write((int) dyn.Id); - - dyn.Writer(value, this); - } - else - { - // Gets the id for this dynamic - Dynamic dyn; - if (noDynamic) - { - var type = typeof (T); - if (!dynamicMapToFourCC.TryGetValue(type, out dyn)) - throw new IOException(string.Format("Type [{0}] is not registered as dynamic", type)); - } - else - { - var id = (FourCC) Reader.ReadInt32(); - - if (!dynamicMapToType.TryGetValue(id, out dyn)) - throw new IOException(string.Format("Type [{0}] is not registered as dynamic", id)); - } - - value = (T) dyn.Reader(this); - } - } - - private void RegisterDynamic(Dynamic dynamic) - { - dynamicMapToFourCC.Add(dynamic.Type, dynamic); - dynamicMapToType.Add(dynamic.Id, dynamic); - } - - - #region Primitive Array Readers - - private static object ReaderIntArray(BinarySerializer serializer) - { - int[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderUIntArray(BinarySerializer serializer) - { - uint[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderShortArray(BinarySerializer serializer) - { - short[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderUShortArray(BinarySerializer serializer) - { - ushort[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderLongArray(BinarySerializer serializer) - { - long[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderULongArray(BinarySerializer serializer) - { - ulong[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderBoolArray(BinarySerializer serializer) - { - bool[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderFloatArray(BinarySerializer serializer) - { - float[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderDoubleArray(BinarySerializer serializer) - { - double[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderDateTimeArray(BinarySerializer serializer) - { - DateTime[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderGuidArray(BinarySerializer serializer) - { - Guid[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderObjectArray(BinarySerializer serializer) - { - object[] value = null; - serializer.Serialize(ref value, serializer.SerializeDynamic); - return value; - } - - private static object ReaderCharArray(BinarySerializer serializer) - { - char[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderStringArray(BinarySerializer serializer) - { - string[] value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderByteArray(BinarySerializer serializer) - { - byte[] value = null; - serializer.Serialize(ref value); - return value; - } - - private static object ReaderSByteArray(BinarySerializer serializer) - { - sbyte[] values = null; - serializer.Serialize(ref values, serializer.Serialize); - return values; - } - - #endregion - - #region Primitive Array Writer - - private static void WriterIntArray(object value, BinarySerializer serializer) - { - var valueTyped = (int[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterUIntArray(object value, BinarySerializer serializer) - { - var valueTyped = (uint[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterShortArray(object value, BinarySerializer serializer) - { - var valueTyped = (short[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterUShortArray(object value, BinarySerializer serializer) - { - var valueTyped = (ushort[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterLongArray(object value, BinarySerializer serializer) - { - var valueTyped = (long[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterULongArray(object value, BinarySerializer serializer) - { - var valueTyped = (ulong[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterSByteArray(object value, BinarySerializer serializer) - { - var valueTyped = (sbyte[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterStringArray(object value, BinarySerializer serializer) - { - var valueTyped = (string[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterCharArray(object value, BinarySerializer serializer) - { - var valueTyped = (char[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterBoolArray(object value, BinarySerializer serializer) - { - var valueTyped = (bool[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterFloatArray(object value, BinarySerializer serializer) - { - var valueTyped = (float[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterDoubleArray(object value, BinarySerializer serializer) - { - var valueTyped = (double[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterDateTimeArray(object value, BinarySerializer serializer) - { - var valueTyped = (DateTime[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterGuidArray(object value, BinarySerializer serializer) - { - var valueTyped = (Guid[]) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterObjectArray(object value, BinarySerializer serializer) - { - var valueTyped = (object[])value; - serializer.Serialize(ref valueTyped, serializer.SerializeDynamic); - } - - private static void WriterByteArray(object value, BinarySerializer serializer) - { - var valueArray = (byte[]) value; - serializer.Serialize(ref valueArray); - } - - #endregion - - #region Primitive List Readers - - private static object ReaderIntList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderUIntList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderShortList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderUShortList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderLongList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderULongList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderBoolList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderFloatList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderDoubleList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderDateTimeList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderGuidList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderObjectList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.SerializeDynamic); - return value; - } - - private static object ReaderCharList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderStringList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderByteList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - private static object ReaderSByteList(BinarySerializer serializer) - { - List value = null; - serializer.Serialize(ref value, serializer.Serialize); - return value; - } - - #endregion - - #region Primitive List Writers - - private static void WriterIntList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterUIntList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterShortList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterUShortList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterLongList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterULongList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterSByteList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterStringList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterCharList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterBoolList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterFloatList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterDoubleList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterDateTimeList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterGuidList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - private static void WriterObjectList(object value, BinarySerializer serializer) - { - var valueTyped = (List)value; - serializer.Serialize(ref valueTyped, serializer.SerializeDynamic); - } - - private static void WriterByteList(object value, BinarySerializer serializer) - { - var valueTyped = (List) value; - serializer.Serialize(ref valueTyped, serializer.Serialize); - } - - #endregion - - #region Primitive Readers - - private static object ReaderInt(BinarySerializer serializer) - { - return serializer.Reader.ReadInt32(); - } - - private static object ReaderUInt(BinarySerializer serializer) - { - return serializer.Reader.ReadUInt32(); - } - - private static object ReaderShort(BinarySerializer serializer) - { - return serializer.Reader.ReadInt16(); - } - - private static object ReaderUShort(BinarySerializer serializer) - { - return serializer.Reader.ReadUInt16(); - } - - private static object ReaderLong(BinarySerializer serializer) - { - return serializer.Reader.ReadInt64(); - } - - private static object ReaderULong(BinarySerializer serializer) - { - return serializer.Reader.ReadUInt64(); - } - - private static object ReaderBool(BinarySerializer serializer) - { - return serializer.Reader.ReadBoolean(); - } - - private static object ReaderByte(BinarySerializer serializer) - { - return serializer.Reader.ReadByte(); - } - - private static object ReaderSByte(BinarySerializer serializer) - { - return serializer.Reader.ReadSByte(); - } - - private static object ReaderString(BinarySerializer serializer) - { - var value = (string) null; - serializer.Serialize(ref value); - return value; - } - - private static object ReaderFloat(BinarySerializer serializer) - { - return serializer.Reader.ReadSingle(); - } - - private static object ReaderDouble(BinarySerializer serializer) - { - return serializer.Reader.ReadDouble(); - } - - private static object ReaderChar(BinarySerializer serializer) - { - return serializer.Reader.ReadChar(); - } - - private static object ReaderDateTime(BinarySerializer serializer) - { - return new DateTime(serializer.Reader.ReadInt64()); - } - - private static object ReaderGuid(BinarySerializer serializer) - { - return new Guid(serializer.Reader.ReadBytes(16)); - } - - #endregion - - #region Primitive Writers - - private static void WriterInt(object value, BinarySerializer serializer) - { - serializer.Writer.Write((int) value); - } - - private static void WriterUInt(object value, BinarySerializer serializer) - { - serializer.Writer.Write((uint) value); - } - - private static void WriterShort(object value, BinarySerializer serializer) - { - serializer.Writer.Write((short) value); - } - - private static void WriterUShort(object value, BinarySerializer serializer) - { - serializer.Writer.Write((ushort) value); - } - - private static void WriterLong(object value, BinarySerializer serializer) - { - serializer.Writer.Write((long) value); - } - - private static void WriterULong(object value, BinarySerializer serializer) - { - serializer.Writer.Write((ulong) value); - } - - private static void WriterByte(object value, BinarySerializer serializer) - { - serializer.Writer.Write((byte) value); - } - - private static void WriterSByte(object value, BinarySerializer serializer) - { - serializer.Writer.Write((sbyte) value); - } - - private static void WriterString(object value, BinarySerializer serializer) - { - var str = (string) value; - serializer.Serialize(ref str); - } - - private static void WriterChar(object value, BinarySerializer serializer) - { - serializer.Writer.Write((char) value); - } - - private static void WriterBool(object value, BinarySerializer serializer) - { - serializer.Writer.Write((bool) value); - } - - private static void WriterFloat(object value, BinarySerializer serializer) - { - serializer.Writer.Write((float) value); - } - - private static void WriterDouble(object value, BinarySerializer serializer) - { - serializer.Writer.Write((double) value); - } - - private static void WriterDateTime(object value, BinarySerializer serializer) - { - serializer.Writer.Write(((DateTime) value).ToBinary()); - } - - private static void WriterGuid(object value, BinarySerializer serializer) - { - serializer.Writer.Write(((Guid) value).ToByteArray()); - } - - #endregion - - #region IDataSerializable Reader and Writer (+ Array and List) - - private static object ReaderDataSerializer(BinarySerializer serializer) where T : IDataSerializable, new() - { - var value = default(T); - serializer.Serialize(ref value); - return value; - } - - private static void WriterDataSerializer(object value, BinarySerializer serializer) where T : IDataSerializable, new() - { - var valueTyped = (T)value; - serializer.Serialize(ref valueTyped); - } - - private static object ReaderDataSerializerArray(BinarySerializer serializer) where T : IDataSerializable, new() - { - var value = (T[]) null; - serializer.Serialize(ref value); - return value; - } - - private static void WriterDataSerializerArray(object value, BinarySerializer serializer) where T : IDataSerializable, new() - { - var valueList = (T[]) value; - serializer.Serialize(ref valueList); - } - - private static object ReaderDataSerializerList(BinarySerializer serializer) where T : IDataSerializable, new() - { - var value = (List) null; - serializer.Serialize(ref value); - return value; - } - - private static void WriterDataSerializerList(object value, BinarySerializer serializer) where T : IDataSerializable, new() - { - var valueList = (List) value; - serializer.Serialize(ref valueList); - } - - #endregion - - private static readonly List DefaultDynamics = new List() - { - new Dynamic {Id = 0, Type = typeof (int), Reader = ReaderInt, Writer = WriterInt}, - new Dynamic {Id = 1, Type = typeof (uint), Reader = ReaderUInt, Writer = WriterUInt}, - new Dynamic {Id = 2, Type = typeof (short), Reader = ReaderShort, Writer = WriterShort}, - new Dynamic {Id = 3, Type = typeof (ushort), Reader = ReaderUShort, Writer = WriterUShort}, - new Dynamic {Id = 4, Type = typeof (long), Reader = ReaderLong, Writer = WriterLong}, - new Dynamic {Id = 5, Type = typeof (ulong), Reader = ReaderULong, Writer = WriterULong}, - new Dynamic {Id = 6, Type = typeof (byte), Reader = ReaderByte, Writer = WriterByte}, - new Dynamic {Id = 7, Type = typeof (sbyte), Reader = ReaderSByte, Writer = WriterSByte}, - new Dynamic {Id = 8, Type = typeof (bool), Reader = ReaderBool, Writer = WriterBool}, - new Dynamic {Id = 9, Type = typeof (float), Reader = ReaderFloat, Writer = WriterFloat}, - new Dynamic {Id = 10, Type = typeof (double), Reader = ReaderDouble, Writer = WriterDouble}, - new Dynamic {Id = 11, Type = typeof (string), Reader = ReaderString, Writer = WriterString}, - new Dynamic {Id = 12, Type = typeof (char), Reader = ReaderChar, Writer = WriterChar}, - new Dynamic {Id = 13, Type = typeof (DateTime), Reader = ReaderDateTime, Writer = WriterDateTime}, - new Dynamic {Id = 14, Type = typeof (Guid), Reader = ReaderGuid, Writer = WriterGuid}, - - new Dynamic {Id = 30, Type = typeof (int[]), Reader = ReaderIntArray, Writer = WriterIntArray}, - new Dynamic {Id = 31, Type = typeof (uint[]), Reader = ReaderUIntArray, Writer = WriterUIntArray}, - new Dynamic {Id = 32, Type = typeof (short[]), Reader = ReaderShortArray, Writer = WriterShortArray}, - new Dynamic {Id = 33, Type = typeof (ushort[]), Reader = ReaderUShortArray, Writer = WriterUShortArray}, - new Dynamic {Id = 34, Type = typeof (long[]), Reader = ReaderLongArray, Writer = WriterLongArray}, - new Dynamic {Id = 35, Type = typeof (ulong[]), Reader = ReaderULongArray, Writer = WriterULongArray}, - new Dynamic {Id = 36, Type = typeof (byte[]), Reader = ReaderByteArray, Writer = WriterByteArray}, - new Dynamic {Id = 37, Type = typeof (sbyte[]), Reader = ReaderSByteArray, Writer = WriterSByteArray}, - new Dynamic {Id = 38, Type = typeof (bool[]), Reader = ReaderBoolArray, Writer = WriterBoolArray}, - new Dynamic {Id = 39, Type = typeof (float[]), Reader = ReaderFloatArray, Writer = WriterFloatArray}, - new Dynamic {Id = 40, Type = typeof (double[]), Reader = ReaderDoubleArray, Writer = WriterDoubleArray}, - new Dynamic {Id = 41, Type = typeof (string[]), Reader = ReaderStringArray, Writer = WriterStringArray}, - new Dynamic {Id = 42, Type = typeof (char[]), Reader = ReaderCharArray, Writer = WriterCharArray}, - new Dynamic {Id = 43, Type = typeof (DateTime[]), Reader = ReaderDateTimeArray, Writer = WriterDateTimeArray}, - new Dynamic {Id = 44, Type = typeof (Guid[]), Reader = ReaderGuidArray, Writer = WriterGuidArray}, - new Dynamic {Id = 45, Type = typeof (object[]), Reader = ReaderObjectArray, Writer = WriterObjectArray}, - - new Dynamic {Id = 60, Type = typeof (List), Reader = ReaderIntList, Writer = WriterIntList}, - new Dynamic {Id = 61, Type = typeof (List), Reader = ReaderUIntList, Writer = WriterUIntList}, - new Dynamic {Id = 62, Type = typeof (List), Reader = ReaderShortList, Writer = WriterShortList}, - new Dynamic {Id = 63, Type = typeof (List), Reader = ReaderUShortList, Writer = WriterUShortList}, - new Dynamic {Id = 64, Type = typeof (List), Reader = ReaderLongList, Writer = WriterLongList}, - new Dynamic {Id = 65, Type = typeof (List), Reader = ReaderULongList, Writer = WriterULongList}, - new Dynamic {Id = 66, Type = typeof (List), Reader = ReaderByteList, Writer = WriterByteList}, - new Dynamic {Id = 67, Type = typeof (List), Reader = ReaderSByteList, Writer = WriterSByteList}, - new Dynamic {Id = 68, Type = typeof (List), Reader = ReaderBoolList, Writer = WriterBoolList}, - new Dynamic {Id = 69, Type = typeof (List), Reader = ReaderFloatList, Writer = WriterFloatList}, - new Dynamic {Id = 70, Type = typeof (List), Reader = ReaderDoubleList, Writer = WriterDoubleList}, - new Dynamic {Id = 71, Type = typeof (List), Reader = ReaderStringList, Writer = WriterStringList}, - new Dynamic {Id = 72, Type = typeof (List), Reader = ReaderCharList, Writer = WriterCharList}, - new Dynamic {Id = 73, Type = typeof (List), Reader = ReaderDateTimeList, Writer = WriterDateTimeList}, - new Dynamic {Id = 74, Type = typeof (List), Reader = ReaderGuidList, Writer = WriterGuidList}, - new Dynamic {Id = 75, Type = typeof (List), Reader = ReaderObjectList, Writer = WriterObjectList}, - }; - - private Chunk CurrentChunk - { - get { return currentChunk; } - set { currentChunk = value; } - } - - private class Chunk - { - public FourCC Id; - public long ChunkIndexStart; - public long ChunkIndexEnd; - } - - private void StoreObjectRef(object value, int position) - { - objectToPosition.Add(value, position); - positionToObject.Add(position, value); - } - - private void ResetStoredReference() - { - positionToObject.Clear(); - objectToPosition.Clear(); - } - - - private String ReadString(bool readNullTerminatedString, int stringLength) - { - int currPos = 0; - int n; - int readLength; - int charsRead; - - if (largeByteBuffer == null) - largeByteBuffer = new byte[LargeByteBufferSize]; - - if (largeCharBuffer == null) - largeCharBuffer = new char[maxCharSize]; - - var result = String.Empty; - - if (readNullTerminatedString) - { - byte nextByte; - - while ((nextByte = Reader.ReadByte()) != 0) - { - // If index i greater the buffer, then reallocate the buffer. - if (currPos == largeByteBuffer.Length) - { - var temp = new byte[largeByteBuffer.Length * 2]; - Array.Copy(largeByteBuffer, 0, temp, 0, largeByteBuffer.Length); - largeByteBuffer = temp; - } - - largeByteBuffer[currPos++] = nextByte; - } - - // Reallocate chars. - var maxCharCount = encoding.GetMaxCharCount(currPos); - if (maxCharCount > largeCharBuffer.Length) - largeCharBuffer = new char[maxCharCount]; - - int charRead = decoder.GetChars(largeByteBuffer, 0, currPos, largeCharBuffer, 0); - result = new string(largeCharBuffer, 0, charRead); - } - else - { - // Length of the string in bytes, not chars - if (stringLength < 0) - { - stringLength = ReadArrayLength(); - if (stringLength < 0) - throw new IOException(string.Format("Invalid string length ({0})", stringLength)); - } - - if (stringLength > 0) - { - StringBuilder sb = null; - do - { - readLength = ((stringLength - currPos) > LargeByteBufferSize) ? LargeByteBufferSize : (stringLength - currPos); - - n = Stream.Read(largeByteBuffer, 0, readLength); - if (n == 0) - throw new EndOfStreamException(); - - charsRead = decoder.GetChars(largeByteBuffer, 0, n, largeCharBuffer, 0); - - if (currPos == 0 && n == stringLength) - return new String(largeCharBuffer, 0, charsRead); - - if (sb == null) - sb = new StringBuilder(stringLength); // Actual string length in chars may be smaller. - sb.Append(largeCharBuffer, 0, charsRead); - currPos += n; - - } while (currPos < stringLength); - - result = sb.ToString(); - } - } - - return result; - } - - private unsafe void WriteString(String value, bool writeNullTerminated, int len) - { - if (value == null) - throw new ArgumentNullException("value"); - - // If len == -1, then we are serializing the length - if (len < 0) - { - len = encoding.GetByteCount(value); - // If null terminated string, don't output the length of the string before string data. - if (!writeNullTerminated) - { - WriteArrayLength(len); - } - } - else - { - if (value.Length != len) - throw new ArgumentException(string.Format("length of string to serialized ({0}) != fixed length ({1})", value.Length, len)); - - // Cannot use null terminated string with fixed length - if (writeNullTerminated) - throw new ArgumentException("Cannot use null terminated string and fixed length"); - } - - if (largeByteBuffer == null) - { - largeByteBuffer = new byte[LargeByteBufferSize]; - maxChars = LargeByteBufferSize / encoding.GetMaxByteCount(1); - } - - if (len <= LargeByteBufferSize) - { - //BCLDebug.Assert(len == _encoding.GetBytes(chars, 0, chars.Length, largeByteBuffer, 0), "encoding's GetByteCount & GetBytes gave different answers! encoding type: "+_encoding.GetType().Name); - encoding.GetBytes(value, 0, value.Length, largeByteBuffer, 0); - Stream.Write(largeByteBuffer, 0, len); - } - else - { - // Aggressively try to not allocate memory in this loop for - // runtime performance reasons. Use an Encoder to write out - // the string correctly (handling surrogates crossing buffer - // boundaries properly). - int charStart = 0; - int numLeft = value.Length; - while (numLeft > 0) - { - // Figure out how many chars to process this round. - int charCount = (numLeft > maxChars) ? maxChars : numLeft; - int byteLen; -#if W8CORE - // This is inefficient, but .NET 4.5 Core profile doesn't give us the choice. - var charArray = value.ToCharArray(); - byteLen = encoder.GetBytes(charArray, charStart, charCount, largeByteBuffer, 0, charCount == numLeft); -#else - fixed (char* pChars = value) - { - fixed (byte* pBytes = largeByteBuffer) - { - byteLen = encoder.GetBytes(pChars + charStart, charCount, pBytes, LargeByteBufferSize, charCount == numLeft); - } - } -#endif - Stream.Write(largeByteBuffer, 0, byteLen); - charStart += charCount; - numLeft -= charCount; - } - } - - // Write a null terminated string - if (writeNullTerminated) - Stream.WriteByte(0); - } - - protected int ReadArrayLength() - { - switch (ArrayLengthType) - { - case ArrayLengthType.Dynamic: - return Read7BitEncodedInt(); - case ArrayLengthType.Byte: - return Reader.ReadByte(); - case ArrayLengthType.UShort: - return Reader.ReadUInt16(); - } - return Reader.ReadInt32(); - } - - protected void WriteArrayLength(int value) - { - switch (ArrayLengthType) - { - case ArrayLengthType.Dynamic: - Write7BitEncodedInt(value); - break; - case ArrayLengthType.Byte: - if (value > 255) throw new NotSupportedException(string.Format("Cannot serialize array length [{0}], larger then ArrayLengthType [{1}]", value, 255)); - Writer.Write((byte)value); - break; - case ArrayLengthType.UShort: - if (value > 65535) throw new NotSupportedException(string.Format("Cannot serialize array length [{0}], larger then ArrayLengthType [{1}]", value, 65535)); - Writer.Write((ushort)value); - break; - case ArrayLengthType.Int: - if (value < 0) throw new NotSupportedException(string.Format("Cannot serialize array length [{0}], larger then ArrayLengthType [{1}]", value, 0x7FFFFFF)); - Writer.Write(value); - break; - } - } - - protected int Read7BitEncodedInt() - { - // Read out an Int32 7 bits at a time. The high bit - // of the byte when on means to continue reading more bytes. - int count = 0; - int shift = 0; - byte b; - do - { - // Check for a corrupted stream. Read a max of 5 bytes. - // In a future version, add a DataFormatException. - if (shift == 5 * 7) // 5 bytes max per Int32, shift += 7 - throw new FormatException("Bad string length. 7bit Int32 format"); - - // ReadByte handles end of stream cases for us. - b = Reader.ReadByte(); - count |= (b & 0x7F) << shift; - shift += 7; - } while ((b & 0x80) != 0); - return count; - } - - protected void Write7BitEncodedInt(int value) - { - // Write out an int 7 bits at a time. The high bit of the byte, - // when on, tells reader to continue reading more bytes. - uint v = (uint)value; // support negative numbers - while (v >= 0x80) - { - Writer.Write((byte)(v | 0x80)); - v >>= 7; - } - Writer.Write((byte)v); - } - - private static Dynamic GetDynamic(FourCC id) where T : IDataSerializable, new() - { - return new Dynamic { Id = id, Type = typeof(T), Reader = ReaderDataSerializer, Writer = WriterDataSerializer }; - } - - private static Dynamic GetDynamicArray(FourCC id) where T : IDataSerializable, new() - { - return new Dynamic { Id = id, Type = typeof(T[]), Reader = ReaderDataSerializerArray, Writer = WriterDataSerializerArray }; - } - - private static Dynamic GetDynamicList(FourCC id) where T : IDataSerializable, new() - { - return new Dynamic { Id = id, Type = typeof(List), Reader = ReaderDataSerializerList, Writer = WriterDataSerializerList }; - } - - private class Dynamic - { - public FourCC Id; - - public Type Type; - - public ReadRef Reader; - - public WriteRef Writer; - - public SerializerAction DynamicSerializer; - - public object DynamicReader(BinarySerializer serializer) where T : new() - { - object value = new T(); - DynamicSerializer(ref value, serializer); - return value; - } - - public void DynamicWriter(object value, BinarySerializer serializer) - { - DynamicSerializer(ref value, serializer); - } - } - - protected override void Dispose(bool disposing) - { - } - } +// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; +using SharpDX.IO; +using SharpDX.Mathematics; +using SharpDX.Multimedia; + +namespace SharpDX.Toolkit.Serialization +{ + /// + /// Serializer action. + /// + /// The value to read or write. + /// The serializer. + public delegate void SerializerAction(ref object value, BinarySerializer serializer); + + /// + /// This class provides serialization methods for types implementing the . + /// + /// + /// BinarySerializer is a basic binary serializer with the following features: + ///
    + ///
  • 10x times faster and smaller than default System Serialization and Xml Serialization.
  • + ///
  • Supports for all primitive types, array/List<T>/Dictionary of primitive types, custom data via (struct or class) and array/List/Dictionary of custom data.
  • + ///
  • Optimized binary format, data serialized to the strict minimum.
  • + ///
  • Should be compatible with Win8/WinRT, Desktop.
  • + ///
  • Not reflection based serializer, but fully compile time serializer.
  • + ///
  • Format could be read back from C/C++.
  • + /// + ///
+ ///
+ public partial class BinarySerializer : Component + { + private int chunkCount; + private Chunk[] chunks; + private Chunk currentChunk; + private readonly Dictionary dynamicMapToType; + private readonly Dictionary dynamicMapToFourCC; + private readonly Dictionary objectToPosition; + private readonly Dictionary positionToObject; + private Dictionary mapTag; + private int allowIdentityReferenceCount; + + // Fields used to serialize strings + private System.Text.Encoding encoding; + private System.Text.Encoder encoder; + private System.Text.Decoder decoder; + private const int LargeByteBufferSize = 1024; + private byte[] largeByteBuffer; + private int maxChars; // max # of chars we can put in _largeByteBuffer + private char[] largeCharBuffer; + private int maxCharSize; // From LargeByteBufferSize & Encoding + + public delegate void SerializerPrimitiveAction(ref T value); + + public delegate void SerializerTypeAction(ref T value, BinarySerializer serializer); + + + public delegate object ReadRef(BinarySerializer serializer); + + public delegate void WriteRef(object value, BinarySerializer serializer); + + + /// + /// Underlying stream this instance is reading/writing to. + /// + public Stream Stream { get; private set; } + + /// + /// Reader used to directly read from the underlying stream. + /// + public BinaryReader Reader { get; private set; } + + /// + /// Gets the reader and throws an exception if this serializer is in Write mode. + /// + /// The context object that requires a Reader. + /// A BinaryReader. + /// context + /// If this reader is not in read mode + public BinaryReader ReaderOnly(object context) + { + if (context == null) + { + throw new ArgumentNullException("context"); + } + if (Mode != SerializerMode.Read) + { + throw new InvalidOperationException(string.Format("[{0}] is only expecting Read-Only BinarySerializer", context.GetType().Name)); + } + return Reader; + } + + /// + /// Writer used to directly write to the underlying stream. + /// + public BinaryWriter Writer { get; private set; } + + public ArrayLengthType ArrayLengthType { get; set; } + + private SerializerMode mode; + + + /// + /// Initializes a new instance of the class. + /// + /// The stream to read or write to. + /// The read or write mode. + public BinarySerializer(Stream stream, SerializerMode mode) : this(stream, mode, SharpDX.Text.Encoding.ASCII) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The stream to read or write to. + /// The read or write mode. + /// Default encoding used for strings. This parameter can be overriden later using Encoding property. + public BinarySerializer(Stream stream, SerializerMode mode, System.Text.Encoding encoding) + { + // Setup the encoding used for strings. + Encoding = encoding; + + // Allocate dictionary used for dynamic serialization. + dynamicMapToType = new Dictionary(); + dynamicMapToFourCC = new Dictionary(); + + // For serializing reference + objectToPosition = new Dictionary(new IdentityEqualityComparer()); + positionToObject = new Dictionary(); + + // Allocate the chunk array and initial chunk. + chunks = new Chunk[8]; + Stream = stream; + + // Setup the mode. + Mode = mode; + CurrentChunk = new Chunk { ChunkIndexStart = 0 }; + + chunks[chunkCount] = CurrentChunk; + chunkCount++; + + + // Register all default dynamics. + foreach (var defaultDynamic in DefaultDynamics) + RegisterDynamic(defaultDynamic); + + RegisterPartialDynamics(); + } + + partial void RegisterPartialDynamics(); + + /// + /// Gets a tag value with the specified key. + /// + /// The tag key. + /// A tag value associated to a key + public object GetTag(object key) + { + if (mapTag == null) + return null; + object value; + mapTag.TryGetValue(key, out value); + return value; + } + + /// + /// Determines whether a tag with a specified key is already stored. + /// + /// The key. + /// true if a tag with a specified key is already stored; otherwise, false. + public bool HasTag(object key) + { + if (mapTag == null) + return false; + return mapTag.ContainsKey(key); + } + + /// + /// Removes a tag with the specified key. + /// + /// The key. + public void RemoveTag(object key) + { + if (mapTag == null) + return; + mapTag.Remove(key); + } + + /// + /// Sets a tag value with the specified key. + /// + /// The key. + /// The value. + /// + public void SetTag(object key, object value) + { + if (mapTag == null) + mapTag = new Dictionary(); + // Always remove previous key before inserting new one + mapTag.Remove(key); + mapTag.Add(key, value); + } + + /// + /// Gets or sets the serialization mode. + /// + /// The serialization mode. + public SerializerMode Mode + { + get { return mode; } + set + { + mode = value; + // Create Reader or writer + if (Mode == SerializerMode.Read) + { + Reader = Reader ?? new BinaryReader(Stream); + } + else + { + Writer = Writer ?? new BinaryWriter(Stream); + } + } + } + + /// + /// Gets or sets the encoding used to serialized strings. + /// + /// The encoding. + /// When setting a null encoding + public System.Text.Encoding Encoding + { + get { return encoding; } + set { + if (ReferenceEquals(value, null)) + throw new ArgumentNullException("value"); + + if (!ReferenceEquals(encoding, value)) + { + encoding = value; + encoder = encoding.GetEncoder(); + decoder = encoding.GetDecoder(); + maxCharSize = encoding.GetMaxCharCount(LargeByteBufferSize); + } + } + } + + /// + /// Enables to serialize an object only once using object reference. Default is false. + /// + /// true if [allow null]; otherwise, false. + /// If an invalid matching pair of true/false is detected. + public bool AllowIdentity + { + get { return allowIdentityReferenceCount > 0; } + set + { + allowIdentityReferenceCount += value ? 1 : -1; + if (allowIdentityReferenceCount < 0) + throw new InvalidOperationException("Invalid call to AllowIdentity. Must match true/false in pair."); + } + } + + /// + /// Register a dynamic serializer for a particular type implementing the interface and having the . + /// + /// Type of the element to serialize. + public void RegisterDynamic() where T : IDataSerializable, new() + { +#if W8CORE + var attribute = Utilities.GetCustomAttribute(typeof (T).GetTypeInfo()); +#else + var attribute = Utilities.GetCustomAttribute(typeof (T)); +#endif + if (attribute == null) + throw new ArgumentException("Type T doesn't have DynamicSerializerAttribute", "T"); + + RegisterDynamic(attribute.Id); + } + + /// + /// Register a dynamic serializer for a particular type implementing the interface. + /// + /// Type of the element to serialize. + /// The id to use for serializing T. + public void RegisterDynamic(FourCC id) where T : IDataSerializable, new() + { + RegisterDynamic(GetDynamic(id)); + } + + /// + /// Register a dynamic array serializer for a particular type implementing the interface. + /// + /// Type of the element in the array. + /// The id to use for serializing T[]. + public void RegisterDynamicArray(FourCC id) where T : IDataSerializable, new() + { + RegisterDynamic(GetDynamicArray(id)); + } + + /// + /// Register a dynamic List<T> serializer for a particular type implementing the interface. + /// + /// Type of the element in the List<T>. + /// The id to use for serializing List<T>. + public void RegisterDynamicList(FourCC id) where T : IDataSerializable, new() + { + RegisterDynamic(GetDynamicList(id)); + } + + /// + /// Register a dynamic serializer using an external action. + /// + /// Type of the element to serialize. + /// The id to use for serializing T. + /// The serializer. + public void RegisterDynamic(FourCC id, SerializerAction serializer) where T : new() + { + var dynamicSerializer = new Dynamic {Id = id, Type = typeof (T), DynamicSerializer = serializer}; + dynamicSerializer.Reader = dynamicSerializer.DynamicReader; + dynamicSerializer.Writer = dynamicSerializer.DynamicWriter; + RegisterDynamic(dynamicSerializer); + } + + private delegate void TypedSerializerAction(ref T value, BinarySerializer serializer); + + private void RegisterDynamic(FourCC id, TypedSerializerAction dynamicSerializer) where T : new() + { + var dyn = new Dynamic { Id = id, Type = typeof(T) }; + dyn.Reader = (serializer) => + { + T value = new T(); + dynamicSerializer(ref value, serializer); + return value; + }; + dyn.Writer = (value, serializer) => + { + T valueT = (T)value; + dynamicSerializer(ref valueT, serializer); + }; + RegisterDynamic(dyn); + } + + /// + /// Begin to serialize a a new chunk. + /// + /// The chunk id. + /// If the chuck to read is not the expecting chunk. + /// + /// A Chunk is an identifiable portion of data that will serialized. Chunk are useful to encapsulate a variable + /// data (and check for the presence of the chunk Id). Chunk are storing a 4 bytes identifier and the length of + /// the chunk before reading/writing actual data. + /// + public void BeginChunk(FourCC chunkId) + { + // Allocate new Chunk + if (chunks[chunkCount] == null) + { + CurrentChunk = new Chunk(); + chunks[chunkCount] = CurrentChunk; + } + else + { + CurrentChunk = chunks[chunkCount]; + } + + // Go to next chunk + chunkCount++; + + // Sets the current id + CurrentChunk.Id = chunkId; + + // Create a new chunk + if (Mode == SerializerMode.Write) + CurrentChunk.ChunkIndexStart = Stream.Position; + + if (chunkCount >= chunks.Length) + { + var temp = new Chunk[chunks.Length * 2]; + Array.Copy(chunks, temp, chunks.Length); + chunks = temp; + } + + if (Mode == SerializerMode.Write) + { + // Write the chunkId to the current chunk + Writer.Write((int) chunkId); + // write temporary null size + Writer.Write(0); + } + else + { + var chunkIdRead = Reader.ReadInt32(); + if (chunkIdRead != chunkId) + throw new InvalidChunkException(chunkIdRead, chunkId); + + uint sizeOfChunk = (uint)Reader.ReadUInt32(); + CurrentChunk.ChunkIndexEnd = Stream.Position + sizeOfChunk; + } + } + + + /// + /// Ends a chunk. + /// + /// If there EndChunk is called without a previous BeginChunk. + /// If the size of data read from the chunk is different from chunk size. + public void EndChunk() + { + if (chunkCount <= 1) + throw new InvalidOperationException("EndChunk() called without BeginChunk()"); + + var previousChunk = CurrentChunk; + chunkCount--; + CurrentChunk = chunks[chunkCount - 1]; + + if (Mode == SerializerMode.Write) + { + // Write the size of this chunk + long currentPosition = Stream.Position; + Stream.Position = previousChunk.ChunkIndexStart + 4; + Writer.Write((uint)(currentPosition - Stream.Position - 4)); + Stream.Position = currentPosition; + } + else + { + if (previousChunk.ChunkIndexEnd != Stream.Position) + throw new IOException(string.Format("Unexpected size when reading chunk [{0}]", CurrentChunk.Id)); + } + } + + + /// + /// Deserialize a data from the underlying stream. + /// + /// Type of the data to load. + /// An instance of the loaded data. + public T Load() where T : IDataSerializable, new() + { + ResetStoredReference(); + + Mode = SerializerMode.Read; + T value = default(T); + Serialize(ref value); + return value; + } + + /// + /// Serializes the specified value to the underlying stream. + /// + /// Type of the data to save. + /// The value to save. + public void Save(T value) where T : IDataSerializable, new() + { + ResetStoredReference(); + + Mode = SerializerMode.Write; + Serialize(ref value); + Flush(); + } + + /// + /// Flush the underlying + /// + public void Flush() + { + Writer.Flush(); + } + + /// + /// Serializes a dynamic value that can be nullable. + /// + /// Known type of the value to serialize. The known type is not the runtime type that will be actually serialized. + /// The value to serialize based on its runtime type. + public void SerializeDynamic(ref T value) + { + SerializeDynamic(ref value, SerializeFlags.Dynamic | SerializeFlags.Nullable); + } + + /// + /// Serializes a dynamic value. + /// + /// Known type of the value to serialize. The known type is not the runtime type that will be actually serialized. + /// The value to serialize based on its runtime type. + /// Type of serialization, see . + public void SerializeDynamic(ref T value, SerializeFlags serializeFlags) + { + int storeObjectRef; + if (SerializeIsNull(ref value, out storeObjectRef, serializeFlags | SerializeFlags.Dynamic)) + return; + + SerializeRawDynamic(ref value); + } + + /// + /// Serializes a static value implementing the interface. + /// + /// Type of the data to serialize. + /// The value to serialize + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref T value, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() + { + int storeObjectRef; + if (SerializeIsNull(ref value, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Read) + value = new T(); + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(value, storeObjectRef); + + value.Serialize(this); + } + + /// + /// Serializes a static value implementing the interface. Unlike , + /// this method doesn't allocate a new instance when reading but use the reference value. + /// + /// Type of the data to serialize. + /// The value to serialize + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void SerializeWithNoInstance(ref T value, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable + { + int storeObjectRef; + if (SerializeIsNull(ref value, out storeObjectRef, serializeFlags)) + return; + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(value, storeObjectRef); + + value.Serialize(this); + } + + /// + /// Serializes an enum value. + /// + /// Type of the enum to serialize. + /// The value to serialize + /// If type T is not an enum. + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public unsafe void SerializeEnum(ref T value) where T : struct, IComparable, IFormattable + { + if (!Utilities.IsEnum(typeof(T))) + throw new ArgumentException("T generic parameter must be a valid enum", "value"); + + var pValue = Native.Fixed(ref value); + + switch (Utilities.SizeOf()) + { + case 1: + { + Serialize(ref *(byte*)pValue); + break; + } + case 2: + { + Serialize(ref *(short*)pValue); + break; + } + case 4: + { + Serialize(ref *(int*)pValue); + break; + } + case 8: + { + Serialize(ref *(long*)pValue); + break; + } + } + } + + /// + /// Serializes an array of primitives using serialization methods implemented by this instance for each item in the array. + /// + /// Type of the primitive data to serialize. + /// An array of primitive value to serialize + /// The serializer to user to serialize the T values. + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref T[] valueArray, SerializerPrimitiveAction serializer, SerializeFlags serializeFlags = SerializeFlags.Normal) + { + int storeObjectRef; + if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + WriteArrayLength((int)valueArray.Length); + for (int i = 0; i < valueArray.Length; i++) + serializer(ref valueArray[i]); + } + else + { + var count = ReadArrayLength(); + valueArray = new T[count]; + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + for (int index = 0; index < count; index++) + serializer(ref valueArray[index]); + } + } + + /// + /// Serializes count elements in an array of primitives using serialization methods implemented by this instance for each item in the array. + /// + /// Type of the primitive data to serialize. + /// An array of primitive value to serialize + /// Count elements to serialize. See remarks. + /// The serializer to user to serialize the T values. + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value.
+ /// Caution: Also unlike the plain array version, the count is not serialized. This method is useful + /// when we want to serialize the count of an array separately from the array. + ///
+ public void Serialize(ref T[] valueArray, int count, SerializerPrimitiveAction serializer, SerializeFlags serializeFlags = SerializeFlags.Normal) + { + int storeObjectRef; + if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + for (int i = 0; i < count; i++) + serializer(ref valueArray[i]); + } + else + { + valueArray = new T[count]; + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + for (int index = 0; index < count; index++) + serializer(ref valueArray[index]); + } + } + + /// + /// Serializes an array of static values that are implementing the interface. + /// + /// Type of the data to serialize. + /// An array of value to serialize + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref T[] valueArray, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() + { + int storeObjectRef; + if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + WriteArrayLength(valueArray.Length); + for (int i = 0; i < valueArray.Length; i++) + Serialize(ref valueArray[i], serializeFlags); + } + else + { + var count = ReadArrayLength(); + valueArray = new T[count]; + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + for (int index = 0; index < count; index++) + Serialize(ref valueArray[index], serializeFlags); + } + } + + /// + /// Serializes an array of static values that are implementing the interface. + /// + /// Type of the data to serialize. + /// An array of value to serialize + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void SerializeWithNoInstance(ref T[] valueArray, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable + { + int storeObjectRef; + if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + WriteArrayLength(valueArray.Length); + for (int i = 0; i < valueArray.Length; i++) + SerializeWithNoInstance(ref valueArray[i], serializeFlags); + } + else + { + var count = ReadArrayLength(); + valueArray = new T[count]; + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + for (int index = 0; index < count; index++) + SerializeWithNoInstance(ref valueArray[index], serializeFlags); + } + } + + /// + /// Serializes count elements in an array of static values that are implementing the interface. + /// + /// Type of the data to serialize. + /// An array of value to serialize + /// Count elements to serialize. See remarks. + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value.
+ /// Caution: Also unlike the plain array version, the count is not serialized. This method is useful + /// when we want to serialize the count of an array separately from the array. + ///
+ public void Serialize(ref T[] valueArray, int count, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() + { + int storeObjectRef; + if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + for (int i = 0; i < count; i++) + Serialize(ref valueArray[i], serializeFlags); + } + else + { + valueArray = new T[count]; + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + for (int index = 0; index < count; index++) + Serialize(ref valueArray[index], serializeFlags); + } + } + + /// + /// Serializes an array of bytes. + /// + /// An array of bytes to serialize + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref byte[] valueArray, SerializeFlags serializeFlags = SerializeFlags.Normal) + { + int storeObjectRef; + if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + WriteArrayLength(valueArray.Length); + Writer.Write(valueArray); + } + else + { + int count = ReadArrayLength(); + valueArray = new byte[count]; + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + Reader.Read(valueArray, 0, count); + } + } + + /// + /// Serializes an array of bytes. + /// + /// An array of bytes to serialize + /// Count elements to serialize. See remarks. + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value.
+ /// Caution: Also unlike the plain array version, the count is not serialized. This method is useful + /// when we want to serialize the count of an array separately from the array. + ///
+ public void Serialize(ref byte[] valueArray, int count, SerializeFlags serializeFlags = SerializeFlags.Normal) + { + int storeObjectRef; + if (SerializeIsNull(ref valueArray, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + Writer.Write(valueArray, 0, count); + } + else + { + valueArray = new byte[count]; + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueArray, storeObjectRef); + + Reader.Read(valueArray, 0, count); + } + } + + /// + /// Serializes a list of static values that are implementing the interface. + /// + /// Type of the data to serialize. + /// A list of value to serialize + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref List valueList, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() + { + int storeObjectRef; + if (SerializeIsNull(ref valueList, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); + + WriteArrayLength(valueList.Count); + foreach (var value in valueList) + { + T localValue = value; + Serialize(ref localValue); + } + } + else + { + var count = ReadArrayLength(); + valueList = new List(count); + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); + + for (int index = 0; index < count; index++) + { + var value = default(T); + Serialize(ref value); + valueList.Add(value); + } + } + } + + /// + /// Serializes a list of static values that are implementing the interface. + /// + /// Type of the data to serialize. + /// A list of value to serialize + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void SerializeThis(List valueList, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() + { + if (Mode == SerializerMode.Write) + { + WriteArrayLength(valueList.Count); + foreach (var value in valueList) + { + T localValue = value; + Serialize(ref localValue); + } + } + else + { + var count = ReadArrayLength(); + for (int index = 0; index < count; index++) + { + var value = default(T); + Serialize(ref value); + valueList.Add(value); + } + } + } + + /// + /// Serializes a list of primitive values using a specific serializer method from this instance. + /// + /// Type of the data to serialize. + /// A list of value to serialize + /// A method of this instance to serialize the primitive T type + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref List valueList, SerializerPrimitiveAction serializerMethod, SerializeFlags serializeFlags = SerializeFlags.Normal) + { + int storeObjectRef; + if (SerializeIsNull(ref valueList, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); + + WriteArrayLength(valueList.Count); + foreach (var value in valueList) + { + T localValue = value; + serializerMethod(ref localValue); + } + } + else + { + var count = ReadArrayLength(); + EnsureList(ref valueList, count); + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); + + for (int i = 0; i < count; i++) + { + var localValue = default(T); + serializerMethod(ref localValue); + valueList.Add(localValue); + } + } + } + + /// + /// Serializes count elements from a list of static values that are implementing the interface. + /// + /// Type of the data to serialize. + /// A list of value to serialize + /// Count elements to serialize. See remarks. + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value.
+ /// Caution: Also unlike the plain array version, the count is not serialized. This method is useful + /// when we want to serialize the count of an array separately from the array. + ///
+ public void Serialize(ref List valueList, int count, SerializeFlags serializeFlags = SerializeFlags.Normal) where T : IDataSerializable, new() + { + int storeObjectRef; + if (SerializeIsNull(ref valueList, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); + + for (int i = 0; i < count; i++) + { + T localValue = valueList[i]; + Serialize(ref localValue, serializeFlags); + } + } + else + { + EnsureList(ref valueList, count); + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); + + for (int index = 0; index < count; index++) + { + var value = default(T); + Serialize(ref value, serializeFlags); + valueList.Add(value); + } + } + } + + /// + /// Serializes count elements from a list of primitive values using a specific serializer method from this instance. + /// + /// Type of the data to serialize. + /// A list of value to serialize + /// A method of this instance to serialize the primitive T type + /// Count elements to serialize. See remarks. + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value.
+ /// Caution: Also unlike the plain array version, the count is not serialized. This method is useful + /// when we want to serialize the count of an array separately from the array. + ///
+ public void Serialize(ref List valueList, int count, SerializerPrimitiveAction serializerMethod, SerializeFlags serializeFlags = SerializeFlags.Normal) + { + int storeObjectRef; + if (SerializeIsNull(ref valueList, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); + + for (int i = 0; i < count; i++) + { + T localValue = valueList[i]; + serializerMethod(ref localValue); + } + } + else + { + EnsureList(ref valueList, count); + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(valueList, storeObjectRef); + + for (int i = 0; i < count; i++) + { + var localValue = default(T); + serializerMethod(ref localValue); + valueList.Add(localValue); + } + } + } + + private void EnsureList(ref List valueList, int count) + { + // If there is a list provided, use it in place instead of allocating a new one + if (valueList != null) + { + valueList.Clear(); + if (valueList.Capacity < count) + { + valueList.Capacity = count; + } + } + else + { + valueList = new List(count); + } + } + + /// + /// Serializes a dictionary of key/values that are both implementing the interface. + /// + /// Type of key to serialize. + /// Type of value to serialize. + /// A dictionary to serialize + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref Dictionary dictionary, SerializeFlags serializeFlags = SerializeFlags.Normal) + where TKey : IDataSerializable, new() + where TValue : IDataSerializable, new() + { + int storeObjectRef; + if (SerializeIsNull(ref dictionary, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); + + WriteArrayLength(dictionary.Count); + foreach (var value in dictionary) + { + TKey localKey = value.Key; + TValue localValue = value.Value; + localKey.Serialize(this); + localValue.Serialize(this); + } + } + else + { + var count = ReadArrayLength(); + dictionary = new Dictionary(count); + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); + + for (int i = 0; i < count; i++) + { + TKey localKey = default(TKey); + TValue localValue = default(TValue); + localKey.Serialize(this); + localValue.Serialize(this); + dictionary.Add(localKey, localValue); + } + } + } + + /// + /// Serializes a dictionary of key/values. + /// + /// Type of key to serialize that is implementing the interface. + /// Type of primitive value with its associated serializer. + /// A dictionary to serialize + /// Serializer used for the TValue. + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref Dictionary dictionary, SerializerPrimitiveAction valueSerializer, SerializeFlags serializeFlags = SerializeFlags.Normal) where TKey : IDataSerializable, new() + { + int storeObjectRef; + if (SerializeIsNull(ref dictionary, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); + + WriteArrayLength(dictionary.Count); + foreach (var value in dictionary) + { + TKey localKey = value.Key; + TValue localValue = value.Value; + localKey.Serialize(this); + valueSerializer(ref localValue); + } + } + else + { + var count = ReadArrayLength(); + dictionary = new Dictionary(count); + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); + + for (int i = 0; i < count; i++) + { + TKey localKey = Utilities.IsValueType(typeof(TKey)) ? default(TKey) : new TKey(); + TValue localValue = default(TValue); + localKey.Serialize(this); + valueSerializer(ref localValue); + dictionary.Add(localKey, localValue); + } + } + } + + /// + /// Serializes a dictionary of key/values. + /// + /// Type of primitive value with its associated serializer. + /// Type of value to serialize that is implementing the interface. + /// A dictionary to serialize + /// Serializer used for the TKey. + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref Dictionary dictionary, SerializerPrimitiveAction keySerializer, SerializeFlags serializeFlags = SerializeFlags.Normal) where TValue : IDataSerializable, new() + { + int storeObjectRef; + if (SerializeIsNull(ref dictionary, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); + + WriteArrayLength(dictionary.Count); + foreach (var value in dictionary) + { + TKey localKey = value.Key; + TValue localValue = value.Value; + keySerializer(ref localKey); + localValue.Serialize(this); + } + } + else + { + var count = ReadArrayLength(); + dictionary = new Dictionary(count); + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); + + for (int i = 0; i < count; i++) + { + TKey localKey = default(TKey); + TValue localValue = Utilities.IsValueType(typeof(TValue)) ? default(TValue) : new TValue(); + keySerializer(ref localKey); + localValue.Serialize(this); + dictionary.Add(localKey, localValue); + } + } + } + + /// + /// Serializes a dictionary of key/values. + /// + /// Type of primitive key with its associated serializer. + /// Type of primitive value with its associated serializer. + /// A dictionary to serialize + /// Serializer used for the TKey. + /// Serializer used for the TValue. + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref Dictionary dictionary, SerializerPrimitiveAction keySerializer, SerializerPrimitiveAction valueSerializer, SerializeFlags serializeFlags = SerializeFlags.Normal) + { + int storeObjectRef; + if (SerializeIsNull(ref dictionary, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); + + WriteArrayLength(dictionary.Count); + foreach (var value in dictionary) + { + TKey localKey = value.Key; + TValue localValue = value.Value; + keySerializer(ref localKey); + valueSerializer(ref localValue); + } + } + else + { + var count = ReadArrayLength(); + dictionary = new Dictionary(count); + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(dictionary, storeObjectRef); + + for (int i = 0; i < count; i++) + { + TKey localKey = default(TKey); + TValue localValue = default(TValue); + keySerializer(ref localKey); + valueSerializer(ref localValue); + dictionary.Add(localKey, localValue); + } + } + } + + /// + /// Serializes a single string value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// This string is serialized with the current set on this instance. + /// + public void Serialize(ref string value) + { + Serialize(ref value, false); + } + + /// + /// Serializes a single string value. + /// + /// The value to serialize + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// This string is serialized with the current set on this instance. + /// + public void Serialize(ref string value, SerializeFlags serializeFlags) + { + Serialize(ref value, false, serializeFlags); + } + + /// + /// Serializes a single string value. + /// + /// The value to serialize + /// Write a null byte at the end of the string. + /// Type of serialization, see . + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// This string is serialized with the current set on this instance. + /// + public void Serialize(ref string value, bool writeNullTerminatedString, SerializeFlags serializeFlags = SerializeFlags.Normal) + { + int storeObjectRef = -1; + // If len < 0, then we need to check for null/identity. + if (SerializeIsNull(ref value, out storeObjectRef, serializeFlags)) + return; + + if (Mode == SerializerMode.Write) + { + WriteString(value, writeNullTerminatedString, -1); + } + else + { + value = ReadString(writeNullTerminatedString, -1); + } + + // Store ObjectRef + if (storeObjectRef >= 0) StoreObjectRef(value, storeObjectRef); + } + + /// + /// Serializes a single fixed length string value. + /// + /// The value to serialize + /// Read/write a specific number of characters. + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// This string is serialized with the current set on this instance. + /// + public void Serialize(ref string value, int len) + { + if (Mode == SerializerMode.Write) + { + WriteString(value, false, len); + } + else + { + value = ReadString(false, len); + } + } + + /// + /// Serializes a single boolean value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref bool value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadBoolean(); + } + } + + /// + /// Serializes a single byte value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref byte value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadByte(); + } + } + + /// + /// Serializes a single sbyte value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref sbyte value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadSByte(); + } + } + + /// + /// Serializes a single short value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref short value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadInt16(); + } + } + + /// + /// Serializes a single ushort value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref ushort value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadUInt16(); + } + } + + /// + /// Serializes a single int value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref int value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadInt32(); + } + } + + /// + /// Serializes a single int as a packed value (from 1 byte to 5 byte. if value < 128, then 1 byte...etc.) + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void SerializePackedInt(ref int value) + { + if (Mode == SerializerMode.Write) + { + Write7BitEncodedInt(value); + } + else + { + value = Read7BitEncodedInt(); + } + } + + /// + /// Serializes a memory region. + /// + /// The pointer to an unmanaged memory region. For read operation, this pointer must be allocated by the caller. + /// If the end of stream was reached before reading all the bytes. + /// Note that depending on the serialization , this method reads or writes the value. + /// This method doesn't serialize the sizeInBytes of the region, so the size must be serialized separately. + /// + public void SerializeMemoryRegion(DataPointer dataRegion) + { + SerializeMemoryRegion(dataRegion.Pointer, dataRegion.Size); + } + + /// + /// Serializes a memory region. + /// + /// The data pointer. For read operation, this pointer must be allocated by the caller. + /// The size in bytes. See remarks. + /// If the end of stream was reached before reading all the bytes. + /// Note that depending on the serialization , this method reads or writes the value. + /// This method doesn't serialize the sizeInBytes of the region, so the size must be serialized separately. + /// + public unsafe void SerializeMemoryRegion(IntPtr dataPointer, int sizeInBytes) + { + // Provides optimized path for special streams + var fileStream = Stream as NativeFileStream; + if (fileStream != null) + { + if (Mode == SerializerMode.Write) + { + fileStream.Write(dataPointer, 0, sizeInBytes); + } + else + { + fileStream.Read(dataPointer, 0, sizeInBytes); + } + } + else if (Stream is DataStream) + { + if (Mode == SerializerMode.Write) + { + ((DataStream)Stream).Write(dataPointer, 0, sizeInBytes); + } + else + { + ((DataStream)Stream).Read(dataPointer, 0, sizeInBytes); + } + } + else + { + const int internalBufferSize = 32768; + + if (largeByteBuffer == null) + largeByteBuffer = new byte[internalBufferSize]; + + if (largeByteBuffer.Length < internalBufferSize) + largeByteBuffer = new byte[internalBufferSize]; + + if (Mode == SerializerMode.Write) + { + var remainingSize = sizeInBytes; + while (remainingSize > 0) + { + var maxSize = remainingSize < largeByteBuffer.Length ? remainingSize : largeByteBuffer.Length; + Utilities.Read(dataPointer, largeByteBuffer, 0, maxSize); + Stream.Write(largeByteBuffer, 0, maxSize); + + dataPointer = (IntPtr) ((byte*) dataPointer + maxSize); + remainingSize -= maxSize; + } + } + else + { + var remainingSize = sizeInBytes; + while (remainingSize > 0) + { + var maxSize = remainingSize < largeByteBuffer.Length ? remainingSize : largeByteBuffer.Length; + + if (Stream.Read(largeByteBuffer, 0, maxSize) != maxSize) + throw new EndOfStreamException(); + Utilities.Write(dataPointer, largeByteBuffer, 0, maxSize); + + dataPointer = (IntPtr)((byte*)dataPointer + maxSize); + remainingSize -= maxSize; + } + } + } + } + + /// + /// Serializes a single uint value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref uint value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadUInt32(); + } + } + + /// + /// Serializes a single long value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref long value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadInt64(); + } + } + + /// + /// Serializes a single ulong value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref ulong value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadUInt64(); + } + } + + /// + /// Serializes a single char value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref char value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadChar(); + } + } + + /// + /// Serializes a single float value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref float value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadSingle(); + } + } + + /// + /// Serializes a single double value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref double value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value); + } + else + { + value = Reader.ReadDouble(); + } + } + + /// + /// Serializes a single DateTime value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref DateTime value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value.ToBinary()); + } + else + { + value = new DateTime(Reader.ReadInt64()); + } + } + + /// + /// Serializes a single Guid value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref Guid value) + { + if (Mode == SerializerMode.Write) + { + Writer.Write(value.ToByteArray()); + } + else + { + value = new Guid(Reader.ReadBytes(16)); + } + } + + /// + /// Serializes a single value. + /// + /// The value to serialize + /// + /// Note that depending on the serialization , this method reads or writes the value. + /// + public void Serialize(ref FourCC value) + { + uint valueUint = (uint)value; + Serialize(ref valueUint); + + if (Mode == SerializerMode.Read) + { + value = valueUint; + } + } + + private bool SerializeIsNull(ref T value, out int storeObjectReference, SerializeFlags flags) + { + storeObjectReference = -1; + + // If value type, no null possible + if (Utilities.IsValueType(typeof(T))) + return false; + + bool isNullValue = ReferenceEquals(value, null); + if ((flags & SerializeFlags.Nullable) != 0 || allowIdentityReferenceCount > 0) + { + // Handle write + if (Mode == SerializerMode.Write) + { + // Handle reference + if (!isNullValue && allowIdentityReferenceCount > 0 && (flags & SerializeFlags.Dynamic) == 0) + { + int position; + if (objectToPosition.TryGetValue(value, out position)) + { + Writer.Write((byte)2); + Write7BitEncodedInt(position); + return true; + } + + // Register reference + objectToPosition.Add(value, (int)Stream.Position); + } + + Writer.Write((byte)(isNullValue ? 0 : 1)); + + return isNullValue; + } + else + { + // Handle read + value = default(T); + int objectPosition = (int)Stream.Position; + int objectReferenceHeader = Reader.ReadByte(); + switch (objectReferenceHeader) + { + case 1: + { + if (allowIdentityReferenceCount > 0 && (flags & SerializeFlags.Dynamic) == 0) + storeObjectReference = objectPosition; + } + break; + + case 2: + { + if (allowIdentityReferenceCount == 0) + throw new InvalidOperationException("Can't read serialized reference when SerializeReference is off"); + + // Read object position from stream + objectPosition = Read7BitEncodedInt(); + object localValue; + if (!positionToObject.TryGetValue(objectPosition, out localValue)) + throw new InvalidOperationException(string.Format("Can't find serialized reference at position [{0}]", objectPosition)); + + // Set Object Reference + value = (T) localValue; + + // Set it as null + objectReferenceHeader = 0; + } + break; + } + + return objectReferenceHeader == 0; + } + } + + // Null is not allowed + if (isNullValue && Mode == SerializerMode.Write) + { + throw new ArgumentNullException("value"); + } + + return false; + } + + private void SerializeRawDynamic(ref T value, bool noDynamic = false) + { + if (Mode == SerializerMode.Write) + { + var type = (noDynamic) ? typeof (T) : value.GetType(); + Dynamic dyn; + if (!dynamicMapToFourCC.TryGetValue(type, out dyn)) + throw new IOException(string.Format("Type [{0}] is not registered as dynamic", type)); + + // Write the id of the object + if (!noDynamic) + Writer.Write((int) dyn.Id); + + dyn.Writer(value, this); + } + else + { + // Gets the id for this dynamic + Dynamic dyn; + if (noDynamic) + { + var type = typeof (T); + if (!dynamicMapToFourCC.TryGetValue(type, out dyn)) + throw new IOException(string.Format("Type [{0}] is not registered as dynamic", type)); + } + else + { + var id = (FourCC) Reader.ReadInt32(); + + if (!dynamicMapToType.TryGetValue(id, out dyn)) + throw new IOException(string.Format("Type [{0}] is not registered as dynamic", id)); + } + + value = (T) dyn.Reader(this); + } + } + + private void RegisterDynamic(Dynamic dynamic) + { + dynamicMapToFourCC.Add(dynamic.Type, dynamic); + dynamicMapToType.Add(dynamic.Id, dynamic); + } + + + #region Primitive Array Readers + + private static object ReaderIntArray(BinarySerializer serializer) + { + int[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderUIntArray(BinarySerializer serializer) + { + uint[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderShortArray(BinarySerializer serializer) + { + short[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderUShortArray(BinarySerializer serializer) + { + ushort[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderLongArray(BinarySerializer serializer) + { + long[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderULongArray(BinarySerializer serializer) + { + ulong[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderBoolArray(BinarySerializer serializer) + { + bool[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderFloatArray(BinarySerializer serializer) + { + float[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderDoubleArray(BinarySerializer serializer) + { + double[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderDateTimeArray(BinarySerializer serializer) + { + DateTime[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderGuidArray(BinarySerializer serializer) + { + Guid[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderObjectArray(BinarySerializer serializer) + { + object[] value = null; + serializer.Serialize(ref value, serializer.SerializeDynamic); + return value; + } + + private static object ReaderCharArray(BinarySerializer serializer) + { + char[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderStringArray(BinarySerializer serializer) + { + string[] value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderByteArray(BinarySerializer serializer) + { + byte[] value = null; + serializer.Serialize(ref value); + return value; + } + + private static object ReaderSByteArray(BinarySerializer serializer) + { + sbyte[] values = null; + serializer.Serialize(ref values, serializer.Serialize); + return values; + } + + #endregion + + #region Primitive Array Writer + + private static void WriterIntArray(object value, BinarySerializer serializer) + { + var valueTyped = (int[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterUIntArray(object value, BinarySerializer serializer) + { + var valueTyped = (uint[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterShortArray(object value, BinarySerializer serializer) + { + var valueTyped = (short[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterUShortArray(object value, BinarySerializer serializer) + { + var valueTyped = (ushort[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterLongArray(object value, BinarySerializer serializer) + { + var valueTyped = (long[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterULongArray(object value, BinarySerializer serializer) + { + var valueTyped = (ulong[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterSByteArray(object value, BinarySerializer serializer) + { + var valueTyped = (sbyte[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterStringArray(object value, BinarySerializer serializer) + { + var valueTyped = (string[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterCharArray(object value, BinarySerializer serializer) + { + var valueTyped = (char[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterBoolArray(object value, BinarySerializer serializer) + { + var valueTyped = (bool[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterFloatArray(object value, BinarySerializer serializer) + { + var valueTyped = (float[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterDoubleArray(object value, BinarySerializer serializer) + { + var valueTyped = (double[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterDateTimeArray(object value, BinarySerializer serializer) + { + var valueTyped = (DateTime[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterGuidArray(object value, BinarySerializer serializer) + { + var valueTyped = (Guid[]) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterObjectArray(object value, BinarySerializer serializer) + { + var valueTyped = (object[])value; + serializer.Serialize(ref valueTyped, serializer.SerializeDynamic); + } + + private static void WriterByteArray(object value, BinarySerializer serializer) + { + var valueArray = (byte[]) value; + serializer.Serialize(ref valueArray); + } + + #endregion + + #region Primitive List Readers + + private static object ReaderIntList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderUIntList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderShortList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderUShortList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderLongList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderULongList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderBoolList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderFloatList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderDoubleList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderDateTimeList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderGuidList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderObjectList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.SerializeDynamic); + return value; + } + + private static object ReaderCharList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderStringList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderByteList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + private static object ReaderSByteList(BinarySerializer serializer) + { + List value = null; + serializer.Serialize(ref value, serializer.Serialize); + return value; + } + + #endregion + + #region Primitive List Writers + + private static void WriterIntList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterUIntList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterShortList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterUShortList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterLongList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterULongList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterSByteList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterStringList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterCharList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterBoolList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterFloatList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterDoubleList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterDateTimeList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterGuidList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + private static void WriterObjectList(object value, BinarySerializer serializer) + { + var valueTyped = (List)value; + serializer.Serialize(ref valueTyped, serializer.SerializeDynamic); + } + + private static void WriterByteList(object value, BinarySerializer serializer) + { + var valueTyped = (List) value; + serializer.Serialize(ref valueTyped, serializer.Serialize); + } + + #endregion + + #region Primitive Readers + + private static object ReaderInt(BinarySerializer serializer) + { + return serializer.Reader.ReadInt32(); + } + + private static object ReaderUInt(BinarySerializer serializer) + { + return serializer.Reader.ReadUInt32(); + } + + private static object ReaderShort(BinarySerializer serializer) + { + return serializer.Reader.ReadInt16(); + } + + private static object ReaderUShort(BinarySerializer serializer) + { + return serializer.Reader.ReadUInt16(); + } + + private static object ReaderLong(BinarySerializer serializer) + { + return serializer.Reader.ReadInt64(); + } + + private static object ReaderULong(BinarySerializer serializer) + { + return serializer.Reader.ReadUInt64(); + } + + private static object ReaderBool(BinarySerializer serializer) + { + return serializer.Reader.ReadBoolean(); + } + + private static object ReaderByte(BinarySerializer serializer) + { + return serializer.Reader.ReadByte(); + } + + private static object ReaderSByte(BinarySerializer serializer) + { + return serializer.Reader.ReadSByte(); + } + + private static object ReaderString(BinarySerializer serializer) + { + var value = (string) null; + serializer.Serialize(ref value); + return value; + } + + private static object ReaderFloat(BinarySerializer serializer) + { + return serializer.Reader.ReadSingle(); + } + + private static object ReaderDouble(BinarySerializer serializer) + { + return serializer.Reader.ReadDouble(); + } + + private static object ReaderChar(BinarySerializer serializer) + { + return serializer.Reader.ReadChar(); + } + + private static object ReaderDateTime(BinarySerializer serializer) + { + return new DateTime(serializer.Reader.ReadInt64()); + } + + private static object ReaderGuid(BinarySerializer serializer) + { + return new Guid(serializer.Reader.ReadBytes(16)); + } + + #endregion + + #region Primitive Writers + + private static void WriterInt(object value, BinarySerializer serializer) + { + serializer.Writer.Write((int) value); + } + + private static void WriterUInt(object value, BinarySerializer serializer) + { + serializer.Writer.Write((uint) value); + } + + private static void WriterShort(object value, BinarySerializer serializer) + { + serializer.Writer.Write((short) value); + } + + private static void WriterUShort(object value, BinarySerializer serializer) + { + serializer.Writer.Write((ushort) value); + } + + private static void WriterLong(object value, BinarySerializer serializer) + { + serializer.Writer.Write((long) value); + } + + private static void WriterULong(object value, BinarySerializer serializer) + { + serializer.Writer.Write((ulong) value); + } + + private static void WriterByte(object value, BinarySerializer serializer) + { + serializer.Writer.Write((byte) value); + } + + private static void WriterSByte(object value, BinarySerializer serializer) + { + serializer.Writer.Write((sbyte) value); + } + + private static void WriterString(object value, BinarySerializer serializer) + { + var str = (string) value; + serializer.Serialize(ref str); + } + + private static void WriterChar(object value, BinarySerializer serializer) + { + serializer.Writer.Write((char) value); + } + + private static void WriterBool(object value, BinarySerializer serializer) + { + serializer.Writer.Write((bool) value); + } + + private static void WriterFloat(object value, BinarySerializer serializer) + { + serializer.Writer.Write((float) value); + } + + private static void WriterDouble(object value, BinarySerializer serializer) + { + serializer.Writer.Write((double) value); + } + + private static void WriterDateTime(object value, BinarySerializer serializer) + { + serializer.Writer.Write(((DateTime) value).ToBinary()); + } + + private static void WriterGuid(object value, BinarySerializer serializer) + { + serializer.Writer.Write(((Guid) value).ToByteArray()); + } + + #endregion + + #region IDataSerializable Reader and Writer (+ Array and List) + + private static object ReaderDataSerializer(BinarySerializer serializer) where T : IDataSerializable, new() + { + var value = default(T); + serializer.Serialize(ref value); + return value; + } + + private static void WriterDataSerializer(object value, BinarySerializer serializer) where T : IDataSerializable, new() + { + var valueTyped = (T)value; + serializer.Serialize(ref valueTyped); + } + + private static object ReaderDataSerializerArray(BinarySerializer serializer) where T : IDataSerializable, new() + { + var value = (T[]) null; + serializer.Serialize(ref value); + return value; + } + + private static void WriterDataSerializerArray(object value, BinarySerializer serializer) where T : IDataSerializable, new() + { + var valueList = (T[]) value; + serializer.Serialize(ref valueList); + } + + private static object ReaderDataSerializerList(BinarySerializer serializer) where T : IDataSerializable, new() + { + var value = (List) null; + serializer.Serialize(ref value); + return value; + } + + private static void WriterDataSerializerList(object value, BinarySerializer serializer) where T : IDataSerializable, new() + { + var valueList = (List) value; + serializer.Serialize(ref valueList); + } + + #endregion + + private static readonly List DefaultDynamics = new List() + { + new Dynamic {Id = 0, Type = typeof (int), Reader = ReaderInt, Writer = WriterInt}, + new Dynamic {Id = 1, Type = typeof (uint), Reader = ReaderUInt, Writer = WriterUInt}, + new Dynamic {Id = 2, Type = typeof (short), Reader = ReaderShort, Writer = WriterShort}, + new Dynamic {Id = 3, Type = typeof (ushort), Reader = ReaderUShort, Writer = WriterUShort}, + new Dynamic {Id = 4, Type = typeof (long), Reader = ReaderLong, Writer = WriterLong}, + new Dynamic {Id = 5, Type = typeof (ulong), Reader = ReaderULong, Writer = WriterULong}, + new Dynamic {Id = 6, Type = typeof (byte), Reader = ReaderByte, Writer = WriterByte}, + new Dynamic {Id = 7, Type = typeof (sbyte), Reader = ReaderSByte, Writer = WriterSByte}, + new Dynamic {Id = 8, Type = typeof (bool), Reader = ReaderBool, Writer = WriterBool}, + new Dynamic {Id = 9, Type = typeof (float), Reader = ReaderFloat, Writer = WriterFloat}, + new Dynamic {Id = 10, Type = typeof (double), Reader = ReaderDouble, Writer = WriterDouble}, + new Dynamic {Id = 11, Type = typeof (string), Reader = ReaderString, Writer = WriterString}, + new Dynamic {Id = 12, Type = typeof (char), Reader = ReaderChar, Writer = WriterChar}, + new Dynamic {Id = 13, Type = typeof (DateTime), Reader = ReaderDateTime, Writer = WriterDateTime}, + new Dynamic {Id = 14, Type = typeof (Guid), Reader = ReaderGuid, Writer = WriterGuid}, + + new Dynamic {Id = 30, Type = typeof (int[]), Reader = ReaderIntArray, Writer = WriterIntArray}, + new Dynamic {Id = 31, Type = typeof (uint[]), Reader = ReaderUIntArray, Writer = WriterUIntArray}, + new Dynamic {Id = 32, Type = typeof (short[]), Reader = ReaderShortArray, Writer = WriterShortArray}, + new Dynamic {Id = 33, Type = typeof (ushort[]), Reader = ReaderUShortArray, Writer = WriterUShortArray}, + new Dynamic {Id = 34, Type = typeof (long[]), Reader = ReaderLongArray, Writer = WriterLongArray}, + new Dynamic {Id = 35, Type = typeof (ulong[]), Reader = ReaderULongArray, Writer = WriterULongArray}, + new Dynamic {Id = 36, Type = typeof (byte[]), Reader = ReaderByteArray, Writer = WriterByteArray}, + new Dynamic {Id = 37, Type = typeof (sbyte[]), Reader = ReaderSByteArray, Writer = WriterSByteArray}, + new Dynamic {Id = 38, Type = typeof (bool[]), Reader = ReaderBoolArray, Writer = WriterBoolArray}, + new Dynamic {Id = 39, Type = typeof (float[]), Reader = ReaderFloatArray, Writer = WriterFloatArray}, + new Dynamic {Id = 40, Type = typeof (double[]), Reader = ReaderDoubleArray, Writer = WriterDoubleArray}, + new Dynamic {Id = 41, Type = typeof (string[]), Reader = ReaderStringArray, Writer = WriterStringArray}, + new Dynamic {Id = 42, Type = typeof (char[]), Reader = ReaderCharArray, Writer = WriterCharArray}, + new Dynamic {Id = 43, Type = typeof (DateTime[]), Reader = ReaderDateTimeArray, Writer = WriterDateTimeArray}, + new Dynamic {Id = 44, Type = typeof (Guid[]), Reader = ReaderGuidArray, Writer = WriterGuidArray}, + new Dynamic {Id = 45, Type = typeof (object[]), Reader = ReaderObjectArray, Writer = WriterObjectArray}, + + new Dynamic {Id = 60, Type = typeof (List), Reader = ReaderIntList, Writer = WriterIntList}, + new Dynamic {Id = 61, Type = typeof (List), Reader = ReaderUIntList, Writer = WriterUIntList}, + new Dynamic {Id = 62, Type = typeof (List), Reader = ReaderShortList, Writer = WriterShortList}, + new Dynamic {Id = 63, Type = typeof (List), Reader = ReaderUShortList, Writer = WriterUShortList}, + new Dynamic {Id = 64, Type = typeof (List), Reader = ReaderLongList, Writer = WriterLongList}, + new Dynamic {Id = 65, Type = typeof (List), Reader = ReaderULongList, Writer = WriterULongList}, + new Dynamic {Id = 66, Type = typeof (List), Reader = ReaderByteList, Writer = WriterByteList}, + new Dynamic {Id = 67, Type = typeof (List), Reader = ReaderSByteList, Writer = WriterSByteList}, + new Dynamic {Id = 68, Type = typeof (List), Reader = ReaderBoolList, Writer = WriterBoolList}, + new Dynamic {Id = 69, Type = typeof (List), Reader = ReaderFloatList, Writer = WriterFloatList}, + new Dynamic {Id = 70, Type = typeof (List), Reader = ReaderDoubleList, Writer = WriterDoubleList}, + new Dynamic {Id = 71, Type = typeof (List), Reader = ReaderStringList, Writer = WriterStringList}, + new Dynamic {Id = 72, Type = typeof (List), Reader = ReaderCharList, Writer = WriterCharList}, + new Dynamic {Id = 73, Type = typeof (List), Reader = ReaderDateTimeList, Writer = WriterDateTimeList}, + new Dynamic {Id = 74, Type = typeof (List), Reader = ReaderGuidList, Writer = WriterGuidList}, + new Dynamic {Id = 75, Type = typeof (List), Reader = ReaderObjectList, Writer = WriterObjectList}, + }; + + private Chunk CurrentChunk + { + get { return currentChunk; } + set { currentChunk = value; } + } + + private class Chunk + { + public FourCC Id; + public long ChunkIndexStart; + public long ChunkIndexEnd; + } + + private void StoreObjectRef(object value, int position) + { + objectToPosition.Add(value, position); + positionToObject.Add(position, value); + } + + private void ResetStoredReference() + { + positionToObject.Clear(); + objectToPosition.Clear(); + } + + + private String ReadString(bool readNullTerminatedString, int stringLength) + { + int currPos = 0; + int n; + int readLength; + int charsRead; + + if (largeByteBuffer == null) + largeByteBuffer = new byte[LargeByteBufferSize]; + + if (largeCharBuffer == null) + largeCharBuffer = new char[maxCharSize]; + + var result = String.Empty; + + if (readNullTerminatedString) + { + byte nextByte; + + while ((nextByte = Reader.ReadByte()) != 0) + { + // If index i greater the buffer, then reallocate the buffer. + if (currPos == largeByteBuffer.Length) + { + var temp = new byte[largeByteBuffer.Length * 2]; + Array.Copy(largeByteBuffer, 0, temp, 0, largeByteBuffer.Length); + largeByteBuffer = temp; + } + + largeByteBuffer[currPos++] = nextByte; + } + + // Reallocate chars. + var maxCharCount = encoding.GetMaxCharCount(currPos); + if (maxCharCount > largeCharBuffer.Length) + largeCharBuffer = new char[maxCharCount]; + + int charRead = decoder.GetChars(largeByteBuffer, 0, currPos, largeCharBuffer, 0); + result = new string(largeCharBuffer, 0, charRead); + } + else + { + // Length of the string in bytes, not chars + if (stringLength < 0) + { + stringLength = ReadArrayLength(); + if (stringLength < 0) + throw new IOException(string.Format("Invalid string length ({0})", stringLength)); + } + + if (stringLength > 0) + { + StringBuilder sb = null; + do + { + readLength = ((stringLength - currPos) > LargeByteBufferSize) ? LargeByteBufferSize : (stringLength - currPos); + + n = Stream.Read(largeByteBuffer, 0, readLength); + if (n == 0) + throw new EndOfStreamException(); + + charsRead = decoder.GetChars(largeByteBuffer, 0, n, largeCharBuffer, 0); + + if (currPos == 0 && n == stringLength) + return new String(largeCharBuffer, 0, charsRead); + + if (sb == null) + sb = new StringBuilder(stringLength); // Actual string length in chars may be smaller. + sb.Append(largeCharBuffer, 0, charsRead); + currPos += n; + + } while (currPos < stringLength); + + result = sb.ToString(); + } + } + + return result; + } + + private unsafe void WriteString(String value, bool writeNullTerminated, int len) + { + if (value == null) + throw new ArgumentNullException("value"); + + // If len == -1, then we are serializing the length + if (len < 0) + { + len = encoding.GetByteCount(value); + // If null terminated string, don't output the length of the string before string data. + if (!writeNullTerminated) + { + WriteArrayLength(len); + } + } + else + { + if (value.Length != len) + throw new ArgumentException(string.Format("length of string to serialized ({0}) != fixed length ({1})", value.Length, len)); + + // Cannot use null terminated string with fixed length + if (writeNullTerminated) + throw new ArgumentException("Cannot use null terminated string and fixed length"); + } + + if (largeByteBuffer == null) + { + largeByteBuffer = new byte[LargeByteBufferSize]; + maxChars = LargeByteBufferSize / encoding.GetMaxByteCount(1); + } + + if (len <= LargeByteBufferSize) + { + //BCLDebug.Assert(len == _encoding.GetBytes(chars, 0, chars.Length, largeByteBuffer, 0), "encoding's GetByteCount & GetBytes gave different answers! encoding type: "+_encoding.GetType().Name); + encoding.GetBytes(value, 0, value.Length, largeByteBuffer, 0); + Stream.Write(largeByteBuffer, 0, len); + } + else + { + // Aggressively try to not allocate memory in this loop for + // runtime performance reasons. Use an Encoder to write out + // the string correctly (handling surrogates crossing buffer + // boundaries properly). + int charStart = 0; + int numLeft = value.Length; + while (numLeft > 0) + { + // Figure out how many chars to process this round. + int charCount = (numLeft > maxChars) ? maxChars : numLeft; + int byteLen; +#if W8CORE + // This is inefficient, but .NET 4.5 Core profile doesn't give us the choice. + var charArray = value.ToCharArray(); + byteLen = encoder.GetBytes(charArray, charStart, charCount, largeByteBuffer, 0, charCount == numLeft); +#else + fixed (char* pChars = value) + { + fixed (byte* pBytes = largeByteBuffer) + { + byteLen = encoder.GetBytes(pChars + charStart, charCount, pBytes, LargeByteBufferSize, charCount == numLeft); + } + } +#endif + Stream.Write(largeByteBuffer, 0, byteLen); + charStart += charCount; + numLeft -= charCount; + } + } + + // Write a null terminated string + if (writeNullTerminated) + Stream.WriteByte(0); + } + + protected int ReadArrayLength() + { + switch (ArrayLengthType) + { + case ArrayLengthType.Dynamic: + return Read7BitEncodedInt(); + case ArrayLengthType.Byte: + return Reader.ReadByte(); + case ArrayLengthType.UShort: + return Reader.ReadUInt16(); + } + return Reader.ReadInt32(); + } + + protected void WriteArrayLength(int value) + { + switch (ArrayLengthType) + { + case ArrayLengthType.Dynamic: + Write7BitEncodedInt(value); + break; + case ArrayLengthType.Byte: + if (value > 255) throw new NotSupportedException(string.Format("Cannot serialize array length [{0}], larger then ArrayLengthType [{1}]", value, 255)); + Writer.Write((byte)value); + break; + case ArrayLengthType.UShort: + if (value > 65535) throw new NotSupportedException(string.Format("Cannot serialize array length [{0}], larger then ArrayLengthType [{1}]", value, 65535)); + Writer.Write((ushort)value); + break; + case ArrayLengthType.Int: + if (value < 0) throw new NotSupportedException(string.Format("Cannot serialize array length [{0}], larger then ArrayLengthType [{1}]", value, 0x7FFFFFF)); + Writer.Write(value); + break; + } + } + + protected int Read7BitEncodedInt() + { + // Read out an Int32 7 bits at a time. The high bit + // of the byte when on means to continue reading more bytes. + int count = 0; + int shift = 0; + byte b; + do + { + // Check for a corrupted stream. Read a max of 5 bytes. + // In a future version, add a DataFormatException. + if (shift == 5 * 7) // 5 bytes max per Int32, shift += 7 + throw new FormatException("Bad string length. 7bit Int32 format"); + + // ReadByte handles end of stream cases for us. + b = Reader.ReadByte(); + count |= (b & 0x7F) << shift; + shift += 7; + } while ((b & 0x80) != 0); + return count; + } + + protected void Write7BitEncodedInt(int value) + { + // Write out an int 7 bits at a time. The high bit of the byte, + // when on, tells reader to continue reading more bytes. + uint v = (uint)value; // support negative numbers + while (v >= 0x80) + { + Writer.Write((byte)(v | 0x80)); + v >>= 7; + } + Writer.Write((byte)v); + } + + private static Dynamic GetDynamic(FourCC id) where T : IDataSerializable, new() + { + return new Dynamic { Id = id, Type = typeof(T), Reader = ReaderDataSerializer, Writer = WriterDataSerializer }; + } + + private static Dynamic GetDynamicArray(FourCC id) where T : IDataSerializable, new() + { + return new Dynamic { Id = id, Type = typeof(T[]), Reader = ReaderDataSerializerArray, Writer = WriterDataSerializerArray }; + } + + private static Dynamic GetDynamicList(FourCC id) where T : IDataSerializable, new() + { + return new Dynamic { Id = id, Type = typeof(List), Reader = ReaderDataSerializerList, Writer = WriterDataSerializerList }; + } + + private class Dynamic + { + public FourCC Id; + + public Type Type; + + public ReadRef Reader; + + public WriteRef Writer; + + public SerializerAction DynamicSerializer; + + public object DynamicReader(BinarySerializer serializer) where T : new() + { + object value = new T(); + DynamicSerializer(ref value, serializer); + return value; + } + + public void DynamicWriter(object value, BinarySerializer serializer) + { + DynamicSerializer(ref value, serializer); + } + } + + protected override void Dispose(bool disposing) + { + } + } } \ No newline at end of file diff --git a/Source/Toolkit/SharpDX.Toolkit/SharpDX.Toolkit.csproj b/Source/Toolkit/SharpDX.Toolkit/SharpDX.Toolkit.csproj index 426bc873..be3c4383 100644 --- a/Source/Toolkit/SharpDX.Toolkit/SharpDX.Toolkit.csproj +++ b/Source/Toolkit/SharpDX.Toolkit/SharpDX.Toolkit.csproj @@ -1,155 +1,174 @@ - - - - - 8.0.30703 - 2.0 - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C} - SharpDX.Toolkit - SharpDX.Toolkit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - {736dfb52-1afe-4eff-9710-89046ab5b1f9} - SharpDX.Direct3D11 - - - {3fc6de77-b412-4101-9e64-6b9aa831179b} - SharpDX.DXGI - False - - - {49e4485f-3a2a-4c35-a159-12eccfc00396} - SharpDX.Mathematics - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - False - - - - - - - - - - - - - - + + + + + 8.0.30703 + 2.0 + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C} + SharpDX.Toolkit + SharpDX.Toolkit + v4.5.2 + + + + AnyCPU + false + false + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct3D11.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Direct3D12.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.DXGI.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.Mathematics.dll + + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/tkfont/app.config b/Source/Toolkit/tkfont/app.config new file mode 100644 index 00000000..9c72f143 --- /dev/null +++ b/Source/Toolkit/tkfont/app.config @@ -0,0 +1,3 @@ + + + diff --git a/Source/Toolkit/tkfont/tkfont.csproj b/Source/Toolkit/tkfont/tkfont.csproj index 64ae118a..fb0b8751 100644 --- a/Source/Toolkit/tkfont/tkfont.csproj +++ b/Source/Toolkit/tkfont/tkfont.csproj @@ -1,59 +1,63 @@ - - - - - 8.0.30703 - 2.0 - {7329B02D-C504-482A-A156-181D48CE493C} - SharpDX.Toolkit.Graphics - tkfont - Exe - v4.0 - Client - 512 - - - - Properties\SharedAssemblyInfo.cs - - - ConsoleProgram.cs - - - - - - - - - - - {3FC6DE77-B412-4101-9E64-6B9AA831179B} - SharpDX.DXGI - - - {D0BCD56A-41C4-4A4E-8590-26864CED07FF} - SharpDX - - - {8bfff9d1-84ec-4fba-9beb-710ecf1857a8} - SharpDX.Toolkit.Compiler - - - {53ef08a7-4224-434c-a62c-f29807c1c750} - SharpDX.Toolkit.Graphics - - - {9FF0707C-75BB-4984-A01F-B9EAAD293F6C} - SharpDX.Toolkit - - - + + + + + 8.0.30703 + 2.0 + {7329B02D-C504-482A-A156-181D48CE493C} + SharpDX.Toolkit.Graphics + tkfont + Exe + v4.5.2 + + + 512 + + + + Properties\SharedAssemblyInfo.cs + + + ConsoleProgram.cs + + + + + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.DXGI.dll + + + + + + + {8bfff9d1-84ec-4fba-9beb-710ecf1857a8} + SharpDX.Toolkit.Compiler + + + {53ef08a7-4224-434c-a62c-f29807c1c750} + SharpDX.Toolkit.Graphics + + + {9FF0707C-75BB-4984-A01F-B9EAAD293F6C} + SharpDX.Toolkit + + + + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/tkfxc/Program.cs b/Source/Toolkit/tkfxc/Program.cs index b3a40dde..4c8703ac 100644 --- a/Source/Toolkit/tkfxc/Program.cs +++ b/Source/Toolkit/tkfxc/Program.cs @@ -328,6 +328,7 @@ private void Abort() ErrorColor(); Console.Error.WriteLine("Compilation has errors. Process aborted."); ResetColor(); + Console.ReadKey(); Environment.Exit(-1); } diff --git a/Source/Toolkit/tkfxc/app.config b/Source/Toolkit/tkfxc/app.config new file mode 100644 index 00000000..9c72f143 --- /dev/null +++ b/Source/Toolkit/tkfxc/app.config @@ -0,0 +1,3 @@ + + + diff --git a/Source/Toolkit/tkfxc/tkfxc.csproj b/Source/Toolkit/tkfxc/tkfxc.csproj index 5f85e92b..f00fc8d0 100644 --- a/Source/Toolkit/tkfxc/tkfxc.csproj +++ b/Source/Toolkit/tkfxc/tkfxc.csproj @@ -1,63 +1,65 @@ - - - - - 8.0.30703 - 2.0 - {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702} - SharpDX.Toolkit.Compiler - tkfxc - Exe - v4.0 - Client - 512 - - - Exe - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - ConsoleProgram.cs - - - - - - - {361d3f81-a48a-47f2-80df-ca4f9536cb4e} - SharpDX.D3DCompiler - False - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - False - - - {8bfff9d1-84ec-4fba-9beb-710ecf1857a8} - SharpDX.Toolkit.Compiler - False - - - {9ff0707c-75bb-4984-a01f-b9eaad293f6c} - SharpDX.Toolkit - False - - - + + + + + 8.0.30703 + 2.0 + {BCE106B4-0C81-4705-8A9C-C4C4F5EAB702} + SharpDX.Toolkit.Compiler + tkfxc + Exe + v4.5.2 + + + 512 + + + Exe + + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.D3DCompiler.dll + + + + + + + + Properties\SharedAssemblyInfo.cs + + + ConsoleProgram.cs + + + + + + + {8bfff9d1-84ec-4fba-9beb-710ecf1857a8} + SharpDX.Toolkit.Compiler + False + + + {9ff0707c-75bb-4984-a01f-b9eaad293f6c} + SharpDX.Toolkit + False + + + + + + + --> \ No newline at end of file diff --git a/Source/Toolkit/tkmodel/app.config b/Source/Toolkit/tkmodel/app.config new file mode 100644 index 00000000..9c72f143 --- /dev/null +++ b/Source/Toolkit/tkmodel/app.config @@ -0,0 +1,3 @@ + + + diff --git a/Source/Toolkit/tkmodel/tkmodel.csproj b/Source/Toolkit/tkmodel/tkmodel.csproj index f2bac0ed..d091a1bd 100644 --- a/Source/Toolkit/tkmodel/tkmodel.csproj +++ b/Source/Toolkit/tkmodel/tkmodel.csproj @@ -1,59 +1,63 @@ - - - - - 8.0.30703 - 2.0 - {76FD0713-F217-4485-89B3-C6423DB46C58} - SharpDX.Toolkit.Compiler - tkmodel - Exe - v4.0 - Client - 512 - - - Exe - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - ConsoleProgram.cs - - - - - - - {361d3f81-a48a-47f2-80df-ca4f9536cb4e} - SharpDX.D3DCompiler - - - {d0bcd56a-41c4-4a4e-8590-26864ced07ff} - SharpDX - - - {8bfff9d1-84ec-4fba-9beb-710ecf1857a8} - SharpDX.Toolkit.Compiler - - - {9ff0707c-75bb-4984-a01f-b9eaad293f6c} - SharpDX.Toolkit - - - + + + + + 8.0.30703 + 2.0 + {76FD0713-F217-4485-89B3-C6423DB46C58} + SharpDX.Toolkit.Compiler + tkmodel + Exe + v4.5.2 + + + 512 + + + Exe + + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.dll + + + False + ..\..\..\Bin\DirectX11_2-net40\SharpDX.D3DCompiler.dll + + + + + + + + Properties\SharedAssemblyInfo.cs + + + ConsoleProgram.cs + + + + + + + {8bfff9d1-84ec-4fba-9beb-710ecf1857a8} + SharpDX.Toolkit.Compiler + + + {9ff0707c-75bb-4984-a01f-b9eaad293f6c} + SharpDX.Toolkit + + + + + + + --> \ No newline at end of file diff --git a/Source/VisualStudio/SharpDX.VisualStudio.Package/Resources.Designer.cs b/Source/VisualStudio/SharpDX.VisualStudio.Package/Resources.Designer.cs index 5b6a1dd0..cc9e4a3c 100644 --- a/Source/VisualStudio/SharpDX.VisualStudio.Package/Resources.Designer.cs +++ b/Source/VisualStudio/SharpDX.VisualStudio.Package/Resources.Designer.cs @@ -1,63 +1,63 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18213 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SharpDX.VisualStudio.Package { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SharpDX.VisualStudio.Package.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SharpDX.VisualStudio.Package { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SharpDX.VisualStudio.Package.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Source/VisualStudio/SharpDX.VisualStudio.Package/SharpDX.VisualStudio.Package.csproj b/Source/VisualStudio/SharpDX.VisualStudio.Package/SharpDX.VisualStudio.Package.csproj index 59d78545..8e48518b 100644 --- a/Source/VisualStudio/SharpDX.VisualStudio.Package/SharpDX.VisualStudio.Package.csproj +++ b/Source/VisualStudio/SharpDX.VisualStudio.Package/SharpDX.VisualStudio.Package.csproj @@ -1,204 +1,209 @@ - - - - 11.0 - 11.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - Debug - AnyCPU - 2.0 - {CA8F0A7A-75E1-4626-9B39-8CB0AC32330F} - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Properties - SharpDX.VisualStudio.Package - SharpDX.VisualStudio.Package - false - - - v4.5 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - - - - - - - - true - - - - - - - - ..\packages\NuGet.VisualStudio.2.8.1\lib\net40\NuGet.VisualStudio.dll - True - - - - - - - - - - - - {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2} - 8 - 0 - 0 - primary - False - False - - - {26AD1324-4B7C-44BC-84F8-B86AED45729F} - 10 - 0 - 0 - primary - False - False - - - {1A31287A-4D7D-413E-8E32-3B374931BD89} - 8 - 0 - 0 - primary - False - False - - - {2CE2370E-D744-4936-A090-3FFFE667B0E1} - 9 - 0 - 0 - primary - False - False - - - {1CBA492E-7263-47BB-87FE-639000619B15} - 8 - 0 - 0 - primary - False - False - - - {00020430-0000-0000-C000-000000000046} - 2 - 0 - 0 - primary - False - False - - - - - - - Form - - - WizardForm.cs - - - True - True - Resources.resx - - - - - - - - WizardForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - true - VSPackage - - - - - - - Designer - - - - - true - - - Always - true - - - Always - true - - - Always - true - - - - - - {0B3215F2-A447-4E44-A111-0CCC5E4F0D14} - ToolkitGame - ProjectTemplates - false - TemplateProjectOutputGroup%3b - - - - true - - - + + + + 14.0 + 11.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + 4.0 + + + + Debug + AnyCPU + 2.0 + {CA8F0A7A-75E1-4626-9B39-8CB0AC32330F} + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + SharpDX.VisualStudio.Package + SharpDX.VisualStudio.Package + false + + + v4.5 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + + + + + + + + true + + + + + + + + ..\packages\NuGet.VisualStudio.2.8.1\lib\net40\NuGet.VisualStudio.dll + True + + + + + + + + + + + + {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2} + 8 + 0 + 0 + primary + False + False + + + {26AD1324-4B7C-44BC-84F8-B86AED45729F} + 10 + 0 + 0 + primary + False + False + + + {1A31287A-4D7D-413E-8E32-3B374931BD89} + 8 + 0 + 0 + primary + False + False + + + {2CE2370E-D744-4936-A090-3FFFE667B0E1} + 9 + 0 + 0 + primary + False + False + + + {1CBA492E-7263-47BB-87FE-639000619B15} + 8 + 0 + 0 + primary + False + False + + + {00020430-0000-0000-C000-000000000046} + 2 + 0 + 0 + primary + False + False + + + + + + + Form + + + WizardForm.cs + + + True + True + Resources.resx + + + + + + + + WizardForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + true + VSPackage + + + + + + + Designer + + + + + true + + + Always + true + + + Always + true + + + Always + true + + + + + + {0B3215F2-A447-4E44-A111-0CCC5E4F0D14} + ToolkitGame + ProjectTemplates + false + TemplateProjectOutputGroup%3b + + + + true + + + + --> \ No newline at end of file diff --git a/Source/VisualStudio/SharpDX.VisualStudio.sln b/Source/VisualStudio/SharpDX.VisualStudio.sln index 2a851c1e..c2859d7f 100644 --- a/Source/VisualStudio/SharpDX.VisualStudio.sln +++ b/Source/VisualStudio/SharpDX.VisualStudio.sln @@ -1,26 +1,28 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolkitGame", "ToolkitGame\ToolkitGame.csproj", "{0B3215F2-A447-4E44-A111-0CCC5E4F0D14}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.VisualStudio.Package", "SharpDX.VisualStudio.Package\SharpDX.VisualStudio.Package.csproj", "{CA8F0A7A-75E1-4626-9B39-8CB0AC32330F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0B3215F2-A447-4E44-A111-0CCC5E4F0D14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0B3215F2-A447-4E44-A111-0CCC5E4F0D14}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0B3215F2-A447-4E44-A111-0CCC5E4F0D14}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0B3215F2-A447-4E44-A111-0CCC5E4F0D14}.Release|Any CPU.Build.0 = Release|Any CPU - {CA8F0A7A-75E1-4626-9B39-8CB0AC32330F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA8F0A7A-75E1-4626-9B39-8CB0AC32330F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA8F0A7A-75E1-4626-9B39-8CB0AC32330F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA8F0A7A-75E1-4626-9B39-8CB0AC32330F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolkitGame", "ToolkitGame\ToolkitGame.csproj", "{0B3215F2-A447-4E44-A111-0CCC5E4F0D14}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.VisualStudio.Package", "SharpDX.VisualStudio.Package\SharpDX.VisualStudio.Package.csproj", "{CA8F0A7A-75E1-4626-9B39-8CB0AC32330F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0B3215F2-A447-4E44-A111-0CCC5E4F0D14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B3215F2-A447-4E44-A111-0CCC5E4F0D14}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B3215F2-A447-4E44-A111-0CCC5E4F0D14}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B3215F2-A447-4E44-A111-0CCC5E4F0D14}.Release|Any CPU.Build.0 = Release|Any CPU + {CA8F0A7A-75E1-4626-9B39-8CB0AC32330F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA8F0A7A-75E1-4626-9B39-8CB0AC32330F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA8F0A7A-75E1-4626-9B39-8CB0AC32330F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA8F0A7A-75E1-4626-9B39-8CB0AC32330F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Source/VisualStudio/ToolkitGame/ToolkitGame.csproj b/Source/VisualStudio/ToolkitGame/ToolkitGame.csproj index 2f5c2583..8ebcf8de 100644 --- a/Source/VisualStudio/ToolkitGame/ToolkitGame.csproj +++ b/Source/VisualStudio/ToolkitGame/ToolkitGame.csproj @@ -1,125 +1,132 @@ - - - - 11.0 - 11.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - Debug - AnyCPU - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {0B3215F2-A447-4E44-A111-0CCC5E4F0D14} - Library - Properties - DesktopGame - DesktopGame - v4.5 - 512 - false - false - false - false - false - false - false - false - false - false - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - - - - - - - - - - - Designer - - - - App.xaml - - - MainPage.xaml - - - - - - - - - - - - - - Designer - SharpDX - - - - - - - - - - - Always - - - - - Designer - - - - - Designer - - - - - MSBuild:Compile - Designer - - - - - - - + + + + 14.0 + 11.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + 4.0 + + + + Debug + AnyCPU + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {0B3215F2-A447-4E44-A111-0CCC5E4F0D14} + Library + Properties + DesktopGame + DesktopGame + v4.5 + 512 + false + false + false + false + false + false + false + false + false + false + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + + + + + + + + + + + Designer + + + + App.xaml + + + MainPage.xaml + + + + + + + + + + + + + + Designer + SharpDX + + + + + + + + + + + Always + + + + + Designer + MSBuild:Compile + + + + + Designer + MSBuild:Compile + + + + + MSBuild:Compile + Designer + + + + + + + + --> \ No newline at end of file diff --git a/packages/SharpYaml.1.2.0/LICENSE.txt b/packages/SharpYaml.1.2.0/LICENSE.txt index 38e871a8..e02023d3 100644 --- a/packages/SharpYaml.1.2.0/LICENSE.txt +++ b/packages/SharpYaml.1.2.0/LICENSE.txt @@ -1,44 +1,44 @@ -Copyright (c) 2013 SharpYaml - Alexandre Mutel - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -------------------------------------------------------------------------------- -SharpYaml is a fork of YamlDotNet https://github.com/aaubry/YamlDotNet -published with the following license: -------------------------------------------------------------------------------- - -Copyright (c) 2008, 2009, 2010, 2011, 2012 Antoine Aubry - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +Copyright (c) 2013 SharpYaml - Alexandre Mutel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +------------------------------------------------------------------------------- +SharpYaml is a fork of YamlDotNet https://github.com/aaubry/YamlDotNet +published with the following license: +------------------------------------------------------------------------------- + +Copyright (c) 2008, 2009, 2010, 2011, 2012 Antoine Aubry + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/packages/SharpYaml.1.2.0/lib/SharpYaml.xml b/packages/SharpYaml.1.2.0/lib/SharpYaml.xml index 52b2ab9a..6e2a1f1b 100644 --- a/packages/SharpYaml.1.2.0/lib/SharpYaml.xml +++ b/packages/SharpYaml.1.2.0/lib/SharpYaml.xml @@ -1,5446 +1,5446 @@ - - - - SharpYaml - - - - - Check if the character at the specified position is an alphabetical - character, a digit, '_', or '-'. - - - - - Check if the character is ASCII. - - - - - Check if the character at the specified position is a digit. - - - - - Get the value of a digit. - - - - - Check if the character at the specified position is a hex-digit. - - - - - Get the value of a hex-digit. - - - - - Check if the character at the specified position is NUL. - - - - - Check if the character at the specified position is tab. - - - - - Check if the character at the specified position is blank (space or tab). - - - - - Check if the character at the specified position is a line break. - - - - - Check if the character is a line break or NUL. - - - - - Check if the character is a line break, space, tab, or NUL. - - - - - Defines constants thar relate to the YAML specification. - - - - - Emits YAML streams. - - - - - Represents a YAML stream emitter. - - - - - Emits an event. - - - - - Initializes a new instance of the class. - - The where the emitter will write. - - - - Initializes a new instance of the class. - - The where the emitter will write. - The preferred indentation. - - - - Initializes a new instance of the class. - - The where the emitter will write. - The preferred indentation. - The preferred text width. - - - - Initializes a new instance of the class. - - The where the emitter will write. - The preferred indentation. - The preferred text width. - If true, write the output in canonical form. - if set to true [always indent]. - - bestIndent - or - bestWidth;The bestWidth parameter must be greater than bestIndent * 2. - - - - - Emit an evt. - - - - - Check if we need to accumulate more events before emitting. - - We accumulate extra - - 1 event for DOCUMENT-START - - 2 events for SEQUENCE-START - - 3 events for MAPPING-START - - - - - Check if the evt data is valid. - - - - - Check if a scalar is valid. - - - - - Check if a tag is valid. - - - - - State dispatcher. - - - - - Expect STREAM-START. - - - - - Expect DOCUMENT-START or STREAM-END. - - - - - Check if the document content is an empty scalar. - - - - - Append a directive to the directives stack. - - - - - Check if a %YAML directive is valid. - - - - - Expect the root node. - - - - - Expect a node. - - - - - Expect SEQUENCE-START. - - - - - Check if the next events represent an empty sequence. - - - - - Check if the next events represent an empty mapping. - - - - - Write a tag. - - - - - Expect MAPPING-START. - - - - - Expect SCALAR. - - - - - Write a scalar. - - - - - Check if the specified character is a space. - - - - - Increase the indentation level. - - - - - Determine an acceptable scalar style. - - - - - Expect ALIAS. - - - - - Write an achor. - - - - - Expect DOCUMENT-END. - - - - - - Expect a flow item node. - - - - - Expect a flow key node. - - - - - Check if the next node can be expressed as a simple key. - - - - - Expect a flow value node. - - - - - Expect a block item node. - - - - - Expect a block key node. - - - - - Expect a block value node. - - - - - Gets or sets a value indicating whether [always indent]. - - true if [always indent]; otherwise, false. - - - - Defines the YAML emitter's state. - - - - - Expect STREAM-START. - - - - - Expect the first DOCUMENT-START or STREAM-END. - - - - - Expect DOCUMENT-START or STREAM-END. - - - - - Expect the content of a document. - - - - - Expect DOCUMENT-END. - - - - - Expect the first item of a flow sequence. - - - - - Expect an item of a flow sequence. - - - - - Expect the first key of a flow mapping. - - - - - Expect a key of a flow mapping. - - - - - Expect a value for a simple key of a flow mapping. - - - - - Expect a value of a flow mapping. - - - - - Expect the first item of a block sequence. - - - - - Expect an item of a block sequence. - - - - - Expect the first key of a block mapping. - - - - - Expect the key of a block mapping. - - - - - Expect a value for a simple key of a block mapping. - - - - - Expect a value of a block mapping. - - - - - Expect nothing. - - - - - Reads events from a sequence of . - - - - - Initializes a new instance of the class. - - The parser that provides the events. - - - - Ensures that the current event is of the specified type, returns it and moves to the next event. - - Type of the . - Returns the current event. - If the current event is not of the specified type. - - - - Moves to the next event. - - - - - Checks whether the current event is of the specified type. - - Type of the event. - Returns true if the current event is of type . Otherwise returns false. - - - - Checks whether the current event is of the specified type. - If the event is of the specified type, returns it and moves to the next event. - Otherwise retruns null. - - Type of the . - Returns the current event if it is of type T; otherwise returns null. - - - - Gets the next event without consuming it. - - Type of the . - Returns the current event if it is of type T; otherwise returns null. - - - - Skips the current event and any "child" event. - - - - - Throws an exception if Ensures the not at end of stream. - - - - - Gets the underlying parser. - - The parser. - - - - Represents an alias event. - - - - - Base class for parsing events. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the position in the input stream where the event starts. - - - - - Gets the position in the input stream where the event ends. - - - - - Initializes a new instance of the class. - - The value of the alias. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - The value of the alias. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the value of the alias. - - - - - Represents a document end event. - - - - - Initializes a new instance of the class. - - Indicates whether the event is implicit. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - Indicates whether the event is implicit. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Represents a document start event. - - - - - Initializes a new instance of the class. - - The version. - The tags. - Indicates whether the event is implicit. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - The version. - The tags. - Indicates whether the event is implicit. - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the tags. - - The tags. - - - - Gets the version. - - The version. - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Defines the event types. This allows for simpler type comparisons. - - - - - An empty event. - - - - - A STREAM-START event. - - - - - A STREAM-END event. - - - - - A DOCUMENT-START event. - - - - - A DOCUMENT-END event. - - - - - An ALIAS event. - - - - - A SCALAR event. - - - - - A SEQUENCE-START event. - - - - - A SEQUENCE-END event. - - - - - A MAPPING-START event. - - - - - A MAPPING-END event. - - - - - Contains the behavior that is common between node events. - - - - - Initializes a new instance of the class. - - The anchor. - The tag. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Gets the anchor. - - - - - - Gets the tag. - - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Represents a mapping end event. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Represents a mapping start event. - - - - - Initializes a new instance of the class. - - The anchor. - The tag. - Indicates whether the event is implicit. - The style of the mapping. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - The anchor. - The tag. - Indicates whether the event is implicit. - The style of the mapping. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Gets the style of the mapping. - - - - - Represents a scalar event. - - - - - Initializes a new instance of the class. - - The anchor. - The tag. - The value. - The style. - . - . - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - The anchor. - The tag. - The value. - The style. - . - . - - - - Initializes a new instance of the class. - - The value. - - - - Initializes a new instance of the class. - - The tag. - The value. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets the value. - - The value. - - - - Gets the style of the scalar. - - The style. - - - - Gets a value indicating whether the tag is optional for the plain style. - - - - - Gets a value indicating whether the tag is optional for any non-plain style. - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Represents a sequence end event. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Represents a sequence start event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The anchor. - The tag. - if set to true [is implicit]. - The style. - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Gets a value indicating whether this instance is implicit. - - - true if this instance is implicit; otherwise, false. - - - - - Gets a value indicating whether this instance is canonical. - - - - - - Gets the style. - - The style. - - - - Provided the base implementation for an IEventEmitter that is a - decorator for another IEventEmitter. - - - - - Interface used to write YAML events. - - - - - Default comparer used to sort keys for object members and dictionary keys. See remarks. - -
    -
  • For members of an object, this comparer will first try to use an explicit order defined by - using otherwise It will use the name of the field/property. -
  • -
  • If both objects are string, use
  • -
  • - For keys of a dictionary, this comparer will try to use interface - when comparing keys. -
  • -
-
- - - The object context used when serializing/deserializing an object instance. See remarks. - - - When serializing, this struct contains the of the object to serialize, the type, the tag to use - and the style, as well as providing access to the . - When deserializing, this struct will contain the expected type to deserialize and if not null, the instance of an object - that will recieve deserialization of its members (in case the instance cannot be created). - - - - - Initializes a new instance of the struct. - - The serializer context. - The instance. - The descriptor. - - - - The serializer context associated to this object context. - - - - - Gets the current YAML reader. Equivalent to calling directly . - - The current YAML reader. - - - - Gets the writer used while deserializing. Equivalent to calling directly . - - The writer. - - - - Gets the settings. Equivalent to calling directly . - - The settings. - - - - Gets the object serializer backend. - - The object serializer backend. - - - - The instance link to this context. - - - - - The expected type descriptor. - - - - - The tag used when serializing. - - - - - The anchor used when serializing. - - - - - The style used when serializing. - - - - - Default implementation for - - - - - This interface is used by , and - as a backend interface for serializing/deserializing member name, member values, collection and dictionary items. The default - implementation is that can be subclassed to provide aditionnal behavior. - - - TODO: Explain why this interface is used and how it can be extended for specific scenarios. - - - - - Gets the style that will be used to serialize the object provided by . - - The object context which contains the object instance to serialize. - The to use when serializing the object instance. - - - - Allows to transform the name of the member while reading for the specified object context. - - The object context to which the member name. - Name of the member read from the current yaml stream. - The name that will be used to get the from the current object context. - - - - Reads the value for the specified member from the current YAML stream. - - The object context. - The member. - The member value. See remarks - Type of the member. - The value read from YAML stream. - - TODO: Explain memberValue when can be not null - - - - - Reads the collection item from the current YAML stream. - - The object context. - Type of the item. - The collection item read from YAML stream. - - - - Reads the dictionary item from the current YAML stream. - - The object context. - Type of the key value. - The dictionary item (key,value) read from YAML stream. - - - - Writes the name of the member. - - The object context. - The member. - Name of the member. - - - - Writes the member value. - - The object context. - The member. - The member value. - Type of the member. - - - - Writes the collection item. - - The object context. - The item. - Type of the item. - - - - Writes the dictionary item. - - The object context. - The key value. - The types. - - - - Specifies the style of a sequence or mapping. - - - - - Let the emitter choose the style. - - - - - The block style. - - - - - The flow style. - - - - - Represents a stream end event. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Initializes a new instance of the class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Represents a stream start event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the event. - The end position of the event. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets a value indicating the variation of depth caused by this event. - The value can be either -1, 0 or 1. For start events, it will be 1, - for end events, it will be -1, and for the remaining events, it will be 0. - - - - - Gets the event type, which allows for simpler type comparisons. - - - - - Implements an indexer through an IEnumerator<T>. - - - - - Initializes a new instance of FakeList<T>. - - The enumerator to use to implement the indexer. - - - - Initializes a new instance of FakeList<T>. - - The collection to use to implement the indexer. - - - - Gets the element at the specified index. - - - If index is greater or equal than the last used index, this operation is O(index - lastIndex), - else this operation is O(index). - - - - - Gets the character at thhe specified offset. - - - - - Skips the next characters. Those characters must have been - obtained first by calling the method. - - - - - Gets a value indicating whether the end of the input reader has been reached. - - - - - Generic queue on which items may be inserted - - - - - Enqueues the specified item. - - The item to be enqueued. - - - - Dequeues an item. - - Returns the item that been dequeued. - - - - Inserts an item at the specified index. - - The index where to insert the item. - The item to be inserted. - - - - Gets the number of items that are contained by the queue. - - - - - Represents a YAML stream paser. - - - - - Moves to the next event. - - Returns true if there are more events available, otherwise returns false. - - - - Gets the current event. - - - - - Provides access to a stream and allows to peek at the next characters, - up to the buffer's capacity. - - - This class implements a circular buffer with a fixed capacity. - - - - - Initializes a new instance of the class. - - The input. - The capacity. - - - - Gets the index of the character for the specified offset. - - - - - Gets the character at thhe specified offset. - - - - - Reads characters until at least characters are in the buffer. - - - Number of characters to cache. - - - - - Skips the next characters. Those characters must have been - obtained first by calling the or methods. - - - - - Gets a value indicating whether the end of the input reader has been reached. - - - - - Represents a location inside a file - - - - - Gets a with empty values. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets / sets the absolute offset in the file - - - - - Gets / sets the number of the line - - - - - Gets / sets the index of the column - - - - - Parses YAML streams. - - - - - Initializes a new instance of the class. - - The input where the YAML stream is to be read. - - - - Moves to the next event. - - Returns true if there are more events available, otherwise returns false. - - - - Parse the production: - stream ::= STREAM-START implicit_document? explicit_document* STREAM-END - ************ - - - - - Parse the productions: - implicit_document ::= block_node DOCUMENT-END* - * - explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - ************************* - - - - - Parse directives. - - - - - Parse the productions: - explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - *********** - - - - - Generate an empty scalar event. - - - - - Parse the productions: - block_node_or_indentless_sequence ::= - ALIAS - ***** - | properties (block_content | indentless_block_sequence)? - ********** * - | block_content | indentless_block_sequence - * - block_node ::= ALIAS - ***** - | properties block_content? - ********** * - | block_content - * - flow_node ::= ALIAS - ***** - | properties flow_content? - ********** * - | flow_content - * - properties ::= TAG ANCHOR? | ANCHOR TAG? - ************************* - block_content ::= block_collection | flow_collection | SCALAR - ****** - flow_content ::= flow_collection | SCALAR - ****** - - - - - Parse the productions: - implicit_document ::= block_node DOCUMENT-END* - ************* - explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* - ************* - - - - - Parse the productions: - block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END - ******************** *********** * ********* - - - - - Parse the productions: - indentless_sequence ::= (BLOCK-ENTRY block_node?)+ - *********** * - - - - - Parse the productions: - block_mapping ::= BLOCK-MAPPING_START - ******************* - ((KEY block_node_or_indentless_sequence?)? - *** * - (VALUE block_node_or_indentless_sequence?)?)* - - BLOCK-END - ********* - - - - - Parse the productions: - block_mapping ::= BLOCK-MAPPING_START - - ((KEY block_node_or_indentless_sequence?)? - - (VALUE block_node_or_indentless_sequence?)?)* - ***** * - BLOCK-END - - - - - - Parse the productions: - flow_sequence ::= FLOW-SEQUENCE-START - ******************* - (flow_sequence_entry FLOW-ENTRY)* - * ********** - flow_sequence_entry? - * - FLOW-SEQUENCE-END - ***************** - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * - - - - - Parse the productions: - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - *** * - - - - - Parse the productions: - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - ***** * - - - - - Parse the productions: - flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * - - - - - Parse the productions: - flow_mapping ::= FLOW-MAPPING-START - ****************** - (flow_mapping_entry FLOW-ENTRY)* - * ********** - flow_mapping_entry? - ****************** - FLOW-MAPPING-END - **************** - flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * *** * - - - - - Parse the productions: - flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? - * ***** * - - - - - Gets the current event. - - - - - Defines the YAML parser's state. - - - - - Expect STREAM-START. - - - - - Expect the beginning of an implicit document. - - - - - Expect DOCUMENT-START. - - - - - Expect the content of a document. - - - - - Expect DOCUMENT-END. - - - - - Expect a block node. - - - - - Expect a block node or indentless sequence. - - - - - Expect a flow node. - - - - - Expect the first entry of a block sequence. - - - - - Expect an entry of a block sequence. - - - - - Expect an entry of an indentless sequence. - - - - - Expect the first key of a block mapping. - - - - - Expect a block mapping key. - - - - - Expect a block mapping value. - - - - - Expect the first entry of a flow sequence. - - - - - Expect an entry of a flow sequence. - - - - - Expect a key of an ordered mapping. - - - - - Expect a value of an ordered mapping. - - - - - Expect the and of an ordered mapping entry. - - - - - Expect the first key of a flow mapping. - - - - - Expect a key of a flow mapping. - - - - - Expect a value of a flow mapping. - - - - - Expect an empty value of a flow mapping. - - - - - Expect nothing. - - - - - Converts a sequence of characters into a sequence of YAML tokens. - - - - - Initializes a new instance of the class. - - The input. - - - - Moves to the next token. - - - - - - Consumes the current token and increments the parsed token count - - - - - Check the list of potential simple keys and remove the positions that - cannot contain simple keys anymore. - - - - - Pop indentation levels from the indents stack until the current level - becomes less or equal to the column. For each intendation level, append - the BLOCK-END token. - - - - - Produce the STREAM-END token and shut down the scanner. - - - - - Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. - - Scope: - %YAML 1.1 # a comment \n - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - %TAG !yaml! tag:yaml.org,2002: \n - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - - - - Produce the DOCUMENT-START or DOCUMENT-END token. - - - - - Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token. - - - - - Increase the flow level and resize the simple key list if needed. - - - - - Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token. - - - - - Decrease the flow level. - - - - - Produce the FLOW-ENTRY token. - - - - - Produce the BLOCK-ENTRY token. - - - - - Produce the KEY token. - - - - - Produce the VALUE token. - - - - - Push the current indentation level to the stack and set the new level - the current column is greater than the indentation level. In this case, - append or insert the specified token into the token queue. - - - - - Produce the ALIAS or ANCHOR token. - - - - - Produce the TAG token. - - - - - Scan a TAG token. - - - - - Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens. - - - - - Scan a block scalar. - - - - - Scan intendation spaces and line breaks for a block scalar. Determine the - intendation level if needed. - - - - - Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. - - - - - Scan a quoted scalar. - - - - - Produce the SCALAR(...,plain) token. - - - - - Scan a plain scalar. - - - - - Remove a potential simple key at the current flow level. - - - - - Scan the directive name. - - Scope: - %YAML 1.1 # a comment \n - ^^^^ - %TAG !yaml! tag:yaml.org,2002: \n - ^^^ - - - - - Scan the value of VERSION-DIRECTIVE. - - Scope: - %YAML 1.1 # a comment \n - ^^^^^^ - - - - - Scan the value of a TAG-DIRECTIVE token. - - Scope: - %TAG !yaml! tag:yaml.org,2002: \n - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - - - - Scan a tag. - - - - - Decode an URI-escape sequence corresponding to a single UTF-8 character. - - - - - Scan a tag handle. - - - - - Scan the version number of VERSION-DIRECTIVE. - - Scope: - %YAML 1.1 # a comment \n - ^ - %YAML 1.1 # a comment \n - ^ - - - - - Check if a simple key may start at the current position and add it if - needed. - - - - - Gets the current position inside the input stream. - - The current position. - - - - Gets the current token. - - - - - Implements the Core schema. - - - The Core schema is an extension of the JSON schema, allowing for more human-readable presentation of the same types. - This is the recommended default schema that YAML processor should use unless instructed otherwise. - It is also strongly recommended that other schemas should be based on it. - - - - - Implements a JSON schema. - - - The JSON schema is the lowest common denominator of most modern computer languages, and allows parsing JSON files. - A YAML processor should therefore support this schema, at least as an option. It is also strongly recommended that other schemas should be based on it. . - > - - - - Implements the YAML failsafe schema. - - - The failsafe schema is guaranteed to work with any YAML document. - It is therefore the recommended schema for generic YAML tools. - A YAML processor should therefore support this schema, at least as an option. - - - - Base implementation for a based schema. - - - - - Provides schema information for tag resolution. - - - - - Expands the tag. Example, transforms a short tag '!!str' to its long version 'tag:yaml.org,2002:str' - - The tag. - Expanded version of the tag. - - - - Shortens the tag. Example, transforms a long tag 'tag:yaml.org,2002:str' to its short version '!!str' - - The tag. - Expanded version of the tag. - - - - Gets the default tag for the specified . The default tag can be different from a actual tag of this . - - The node event. - A short tag. - - - - Gets the default tag for the specified . This is only valid for scalar, return null if no default tag found. - - A short tag. - - - - Determines whether the short tag implicit (e.g. !!int). - - The tag. - true if [is tag implicit] [the specified tag]; otherwise, false. - - - - Gets the default tag and value for the specified . The default tag can be different from a actual tag of this . - - The scalar event. - if set to true [decode value]. - The default tag decoded from the scalar. - The value extracted from a scalar. - System.String. - - - - Gets the default tag and value for the specified . The default tag can be different from a actual tag of this . - - The scalar event. - The type. - The value extracted from a scalar. - System.String. - - - - Gets the type for a default tag. - - The tag in short form. - The type for a default tag or null if no default tag associated - - - - Registers a long/short tag association. - - The short tag. - The long tag. - - shortTag - or - shortTag - - - - - The string short tag: !!str - - - - - The string long tag: tag:yaml.org,2002:str - - - - - Registers a long/short tag association. - - The short tag. - The long tag. - - shortTag - or - shortTag - - - - - Gets the default tag for a event. - - The node event. - The default tag for a map. - - - - Gets the default tag for a event. - - The node event. - The default tag for a seq. - - - - Prepare scalar rules. In the implementation of this method, should call - - - - - Add a tag resolution rule that is invoked when matches - the Value of a node. - The tag is resolved to and is - invoked when actual value of type is extracted from - the node text. - - Type of the scalar - The tag. - The regex. - The decode function. - The encode function. - - - BeginUpdate(); // to avoid invoking slow internal calculation method many times. - Add( ... ); - Add( ... ); - Add( ... ); - Add( ... ); - EndUpdate(); // automaticall invoke internal calculation method - - - - - Allows to register tag mapping for all primitive types (e.g. int -> !!int) - - - - - The map short tag: !!map. - - - - - The map long tag: tag:yaml.org,2002:map - - - - - The seq short tag: !!seq - - - - - The seq long tag: tag:yaml.org,2002:seq - - - - - Initializes a new instance of the class. - - - - - Gets or sets a value indicating whether this schema should always fallback to a - failsafe string in case of not matching any scalar rules. Default is true for - - true if [allow failsafe string]; otherwise, false. - - - - The null short tag: !!null - - - - - The null long tag: tag:yaml.org,2002:null - - - - - The bool short tag: !!bool - - - - - The bool long tag: tag:yaml.org,2002:bool - - - - - The int short tag: !!int - - - - - The int long tag: tag:yaml.org,2002:int - - - - - The float short tag: !!float - - - - - The float long tag: tag:yaml.org,2002:float - - - - - Initializes a new instance of the class. - - - - - Extension to the core schema and accept different flavor of scalars -
    -
  • bool(true): y|Y|yes|Yes|YES|true|True|TRUE|on|On|ON
  • -
  • bool(false): n|N|no|No|NO|false|False|FALSE|off|Off|OFF
  • -
  • timestamp
  • -
-
-
- - - The timestamp short tag: !!timestamp - - - - - The timestamp long tag: tag:yaml.org,2002:timestamp - - - - - The merge short tag: !!merge - - - - - The merge long tag: tag:yaml.org,2002:merge - - - - - Initializes a new instance of the class. - - - - - Exception that is thrown when a semantic error is detected on a YAML stream. - - - - - Base exception that is thrown when the a problem occurs in the SharpYaml library. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Gets the position in the input stream where the event that originated the exception starts. - - - - - Gets the position in the input stream where the event that originated the exception ends. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - The exception that is thrown when an alias references an anchor that does not exist. - - - - - Initializes a new instance of the class. - - The anchor alias. - - - - Initializes a new instance of the class. - - The anchor alias. - The message. - - - - Initializes a new instance of the class. - - The anchor alias. - The start. - The end. - The message. - - - - Gets or sets the anchor alias. - - The anchor alias. - - - - An that can be chained with another object factory; - - - - - Creates instances of types. - - - This interface allows to provide a custom logic for creating instances during deserialization. - - - - - Creates an instance of the specified type. Returns null if instance cannot be created. - - - - - Initializes a new instance of the class. - - The next factory. - - - - Creates objects using Activator.CreateInstance. - - - - - Gets the default implementation for a type. - - The type. - The type of the implem or the same type as input if there is no default implementation - - - - A descriptor for an array. - - - - - Default implementation of a . - - - - - Provides access members of a type. - - - - - Determines whether this instance contains a member with the specified member name. - - Name of the member. - true if this instance contains a member with the specified member name; otherwise, false. - - - - Gets the type described by this instance. - - The type. - - - - Gets the members of this type. - - The members. - - - - Gets the member count. - - The member count. - - - - Gets a value indicating whether this instance has members. - - true if this instance has members; otherwise, false. - - - - Gets the with the specified name. Return null if not found - - The name. - The member. - - - - Gets a value indicating whether this instance is a compiler generated type. - - true if this instance is a compiler generated type; otherwise, false. - - - - Gets the style. - - The style. - - - - Initializes a new instance of the class. - - The attribute registry. - The type. - - type - Failed to get ObjectDescriptor for type [{0}]. The member [{1}] cannot be registered as a member with the same name is already registered [{2}].DoFormat(type.FullName, member, existingMember) - - - - Sorts the members of this instance with the specified instance. - - The key comparer. - - - - Initializes a new instance of the class. - - The attribute registry. - The type. - Expecting arrat type;type - - - - Creates the equivalent of list type for this array. - - A list type with same element type than this array. - - - - Gets the type of the array element. - - The type of the element. - - - - Provides a descriptor for a . - - - - - Initializes a new instance of the class. - - The attribute registry. - The type. - if set to true [emit default values]. - Expecting a type inheriting from System.Collections.ICollection;type - - - - Add to the collections of the same type than this descriptor. - - The collection. - The value to add to this collection. - - - - Determines whether the specified collection is read only. - - The collection. - true if the specified collection is read only; otherwise, false. - - - - Determines the number of elements of a collection, -1 if it cannot determine the number of elements. - - The collection. - The number of elements of a collection, -1 if it cannot determine the number of elements. - - - - Determines whether the specified type is collection. - - The type. - true if the specified type is collection; otherwise, false. - - - - Gets or sets the type of the element. - - The type of the element. - - - - Gets a value indicating whether the collection has only the capacity as a property defined. - - true if the collection has only the capacity as a property defined; otherwise, false. - - - - Gets a value indicating whether this instance is a pure collection (no public property/field) - - true if this instance is pure collection; otherwise, false. - - - - Gets a value indicating whether this collection type has add method. - - true if this instance has add; otherwise, false. - - - - Provides a descriptor for a . - - - - - Initializes a new instance of the class. - - The attribute registry. - The type. - if set to true [emit default values]. - Expecting a type inheriting from System.Collections.IDictionary;type - - - - Determines whether the value passed is readonly. - - The this object. - true if [is read only] [the specified this object]; otherwise, false. - - - - Gets a generic enumerator for a dictionary. - - The dictionary. - A generic enumerator. - dictionary - Key value-pair [{0}] is not supported for IDictionary. Only DictionaryEntry.DoFormat(keyValueObject) - - - - Adds a a key-value to a dictionary. - - The dictionary. - The key. - The value. - No Add() method found on dictionary [{0}].DoFormat(Type) - - - - Determines whether the specified type is a .NET dictionary. - - The type. - true if the specified type is dictionary; otherwise, false. - - - - Gets a value indicating whether this instance is generic dictionary. - - true if this instance is generic dictionary; otherwise, false. - - - - Gets the type of the key. - - The type of the key. - - - - Gets the type of the value. - - The type of the value. - - - - Gets or sets a value indicating whether this instance is pure dictionary. - - true if this instance is pure dictionary; otherwise, false. - - - - A for a - - - - - Base class for for a - - - - - Describe a member of an object. - - - - - Gets the value of this memeber for the specified instance. - - The this object to get the value from. - Value of the member. - - - - Sets a value of this memeber for the specified instance. - - The this object. - The value. - - - - Gets the name. - - The name. - - - - Gets the type. - - The type. - - - - Gets the order of this member. - Default is -1, meaning that it is using the alphabetical order - based on the name of this property. - - The order. - - - - Gets the mode of serialization for this member. - - The mode. - - - - Gets a value indicating whether this instance has set method. - - true if this instance has set method; otherwise, false. - - - - Gets the default style attached to this member. - - The style. - - - - Gets a value indicating whether this member should be serialized. - - true if [should serialize]; otherwise, false. - - - - Gets the type of the declaring this member. - - The type of the declaring. - - - - Gets the member information. - - The member information. - - - - Initializes a new instance of the class. - - The property information. - - - - Returns a that represents this instance. - - A that represents this instance. - - - - Gets the property information attached to this instance. - - The property information. - - - - Describes a descriptor for a nullable type . - - - - - Initializes a new instance of the class. - - The attribute registry. - The type. - Type [{0}] is not a primitive - - - - Determines whether the specified type is nullable. - - The type. - true if the specified type is nullable; otherwise, false. - - - - Gets the type underlying type T of the nullable - - The type of the element. - - - - Describes a descriptor for a primitive (bool, char, sbyte, byte, int, uint, long, ulong, float, double, decimal, string, DateTime). - - - - - Initializes a new instance of the class. - - The attribute registry. - The type. - Type [{0}] is not a primitive - - - - Determines whether the specified type is a primitive. - - The type. - true if the specified type is primitive; otherwise, false. - - - - A for a - - - - - Initializes a new instance of the class. - - The property information. - - - - Returns a that represents this instance. - - A that represents this instance. - - - - Gets the property information attached to this instance. - - The property information. - - - - A default implementation for the . - - - - - A factory to create an instance of a - - - - - Tries to create an instance of a from the type. Return null if this factory is not handling this type. - - The type. - ITypeDescriptor. - - - - Initializes a new instance of the class. - - The attribute registry. - if set to true [emit default values]. - attributeRegistry - - - - Creates a type descriptor for the specified type. - - The type. - An instance of type descriptor. - - - - Gets the settings. - - The settings. - - - - Manages the state of a while it is loading. - - - - - Adds the specified node to the anchor list. - - The node. - - - - Gets the node with the specified anchor. - - The anchor. - if set to true, the method should throw an exception if there is no node with that anchor. - The start position. - The end position. - - - - - Adds the specified node to the collection of nodes with unresolved aliases. - - - The that has unresolved aliases. - - - - - Resolves the aliases that could not be resolved while loading the document. - - - - - The exception that is thrown when a duplicate anchor is detected. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Holds state that is used when emitting a stream. - - - - - Gets the already emitted anchors. - - The emitted anchors. - - - - A registry for all attributes. - - - - - Gets the attributes associated with the specified member. - - The reflection member. - if set to true includes inherited attributes. - An enumeration of . - - - - Registers an attribute for the specified member. Restriction: Attributes registered this way cannot be listed in inherited attributes. - - The member information. - The attribute. - - - - Extension methods for attribute registry. - - - - - Gets the attributes associated with the specified member. - - Type of the attribute - The member information. - if set to true [inherit]. - An enumeration of . - - - - Gets the first attribute of type T associated with the specified member. - - Type of the attribute - The member information. - if set to true [inherit]. - An attribute of type {T} if it was found; otherwise null - - - - Prodives tag discovery from a type and type discovery from a tag. - - - - - Finds a type from a tag, null if not found. - - Name of the tag. - A Type or null if not found - - - - Finds a tag from a type, null if not found. - - The type. - A tag or null if not found - - - - Resolves a type from the specified typeName. - - Name of the type. - Type found for this typeName - - - - Registers an assembly when trying to resolve types. All types - having will be registered - automatically. - - The assembly. - The attribute registry to use when quering for . - - - - Register a mapping between a tag and a type. - - The tag. - The type. - - - - Defines the method needed to be able to visit Yaml elements. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Visits a . - - - The that is being visited. - - - - - Creates objects using a Func{Type,object}"/>. - - - - - Initializes a new instance of the class. - - The factory. - - - - Initializes a new instance of the class. - - The factory. - The next factory. - factory - - - - Allows an object to customize how it is serialized and deserialized. - - - - - Reads this object's state from a YAML parser. - - - A instance of the object deserialized from Yaml. - - - - Writes the specified object context to a YAML emitter. - - The object context. - - - - A factory of - - - - - Try to create a or return null if not supported for a particular .NET typeDescriptor. - - - The typeDescriptor. - If supported, return an instance of else return null. - - - - Class for serializing a or - - - - - Base class for serializing an object that can be a Yaml !!map or !!seq. - - - - - Initializes a new instance of the class. - - - - - - - - Checks if a type is a sequence. - - - true if a type is a sequence, false otherwise. - - - - Gets the style that will be used to serialized the object. - - - The to use. Default is . - - - - Overrides this method when deserializing/serializing an object that needs a special instantiation or transformation. By default, this is calling - if the is null or returning . - - The object context. - A new instance of the object or if not null - - - - Transforms the object after it has been read. This method is called after an object has been read and before returning the object to - the deserialization process. See remarks for usage. - - - The actual object deserialized. By default same as . - - This method is usefull in conjunction with . - For example, in the case of deserializing to an immutable member, where we need to call the constructor of a type instead of setting each of - its member, we can instantiate a mutable object in , receive the mutable object filled in - and transform it back to an immutable object. - - - - - Reads the members from the current stream. - - The type of the t start. - The type of the t end. - - Return the object being read, by default thisObject passed by argument. - - - - Reads an item of the object from the YAML flow (either a sequence item or mapping key/value item). - - - Unable to deserialize property [{0}] not found in type [{1}].DoFormat(propertyName, typeDescriptor) - - - - - - - Writes the members of the object to serialize. By default this method is iterating on the and - calling on each member. - - - - - - Writes a member. - - - The member. - - - - Initializes a new instance of the class. - - - - - Reads the collection items. - - The object context. - Cannot deserialize list to type [{0}]. No Add method found.DoFormat(thisObject.GetType()) - or - Cannot deserialize list to readonly collection type [{0}]..DoFormat(thisObject.GetType()) - - - - Reads a collection item. - - The object context. - Type of the item. - The item to add to the current collection. - - - - Writes the collection items. - - The object context. - - - - Writes the collection item. - - The object context. - The item. - Type of the item. - - - - Class for serializing a or - - - - - Initializes a new instance of the class. - - - - - - - - Reads the dictionary items key-values. - - - - - - Reads a dictionary item key-value. - - The object context. - KeyValuePair{System.ObjectSystem.Object}. - - - - Writes the dictionary items keys-values. - - The object context. - - - - Writes the dictionary item key-value. - - The object context. - The key value. - - - - Writes the scalar to the . See remarks. - - The object context. - The scalar. - - This method can be overloaded to replace the converted scalar just before writing it. - - - - - This serializer is responsible to route to a specific serializer. - - - - - A context used while deserializing. - - - - - Initializes a new instance of the class. - - The serializer. - - - - The default function to read an object from the current Yaml stream. - - The value of the receiving object, may be null. - The expected type. - System.Object. - - - - The default function to write an object to Yaml - - - - - Finds the type descriptor for the specified type. - - The type. - An instance of . - - - - Resolves a type from the specified tag. - - Name of the tag. - Type. - - - - Resolves a tag from a type - - The type. - The associated tag - - - - Resolves a type from the specified typename using registered assemblies. - - Full name of the type. - The type of null if not found - - - - Gets the default tag and value for the specified . The default tag can be different from a actual tag of this . - - The scalar event. - The default tag decoded from the scalar. - The value extracted from a scalar. - System.String. - - - - Gets a value indicating whether we are in the context of serializing. - - true if we are in the context of serializing; otherwise, false. - - - - Gets the settings. - - The settings. - - - - Gets the schema. - - The schema. - - - - Gets the serializer. - - The serializer. - - - - Gets the reader used while deserializing. - - The reader. - - - - Gets the object serializer backend. - - The object serializer backend. - - - - Gets or sets the type of the create. - - The type of the create. - - - - Gets the writer used while deserializing. - - The writer. - - - - Gets the emitter. - - The emitter. - - - - A default implementation for . - This implementation allows to retrieve default attributes for a member or - to attach an attribute to a specific type/member. - - - - - Gets the attributes associated with the specified member. - - The reflection member. - if set to true includes inherited attributes. - An enumeration of . - - - - Registers an attribute for the specified member. Restriction: Attributes registered this way cannot be listed in inherited attributes. - - The member information. - The attribute. - - - - Default implementation of ITagTypeRegistry. - - - - - Initializes a new instance of the class. - - - - - Register a mapping between a tag and a type. - - The tag. - The type. - - - - Gets or sets a value indicating whether [use short type name]. - - true if [use short type name]; otherwise, false. - - - - Represents an alias node in the YAML document. - - - - - Represents a single node in the YAML document. - - - - - Loads the specified event. - - The event. - The state of the document. - - - - Parses the node represented by the next event in . - - The events. - The state. - Returns the node that has been parsed. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - Provides a basic implementation of Object.Equals - - - - - Gets a value indicating whether two objects are equal. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Gets the hash code of the specified object, or zero if the object is null. - - - - - Combines two hash codes into one. - - - - - Gets or sets the anchor of the node. - - The anchor. - - - - Gets or sets the tag of the node. - - The tag. - - - - Gets the position in the input stream where the event that originated the node starts. - - - - - Gets the position in the input stream where the event that originated the node ends. - - - - - Gets all nodes from the document, starting on the current node. - - - - - Initializes a new instance of the class. - - The anchor. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets all nodes from the document, starting on the current node. - - - - - Represents an YAML document. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a single scalar node. - - - - - Initializes a new instance of the class. - - The events. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - Gets or sets the root node. - - The root node. - - - - Gets all nodes from the document. - - - - - Visitor that assigns anchors to nodes that are referenced more than once but have no anchor. - - - - - Abstract implementation of that knows how to walk a complete Yaml object model. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Called when this object is visiting a . - - - The that is being visited. - - - - - Called after this object finishes visiting a . - - - The that has been visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Visits every child of a . - - - The that is being visited. - - - - - Instructs the YamlSerializer not to serialize the public field or public read/write property value. - - - - - Represents a mapping node in the YAML document. - - - - - Initializes a new instance of the class. - - The events. - The state. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - A sequence of where even elements are keys and odd elements are values. - - - - Initializes a new instance of the class. - - A sequence of where even elements are keys and odd elements are values. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Adds the specified mapping to the collection. - - The key node. - The value node. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - - - - Gets the children of the current node. - - The children. - - - - Gets or sets the style of the node. - - The style. - - - - Gets all nodes from the document, starting on the current node. - - - - - Specify the way to store a property or field of some class or structure. - - - - - Initializes a new instance of the class. - - The order. - - - - Initializes a new instance of the class. - - The name. - - - - Specify the way to store a property or field of some class or structure. - - The name. - The serialize method. - - - - Specify the way to store a property or field of some class or structure. - - The serialize method. - - - - Gets the name. - - The name. - - - - Gets the serialize method1. - - The serialize method1. - - - - Gets or sets the order. Default is -1 (default to alphabetical) - - The order. - - - - Comparer that is based on identity comparisons. - - - - - - - - - - - Represents a scalar node in the YAML document. - - - - - Initializes a new instance of the class. - - The events. - The state. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The value. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Performs an implicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the value of the node. - - The value. - - - - Gets or sets the style of the node. - - The style. - - - - Gets all nodes from the document, starting on the current node. - - - - - Represents a sequence node in the YAML document. - - - - - Initializes a new instance of the class. - - The events. - The state. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Adds the specified child to the collection. - - The child. - - - - Adds a scalar node to the collection. - - The child. - - - - Resolves the aliases that could not be resolved when the node was created. - - The state of the document. - - - - Saves the current node to the specified emitter. - - The emitter where the node is to be saved. - The state. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - - - - Gets the collection of child nodes. - - The children. - - - - Gets or sets the style of the node. - - The style. - - - - Gets all nodes from the document, starting on the current node. - - - - - Specify the way to store a property or field of some class or structure. - See for detail. - - - - - Use the default mode depending on the type of the field/property. - - - - - When restored, new object is created by using the parameters in - the YAML data and assigned to the property / field. When the - property / filed is writeable, this is the default. - - - - - Only valid for a property / field that has a class or struct type. - When restored, instead of recreating the whole class or struct, - the members are independently restored. When the property / field - is not writeable this is the default. - - - - - Only valid for a property / field that has an array type of a - some value type. The content of the array is stored in a binary - format encoded in base64 style. - - - - - The property / field will not be stored. - - - - - Serializes and deserializes objects into and from YAML documents. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The settings. - - - - Serializes the specified object to a string. - - The graph. - A YAML string of the object. - - - - Serializes the specified object to a string. - - The graph. - The expected type. - A YAML string of the object. - - - - Serializes the specified object. - - The stream. - The object to serialize. - - - - Serializes the specified object. - - The stream. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - The static type of the object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - - - - Serializes the specified object. - - The where to serialize the object. - The object to serialize. - The static type of the object to serialize. - - - - Deserializes an object from the specified . - - The stream. - A deserialized object. - - - - Deserializes an object from the specified . - - The reader. - A deserialized object. - - - - Deserializes an object from the specified with an expected specific type. - - The stream. - The expected type. - A deserialized object. - stream - - - - Deserializes an object from the specified with an expected specific type. - - The expected type - The stream. - A deserialized object. - stream - - - - Deserializes an object from the specified with an expected specific type. - - The reader. - The expected type. - A deserialized object. - reader - - - - Deserializes an object from the specified with an expected specific type. - - The expected type - The reader. - A deserialized object. - reader - - - - Deserializes an object from the specified string. - - The text. - A deserialized object. - - - - Deserializes an object from the specified string. with an expected specific type. - - From text. - The expected type. - A deserialized object. - stream - - - - Deserializes an object from the specified string. with an expected specific type. - - The expected type - From text. - A deserialized object. - stream - - - - Deserializes an object from the specified with an expected specific type. - - The expected type - The reader. - A deserialized object. - reader - - - - Deserializes an object from the specified with an expected specific type. - - The reader. - The expected type. - A deserialized object. - reader - - - - Gets the settings. - - The settings. - - - - Settings used to configure serialization and control how objects are encoded into YAML. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Register a mapping between a tag and a type. - - The assembly. - - - - Register a mapping between a tag and a type. - - Name of the tag. - Type of the tag. - - - - Adds a custom serializer for the specified type. - - The type. - The serializer. - - type - or - serializer - - - - - Adds a serializer factory. - - The factory. - factory - - - - Gets or sets the preferred indentation. Default is 2. - - The preferred indentation. - value;Expecting value > 0 - - - - Gets or sets a value indicating whether to emit anchor alias. Default is true. - - true to emit anchor alias; otherwise, false. - - - - Gets or sets a value indicating whether to emit tags when serializing. Default is true. - - true to emit tags when serializing; otherwise, false. - - - - Gets or sets a value indicating whether the identation is trying to less - indent when possible - (For example, sequence after a key are not indented). Default is false. - - true if [always indent]; otherwise, false. - - - - Gets or sets a value indicating whether to enable sorting keys from dictionary to YAML mapping. Default is true. See remarks. - - true to enable sorting keys from dictionary to YAML mapping; otherwise, false. - When storing a YAML document, It can be important to keep the same order for key mapping in order to keep - a YAML document versionable/diffable. - - - - Gets or sets a value indicating whether to emit JSON compatible YAML. - - true if to emit JSON compatible YAML; otherwise, false. - - - - Gets or sets a value indicating whether the property should be emitted. Default is false. - - true if the property should be emitted; otherwise, false. - - - - Gets or sets the maximum number of elements an array/list of primitive can be emitted as a - flow sequence (instead of a block sequence by default). Default is 0, meaning block style - for all sequuences. - - The emit compact array limit. - - - - Gets or sets a value indicating whether to emit default value. Default is false. - - true if to emit default value; otherwise, false. - - - - Gets or sets the default key comparer used to sort members () or - dictionary keys, when serializing objects as YAML mappings. Default is . - To disable the default comparer, this value can be set to null. - - The key comparer. - - - - Gets or sets a value indicating whether to emit short type name (type, assembly name) or full . Default is false. - - true to emit short type name; otherwise, false. - - - - Gets or sets the default . Default is . See to understand the resolution of styles. - - The default style. - - - - Gets or sets the prefix used to serialize items for a non pure or - - . Default to "~Items", see remarks. - - The prefix for items. - value - Expecting length >= 2 and at least a special character '.', '~', '-' (not starting on first char for '-') - A pure or is a class that inherits from these types but are not adding any - public properties or fields. When these types are pure, they are respectively serialized as a YAML mapping (for dictionary) or a YAML sequence (for collections). - If the collection type to serialize is not pure, the type is serialized as a YAML mapping sequence that contains the public properties/fields as well as a - special fielx (e.g. "~Items") that contains the actual items of the collection (either a mapping for dictionary or a sequence for collections). - The is this special key that is used when serializing items of a non-pure collection. - - - - Gets the attribute registry. - - The attribute registry. - - - - Gets or sets the ObjectSerializerBackend. Default implementation is - - The ObjectSerializerBackend. - - - - Gets or sets the default factory to instantiate a type. Default is . - - The default factory to instantiate a type. - value - - - - Gets or sets the schema. Default is . - method. - - The schema. - value - - - - Represents an YAML stream. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Adds the specified document to the collection. - - The document. - - - - Loads the stream from the specified input. - - The input. - - - - Saves the stream to the specified output. - - The output. - - - - Accepts the specified visitor by calling the appropriate Visit method on it. - - - A . - - - - - - - - Gets the documents inside the stream. - - The documents. - - - - An attribute to associate a tag with a particular type. - - - - - Initializes a new instance of the class. - - The tag. - - - - Gets the tag. - - The tag. - - - - Represents a simple key. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Gets or sets a value indicating whether this instance is possible. - - - true if this instance is possible; otherwise, false. - - - - - Gets or sets a value indicating whether this instance is required. - - - true if this instance is required; otherwise, false. - - - - - Gets or sets the token number. - - The token number. - - - - Gets or sets the mark that indicates the location of the simple key. - - The mark. - - - - Add extensions methods to . - - - - - Expression of string.Format(this, arg1, arg2, ...) - - The format string. - The arguments. - A formatted string. - - - - - Exception that is thrown when a syntax error is detected on a YAML stream. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Collection of . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Initial content of the collection. - - - - - - - Gets a value indicating whether the collection contains a directive with the same handle - - - - - Represents an alias token. - - - - - Base class for YAML tokens. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Gets the start of the token in the input stream. - - - - - Gets the end of the token in the input stream. - - - - - Initializes a new instance of the class. - - The value of the anchor. - - - - Initializes a new instance of the class. - - The value of the anchor. - The start position of the event. - The end position of the event. - - - - Gets the value of the alias. - - - - - Represents an anchor token. - - - - - Initializes a new instance of the class. - - The value. - - - - Initializes a new instance of the class. - - The value. - The start position of the token. - The end position of the token. - - - - Gets the value. - - The value. - - - - Represents a block end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a block entry event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a block mapping start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a block sequence start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a document end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a document start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow entry event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow mapping end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow mapping start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow sequence end token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a flow sequence start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a key token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a scalar token. - - - - - Initializes a new instance of the class. - - The value. - - - - Initializes a new instance of the class. - - The value. - The style. - - - - Initializes a new instance of the class. - - The value. - The style. - The start position of the token. - The end position of the token. - - - - Gets the value. - - The value. - - - - Gets the style. - - The style. - - - - Specifies the style of a YAML scalar. - - - - - Let the emitter choose the style. - - - - - The plain scalar style. - - - - - The single-quoted scalar style. - - - - - The double-quoted scalar style. - - - - - The literal scalar style. - - - - - The folded scalar style. - - - - - Represents a stream end event. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a stream start token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a tag token. - - - - - Initializes a new instance of the class. - - The handle. - The suffix. - - - - Initializes a new instance of the class. - - The handle. - The suffix. - The start position of the token. - The end position of the token. - - - - Gets the handle. - - The handle. - - - - Gets the suffix. - - The suffix. - - - - Represents a tag directive token. - - - - - Initializes a new instance of the class. - - The handle. - The prefix. - - - - Initializes a new instance of the class. - - The handle. - The prefix. - The start position of the token. - The end position of the token. - - - - Determines whether the specified System.Object is equal to the current System.Object. - - The System.Object to compare with the current System.Object. - - true if the specified System.Object is equal to the current System.Object; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - - - - Gets the handle. - - The handle. - - - - Gets the prefix. - - The prefix. - - - - Represents a value token. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The start position of the token. - The end position of the token. - - - - Represents a version directive token. - - - - - Initializes a new instance of the class. - - The version. - - - - Initializes a new instance of the class. - - The version. - The start position of the token. - The end position of the token. - - - - Determines whether the specified System.Object is equal to the current System.Object. - - The System.Object to compare with the current System.Object. - - true if the specified System.Object is equal to the current System.Object; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Gets the version. - - The version. - - - - Gets the assembly qualified name of the type, but without the assembly version or public token. - - The type. - The assembly qualified name of the type, but without the assembly version or public token. - Unable to get an assembly qualified name for type [{0}].DoFormat(type) - - - - Determines whether the specified type is an anonymous type. - - The type. - true if the specified type is anonymous; otherwise, false. - - - - Determines whether the specified type is nullable . - - The type. - true if the specified type is nullable; otherwise, false. - - - - Check if the type is a ValueType and does not contain any non ValueType members. - - - - - - - Returnes true if the specified is a struct type. - - to be analyzed. - true if the specified is a struct type; otehrwise false. - - - - Return if an object is a numeric value. - - The type. - True if object is a numeric value. - - - - Compare two objects to see if they are equal or not. Null is acceptable. - - - - - - - - Cast an object to a specified numeric type. - - Any object - Numric type - Numeric value or null if the object is not a numeric value. - - - - Cast boxed numeric value to double - - boxed numeric value - Numeric value in double. Double.Nan if obj is not a numeric value. - - - - Specifies the version of the YAML language. - - - - - Initializes a new instance of the class. - - The the major version number. - The the minor version number. - - - - Determines whether the specified System.Object is equal to the current System.Object. - - The System.Object to compare with the current System.Object. - - true if the specified System.Object is equal to the current System.Object; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Gets the major version number. - - - - - Gets the minor version number. - - - - - An attribute to modify the output style of a sequence or mapping. - This attribute can be apply directly on a type or on a property/field. - - - - - Initializes a new instance of the class. - - The style. - - - - Gets the style. - - The style. - - - + + + + SharpYaml + + + + + Check if the character at the specified position is an alphabetical + character, a digit, '_', or '-'. + + + + + Check if the character is ASCII. + + + + + Check if the character at the specified position is a digit. + + + + + Get the value of a digit. + + + + + Check if the character at the specified position is a hex-digit. + + + + + Get the value of a hex-digit. + + + + + Check if the character at the specified position is NUL. + + + + + Check if the character at the specified position is tab. + + + + + Check if the character at the specified position is blank (space or tab). + + + + + Check if the character at the specified position is a line break. + + + + + Check if the character is a line break or NUL. + + + + + Check if the character is a line break, space, tab, or NUL. + + + + + Defines constants thar relate to the YAML specification. + + + + + Emits YAML streams. + + + + + Represents a YAML stream emitter. + + + + + Emits an event. + + + + + Initializes a new instance of the class. + + The where the emitter will write. + + + + Initializes a new instance of the class. + + The where the emitter will write. + The preferred indentation. + + + + Initializes a new instance of the class. + + The where the emitter will write. + The preferred indentation. + The preferred text width. + + + + Initializes a new instance of the class. + + The where the emitter will write. + The preferred indentation. + The preferred text width. + If true, write the output in canonical form. + if set to true [always indent]. + + bestIndent + or + bestWidth;The bestWidth parameter must be greater than bestIndent * 2. + + + + + Emit an evt. + + + + + Check if we need to accumulate more events before emitting. + + We accumulate extra + - 1 event for DOCUMENT-START + - 2 events for SEQUENCE-START + - 3 events for MAPPING-START + + + + + Check if the evt data is valid. + + + + + Check if a scalar is valid. + + + + + Check if a tag is valid. + + + + + State dispatcher. + + + + + Expect STREAM-START. + + + + + Expect DOCUMENT-START or STREAM-END. + + + + + Check if the document content is an empty scalar. + + + + + Append a directive to the directives stack. + + + + + Check if a %YAML directive is valid. + + + + + Expect the root node. + + + + + Expect a node. + + + + + Expect SEQUENCE-START. + + + + + Check if the next events represent an empty sequence. + + + + + Check if the next events represent an empty mapping. + + + + + Write a tag. + + + + + Expect MAPPING-START. + + + + + Expect SCALAR. + + + + + Write a scalar. + + + + + Check if the specified character is a space. + + + + + Increase the indentation level. + + + + + Determine an acceptable scalar style. + + + + + Expect ALIAS. + + + + + Write an achor. + + + + + Expect DOCUMENT-END. + + + + + + Expect a flow item node. + + + + + Expect a flow key node. + + + + + Check if the next node can be expressed as a simple key. + + + + + Expect a flow value node. + + + + + Expect a block item node. + + + + + Expect a block key node. + + + + + Expect a block value node. + + + + + Gets or sets a value indicating whether [always indent]. + + true if [always indent]; otherwise, false. + + + + Defines the YAML emitter's state. + + + + + Expect STREAM-START. + + + + + Expect the first DOCUMENT-START or STREAM-END. + + + + + Expect DOCUMENT-START or STREAM-END. + + + + + Expect the content of a document. + + + + + Expect DOCUMENT-END. + + + + + Expect the first item of a flow sequence. + + + + + Expect an item of a flow sequence. + + + + + Expect the first key of a flow mapping. + + + + + Expect a key of a flow mapping. + + + + + Expect a value for a simple key of a flow mapping. + + + + + Expect a value of a flow mapping. + + + + + Expect the first item of a block sequence. + + + + + Expect an item of a block sequence. + + + + + Expect the first key of a block mapping. + + + + + Expect the key of a block mapping. + + + + + Expect a value for a simple key of a block mapping. + + + + + Expect a value of a block mapping. + + + + + Expect nothing. + + + + + Reads events from a sequence of . + + + + + Initializes a new instance of the class. + + The parser that provides the events. + + + + Ensures that the current event is of the specified type, returns it and moves to the next event. + + Type of the . + Returns the current event. + If the current event is not of the specified type. + + + + Moves to the next event. + + + + + Checks whether the current event is of the specified type. + + Type of the event. + Returns true if the current event is of type . Otherwise returns false. + + + + Checks whether the current event is of the specified type. + If the event is of the specified type, returns it and moves to the next event. + Otherwise retruns null. + + Type of the . + Returns the current event if it is of type T; otherwise returns null. + + + + Gets the next event without consuming it. + + Type of the . + Returns the current event if it is of type T; otherwise returns null. + + + + Skips the current event and any "child" event. + + + + + Throws an exception if Ensures the not at end of stream. + + + + + Gets the underlying parser. + + The parser. + + + + Represents an alias event. + + + + + Base class for parsing events. + + + + + Initializes a new instance of the class. + + The start position of the event. + The end position of the event. + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Gets the position in the input stream where the event starts. + + + + + Gets the position in the input stream where the event ends. + + + + + Initializes a new instance of the class. + + The value of the alias. + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + The value of the alias. + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Gets the value of the alias. + + + + + Represents a document end event. + + + + + Initializes a new instance of the class. + + Indicates whether the event is implicit. + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + Indicates whether the event is implicit. + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Gets a value indicating whether this instance is implicit. + + + true if this instance is implicit; otherwise, false. + + + + + Represents a document start event. + + + + + Initializes a new instance of the class. + + The version. + The tags. + Indicates whether the event is implicit. + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + The version. + The tags. + Indicates whether the event is implicit. + + + + Initializes a new instance of the class. + + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Gets the tags. + + The tags. + + + + Gets the version. + + The version. + + + + Gets a value indicating whether this instance is implicit. + + + true if this instance is implicit; otherwise, false. + + + + + Defines the event types. This allows for simpler type comparisons. + + + + + An empty event. + + + + + A STREAM-START event. + + + + + A STREAM-END event. + + + + + A DOCUMENT-START event. + + + + + A DOCUMENT-END event. + + + + + An ALIAS event. + + + + + A SCALAR event. + + + + + A SEQUENCE-START event. + + + + + A SEQUENCE-END event. + + + + + A MAPPING-START event. + + + + + A MAPPING-END event. + + + + + Contains the behavior that is common between node events. + + + + + Initializes a new instance of the class. + + The anchor. + The tag. + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + + + + Gets the anchor. + + + + + + Gets the tag. + + + + + + Gets a value indicating whether this instance is canonical. + + + + + + Represents a mapping end event. + + + + + Initializes a new instance of the class. + + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Represents a mapping start event. + + + + + Initializes a new instance of the class. + + The anchor. + The tag. + Indicates whether the event is implicit. + The style of the mapping. + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + The anchor. + The tag. + Indicates whether the event is implicit. + The style of the mapping. + + + + Initializes a new instance of the class. + + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Gets a value indicating whether this instance is implicit. + + + true if this instance is implicit; otherwise, false. + + + + + Gets a value indicating whether this instance is canonical. + + + + + + Gets the style of the mapping. + + + + + Represents a scalar event. + + + + + Initializes a new instance of the class. + + The anchor. + The tag. + The value. + The style. + . + . + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + The anchor. + The tag. + The value. + The style. + . + . + + + + Initializes a new instance of the class. + + The value. + + + + Initializes a new instance of the class. + + The tag. + The value. + + + + Initializes a new instance of the class. + + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Gets the value. + + The value. + + + + Gets the style of the scalar. + + The style. + + + + Gets a value indicating whether the tag is optional for the plain style. + + + + + Gets a value indicating whether the tag is optional for any non-plain style. + + + + + Gets a value indicating whether this instance is canonical. + + + + + + Represents a sequence end event. + + + + + Initializes a new instance of the class. + + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Represents a sequence start event. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The anchor. + The tag. + if set to true [is implicit]. + The style. + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Gets a value indicating whether this instance is implicit. + + + true if this instance is implicit; otherwise, false. + + + + + Gets a value indicating whether this instance is canonical. + + + + + + Gets the style. + + The style. + + + + Provided the base implementation for an IEventEmitter that is a + decorator for another IEventEmitter. + + + + + Interface used to write YAML events. + + + + + Default comparer used to sort keys for object members and dictionary keys. See remarks. + +
    +
  • For members of an object, this comparer will first try to use an explicit order defined by + using otherwise It will use the name of the field/property. +
  • +
  • If both objects are string, use
  • +
  • + For keys of a dictionary, this comparer will try to use interface + when comparing keys. +
  • +
+
+ + + The object context used when serializing/deserializing an object instance. See remarks. + + + When serializing, this struct contains the of the object to serialize, the type, the tag to use + and the style, as well as providing access to the . + When deserializing, this struct will contain the expected type to deserialize and if not null, the instance of an object + that will recieve deserialization of its members (in case the instance cannot be created). + + + + + Initializes a new instance of the struct. + + The serializer context. + The instance. + The descriptor. + + + + The serializer context associated to this object context. + + + + + Gets the current YAML reader. Equivalent to calling directly . + + The current YAML reader. + + + + Gets the writer used while deserializing. Equivalent to calling directly . + + The writer. + + + + Gets the settings. Equivalent to calling directly . + + The settings. + + + + Gets the object serializer backend. + + The object serializer backend. + + + + The instance link to this context. + + + + + The expected type descriptor. + + + + + The tag used when serializing. + + + + + The anchor used when serializing. + + + + + The style used when serializing. + + + + + Default implementation for + + + + + This interface is used by , and + as a backend interface for serializing/deserializing member name, member values, collection and dictionary items. The default + implementation is that can be subclassed to provide aditionnal behavior. + + + TODO: Explain why this interface is used and how it can be extended for specific scenarios. + + + + + Gets the style that will be used to serialize the object provided by . + + The object context which contains the object instance to serialize. + The to use when serializing the object instance. + + + + Allows to transform the name of the member while reading for the specified object context. + + The object context to which the member name. + Name of the member read from the current yaml stream. + The name that will be used to get the from the current object context. + + + + Reads the value for the specified member from the current YAML stream. + + The object context. + The member. + The member value. See remarks + Type of the member. + The value read from YAML stream. + + TODO: Explain memberValue when can be not null + + + + + Reads the collection item from the current YAML stream. + + The object context. + Type of the item. + The collection item read from YAML stream. + + + + Reads the dictionary item from the current YAML stream. + + The object context. + Type of the key value. + The dictionary item (key,value) read from YAML stream. + + + + Writes the name of the member. + + The object context. + The member. + Name of the member. + + + + Writes the member value. + + The object context. + The member. + The member value. + Type of the member. + + + + Writes the collection item. + + The object context. + The item. + Type of the item. + + + + Writes the dictionary item. + + The object context. + The key value. + The types. + + + + Specifies the style of a sequence or mapping. + + + + + Let the emitter choose the style. + + + + + The block style. + + + + + The flow style. + + + + + Represents a stream end event. + + + + + Initializes a new instance of the class. + + The start position of the event. + The end position of the event. + + + + Initializes a new instance of the class. + + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Represents a stream start event. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the event. + The end position of the event. + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets a value indicating the variation of depth caused by this event. + The value can be either -1, 0 or 1. For start events, it will be 1, + for end events, it will be -1, and for the remaining events, it will be 0. + + + + + Gets the event type, which allows for simpler type comparisons. + + + + + Implements an indexer through an IEnumerator<T>. + + + + + Initializes a new instance of FakeList<T>. + + The enumerator to use to implement the indexer. + + + + Initializes a new instance of FakeList<T>. + + The collection to use to implement the indexer. + + + + Gets the element at the specified index. + + + If index is greater or equal than the last used index, this operation is O(index - lastIndex), + else this operation is O(index). + + + + + Gets the character at thhe specified offset. + + + + + Skips the next characters. Those characters must have been + obtained first by calling the method. + + + + + Gets a value indicating whether the end of the input reader has been reached. + + + + + Generic queue on which items may be inserted + + + + + Enqueues the specified item. + + The item to be enqueued. + + + + Dequeues an item. + + Returns the item that been dequeued. + + + + Inserts an item at the specified index. + + The index where to insert the item. + The item to be inserted. + + + + Gets the number of items that are contained by the queue. + + + + + Represents a YAML stream paser. + + + + + Moves to the next event. + + Returns true if there are more events available, otherwise returns false. + + + + Gets the current event. + + + + + Provides access to a stream and allows to peek at the next characters, + up to the buffer's capacity. + + + This class implements a circular buffer with a fixed capacity. + + + + + Initializes a new instance of the class. + + The input. + The capacity. + + + + Gets the index of the character for the specified offset. + + + + + Gets the character at thhe specified offset. + + + + + Reads characters until at least characters are in the buffer. + + + Number of characters to cache. + + + + + Skips the next characters. Those characters must have been + obtained first by calling the or methods. + + + + + Gets a value indicating whether the end of the input reader has been reached. + + + + + Represents a location inside a file + + + + + Gets a with empty values. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets / sets the absolute offset in the file + + + + + Gets / sets the number of the line + + + + + Gets / sets the index of the column + + + + + Parses YAML streams. + + + + + Initializes a new instance of the class. + + The input where the YAML stream is to be read. + + + + Moves to the next event. + + Returns true if there are more events available, otherwise returns false. + + + + Parse the production: + stream ::= STREAM-START implicit_document? explicit_document* STREAM-END + ************ + + + + + Parse the productions: + implicit_document ::= block_node DOCUMENT-END* + * + explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* + ************************* + + + + + Parse directives. + + + + + Parse the productions: + explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* + *********** + + + + + Generate an empty scalar event. + + + + + Parse the productions: + block_node_or_indentless_sequence ::= + ALIAS + ***** + | properties (block_content | indentless_block_sequence)? + ********** * + | block_content | indentless_block_sequence + * + block_node ::= ALIAS + ***** + | properties block_content? + ********** * + | block_content + * + flow_node ::= ALIAS + ***** + | properties flow_content? + ********** * + | flow_content + * + properties ::= TAG ANCHOR? | ANCHOR TAG? + ************************* + block_content ::= block_collection | flow_collection | SCALAR + ****** + flow_content ::= flow_collection | SCALAR + ****** + + + + + Parse the productions: + implicit_document ::= block_node DOCUMENT-END* + ************* + explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* + ************* + + + + + Parse the productions: + block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END + ******************** *********** * ********* + + + + + Parse the productions: + indentless_sequence ::= (BLOCK-ENTRY block_node?)+ + *********** * + + + + + Parse the productions: + block_mapping ::= BLOCK-MAPPING_START + ******************* + ((KEY block_node_or_indentless_sequence?)? + *** * + (VALUE block_node_or_indentless_sequence?)?)* + + BLOCK-END + ********* + + + + + Parse the productions: + block_mapping ::= BLOCK-MAPPING_START + + ((KEY block_node_or_indentless_sequence?)? + + (VALUE block_node_or_indentless_sequence?)?)* + ***** * + BLOCK-END + + + + + + Parse the productions: + flow_sequence ::= FLOW-SEQUENCE-START + ******************* + (flow_sequence_entry FLOW-ENTRY)* + * ********** + flow_sequence_entry? + * + FLOW-SEQUENCE-END + ***************** + flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + * + + + + + Parse the productions: + flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + *** * + + + + + Parse the productions: + flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + ***** * + + + + + Parse the productions: + flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + * + + + + + Parse the productions: + flow_mapping ::= FLOW-MAPPING-START + ****************** + (flow_mapping_entry FLOW-ENTRY)* + * ********** + flow_mapping_entry? + ****************** + FLOW-MAPPING-END + **************** + flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + * *** * + + + + + Parse the productions: + flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + * ***** * + + + + + Gets the current event. + + + + + Defines the YAML parser's state. + + + + + Expect STREAM-START. + + + + + Expect the beginning of an implicit document. + + + + + Expect DOCUMENT-START. + + + + + Expect the content of a document. + + + + + Expect DOCUMENT-END. + + + + + Expect a block node. + + + + + Expect a block node or indentless sequence. + + + + + Expect a flow node. + + + + + Expect the first entry of a block sequence. + + + + + Expect an entry of a block sequence. + + + + + Expect an entry of an indentless sequence. + + + + + Expect the first key of a block mapping. + + + + + Expect a block mapping key. + + + + + Expect a block mapping value. + + + + + Expect the first entry of a flow sequence. + + + + + Expect an entry of a flow sequence. + + + + + Expect a key of an ordered mapping. + + + + + Expect a value of an ordered mapping. + + + + + Expect the and of an ordered mapping entry. + + + + + Expect the first key of a flow mapping. + + + + + Expect a key of a flow mapping. + + + + + Expect a value of a flow mapping. + + + + + Expect an empty value of a flow mapping. + + + + + Expect nothing. + + + + + Converts a sequence of characters into a sequence of YAML tokens. + + + + + Initializes a new instance of the class. + + The input. + + + + Moves to the next token. + + + + + + Consumes the current token and increments the parsed token count + + + + + Check the list of potential simple keys and remove the positions that + cannot contain simple keys anymore. + + + + + Pop indentation levels from the indents stack until the current level + becomes less or equal to the column. For each intendation level, append + the BLOCK-END token. + + + + + Produce the STREAM-END token and shut down the scanner. + + + + + Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. + + Scope: + %YAML 1.1 # a comment \n + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + %TAG !yaml! tag:yaml.org,2002: \n + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + + + + Produce the DOCUMENT-START or DOCUMENT-END token. + + + + + Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token. + + + + + Increase the flow level and resize the simple key list if needed. + + + + + Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token. + + + + + Decrease the flow level. + + + + + Produce the FLOW-ENTRY token. + + + + + Produce the BLOCK-ENTRY token. + + + + + Produce the KEY token. + + + + + Produce the VALUE token. + + + + + Push the current indentation level to the stack and set the new level + the current column is greater than the indentation level. In this case, + append or insert the specified token into the token queue. + + + + + Produce the ALIAS or ANCHOR token. + + + + + Produce the TAG token. + + + + + Scan a TAG token. + + + + + Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens. + + + + + Scan a block scalar. + + + + + Scan intendation spaces and line breaks for a block scalar. Determine the + intendation level if needed. + + + + + Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. + + + + + Scan a quoted scalar. + + + + + Produce the SCALAR(...,plain) token. + + + + + Scan a plain scalar. + + + + + Remove a potential simple key at the current flow level. + + + + + Scan the directive name. + + Scope: + %YAML 1.1 # a comment \n + ^^^^ + %TAG !yaml! tag:yaml.org,2002: \n + ^^^ + + + + + Scan the value of VERSION-DIRECTIVE. + + Scope: + %YAML 1.1 # a comment \n + ^^^^^^ + + + + + Scan the value of a TAG-DIRECTIVE token. + + Scope: + %TAG !yaml! tag:yaml.org,2002: \n + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + + + + Scan a tag. + + + + + Decode an URI-escape sequence corresponding to a single UTF-8 character. + + + + + Scan a tag handle. + + + + + Scan the version number of VERSION-DIRECTIVE. + + Scope: + %YAML 1.1 # a comment \n + ^ + %YAML 1.1 # a comment \n + ^ + + + + + Check if a simple key may start at the current position and add it if + needed. + + + + + Gets the current position inside the input stream. + + The current position. + + + + Gets the current token. + + + + + Implements the Core schema. + + + The Core schema is an extension of the JSON schema, allowing for more human-readable presentation of the same types. + This is the recommended default schema that YAML processor should use unless instructed otherwise. + It is also strongly recommended that other schemas should be based on it. + + + + + Implements a JSON schema. + + + The JSON schema is the lowest common denominator of most modern computer languages, and allows parsing JSON files. + A YAML processor should therefore support this schema, at least as an option. It is also strongly recommended that other schemas should be based on it. . + > + + + + Implements the YAML failsafe schema. + + + The failsafe schema is guaranteed to work with any YAML document. + It is therefore the recommended schema for generic YAML tools. + A YAML processor should therefore support this schema, at least as an option. + + + + Base implementation for a based schema. + + + + + Provides schema information for tag resolution. + + + + + Expands the tag. Example, transforms a short tag '!!str' to its long version 'tag:yaml.org,2002:str' + + The tag. + Expanded version of the tag. + + + + Shortens the tag. Example, transforms a long tag 'tag:yaml.org,2002:str' to its short version '!!str' + + The tag. + Expanded version of the tag. + + + + Gets the default tag for the specified . The default tag can be different from a actual tag of this . + + The node event. + A short tag. + + + + Gets the default tag for the specified . This is only valid for scalar, return null if no default tag found. + + A short tag. + + + + Determines whether the short tag implicit (e.g. !!int). + + The tag. + true if [is tag implicit] [the specified tag]; otherwise, false. + + + + Gets the default tag and value for the specified . The default tag can be different from a actual tag of this . + + The scalar event. + if set to true [decode value]. + The default tag decoded from the scalar. + The value extracted from a scalar. + System.String. + + + + Gets the default tag and value for the specified . The default tag can be different from a actual tag of this . + + The scalar event. + The type. + The value extracted from a scalar. + System.String. + + + + Gets the type for a default tag. + + The tag in short form. + The type for a default tag or null if no default tag associated + + + + Registers a long/short tag association. + + The short tag. + The long tag. + + shortTag + or + shortTag + + + + + The string short tag: !!str + + + + + The string long tag: tag:yaml.org,2002:str + + + + + Registers a long/short tag association. + + The short tag. + The long tag. + + shortTag + or + shortTag + + + + + Gets the default tag for a event. + + The node event. + The default tag for a map. + + + + Gets the default tag for a event. + + The node event. + The default tag for a seq. + + + + Prepare scalar rules. In the implementation of this method, should call + + + + + Add a tag resolution rule that is invoked when matches + the Value of a node. + The tag is resolved to and is + invoked when actual value of type is extracted from + the node text. + + Type of the scalar + The tag. + The regex. + The decode function. + The encode function. + + + BeginUpdate(); // to avoid invoking slow internal calculation method many times. + Add( ... ); + Add( ... ); + Add( ... ); + Add( ... ); + EndUpdate(); // automaticall invoke internal calculation method + + + + + Allows to register tag mapping for all primitive types (e.g. int -> !!int) + + + + + The map short tag: !!map. + + + + + The map long tag: tag:yaml.org,2002:map + + + + + The seq short tag: !!seq + + + + + The seq long tag: tag:yaml.org,2002:seq + + + + + Initializes a new instance of the class. + + + + + Gets or sets a value indicating whether this schema should always fallback to a + failsafe string in case of not matching any scalar rules. Default is true for + + true if [allow failsafe string]; otherwise, false. + + + + The null short tag: !!null + + + + + The null long tag: tag:yaml.org,2002:null + + + + + The bool short tag: !!bool + + + + + The bool long tag: tag:yaml.org,2002:bool + + + + + The int short tag: !!int + + + + + The int long tag: tag:yaml.org,2002:int + + + + + The float short tag: !!float + + + + + The float long tag: tag:yaml.org,2002:float + + + + + Initializes a new instance of the class. + + + + + Extension to the core schema and accept different flavor of scalars +
    +
  • bool(true): y|Y|yes|Yes|YES|true|True|TRUE|on|On|ON
  • +
  • bool(false): n|N|no|No|NO|false|False|FALSE|off|Off|OFF
  • +
  • timestamp
  • +
+
+
+ + + The timestamp short tag: !!timestamp + + + + + The timestamp long tag: tag:yaml.org,2002:timestamp + + + + + The merge short tag: !!merge + + + + + The merge long tag: tag:yaml.org,2002:merge + + + + + Initializes a new instance of the class. + + + + + Exception that is thrown when a semantic error is detected on a YAML stream. + + + + + Base exception that is thrown when the a problem occurs in the SharpYaml library. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Gets the position in the input stream where the event that originated the exception starts. + + + + + Gets the position in the input stream where the event that originated the exception ends. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + The exception that is thrown when an alias references an anchor that does not exist. + + + + + Initializes a new instance of the class. + + The anchor alias. + + + + Initializes a new instance of the class. + + The anchor alias. + The message. + + + + Initializes a new instance of the class. + + The anchor alias. + The start. + The end. + The message. + + + + Gets or sets the anchor alias. + + The anchor alias. + + + + An that can be chained with another object factory; + + + + + Creates instances of types. + + + This interface allows to provide a custom logic for creating instances during deserialization. + + + + + Creates an instance of the specified type. Returns null if instance cannot be created. + + + + + Initializes a new instance of the class. + + The next factory. + + + + Creates objects using Activator.CreateInstance. + + + + + Gets the default implementation for a type. + + The type. + The type of the implem or the same type as input if there is no default implementation + + + + A descriptor for an array. + + + + + Default implementation of a . + + + + + Provides access members of a type. + + + + + Determines whether this instance contains a member with the specified member name. + + Name of the member. + true if this instance contains a member with the specified member name; otherwise, false. + + + + Gets the type described by this instance. + + The type. + + + + Gets the members of this type. + + The members. + + + + Gets the member count. + + The member count. + + + + Gets a value indicating whether this instance has members. + + true if this instance has members; otherwise, false. + + + + Gets the with the specified name. Return null if not found + + The name. + The member. + + + + Gets a value indicating whether this instance is a compiler generated type. + + true if this instance is a compiler generated type; otherwise, false. + + + + Gets the style. + + The style. + + + + Initializes a new instance of the class. + + The attribute registry. + The type. + + type + Failed to get ObjectDescriptor for type [{0}]. The member [{1}] cannot be registered as a member with the same name is already registered [{2}].DoFormat(type.FullName, member, existingMember) + + + + Sorts the members of this instance with the specified instance. + + The key comparer. + + + + Initializes a new instance of the class. + + The attribute registry. + The type. + Expecting arrat type;type + + + + Creates the equivalent of list type for this array. + + A list type with same element type than this array. + + + + Gets the type of the array element. + + The type of the element. + + + + Provides a descriptor for a . + + + + + Initializes a new instance of the class. + + The attribute registry. + The type. + if set to true [emit default values]. + Expecting a type inheriting from System.Collections.ICollection;type + + + + Add to the collections of the same type than this descriptor. + + The collection. + The value to add to this collection. + + + + Determines whether the specified collection is read only. + + The collection. + true if the specified collection is read only; otherwise, false. + + + + Determines the number of elements of a collection, -1 if it cannot determine the number of elements. + + The collection. + The number of elements of a collection, -1 if it cannot determine the number of elements. + + + + Determines whether the specified type is collection. + + The type. + true if the specified type is collection; otherwise, false. + + + + Gets or sets the type of the element. + + The type of the element. + + + + Gets a value indicating whether the collection has only the capacity as a property defined. + + true if the collection has only the capacity as a property defined; otherwise, false. + + + + Gets a value indicating whether this instance is a pure collection (no public property/field) + + true if this instance is pure collection; otherwise, false. + + + + Gets a value indicating whether this collection type has add method. + + true if this instance has add; otherwise, false. + + + + Provides a descriptor for a . + + + + + Initializes a new instance of the class. + + The attribute registry. + The type. + if set to true [emit default values]. + Expecting a type inheriting from System.Collections.IDictionary;type + + + + Determines whether the value passed is readonly. + + The this object. + true if [is read only] [the specified this object]; otherwise, false. + + + + Gets a generic enumerator for a dictionary. + + The dictionary. + A generic enumerator. + dictionary + Key value-pair [{0}] is not supported for IDictionary. Only DictionaryEntry.DoFormat(keyValueObject) + + + + Adds a a key-value to a dictionary. + + The dictionary. + The key. + The value. + No Add() method found on dictionary [{0}].DoFormat(Type) + + + + Determines whether the specified type is a .NET dictionary. + + The type. + true if the specified type is dictionary; otherwise, false. + + + + Gets a value indicating whether this instance is generic dictionary. + + true if this instance is generic dictionary; otherwise, false. + + + + Gets the type of the key. + + The type of the key. + + + + Gets the type of the value. + + The type of the value. + + + + Gets or sets a value indicating whether this instance is pure dictionary. + + true if this instance is pure dictionary; otherwise, false. + + + + A for a + + + + + Base class for for a + + + + + Describe a member of an object. + + + + + Gets the value of this memeber for the specified instance. + + The this object to get the value from. + Value of the member. + + + + Sets a value of this memeber for the specified instance. + + The this object. + The value. + + + + Gets the name. + + The name. + + + + Gets the type. + + The type. + + + + Gets the order of this member. + Default is -1, meaning that it is using the alphabetical order + based on the name of this property. + + The order. + + + + Gets the mode of serialization for this member. + + The mode. + + + + Gets a value indicating whether this instance has set method. + + true if this instance has set method; otherwise, false. + + + + Gets the default style attached to this member. + + The style. + + + + Gets a value indicating whether this member should be serialized. + + true if [should serialize]; otherwise, false. + + + + Gets the type of the declaring this member. + + The type of the declaring. + + + + Gets the member information. + + The member information. + + + + Initializes a new instance of the class. + + The property information. + + + + Returns a that represents this instance. + + A that represents this instance. + + + + Gets the property information attached to this instance. + + The property information. + + + + Describes a descriptor for a nullable type . + + + + + Initializes a new instance of the class. + + The attribute registry. + The type. + Type [{0}] is not a primitive + + + + Determines whether the specified type is nullable. + + The type. + true if the specified type is nullable; otherwise, false. + + + + Gets the type underlying type T of the nullable + + The type of the element. + + + + Describes a descriptor for a primitive (bool, char, sbyte, byte, int, uint, long, ulong, float, double, decimal, string, DateTime). + + + + + Initializes a new instance of the class. + + The attribute registry. + The type. + Type [{0}] is not a primitive + + + + Determines whether the specified type is a primitive. + + The type. + true if the specified type is primitive; otherwise, false. + + + + A for a + + + + + Initializes a new instance of the class. + + The property information. + + + + Returns a that represents this instance. + + A that represents this instance. + + + + Gets the property information attached to this instance. + + The property information. + + + + A default implementation for the . + + + + + A factory to create an instance of a + + + + + Tries to create an instance of a from the type. Return null if this factory is not handling this type. + + The type. + ITypeDescriptor. + + + + Initializes a new instance of the class. + + The attribute registry. + if set to true [emit default values]. + attributeRegistry + + + + Creates a type descriptor for the specified type. + + The type. + An instance of type descriptor. + + + + Gets the settings. + + The settings. + + + + Manages the state of a while it is loading. + + + + + Adds the specified node to the anchor list. + + The node. + + + + Gets the node with the specified anchor. + + The anchor. + if set to true, the method should throw an exception if there is no node with that anchor. + The start position. + The end position. + + + + + Adds the specified node to the collection of nodes with unresolved aliases. + + + The that has unresolved aliases. + + + + + Resolves the aliases that could not be resolved while loading the document. + + + + + The exception that is thrown when a duplicate anchor is detected. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Holds state that is used when emitting a stream. + + + + + Gets the already emitted anchors. + + The emitted anchors. + + + + A registry for all attributes. + + + + + Gets the attributes associated with the specified member. + + The reflection member. + if set to true includes inherited attributes. + An enumeration of . + + + + Registers an attribute for the specified member. Restriction: Attributes registered this way cannot be listed in inherited attributes. + + The member information. + The attribute. + + + + Extension methods for attribute registry. + + + + + Gets the attributes associated with the specified member. + + Type of the attribute + The member information. + if set to true [inherit]. + An enumeration of . + + + + Gets the first attribute of type T associated with the specified member. + + Type of the attribute + The member information. + if set to true [inherit]. + An attribute of type {T} if it was found; otherwise null + + + + Prodives tag discovery from a type and type discovery from a tag. + + + + + Finds a type from a tag, null if not found. + + Name of the tag. + A Type or null if not found + + + + Finds a tag from a type, null if not found. + + The type. + A tag or null if not found + + + + Resolves a type from the specified typeName. + + Name of the type. + Type found for this typeName + + + + Registers an assembly when trying to resolve types. All types + having will be registered + automatically. + + The assembly. + The attribute registry to use when quering for . + + + + Register a mapping between a tag and a type. + + The tag. + The type. + + + + Defines the method needed to be able to visit Yaml elements. + + + + + Visits a . + + + The that is being visited. + + + + + Visits a . + + + The that is being visited. + + + + + Visits a . + + + The that is being visited. + + + + + Visits a . + + + The that is being visited. + + + + + Visits a . + + + The that is being visited. + + + + + Creates objects using a Func{Type,object}"/>. + + + + + Initializes a new instance of the class. + + The factory. + + + + Initializes a new instance of the class. + + The factory. + The next factory. + factory + + + + Allows an object to customize how it is serialized and deserialized. + + + + + Reads this object's state from a YAML parser. + + + A instance of the object deserialized from Yaml. + + + + Writes the specified object context to a YAML emitter. + + The object context. + + + + A factory of + + + + + Try to create a or return null if not supported for a particular .NET typeDescriptor. + + + The typeDescriptor. + If supported, return an instance of else return null. + + + + Class for serializing a or + + + + + Base class for serializing an object that can be a Yaml !!map or !!seq. + + + + + Initializes a new instance of the class. + + + + + + + + Checks if a type is a sequence. + + + true if a type is a sequence, false otherwise. + + + + Gets the style that will be used to serialized the object. + + + The to use. Default is . + + + + Overrides this method when deserializing/serializing an object that needs a special instantiation or transformation. By default, this is calling + if the is null or returning . + + The object context. + A new instance of the object or if not null + + + + Transforms the object after it has been read. This method is called after an object has been read and before returning the object to + the deserialization process. See remarks for usage. + + + The actual object deserialized. By default same as . + + This method is usefull in conjunction with . + For example, in the case of deserializing to an immutable member, where we need to call the constructor of a type instead of setting each of + its member, we can instantiate a mutable object in , receive the mutable object filled in + and transform it back to an immutable object. + + + + + Reads the members from the current stream. + + The type of the t start. + The type of the t end. + + Return the object being read, by default thisObject passed by argument. + + + + Reads an item of the object from the YAML flow (either a sequence item or mapping key/value item). + + + Unable to deserialize property [{0}] not found in type [{1}].DoFormat(propertyName, typeDescriptor) + + + + + + + Writes the members of the object to serialize. By default this method is iterating on the and + calling on each member. + + + + + + Writes a member. + + + The member. + + + + Initializes a new instance of the class. + + + + + Reads the collection items. + + The object context. + Cannot deserialize list to type [{0}]. No Add method found.DoFormat(thisObject.GetType()) + or + Cannot deserialize list to readonly collection type [{0}]..DoFormat(thisObject.GetType()) + + + + Reads a collection item. + + The object context. + Type of the item. + The item to add to the current collection. + + + + Writes the collection items. + + The object context. + + + + Writes the collection item. + + The object context. + The item. + Type of the item. + + + + Class for serializing a or + + + + + Initializes a new instance of the class. + + + + + + + + Reads the dictionary items key-values. + + + + + + Reads a dictionary item key-value. + + The object context. + KeyValuePair{System.ObjectSystem.Object}. + + + + Writes the dictionary items keys-values. + + The object context. + + + + Writes the dictionary item key-value. + + The object context. + The key value. + + + + Writes the scalar to the . See remarks. + + The object context. + The scalar. + + This method can be overloaded to replace the converted scalar just before writing it. + + + + + This serializer is responsible to route to a specific serializer. + + + + + A context used while deserializing. + + + + + Initializes a new instance of the class. + + The serializer. + + + + The default function to read an object from the current Yaml stream. + + The value of the receiving object, may be null. + The expected type. + System.Object. + + + + The default function to write an object to Yaml + + + + + Finds the type descriptor for the specified type. + + The type. + An instance of . + + + + Resolves a type from the specified tag. + + Name of the tag. + Type. + + + + Resolves a tag from a type + + The type. + The associated tag + + + + Resolves a type from the specified typename using registered assemblies. + + Full name of the type. + The type of null if not found + + + + Gets the default tag and value for the specified . The default tag can be different from a actual tag of this . + + The scalar event. + The default tag decoded from the scalar. + The value extracted from a scalar. + System.String. + + + + Gets a value indicating whether we are in the context of serializing. + + true if we are in the context of serializing; otherwise, false. + + + + Gets the settings. + + The settings. + + + + Gets the schema. + + The schema. + + + + Gets the serializer. + + The serializer. + + + + Gets the reader used while deserializing. + + The reader. + + + + Gets the object serializer backend. + + The object serializer backend. + + + + Gets or sets the type of the create. + + The type of the create. + + + + Gets the writer used while deserializing. + + The writer. + + + + Gets the emitter. + + The emitter. + + + + A default implementation for . + This implementation allows to retrieve default attributes for a member or + to attach an attribute to a specific type/member. + + + + + Gets the attributes associated with the specified member. + + The reflection member. + if set to true includes inherited attributes. + An enumeration of . + + + + Registers an attribute for the specified member. Restriction: Attributes registered this way cannot be listed in inherited attributes. + + The member information. + The attribute. + + + + Default implementation of ITagTypeRegistry. + + + + + Initializes a new instance of the class. + + + + + Register a mapping between a tag and a type. + + The tag. + The type. + + + + Gets or sets a value indicating whether [use short type name]. + + true if [use short type name]; otherwise, false. + + + + Represents an alias node in the YAML document. + + + + + Represents a single node in the YAML document. + + + + + Loads the specified event. + + The event. + The state of the document. + + + + Parses the node represented by the next event in . + + The events. + The state. + Returns the node that has been parsed. + + + + Resolves the aliases that could not be resolved when the node was created. + + The state of the document. + + + + Saves the current node to the specified emitter. + + The emitter where the node is to be saved. + The state. + + + + Saves the current node to the specified emitter. + + The emitter where the node is to be saved. + The state. + + + + Accepts the specified visitor by calling the appropriate Visit method on it. + + + A . + + + + + Provides a basic implementation of Object.Equals + + + + + Gets a value indicating whether two objects are equal. + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Gets the hash code of the specified object, or zero if the object is null. + + + + + Combines two hash codes into one. + + + + + Gets or sets the anchor of the node. + + The anchor. + + + + Gets or sets the tag of the node. + + The tag. + + + + Gets the position in the input stream where the event that originated the node starts. + + + + + Gets the position in the input stream where the event that originated the node ends. + + + + + Gets all nodes from the document, starting on the current node. + + + + + Initializes a new instance of the class. + + The anchor. + + + + Resolves the aliases that could not be resolved when the node was created. + + The state of the document. + + + + Saves the current node to the specified emitter. + + The emitter where the node is to be saved. + The state. + + + + Accepts the specified visitor by calling the appropriate Visit method on it. + + + A . + + + + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets all nodes from the document, starting on the current node. + + + + + Represents an YAML document. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with a single scalar node. + + + + + Initializes a new instance of the class. + + The events. + + + + Accepts the specified visitor by calling the appropriate Visit method on it. + + + A . + + + + + Gets or sets the root node. + + The root node. + + + + Gets all nodes from the document. + + + + + Visitor that assigns anchors to nodes that are referenced more than once but have no anchor. + + + + + Abstract implementation of that knows how to walk a complete Yaml object model. + + + + + Called when this object is visiting a . + + + The that is being visited. + + + + + Called after this object finishes visiting a . + + + The that has been visited. + + + + + Called when this object is visiting a . + + + The that is being visited. + + + + + Called after this object finishes visiting a . + + + The that has been visited. + + + + + Called when this object is visiting a . + + + The that is being visited. + + + + + Called after this object finishes visiting a . + + + The that has been visited. + + + + + Called when this object is visiting a . + + + The that is being visited. + + + + + Called after this object finishes visiting a . + + + The that has been visited. + + + + + Called when this object is visiting a . + + + The that is being visited. + + + + + Called after this object finishes visiting a . + + + The that has been visited. + + + + + Visits every child of a . + + + The that is being visited. + + + + + Visits every child of a . + + + The that is being visited. + + + + + Visits every child of a . + + + The that is being visited. + + + + + Visits every child of a . + + + The that is being visited. + + + + + Instructs the YamlSerializer not to serialize the public field or public read/write property value. + + + + + Represents a mapping node in the YAML document. + + + + + Initializes a new instance of the class. + + The events. + The state. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + A sequence of where even elements are keys and odd elements are values. + + + + Initializes a new instance of the class. + + A sequence of where even elements are keys and odd elements are values. + + + + Adds the specified mapping to the collection. + + The key node. + The value node. + + + + Adds the specified mapping to the collection. + + The key node. + The value node. + + + + Adds the specified mapping to the collection. + + The key node. + The value node. + + + + Adds the specified mapping to the collection. + + The key node. + The value node. + + + + Resolves the aliases that could not be resolved when the node was created. + + The state of the document. + + + + Saves the current node to the specified emitter. + + The emitter where the node is to be saved. + The state. + + + + Accepts the specified visitor by calling the appropriate Visit method on it. + + + A . + + + + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + + + + Gets the children of the current node. + + The children. + + + + Gets or sets the style of the node. + + The style. + + + + Gets all nodes from the document, starting on the current node. + + + + + Specify the way to store a property or field of some class or structure. + + + + + Initializes a new instance of the class. + + The order. + + + + Initializes a new instance of the class. + + The name. + + + + Specify the way to store a property or field of some class or structure. + + The name. + The serialize method. + + + + Specify the way to store a property or field of some class or structure. + + The serialize method. + + + + Gets the name. + + The name. + + + + Gets the serialize method1. + + The serialize method1. + + + + Gets or sets the order. Default is -1 (default to alphabetical) + + The order. + + + + Comparer that is based on identity comparisons. + + + + + + + + + + + Represents a scalar node in the YAML document. + + + + + Initializes a new instance of the class. + + The events. + The state. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The value. + + + + Resolves the aliases that could not be resolved when the node was created. + + The state of the document. + + + + Saves the current node to the specified emitter. + + The emitter where the node is to be saved. + The state. + + + + Accepts the specified visitor by calling the appropriate Visit method on it. + + + A . + + + + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets or sets the value of the node. + + The value. + + + + Gets or sets the style of the node. + + The style. + + + + Gets all nodes from the document, starting on the current node. + + + + + Represents a sequence node in the YAML document. + + + + + Initializes a new instance of the class. + + The events. + The state. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Adds the specified child to the collection. + + The child. + + + + Adds a scalar node to the collection. + + The child. + + + + Resolves the aliases that could not be resolved when the node was created. + + The state of the document. + + + + Saves the current node to the specified emitter. + + The emitter where the node is to be saved. + The state. + + + + Accepts the specified visitor by calling the appropriate Visit method on it. + + + A . + + + + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + + + + Gets the collection of child nodes. + + The children. + + + + Gets or sets the style of the node. + + The style. + + + + Gets all nodes from the document, starting on the current node. + + + + + Specify the way to store a property or field of some class or structure. + See for detail. + + + + + Use the default mode depending on the type of the field/property. + + + + + When restored, new object is created by using the parameters in + the YAML data and assigned to the property / field. When the + property / filed is writeable, this is the default. + + + + + Only valid for a property / field that has a class or struct type. + When restored, instead of recreating the whole class or struct, + the members are independently restored. When the property / field + is not writeable this is the default. + + + + + Only valid for a property / field that has an array type of a + some value type. The content of the array is stored in a binary + format encoded in base64 style. + + + + + The property / field will not be stored. + + + + + Serializes and deserializes objects into and from YAML documents. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The settings. + + + + Serializes the specified object to a string. + + The graph. + A YAML string of the object. + + + + Serializes the specified object to a string. + + The graph. + The expected type. + A YAML string of the object. + + + + Serializes the specified object. + + The stream. + The object to serialize. + + + + Serializes the specified object. + + The stream. + The object to serialize. + + + + Serializes the specified object. + + The where to serialize the object. + The object to serialize. + + + + Serializes the specified object. + + The where to serialize the object. + The object to serialize. + The static type of the object to serialize. + + + + Serializes the specified object. + + The where to serialize the object. + The object to serialize. + + + + Serializes the specified object. + + The where to serialize the object. + The object to serialize. + The static type of the object to serialize. + + + + Deserializes an object from the specified . + + The stream. + A deserialized object. + + + + Deserializes an object from the specified . + + The reader. + A deserialized object. + + + + Deserializes an object from the specified with an expected specific type. + + The stream. + The expected type. + A deserialized object. + stream + + + + Deserializes an object from the specified with an expected specific type. + + The expected type + The stream. + A deserialized object. + stream + + + + Deserializes an object from the specified with an expected specific type. + + The reader. + The expected type. + A deserialized object. + reader + + + + Deserializes an object from the specified with an expected specific type. + + The expected type + The reader. + A deserialized object. + reader + + + + Deserializes an object from the specified string. + + The text. + A deserialized object. + + + + Deserializes an object from the specified string. with an expected specific type. + + From text. + The expected type. + A deserialized object. + stream + + + + Deserializes an object from the specified string. with an expected specific type. + + The expected type + From text. + A deserialized object. + stream + + + + Deserializes an object from the specified with an expected specific type. + + The expected type + The reader. + A deserialized object. + reader + + + + Deserializes an object from the specified with an expected specific type. + + The reader. + The expected type. + A deserialized object. + reader + + + + Gets the settings. + + The settings. + + + + Settings used to configure serialization and control how objects are encoded into YAML. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Register a mapping between a tag and a type. + + The assembly. + + + + Register a mapping between a tag and a type. + + Name of the tag. + Type of the tag. + + + + Adds a custom serializer for the specified type. + + The type. + The serializer. + + type + or + serializer + + + + + Adds a serializer factory. + + The factory. + factory + + + + Gets or sets the preferred indentation. Default is 2. + + The preferred indentation. + value;Expecting value > 0 + + + + Gets or sets a value indicating whether to emit anchor alias. Default is true. + + true to emit anchor alias; otherwise, false. + + + + Gets or sets a value indicating whether to emit tags when serializing. Default is true. + + true to emit tags when serializing; otherwise, false. + + + + Gets or sets a value indicating whether the identation is trying to less + indent when possible + (For example, sequence after a key are not indented). Default is false. + + true if [always indent]; otherwise, false. + + + + Gets or sets a value indicating whether to enable sorting keys from dictionary to YAML mapping. Default is true. See remarks. + + true to enable sorting keys from dictionary to YAML mapping; otherwise, false. + When storing a YAML document, It can be important to keep the same order for key mapping in order to keep + a YAML document versionable/diffable. + + + + Gets or sets a value indicating whether to emit JSON compatible YAML. + + true if to emit JSON compatible YAML; otherwise, false. + + + + Gets or sets a value indicating whether the property should be emitted. Default is false. + + true if the property should be emitted; otherwise, false. + + + + Gets or sets the maximum number of elements an array/list of primitive can be emitted as a + flow sequence (instead of a block sequence by default). Default is 0, meaning block style + for all sequuences. + + The emit compact array limit. + + + + Gets or sets a value indicating whether to emit default value. Default is false. + + true if to emit default value; otherwise, false. + + + + Gets or sets the default key comparer used to sort members () or + dictionary keys, when serializing objects as YAML mappings. Default is . + To disable the default comparer, this value can be set to null. + + The key comparer. + + + + Gets or sets a value indicating whether to emit short type name (type, assembly name) or full . Default is false. + + true to emit short type name; otherwise, false. + + + + Gets or sets the default . Default is . See to understand the resolution of styles. + + The default style. + + + + Gets or sets the prefix used to serialize items for a non pure or + + . Default to "~Items", see remarks. + + The prefix for items. + value + Expecting length >= 2 and at least a special character '.', '~', '-' (not starting on first char for '-') + A pure or is a class that inherits from these types but are not adding any + public properties or fields. When these types are pure, they are respectively serialized as a YAML mapping (for dictionary) or a YAML sequence (for collections). + If the collection type to serialize is not pure, the type is serialized as a YAML mapping sequence that contains the public properties/fields as well as a + special fielx (e.g. "~Items") that contains the actual items of the collection (either a mapping for dictionary or a sequence for collections). + The is this special key that is used when serializing items of a non-pure collection. + + + + Gets the attribute registry. + + The attribute registry. + + + + Gets or sets the ObjectSerializerBackend. Default implementation is + + The ObjectSerializerBackend. + + + + Gets or sets the default factory to instantiate a type. Default is . + + The default factory to instantiate a type. + value + + + + Gets or sets the schema. Default is . + method. + + The schema. + value + + + + Represents an YAML stream. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Adds the specified document to the collection. + + The document. + + + + Loads the stream from the specified input. + + The input. + + + + Saves the stream to the specified output. + + The output. + + + + Accepts the specified visitor by calling the appropriate Visit method on it. + + + A . + + + + + + + + Gets the documents inside the stream. + + The documents. + + + + An attribute to associate a tag with a particular type. + + + + + Initializes a new instance of the class. + + The tag. + + + + Gets the tag. + + The tag. + + + + Represents a simple key. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Gets or sets a value indicating whether this instance is possible. + + + true if this instance is possible; otherwise, false. + + + + + Gets or sets a value indicating whether this instance is required. + + + true if this instance is required; otherwise, false. + + + + + Gets or sets the token number. + + The token number. + + + + Gets or sets the mark that indicates the location of the simple key. + + The mark. + + + + Add extensions methods to . + + + + + Expression of string.Format(this, arg1, arg2, ...) + + The format string. + The arguments. + A formatted string. + + + + + Exception that is thrown when a syntax error is detected on a YAML stream. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Collection of . + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + Initial content of the collection. + + + + + + + Gets a value indicating whether the collection contains a directive with the same handle + + + + + Represents an alias token. + + + + + Base class for YAML tokens. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Gets the start of the token in the input stream. + + + + + Gets the end of the token in the input stream. + + + + + Initializes a new instance of the class. + + The value of the anchor. + + + + Initializes a new instance of the class. + + The value of the anchor. + The start position of the event. + The end position of the event. + + + + Gets the value of the alias. + + + + + Represents an anchor token. + + + + + Initializes a new instance of the class. + + The value. + + + + Initializes a new instance of the class. + + The value. + The start position of the token. + The end position of the token. + + + + Gets the value. + + The value. + + + + Represents a block end token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a block entry event. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a block mapping start token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a block sequence start token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a document end token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a document start token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a flow entry event. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a flow mapping end token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a flow mapping start token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a flow sequence end token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a flow sequence start token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a key token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a scalar token. + + + + + Initializes a new instance of the class. + + The value. + + + + Initializes a new instance of the class. + + The value. + The style. + + + + Initializes a new instance of the class. + + The value. + The style. + The start position of the token. + The end position of the token. + + + + Gets the value. + + The value. + + + + Gets the style. + + The style. + + + + Specifies the style of a YAML scalar. + + + + + Let the emitter choose the style. + + + + + The plain scalar style. + + + + + The single-quoted scalar style. + + + + + The double-quoted scalar style. + + + + + The literal scalar style. + + + + + The folded scalar style. + + + + + Represents a stream end event. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a stream start token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a tag token. + + + + + Initializes a new instance of the class. + + The handle. + The suffix. + + + + Initializes a new instance of the class. + + The handle. + The suffix. + The start position of the token. + The end position of the token. + + + + Gets the handle. + + The handle. + + + + Gets the suffix. + + The suffix. + + + + Represents a tag directive token. + + + + + Initializes a new instance of the class. + + The handle. + The prefix. + + + + Initializes a new instance of the class. + + The handle. + The prefix. + The start position of the token. + The end position of the token. + + + + Determines whether the specified System.Object is equal to the current System.Object. + + The System.Object to compare with the current System.Object. + + true if the specified System.Object is equal to the current System.Object; otherwise, false. + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + + + + Gets the handle. + + The handle. + + + + Gets the prefix. + + The prefix. + + + + Represents a value token. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The start position of the token. + The end position of the token. + + + + Represents a version directive token. + + + + + Initializes a new instance of the class. + + The version. + + + + Initializes a new instance of the class. + + The version. + The start position of the token. + The end position of the token. + + + + Determines whether the specified System.Object is equal to the current System.Object. + + The System.Object to compare with the current System.Object. + + true if the specified System.Object is equal to the current System.Object; otherwise, false. + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Gets the version. + + The version. + + + + Gets the assembly qualified name of the type, but without the assembly version or public token. + + The type. + The assembly qualified name of the type, but without the assembly version or public token. + Unable to get an assembly qualified name for type [{0}].DoFormat(type) + + + + Determines whether the specified type is an anonymous type. + + The type. + true if the specified type is anonymous; otherwise, false. + + + + Determines whether the specified type is nullable . + + The type. + true if the specified type is nullable; otherwise, false. + + + + Check if the type is a ValueType and does not contain any non ValueType members. + + + + + + + Returnes true if the specified is a struct type. + + to be analyzed. + true if the specified is a struct type; otehrwise false. + + + + Return if an object is a numeric value. + + The type. + True if object is a numeric value. + + + + Compare two objects to see if they are equal or not. Null is acceptable. + + + + + + + + Cast an object to a specified numeric type. + + Any object + Numric type + Numeric value or null if the object is not a numeric value. + + + + Cast boxed numeric value to double + + boxed numeric value + Numeric value in double. Double.Nan if obj is not a numeric value. + + + + Specifies the version of the YAML language. + + + + + Initializes a new instance of the class. + + The the major version number. + The the minor version number. + + + + Determines whether the specified System.Object is equal to the current System.Object. + + The System.Object to compare with the current System.Object. + + true if the specified System.Object is equal to the current System.Object; otherwise, false. + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Gets the major version number. + + + + + Gets the minor version number. + + + + + An attribute to modify the output style of a sequence or mapping. + This attribute can be apply directly on a type or on a property/field. + + + + + Initializes a new instance of the class. + + The style. + + + + Gets the style. + + The style. + + +