diff --git a/AMD64_ProjectFiles_VS2005/Backup/Game01.sln b/AMD64_ProjectFiles_VS2005/Backup/Game01.sln new file mode 100644 index 0000000..6d27b24 --- /dev/null +++ b/AMD64_ProjectFiles_VS2005/Backup/Game01.sln @@ -0,0 +1,543 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cry3DEngine", "Cry3DEngine\Cry3DEngine.vcproj", "{BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryAISystem", "CryAISystem\CryAISystem.vcproj", "{07D7D59A-D2A1-4B62-AE29-F818542D231C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryCommon", "CryCommon\CryCommon.vcproj", "{CC7E772A-D33D-4CDA-9F83-9281A7C48539}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryEntitySystem", "CryEntitySystem\CryEntitySystem.vcproj", "{ED25E8E5-3A18-4236-9FE2-06E706380C5C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryFont", "CryFont\CryFont.vcproj", "{0FE76AE2-9814-4738-90E7-D45950952A27}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryGame", "CryGame\CryGame.vcproj", "{75A0E1EE-267F-4D2A-A90D-AE3604E7C733}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryInput", "CryInput\CryInput.vcproj", "{6B81BC85-356D-4D09-9C01-BC44A9386259}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryMovie", "CryMovie\CryMovie.vcproj", "{119CC33C-E31E-4A39-A38E-4AE64B8A359F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryNetwork", "CryNetwork\CryNetwork.vcproj", "{4A4EE1C2-855E-48DB-815D-8AE882D3332F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryPhysics", "CryPhysics\CryPhysics.vcproj", "{9F51A48A-EE94-4A94-AABA-C0C18B7B8774}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryScriptSystem", "CryScriptSystem\CryScriptSystem.vcproj", "{A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CrySoundSystem", "CrySoundSystem\CrySoundSystem.vcproj", "{FD988D8E-914A-4463-A458-4568120E258C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XRenderOGL", "RenderDll\XRenderOGL\XRenderOGL.vcproj", "{41DE4587-989B-4341-9F67-2AE5EA201E5B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Editor", "Editor\Editor.vcproj", "{8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryAnimation", "CryAnimation\CryAnimation.vcproj", "{7BB11400-AFC9-4439-89B3-A00122B44850}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FarCry", "FarCry\FarCry.vcproj", "{371D7BDF-BD06-4CF1-A697-CE7CC57C107D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CrySystem", "CrySystem\CrySystem.vcproj", "{9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XRenderD3D9", "RenderDll\xrenderd3d9\XRenderD3D9.vcproj", "{6711B2B2-6829-4314-A491-D01A29365658}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XRenderNULL", "RenderDll\xrenderNULL\XRenderNULL.vcproj", "{1EE58697-2D3E-454A-BA80-2455F7EA14A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResourceCompiler", "ResourceCompiler\ResourceCompiler.vcproj", "{2F21D2A8-925B-4A73-A32B-D111580614C3}" + ProjectSection(ProjectDependencies) = postProject + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0} = {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResourceCompilerPC", "ResourceCompilerPC\ResourceCompilerPC.vcproj", "{43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FarCry_WinSV", "FarCry_WinSV\FarCry_WinSV.vcproj", "{8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}" +EndProject +Global + GlobalSection(SourceCodeControl) = preSolution + SccNumberOfProjects = 23 + SccProviderRegKey = SOFTWARE\Perforce\p4 + SccProjectName0 = Perforce\u0020Project + SccLocalPath0 = . + SccProvider0 = MSSCCI:Perforce\u0020SCM + CanCheckoutShared = true + SolutionUniqueID = {A06ECB99-3504-4046-98DD-CF1A6931A3BF} + SccProjectUniqueName1 = RenderDll\\xrenderd3d9\\XRenderD3D9.vcproj + SccLocalPath1 = RenderDll + CanCheckoutShared = true + SccProjectFilePathRelativizedFromConnection1 = xrenderd3d9\\ + SccProjectUniqueName2 = ResourceCompiler\\ResourceCompiler.vcproj + SccLocalPath2 = . + CanCheckoutShared = true + SccProjectFilePathRelativizedFromConnection2 = ResourceCompiler\\ + SccProjectUniqueName3 = ResourceCompilerPC\\ResourceCompilerPC.vcproj + SccLocalPath3 = ResourceCompilerPC + CanCheckoutShared = true + SccProjectUniqueName4 = CryAISystem\\CryAISystem.vcproj + SccLocalPath4 = CryAISystem + CanCheckoutShared = true + SccProjectUniqueName5 = CryCommon\\CryCommon.vcproj + SccLocalPath5 = CryCommon + CanCheckoutShared = true + SccProjectUniqueName6 = CryEntitySystem\\CryEntitySystem.vcproj + SccLocalPath6 = CryEntitySystem + CanCheckoutShared = true + SccProjectUniqueName7 = CryFont\\CryFont.vcproj + SccLocalPath7 = CryFont + CanCheckoutShared = true + SccProjectUniqueName8 = CryGame\\CryGame.vcproj + SccLocalPath8 = CryGame + CanCheckoutShared = true + SccProjectUniqueName9 = CryInput\\CryInput.vcproj + SccLocalPath9 = CryInput + CanCheckoutShared = true + SccProjectUniqueName10 = CryMovie\\CryMovie.vcproj + SccLocalPath10 = CryMovie + CanCheckoutShared = true + SccProjectUniqueName11 = CryNetwork\\CryNetwork.vcproj + SccLocalPath11 = CryNetwork + CanCheckoutShared = true + SccProjectUniqueName12 = CryPhysics\\CryPhysics.vcproj + SccLocalPath12 = CryPhysics + CanCheckoutShared = true + SccProjectUniqueName13 = CryScriptSystem\\CryScriptSystem.vcproj + SccLocalPath13 = CryScriptSystem + CanCheckoutShared = true + SccProjectUniqueName14 = CrySoundSystem\\CrySoundSystem.vcproj + SccLocalPath14 = CrySoundSystem + CanCheckoutShared = true + SccProjectUniqueName15 = RenderDll\\XRenderOGL\\XRenderOGL.vcproj + SccLocalPath15 = RenderDll + CanCheckoutShared = true + SccProjectFilePathRelativizedFromConnection15 = XRenderOGL\\ + SccProjectUniqueName16 = Editor\\Editor.vcproj + SccLocalPath16 = Editor + CanCheckoutShared = true + SccProjectUniqueName17 = CryAnimation\\CryAnimation.vcproj + SccLocalPath17 = CryAnimation + CanCheckoutShared = true + SccProjectUniqueName18 = FarCry\\FarCry.vcproj + SccLocalPath18 = FarCry + CanCheckoutShared = true + SccProjectUniqueName19 = CrySystem\\CrySystem.vcproj + SccLocalPath19 = CrySystem + CanCheckoutShared = true + SccProjectUniqueName20 = RenderDll\\xrenderNULL\\XRenderNULL.vcproj + SccLocalPath20 = RenderDll + CanCheckoutShared = true + SccProjectFilePathRelativizedFromConnection20 = xrenderNULL\\ + SccProjectUniqueName21 = FarCry_WinSV\\FarCry_WinSV.vcproj + SccLocalPath21 = FarCry_WinSV + CanCheckoutShared = true + SccProjectUniqueName22 = Cry3DEngine\\Cry3DEngine.vcproj + SccLocalPath22 = Cry3DEngine + CanCheckoutShared = true + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug64|Win32 = Debug64|Win32 + Hybrid Debug|Win32 = Hybrid Debug|Win32 + Hybrid NDebug|Win32 = Hybrid NDebug|Win32 + Hybrid|Win32 = Hybrid|Win32 + Hybrid64|Win32 = Hybrid64|Win32 + Profile|Win32 = Profile|Win32 + Release|Win32 = Release|Win32 + Release64|Win32 = Release64|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Debug|Win32.ActiveCfg = Debug|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Debug|Win32.Build.0 = Debug|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Debug64|Win32.Build.0 = Debug64|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid64|Win32.ActiveCfg = Debug64|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid64|Win32.Build.0 = Debug64|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid64|Win32.Deploy.0 = Debug64|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Profile|Win32.ActiveCfg = Profile|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Profile|Win32.Build.0 = Profile|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Release|Win32.ActiveCfg = Release|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Release|Win32.Build.0 = Release|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Release64|Win32.ActiveCfg = Release64|Win32 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Release64|Win32.Build.0 = Release64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug|Win32.ActiveCfg = Debug|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug|Win32.Build.0 = Debug|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug64|Win32.Build.0 = Debug64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid64|Win32.Build.0 = Release64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Profile|Win32.ActiveCfg = Profile|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Profile|Win32.Build.0 = Profile|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release|Win32.ActiveCfg = Release|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release|Win32.Build.0 = Release|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release64|Win32.ActiveCfg = Release64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release64|Win32.Build.0 = Release64|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug|Win32.ActiveCfg = Debug|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug|Win32.Build.0 = Debug|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug64|Win32.ActiveCfg = Debug|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid64|Win32.ActiveCfg = Profile|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid64|Win32.Build.0 = Profile|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Profile|Win32.ActiveCfg = Profile|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Profile|Win32.Build.0 = Profile|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release|Win32.ActiveCfg = Release|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release|Win32.Build.0 = Release|Win32 + {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release64|Win32.ActiveCfg = Release|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug|Win32.ActiveCfg = Debug|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug|Win32.Build.0 = Debug|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug64|Win32.Build.0 = Debug64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid64|Win32.Build.0 = Release64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Profile|Win32.ActiveCfg = Profile|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Profile|Win32.Build.0 = Profile|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release|Win32.ActiveCfg = Release|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release|Win32.Build.0 = Release|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release64|Win32.ActiveCfg = Release64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release64|Win32.Build.0 = Release64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug|Win32.ActiveCfg = Debug|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug|Win32.Build.0 = Debug|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug64|Win32.Build.0 = Debug64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid64|Win32.Build.0 = Release64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Profile|Win32.ActiveCfg = Profile|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Profile|Win32.Build.0 = Profile|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Release|Win32.ActiveCfg = Release|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Release|Win32.Build.0 = Release|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Release64|Win32.ActiveCfg = Release64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Release64|Win32.Build.0 = Release64|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Debug|Win32.ActiveCfg = Debug|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Debug|Win32.Build.0 = Debug|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Debug64|Win32.Build.0 = Debug64|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Hybrid64|Win32.Build.0 = Release64|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Profile|Win32.ActiveCfg = Profile|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Profile|Win32.Build.0 = Profile|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Release|Win32.ActiveCfg = Release|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Release|Win32.Build.0 = Release|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Release64|Win32.ActiveCfg = Release64|Win32 + {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Release64|Win32.Build.0 = Release64|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Debug|Win32.ActiveCfg = Debug|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Debug|Win32.Build.0 = Debug|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Debug64|Win32.Build.0 = Debug64|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid64|Win32.Build.0 = Release64|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Profile|Win32.ActiveCfg = Profile|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Profile|Win32.Build.0 = Profile|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Release|Win32.ActiveCfg = Release|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Release|Win32.Build.0 = Release|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Release64|Win32.ActiveCfg = Release64|Win32 + {6B81BC85-356D-4D09-9C01-BC44A9386259}.Release64|Win32.Build.0 = Release64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug|Win32.ActiveCfg = Debug|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug|Win32.Build.0 = Debug|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug64|Win32.Build.0 = Debug64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid64|Win32.Build.0 = Release64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Profile|Win32.ActiveCfg = Profile|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Profile|Win32.Build.0 = Profile|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release|Win32.ActiveCfg = Release|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release|Win32.Build.0 = Release|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release64|Win32.ActiveCfg = Release64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release64|Win32.Build.0 = Release64|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Debug|Win32.ActiveCfg = Debug|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Debug|Win32.Build.0 = Debug|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Debug64|Win32.Build.0 = Debug64|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid64|Win32.Build.0 = Release64|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Profile|Win32.ActiveCfg = Profile|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Profile|Win32.Build.0 = Profile|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Release|Win32.ActiveCfg = Release|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Release|Win32.Build.0 = Release|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Release64|Win32.ActiveCfg = Release64|Win32 + {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Release64|Win32.Build.0 = Release64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug|Win32.ActiveCfg = Debug|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug|Win32.Build.0 = Debug|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug64|Win32.Build.0 = Debug64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid64|Win32.Build.0 = Release64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Profile|Win32.ActiveCfg = Profile|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Profile|Win32.Build.0 = Profile|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release|Win32.ActiveCfg = Release|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release|Win32.Build.0 = Release|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release64|Win32.ActiveCfg = Release64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release64|Win32.Build.0 = Release64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug|Win32.ActiveCfg = Debug|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug|Win32.Build.0 = Debug|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug64|Win32.Build.0 = Debug64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid64|Win32.Build.0 = Release64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Profile|Win32.ActiveCfg = Profile|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Profile|Win32.Build.0 = Profile|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release|Win32.ActiveCfg = Release|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release|Win32.Build.0 = Release|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release64|Win32.ActiveCfg = Release64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release64|Win32.Build.0 = Release64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Debug|Win32.ActiveCfg = Debug|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Debug|Win32.Build.0 = Debug|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Debug64|Win32.Build.0 = Debug64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid64|Win32.Build.0 = Release64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Profile|Win32.ActiveCfg = Profile|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Profile|Win32.Build.0 = Profile|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Release|Win32.ActiveCfg = Release|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Release|Win32.Build.0 = Release|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Release64|Win32.ActiveCfg = Release64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Release64|Win32.Build.0 = Release64|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Debug|Win32.ActiveCfg = Debug|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Debug|Win32.Build.0 = Debug|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Debug64|Win32.Build.0 = Debug64|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid64|Win32.Build.0 = Release64|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Profile|Win32.ActiveCfg = Profile|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Profile|Win32.Build.0 = Profile|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Release|Win32.ActiveCfg = Release|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Release64|Win32.ActiveCfg = Release64|Win32 + {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Release64|Win32.Build.0 = Release64|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Debug|Win32.ActiveCfg = Debug|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Debug|Win32.Build.0 = Debug|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid|Win32.ActiveCfg = Release|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid64|Win32.ActiveCfg = Debug64|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid64|Win32.Build.0 = Debug64|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Profile|Win32.ActiveCfg = Profile|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Profile|Win32.Build.0 = Profile|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release|Win32.ActiveCfg = Release|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release|Win32.Build.0 = Release|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release64|Win32.ActiveCfg = Release64|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release64|Win32.Build.0 = Release64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug|Win32.ActiveCfg = Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug|Win32.Build.0 = Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug64|Win32.Build.0 = Debug64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid Debug|Win32.Build.0 = Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid Debug|Win32.Deploy.0 = Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid NDebug|Win32.Build.0 = Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid NDebug|Win32.Deploy.0 = Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid64|Win32.Build.0 = Release64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile|Win32.ActiveCfg = Profile|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile|Win32.Build.0 = Profile|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Release|Win32.ActiveCfg = Release|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Release|Win32.Build.0 = Release|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Release64|Win32.ActiveCfg = Release64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Release64|Win32.Build.0 = Release64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug|Win32.ActiveCfg = Debug|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug|Win32.Build.0 = Debug|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug64|Win32.Build.0 = Debug64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid|Win32.ActiveCfg = Release|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid64|Win32.Build.0 = Release64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile|Win32.ActiveCfg = Profile|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile|Win32.Build.0 = Profile|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release|Win32.ActiveCfg = Release|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release|Win32.Build.0 = Release|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release64|Win32.ActiveCfg = Release64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release64|Win32.Build.0 = Release64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug|Win32.ActiveCfg = Debug|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug|Win32.Build.0 = Debug|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug64|Win32.Build.0 = Debug64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid|Win32.ActiveCfg = Profile|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid64|Win32.Build.0 = Release64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile|Win32.ActiveCfg = Profile|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile|Win32.Build.0 = Profile|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release|Win32.ActiveCfg = Release|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release|Win32.Build.0 = Release|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release64|Win32.ActiveCfg = Release64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release64|Win32.Build.0 = Release64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Debug|Win32.ActiveCfg = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Debug|Win32.Build.0 = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid|Win32.ActiveCfg = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid|Win32.Build.0 = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid64|Win32.Build.0 = Release64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Profile|Win32.ActiveCfg = Profile|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Profile|Win32.Build.0 = Profile|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Release|Win32.ActiveCfg = Release|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Release|Win32.Build.0 = Release|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Release64|Win32.ActiveCfg = Release64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Release64|Win32.Build.0 = Release64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Debug|Win32.Build.0 = Debug|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid|Win32.ActiveCfg = Release|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid|Win32.Build.0 = Release|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid64|Win32.Build.0 = Release64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Profile|Win32.ActiveCfg = Profile|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Profile|Win32.Build.0 = Profile|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release|Win32.ActiveCfg = Release|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release|Win32.Build.0 = Release|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release64|Win32.ActiveCfg = Release64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release64|Win32.Build.0 = Release64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug|Win32.ActiveCfg = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug|Win32.Build.0 = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug64|Win32.Build.0 = Debug64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid Debug|Win32.Build.0 = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid NDebug|Win32.Build.0 = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid|Win32.ActiveCfg = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid|Win32.Build.0 = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid64|Win32.Build.0 = Release64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Profile|Win32.ActiveCfg = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Profile|Win32.Build.0 = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release|Win32.ActiveCfg = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release|Win32.Build.0 = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release64|Win32.ActiveCfg = Release64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release64|Win32.Build.0 = Release64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug|Win32.ActiveCfg = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug|Win32.Build.0 = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug64|Win32.Build.0 = Debug64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid Debug|Win32.Build.0 = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid NDebug|Win32.Build.0 = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid|Win32.ActiveCfg = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid|Win32.Build.0 = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid64|Win32.Build.0 = Release64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Profile|Win32.ActiveCfg = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Profile|Win32.Build.0 = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release|Win32.ActiveCfg = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release|Win32.Build.0 = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release64|Win32.ActiveCfg = Release64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release64|Win32.Build.0 = Release64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug|Win32.ActiveCfg = Debug|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug|Win32.Build.0 = Debug|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug64|Win32.ActiveCfg = Debug64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug64|Win32.Build.0 = Debug64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid Debug|Win32.ActiveCfg = Debug|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid Debug|Win32.Build.0 = Debug|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid Debug|Win32.Deploy.0 = Debug|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid NDebug|Win32.ActiveCfg = Debug|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid NDebug|Win32.Build.0 = Debug|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid NDebug|Win32.Deploy.0 = Debug|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid|Win32.ActiveCfg = Release64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid|Win32.Build.0 = Release64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid|Win32.Deploy.0 = Release64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid64|Win32.ActiveCfg = Release64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid64|Win32.Build.0 = Release64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid64|Win32.Deploy.0 = Release64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Profile|Win32.ActiveCfg = Profile|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Profile|Win32.Build.0 = Profile|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release|Win32.ActiveCfg = Release|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release|Win32.Build.0 = Release|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release64|Win32.ActiveCfg = Release64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release64|Win32.Build.0 = Release64|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + DPBuild = 5 + EndGlobalSection + GlobalSection(DevPartner Solution Properties) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection + GlobalSection(DevPartner) = postSolution + EndGlobalSection +EndGlobal diff --git a/AMD64_ProjectFiles_VS2005/Cry3DEngine/Cry3DEngine.vcxproj b/AMD64_ProjectFiles_VS2005/Cry3DEngine/Cry3DEngine.vcxproj new file mode 100644 index 0000000..ca06d4f --- /dev/null +++ b/AMD64_ProjectFiles_VS2005/Cry3DEngine/Cry3DEngine.vcxproj @@ -0,0 +1,367 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE} + Perforce Project + . + MSSCCI:Perforce SCM + Win32Proj + + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + true + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + C:\MasterCD\Bin32\ + Debug\ + PreBuildEvent + true + + + C:\MasterCD\Bin32\ + Release\ + PreBuildEvent + false + + + C:\MasterCD\Bin32\ + Profile\ + PreBuildEvent + false + + + C:\MasterCD\Bin64\ + $(Configuration)\ + PreBuildEvent + false + false + + + C:\MasterCD\Bin64\ + $(Configuration)\ + PreBuildEvent + true + false + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CRY3DENGINE_EXPORTS;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + true + true + Level3 + EditAndContinue + + + true + true + NotSet + $(IntDir)$(TargetName).lib + MachineX86 + + + + + Full + AnySuitable + true + Speed + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRY3DENGINE_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Level3 + ProgramDatabase + + + $(OutDir)Cry3DEngine.dll + true + NotSet + true + true + 0x20000000 + MachineX86 + + + + + Full + AnySuitable + true + Speed + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRY3DENGINE_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Level3 + ProgramDatabase + + + /OPT:ref,icf %(AdditionalOptions) + true + NotSet + true + true + 0x30000000 + MachineX86 + + + + + /GS- %(AdditionalOptions) + MaxSpeed + AnySuitable + true + Speed + true + false + true + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRY3DENGINE_EXPORTS;WIN64;_AMD64_;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Fast + Level3 + ProgramDatabase + + + /OPT:ref,icf +/xxLTCG:PGO /xxPGD:C:\MasterCD\Bin64\Cry3DEngine.pgd %(AdditionalOptions) + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + true + NotSet + true + true + 0x20000000 + MachineX64 + + + + + /GS- %(AdditionalOptions) + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CRY3DENGINE_EXPORTS;WIN64;_AMD64_;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + true + Level3 + EditAndContinue + + + /MACHINE:AMD64 %(AdditionalOptions) + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + true + true + NotSet + $(IntDir)$(TargetName).lib + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AMD64_ProjectFiles_VS2005/Cry3DEngine/Cry3DEngine.vcxproj.filters b/AMD64_ProjectFiles_VS2005/Cry3DEngine/Cry3DEngine.vcxproj.filters new file mode 100644 index 0000000..5409299 --- /dev/null +++ b/AMD64_ProjectFiles_VS2005/Cry3DEngine/Cry3DEngine.vcxproj.filters @@ -0,0 +1,383 @@ + + + + + {4b50e197-b58e-4b17-9175-def17e362a03} + + + {544d2e9a-2e8c-4fc3-8887-bb23e38946f5} + + + {e274d560-cad6-4f32-8b1a-03517d3f7996} + + + {6cea3ec1-0dce-4bfe-b9de-f9e17d868824} + + + {ec3c59a7-ac52-481e-a929-da0848b924c0} + + + {a897be17-d468-44dc-8714-5ac9c165ef25} + + + {d32afbdb-f868-4806-9c93-d147300857ef} + + + {80e81610-c132-4024-9811-941f7fb239fa} + + + {716b48d9-24f7-4636-8ef8-fab59f195c23} + + + {7df62131-7210-4a7d-bd8d-c4a7a1b1e348} + + + {93683466-a2c3-41d4-855b-0ebd805a1a9f} + + + {bfcba5a5-14c3-41d5-b431-f5fbe2688f0a} + + + {71e18edc-43e7-4ff4-8b16-04dd43e42767} + + + {293a087c-4259-4190-a899-294076706d6b} + + + {bd2ee2ae-7190-4700-806b-6f70de5df030} + + + {af17a3fb-9a9d-4eb4-9311-abcce87d60c9} + + + {aa0baafc-6b32-4a66-85da-4994d003dbbb} + + + {50c92a42-07c0-4705-a9ce-6191a9bb69dd} + + + {099bfb0c-7b19-43a0-a867-89cf40c4a9ba} + + + {277ff4da-f9da-4246-a8f2-26dd66167bdd} + + + {1a37d58b-ca24-4f4f-bf70-4c21799d2e8b} + + + {2d7db40c-bb13-4e5f-97fd-ebd2dc9ffc99} + + + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + StatObj + + + Effects\Decals + + + Effects\Particles + + + Effects\Particles + + + Effects\Particles + + + Effects\Rain + + + Effects\Detail Objects + + + Terrain + + + Terrain\Sector + + + Water + + + Water + + + Vegetation + + + Brush + + + LightMaps + + + LightMaps + + + ObjManager + + + StencilShadows + + + StencilShadows + + + StencilShadows + + + StencilShadows + + + StencilShadows + + + StencilShadows + + + 3DEngine + + + VisAreas + + + VisAreas + + + CVars + + + CBuffer + + + Containers + + + + + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + Effects\Decals + + + Effects\Decals + + + Effects\Particles + + + Effects\Particles + + + Effects\Particles + + + Effects\Particles + + + Effects\Particles + + + Effects\Particles + + + Effects\Rain + + + Effects\Detail Objects + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain\Sector + + + Terrain\Sector + + + Terrain\Sector + + + Terrain\Sector + + + Water + + + Water + + + Vegetation + + + Brush + + + Brush + + + LightMaps + + + ObjManager + + + ObjManager + + + ObjManager + + + ObjManager + + + ObjManager + + + ObjManager + + + StencilShadows + + + StencilShadows + + + 3DEngine + + + 3DEngine + + + 3DEngine + + + 3DEngine + + + 3DEngine + + + 3DEngine + + + VisAreas + + + VisAreas + + + VisAreas + + + CVars + + + CBuffer + + + + + + \ No newline at end of file diff --git a/AMD64_ProjectFiles_VS2005/CryAISystem/CryAISystem.vcxproj b/AMD64_ProjectFiles_VS2005/CryAISystem/CryAISystem.vcxproj new file mode 100644 index 0000000..e693cb9 --- /dev/null +++ b/AMD64_ProjectFiles_VS2005/CryAISystem/CryAISystem.vcxproj @@ -0,0 +1,41 @@ + + + + + + Template + Win32 + + + + + 17.0 + + + + + + Application + v143 + + + + + + + + + + + + + + + + + + + + + + diff --git a/Cry3DEngine/Cry3DEngine.vcproj.vspscc b/Cry3DEngine/Cry3DEngine.vcproj.vspscc index 6b7a651..c4eb70c 100644 --- a/Cry3DEngine/Cry3DEngine.vcproj.vspscc +++ b/Cry3DEngine/Cry3DEngine.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/Cry3DEngine/Cry3DEngine.vcxproj b/Cry3DEngine/Cry3DEngine.vcxproj new file mode 100644 index 0000000..dc52bc0 --- /dev/null +++ b/Cry3DEngine/Cry3DEngine.vcxproj @@ -0,0 +1,362 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F} + Perforce Project + + . + MSSCCI:Perforce SCM + Win32Proj + + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + true + + + DynamicLibrary + v143 + MultiByte + true + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + $(Configuration)\ + false + + + D:\Games\FC\Bin32\ + $(Configuration)\ + true + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CRY3DENGINE_EXPORTS;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + true + true + Use + Level3 + EditAndContinue + + + true + true + NotSet + $(IntDir)$(TargetName).lib + MachineX86 + + + + + Full + AnySuitable + true + Speed + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRY3DENGINE_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + Level3 + ProgramDatabase + + + $(OutDir)$(TargetName)$(TargetExt) + true + NotSet + true + true + 0x20000000 + MachineX86 + + + + + Full + AnySuitable + true + Speed + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRY3DENGINE_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + Level3 + ProgramDatabase + + + true + NotSet + true + true + 0x30000000 + MachineX86 + + + + + /fp:fast + %(AdditionalOptions) + MaxSpeed + AnySuitable + true + Speed + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRY3DENGINE_EXPORTS;WIN64;_AMD64_;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + Level3 + ProgramDatabase + + + /xxLTCG:PGI /xxxPGD:C:\MasterCD\Bin64\Cry3DEngine.pgd %(AdditionalOptions) + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + true + NotSet + true + true + 0x20000000 + + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CRY3DENGINE_EXPORTS;WIN64;_AMD64_;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + true + Use + Level3 + EditAndContinue + + + /MACHINE:AMD64 %(AdditionalOptions) + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + true + true + NotSet + $(IntDir)$(TargetName).lib + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Cry3DEngine/Cry3DEngine.vcxproj.filters b/Cry3DEngine/Cry3DEngine.vcxproj.filters new file mode 100644 index 0000000..334444e --- /dev/null +++ b/Cry3DEngine/Cry3DEngine.vcxproj.filters @@ -0,0 +1,383 @@ + + + + + {e27572a9-c37f-425c-a7e6-a9161e9fab24} + + + {5a7308d7-1e76-41f2-ab29-3797592c1cd7} + + + {63b406e8-1a09-4772-a9a4-ae5a52420d7f} + + + {1707a6c8-2ab7-40d1-bb3b-87932f78999f} + + + {fdb67d59-00b6-4f39-9899-c057d6bc3adf} + + + {23e7e1e8-a087-4e12-b3a0-aaa5e01140c4} + + + {269b9f7e-4ee8-4296-bb4e-e826f5271e6d} + + + {98ba4e80-0a71-4483-8955-bb6373de8b19} + + + {5747409d-bd2b-4a4f-872a-7d69c70c723f} + + + {6cbbbf87-30d6-4c7e-ac57-c0777b31ce82} + + + {69fd847d-5e92-4261-a448-6a7dbc11c047} + + + {f1f15ea6-e37b-44aa-922e-059157d41492} + + + {7c89317f-6152-4981-a3ef-b8e649c5f325} + + + {3a03b00d-f64c-4d9c-9033-69355e007e25} + + + {235d742a-a2f6-4620-af97-bf1bf0f7bb46} + + + {c44ce170-f9b6-4829-8d85-12d711fc3a2d} + + + {de83f784-5782-459a-bbc1-19f17640e619} + + + {dad9a7de-fdcd-4725-8452-afa564643060} + + + {a109dd49-b318-4b51-8e5d-6b42ff7bbef6} + + + {24788dc8-43f5-4ec2-b3f0-3af8f1972c08} + + + {28948a33-a53d-41e7-9a58-b09b2cb6571c} + + + {9876eb14-3744-4bd8-bf98-8a0d908d4279} + + + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + StatObj + + + Effects\Decals + + + Effects\Particles + + + Effects\Particles + + + Effects\Particles + + + Effects\Rain + + + Effects\Detail Objects + + + Terrain + + + Terrain\Sector + + + Water + + + Water + + + Vegetation + + + Brush + + + LightMaps + + + LightMaps + + + ObjManager + + + StencilShadows + + + StencilShadows + + + StencilShadows + + + StencilShadows + + + StencilShadows + + + StencilShadows + + + 3DEngine + + + VisAreas + + + VisAreas + + + CVars + + + CBuffer + + + Containers + + + + + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + CFGLoader + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + StatObj + + + Effects\Decals + + + Effects\Decals + + + Effects\Particles + + + Effects\Particles + + + Effects\Particles + + + Effects\Particles + + + Effects\Particles + + + Effects\Particles + + + Effects\Rain + + + Effects\Detail Objects + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain\Sector + + + Terrain\Sector + + + Terrain\Sector + + + Terrain\Sector + + + Water + + + Water + + + Vegetation + + + Brush + + + Brush + + + LightMaps + + + ObjManager + + + ObjManager + + + ObjManager + + + ObjManager + + + ObjManager + + + ObjManager + + + StencilShadows + + + StencilShadows + + + 3DEngine + + + 3DEngine + + + 3DEngine + + + 3DEngine + + + 3DEngine + + + 3DEngine + + + VisAreas + + + VisAreas + + + VisAreas + + + CVars + + + CBuffer + + + + + + \ No newline at end of file diff --git a/Cry3DEngine/Cry3DEngine.vcxproj.user b/Cry3DEngine/Cry3DEngine.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/Cry3DEngine/Cry3DEngine.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Cry3DEngine/Cry3DEngine_XBox.vcproj.vspscc b/Cry3DEngine/Cry3DEngine_XBox.vcproj.vspscc index c432b54..80f9f6e 100644 --- a/Cry3DEngine/Cry3DEngine_XBox.vcproj.vspscc +++ b/Cry3DEngine/Cry3DEngine_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/Cry3DEngine/Release/Cry3DEngine.Build.CppClean.log b/Cry3DEngine/Release/Cry3DEngine.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/Cry3DEngine/Release/Cry3DEngine.dll.recipe b/Cry3DEngine/Release/Cry3DEngine.dll.recipe new file mode 100644 index 0000000..5bd7a46 --- /dev/null +++ b/Cry3DEngine/Release/Cry3DEngine.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\Cry3DEngine.dll + + + + + + \ No newline at end of file diff --git a/Cry3DEngine/Release/Cry3DEngine.log b/Cry3DEngine/Release/Cry3DEngine.log new file mode 100644 index 0000000..e69de29 diff --git a/Cry3DEngine/Release/Cry3DEngine.vcxproj.FileListAbsolute.txt b/Cry3DEngine/Release/Cry3DEngine.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/Cry3DEngine/StdAfx.h b/Cry3DEngine/StdAfx.h index 7004050..86813ab 100644 --- a/Cry3DEngine/StdAfx.h +++ b/Cry3DEngine/StdAfx.h @@ -26,6 +26,7 @@ ////////////////////////////////////////////////////////////////////////// #define _NOTHREADS #define _STLP_NO_THREADS +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ////////////////////////////////////////////////////////////////////////// #include @@ -151,7 +152,9 @@ inline int __cdecl strnicmp (const char * first, const char * last, size_t count class IPhysicalWorld; struct IEntityRender; -#if defined(WIN32) && defined(_DEBUG) +//#define DEBUG_MEMORY + +#if defined(WIN32) && defined(DEBUG_MEMORY) #include #define DEBUG_NEW_NORMAL_CLIENTBLOCK(file, line) new(_NORMAL_BLOCK, file, line) diff --git a/CryAISystem/CryAISystem.vcproj.vspscc b/CryAISystem/CryAISystem.vcproj.vspscc index 4a30d69..fcf7aeb 100644 --- a/CryAISystem/CryAISystem.vcproj.vspscc +++ b/CryAISystem/CryAISystem.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryAISystem/CryAISystem.vcxproj b/CryAISystem/CryAISystem.vcxproj new file mode 100644 index 0000000..a79ce5f --- /dev/null +++ b/CryAISystem/CryAISystem.vcxproj @@ -0,0 +1,383 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {07D7D59A-D2A1-4B62-AE29-F818542D231C} + Perforce Project + + . + MSSCCI:Perforce SCM + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYAISYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Release/CryAISystem.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + .\Release/CryAISystem.pdb + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryAISystem.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYAISYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Profile/CryAISystem.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + true + true + 0x31000000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/CryAISystem.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CRYAISYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + Use + stdafx.h + .\Debug/CryAISystem.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + true + true + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryAISystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;WIN64;_AMD64_;_DEBUG;_WINDOWS;_USRDLL;CRYAISYSTEM_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + Use + stdafx.h + $(IntDir)CryAISystem.pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryAISystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + /fp:fast + %(AdditionalOptions) + MaxSpeed + AnySuitable + true + Speed + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;_USRDLL;CRYAISYSTEM_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + Use + stdafx.h + $(IntDir)CryAISystem.pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryAISystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CryAISystem/CryAISystem.vcxproj.filters b/CryAISystem/CryAISystem.vcxproj.filters new file mode 100644 index 0000000..bc362d9 --- /dev/null +++ b/CryAISystem/CryAISystem.vcxproj.filters @@ -0,0 +1,147 @@ + + + + + {896f5b03-a119-4a94-a4bf-991ef3edfc6d} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {d8698457-8e76-44f3-b601-2e0ea0be20b7} + h;hpp;hxx;hm;inl + + + {285dbe3b-dc58-4b0b-b0e7-d065498c4ef8} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/CryAISystem/CryAISystem.vcxproj.user b/CryAISystem/CryAISystem.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryAISystem/CryAISystem.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryAISystem/CryAISystem_XBox.vcproj.vspscc b/CryAISystem/CryAISystem_XBox.vcproj.vspscc index bb945f3..5d6d39a 100644 --- a/CryAISystem/CryAISystem_XBox.vcproj.vspscc +++ b/CryAISystem/CryAISystem_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryAISystem/Release/CryAISystem.Build.CppClean.log b/CryAISystem/Release/CryAISystem.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryAISystem/Release/CryAISystem.dll.recipe b/CryAISystem/Release/CryAISystem.dll.recipe new file mode 100644 index 0000000..914d46a --- /dev/null +++ b/CryAISystem/Release/CryAISystem.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryAISystem.dll + + + + + + \ No newline at end of file diff --git a/CryAISystem/Release/CryAISystem.log b/CryAISystem/Release/CryAISystem.log new file mode 100644 index 0000000..e69de29 diff --git a/CryAISystem/Release/CryAISystem.vcxproj.FileListAbsolute.txt b/CryAISystem/Release/CryAISystem.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryAISystem/StdAfx.h b/CryAISystem/StdAfx.h index 698e443..826c86c 100644 --- a/CryAISystem/StdAfx.h +++ b/CryAISystem/StdAfx.h @@ -16,6 +16,7 @@ ////////////////////////////////////////////////////////////////////////// #define _NOTHREADS #define _STLP_NO_THREADS +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ////////////////////////////////////////////////////////////////////////// #include diff --git a/CryAnimation/CryAnimation.vcproj.vspscc b/CryAnimation/CryAnimation.vcproj.vspscc index a009931..d960121 100644 --- a/CryAnimation/CryAnimation.vcproj.vspscc +++ b/CryAnimation/CryAnimation.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryAnimation/CryAnimation.vcxproj b/CryAnimation/CryAnimation.vcxproj new file mode 100644 index 0000000..341c93f --- /dev/null +++ b/CryAnimation/CryAnimation.vcxproj @@ -0,0 +1,512 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {7BB11400-AFC9-4439-89B3-A00122B44850} + Perforce Project + + . + MSSCCI:Perforce SCM + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + true + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Debug64\ + + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_RELEASE;COMP_VC;DO_ASM;OS_WIN32;PROC_INTEL;WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYANIMATION_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Release/CryAnimation.pch + .\Release/ + .\Release/ + .\Release/ + + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + Glu32.lib;Winmm.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + .\Release/CryAnimation.pdb + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryAnimation.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;COMP_VC;DO_ASM;OS_WIN32;PROC_INTEL;WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYANIMATION_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + glu32.lib;Winmm.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + true + 0x31500000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/CryAnimation.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;COMP_VC;DO_ASM;OS_WIN32;PROC_INTEL;WIN32;_DEBUG;_WINDOWS;_USRDLL;CRYANIMATION_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + Use + stdafx.h + .\Debug/CryAnimation.pch + .\Debug/ + .\Debug/ + .\Debug/ + true + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + glu32.lib;Winmm.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + true + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryAnimation.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN64;COMP_VC;OS_WIN64;PROC_AMD64;_AMD64_;_DEBUG;_WINDOWS;_USRDLL;CRYANIMATION_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + Use + stdafx.h + $(IntDir)CryAnimation.pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + LinkVerbose + false + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryAnimation.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + /fp:fast /GL %(AdditionalOptions) + MaxSpeed + AnySuitable + true + Speed + true + ..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;COMP_VC;OS_WIN64;PROC_AMD64;NDEBUG;_WINDOWS;_USRDLL;CRYANIMATION_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + Use + stdafx.h + $(IntDir)CryAnimation.pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + + Level3 + true + ProgramDatabase + Default + + + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + NotSet + false + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryAnimation.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compiling %(Filename) + ml64 /nologo /c /Fl"$(OutDir)%(Filename).cod" /Fo"$(OutDir)%(Filename).obj" /Zi %(FullPath) + + $(OutDir)%(Filename).obj;%(Outputs) + true + true + Compiling %(Filename) + ml64 /nologo /c /Fl"$(OutDir)%(Filename).cod" /Fo"$(OutDir)%(Filename).obj" /Zi %(FullPath) + + $(OutDir)%(Filename).obj;%(Outputs) + true + + + + + + + + + + \ No newline at end of file diff --git a/CryAnimation/CryAnimation.vcxproj.filters b/CryAnimation/CryAnimation.vcxproj.filters new file mode 100644 index 0000000..69ddd7e --- /dev/null +++ b/CryAnimation/CryAnimation.vcxproj.filters @@ -0,0 +1,517 @@ + + + + + {9bdfc399-fe5b-4395-9a61-1975aaba0d65} + + + {9f35825a-1ca5-446f-ac95-fbeb7cd261a8} + + + {faf4546c-ce44-4ed9-a9a6-e034fb11e368} + + + {0a5bb251-62ae-469b-b2bf-ddd60d8cb9b7} + + + {42374831-ac7d-4983-9898-431001f8d2f6} + + + {ed2166b0-9f81-4327-8466-3b65bd2f2e8b} + + + {ca7b4253-bc07-41a6-8efa-50bc84ed5180} + + + {e350c7e1-a458-4c6a-b317-c5bae8cc46e7} + + + {e4fb8aa6-4930-41c3-a0fe-13bb7013f394} + + + {91daac69-a3ee-4459-b747-6572070dc86a} + + + {4ac7e6ca-306d-4c80-8280-7acb24976129} + + + {061d6af7-e3a3-4ee9-a9e3-a451d9462126} + + + {1887795d-1885-42b8-be39-adf4d9dd211c} + + + {93da3c3a-b95b-4272-a799-79b7e0b4773e} + + + {ba3646f8-e1ad-46d6-afe2-4aed145804ce} + + + {c843116c-cf9a-415f-9d8a-1a533611d830} + + + {3da86fd5-76f6-4357-9b92-ba2f2a6e9163} + + + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Shadow Volume + + + Model\Shadow Volume + + + Bones + + + Bones + + + Bones + + + Bones + + + Bones + + + Bones + + + Front-End + + + Front-End + + + Front-End + + + Front-End + + + Front-End + + + TCB-Spline + + + B-Splines + + + B-Splines + + + B-Splines + + + CVars + + + Decals + + + Decals + + + Decals + + + Chunk Files + + + Chunk Files + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Controllers + + + Controllers + + + Controllers + + + Controllers + + + Animation + + + Animation + + + Animation + + + Animation + + + AnimObject + + + AnimObject + + + AnimObject + + + Other + + + Particles + + + fx + + + fx + + + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Skin + + + Model\Shadow Volume + + + Model\Shadow Volume + + + Bones + + + Bones + + + Bones + + + Bones + + + Bones + + + Bones + + + Front-End + + + Front-End + + + Front-End + + + Front-End + + + Front-End + + + TCB-Spline + + + TCB-Spline + + + B-Splines + + + B-Splines + + + B-Splines + + + CVars + + + CVars + + + Decals + + + Decals + + + Decals + + + Decals + + + Chunk Files + + + Chunk Files + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Controllers + + + Controllers + + + Controllers + + + Controllers + + + Animation + + + Animation + + + Animation + + + Animation + + + Animation + + + Animation + + + Animation + + + AnimObject + + + AnimObject + + + AnimObject + + + Particles + + + fx + + + fx + + + + + Other + + + Other + + + + + Model\Skin + + + \ No newline at end of file diff --git a/CryAnimation/CryAnimation.vcxproj.user b/CryAnimation/CryAnimation.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryAnimation/CryAnimation.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryAnimation/CryAnimation_XBox.vcproj.vspscc b/CryAnimation/CryAnimation_XBox.vcproj.vspscc index 743e533..0f6795f 100644 --- a/CryAnimation/CryAnimation_XBox.vcproj.vspscc +++ b/CryAnimation/CryAnimation_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryAnimation/CryModel.cpp b/CryAnimation/CryModel.cpp index 2af4fdf..1162cd4 100644 --- a/CryAnimation/CryModel.cpp +++ b/CryAnimation/CryModel.cpp @@ -76,7 +76,7 @@ CryModel::~CryModel() #ifndef UNIQUE_VERT_BUFF_PER_INSTANCE // the default model state is the only one where the leaf buffers must be deleted. // if the vertex buffers are unique per modelstate, then they're deleted by the modelstate destructor - m_pDefaultModelState->DeleteLeafBuffers(); + //m_pDefaultModelState->DeleteLeafBuffers(); #endif delete m_pDefaultModelState; m_pDefaultModelState=0; diff --git a/CryAnimation/Release/CryAnimation.Build.CppClean.log b/CryAnimation/Release/CryAnimation.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryAnimation/Release/CryAnimation.dll.recipe b/CryAnimation/Release/CryAnimation.dll.recipe new file mode 100644 index 0000000..a150428 --- /dev/null +++ b/CryAnimation/Release/CryAnimation.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryAnimation.dll + + + + + + \ No newline at end of file diff --git a/CryAnimation/Release/CryAnimation.log b/CryAnimation/Release/CryAnimation.log new file mode 100644 index 0000000..e69de29 diff --git a/CryAnimation/Release/CryAnimation.vcxproj.FileListAbsolute.txt b/CryAnimation/Release/CryAnimation.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryAnimation/stdafx.h b/CryAnimation/stdafx.h index fc8ab1c..e9f66b6 100644 --- a/CryAnimation/stdafx.h +++ b/CryAnimation/stdafx.h @@ -10,6 +10,7 @@ ////////////////////////////////////////////////////////////////////////// #define _NOTHREADS #define _STLP_NO_THREADS +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ////////////////////////////////////////////////////////////////////////// // if UNIQUE_VERT_BUFF_PER_INSTANCE defined - every instance will have unique vertex buffer (default state for now) @@ -22,7 +23,7 @@ // if UNIQUE_VERT_BUFF_PER_INSTANCE not defined - only every model will use unique vertex buffer // works much slower now, especially with reflections. shadow maps not supported now. // buffer waiting can be optimized: cycle thru 4-8 vertex buffers (for all models) -#define UNIQUE_VERT_BUFF_PER_INSTANCE +//#define UNIQUE_VERT_BUFF_PER_INSTANCE #ifdef _XBOX diff --git a/CryCommon/CryCommon.vcproj.vspscc b/CryCommon/CryCommon.vcproj.vspscc index f9b2c93..94f3d33 100644 --- a/CryCommon/CryCommon.vcproj.vspscc +++ b/CryCommon/CryCommon.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryCommon/CryCommon.vcxproj b/CryCommon/CryCommon.vcxproj new file mode 100644 index 0000000..cb7bc92 --- /dev/null +++ b/CryCommon/CryCommon.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + Win32 + + + Profile + Win32 + + + Release + Win32 + + + + 17.0 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B} + Perforce Project + + . + MSSCCI:Perforce SCM + MakeFileProj + + + + Utility + v143 + false + + + Utility + v143 + false + + + Utility + v143 + false + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + .\Release\ + + + D:\Games\FC\Bin32\ + .\Debug_XBox\ + + + D:\Games\FC\Bin32\ + .\Profile\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CryCommon/CryCommon.vcxproj.filters b/CryCommon/CryCommon.vcxproj.filters new file mode 100644 index 0000000..b96123e --- /dev/null +++ b/CryCommon/CryCommon.vcxproj.filters @@ -0,0 +1,379 @@ + + + + + {3874509f-8eb6-440a-b932-f139c4a4471b} + + + {e05c8fe8-fe7a-40db-9aa1-1c5180072445} + + + {d0ad715c-d9c5-4922-82aa-fc2cf967e80c} + + + {60700a69-85cc-4c7c-ac2a-e17f442568ce} + + + {a982f3f0-5bf2-495e-9a5a-7a0b40f1649e} + + + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Interfaces_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h + + + Common_h\RenderElements + + + Common_h\RenderElements + + + Common_h\RenderElements + + + Common_h\RenderElements + + + Common_h\RenderElements + + + Common_h\RenderElements + + + Common_h\RenderElements + + + Common_h\RenderElements + + + Common_h\RenderElements + + + Common_h\RenderElements + + + Common_h\RenderElements + + + Common_h\RenderElements + + + MatLib + + + MatLib + + + MatLib + + + MatLib + + + MatLib + + + MatLib + + + MatLib + + + MatLib + + + MatLib + + + MatLib + + + MatLib + + + MatLib + + + MatLib + + + Platform_h + + + Platform_h + + + Platform_h + + + Platform_h + + + Platform_h + + + \ No newline at end of file diff --git a/CryCommon/CryCommon.vcxproj.user b/CryCommon/CryCommon.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryCommon/CryCommon.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryCommon/Debug_XBox/CryCommon.Build.CppClean.log b/CryCommon/Debug_XBox/CryCommon.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryCommon/Debug_XBox/CryCommon.log b/CryCommon/Debug_XBox/CryCommon.log new file mode 100644 index 0000000..e69de29 diff --git a/CryCommon/Debug_XBox/CryCommon.recipe b/CryCommon/Debug_XBox/CryCommon.recipe new file mode 100644 index 0000000..470ae00 --- /dev/null +++ b/CryCommon/Debug_XBox/CryCommon.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryCommon + + + + + + \ No newline at end of file diff --git a/CryCommon/Debug_XBox/CryCommon.vcxproj.FileListAbsolute.txt b/CryCommon/Debug_XBox/CryCommon.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryCommon/ICryPak.h b/CryCommon/ICryPak.h index fe3f3c1..1d96873 100644 --- a/CryCommon/ICryPak.h +++ b/CryCommon/ICryPak.h @@ -4,6 +4,9 @@ #define _ICRY_PAK_HDR_ #include + +#include + #ifdef LINUX #include #include diff --git a/CryCommon/IScriptSystem.h b/CryCommon/IScriptSystem.h index a134b4c..e6343f4 100644 --- a/CryCommon/IScriptSystem.h +++ b/CryCommon/IScriptSystem.h @@ -200,6 +200,10 @@ struct IScriptSystem virtual void EndCall(int &nRet)=0; virtual void EndCall(float &fRet)=0; virtual void EndCall(const char *&sRet)=0; + + // #TODO: !!! + inline void EndCall(char*& sRet) { EndCall((const char*&)sRet); } + #if defined(WIN64) || defined(LINUX) inline void EndCall(char *&sRet) {EndCall ((const char*&)sRet);} #endif @@ -507,6 +511,15 @@ struct IScriptObject virtual bool GetCurrentFuncData(unsigned int * &pCode, int &iSize) = 0; virtual bool GetCurrentKey(const char* &sVal) = 0; + // #TODO: !!! + inline bool GetCurrentKey(char*& sVal) { return GetCurrentKey((const char*&)sVal); } + + // #TODO: !!! + inline bool GetAt(int nIdx, char*& sVal) { return GetAt(nIdx, (const char*&)sVal); } + + // #TODO: !!! + inline bool GetCurrent(char*& sVal) { return GetCurrent((const char*&)sVal); } + #if defined(WIN64) || defined(LINUX) inline bool GetCurrentKey(char* &sVal) {return GetCurrentKey((const char*&)sVal);} inline bool GetCurrent(char* &sVal) {return GetCurrent ((const char*&)sVal);} @@ -598,6 +611,10 @@ struct IFunctionHandler virtual bool GetParam(int nIdx, int &n) = 0; virtual bool GetParam(int nIdx, float &f) = 0; virtual bool GetParam(int nIdx, const char * &s) = 0; + + // #TODO: !!! + inline bool GetParam(int nIdx, char*& s) { return GetParam(nIdx, (const char*&)s); } + #if defined(WIN64) || defined(LINUX) inline bool GetParam(int nIdx, char * &s) {return GetParam(nIdx, (const char*&)s);} #endif diff --git a/CryCommon/Release/CryCommon.Build.CppClean.log b/CryCommon/Release/CryCommon.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryCommon/Release/CryCommon.log b/CryCommon/Release/CryCommon.log new file mode 100644 index 0000000..e69de29 diff --git a/CryCommon/Release/CryCommon.recipe b/CryCommon/Release/CryCommon.recipe new file mode 100644 index 0000000..470ae00 --- /dev/null +++ b/CryCommon/Release/CryCommon.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryCommon + + + + + + \ No newline at end of file diff --git a/CryCommon/Release/CryCommon.vcxproj.FileListAbsolute.txt b/CryCommon/Release/CryCommon.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryCommon/platform.h b/CryCommon/platform.h index a1b673d..d3e32a5 100644 --- a/CryCommon/platform.h +++ b/CryCommon/platform.h @@ -62,6 +62,8 @@ typedef void *EVENT_HANDLE; #include #define RC_EXECUTABLE "rc.exe" + +#pragma warning(disable:4996) #endif #if defined(WIN64) diff --git a/CryEntitySystem/CryEntitySystem.vcproj.vspscc b/CryEntitySystem/CryEntitySystem.vcproj.vspscc index 8f11f2e..e9967ea 100644 --- a/CryEntitySystem/CryEntitySystem.vcproj.vspscc +++ b/CryEntitySystem/CryEntitySystem.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryEntitySystem/CryEntitySystem.vcxproj b/CryEntitySystem/CryEntitySystem.vcxproj new file mode 100644 index 0000000..710cd37 --- /dev/null +++ b/CryEntitySystem/CryEntitySystem.vcxproj @@ -0,0 +1,357 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C} + Perforce Project + + . + MSSCCI:Perforce SCM + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Disabled + .\;..\XIsle;..\CryCommon;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;_USRDLL;CRYENTITYDLL_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + Use + stdafx.h + .\Debug/CryEntitySystem.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + true + true + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryEntitySystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + .\;..\;..\CryCommon;..\XIsle;..\Cry3DEngine;..\CryPhysics;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN32;_WINDOWS;_USRDLL;CRYENTITYDLL_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + .\Release/CryEntitySystem.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + .\Release/CryEntitySystem.pdb + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryEntitySystem.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + .\;..\;..\CryCommon;..\XIsle;..\Cry3DEngine;..\CryPhysics;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;_USRDLL;CRYENTITYDLL_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + .\Profile/CryEntitySystem.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + true + true + 0x32000000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/CryEntitySystem.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + .\;..\XIsle;..\CryCommon;%(AdditionalIncludeDirectories) + _DEBUG;WIN64;_WINDOWS;_USRDLL;CRYENTITYDLL_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + false + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryEntitySystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + /fp:fast +/GL %(AdditionalOptions) + MaxSpeed + AnySuitable + true + .\;..\XIsle;..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;_USRDLL;CRYENTITYDLL_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + false + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryEntitySystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CryEntitySystem/CryEntitySystem.vcxproj.filters b/CryEntitySystem/CryEntitySystem.vcxproj.filters new file mode 100644 index 0000000..2c90de4 --- /dev/null +++ b/CryEntitySystem/CryEntitySystem.vcxproj.filters @@ -0,0 +1,84 @@ + + + + + {9a1a7990-2bb7-406b-9131-192294bdf158} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {fe79c19d-c9aa-4b67-b58a-7fe5d4202b3b} + + + {d14e3d34-6303-430e-91d9-1107126e6671} + h;hpp;hxx;hm;inl + + + {2af8ee3a-09a1-4d69-90f5-45ac3817559b} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\Lip Sync + + + Source Files\Lip Sync + + + + + Source Files\Lip Sync + + + Source Files\Lip Sync + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/CryEntitySystem/CryEntitySystem.vcxproj.user b/CryEntitySystem/CryEntitySystem.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryEntitySystem/CryEntitySystem.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryEntitySystem/CryEntitySystem_XBox.vcproj.vspscc b/CryEntitySystem/CryEntitySystem_XBox.vcproj.vspscc index 3a663cc..96a8917 100644 --- a/CryEntitySystem/CryEntitySystem_XBox.vcproj.vspscc +++ b/CryEntitySystem/CryEntitySystem_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryEntitySystem/Release/CryEntitySystem.Build.CppClean.log b/CryEntitySystem/Release/CryEntitySystem.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryEntitySystem/Release/CryEntitySystem.dll.recipe b/CryEntitySystem/Release/CryEntitySystem.dll.recipe new file mode 100644 index 0000000..622bc93 --- /dev/null +++ b/CryEntitySystem/Release/CryEntitySystem.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryEntitySystem.dll + + + + + + \ No newline at end of file diff --git a/CryEntitySystem/Release/CryEntitySystem.log b/CryEntitySystem/Release/CryEntitySystem.log new file mode 100644 index 0000000..e69de29 diff --git a/CryEntitySystem/Release/CryEntitySystem.vcxproj.FileListAbsolute.txt b/CryEntitySystem/Release/CryEntitySystem.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryEntitySystem/stdafx.h b/CryEntitySystem/stdafx.h index 5b72e02..49b7b07 100644 --- a/CryEntitySystem/stdafx.h +++ b/CryEntitySystem/stdafx.h @@ -16,6 +16,7 @@ ////////////////////////////////////////////////////////////////////////// #define _NOTHREADS #define _STLP_NO_THREADS +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ////////////////////////////////////////////////////////////////////////// #include "Cry_Math.h" diff --git a/CryFont/CryFont.vcproj.vspscc b/CryFont/CryFont.vcproj.vspscc index 5bd3ee4..b3738c9 100644 --- a/CryFont/CryFont.vcproj.vspscc +++ b/CryFont/CryFont.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryFont/CryFont.vcxproj b/CryFont/CryFont.vcxproj new file mode 100644 index 0000000..bb1e0a7 --- /dev/null +++ b/CryFont/CryFont.vcxproj @@ -0,0 +1,371 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {0FE76AE2-9814-4738-90E7-D45950952A27} + Perforce Project + + . + MSSCCI:Perforce SCM + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Full + AnySuitable + true + Size + true + false + ../CrytekDLL;../CryCommon;FreeType2/include;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYFONT_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + + stdafx.h + .\Release/CryFont.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + $(OutDir)$(TargetName)$(TargetExt) + true + .\Release/CryFont.pdb + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryFont.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + ../CrytekDLL;../CryCommon;FreeType2/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYFONT_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + + stdafx.h + .\Profile/CryFont.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + true + true + 0x32500000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/CryFont.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ../CrytekDLL;../CryCommon;FreeType2/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CRYFONT_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + + stdafx.h + .\Debug/CryFont.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + ProgramDatabase + Default + + + true + true + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryFont.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ../CrytekDLL;../CryCommon;FreeType2/include;%(AdditionalIncludeDirectories) + WIN64;_DEBUG;_WINDOWS;_USRDLL;CRYFONT_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + false + + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryFont.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + ../CrytekDLL;../CryCommon;FreeType2/include;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;_USRDLL;CRYFONT_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + false + + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryFont.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CryFont/CryFont.vcxproj.filters b/CryFont/CryFont.vcxproj.filters new file mode 100644 index 0000000..6ce4235 --- /dev/null +++ b/CryFont/CryFont.vcxproj.filters @@ -0,0 +1,134 @@ + + + + + {e4140c61-1744-45ab-8f63-3edd911d09b5} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {1b7d8b19-82da-43a5-b993-f04aa46c2618} + h;hpp;hxx;hm;inl + + + {af34042f-5155-40ee-b23c-376e8256767c} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + FreeType 2 + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/CryFont/CryFont.vcxproj.user b/CryFont/CryFont.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryFont/CryFont.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryFont/CryFont_XBox.vcproj.vspscc b/CryFont/CryFont_XBox.vcproj.vspscc index 91a6064..eef255f 100644 --- a/CryFont/CryFont_XBox.vcproj.vspscc +++ b/CryFont/CryFont_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryFont/Release/CryFont.Build.CppClean.log b/CryFont/Release/CryFont.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryFont/Release/CryFont.dll.recipe b/CryFont/Release/CryFont.dll.recipe new file mode 100644 index 0000000..c67b148 --- /dev/null +++ b/CryFont/Release/CryFont.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryFont.dll + + + + + + \ No newline at end of file diff --git a/CryFont/Release/CryFont.log b/CryFont/Release/CryFont.log new file mode 100644 index 0000000..e69de29 diff --git a/CryFont/Release/CryFont.vcxproj.FileListAbsolute.txt b/CryFont/Release/CryFont.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryFont/StdAfx.h b/CryFont/StdAfx.h index 5f101a3..97e2372 100644 --- a/CryFont/StdAfx.h +++ b/CryFont/StdAfx.h @@ -16,6 +16,7 @@ ////////////////////////////////////////////////////////////////////////// #define _NOTHREADS #define _STLP_NO_THREADS +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ////////////////////////////////////////////////////////////////////////// #pragma warning(disable:4786) // identifier was truncated to '255' characters in the debug information diff --git a/CryGame/CryGame.vcproj.vspscc b/CryGame/CryGame.vcproj.vspscc index d28fb6b..6b12bd3 100644 --- a/CryGame/CryGame.vcproj.vspscc +++ b/CryGame/CryGame.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryGame/CryGame.vcxproj b/CryGame/CryGame.vcxproj new file mode 100644 index 0000000..7632bcc --- /dev/null +++ b/CryGame/CryGame.vcxproj @@ -0,0 +1,531 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {A7EC04A5-D65C-4C45-969C-D842823446ED} + Perforce Project + + . + MSSCCI:Perforce SCM + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Disabled + ..\BinkSDK;..\CryCommon;..\ubisoft.com\ConsoleImplementation\src;..\ubisoft.com\GSServices\sdks\gs-sdk-common\include;..\ubisoft.com\GSServices\sdks\gs-sdk-base\include;..\ubisoft.com\GSServices\sdks\gs-sdk-msclient\include;..\ubisoft.com\GSServices\sdks\gs-sdk-regserver\include;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\include;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;_USRDLL;CRYGAME_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + Use + stdafx.h + .\Debug/CryGame.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + Shlwapi.lib;wininet.lib;Wsock32.lib;%(AdditionalDependencies) + true + ..\BinkSDK;..\CryNetwork\Debug;.\..\ubisoft.com\GSServices\sdks/gs-sdk-regserver/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-msclient/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-common/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-base/lib_win32;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\lib_win32;%(AdditionalLibraryDirectories) + libcmt.lib;%(IgnoreSpecificDefaultLibraries) + true + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryGame.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + ..\BinkSDK;..\CryCommon;..\ubisoft.com\ConsoleImplementation\src;..\ubisoft.com\GSServices\sdks\gs-sdk-regserver\include;..\ubisoft.com\GSServices\sdks\gs-sdk-common\include;..\ubisoft.com\GSServices\sdks\gs-sdk-msclient\include;..\ubisoft.com\GSServices\sdks\gs-sdk-base\include;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\include;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;USE_GAME_DLL;WIN32;_WINDOWS;_USRDLL;CRYGAME_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Release/CryGame.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + Shlwapi.lib;wininet.lib;Ws2_32.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + ..\BinkSDK;..\CryNetwork\Release;.\..\ubisoft.com\GSServices\sdks/gs-sdk-regserver/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-msclient/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-common/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-base/lib_win32;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\lib_win32;%(AdditionalLibraryDirectories) + .\Release/CryGame.pdb + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryGame.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + ..\BinkSDK;..\CryCommon;..\ubisoft.com\ConsoleImplementation\src;..\ubisoft.com\GSServices\sdks\gs-sdk-msclient\include;..\ubisoft.com\GSServices\sdks\gs-sdk-common\include;..\ubisoft.com\GSServices\sdks\gs-sdk-base\include;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\include;..\ubisoft.com\GSServices\sdks\gs-sdk-regserver\include;%(AdditionalIncludeDirectories) + NDEBUG;USE_GAME_DLL;WIN32;_WINDOWS;_USRDLL;CRYGAME_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + false + false + Use + stdafx.h + .\Profile/CryGame.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + Shlwapi.lib;wininet.lib;Ws2_32.lib;%(AdditionalDependencies) + true + ..\BinkSDK;..\CryNetwork\Release;.\..\ubisoft.com\GSServices\sdks/gs-sdk-regserver/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-msclient/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-result/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-cdkey/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-common/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-base/lib_win32;%(AdditionalLibraryDirectories) + false + libcmt.lib;%(IgnoreSpecificDefaultLibraries) + true + 0x33000000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/CryGame.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + _AMD64_;_DEBUG;WIN64;WIN32;_WINDOWS;_USRDLL;CRYGAME_EXPORTS;DIVX;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + false + Use + stdafx.h + $(IntDir)$(ProjectName).pch + All + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + Shlwapi.lib;wininet.lib;Ws2_32.lib;../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + libcmt.lib;%(IgnoreSpecificDefaultLibraries) + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryGame.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + /fp:fast /GL %(AdditionalOptions) + MaxSpeed + AnySuitable + true + Speed + ..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;_USRDLL;CRYGAME_EXPORTS;DIVX;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + false + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + Shlwapi.lib;wininet.lib;Ws2_32.lib;../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + libcmt.lib;%(IgnoreSpecificDefaultLibraries) + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryGame.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CryGame/CryGame.vcxproj.filters b/CryGame/CryGame.vcxproj.filters new file mode 100644 index 0000000..27e42c3 --- /dev/null +++ b/CryGame/CryGame.vcxproj.filters @@ -0,0 +1,608 @@ + + + + + {bf18a1c2-5b7f-4c41-92fb-b2862375a9a1} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {963f0510-0055-47d0-8bb8-1274bb4275f4} + + + {bd0e4449-6a72-47a6-8631-220501aaef43} + + + {847b429d-70dc-43a9-824a-74c81e47cd8b} + + + {c76de7d1-cc5e-4deb-be64-1d47c5568057} + + + {22935b2b-baaf-45b1-8ba7-89bc368a4417} + + + {5ee1dcde-47ea-4f92-834d-8578c9590211} + + + {d1e5ae62-2f08-4497-be51-4f89a3f6889b} + + + {6783b7b1-b2e6-4a5a-8bd9-4bc3f4cb2fa7} + + + {6750a8e9-fcf9-4aae-8db5-e9771e1ee540} + + + {adf6595d-bf62-4921-a584-1cb5cb8a337a} + + + {9e37e5ad-6413-4642-a7ff-40f28f1f4aa2} + + + {37dcf47e-7867-4f5b-b241-fb4ffa16cf87} + + + {da851d3a-0022-46b6-8b21-bbe5c8ab23c8} + + + {236b8159-490a-46e1-b1bf-bd830f923943} + + + {04b3afad-18f2-490f-825f-427d787ac75d} + + + {dbead215-4451-410e-bf5a-4af510b8a06b} + + + {258155dd-195a-423a-86f0-328951f66ae1} + + + {7c8c7bf2-7235-4aea-a9ed-dc588b3a51ef} + h;hpp;hxx;hm;inl + + + {09f88da0-9d8b-4702-8ebe-677dbc9d62d7} + + + {a21ca862-2481-4353-97cc-ac34c4da6b18} + + + {67980c64-36fb-4b83-b2d4-70811b05256c} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\ScriptObjects + + + Source Files\GameServer + + + Source Files\GameServer + + + Source Files\GameServer + + + Source Files\GameServer + + + Source Files\GameSystem + + + Source Files\GameSystem + + + Source Files\GameSystem + + + Source Files\GameSystem + + + Source Files\GameSystem + + + Source Files\Weapons + + + Source Files\Weapons + + + Source Files\GameClient + + + Source Files\GameClient + + + Source Files\Flock + + + Source Files\Flock + + + Source Files\Vehicle + + + Source Files\Vehicle + + + Source Files\Vehicle + + + Source Files\Vehicle + + + Source Files\Vehicle + + + Source Files\TimeDemoRecorder + + + Source Files\TimeDemoRecorder + + + Source Files\Player + + + Source Files\Player + + + Source Files\Player + + + Source Files\Player + + + Source Files\Player + + + Source Files\Player + + + Source Files\AI + + + Source Files\AI + + + Source Files\AI + + + Source Files\Network + + + Source Files\Network + + + Source Files\Network + + + Source Files\Network + + + Source Files\Network + + + Source Files\Network + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\GameFiles + + + Source Files\Materials + + + Source Files\Localization + + + Source Files\GameSerialization + + + Source Files\Scoreboard + + + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\UI + + + Source Files\Flock + + + Source Files\Flock + + + Source Files\TimeDemoRecorder + + + Source Files\Scoreboard + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\Weapons + + + Header Files\Weapons + + + Header Files\Weapons + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + Header Files\ScriptObjects + + + + + Source Files\UI + + + Source Files\GameClient + + + \ No newline at end of file diff --git a/CryGame/CryGame.vcxproj.user b/CryGame/CryGame.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryGame/CryGame.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryGame/CryGame_XBox.vcproj.vspscc b/CryGame/CryGame_XBox.vcproj.vspscc index 8f49f2e..a91c745 100644 --- a/CryGame/CryGame_XBox.vcproj.vspscc +++ b/CryGame/CryGame_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryGame/Release/CryGame.Build.CppClean.log b/CryGame/Release/CryGame.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryGame/Release/CryGame.dll.recipe b/CryGame/Release/CryGame.dll.recipe new file mode 100644 index 0000000..095fd28 --- /dev/null +++ b/CryGame/Release/CryGame.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryGame.dll + + + + + + \ No newline at end of file diff --git a/CryGame/Release/CryGame.log b/CryGame/Release/CryGame.log new file mode 100644 index 0000000..e69de29 diff --git a/CryGame/Release/CryGame.vcxproj.FileListAbsolute.txt b/CryGame/Release/CryGame.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryGame/ScriptObjectGame.cpp b/CryGame/ScriptObjectGame.cpp index 1ef5e76..567e20e 100644 --- a/CryGame/ScriptObjectGame.cpp +++ b/CryGame/ScriptObjectGame.cpp @@ -2715,8 +2715,7 @@ int CScriptObjectGame::GetSaveGameList(IFunctionHandler *pH) CStream stm(300, &sa); int bitslen = m_pSystem->GetCompressedFileSize((char *)szSaveFilename.c_str()); - - if (bitslen) + if (bitslen > 1) { stm.Resize(bitslen); diff --git a/CryGame/StdAfx.h b/CryGame/StdAfx.h index 22ac826..a4e4011 100644 --- a/CryGame/StdAfx.h +++ b/CryGame/StdAfx.h @@ -19,6 +19,7 @@ ////////////////////////////////////////////////////////////////////////// #define _NOTHREADS #define _STLP_NO_THREADS +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ////////////////////////////////////////////////////////////////////////// diff --git a/CryGame/UIDivX_Video.cpp b/CryGame/UIDivX_Video.cpp index 80f3408..c6600bb 100644 --- a/CryGame/UIDivX_Video.cpp +++ b/CryGame/UIDivX_Video.cpp @@ -744,7 +744,8 @@ LPDIRECTSOUNDBUFFER CStreamingSound::GetFreeBuffer() if( m_apDSBuffer == NULL ) return FALSE; - for( DWORD i=0; i + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {BDBC2938-D1D4-4773-9466-4E085586B073} + Perforce Project + + . + MSSCCI:Perforce SCM + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYINPUT_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Release/CryInput.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + .\Release/CryInput.pdb + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryInput.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYINPUT_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Profile/CryInput.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + true + true + 0x33500000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/CryInput.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CRYINPUT_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + Use + stdafx.h + .\Debug/CryInput.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + true + true + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryInput.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;C:\DXSDK\Include;%(AdditionalIncludeDirectories) + WIN64;_DEBUG;_WINDOWS;_USRDLL;CRYINPUT_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryInput.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + ..\CryCommon;C:\DXSDK\Include;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;_USRDLL;CRYINPUT_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryInput.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CryInput/CryInput.vcxproj.filters b/CryInput/CryInput.vcxproj.filters new file mode 100644 index 0000000..ec010b3 --- /dev/null +++ b/CryInput/CryInput.vcxproj.filters @@ -0,0 +1,72 @@ + + + + + {db3aeab7-b6f1-4c96-bc77-42b822444abd} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {4752781e-4811-4994-981c-b40cd0d69aff} + h;hpp;hxx;hm;inl + + + {57e9a6f9-58a8-4653-9862-f630aebb8902} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/CryInput/CryInput.vcxproj.user b/CryInput/CryInput.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryInput/CryInput.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryInput/CryInput_XBox.vcproj.vspscc b/CryInput/CryInput_XBox.vcproj.vspscc index b9b8a71..fb3bcbb 100644 --- a/CryInput/CryInput_XBox.vcproj.vspscc +++ b/CryInput/CryInput_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryInput/Release/CryInput.Build.CppClean.log b/CryInput/Release/CryInput.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryInput/Release/CryInput.dll.recipe b/CryInput/Release/CryInput.dll.recipe new file mode 100644 index 0000000..6119ec9 --- /dev/null +++ b/CryInput/Release/CryInput.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryInput.dll + + + + + + \ No newline at end of file diff --git a/CryInput/Release/CryInput.log b/CryInput/Release/CryInput.log new file mode 100644 index 0000000..e69de29 diff --git a/CryInput/Release/CryInput.vcxproj.FileListAbsolute.txt b/CryInput/Release/CryInput.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryInput/XKeyboard.cpp b/CryInput/XKeyboard.cpp index 336a8c5..5cf64d4 100644 --- a/CryInput/XKeyboard.cpp +++ b/CryInput/XKeyboard.cpp @@ -915,7 +915,7 @@ void CXKeyboard::SetupKeyNames() int nResult; unsigned int vKeyCode; - for (k=0;k<256;k++) + for (int k=0;k<256;k++) { vKeyCode = MapVirtualKeyEx( k, 1, GetKeyboardLayout(0) ); diff --git a/CryMovie/CryMovie.vcproj.vspscc b/CryMovie/CryMovie.vcproj.vspscc index 91a2146..631b6ea 100644 --- a/CryMovie/CryMovie.vcproj.vspscc +++ b/CryMovie/CryMovie.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryMovie/CryMovie.vcxproj b/CryMovie/CryMovie.vcxproj new file mode 100644 index 0000000..4bbab1f --- /dev/null +++ b/CryMovie/CryMovie.vcxproj @@ -0,0 +1,382 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F} + Perforce Project + + . + MSSCCI:Perforce SCM + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CRYMOVIE_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + Use + stdafx.h + .\Debug/CryMovie.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + true + true + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryMovie.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0407 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;.;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYMOVIE_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Release/CryMovie.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + .\Release/CryMovie.pdb + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryMovie.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0407 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;.;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYMOVIE_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Release/CryMovie.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + true + true + 0x34000000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryMovie.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0407 + + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN64;_DEBUG;_WINDOWS;_USRDLL;CRYMOVIE_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryMovie.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0407 + + + + + Full + AnySuitable + true + ..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;_USRDLL;CRYMOVIE_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryMovie.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0407 + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CryMovie/CryMovie.vcxproj.filters b/CryMovie/CryMovie.vcxproj.filters new file mode 100644 index 0000000..b895d06 --- /dev/null +++ b/CryMovie/CryMovie.vcxproj.filters @@ -0,0 +1,159 @@ + + + + + {451a78c8-b7a0-4c57-851b-25a514fd2f01} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {b127b9dd-5eac-4778-b592-c7fde8fcb828} + h;hpp;hxx;hm;inl + + + {51ae56fe-d81a-4d18-8ac1-1742eb093ad4} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/CryMovie/CryMovie.vcxproj.user b/CryMovie/CryMovie.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryMovie/CryMovie.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryMovie/CryMovie_XBox.vcproj.vspscc b/CryMovie/CryMovie_XBox.vcproj.vspscc index bb16f3e..2e09e12 100644 --- a/CryMovie/CryMovie_XBox.vcproj.vspscc +++ b/CryMovie/CryMovie_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryMovie/Release/CryMovie.Build.CppClean.log b/CryMovie/Release/CryMovie.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryMovie/Release/CryMovie.dll.recipe b/CryMovie/Release/CryMovie.dll.recipe new file mode 100644 index 0000000..3167cfc --- /dev/null +++ b/CryMovie/Release/CryMovie.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryMovie.dll + + + + + + \ No newline at end of file diff --git a/CryMovie/Release/CryMovie.log b/CryMovie/Release/CryMovie.log new file mode 100644 index 0000000..e69de29 diff --git a/CryMovie/Release/CryMovie.vcxproj.FileListAbsolute.txt b/CryMovie/Release/CryMovie.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryMovie/StdAfx.h b/CryMovie/StdAfx.h index fc2d630..11188ad 100644 --- a/CryMovie/StdAfx.h +++ b/CryMovie/StdAfx.h @@ -16,6 +16,7 @@ ////////////////////////////////////////////////////////////////////////// #define _NOTHREADS #define _STLP_NO_THREADS +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ////////////////////////////////////////////////////////////////////////// #include diff --git a/CryNetwork/CryNetwork.vcproj.vspscc b/CryNetwork/CryNetwork.vcproj.vspscc index 2179bbb..83f4da7 100644 --- a/CryNetwork/CryNetwork.vcproj.vspscc +++ b/CryNetwork/CryNetwork.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryNetwork/CryNetwork.vcxproj b/CryNetwork/CryNetwork.vcxproj new file mode 100644 index 0000000..3d53aa4 --- /dev/null +++ b/CryNetwork/CryNetwork.vcxproj @@ -0,0 +1,465 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C} + Perforce Project + + . + MSSCCI:Perforce SCM + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Disabled + ..\CryCommon;..\ubisoft.com\ConsoleImplementation\src;..\ubisoft.com\GSServices\sdks\gs-sdk-common\include;..\ubisoft.com\GSServices\sdks\gs-sdk-base\include;..\ubisoft.com\GSServices\sdks\gs-sdk-msclient\include;..\ubisoft.com\GSServices\sdks\gs-sdk-regserver\include;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\include;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;_USRDLL;CRYNETWORK_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + Use + stdafx.h + .\Debug/CryNetwork.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + winmm.lib;Shlwapi.lib;wininet.lib;Wsock32.lib;Ws2_32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) + true + .\..\ubisoft.com\GSServices\sdks/gs-sdk-regserver/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-msclient/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-common/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-base/lib_win32;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\lib_win32;%(AdditionalLibraryDirectories) + libcmt.lib;%(IgnoreSpecificDefaultLibraries) + true + $(IntDir)$(TargetName).lib + false + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryNetwork.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;..\ubisoft.com\ConsoleImplementation\src;..\ubisoft.com\GSServices\sdks\gs-sdk-common\include;..\ubisoft.com\GSServices\sdks\gs-sdk-base\include;..\ubisoft.com\GSServices\sdks\gs-sdk-msclient\include;..\ubisoft.com\GSServices\sdks\gs-sdk-regserver\include;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\include;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN32;_WINDOWS;_USRDLL;CRYNETWORK_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Release/CryNetwork.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + winmm.lib;wininet.lib;Wsock32.lib;Ws2_32.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + libcmt.lib;%(IgnoreSpecificDefaultLibraries) + .\Release/CryNetwork.pdb + $(IntDir)$(TargetName).lib + false + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryNetwork.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;..\ubisoft.com\ConsoleImplementation\src;..\ubisoft.com\GSServices\sdks\gs-sdk-common\include;..\ubisoft.com\GSServices\sdks\gs-sdk-base\include;..\ubisoft.com\GSServices\sdks\gs-sdk-msclient\include;..\ubisoft.com\GSServices\sdks\gs-sdk-regserver\include;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;_USRDLL;CRYNETWORK_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Profile/CryNetwork.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + winmm.lib;wininet.lib;Wsock32.lib;Ws2_32.lib;%(AdditionalDependencies) + true + .\..\ubisoft.com\GSServices\sdks/gs-sdk-regserver/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-msclient/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-common/lib_win32;.\..\ubisoft.com\GSServices\sdks/gs-sdk-base/lib_win32;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\lib_win32;%(AdditionalLibraryDirectories) + libcmt.lib;%(IgnoreSpecificDefaultLibraries) + true + 0x34500000 + false + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/CryNetwork.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;..\ubisoft.com\ConsoleImplementation\src;..\ubisoft.com\GSServices\sdks\gs-sdk-msclient\include;..\ubisoft.com\GSServices\sdks\gs-sdk-common\include;..\ubisoft.com\GSServices\sdks\gs-sdk-base\include;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\include;..\ubisoft.com\GSServices\sdks\gs-sdk-regserver\include;%(AdditionalIncludeDirectories) + _DEBUG;WIN64;_WINDOWS;_USRDLL;CRYNETWORK_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + false + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + winmm.lib;Shlwapi.lib;wininet.lib;Wsock32.lib;Ws2_32.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + ..\ubisoft.com\GSServices\sdks64/gs-sdk-regserver/lib_amd64;..\ubisoft.com\GSServices\sdks64/gs-sdk-msclient/lib_amd64;..\ubisoft.com\GSServices\sdks64/gs-sdk-common/lib_amd64;..\ubisoft.com\GSServices\sdks64/gs-sdk-base/lib_amd64;..\ubisoft.com\GSServices\sdks64\gs-sdk-cdkey\lib_amd64;%(AdditionalLibraryDirectories) + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + false + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryNetwork.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + ..\CryCommon;..\ubisoft.com\ConsoleImplementation\src;..\ubisoft.com\GSServices\sdks\gs-sdk-msclient\include;..\ubisoft.com\GSServices\sdks\gs-sdk-common\include;..\ubisoft.com\GSServices\sdks\gs-sdk-base\include;..\ubisoft.com\GSServices\sdks\gs-sdk-cdkey\include;..\ubisoft.com\GSServices\sdks\gs-sdk-regserver\include;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;_USRDLL;CRYNETWORK_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + false + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + winmm.lib;wininet.lib;Wsock32.lib;Ws2_32.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + ..\ubisoft.com\GSServices\sdks64/gs-sdk-regserver/lib_amd64;..\ubisoft.com\GSServices\sdks64/gs-sdk-msclient/lib_amd64;..\ubisoft.com\GSServices\sdks64/gs-sdk-common/lib_amd64;..\ubisoft.com\GSServices\sdks64/gs-sdk-base/lib_amd64;..\ubisoft.com\GSServices\sdks64\gs-sdk-cdkey\lib_amd64;%(AdditionalLibraryDirectories) + libcmt.lib;%(IgnoreSpecificDefaultLibraries) + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + false + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryNetwork.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + Full + + + + + + + + + + + + + + + + + + + + + + + + + Full + + + + + + + + + + + + + Full + + + + + + + + + + + + + + + + + + + + + + + + + Full + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CryNetwork/CryNetwork.vcxproj.filters b/CryNetwork/CryNetwork.vcxproj.filters new file mode 100644 index 0000000..046ca9e --- /dev/null +++ b/CryNetwork/CryNetwork.vcxproj.filters @@ -0,0 +1,213 @@ + + + + + {3b7934f0-3972-4ab2-bc0b-5736a7540ca2} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {50d5c507-a8d9-4e9e-accb-29e70a6d52ee} + h;hpp;hxx;hm;inl + + + {03b0acdf-4cf7-490f-a5bb-ef9aa68888f8} + + + {c838dd98-53a3-453d-84ae-02683323016d} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + {c52414de-c126-4ae0-9187-9207f1b91958} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + PunkBuster + + + PunkBuster + + + PunkBuster + + + PunkBuster + + + PunkBuster + + + UBIcom + + + UBIcom + + + UBIcom + + + UBIcom + + + UBIcom + + + UBIcom + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + PunkBuster + + + PunkBuster + + + PunkBuster + + + PunkBuster + + + PunkBuster + + + PunkBuster + + + UBIcom + + + UBIcom + + + UBIcom + + + UBIcom + + + \ No newline at end of file diff --git a/CryNetwork/CryNetwork.vcxproj.user b/CryNetwork/CryNetwork.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryNetwork/CryNetwork.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryNetwork/CryNetwork_XBox.vcproj.vspscc b/CryNetwork/CryNetwork_XBox.vcproj.vspscc index c2c50b1..b991d79 100644 --- a/CryNetwork/CryNetwork_XBox.vcproj.vspscc +++ b/CryNetwork/CryNetwork_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryNetwork/Release/CryNetwork.Build.CppClean.log b/CryNetwork/Release/CryNetwork.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryNetwork/Release/CryNetwork.lib b/CryNetwork/Release/CryNetwork.lib new file mode 100644 index 0000000..81edb34 Binary files /dev/null and b/CryNetwork/Release/CryNetwork.lib differ diff --git a/CryNetwork/Release/CryNetwork.log b/CryNetwork/Release/CryNetwork.log new file mode 100644 index 0000000..e69de29 diff --git a/CryNetwork/Release/CryNetwork.tlog/unsuccessfulbuild b/CryNetwork/Release/CryNetwork.tlog/unsuccessfulbuild new file mode 100644 index 0000000..e69de29 diff --git a/CryNetwork/Release/CryNetwork.vcxproj.FileListAbsolute.txt b/CryNetwork/Release/CryNetwork.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryNetwork/StdAfx.h b/CryNetwork/StdAfx.h index ba56f88..b9d4cb1 100644 --- a/CryNetwork/StdAfx.h +++ b/CryNetwork/StdAfx.h @@ -16,6 +16,9 @@ ////////////////////////////////////////////////////////////////////////// #define _NOTHREADS #define _STLP_NO_THREADS + +// #TODO: !!! +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ////////////////////////////////////////////////////////////////////////// #include @@ -44,6 +47,8 @@ // TODO: reference additional headers your program requires here +#define NOT_USE_UBICOM_SDK +//#define NOT_USE_PUNKBUSTER_SDK #if defined(_DEBUG) && !defined(LINUX) #include diff --git a/CryPhysics/CryPhysics.vcproj.vspscc b/CryPhysics/CryPhysics.vcproj.vspscc index ffb3743..53fe0b3 100644 --- a/CryPhysics/CryPhysics.vcproj.vspscc +++ b/CryPhysics/CryPhysics.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryPhysics/CryPhysics.vcxproj b/CryPhysics/CryPhysics.vcxproj new file mode 100644 index 0000000..5fa50db --- /dev/null +++ b/CryPhysics/CryPhysics.vcxproj @@ -0,0 +1,415 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774} + Perforce Project + + . + MSSCCI:Perforce SCM + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + true + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Full + AnySuitable + true + Speed + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;_USRDLL;PHYSICS_EXPORTS;PIII_SSE;ENTITY_PROFILER_ENABLED;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Profile/CryPhysics.pch + .\Profile/ + .\Profile/ + .\Profile/ + true + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + true + 0x35000000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/CryPhysics.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;_USRDLL;PHYSICS_EXPORTS;PIII_SSE;ENTITY_PROFILER_ENABLED;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + true + true + true + Use + stdafx.h + .\Debug/CryPhysics.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + true + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryPhysics.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Speed + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN32;_WINDOWS;_USRDLL;PHYSICS_EXPORTS;PIII_SSE;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + stdafx.h + .\Release/CryPhysics.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + .\Release/CryPhysics.pdb + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryPhysics.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + _DEBUG;WIN64;_WINDOWS;_USRDLL;PHYSICS_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + true + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryPhysics.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + /fp:fast /GL %(AdditionalOptions) + MaxSpeed + AnySuitable + true + Speed + ..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;_USRDLL;PHYSICS_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + true + Use + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + ../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryPhysics.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CryPhysics/CryPhysics.vcxproj.filters b/CryPhysics/CryPhysics.vcxproj.filters new file mode 100644 index 0000000..2e0ae79 --- /dev/null +++ b/CryPhysics/CryPhysics.vcxproj.filters @@ -0,0 +1,220 @@ + + + + + {bcffde22-0ca0-47d6-85b8-4c6945d7c084} + + + {4a50c979-d975-46ed-9fa3-7119b117a5ad} + + + {2293728c-d974-4e97-ba67-375890054426} + + + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Utils + + + Utils + + + Utils + + + Utils + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + + + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Dynamics + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + Collisions + + + + + \ No newline at end of file diff --git a/CryPhysics/CryPhysics.vcxproj.user b/CryPhysics/CryPhysics.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryPhysics/CryPhysics.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryPhysics/CryPhysics_XBox.vcproj.vspscc b/CryPhysics/CryPhysics_XBox.vcproj.vspscc index f0b3ddc..b6ed840 100644 --- a/CryPhysics/CryPhysics_XBox.vcproj.vspscc +++ b/CryPhysics/CryPhysics_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryPhysics/Release/CryPhysics.Build.CppClean.log b/CryPhysics/Release/CryPhysics.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryPhysics/Release/CryPhysics.dll.recipe b/CryPhysics/Release/CryPhysics.dll.recipe new file mode 100644 index 0000000..c71802a --- /dev/null +++ b/CryPhysics/Release/CryPhysics.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryPhysics.dll + + + + + + \ No newline at end of file diff --git a/CryPhysics/Release/CryPhysics.log b/CryPhysics/Release/CryPhysics.log new file mode 100644 index 0000000..e69de29 diff --git a/CryPhysics/Release/CryPhysics.vcxproj.FileListAbsolute.txt b/CryPhysics/Release/CryPhysics.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CryScriptSystem/CryScriptSystem.vcproj.vspscc b/CryScriptSystem/CryScriptSystem.vcproj.vspscc index 30e285b..605c25a 100644 --- a/CryScriptSystem/CryScriptSystem.vcproj.vspscc +++ b/CryScriptSystem/CryScriptSystem.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryScriptSystem/CryScriptSystem.vcxproj b/CryScriptSystem/CryScriptSystem.vcxproj new file mode 100644 index 0000000..14c92e5 --- /dev/null +++ b/CryScriptSystem/CryScriptSystem.vcxproj @@ -0,0 +1,852 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + Perforce Project + + . + MSSCCI:Perforce SCM + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0} + + + + DynamicLibrary + v143 + false + true + + + DynamicLibrary + v143 + false + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + + + DynamicLibrary + v143 + false + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Disabled + lua;..\CryCommon;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_USRDLL;_WINDOWS;CRYSCRIPTSYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + Use + .\Debug/CryScriptSystem.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + true + true + Windows + $(IntDir)$(TargetName).lib + + + _DEBUG;CRYXMLDOM_EXPORTS;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryScriptSystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + lua;../CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN32;_WINDOWS;CRYSCRIPTSYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + + .\Release/CryScriptSystem.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + .\Release/CryScriptSystem.pdb + true + $(TargetDir)\map.map + true + Windows + 0x34000000 + + + NDEBUG;CRYXMLDOM_EXPORTS;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CryScriptSystem.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + lua;../CryCommon;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;_USRDLL;CRYSCRIPTSYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + .\Profile/CryScriptSystem.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + true + Windows + 0x35500000 + + + NDEBUG;CRYXMLDOM_EXPORTS;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/CryScriptSystem.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + lua;..\CryCommon;%(AdditionalIncludeDirectories) + _DEBUG;WIN64;_WINDOWS;CRYSCRIPTSYSTEM_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + Use + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + Windows + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;CRYXMLDOM_EXPORTS;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryScriptSystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + lua;..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;CRYSCRIPTSYSTEM_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + Use + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + Windows + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;CRYXMLDOM_EXPORTS;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CryScriptSystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Use + Use + Use + + + Use + Use + Use + + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + + + + + + + + + Use + Use + Use + + + Use + Use + Use + + + Create + Create + Create + Create + + + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + + + TurnOffAllWarnings + TurnOffAllWarnings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CryScriptSystem/CryScriptSystem.vcxproj.filters b/CryScriptSystem/CryScriptSystem.vcxproj.filters new file mode 100644 index 0000000..18668b6 --- /dev/null +++ b/CryScriptSystem/CryScriptSystem.vcxproj.filters @@ -0,0 +1,238 @@ + + + + + {a00f7261-906b-44ee-9959-ca60c0377848} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {edc2a9ed-fbc6-4a7e-8027-6e9230fb46fd} + c + + + {c759c635-d346-4f52-a2ed-5b479685b541} + cpp;h + + + {ebd8871f-bccd-42c3-82f3-d2a480b18221} + c + + + {adba60df-6d87-477b-9ef6-02d4441cc506} + h + + + {26c3a1e0-2cf8-4538-9ccc-493e2d768654} + h;hpp;hxx;hm;inl + + + {bf6eb495-0cd1-4748-b4fc-bd79c965ee04} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\LUA\LuaCryPak + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + Source Files\LUA\Source Files + + + + + Source Files\LUA\LuaCryPak + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Source Files\LUA\Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/CryScriptSystem/CryScriptSystem.vcxproj.user b/CryScriptSystem/CryScriptSystem.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CryScriptSystem/CryScriptSystem.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CryScriptSystem/CryScriptSystem_XBox.vcproj.vspscc b/CryScriptSystem/CryScriptSystem_XBox.vcproj.vspscc index 8979f6c..c677eae 100644 --- a/CryScriptSystem/CryScriptSystem_XBox.vcproj.vspscc +++ b/CryScriptSystem/CryScriptSystem_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CryScriptSystem/Release/CryScriptSystem.Build.CppClean.log b/CryScriptSystem/Release/CryScriptSystem.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CryScriptSystem/Release/CryScriptSystem.dll.recipe b/CryScriptSystem/Release/CryScriptSystem.dll.recipe new file mode 100644 index 0000000..3b63127 --- /dev/null +++ b/CryScriptSystem/Release/CryScriptSystem.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CryScriptSystem.dll + + + + + + \ No newline at end of file diff --git a/CryScriptSystem/Release/CryScriptSystem.log b/CryScriptSystem/Release/CryScriptSystem.log new file mode 100644 index 0000000..e69de29 diff --git a/CryScriptSystem/Release/CryScriptSystem.vcxproj.FileListAbsolute.txt b/CryScriptSystem/Release/CryScriptSystem.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CrySoundSystem/CrySoundSystem.vcproj.vspscc b/CrySoundSystem/CrySoundSystem.vcproj.vspscc index b09f853..5291bb4 100644 --- a/CrySoundSystem/CrySoundSystem.vcproj.vspscc +++ b/CrySoundSystem/CrySoundSystem.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CrySoundSystem/CrySoundSystem.vcxproj b/CrySoundSystem/CrySoundSystem.vcxproj new file mode 100644 index 0000000..9bc96c5 --- /dev/null +++ b/CrySoundSystem/CrySoundSystem.vcxproj @@ -0,0 +1,389 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {FD988D8E-914A-4463-A458-4568120E258C} + Perforce Project + + . + MSSCCI:Perforce SCM + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;OggVorbisInclude\;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYSOUNDSYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + + .\Release/CrySoundSystem.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + ogg_static.lib;vorbis_static.lib;vorbisfile_static.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + .\Release/CrySoundSystem.pdb + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/CrySoundSystem.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;OggVorbisInclude\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYSOUNDSYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + .\Profile/CrySoundSystem.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + ogg_static.lib;vorbis_static.lib;vorbisfile_static.lib;%(AdditionalDependencies) + true + true + 0x36000000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Profile/CrySoundSystem.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;OggVorbisInclude\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CRYSOUNDSYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + + .\Debug/CrySoundSystem.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + ogg_static.lib;vorbis_static.lib;vorbisfile_static.lib;%(AdditionalDependencies) + true + true + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CrySoundSystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\CryCommon;OggVorbisInclude\;%(AdditionalIncludeDirectories) + WIN64;WIN32;_DEBUG;_WINDOWS;_USRDLL;CRYSOUNDSYSTEM_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + Use + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + ogg_static_d64.lib;vorbis_static_d64.lib;vorbisfile_static_d64.lib;crysound64d.lib;../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + Windows + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CrySoundSystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + ..\CryCommon;OggVorbisInclude\;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;_USRDLL;CRYSOUNDSYSTEM_EXPORTS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + Use + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + ogg_static_r64.lib;vorbis_static_r64.lib;vorbisfile_static_r64.lib;crysound64.lib;../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/CrySoundSystem.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + + + + + + \ No newline at end of file diff --git a/CrySoundSystem/CrySoundSystem.vcxproj.filters b/CrySoundSystem/CrySoundSystem.vcxproj.filters new file mode 100644 index 0000000..97fd5dc --- /dev/null +++ b/CrySoundSystem/CrySoundSystem.vcxproj.filters @@ -0,0 +1,162 @@ + + + + + {c5d4ec77-1daf-49eb-8e8a-721e91cd0e65} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {f68ee074-b1b8-450c-bca5-a0b54caadc69} + h;hpp;hxx;hm;inl + + + {2984ee1b-a0e2-4f76-99d7-ab82095f13f0} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + {4eb8c9a7-f3d2-4feb-a3f0-a45742ca34c6} + + + {cce51135-e77d-4a2a-93a6-23bd689f6b7d} + + + {595afd63-fc67-4dcf-9dba-a47108c33bf3} + + + {90a0d401-a323-4331-9c7a-f6dc7f7eb378} + + + {d88f968c-4509-4e00-85e0-3c54b8121f9a} + + + {8d9ecfa6-e00d-446a-8dac-ce893be3fe5f} + + + {64fc0190-6f11-4330-a124-1c25f7b9241d} + + + {46277d21-6b67-473c-bdcc-3fe8a2caf2eb} + + + {6f8dce86-a2da-4a89-ac5f-6544ffdcd593} + + + {3b4f84ec-eba2-49ee-8ecf-0887a86f2735} + + + {c65e3c64-900b-4af4-ab02-b56e3e4bd43c} + + + {93b19774-0b0d-43fe-8faa-6cdf796f9f8f} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + DynamicMusic\Pattern + + + DynamicMusic\Pattern + + + DynamicMusic\Pattern\Decoder\WAV + + + DynamicMusic\Pattern\Decoder\OGG + + + DynamicMusic\Pattern\Decoder\ADPCM + + + DynamicMusic\System + + + DynamicMusic\RandGen + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + DynamicMusic\Pattern + + + DynamicMusic\Pattern + + + DynamicMusic\Pattern\Decoder + + + DynamicMusic\Pattern\Decoder\WAV + + + DynamicMusic\Pattern\Decoder\OGG + + + DynamicMusic\Pattern\Decoder\OGG\OggVorbisInclude\Ogg + + + DynamicMusic\Pattern\Decoder\OGG\OggVorbisInclude\Ogg + + + DynamicMusic\Pattern\Decoder\OGG\OggVorbisInclude\Vorbis + + + DynamicMusic\Pattern\Decoder\OGG\OggVorbisInclude\Vorbis + + + DynamicMusic\Pattern\Decoder\OGG\OggVorbisInclude\Vorbis + + + DynamicMusic\Pattern\Decoder\ADPCM + + + DynamicMusic\System + + + DynamicMusic\System\Dummy + + + DynamicMusic\RandGen + + + + + + \ No newline at end of file diff --git a/CrySoundSystem/CrySoundSystem.vcxproj.user b/CrySoundSystem/CrySoundSystem.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CrySoundSystem/CrySoundSystem.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CrySoundSystem/CrySoundSystem_XBox.vcproj.vspscc b/CrySoundSystem/CrySoundSystem_XBox.vcproj.vspscc index 8031058..a1bf8d6 100644 --- a/CrySoundSystem/CrySoundSystem_XBox.vcproj.vspscc +++ b/CrySoundSystem/CrySoundSystem_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CrySoundSystem/Release/CrySoundSystem.Build.CppClean.log b/CrySoundSystem/Release/CrySoundSystem.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CrySoundSystem/Release/CrySoundSystem.dll.recipe b/CrySoundSystem/Release/CrySoundSystem.dll.recipe new file mode 100644 index 0000000..bb448e7 --- /dev/null +++ b/CrySoundSystem/Release/CrySoundSystem.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CrySoundSystem.dll + + + + + + \ No newline at end of file diff --git a/CrySoundSystem/Release/CrySoundSystem.log b/CrySoundSystem/Release/CrySoundSystem.log new file mode 100644 index 0000000..e69de29 diff --git a/CrySoundSystem/Release/CrySoundSystem.vcxproj.FileListAbsolute.txt b/CrySoundSystem/Release/CrySoundSystem.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CrySoundSystem/StdAfx.h b/CrySoundSystem/StdAfx.h index 0647397..b45b370 100644 --- a/CrySoundSystem/StdAfx.h +++ b/CrySoundSystem/StdAfx.h @@ -16,6 +16,7 @@ ////////////////////////////////////////////////////////////////////////// //#define _NOTHREADS //#define _STLP_NO_THREADS +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ////////////////////////////////////////////////////////////////////////// diff --git a/CrySystem/CompressedFile.cpp b/CrySystem/CompressedFile.cpp index c23ca24..d64c294 100644 --- a/CrySystem/CompressedFile.cpp +++ b/CrySystem/CompressedFile.cpp @@ -14,7 +14,7 @@ #include -#define USE_COMPRESSION +//#define USE_COMPRESSION bool CSystem::WriteCompressedFile(char *filename, void *data, unsigned int bitlen) { @@ -41,7 +41,8 @@ unsigned int CSystem::GetCompressedFileSize(char *filename) FILE *pFile=fxopen(filename, "rb"); if (!pFile) return 0; - + +#ifdef USE_COMPRESSION fseek(pFile,0,SEEK_END); long nLen=ftell(pFile); fseek(pFile,0,SEEK_SET); @@ -62,6 +63,22 @@ unsigned int CSystem::GetCompressedFileSize(char *filename) gzread(f, &bitlen, sizeof(int)); gzclose(f); fclose(pFile); +#else + fseek(pFile, 0, SEEK_END); + long nLen = ftell(pFile); + fseek(pFile, 0, SEEK_SET); + + if (nLen <= 0) + { + fclose(pFile); + return (0); + } + + unsigned int bitlen; + fread(&bitlen, sizeof(int), 1, pFile); + fclose(pFile); +#endif + return bitlen; } @@ -87,9 +104,9 @@ unsigned int CSystem::ReadCompressedFile(char *filename, void *data, unsigned in gzclose(f); fclose(pFile); #else - fread(pFile, &bitlen, sizeof(int)); + fread(&bitlen, sizeof(int), 1, pFile); assert(bitlen<=maxbitlen); // FIXME: nicer if caller doesn't need to know buffer size in advance - fread(pFile, data, BITS2BYTES(bitlen)); + fread(data, BITS2BYTES(bitlen), 1, pFile); fclose(pFile); #endif diff --git a/CrySystem/CrySystem.vcproj.vspscc b/CrySystem/CrySystem.vcproj.vspscc index f2c8ecd..274246b 100644 --- a/CrySystem/CrySystem.vcproj.vspscc +++ b/CrySystem/CrySystem.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CrySystem/CrySystem.vcxproj b/CrySystem/CrySystem.vcxproj new file mode 100644 index 0000000..e85af15 --- /dev/null +++ b/CrySystem/CrySystem.vcxproj @@ -0,0 +1,692 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B} + Perforce Project + + . + MSSCCI:Perforce SCM + Win32Proj + + + + DynamicLibrary + v143 + MultiByte + true + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CRYSYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + Use + Level3 + EditAndContinue + + + wininet.lib;%(AdditionalDependencies) + true + Windows + $(IntDir)$(TargetName).lib + MachineX86 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYSYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + Level3 + + + wininet.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + Windows + true + true + $(IntDir)$(TargetName).lib + MachineX86 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYSYSTEM_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + Level3 + ProgramDatabase + + + wininet.lib;%(AdditionalDependencies) + true + false + true + Windows + true + true + 0x36500000 + MachineX86 + + + + + Disabled + ..\CryCommon;c:\Program Files\Microsoft SDK\include;%(AdditionalIncludeDirectories) + WIN64;_DEBUG;_WINDOWS;_USRDLL;CRYSYSTEM_EXPORTS;GARBAGEMEMORY;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebug + false + Use + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + false + ProgramDatabase + + + /MACHINE:AMD64 %(AdditionalOptions) + wininet.lib;../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + C:\Program Files\Microsoft SDK\Lib\AMD64;%(AdditionalLibraryDirectories) + true + $(OutDir)$(ProjectName).pdb + Windows + true + $(OutDir)$(ProjectName).lib + NotSet + + + + + /fp:fast /GL %(AdditionalOptions) + MaxSpeed + AnySuitable + true + Speed + ..\CryCommon;c:\Program Files\Microsoft SDK\include;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;_USRDLL;CRYSYSTEM_EXPORTS;GARBAGEMEMORY;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + Use + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + false + ProgramDatabase + + + wininet.lib;../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + C:\Program Files\Microsoft SDK\Lib\AMD64;%(AdditionalLibraryDirectories) + true + $(OutDir)$(ProjectName).pdb + Windows + true + $(OutDir)$(ProjectName).lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + + + true + + + true + + + true + + + true + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CrySystem/CrySystem.vcxproj.filters b/CrySystem/CrySystem.vcxproj.filters new file mode 100644 index 0000000..f5c065d --- /dev/null +++ b/CrySystem/CrySystem.vcxproj.filters @@ -0,0 +1,595 @@ + + + + + {aa71c06c-056e-4614-ab51-51b37b4c89a1} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + {98e89c77-ebe4-4988-9ca0-e21590c7b0fe} + h;hpp;hxx;hm;inl;inc + + + {af09c910-dca1-44ed-820a-66fec24c3a70} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + {090f4999-e60e-4fb9-91bc-0eb1b45df106} + + + {0ccc65bc-a960-4d3b-88d0-541ad0041cb7} + + + {fe537930-4380-40be-b3b2-570ee0609d76} + + + {542f6126-dc2b-4aad-8a32-fc9a126f6881} + + + {e24449f6-c716-434d-ba87-9346e06ff39b} + + + {53864450-14b1-456a-bf61-3cf27d421fe6} + + + {2bc18d2f-c42e-4f62-8240-c676882d815e} + + + {c7a29548-9bc8-4e71-a7b9-ed3c5b5174c2} + + + {dffdee5a-d69f-49c2-8fb8-edc970a4613d} + + + {2b704826-6fb7-4fdc-bca0-cbc9007adbb0} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + MemoryManager + + + MemoryManager + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + StreamEngine + + + StreamEngine + + + StreamEngine + + + StreamEngine + + + XML + + + XML + + + XML + + + XML + + + XML + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + ScriptObjects + + + ScriptObjects + + + ScriptObjects + + + ScriptObjects + + + ScriptObjects + + + ScriptObjects + + + ScriptObjects + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + HTTPDownloader + + + HTTPDownloader + + + CheatProtection + + + CheatProtection + + + CheatProtection + + + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + MemoryManager + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + LuaDebugger + + + StreamEngine + + + StreamEngine + + + StreamEngine + + + StreamEngine + + + StreamEngine + + + StreamEngine + + + XML + + + XML + + + XML + + + XML + + + XML + + + XML + + + XML + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + XML\Expat + + + ScriptObjects + + + ScriptObjects + + + ScriptObjects + + + ScriptObjects + + + ScriptObjects + + + ScriptObjects + + + ScriptObjects + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + zlib + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + ZipDir + + + HTTPDownloader + + + HTTPDownloader + + + CheatProtection + + + CheatProtection + + + CheatProtection + + + + + Resource Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/CrySystem/CrySystem.vcxproj.user b/CrySystem/CrySystem.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/CrySystem/CrySystem.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CrySystem/CrySystem_XBox.vcproj.vspscc b/CrySystem/CrySystem_XBox.vcproj.vspscc index 7f08afe..25687b8 100644 --- a/CrySystem/CrySystem_XBox.vcproj.vspscc +++ b/CrySystem/CrySystem_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/CrySystem/HTTPDownloader.cpp b/CrySystem/HTTPDownloader.cpp index cf9301a..cf106db 100644 --- a/CrySystem/HTTPDownloader.cpp +++ b/CrySystem/HTTPDownloader.cpp @@ -305,8 +305,9 @@ int CHTTPDownloader::Download(IFunctionHandler *pH) char *szURL = 0; char *szFileName = 0; - pH->GetParam(1, szURL); - pH->GetParam(2, szFileName); + // #TODO: Uncomment !!! + //pH->GetParam(1, szURL); + //pH->GetParam(2, szFileName); if (szURL && szFileName) { diff --git a/CrySystem/LuaDebugger/_TinyWindow.h b/CrySystem/LuaDebugger/_TinyWindow.h index 938f1bc..dbedf25 100644 --- a/CrySystem/LuaDebugger/_TinyWindow.h +++ b/CrySystem/LuaDebugger/_TinyWindow.h @@ -190,7 +190,7 @@ class _TinyWindow{ virtual BOOL IsCreated() { return IsWindow(m_hWnd); }; - virtual MakeChild() + virtual void MakeChild() { _TinyAssert(IsCreated()); DWORD dwStyle = GetWindowLong(m_hWnd, GWL_STYLE); diff --git a/CrySystem/MTSafeAllocator.h b/CrySystem/MTSafeAllocator.h index 1ff3261..b72b09e 100644 --- a/CrySystem/MTSafeAllocator.h +++ b/CrySystem/MTSafeAllocator.h @@ -111,12 +111,12 @@ class CMTSafeAllocator void construct(pointer _Ptr, const _Ty& _Val) { // construct object at _Ptr with value _Val - std::_Construct(_Ptr, _Val); + ::new (_Ptr) value_type(_Val); } void destroy(pointer _Ptr) { // destroy object at _Ptr - std::_Destroy(_Ptr); + _Ptr->~value_type(); } size_t max_size() const diff --git a/CrySystem/Release/CrySystem.Build.CppClean.log b/CrySystem/Release/CrySystem.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/CrySystem/Release/CrySystem.dll.recipe b/CrySystem/Release/CrySystem.dll.recipe new file mode 100644 index 0000000..59c124b --- /dev/null +++ b/CrySystem/Release/CrySystem.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\CrySystem.dll + + + + + + \ No newline at end of file diff --git a/CrySystem/Release/CrySystem.log b/CrySystem/Release/CrySystem.log new file mode 100644 index 0000000..e69de29 diff --git a/CrySystem/Release/CrySystem.vcxproj.FileListAbsolute.txt b/CrySystem/Release/CrySystem.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/CrySystem/StdAfx.h b/CrySystem/StdAfx.h index a416413..243d57f 100644 --- a/CrySystem/StdAfx.h +++ b/CrySystem/StdAfx.h @@ -20,6 +20,15 @@ #pragma once #endif +// TODO: fatal error C1189: #error: is deprecated and will be REMOVED. Please use . +// You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to suppress this error. +// Replace with std::unordered_map? +// +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS + +// Disable CRT warnings (disable SDL check?) +#define _CRT_SECURE_NO_WARNINGS + ////////////////////////////////////////////////////////////////////////// // THIS MUST BE AT THE VERY BEGINING OF STDAFX.H FILE. // Disable STL threading support, (makes STL faster) diff --git a/Editor/Editor.vcproj.vspscc b/Editor/Editor.vcproj.vspscc index 6cb031b..dcc120f 100644 --- a/Editor/Editor.vcproj.vspscc +++ b/Editor/Editor.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/Editor/Editor.vcxproj b/Editor/Editor.vcxproj new file mode 100644 index 0000000..7423af9 --- /dev/null +++ b/Editor/Editor.vcxproj @@ -0,0 +1,1446 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189} + Perforce Project + + . + MSSCCI:Perforce SCM + MFCProj + + + + Application + v143 + Dynamic + MultiByte + + + Application + v143 + Dynamic + MultiByte + + + Application + v143 + Dynamic + MultiByte + + + Application + v143 + Dynamic + MultiByte + + + Application + v143 + Dynamic + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + true + + + + Full + AnySuitable + true + Size + true + false + .\;..\;..\CryCommon;XT\Include;Include;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;_XT_STATICLINK;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + true + Use + StdAfx.h + .\Release/Editor.pch + .\Release/ + .\Release/ + .\Release/ + + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 +/fixed:no %(AdditionalOptions) + c:\MasterCD/Editor.exe + true + XT\Lib;Lib;%(AdditionalLibraryDirectories) + true + c:\MasterCD/Editor.pdb + Windows + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + c:\MasterCD/Editor.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + XT\Include;%(AdditionalIncludeDirectories) + + + + + Disabled + .\;..\;..\CryCommon;XT\Include;Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_XT_STATICLINK;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + false + true + true + Use + StdAfx.h + .\Debug/Editor.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 +/fixed:no %(AdditionalOptions) + true + XT\Lib;Lib;%(AdditionalLibraryDirectories) + true + Windows + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/Editor.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + XT\Include;%(AdditionalIncludeDirectories) + + + + + Full + AnySuitable + true + Size + true + false + .\;..\;..\CryCommon;XT\Include;Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_XT_STATICLINK;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + true + Use + StdAfx.h + .\Profile/Editor.pch + .\Profile/ + .\Profile/ + .\Profile/ + + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 +/fixed:no %(AdditionalOptions) + true + XT\Lib;Lib;%(AdditionalLibraryDirectories) + true + Windows + 0x37000000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + c:\MasterCD/Editor.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + XT\Include;%(AdditionalIncludeDirectories) + + + + + Disabled + .\;..\;..\CryCommon;XT\Include;Include;%(AdditionalIncludeDirectories) + _AFXDLL;_AMD64_;WIN64;WIN32;_DEBUG;_WINDOWS;_XT_STATICLINK;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + true + true + Use + StdAfx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + false + ProgramDatabase + Default + + + /MACHINE:AMD64 +/fixed:no %(AdditionalOptions) + true + XT\Lib;Lib;%(AdditionalLibraryDirectories) + true + Windows + true + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/Editor.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + XT\Include;%(AdditionalIncludeDirectories) + + + + + MinSpace + AnySuitable + true + Size + .\;..\;..\CryCommon;XT\Include;Include;%(AdditionalIncludeDirectories) + _AFXDLL;_AMD64_;WIN64;WIN32;NDEBUG;_RELEASE;_WINDOWS;_XT_STATICLINK;%(PreprocessorDefinitions) + true + true + Default + MultiThreadedDLL + false + true + true + Use + StdAfx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + false + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + true + XT\Lib;Lib;%(AdditionalLibraryDirectories) + true + Windows + true + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/Editor.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + XT\Include;%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + $(IntDir)%(Filename)1.obj + Level2 + + + $(IntDir)%(Filename)1.obj + + + $(IntDir)%(Filename)1.obj + + + $(IntDir)%(Filename)1.obj + Level2 + + + $(IntDir)%(Filename)1.obj + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + Level2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Editor/Editor.vcxproj.filters b/Editor/Editor.vcxproj.filters new file mode 100644 index 0000000..8115ecb --- /dev/null +++ b/Editor/Editor.vcxproj.filters @@ -0,0 +1,2741 @@ + + + + + {cdeee0d2-ac6c-4eb7-b9c6-dea844641b16} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {41169809-eb89-4b9c-9fb9-37950f956349} + h;hpp;hxx;hm;inl + + + {47ded994-83db-4e81-9e29-b2e40f18a88a} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + {046287dc-63cd-490c-bd01-6eb57272a55f} + + + {fbf5f120-7e1e-41e8-8db0-e1a0c8e8d8b3} + + + {9d0fc483-5b01-483b-9e45-3c4b67b7ed85} + + + {11404bb9-06b9-4a8e-bc5f-2d63eacbca43} + + + {710395a7-1057-467e-879d-2a2ae5754cc9} + + + {11471a85-a2cd-4f7b-a5fd-fa879bec8273} + + + {4c885813-c25f-4bbc-a923-cce2d3fca4cc} + + + {e2fd2929-3a90-407b-932e-b7b4362a0f14} + + + {fb0cd68b-e6fb-4f0c-bf9f-7e3f6c779b86} + + + {bca81152-5ea3-4ce1-accb-bb4895be708d} + + + {96a1b8f2-b947-444c-ae99-49f5a9b01899} + + + {52e3bea9-a377-40be-82fe-416b6fd81e04} + + + {1527ca4e-78ab-49fc-b4d7-c53bed4d2d36} + + + {b3a44c5b-1e0c-4a1a-8eea-6e96bb881d54} + + + {081478b7-7ac0-4513-8a79-966c6fc249c0} + + + {8d63a03d-2e13-4637-a589-0274252e51d5} + + + {a5ea7bd9-16d4-4e20-9329-2c55e38047de} + + + {6117eedc-8e37-4651-be9d-fd812da7ed98} + + + {e95d873d-0470-4be7-80b5-91726592b978} + + + {8fcee42f-0759-4d88-adcc-17e8f18505a7} + + + {5d719d91-f59e-4bcc-b144-16bb9fdc7e97} + + + {e7b457a8-a3aa-4bda-86f4-4ade56ca2508} + + + {9ace1104-214f-49a8-a504-fd1bfdd31707} + + + {bfc644cf-b320-40da-a1a6-70c316b15c73} + + + {62ab3f17-3fc4-4e1e-8b51-abf3dc54fff6} + + + {fe44c7e0-0704-460b-80ae-86a928f8c59d} + + + {20e8335d-82b2-4224-af41-4ce98c80c252} + + + {333a0ceb-f021-49f2-916b-d40b8ed403f7} + + + {6e370353-a36e-4383-af6b-b4146a6f978c} + + + {a352c0f9-e88f-419a-8339-1ff3087322df} + + + {0fe1e57e-ee20-43a2-923e-f957263c5dec} + + + {d5192b89-8c9c-4172-9a04-c3a19d9e0b57} + + + {2c17e199-d058-4ff4-a41d-390527009c11} + + + {a30baedc-dfd8-4f42-a0f5-8ad6c0f781f6} + + + {b195181d-8848-4bf4-952c-c7ff3f2f85cd} + + + {aac66ea7-a691-424d-88a4-485dbfae8e9e} + + + {e7fd9d20-f89c-4191-a3b0-ed632ef63d37} + + + {dee99987-ec25-4a08-9199-39a761039589} + + + {b3cdef6d-4101-466e-82dc-05bdcc6ced5f} + + + {2fa0931f-cb9e-4f37-a157-1c50efd72392} + + + {62b188ae-c7f9-4a96-aae8-27bae7073b25} + + + {8d478318-57b1-4a70-94d6-5ef1108db94f} + + + {d770926e-c324-453f-9b83-3828e979beae} + + + {e7a66c46-5d4b-4797-9b21-7bbfb2dbb57b} + + + {4ee41251-9888-4aa2-b6e8-373a58d36e3d} + + + {dbefab24-b2e1-49a9-a52d-8ab83d2f5e60} + + + {e7d13bd1-19b1-4373-8dab-2c501ea62aa9} + + + {e413cf66-f123-44a7-9ee7-d5f7729de8da} + + + {df2ad2cc-c632-46b4-891f-d2194571f627} + + + {3ab289e3-286d-4c26-9a5a-ba89fc38c847} + + + {1813fe77-ead1-4779-b326-a009f9e96aab} + + + {3598704a-2730-4099-b846-71ebbe5f0980} + + + {91e0d427-f4f0-4495-8c1e-ea14cd51ee53} + + + {f4028272-05c6-4fbd-a04d-4dfe047231da} + + + {88981baf-196a-4315-bafb-0f1aa5f781f0} + + + {d596f975-c16c-4f84-aba2-a30aed7cd620} + + + {3ad46055-6caf-4241-ba11-d5ea1e13a589} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls\SizingControlBar + + + Controls\SizingControlBar + + + Controls\SizingControlBar + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + System + + + System + + + System + + + System + + + System + + + System + + + System + + + System + + + System + + + System + + + ModelView + + + ModelView + + + ModelView + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects\Gizmo + + + Objects\Gizmo + + + Objects\Gizmo + + + Objects\Gizmo + + + Objects\Gizmo + + + Xml + + + Xml\Expat + + + Xml\Expat + + + Xml\Expat + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util\Images + + + Util\Images + + + Util\Images + + + Util\Images + + + Util\Images + + + Util\Math + + + Util\FileChangeMonitor + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + Util\zlib\Source Files + + + EditTools + + + EditTools\Texture + + + EditTools\Texture + + + EditTools\Clone + + + EditTools\Create + + + EditTools\Pick + + + EditTools\LinkTool + + + EditTools\LinkTool + + + EditTools\AlignTool + + + TerrainTools\Hole + + + TerrainTools\Hole + + + TerrainTools\Modify + + + TerrainTools\Modify + + + TerrainTools\Environment + + + TerrainTools\Environment + + + TerrainTools\TexturePainter + + + TerrainTools\TexturePainter + + + TerrainTools\Move + + + Undo + + + MaterialTools + + + MaterialTools + + + Vegetation + + + Vegetation + + + Vegetation + + + Vegetation + + + Vegetation + + + AI + + + AI + + + AI + + + AI + + + AI + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + Animation + + + Animation + + + EquipPack + + + EquipPack + + + Commands + + + Commands + + + Brush + + + Brush + + + Brush + + + Brush + + + Brush + + + Brush + + + Brush + + + Brush + + + Brush + + + Mission + + + Mission + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + GameExport + + + GameExport + + + GameExport + + + GameExport + + + LightmapCompiler + + + LightmapCompiler + + + LightmapCompiler + + + LightmapCompiler + + + LightmapCompiler + + + DataBase + + + DataBase + + + DataBase + + + DataBase + + + DataBase + + + DataBase\EntityArchetype + + + DataBase\EntityArchetype + + + DataBase\EntityArchetype + + + DataBase\EntityArchetype + + + DataBase\EntityArchetype + + + DataBase\ParticlesEditor + + + DataBase\ParticlesEditor + + + DataBase\ParticlesEditor + + + DataBase\ParticlesEditor + + + DataBase\MusicEditor + + + DataBase\MusicEditor + + + DataBase\MusicEditor + + + DataBase\MusicEditor + + + DataBase\PrefabsEditor + + + DataBase\PrefabsEditor + + + DataBase\PrefabsEditor + + + DataBase\PrefabsEditor + + + Material + + + Material + + + Material + + + Material + + + Presets\EAXPresets + + + Presets\SoundPresets + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Layout + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Dialogs + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls + + + Controls\SizingControlBar + + + Controls\SizingControlBar + + + Controls\SizingControlBar + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + Controls\PropertyCtrl + + + System + + + System + + + System + + + System + + + System + + + System + + + System + + + System + + + System + + + System + + + ModelView + + + ModelView + + + ModelView + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects + + + Objects\Gizmo + + + Objects\Gizmo + + + Objects\Gizmo + + + Objects\Gizmo + + + Objects\Gizmo + + + Xml + + + Xml\Expat + + + Xml\Expat + + + Xml\Expat + + + Xml\Expat + + + Xml\Expat + + + Xml\Expat + + + Xml\Expat + + + Xml\Expat + + + Xml\Expat + + + Xml\Expat + + + Xml\Expat + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Panels + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util + + + Util\Images + + + Util\Images + + + Util\Images + + + Util\Images + + + Util\Images + + + Util\Images + + + Util\Math + + + Util\Math + + + Util\FileChangeMonitor + + + Util\zlib\Header Files + + + Util\zlib\Header Files + + + Util\zlib\Header Files + + + Util\zlib\Header Files + + + Util\zlib\Header Files + + + Util\zlib\Header Files + + + Util\zlib\Header Files + + + Util\zlib\Header Files + + + Util\zlib\Header Files + + + Util\zlib\Header Files + + + Util\zlib\Header Files + + + EditTools + + + EditTools\Texture + + + EditTools\Texture + + + EditTools\Clone + + + EditTools\Create + + + EditTools\Pick + + + EditTools\LinkTool + + + EditTools\LinkTool + + + EditTools\AlignTool + + + TerrainTools\Hole + + + TerrainTools\Hole + + + TerrainTools\Modify + + + TerrainTools\Modify + + + TerrainTools\Environment + + + TerrainTools\Environment + + + TerrainTools\TexturePainter + + + TerrainTools\TexturePainter + + + TerrainTools\Move + + + Undo + + + Undo + + + MaterialTools + + + MaterialTools + + + Vegetation + + + Vegetation + + + Vegetation + + + Vegetation + + + Vegetation + + + AI + + + AI + + + AI + + + AI + + + AI + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + TrackView + + + Animation + + + Animation + + + EquipPack + + + EquipPack + + + Commands + + + Commands + + + Brush + + + Brush + + + Brush + + + Brush + + + Brush + + + Brush + + + Brush + + + Brush + + + Brush + + + Mission + + + Mission + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain + + + Terrain\Sky Accessiblity + + + Terrain\Sky Accessiblity + + + GameExport + + + GameExport + + + GameExport + + + GameExport + + + LightmapCompiler + + + LightmapCompiler + + + LightmapCompiler + + + LightmapCompiler + + + LightmapCompiler + + + LightmapCompiler + + + LightmapCompiler + + + DataBase + + + DataBase + + + DataBase + + + DataBase + + + DataBase + + + DataBase\EntityArchetype + + + DataBase\EntityArchetype + + + DataBase\EntityArchetype + + + DataBase\EntityArchetype + + + DataBase\EntityArchetype + + + DataBase\ParticlesEditor + + + DataBase\ParticlesEditor + + + DataBase\ParticlesEditor + + + DataBase\ParticlesEditor + + + DataBase\MusicEditor + + + DataBase\MusicEditor + + + DataBase\MusicEditor + + + DataBase\MusicEditor + + + DataBase\MusicEditor + + + DataBase\PrefabsEditor + + + DataBase\PrefabsEditor + + + DataBase\PrefabsEditor + + + DataBase\PrefabsEditor + + + Material + + + Material + + + Material + + + Material + + + Presets\EAXPresets + + + Presets\SoundPresets + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + Include + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Panels + + + + + Resource Files + + + + + Libraries + + + + + LightmapCompiler + + + + \ No newline at end of file diff --git a/Editor/Editor.vcxproj.user b/Editor/Editor.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/Editor/Editor.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Editor/Release/Editor.Build.CppClean.log b/Editor/Release/Editor.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/Editor/Release/Editor.log b/Editor/Release/Editor.log new file mode 100644 index 0000000..e69de29 diff --git a/Editor/Release/Editor.vcxproj.FileListAbsolute.txt b/Editor/Release/Editor.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/Editor/XT/Include/CJLibrary.h b/Editor/XT/Include/CJLibrary.h new file mode 100644 index 0000000..65236c6 --- /dev/null +++ b/Editor/XT/Include/CJLibrary.h @@ -0,0 +1,210 @@ +//:Ignore +// CJLibrary.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__CJLIBRARY_H__) +#define __CJLIBRARY_H__ + +//:Ignore +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +//:End Ignore + + +#include + +////////////////////////////////////////////////////////////////////// +// PROGRAMMERS NOTE: +// This file is intended to offer support for users who have upgraded from using +// CJLibrary, it is not intended for use on new projects, and only as a temporary +// solution. + +#define CCJBrowseButton CXTBrowseButton +#define CCJBrowseEdit CXTBrowseEdit +#define CCJCaption CXTCaption +#define CCJCaptionButton CXTCaptionButton +#define CCJCaptionPopupWnd CXTCaptionPopupWnd +#define CCJCBarButton // obsolete in XTreme toolkit +#define CCJColorPicker CXTColorPicker +#define CCJColorPopup CXTColorPopup +#define CCJComboBoxEx CXTComboBoxEx +#define CCJControlBar CXTDockWindow +#define CCJDateEdit CXTDateEdit +#define CCJDateTimeCtrl CXTDateTimeCtrl +#define CCJDockBar CXTDockBar +#define CCJDockContext CXTDockContext +#define CCJExplorerBar // obsolete in XTreme toolkit +#define CCJFlatButton CXTButton +#define CCJFlatComboBox CXTFlatComboBox +#define CCJFlatHeaderCtrl CXTFlatHeaderCtrl +#define CCJFlatSplitterWnd CXTSplitterWnd +#define CCJFlatTabCtrl CXTFlatTabCtrl +#define CCJFontCombo CXTFontCombo +#define CCJFrameWnd CXTFrameWnd +#define CCJHexEdit CXTHexEdit +#define CCJHtmlView CXTHtmlView +#define CCJHyperLink CXTHyperLink +#define CCJListBox CXTListBox +#define CCJListCtrl CXTListCtrl +#define CCJListView CXTListView +#define CCJLogoPane CXTLogoPane +#define CCJMaskEdit CXTMaskEdit +#define CCJMDIChildWnd CXTMDIChildWnd +#define CCJMDIFrameWnd CXTMDIFrameWnd +#define CCJMemFile CXTMemFile +#define CCJMenu // obsolete in XTreme toolkit +#define CCJMenuBar CXTMenuBar +#define CCJMenuBarFrameHook CXTMBarWndHook +#define CCJMenuData // obsolete in XTreme toolkit +#define CCJMetaFileButton // obsolete in XTreme toolkit +#define CCJMiniDockFrameWnd CXTMiniDockFrameWnd +#define CCJMonthCalCtrl CXTMonthCalCtrl +#define CCJOutlookBar CXTOutlookBar +#define CCJPagerCtrl CXTPagerCtrl +#define CCJReBar CXTReBar +#define CCJReBarCtrl CXTReBarCtrl +#define CCJShell // obsolete in XTreme toolkit +#define CCJShellList CXTShellListCtrl +#define CCJShellTree CXTShellTreeCtrl +#define CCJSizeDockBar CXTDockBar +#define CCJSortClass CXTSortClass +#define CCJStatusBar CXTStatusBar +#define CCJStatusBarPane // obsolete in XTreme toolkit +#define CCJStatusBarPaneControlInfo // obsolete in XTreme toolkit +#define CCJTabCtrl CXTTabCtrl +#define CCJTabCtrlBar CXTTabCtrlBar +#define CCJTabView CXTTabView +#define CCJTimeEdit CXTTimeEdit +#define CCJToolBar CXTToolBar +#define CCJToolBarBase CXTControlBar +#define CCJToolBarCtrl CXTToolBarCtrl +#define CCJTreeCtrl CXTTreeCtrl +#define CCJWindowPlacement CXTWindowPos +#define CContentItems CXTContentItems +#define CGfxGroupEdit CXTEditItem +#define CMenuItemInfo // obsolete in XTreme toolkit +#define ColorTableEntry XT_PICK_BUTTON +#define CSubclassWnd CXTWndHook +#define CSubclassWndMap CXTWindowMap +#define DROPDOWNBUTTON CXTDropDownButton +#define AFX_OLDTOOLINFO XT_OLDTOOLINFO +#define CTV_ITEM XT_TCB_ITEM +#define LVITEMDATA XT_LVITEMDATA +#define LPLVITEMDATA XT_LPLVITEMDATA +#define TCB_ITEM XT_TCB_ITEM +#define TVITEMDATA XT_TVITEMDATA +#define LPTVITEMDATA XT_LPTVITEMDATA +#define TOOLBARINFO // obsolete in XTreme toolkit +#define CJX_COLORMAP XT_COLORMAP +#define AFX_DLLVERSIONINFO XT_DLLVERSIONINFO +#define CJX_CONTROLPOS XT_CONTROLPOS +#define CToolBarData XT_TOOLBARDATA +#define CGfxSplitterWnd CXTSplitterWndEx + +class CGfxOutBarCtrl : public CXTOutBarCtrl +{ +public: + enum { fSmallIcon = OBS_XT_SMALLICON, + fLargeIcon = OBS_XT_LARGEICON, + fEditGroups = OBS_XT_EDITGROUPS, + fEditItems = OBS_XT_EDITITEMS, + fRemoveGroups = OBS_XT_REMOVEGROUPS, + fRemoveItems = OBS_XT_REMOVEITEMS, + fAddGroups = OBS_XT_ADDGROUPS, + fDragItems = OBS_XT_DRAGITEMS, + fAnimation = OBS_XT_ANIMATION, + fSelHighlight = OBS_XT_SELHIGHLIGHT }; + + enum { ircIcon = 1 // RC_OB_ICON, + ircLabel = 2 // RC_OB_LABEL, + ircAll = 3 // RC_OB_BOTH }; +}; + +struct OUTBAR_INFO : public XT_OUTBAR_INFO +{ + OUTBAR_INFO() : index(nIndex), iDragFrom(nDragFrom), iDragTo(nDragTo), cText(lpszText) {} + int& index; + int& iDragFrom; + int& iDragTo; + LPCTSTR& cText; +}; + +typedef enum +{ + NONE = 0, + OUTLINE = CBRS_XT_CLIENT_OUTLINE, + SUNKEN = CBRS_XT_CLIENT_STATIC, + RAISED = CBRS_XT_CLIENT_MODAL +} +CHILD_BORDER; + +////////////////////////////////////////////////////////////////////// +// Global functions: + +#define _LoadSysColorBitmap(hInst, hRsrc, bMono) _xtAfxLoadSysColorBitmap(hInst, hRsrc, bMono) +#define DDX_CJMonthCalCtrl(pDX, nIDC, value) DDX_XTMonthCalCtrl(pDX, nIDC, value) +#define DDX_CJColorPicker(pDX, nIDC, value) DDX_XTColorPicker(pDX, nIDC, value) +#define DDX_CJDateTimeCtrl(pDX, nIDC, value) DDX_XTDateTimeCtrl(pDX, nIDC, value) +#define DDX_OleDateTime(pDX, nIDC, rControl, rDateTime) DDX_XTOleDateTime(pDX, nIDC, rControl, rDateTime) +#define DDV_CJMinMaxDateTime(pDX, refValue, pMinRange, pMaxRange) DDV_XTMinMaxDateTime(pDX, refValue, pMinRange, pMaxRange) +#define DDV_CJMinMaxMonth(pDX, refValue, pMinRange, pMaxRange) DDV_XTMinMaxMonth(pDX, refValue, pMinRange, pMaxRange) + +////////////////////////////////////////////////////////////////////// +// Definitions: + +#define _ComCtlVersion _xtAfxComCtlVersion +#define _GetComCtlVersion() _xtAfxGetComCtlVersion() +#define _dropDownWidth // obsolete in XTreme toolkit +#define _GetDropDownWidth() // obsolete in XTreme toolkit +#define AFX_IDW_SIZEBAR_LEFT AFX_IDW_DOCKBAR_LEFT +#define AFX_IDW_SIZEBAR_RIGHT AFX_IDW_DOCKBAR_RIGHT +#define AFX_IDW_SIZEBAR_TOP AFX_IDW_DOCKBAR_TOP +#define AFX_IDW_SIZEBAR_BOTTOM AFX_IDW_DOCKBAR_BOTTOM +#define CM_ONPUSHPINBUTTON CPWN_XT_PUSHPINBUTTON +#define CM_ONPUSHPINCANCEL CPWN_XT_PUSHPINCANCEL +#define WS_EX_FLATEDGE // obsolete in XTreme toolkit +#define CPN_SELCHANGE CPN_XT_SELCHANGE +#define CPN_DROPDOWN CPN_XT_DROPDOWN +#define CPN_CLOSEUP CPN_XT_CLOSEUP +#define CPN_SELENDOK CPN_XT_SELENDOK +#define CPN_SELENDCANCEL CPN_XT_SELENDCANCEL +#define FTS_BOTTOM FTS_XT_BOTTOM +#define FTS_HASARROWS FTS_XT_HASARROWS +#define FTS_HASHOMEEND FTS_XT_HASHOMEEND +#define _CJX_EXT_CLASS _XT_EXT_CLASS +#define _CJXLIB_INLINE inline +#define WM_SHELL_NOTIFY XTWM_SHELL_NOTIFY +#define NM_SH_SHELLMENU SHN_XT_SHELLMENU +#define WM_OUTBAR_NOTIFY XTWM_OUTBAR_NOTIFY +#define NM_OB_ITEMCLICK OBN_XT_ITEMCLICK +#define NM_OB_ONLABELENDEDIT OBN_XT_ONLABELENDEDIT +#define NM_OB_ONGROUPENDEDIT OBN_XT_ONGROUPENDEDIT +#define NM_OB_DRAGITEM OBN_XT_DRAGITEM +#define NM_FOLDERCHANGE OBN_XT_FOLDERCHANGE +#define NM_OB_ITEMHOVER OBN_XT_ITEMHOVER +#define BT_POPUPMENU BES_XT_POPUPMENU +#define BT_DIRECTORY BES_XT_CHOOSEDIR +#define BT_FILE BES_XT_CHOOSEFILE +#define BROWSE_TYPE DWORD +#define CP_MODE_TEXT // obsolete in XTreme toolkit +#define CP_MODE_BK // obsolete in XTreme toolkit +#define BTN_IMG_INDEX // obsolete in XTreme toolkit +#define CTabList // obsolete in XTreme toolkit +#define CMDIMenuList // obsolete in XTreme toolkit +#define DATA_TYPE XT_DATA_TYPE +#define CTabViews // obsolete in XTreme toolkit +#define CListViews // obsolete in XTreme toolkit + +#endif // #if !defined(__CJLIBRARY_H__) +//:End Ignore diff --git a/Editor/XT/Include/XTAccelKeyEdit.h b/Editor/XT/Include/XTAccelKeyEdit.h new file mode 100644 index 0000000..b0e5cc6 --- /dev/null +++ b/Editor/XT/Include/XTAccelKeyEdit.h @@ -0,0 +1,103 @@ +// XTAccelKeyEdit.h : interface for the CXTAccelKeyEdit class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTACCELKEYEDIT_H__) +#define __XTACCELKEYEDIT_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTAccelKeyEdit is derived from CEdit. It is used by the "configure +// shortcuts page" to assign accelerator keyboard shortcuts. This class +// will manage the customization of keyboard shortcuts and assignment of +// commands to those shortcuts. +class CXTAccelKeyEdit : public CEdit +{ +public: + + // Summary: Constructs a CXTAccelKeyEdit object. + CXTAccelKeyEdit(); + + // Summary: Destroys a CXTAccelKeyEdit object, handles cleanup and de-allocation. + virtual ~CXTAccelKeyEdit(); + +private: + + BOOL m_bShift; + BOOL m_bCtrl; + BOOL m_bAlt; + WORD m_nVirtualKeyCode; + BOOL m_bKeyDefined; + +public: + + // Summary: This member function is called to reset the edit control. + void Reset(); + + // Input: nVirtualKeyCode - Reference to a WORD object that will receive the + // virtual key code that represents the virtual keys the user has selected. + // bCtrl - Reference to a BOOL object that will be TRUE if the VK_CONTROL key + // was pressed, otherwise set to FALSE. + // bAlt - Reference to a BOOL object that will be TRUE if the VK_MENU key + // was pressed, otherwise set to FALSE. + // bShift - Reference to a BOOL object that will be TRUE if the VK_SHIFT key + // was pressed, otherwise set to FALSE. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is called to determine which virtual keys + // have been selected. + BOOL GetKeyInfo(WORD& nVirtualKeyCode, BOOL& bCtrl, BOOL& bAlt, BOOL& bShift); + + // Returns: TRUE if a virtual key was defined other than VK_SHIFT, VK_CONTROL or VK_MENU, + // otherwise returns FALSE. + // Summary: This member function checks to see if a virtual key, other than VK_SHIFT, + // VK_CONTROL or VK_MENU, was defined. + BOOL IsKeyDefined(); + +protected: + + // Summary: This member function is called to update the text that is displayed + // in the edit field. + void UpdateKeyString(); + + // Ignore: + //{{AFX_VIRTUAL(CXTAccelKeyEdit) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTAccelKeyEdit) + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE BOOL CXTAccelKeyEdit::IsKeyDefined() { + return m_bKeyDefined; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTACCELKEYEDIT_H__) diff --git a/Editor/XT/Include/XTAccelManager.h b/Editor/XT/Include/XTAccelManager.h new file mode 100644 index 0000000..886612c --- /dev/null +++ b/Editor/XT/Include/XTAccelManager.h @@ -0,0 +1,309 @@ +// XTAccelManager.h : interface for the CXTAccelManager class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTACCELMANAGER_H_) +#define __XTACCELMANAGER_H_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// Summary: CMap definition for mapping accelerator categories. +typedef CMap CXTMapAccelCategory; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTAccelSwapOutItemList is a CMap derived class. This class is used +// to hold a list of swap-out commands. +class _XT_EXT_CLASS CXTAccelSwapOutItemList : public CXTMapAccelCategory {}; + +// Summary: XT_EXTRA_ACCELITEM is a stand alone structure class. It is used to +// create a structure that represents an accelerator item. +struct XT_EXTRA_ACCELITEM +{ + UINT nCommandID; // The command ID that this item represents. + CString szCategory; // The category, or top level menu name, that this command belongs to. + CString szName; // The name, or menu item text, that this item represents. +}; + +// Summary: XT_VKEYMAP is a stand alone structure class. It is used to define a +// structure used to map virtual key codes to their human readable names. +struct XT_VKEYMAP +{ + WORD wKey; // Virtual Key Code. + LPCTSTR szKeyName; // Display Name (i.e "CTRL"). +}; + +// Summary: XT_CATEGORY is a stand alone structure class. It is used by the +// accelerator manager to map a category title with an associated HMENU +// handle. +struct XT_CATEGORY +{ + HMENU hSubMenu; // Handle to the menu associated with the category. + CString strCategory; // Title of the menu category. +}; + +// Summary: CList definition for the category structure array. +typedef CList CXTCategoryList; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMapString is a CObject derived helper class. It is used to map IDs +// to command strings. +class CXTMapString : public CObject +{ +public: + + UINT m_nID; // ID of the command to map. + CString m_szName; // A NULL terminated string. + + // Input: item - A reference to a valid CXTMapString object. + // Returns: A reference to a valid CXTMapString object. + // Summary: Use this assignment operator to initialize a CXTMapString object. + const CXTMapString& operator=(const CXTMapString& item); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE const CXTMapString& CXTMapString::operator=(const CXTMapString& item) { + m_nID = item.m_nID; m_szName = item.m_szName; return *this; +} + +// Summary: CList definition for the map string object array. +typedef CList CXTMapStringList; + +// Summary: CList definition for the extra accelitem struct array. +typedef CList CXTExtraItems; + +// Summary: CMap definition for mapping command exclude lists. +typedef CMap CXTMapCommandExcludeList; + +// Summary: CMap definition for mapping accelerator accelerator swapo ut item lists. +typedef CMap CXTSwapOutList; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTAccelManager is a stand alone class. It encapsulates the configurable +// keyboard accelerator functions. +class _XT_EXT_CLASS CXTAccelManager +{ +private: + + // Summary: Constructs a CXTAccelManager object. + CXTAccelManager(); + +public: + + // Summary: Destroys a CXTAccelManager object, handles cleanup and de-allocation. + virtual ~CXTAccelManager(); + +protected: + + ////////////////////////////////////////////////////////////////////// + // Frame window binding information + ////////////////////////////////////////////////////////////////////// + + CFrameWnd* m_pFrameWnd; // A CFrameWnd pointer to the frame window that the accelerators are connected to. + + ////////////////////////////////////////////////////////////////////// + // String list of command categories (top level menu items). + ////////////////////////////////////////////////////////////////////// + + CXTCategoryList m_comboCategoryList; // A list used to map command IDs to display strings. + CXTMapStringList m_mapAccelString; // A list of command IDs to display categories. + CXTMapAccelCategory m_mapAccelCategory; // A map of command IDs to exclude from the string list. + CXTMapCommandExcludeList m_MapCommandExcludeList; // A map of swap-out command IDs. + CXTSwapOutList m_SwapOutList; // A map of extra commands for each category. + CXTExtraItems m_ExtraItems; // A list of additional commands that have accelerator definitions. + + ////////////////////////////////////////////////////////////////////// + // Our accelerator buffer + ////////////////////////////////////////////////////////////////////// + + int m_nAccelBufferCount; // The count of accelerators pointed to by 'm_pAccelBuffer'. + int m_nAccelDefaultCount; // The count of accelerators pointed to by 'm_pAccelDefault'. + bool m_bDefaultInUse; // true if the 'm_pAccelBuffer' currently contains a copy of the default accelerators. + bool m_bChanged; // true if the contents of 'm_pAccelBuffer' has been changed. + bool m_bAutoSave; // true if the accelerator data is automatically saved when this class is destroyed. + bool m_bInitialized; // true if the accelerator data has been initialized for the frame object. + LPACCEL m_pAccelBuffer; // The array of accelerators. + LPACCEL m_pAccelDefault; // The array of default accelerators. + static XT_VKEYMAP m_VirtSysKeys[]; // Virtual System Key ID to Name mappings. + static XT_VKEYMAP m_VirtKeys[]; // Virtual Key ID to Name mappings. + +public: + + // Example:
CXTAccelManager::Get().Init( this );
+ // Returns: A reference to the one and only CXTAccelManager object. + // Summary: This static member function will retrieve a reference to the one + // and only CXTAccelManager object. You can use this function to access + // data members for the CXTAccelManager class. + static CXTAccelManager& Get(); + + // Returns: true if the accelerator data has been initialized, otherwise it returns false. + // Summary: This member function will check to see if the accelerator data has been + // initialized. + bool IsInitialized(); + + // Input: pWnd - A CFrameWnd pointer to the frame window whose keyboard shortcuts + // should be managed. + // Returns: true if successful, otherwise returns false. + // Summary: This member function initializes the accelerator manager and loads default + // and user defined accelerator tables. + bool Init(CFrameWnd* pWnd); + + // Input: bUnInitialize - true if the object is to be un-initialized. + // Returns: true if successful, otherwise returns false. + // Summary: This member function saves the current keyboard accelerator. + bool Save(bool bUnInitialize=false); + + // Input: bUpdateWindowAccel - true to, when loaded, apply the configuration to + // the current frame window. + // Returns: true if successful, otherwise returns false. + // Summary: This member function loads a new keyboard accelerator. + bool Load(bool bUpdateWindowAccel = true); + + // Returns: A valid CMenu pointer if successful, otherwise returns NULL. + // Summary: This member function is called to get a pointer to the frame's + // active menu. + CMenu* GetFrameMenu(); + + // Input: bEnable - true to enable autosave. + // Summary: Call this member function to enable or disable the autosave feature. + // Autosave will automatically save the accelerator information when + // this object is destroyed. + void EnableAutoSave(bool bEnable); + + // Input: hMenu - NEEDS DESCRIPTION + // Summary: This member function is called to initialize the default and user + // defined accelerator tables for the manager, and must be called after the + // Init(...) method has been called. + void InitAccelerators(HMENU hMenu=NULL); + + // Input: nCommand - The command ID to exclude. + // Summary: This member function is used to exclude a specific command ID. To exclude + // a specific command ID, call this method before calling Init(...). + void ExcludeCommandID(UINT nCommand); + + // Input: nSwapOutID - The command ID of the menu item, defined in the menu resource, + // that should be replaced. + // nCommandID - The command ID to add to the menu. + // szName - The menu string to add. + // Summary: Call this method to set one or more swapout IDs, in the case where + // there is a dynamic menu item. An example of where this can be used would + // be the MRU in a standard doc/view application. Add a single command + // to the menu resource that can be swapped out with the commands you + // set here. Call this method once for each command you want to replace. + // For example, if you had a command ID called IDC_MRUPLACEHOLDER, and + // you wanted to add four new items in place of this which are IDC_MRUFILE1, + // IDC_MRUFILE2, IDC_MRUFILE3, IDC_MRUFILE4 you should do the following: - + //
+	//			kbsm.AddSwapoutCommand(IDC_MRUPLACEHOLDER, IDC_MRUFILE1, "File 1");
+    //          kbsm.AddSwapoutCommand(IDC_MRUPLACEHOLDER, IDC_MRUFILE2, "File 2");
+    //          kbsm.AddSwapoutCommand(IDC_MRUPLACEHOLDER, IDC_MRUFILE3, "File 3");
+    //          kbsm.AddSwapoutCommand(IDC_MRUPLACEHOLDER, IDC_MRUFILE4, "File 4");
+ void AddSwapoutCommand(UINT nSwapOutID, UINT nCommandID, LPCTSTR szName); + + // Input: szCategory - The category that this command should be added under. + // nCommandID - The command ID for this extra command. + // szName - The menu string for this command. + // Summary: This member function adds command IDs that are not found in the menu, + // but you want to have appear in the keyboard shortcut configuration and + // assignment property pages. + void AddExtraCommand(LPCTSTR szCategory, UINT nCommandID, LPCTSTR szName); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function applies the current accelerators to the window. + bool UpdateWindowAccelerator(); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to restore the default accelerators for + // the frame window. + bool LoadDefaultAccelerator(); + + // Input: nCommand - The command ID. + // szKeys - Retrieves the displayable string(s) for the assigned shortcuts + // (i.e. "Ctrl+C"). + // Summary: This member function will, given a command ID, return a string describing + // the currently assigned keys, if any. + void GetKeyAssignmentStrings(UINT nCommand, CString& szKeys); + + // Returns: true if successful, otherwise returns false. + // Summary: Override this member function to handle custom loading of the accelerator + // data. + virtual bool OnLoad(); + + // Input: pTable - Pointer to the accelerator table (array) to save. + // nCount - The number of elements in the above array. + // Returns: true if successful, otherwise returns false. + // Summary: Override this member function to handle custom saving of the accelerator + // data. + virtual bool OnSave(LPACCEL pTable, int nCount); + + // Input: pMsg - A pointer to a valid MSG structure. + // Returns: true if the message was handled, otherwise returns false. + // Summary: This member function is called by the framework to allow the accelerator + // manager to process any messages before they are forwarded. + bool TranslateAccelerator(MSG* pMsg); + +private: + + // Helper methods used by the configuration pages + + POSITION GetCommandStringStartPosition(); + void GetNextCommandStringItem(POSITION& rPos, UINT& nCommandID, CString& szString); + bool LookupCommandStringItem(UINT nCommandID, CString& szString); + void SetCommandStringItem(UINT nCommandID, CString szName); + void GetCategoryList(CComboBox& cb); + bool IsCommandInCategory(UINT nCommandID, LPCTSTR szCategory); + bool LookupCommandCategory(UINT nCommandID, CString& szCategory); + bool GetKeyAssignmentInfo(int& nPos, UINT nCommand, CString& szName, BYTE& cVirt, WORD& wKey); + bool AddKeyAssignment(UINT nCommand, BYTE cVirt, WORD wKey); + bool GetKeyAssignment(BYTE cVirt, WORD wKey, UINT& nCommand); + bool DeleteKeyAssignment(BYTE cVirt, WORD wKey); + void MakeDisplayName(CXTString& str); + void MakeKeyString(ACCEL Accel, CString& szName); + void SaveDefaultAcceleratorTable(CFrameWnd* pFrameWnd); + bool AddMenuItemsToNameList(HMENU hMenu, CString szParentName, LPCTSTR szCategory); + static LPCTSTR GetVirtualKeyString(WORD wKey); + bool MenuHasCommands(HMENU hMenu); + void BuildCategoryList(HMENU hMenu, CString strParentItem); + CXTMapStringList& GetCommandStringList(); + + // These classes need access to edit the keyboard accelerators. + + friend class CXTCustAccelerators; + friend class CXTAccelKeyEdit; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTAccelManager::ExcludeCommandID(UINT nCommand) { + m_MapCommandExcludeList.SetAt(nCommand, nCommand); +} +AFX_INLINE POSITION CXTAccelManager::GetCommandStringStartPosition() { + return m_mapAccelString.GetHeadPosition(); +} +AFX_INLINE bool CXTAccelManager::IsInitialized() { + return m_bInitialized; +} +AFX_INLINE void CXTAccelManager::EnableAutoSave(bool bEnable) { + m_bAutoSave = bEnable; +} +AFX_INLINE CXTMapStringList& CXTAccelManager::GetCommandStringList() { + return m_mapAccelString; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTACCELMANAGER_H_) diff --git a/Editor/XT/Include/XTAnimationMemDC.h b/Editor/XT/Include/XTAnimationMemDC.h new file mode 100644 index 0000000..b96f26e --- /dev/null +++ b/Editor/XT/Include/XTAnimationMemDC.h @@ -0,0 +1,108 @@ +// XTAnimationMemDC.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(___XTANIMATIONMEMDC_H__) +#define ___XTANIMATIONMEMDC_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// Summary: Enumerated type used to determine animation effect. +enum ANIMATIONTYPE +{ + animateWindowsDefault, // As defined in the "Display" settings. + animateRandom, // Any of the first three in random selection. + animateUnfold, // Unfold top to bottom. + animateSlide, // Slide in from left. + animateFade, // Fade-in. + animateNone // No animation. +}; + +// Input: rc - Area to display. +// pDestDC - Destination device context. +// pSrcDC - Source device context. +// nType - Enumerated ANIMATIONTYPE to determine animation effect. +// nSteps - Number of steps to complete animation. +// nAnimationTime - Amount of time in milliseconds between each step. +// Summary: Function pointer used to define a custom animation effect. +// See Also: CXTAnimationMemDC::SetCustomAnimation, ANIMATIONTYPE +typedef void (*xtAnimationProc)(CRect rc, CDC* pDestDC, CDC* pSrcDC, int nType, int nSteps, int nAnimationTime); + +////////////////////////////////////////////////////////////////////// +// Summary: CXTAnimationMemDC is a CXTMemDC derived class. This class is a replacement +// for the commonly used XTMemDC. By calling Animate(), the contained +// bitmap is drawn on the screen with a given effect. This effect is equal +// to the Menu effect in Windows® and Office™. +class _XT_EXT_CLASS CXTAnimationMemDC : public CXTMemDC +{ +public: + + // Input: pDC - A pointer to a CDC object. + // rect - An address of a CRect object. + // clrColor - An RGB value that represents the current system face color of + // three dimensional display elements. + // Summary: Constructs a CXTAnimationMemDC object. + CXTAnimationMemDC(CDC* pDC, const CRect& rect, COLORREF clrColor=GetSysColor(COLOR_3DFACE)); + + // Summary: Destroys a CXTAnimationMemDC object, handles cleanup and de-allocation. + virtual ~CXTAnimationMemDC(); + + // Input: nType - Type of animation to perform. + // nSteps - Number of steps to take during animation. + // nAnimationTime - Amount of time to rest, in milliseconds, between each step. + // Summary: This member function performs the animation. + void Animate(int nType = animateWindowsDefault, int nSteps = 10, int nAnimationTime = 1000); + + // Input: rc - Bounding rectangle + // pDestDC - Pointer to device context you must draw to. + // pSrcDC - Device context that contains the bitmap you must take. + // nType - Type of animation to perform. For custom animation you must use + // numbers greater than 6. + // nSteps - Number of steps to take during animation. + // nAnimationTime - Amount of time to rest, in milliseconds, between each step. + // Summary: This member implements default animation effects - Fade, Slide and Unfold. + // You can add new animation effects to call SetCustomAnimation member. + static void DefaultAnimation(CRect rc, CDC* pDestDC, CDC* pSrcDC, int nType, int nSteps, int nAnimationTime); + + // Input: pCustom - pointer to custom animation function. + // Example:
+    //           int CMainFrame::OnCreate()
+    //           {
+    //               CXTCoolMenu::m_nAnimationType = 10; // our animation type
+    //               CXTAnimationMemDC::SetCustomAnimation(CustomAnimation); // custom animation procedure.
+    //               ...
+    //           }
+    //           ...
+    //           void CMainFrame::CustomAnimation(CRect rc, CDC* pDestDC, CDC* pSrcDC, int nType, int nSteps, int nAnimationTime)
+    //           {
+    //               if (nType == 10)
+    //               {
+    //                   // do custom animation
+    //               } 
+    //               else
+    //               {
+    //                   CXTAnimationMemDC::DefaultAnimation(rc, pDestDC, pSrcDC, nType, nSteps, nAnimationTime);
+    //               }   
+    //           }
+    //           
+ // Summary: Call this member function to setup new Animation effects. + // You must call DefaultAnimation in your function. + // See Also: xtAnimationProc, ANIMATIONTYPE + static void SetCustomAnimation(xtAnimationProc pCustom); + +private: + static xtAnimationProc m_pCustomAnimation; +}; + +#endif // !defined(___XTANIMATIONMEMDC_H__) diff --git a/Editor/XT/Include/XTBrowseDialog.h b/Editor/XT/Include/XTBrowseDialog.h new file mode 100644 index 0000000..3d723c0 --- /dev/null +++ b/Editor/XT/Include/XTBrowseDialog.h @@ -0,0 +1,251 @@ +// XTBrowseDialog.h: interface for the CXTBrowseDialog class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTBROWSEDIALOG_H__) +#define __XTBROWSEDIALOG_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTBrowseDialog is derived from the BROWSEINFO structure. It is used +// to display a directory chooser dialog using shell extensions. The +// CXTBrowseDialog class allows you to configure various options, including +// setting the dialog's title, or assigning a callback function for defining +// folder display and file filtering styles. +class _XT_EXT_CLASS CXTBrowseDialog : protected BROWSEINFO +{ +public: + + // Input: pParent - Points to a CWnd object that represents the parent + // window for the browse dialog. + // Summary: Constructs a CXTBrowseDialog object. + CXTBrowseDialog(CWnd* pParent=NULL); + + // Summary: Destroys a CXTBrowseDialog object, handles cleanup and de-allocation. + virtual ~CXTBrowseDialog(); + +protected: + + // Summary: NULL terminated string that represents the selected directory. + TCHAR m_szSelPath[MAX_PATH]; + +public: + + // Returns: IDOK if the OK button was pressed, otherwise returns IDCANCEL. + // Summary: Call this member function to invoke the browse dialog box and return + // the dialog box result when done. + INT_PTR DoModal(); + + // Input: hWnd - Handle to the owner window for the dialog box. + // Summary: Call this member function to set the owner window for the dialog box. + void SetOwner(HWND hWnd); + + // Returns: An HWND handle. + // Summary: Call this member function to get an HWND handle to the owner window + // for the dialog box. + HWND GetOwner(); + + // Input: pidl - Address of an ITEMIDLIST structure specifying the location + // of the root folder from which to browse. Only the specified + // folder and its subfolders appear in the dialog box. This member + // can be NULL, in which case, the namespace root (the desktop folder) + // is used. + // Summary: Call this member function to set the address of an ITEMIDLIST structure + // which specifies the location of the root folder from which to browse. + void SetPidlRoot(LPCITEMIDLIST pidl); + + // Returns: The address of the ITEMIDLIST structure that was specified for the + // location of the root folder. + // Summary: Call this member function to return the address of the ITEMIDLIST + // structure that was specified for the location of the root folder. + LPCITEMIDLIST GetPidlRoot(); + + // Input: szDisplayName - Address of a buffer to receive the display name of the + // folder selected by the user. The size of this buffer is assumed to be + // MAX_PATH bytes. + // Summary: Call this member function to set the address for the display name + // the dialog box will use. + void SetDisplayName(TCHAR* szDisplayName); + + // Returns: The display name that is used by the browse dialog box. + // Summary: Call this member function to return the display name that is used + // by the browse dialog box. + LPCTSTR GetDisplayName(); + + // Input: szTitle - Address of a null-terminated string that is displayed above the + // tree view control in the dialog box. This string can be used to + // specify instructions to the user. + // Summary: Call this member function to set the title for the browse dialog box. + void SetTitle(TCHAR* szTitle); + + // Returns: A NULL terminated string that represents the title that was set for the dialog box. + // Summary: Call this member function to return a NULL terminated string that represents + // the title that was set for the dialog box. + LPCTSTR GetTitle(); + + // BULLETED LIST: + + // Input: uf - Flags specifying the options for the dialog box. This member can + // include zero or a combination of the following values: + // [ul] + // [li]BIF_BROWSEFORCOMPUTER Only return computers. If the user + // selects anything other than a computer, the OK button is grayed.[/li] + // [li]BIF_BROWSEFORPRINTER Only return printers. If the user + // selects anything other than a printer, the OK button is grayed.[/li] + // [li]BIF_BROWSEINCLUDEFILES The browse dialog will display + // files as well as folders.[/li] + // [li]BIF_DONTGOBELOWDOMAIN Do not include network folders + // below the domain level in the tree view control.[/li] + // [li]BIF_EDITBOX Version 4.71. The browse dialog includes an + // edit control in which the user can type the name of an item.[/li] + // [li]BIF_RETURNFSANCESTORS Only return file system ancestors. + // If the user selects anything other than a file system ancestor, + // the OK button is grayed.[/li] + // [li]BIF_RETURNONLYFSDIRS Only return file system directories. + // If the user selects folders that are not part of the file system, + // the OK button is grayed.[/li] + // [li]BIF_STATUSTEXT Include a status area in the dialog box. + // The callback function can set the status text by sending messages + // to the dialog box.[/li] + // [li]BIF_VALIDATE Version 4.71. If the user types an invalid + // name into the edit box, the browse dialog will call the application's + // BrowseCallbackProc with the BFFM_VALIDATEFAILED message. This + // flag is ignored if BIF_EDITBOX is not specified.[/li] + // [/ul] + // Summary: Call this member function to set the flags for specifying the options + // for the browse dialog box. + void SetOptions(UINT uf); + + // Returns: The flags specifying the options that have been set for the dialog box. + // Summary: Call this member function to return the flags specifying the options + // that have been set for the dialog box. + UINT GetOptions(); + + // Input: pf - Address of an application-defined function that the dialog box calls + // when an event occurs. For more information, see the BrowseCallbackProc + // function. This member can be NULL. + // Summary: Call this member function to define the address for the BrowseCallbackProc + // function to be called when an event occurs. + void SetCallback(BFFCALLBACK pf); + + // Returns: The address for the BrowseCallbackProc function that is called when an event occurs. + // Summary: Call this member function to return the address for the BrowseCallbackProc + // function that is called when an event occurs. + BFFCALLBACK GetCallback(); + + // Input: lp - Application-defined value that the dialog box passes to the callback + // function, if one is specified. + // Summary: Call this member function to set the application data that is passed to + // the callback function. + void SetData(LPARAM lp); + + // Returns: The application data that was set to be passed to the callback function, + // if one is specified. + // Summary: NEEDS SUMMARY + LPARAM GetData(); + + // Input: szSelPath - A NULL terminated string that represents the directory that is + // selected when the dialog is initially opened. If not set, + // GetCurrentDirectory is called to set the directory. + // Summary: Call this member function to set the initial path to select when the + // browse dialog is first opened. + void SetSelPath(TCHAR* szSelPath); + + // Returns: A NULL terminated string representing the selected directory. + // Summary: Call this member function to get a NULL terminated string that represents + // the currently selected directory. + LPCTSTR GetSelPath(); + + // Returns: The index to the system image list. + // Summary: Call this member function to get the index to the system image list + // of the image associated with the selected folder. + int GetImage(); + +private: + + CString m_strTitle; // default dialog title. + + // Input: hwnd - A handle to a window. + // uMsg - The message that is sent to the window. + // lParam - Specifies the application-defined data passed by the BrowseCtrlCallback + // function. + // lpData - Data that is passed into the function. + // Returns: An integer value. + // Summary: Application-defined callback function used with the SHBrowseForFolder function. + // The browse dialog box calls this function to notify it about events. You can + // define your own callback function by using the SetCallback method. + static int CALLBACK BrowseCtrlCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData); +}; + +///////////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTBrowseDialog::SetOwner(HWND hWnd) { + hwndOwner = hWnd; +} +AFX_INLINE HWND CXTBrowseDialog::GetOwner() { + return hwndOwner; +} +AFX_INLINE void CXTBrowseDialog::SetPidlRoot(LPCITEMIDLIST pidl) { + pidlRoot = pidl; +} +AFX_INLINE LPCITEMIDLIST CXTBrowseDialog::GetPidlRoot() { + return pidlRoot; +} +AFX_INLINE void CXTBrowseDialog::SetDisplayName(TCHAR* szDisplayName) { + pszDisplayName = szDisplayName; +} +AFX_INLINE LPCTSTR CXTBrowseDialog::GetDisplayName() { + return pszDisplayName; +} +AFX_INLINE void CXTBrowseDialog::SetTitle(TCHAR* szTitle) { + lpszTitle = szTitle; +} +AFX_INLINE LPCTSTR CXTBrowseDialog::GetTitle() { + return lpszTitle; +} +AFX_INLINE void CXTBrowseDialog::SetOptions(UINT uf) { + ulFlags = uf; +} +AFX_INLINE UINT CXTBrowseDialog::GetOptions() { + return ulFlags; +} +AFX_INLINE void CXTBrowseDialog::SetCallback(BFFCALLBACK pf) { + lpfn = pf; +} +AFX_INLINE BFFCALLBACK CXTBrowseDialog::GetCallback() { + return lpfn; +} +AFX_INLINE void CXTBrowseDialog::SetData(LPARAM lp) { + lParam = lp; +} +AFX_INLINE LPARAM CXTBrowseDialog::GetData() { + return lParam; +} +AFX_INLINE void CXTBrowseDialog::SetSelPath(TCHAR* szSelPath) { + _tcscpy(m_szSelPath, szSelPath); +} +AFX_INLINE LPCTSTR CXTBrowseDialog::GetSelPath() { + return m_szSelPath; +} +AFX_INLINE int CXTBrowseDialog::GetImage() { + return iImage; +} + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTBROWSEDIALOG_H__) diff --git a/Editor/XT/Include/XTBrowseEdit.h b/Editor/XT/Include/XTBrowseEdit.h new file mode 100644 index 0000000..b18d104 --- /dev/null +++ b/Editor/XT/Include/XTBrowseEdit.h @@ -0,0 +1,259 @@ +// XTBrowseEdit.h : interface for the CXTBrowseEdit class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTBROWSEEDIT_H__) +#define __XTBROWSEEDIT_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +class CXTBrowseBtn; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTBrowseEdit is a CXTEdit derived class. This class also has a push +// button associated with it. The control can be used to search for directories +// and files, or activate a popup menu. +class _XT_EXT_CLASS CXTBrowseEdit : public CXTEdit +{ + DECLARE_DYNAMIC(CXTBrowseEdit) + +public: + + // Summary: Constructs a CXTBrowseEdit object. + CXTBrowseEdit(); + + // Summary: Destroys a CXTBrowseEdit object, handles cleanup and de-allocation. + virtual ~CXTBrowseEdit(); + +protected: + + int m_nGap; // Distance between the button and edit control. + bool m_bBrowsing; // true if in browse operation. + BOOL m_bOpenFileDialog; // TRUE for Open File dialog, FALSE for Save as. See SetDlgOpenFile(...). + UINT m_nMenu; // Popup menu ID. + UINT m_nSubMenuIndx; // Index of a popup submenu. + CWnd* m_pParentWnd; // A CWnd pointer that represents the parent of the edit control. + DWORD m_dwFlags; // File dialog styles. + DWORD m_dwBStyle; // Search type. + DWORD m_dwInitSignature; // Used for one-time initialization. + CString m_strDefExt; // Default file extension. + CString m_strFileName; // Default file name. + CString m_strFilter; // Default file filter. + CString m_strTitle; // Directory dialog title. + CFileDialog* m_pFileDialog; // Points to a valid CFileDialog object. + CXTBrowseBtn* m_pBrowseBtn; // Pointer to a push button. + +public: + + // Returns: true if the control is displaying a File Open dialog or popup menu. + // Summary: Call this member function to determine if the browse edit control is in + // the middle of a browse operation. + bool IsBrowsing(); + + // Input: nGap - Gap, in pixels, between the browse button and edit window. + // Summary: Call this member function to set the gap between the edit window and the + // browse button. + void SetGap(int nGap); + + // Input: pFileDialog - Points to the CFileDialog object that will replace the + // standard File Open dialog. + // Summary: This member function will set a CFileDialog derived class object to be + // the file open dialog. + virtual void SetFileDialog(CFileDialog* pFileDialog); + + // Input: bOpenFileDialog - Set to TRUE to construct a File Open dialog box, or + // FALSE to construct a File Save as dialog box. + // Summary: This member function will set the File Open dialog style. + virtual void SetDlgOpenFile(BOOL bOpenFileDialog=TRUE); + + // Input: strDefExt - Points to a NULL terminated string that represents the + // default file extension to be used with the File Open dialog. + // Summary: This member function sets the default extension for the File Open dialog. + virtual void SetDlgDefExt(LPCTSTR strDefExt=NULL); + + // Input: strFileName - Points to a NULL terminated string that represents the + // default file name to be used with the File Open dialog. + // Summary: This member function sets the default file name for the File Open dialog. + virtual void SetDlgFileName(LPCTSTR strFileName=NULL); + + // Input: dwFlags - The desired OFN_ styles for the File Open dialog. + // Summary: This member function sets the style flags for the File Open dialog. + virtual void SetDlgStyle(DWORD dwFlags=OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT); + + // Input: strFilter - Points to a NULL terminated string that represents the file + // filter used by the File Open dialog. + // Summary: This member function sets the file filter for the File Open dialog. + virtual void SetDlgFilter(LPCTSTR strFilter=NULL); + + // Input: pParentWnd - Points to a CWnd object that represents the owner window + // for this control. + // Summary: This member function sets the owner for the File Open dialog. + virtual void SetDlgOwner(CWnd* pParentWnd=NULL); + + // Input: strTitle - Points to a NULL terminated string the represents the title + // of the "browse for directory" dialog. + // Summary: This member function sets the title for the directory dialog. + virtual void SetDlgTitle(LPCTSTR strTitle=NULL); + + // BULLETED LIST: + + // Input: dwBStyle - A DWORD value that represents the type of search to perform. It can + // be any one of the following styles: + // [ul] + // [li]BES_XT_CHOOSEDIR Display the choose folder dialog.[/li] + // [li]BES_XT_CHOOSEFILE Display the choose file dialog.[/li] + // [li]BES_XT_POPUPMENU Display a user defined context menu.[/li] + // [/ul] + // nMenu - If 'dwBStyle' contains the BES_XT_POPUPMENU flag, then 'nMenu' represents + // the resource ID of a popup menu. Otherwise this value is ignored. + // nSubMenuIndx - Index of submenu to display. + // Summary: This member function sets the current search type for the control. + virtual void SetBrowseStyle(DWORD dwBStyle,UINT nMenu=0,int nSubMenuIndx=0); + + // Summary: This member function is called whenever the browse button is pressed, + // and can be overridden to perform custom browse functions. + virtual void OnBrowse(); + + // Ignore: + //{{AFX_VIRTUAL(CXTBrowseEdit) + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + + virtual void ChooseDirectory(); + virtual void ChooseFile(); + virtual void PopupMenu(); + virtual void PositionBrowseButton(bool bSizeEdit=false); + + // Summary: Defers control initialization + void DeferInitialUpdate(); + + // Ignore: + //{{AFX_MSG(CXTBrowseEdit) + afx_msg void OnEnable(BOOL bEnable); + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + //}}AFX_MSG + + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTBrowseEdit::SetGap(int nGap) { + ASSERT(nGap >= 0); m_nGap = nGap; +} +AFX_INLINE void CXTBrowseEdit::SetFileDialog(CFileDialog *pFileDialog/*=NULL*/) { + m_pFileDialog = pFileDialog; +} +AFX_INLINE void CXTBrowseEdit::SetDlgOpenFile(BOOL bOpenFileDialog/*=TRUE*/) { + m_bOpenFileDialog = bOpenFileDialog; +} +AFX_INLINE void CXTBrowseEdit::SetDlgDefExt(LPCTSTR strDefExt/*=NULL*/) { + m_strDefExt = strDefExt; +} +AFX_INLINE void CXTBrowseEdit::SetDlgFileName(LPCTSTR strFileName/*=NULL*/) { + m_strFileName = strFileName; +} +AFX_INLINE void CXTBrowseEdit::SetDlgStyle(DWORD dwFlags/*=OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT*/) { + m_dwFlags = dwFlags; +} +AFX_INLINE void CXTBrowseEdit::SetDlgFilter(LPCTSTR strFilter/*=NULL*/) { + m_strFilter = strFilter; +} +AFX_INLINE void CXTBrowseEdit::SetDlgOwner(CWnd* pParentWnd/*=NULL*/) { + m_pParentWnd = pParentWnd; +} +AFX_INLINE void CXTBrowseEdit::SetDlgTitle(LPCTSTR strTitle/*=NULL*/) { + m_strTitle = strTitle; +} +AFX_INLINE void CXTBrowseEdit::SetBrowseStyle(DWORD dwBStyle, UINT nMenu, int nSubMenuIndx) { + m_dwBStyle = dwBStyle; m_nMenu = nMenu; m_nSubMenuIndx = nSubMenuIndx; +} +AFX_INLINE bool CXTBrowseEdit::IsBrowsing() { + return m_bBrowsing; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTItemEdit is a CXTBrowseEdit derived class. It is used to create +// a CXTItemEdit window that can be used as an "in-place" edit field that +// can be dynamically created for controls such as a list box. +class _XT_EXT_CLASS CXTItemEdit : public CXTBrowseEdit +{ + DECLARE_DYNAMIC(CXTItemEdit) + + // Used internally to determine if a WM_CLOSE message has been sent. + + bool m_bClosePosted; + +public: + + // Input: pParent - Points to the parent window. + // rect - Size of the edit item. + // strWindowText - Text to be initially displayed in the edit field. + // dwBStyle - Specifies the browse edit style for the in-place edit field. + // See CXTBrowseEdit::SetBrowseStyle for available styles. + // bAutoDelete - Set to true if the object is to be self deleting. + // Summary: Constructs a CXTItemEdit object that can be used as an "in-place" edit + // field, and can be dynamically created for controls such as a list box. + CXTItemEdit(CWnd* pParent, const CRect& rect, CString& strWindowText, + DWORD dwBStyle=BES_XT_CHOOSEDIR, bool bAutoDelete=true); + + // Summary: Destroys a CXTItemEdit object, handles cleanup and de-allocation. + virtual ~CXTItemEdit(); + +public: + + bool m_bModified; // true if the item was modified. + bool m_bAutoDelete; // true if self deleting. + bool m_bEscapeKey; // true if the edit window was closed with the escape key. + CString& m_strWindowText; // The edit controls text. + +public: + + // Summary: This member function is called whenever the control loses focus. + // This will destroy the window, and notify the parent via WM_COMMAND + // that the editing has been completed. The two possible commands are: + // ON_BEN_XT_LABELEDITEND and ON_BEN_XT_LABELEDITCANCEL; + virtual void EndLabelEdit(); + + // Ignore: + //{{AFX_VIRTUAL(CXTItemEdit) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual void PostNcDestroy(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTItemEdit) + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTBROWSEEDIT_H__) diff --git a/Editor/XT/Include/XTButton.h b/Editor/XT/Include/XTButton.h new file mode 100644 index 0000000..d2add40 --- /dev/null +++ b/Editor/XT/Include/XTButton.h @@ -0,0 +1,315 @@ +// XTButton.h : interface for the CXTButton class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTBUTTON_H__) +#define __XTBUTTON_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTButton is a CButton derived class. It is used to create flat style +// and image buttons. This control has several features including flat, +// semi-flat and three dimensional borders. +class _XT_EXT_CLASS CXTButton : public CButton +{ + DECLARE_DYNAMIC(CXTButton) + +public: + + // Summary: Constructs a CXTButton object. + CXTButton(); + + // Summary: Destroys a CXTButton object, handles cleanup and de-allocation. + virtual ~CXTButton(); + +protected: + + int m_nBorderGap; // Gap between the button edge and the image. + int m_nImageGap; // Gap between the button text and the image. + BOOL m_bHilite; // TRUE if the button is highlighted. + BOOL m_bUserPosition; // TRUE if the user has defined the XY coordinates for the image and text. + BOOL m_bLBtnDown; // TRUE if the left mouse button is pressed. + BOOL m_bAltColor; // TRUE if user defined colors are used. + BOOL m_bPainted; // Used during paint operations. + BOOL m_bChecked; // TRUE if the button is checked. + CSize m_sizeImage; // Initial size of the button. + DWORD m_dwxStyle; // The style of the button. See SetXButtonStyle(). + HICON m_hIcon; // Handle to the icon associated with the button. + HICON m_hIconPushed; // Handle to the icon associated with the button when it is pressed. + CPoint m_ptImage; // XY location of the button image. + CPoint m_ptText; // XY location of the button text. + HBITMAP m_hBitmap; // Bitmap associated with the button. + HBITMAP m_hBitmapMono; // Disabled bitmap associated with the button. + COLORREF m_clrBtnText; // An RGB value that represents the button text color. + COLORREF m_clr3DFace; // An RGB value that represents the button face color. + COLORREF m_clr3DHilight; // An RGB value that represents the 3D border highlight color. + COLORREF m_clr3DShadow; // An RGB value that represents the 3D border shadow color. + + ////////////////////////////////////////////////////////////////////// + // XP Flat colors + ////////////////////////////////////////////////////////////////////// + + BOOL m_bXPFUserColors; // TRUE if the user set custom XP-Flat colors. + DWORD m_dwInitSignature; // Used for one-time initialization. + COLORREF m_clrXPFHighlight; // An RGB value that represents the background color for highlighted buttons in XP-Flat mode. + COLORREF m_clrXPFPressed; // An RGB value that represents the background color for pressed buttons in XP-Flat mode. + COLORREF m_clrXPFBorder; // An RGB value that represents the frame color for highlighted/pressed buttons in XP-Flat mode. + +public: + + // Input: bChecked - Specifies whether the button is to be checked. TRUE will + // check the button. FALSE will uncheck it. + // Summary: This member function sets the highlighting state of a button control. + // This is the same as its CButton counterpart, except the m_bChecked flag + // is set. This is done because MFC does not recognize the button as being + // checked unless it a radio or check box. + void SetStateX(BOOL bChecked); + + // Input: nGap - Amount, in pixels, of the gap between the button edge and the image. + // Returns: The previous border gap value. + // Summary: This member function will set the gap between the button's edge and + // the image. + int SetBorderGap(int nGap); + + // Input: nGap - Amount, in pixels, of the gap between the button text and the image. + // Returns: The previous border gap value. + // Summary: This member function will set the gap between the button's text and + // the image. + int SetImageGap(int nGap); + + // Input: clr3DFace - An RGB value that represents the user defined face color for + // three dimensional display elements. + // clr3DHilight - An RGB value that represents the user defined highlight + // color for three dimensional display elements (edges facing the light + // source.) + // clr3DShadow - An RGB value that represents the user defined shadow color + // for three dimensional display elements (edges facing away from the + // light source). + // clrBtnText - An RGB value that represents the user defined text color + // on push buttons. + // Summary: This method will allow the user to define the default colors for the + // background shadow and highlight colors for the button. + virtual void SetAlternateColors(COLORREF clr3DFace, COLORREF clr3DHilight, COLORREF clr3DShadow, COLORREF clrBtnText); + + // Input: clrFace - An RGB value that represents the user defined face color. + // Summary: This member function sets the default face color for the button. + virtual void SetColorFace(COLORREF clrFace); + + // Returns: An RGB value that represents the current face color. + // Summary: This member function gets the current face color. + virtual COLORREF GetColorFace(); + + // Input: clrHilite - An RGB value that represents the user defined highlight color. + // Summary: This member function sets the default highlight color for the button. + virtual void SetColorHilite(COLORREF clrHilite); + + // Input: clrShadow - An RGB value that represents the user defined shadow color. + // Summary: This member function sets the default shadow color for the button. + virtual void SetColorShadow(COLORREF clrShadow); + + // Input: clrText - An RGB value that represents the user defined text color. + // Summary: This member function sets the default text color for the button. + virtual void SetColorText(COLORREF clrText); + + // Input: clrBorder - An RGB value that represents the user defined border color + // for the flat button. + // clrHighlight - An RGB value that represents the user defined highlight + // color for the flat button. + // clrPressed - An RGB value that represents the user defined color for when + // the flat button is pressed. + // Summary: This member function sets the colors for the BS_XT_XPFLAT mode. + virtual void SetXPFlatColors(COLORREF clrBorder, COLORREF clrHighlight, COLORREF clrPressed); + + // Input: size - CSize object that represents the size of the icon. + // hIcon - Handle to the normal icon. + // hIconPushed - Handle to the pressed icon. + // bRedraw - Specifies whether the button is to be redrawn. A nonzero value + // redraws the button. A zero value does not redraw the button. The button is + // redrawn by default. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will set the normal and pushed state icons for + // the push button. + virtual BOOL SetIcon(CSize size, HICON hIcon, HICON hIconPushed=NULL, BOOL bRedraw=TRUE); + + // Input: size - CSize object that represents the size of the icon. + // nID - Resource ID for the normal icon. + // nPushedID - Resource ID for the pressed icon. + // bRedraw - Specifies whether the button is to be redrawn. A nonzero value + // redraws the button. A zero value does not redraw the button. The button is + // redrawn by default. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will set the normal and pushed state icons for + // the push button. + virtual BOOL SetIcon(CSize size, UINT nID, UINT nPushedID=0, BOOL bRedraw=TRUE); + + // Input: size - CSize object that represents the size of the icon. + // lpszID - Resource string ID for the normal icon. + // lpszPushedID - Resource string ID for the pressed icon. + // bRedraw - Specifies whether the button is to be redrawn. A nonzero value + // redraws the button. A zero value does not redraw the button. The button is + // redrawn by default. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will set the normal and pushed state icons for + // the push button. + virtual BOOL SetIcon(CSize size, LPCTSTR lpszID, LPCTSTR lpszPushedID=NULL, BOOL bRedraw=TRUE); + + // Input: size - CSize object that represents the size of the bitmap. + // nID - Resource ID for the bitmap. + // bRedraw - Specifies whether the button is to be redrawn. A nonzero value redraws + // the button. A zero value does not redraw the button. The button is redrawn + // by default. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will set the bitmap associated with the button. + virtual BOOL SetBitmap(CSize size,UINT nID,BOOL bRedraw=TRUE); + + // Input: ptImage - XY location of the image displayed on the button. + // ptText - XY location of the text displayed on the button. + // bRedraw - Specifies whether the button is to be redrawn. A nonzero value redraws + // the button. A zero value does not redraw the button. The button is redrawn + // by default. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will set the XY location of the text and image + // that is displayed on the push button. + virtual BOOL SetTextAndImagePos(CPoint ptImage,CPoint ptText,BOOL bRedraw=TRUE); + + // BULLETED LIST: + + // Input: dwxStyle - Specifies the button style. It can be one or more of the following: + // [ul] + // [li]BS_XT_FLAT Draws a flat button.[/li] + // [li]BS_XT_SEMIFLAT Draws a semi-flat button.[/li] + // [li]BS_XT_TWOROWS Draws images and text that are centered.[/li] + // [li]BS_XT_SHOWFOCUS Draws a focus rect when the button + // has input focus.[/li] + // [li]BS_XT_HILITEPRESSED Highlights the button when pressed.[/li] + // [li]BS_XT_XPFLAT Draws a flat button ala Office XP.[/li] + // [/ul] + // bRedraw - Specifies whether the button is to be redrawn. A nonzero value redraws + // the button. A zero value does not redraw the button. The button is redrawn + // by default. + // Returns: The previous style that was set. + // Summary: This member function will set the display style for the button. + DWORD SetXButtonStyle(DWORD dwxStyle,BOOL bRedraw=TRUE); + + // Returns: The button styles for this CXTButton object. + // Summary: This function returns only the BS_XT_ style values, not any of the + // other window styles. + virtual DWORD GetXButtonStyle(); + + // Summary: This function removes the icon or bitmap from the button. All resources + // taken by the image are freed. + virtual void ResetImage(); + +protected: + + // Input: point - XY location of the text and image that are displayed. + // size - Initial size of the image associated with the button. + // Summary: This member function will set the proper XY coordinates for the button + // text and image. + void OffsetPoint(CPoint& point, CSize size); + + // Summary: This member function is called to free all associated GDI resources + // that have been allocated. + virtual void CleanUpGDI(); + + // Input: pDC - A CDC pointer that represents the current device context. + // nState - A UINT value that represents the current state for the button. + // rcItem - A CRect reference that represents the current size for the button. + // Summary: This member function draws the icon for the button, if any. + virtual void DrawButtonIcon(CDC* pDC, UINT nState, CRect& rcItem); + + // Input: pDC - A CDC pointer that represents the current device context. + // nState - A UINT value that represents the current state for the button. + // rcItem - A CRect reference that represents the current size for the button. + // Summary: This member function will draw the text for the button, if any. + virtual void DrawButtonText(CDC* pDC, UINT nState, CRect& rcItem); + + // Input: pDC - A CDC pointer that represents the current device context. + // nState - A UINT value that represents the current state for the button. + // rcItem - A CRect reference that represents the current size for the button. + // Summary: This member function will draw the bitmap for the button, if any. + virtual void DrawButtonBitmap(CDC* pDC, UINT nState, CRect& rcItem); + + // Input: bRemoveAmpersand - TRUE to remove the '&' used for mnemonics. + // Returns: A CString object that represents the button's text. + // Summary: Call this member function to return the buttons text minus the '&'. + virtual CString GetButtonText(BOOL bRemoveAmpersand); + + // Input: pDC - A CDC pointer that represents the current device context. + // nState - A UINT value that represents the current state for the button. + // rcItem - A CRect reference that represents the current size for the button. + // bHasPushedImage - Indicates if the button has a separate image for the + // pushed state. + // Returns: The top-left position for the button image. + // Summary: Call this member function to calculate the position of the button image. + virtual CPoint CalculateImagePosition(CDC* pDC, UINT nState, CRect& rcItem, bool bHasPushedImage); + + + // Input: bDepressed - TRUE if the button is pressed, otherwise FALSE. + // Summary: Call this helper function to set the pressed state and redraw the button. + void NoteButtonDepressed(BOOL bDepressed); + + // Summary: Defers control initialization + void DeferInitialUpdate(); + + // Ignore: + //{{AFX_VIRTUAL(CXTButton) + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTButton) + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnSysColorChange(); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnDestroy(); + //}}AFX_MSG + + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE int CXTButton::SetImageGap(int nGap) { + int nOldGap = m_nImageGap; m_nImageGap = nGap; return nOldGap; +} +AFX_INLINE int CXTButton::SetBorderGap(int nGap) { + int nOldGap = m_nBorderGap; m_nBorderGap = nGap; return nOldGap; +} +AFX_INLINE DWORD CXTButton::GetXButtonStyle() { + ASSERT(::IsWindow(m_hWnd)); return m_dwxStyle; +} +AFX_INLINE void CXTButton::SetStateX(BOOL bChecked) { + CButton::SetState(bChecked); m_bChecked = bChecked; +} +AFX_INLINE COLORREF CXTButton::GetColorFace() { + return m_clr3DFace; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTBUTTON_H__) diff --git a/Editor/XT/Include/XTCBarDialog.h b/Editor/XT/Include/XTCBarDialog.h new file mode 100644 index 0000000..7415a0e --- /dev/null +++ b/Editor/XT/Include/XTCBarDialog.h @@ -0,0 +1,172 @@ +// XTCBarDialog.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCBARDIALOG_H__) +#define __XTCBARDIALOG_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +///////////////////////////////////////////////////////////////////////////// +// Summary: CXTCBarDialog is a, CXTResizeDialog derived class. The CXTCBarDialog class is used +// to create a dialog that supports toolbars, status bars and menu commands similar to the way +// a CFrameWnd class would handle this. +class _XT_EXT_CLASS CXTCBarDialog : public CXTResizeDialog +{ + DECLARE_DYNAMIC(CXTCBarDialog) + +public: + + // Summary: Constructs a CXTCBarDialog object. To construct a resource-based modal + // dialog box, call either public form of the constructor. One form of the + // constructor provides access to the dialog resource by template name. The + // other constructor provides access by template ID number, usually with an + // IDD_ prefix (for example, IDD_DIALOG1). + // + // To construct a modal dialog box from a template in memory, first invoke + // the parameterless, protected constructor and then call + // InitModalIndirect. + // + // After you construct a modal dialog box with one of the above methods, call + // DoModal. + // + // To construct a modeless dialog box, use the protected form of the + // CXTResizeDialog constructor. The constructor is protected + // because you must derive your own dialog-box class to implement a modeless + // dialog box. Construction of a modeless dialog box is a two-step process. + // First call the constructor; then call the Create member function to + // create a resource-based dialog box, or call CreateIndirect to create + // the dialog box from a template in memory. + CXTCBarDialog(); + + // BULLETED LIST: + + // Input: nIDTemplate - Contains the ID number of a dialog-box template resource. + // pParentWnd - Points to the parent or owner window object (of type CWnd) to which the dialog object + // belongs. If it is NULL, the dialog object’s parent window is set to the main application window. + // nFlags - Flags that are to be passed to CXTResize that specify the attributes + // of the resizing property page. They can be one or more of the following, + // and can be combined using the or (|) operator: + // [ul] + // [li]SZ_NOSIZEICON Do not add size icon.[/li] + // [li]SZ_NOHORISONTAL No horizontal resizing.[/li] + // [li]SZ_NOVERTICAL No vertical resizing.[/li] + // [li]SZ_NOMINSIZE Do not require a minimum size.[/li] + // [li]SZ_NOCLIPCHILDREN Do not set clip children style.[/li] + // [li]SZ_NOTRANSPARENTGROUP Do not set transparent style + // for group boxes.[/li] + // [/ul] + // Summary: Constructs a CXTCBarDialog object. To construct a resource-based modal dialog box, call either + // public form of the constructor. One form of the constructor provides access to the dialog resource + // by template name. The other constructor provides access by template ID number, usually with an + // IDD_ prefix (for example, IDD_DIALOG1). + // + // To construct a modal dialog box from a template in memory, first invoke the parameterless, protected + // constructor and then call InitModalIndirect. + // + // After you construct a modal dialog box with one of the above methods, call DoModal. + // + // To construct a modeless dialog box, use the protected form of the CXTResizeDialog constructor. The constructor + // is protected because you must derive your own dialog-box class to implement a modeless dialog box. + // Construction of a modeless dialog box is a two-step process. First call the constructor; then call the + // Create member function to create a resource-based dialog box, or call CreateIndirect to + // create the dialog box from a template in memory. + CXTCBarDialog(UINT nIDTemplate,CWnd* pParentWnd = NULL,const UINT nFlags = 0); + +protected: + + UINT m_nIDTracking; // Resource id of the string command currently displayed in the status bar area. + UINT m_nIDLastMessage; // Resource id of the last string command displayed in the status bar area. + CPtrList m_listControlBars; // Array of control bars currently owned by the dialog. + CXTCoolMenu m_hookMenu; // Handles the display of old-style 'cool' menus. + + // Ignore: + //{{AFX_VIRTUAL(CXTCBarDialog) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual void DoDataExchange(CDataExchange* pDX); + //}}AFX_VIRTUAL + +protected: + + // Input: nIDToolBars - Array of toolbar resource IDs. The cool menu will use + // the toolbar commands to map the icons placed next to the corresponding + // menu commands. + // nSize - Size of the array of toolbars. + // Summary: Call this member function to install cool menus for your application. + // Cool menus are menus that appear with icons next to the menu titles. + // Pass in your toolbar resource array to initialize. + virtual void InstallCoolMenus(const UINT* nIDToolBars, int nSize); + + // Input: nIDToolBar - Toolbar resource ID. The cool menu will use the toolbar + // commands to map the icons placed next to the corresponding menu commands. + // Summary: Call this member function to install cool menus for your application. + // Cool menus are menus that appear with icons next to the menu titles. + // Pass in your toolbar resource to initialize. + virtual void InstallCoolMenus(const UINT nIDToolBar); + + // Summary: Called by the dialog when the standard control bars are toggled on or off + // or when the dialog window is resized. The default implementation of this + // member function calls the CWnd member function RepositionBars + // to reposition all the control bars in the dialog. + // + // Override this member function to control the appearance and behavior of + // control bars after the layout of the frame window has changed. For example, + // call it when you turn control bars on or off or add another control bar. + virtual void RecalcBarLayout(); + + // Returns: A CXTStatusBar pointer that represents the status bar associated with the + // dialog. + // Summary: Call this member function to retrieve a pointer to the status bar associated + // with the dialog. + virtual CXTStatusBar* GetMessageBar(); + + // Returns: A CXTMenuBar pointer that represents the menu bar associated with the dialog. + // Summary: Call this member function to retrieve a pointer to the menu bar associated + // with the dialog. + virtual CXTMenuBar* GetMenuBar(); + + // Input: pBar - Pointer to the control bar to be shown or hidden. + // bShow - If TRUE, specifies that the control bar is to be shown. If + // FALSE, specifies that the control bar is to be hidden. + // bDelay - If TRUE, delay showing the control bar. If FALSE, + // show the control bar immediately. + // Summary: Call this member function to show or hide the control bar. + virtual void ShowControlBar(CControlBar* pBar, BOOL bShow, BOOL bDelay); + + // Ignore: + //{{AFX_MSG(CXTCBarDialog) + afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); + afx_msg void OnEnterIdle(UINT nWhy, CWnd* pWho); + afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu); + afx_msg void OnSize(UINT nType, int cx, int cy); + //}}AFX_MSG + + afx_msg LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam = 0L); + afx_msg LRESULT OnPopMessageString(WPARAM wParam, LPARAM lParam); + afx_msg void OnUpdateKeyIndicator(CCmdUI* pCmdUI); + afx_msg void OnUpdateControlBarMenu(CCmdUI* pCmdUI); + afx_msg BOOL OnBarCheck(UINT nID); + afx_msg LRESULT OnKickIdle(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTCBARDIALOG_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTCallbacks.h b/Editor/XT/Include/XTCallbacks.h new file mode 100644 index 0000000..765b0f3 --- /dev/null +++ b/Editor/XT/Include/XTCallbacks.h @@ -0,0 +1,129 @@ +// XTCallbacks.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCALLBACKS_H__) +#define __XTCALLBACKS_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// Summary: This class defines a point of listener/callback registration. +// Each listener can later be notified. +template +class CXTCallbacks +{ +public: + + // Summary: A type of callback function, takes a parameter that is passed to notify() function + typedef void (CObject::*NOTIFYCB)(T caller); + +private: + + // Summary: Callback descriptor + struct CXTCbParam + { + DWORD m_receipt; // Registration receipt or 0 if this descriptor is not initialized yet + CObject* m_listener; // Listener + NOTIFYCB m_cb; // Callback + + CXTCbParam() + : m_listener(0) + , m_cb(0) + , m_receipt(0) + { } + }; + + DWORD m_signatureSeed; // A seed for generating signatures + CXTCbParam m_params[MAXCOUNT]; // Array of registered callbacks, maxed out as specified in template declaration + +// Operations + +public: + + CXTCallbacks() + : m_signatureSeed(0) + {} + + + // Input: listener - a listener on which to invoke the callback + // cb - listener's method to invoke + // Returns: Its registration receipt or 0 if no more space + // Summary: Adds a callback, + DWORD Add(CObject* listener, NOTIFYCB cb) + { + for (int i = 0; i < MAXCOUNT; i++) + { + if (!m_params[i].m_receipt) + { + m_params[i].m_cb = cb; + m_params[i].m_listener = listener; + return (m_params[i].m_receipt = ++m_signatureSeed); + } + } + return 0; + } + + // Input: receipt - Registration receipt. + // Returns: true if the callback was actually removed. + // Summary: Removes a callback by its registration receipt. + bool Remove(DWORD receipt) + { + for (int i = 0; i < MAXCOUNT; i++) + { + if (m_params[i].m_receipt == receipt) + { + m_params[i].m_receipt = 0; + m_params[i].m_cb = 0; + m_params[i].m_listener = 0; + return true; + } + } + return false; + } + + // Input: listener - Callback listener. + // Returns: true if a callback(s) actually removed + // Summary: Removes all callbacks registered with a given listener + bool Remove(CObject* listener) + { + bool removed = false; + for (int i = 0; i < MAXCOUNT; i++) + { + if (m_params[i].m_receipt && + m_params[i].m_listener == listener) + { + m_params[i].m_receipt = 0; + m_params[i].m_cb = 0; + m_params[i].m_listener = 0; + removed = true; + } + } + return removed; + } + + // Input: caller - Caller to notify listeners. + // Summary: Notifies listeners + void Notify(T caller) + { + for (int i = 0; i < MAXCOUNT; i++) + { + if (m_params[i].m_receipt) + { + (m_params[i].m_listener->*m_params[i].m_cb)(caller); + } + } + } +}; + +#endif // !defined(__XTCALLBACKS_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTCaption.h b/Editor/XT/Include/XTCaption.h new file mode 100644 index 0000000..09e532f --- /dev/null +++ b/Editor/XT/Include/XTCaption.h @@ -0,0 +1,222 @@ +// XTCaption.h : interface for the CXTCaption class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCAPTION_H__) +#define __XTCAPTION_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCaptionButton is a CXTButton derived class. It is used by +// the CXTCaption class to activate a CXTCaptionPopupWnd window. +class _XT_EXT_CLASS CXTCaptionButton : public CXTButton +{ +public: + + // Input: clrFace - An RGB value that represents the button background color. + // clrText - An RGB value that represents the font color. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will set the style for the caption button. + virtual BOOL SetButtonStyle(COLORREF clrFace, COLORREF clrText); + +protected: + + // Input: pDC - A CDC pointer that represents the current device context. + // nState - A UINT value that represents the current state for the button. + // rcItem - A CRect reference that represents the current size for the button. + // Summary: This member function will draw the text for the button, if any. + virtual void DrawButtonText(CDC* pDC, UINT nState, CRect& rcItem); + + // Input: pDC - A CDC pointer that represents the current device context. + // nState - A UINT value that represents the current state for the button. + // rcItem - A CRect reference that represents the current size for the button. + // Summary: This member function draws the icon for the button, if any. + virtual void DrawButtonIcon(CDC* pDC, UINT nState, CRect& rcItem); +}; + +class CXTCaptionPopupWnd; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCaption is a CStatic derived class. It is used to create caption +// or info bars similar to those in Microsoft® Outlook™. +class _XT_EXT_CLASS CXTCaption : public CStatic +{ + DECLARE_DYNAMIC(CXTCaption) + +public: + + // Summary: Constructs a CXTCaption object. + CXTCaption(); + + // Summary: Destroys a CXTCaption object, handles cleanup and de-allocation. + virtual ~CXTCaption(); + +protected: + + int m_nOffset; // Size, in pixels, that the child window should leave for its caption area. + int m_nBorder; // Size, in pixels, for the caption border. + bool m_bUserColors; // true if the user has specified caption colors other than the default. + CWnd* m_pChildWnd; // A CWnd pointer that represents the child window displayed in the popup window. + CWnd* m_pParentView; // A CWnd pointer that represents the child window's parent view. + CWnd* m_pSplitterWnd; // A CWnd pointer that represents the splitter window. It is used to track size changes. + CSize m_sizeIcon; // Width and height of the caption icon area. + CRect m_rcChild; // Size of the child window displayed in the popup. + CRect m_rcParent; // Size of the child's parent view. + CRect m_rcSplitter; // Size of the splitter window. + DWORD m_dwExStyle; // Border style bits, either CPWS_EX_GROOVE_EDGE | CPWS_EX_RAISED_EDGE. + DWORD m_dwTextStyle; // Text style, one of DT_ styles. See CDC::DrawText(...) for more details. + HICON m_hIcon; // User defined icon handle. The default value is NULL. + CString m_strCaption; // Text that will be displayed in the caption. + COLORREF m_clrBorder; // An RGB value that represents the user defined border color. + COLORREF m_clrFace; // An RGB value that represents the user defined background color. + COLORREF m_clrText; // An RGB value that represents the user defined font color. + CImageList m_ilButton; // Image list used to create the close button icon. + CXTCaptionButton m_btnCaption; // Button used to 'tack' the popup window back in place. + CXTCaptionPopupWnd* m_pPopupWnd; // Points to the popup window. + +public: + + // Returns: A reference to a CXTCaptionButton object. + // Summary: Call this member function to get a reference to the caption's close + // / popup button. + CXTCaptionButton& GetCaptionButton(); + + // Input: clrBorder - An RGB value that represents the new border color. + // clrFace - An RGB value that represents the new background color. + // clrText - An RGB value that represents the new font color. + // Summary: This member function will set the caption bar border, background, + // and font colors. + virtual void SetCaptionColors(COLORREF clrBorder, COLORREF clrFace, COLORREF clrText); + + // Input: nBorderSize - Specifies size, in pixels, of the banner border. + // pFont - Specifies the new caption font. + // lpszWindText - NULL terminated string specifying the new caption text. + // hIcon - Handle of the icon to be drawn in the caption. + // Summary: This function will modify the caption style. You can use this + // member function to set the border size that is drawn around the + // caption banner, the font that the caption will use, and the caption text + // and icon to be displayed. + virtual void ModifyCaptionStyle(int nBorderSize, CFont* pFont=NULL, LPCTSTR lpszWindText=NULL, HICON hIcon=NULL); + + // Input: pChild - A CWnd pointer that represents the child window to be displayed in + // the popup window. + // pNotifyWnd - A CWnd pointer that represents the window to receive notification + // messages. + // Summary: Call this member function to set the child and notification windows + // for the caption bar. + virtual void SetChildWindow(CWnd* pChild, CWnd* pNotifyWnd); + + // Summary: This member function is called to destroy the popup window and associated + // children. + virtual void KillChildWindow(); + + // Input: lpszWindowText - NULL terminated string to display in the caption bar. + // hIcon - Handle of the icon to display in the caption bar. It can be NULL. + // Summary: This member function is called to update the text and icon for the + // caption bar. + virtual void UpdateCaption(LPCTSTR lpszWindowText, HICON hIcon); + + // Input: dwStyle - Specifies the method of formatting the text. See CDC::DrawText + // for a detailed listing of available styles. + // Summary: This member function is called to set the formatting style of the + // text that is displayed in the caption bar. + virtual void SetTextStyle(DWORD dwStyle); + + // Returns: A DWORD value that represents the formatting style of the current caption text. + // Summary: This member function is called to retrieve the formatting style of + // the text that is displayed in the caption bar. + virtual DWORD GetTextStyle(); + + // Input: pParentWnd - Specifies the parent window. + // lpszWindowName - Points to a null-terminated character string that contains + // the window name. This will be displayed in the caption area. + // dwExStyle - Specifies caption bar style. Can be either CPWS_EX_RAISED_EDGE + // which will draw a 3D edge around the caption bar, or CPWS_EX_GROOVE_EDGE + // which will draw a sunken edge. + // dwStyle - Specifies the control window style. Apply any combination of + // caption bar styles to the control. + // rect - Specifies the position and size of the caption bar. It can be + // either a RECT structure or a CRect object. + // nID - Specifies the caption bar control ID. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This method creates a caption bar window and attaches it to the + // CXTCaption object. You construct a caption bar in two steps. First, + // call the constructor, which constructs the CXTCaption object. Then + // call Create, which creates the Window's child window and attaches it + // to CXTCaption. Create initializes the window class name and window + // name and registers values for its style, parent, and ID. + virtual BOOL Create(CWnd* pParentWnd, LPCTSTR lpszWindowName, DWORD dwExStyle=CPWS_EX_RAISED_EDGE, DWORD dwStyle=WS_VISIBLE|SS_CENTER|SS_CENTERIMAGE, const CRect& rect=CRect(0,0,0,0), UINT nID = 0xffff); + + // Ignore: + //{{AFX_VIRTUAL(CXTCaption) + //}}AFX_VIRTUAL + +protected: + + // Input: pDC - A CDC pointer that represents the current device context. + // rcItem - A CRect reference that represents the size of the area to paint. + // Summary: This member function is called to draw the caption background. + virtual void DrawCaptionBack(CDC* pDC, CRect& rcItem); + + // Input: pDC - A CDC pointer that represents the current device context. + // rcItem - A CRect reference that represents the size of the area to paint. + // Summary: This member function is called to paint the caption text. + virtual void DrawCaptionText(CDC* pDC, CRect& rcItem); + + // Input: pDC - A CDC pointer that represents the current device context. + // rcItem - A CRect reference that represents the size of the area to paint. + // Summary: This member function is called to paint the caption icon. + virtual void DrawCaptionIcon(CDC* pDC, CRect& rcItem); + + // Input: pDC - A CDC pointer that represents the current device context. + // rcItem - A CRect reference that represents the size of the area to paint. + // Summary: This member function is called to update the caption text. + virtual void UpdateCaptionText(CDC* pDC, CRect& rcItem); + + // Ignore: + //{{AFX_MSG(CXTCaption) + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + afx_msg void OnSysColorChange(); + //}}AFX_MSG + + afx_msg void OnCaptButton(); + afx_msg void OnPushPinButton(); + afx_msg void OnPushPinCancel(); + + DECLARE_MESSAGE_MAP() + + friend class CXTCaptionButton; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTCaption::SetTextStyle(DWORD dwStyle) { + m_dwTextStyle = dwStyle; +} +AFX_INLINE DWORD CXTCaption::GetTextStyle() { + return m_dwTextStyle; +} +AFX_INLINE CXTCaptionButton& CXTCaption::GetCaptionButton() { + ASSERT(::IsWindow(m_btnCaption.m_hWnd)); return m_btnCaption; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTCAPTION_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTCaptionPopupWnd.h b/Editor/XT/Include/XTCaptionPopupWnd.h new file mode 100644 index 0000000..48b0752 --- /dev/null +++ b/Editor/XT/Include/XTCaptionPopupWnd.h @@ -0,0 +1,79 @@ +// XTCaptionPopupWnd.h : interface for the CXTCaptionPopupWnd class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCAPTIONPOPUPWND_H__) +#define __XTCAPTIONPOPUPWND_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCaptionPopupWnd is a CWnd derived class. It is used by the CXTCaption +// class to display a popup child window similar to Outlook™. +class _XT_EXT_CLASS CXTCaptionPopupWnd : public CWnd +{ + DECLARE_DYNAMIC(CXTCaptionPopupWnd) + +public: + + // Summary: Constructs a CXTCaptionPopupWnd object. + CXTCaptionPopupWnd(); + + // Summary: Destroys a CXTCaptionPopupWnd object, handles cleanup and de-allocation. + virtual ~CXTCaptionPopupWnd(); + +protected: + + CWnd* m_pParentWnd; // A CWnd pointer that represents the parent window. + CWnd* m_pChildWnd; // A CWnd pointer that represents the child displayed in the popup. + CWnd* m_pChildParent; // A CWnd pointer that represents the parent of the child window. + CXTButton m_CaptionButton; // Close button associated with the caption. + CXTCaption m_Caption; // Caption that is displayed when the window is active. + CXTIconHandle m_hIconOn; // Handle to a normal button icon. + CXTIconHandle m_hIconOff; // Handle to a pressed button icon. + +public: + + // Input: rect - A CRect reference that represents the size of the popup window. + // pParentWnd - A CWnd pointer that represents the popup window. + // pChildWnd - A CWnd pointer that represents the child to be displayed when + // the window is activated. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is called to create and display the popup + // window. + virtual BOOL Create(const CRect& rect, CWnd* pParentWnd, CWnd* pChildWnd); + + // Ignore: + //{{AFX_VIRTUAL(CXTCaptionPopupWnd) + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTCaptionPopupWnd) + afx_msg void OnDestroy(); + afx_msg void OnCaptButton(); + afx_msg void OnPaint(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTCAPTIONPOPUPWND_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTCheckListBox.h b/Editor/XT/Include/XTCheckListBox.h new file mode 100644 index 0000000..1336b6b --- /dev/null +++ b/Editor/XT/Include/XTCheckListBox.h @@ -0,0 +1,213 @@ +// XTCheckListBox.h : interface for the CXTCheckListBox class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCHECKLISTBOX_H__) +#define __XTCHECKLISTBOX_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// CXTCheckListState - helper class + +class _XT_EXT_CLASS CXTCheckListState : public CNoTrackObject +{ +public: + CXTCheckListState(UINT uBitmapID); + virtual ~CXTCheckListState(); + HBITMAP m_hbitmapCheck; + CSize m_sizeCheck; +}; + +////////////////////////////////////////////////////////////////////// +// Summary: The CXTCheckListBox class is a CXTListBox derived class. It provides +// the functionality of a Windows checklist box. A “checklist box” displays +// a list of items, such as filenames. Each item in the list has a check +// box next to it that the user can check or clear. +// +// CXTCheckListBox is only for owner-drawn controls because the list contains +// more than text strings. At its simplest, a checklist box contains text +// strings and check boxes, but you do not need to have text at all. For +// example, you could have a list of small bitmaps with a check box next +// to each item. +// +// To create your own checklist box, you must derive your own class from +// CXTCheckListBox. To derive your own class, write a constructor for +// the derived class, then call Create. +// +// If your checklist box is a default checklist box (a list of strings +// with the default-sized checkboxes to the left of each), you can use +// the default CXTCheckListBox::DrawItem to draw the checklist box. Otherwise, +// you must override the CListBox::CompareItem function and the +// CXTCheckListBox::DrawItem and CXTCheckListBox::MeasureItem functions. +class _XT_EXT_CLASS CXTCheckListBox : public CXTListBox +{ + DECLARE_DYNAMIC(CXTCheckListBox) + +public: + + // Input: uBitmapID - Resource identifier of the bitmap to use for checkmarks. + // Summary: Constructs a CXTCheckListBox object. + CXTCheckListBox(UINT uBitmapID=XT_IDB_CHECKLISTBOX); + + // Summary: Destroys a CXTCheckListBox object, handles cleanup and de-allocation. + virtual ~CXTCheckListBox(); + +protected: + + int m_cyText; + UINT m_nStyle; + CXTCheckListState m_checkListState; + +public: + + + // Input: dwStyle - Specifies the style of the checklist box. The style must be + // either LBS_OWNERDRAWFIXED (all items in the list are the same height) + // or LBS_OWNERDRAWVARIABLE (items in the list are of varying heights). + // This style can be combined with other list-box styles. + // rect - Specifies the checklist-box size and position. Can be either a + // CRect object or a RECT structure. + // pParentWnd - Specifies the checklist box’s parent window (usually a + // CDialog object). It must not be NULL. + // nID - Specifies the checklist box’s control ID. + // Returns: Nonzero if successful; otherwise 0. + // Summary: Creates the Windows checklist box and attaches it to the CXTListBox object. + virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + + // BULLETED LIST: + + // Input: nStyle - Determines the style of check boxes in the checklist box. Valid styles are: + // [ul] + // [li]BS_CHECKBOX[/li] + // [li]BS_AUTOCHECKBOX[/li] + // [li]BS_AUTO3STATE[/li] + // [li]BS_3STATE[/li] + // [/ul] + // For information on these styles, see Button Styles. + // Summary: Call this function to set the style of check boxes in the checklist box. + void SetCheckStyle(UINT nStyle); + + // Returns: The style of the control’s check boxes. + // Summary: Call this function to get the checklist box’s style. For information on + // possible styles, see SetCheckStyle. + // See Also: SetCheckStyle + UINT GetCheckStyle(); + + // Input: nIndex - Index of the item whose check box is to be set. + // nCheck - State of the check box: 0 for clear, 1 for checked, and 2 for + // indeterminate. + // Summary: Call this function to set the check box of the item specified by nIndex. + void SetCheck(int nIndex, int nCheck); + + // Input: nIndex - Index of the item whose check status is to be retrieved. + // Returns: Zero if the item is not checked, 1 if it is checked, and 2 if it is + // indeterminate. + // Summary: Call this function to determine the check state of an item. + int GetCheck(int nIndex); + + // Input: nIndex - Index of the checklist box item to be enabled. + // bEnabled - Specifies whether the item is enabled or disabled. + // Summary: Call this function to enable or disable a checklist box item. + void Enable(int nIndex, BOOL = TRUE); + + // Input: nIndex - Index of the item. + // Returns: Nonzero if the item is enabled; otherwise 0. + // Summary: Call this function to determine whether an item is enabled. + BOOL IsEnabled(int nIndex); + + // Input: rectItem - The position and size of the list item. + // rectCheckBox - The default position and size of an item's check box. + // Example: The following function overrides the default and puts the check box on the + // right of the item, makes it the same height as the item (minus a pixel + // offset at the top and bottom), and makes it the standard check box width: + //
+    //          CRect CMyCheckListBox::OnGetCheckPosition(CRect rectItem, CRect rectCheckBox)
+    //          {
+    //             CRect rectMyCheckBox;
+    //             rectMyCheckBox.top = rectItem.top -1;
+    //             rectMyCheckBox.bottom = rectItem.bottom -1;
+    //             rectMyCheckBox.right = rectItem.right -1;
+    //             rectMyCheckBox.left = rectItem.right -1 - rectCheckBox.Width();
+    //             return rectMyCheckBox;
+    //          }
+    //          
+ // Returns: The position and size of an item's check box. + // Summary: The framework calls this function to get the position and size of the + // check box in an item. + // + // The default implementation only returns the default position and size + // of the check box (rectCheckBox). By default, a check box is aligned in + // the upper-left corner of an item and is the standard check box size. There + // may be cases where you want the check boxes on the right, or want a larger + // or smaller check box. In these cases, override OnGetCheckPosition to change + // the check box position and size within the item. + virtual CRect OnGetCheckPosition(CRect rectItem, CRect rectCheckBox); + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTCheckListBox) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); + virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*); + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + + virtual int GetFontHeight(); + virtual int PreCompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct); + virtual int CalcMinimumItemHeight(); + virtual int CheckFromPoint(CPoint point, BOOL& bInCheck); + virtual void PreDrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void PreMeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); + virtual void PreDeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct); + virtual void SetSelectionCheck( int nCheck ); + virtual void InvalidateCheck(int nIndex); + virtual void InvalidateItem(int nIndex); + +protected: + + // Ignore: + //{{AFX_MSG(CXTCheckListBox) + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnLBAddString(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnLBFindString(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnLBFindStringExact(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnLBGetItemData(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnLBGetText(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnLBInsertString(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnLBSelectString(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnLBSetItemData(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnLBSetItemHeight(WPARAM wParam, LPARAM lParam); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +AFX_INLINE UINT CXTCheckListBox::GetCheckStyle() { + return m_nStyle; +} + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTCHECKLISTBOX_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTColorDialog.h b/Editor/XT/Include/XTColorDialog.h new file mode 100644 index 0000000..5402081 --- /dev/null +++ b/Editor/XT/Include/XTColorDialog.h @@ -0,0 +1,129 @@ +// XTColorDialog.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCOLORSHEET_H__) +#define __XTCOLORSHEET_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorDialog is a multiple inheritance class derived from CXTDialogState +// and CPropertySheet. It is an Office™ style color dialog and can be used +// as a drop in replacement for the MFC CColorDialog API. +class _XT_EXT_CLASS CXTColorDialog : CXTDialogState, public CPropertySheet +{ + DECLARE_DYNAMIC(CXTColorDialog) + +public: + + // BULLETED LIST: + + // Input: clrNew - An RGB value that represents the new color selection. + // clrCurrent - An RGB value that represents the default color selection. + // dwFlags - Style for color dialog. It can be one of the following: + // [ul] + // [li]CPS_XT_SHOW3DSELECTION Displays the color selection + // box with a 3D raised border.[/li] + // [li]CPS_XT_SHOWHEXVALUE Displays the hex equivalent of + // the selected color.[/li] + // [/ul] + // pWndParent - A pointer to the dialog box’s parent or owner window. + // Summary: Constructs a CXTColorDialog object. + CXTColorDialog(COLORREF clrNew,COLORREF clrCurrent,DWORD dwFlags = 0L,CWnd* pWndParent = NULL); + + // Summary: Destroys a CXTColorDialog object, handles cleanup and de-allocation. + virtual ~CXTColorDialog(); + +protected: + + DWORD m_dwStyle; // Styles for the dialog. + CEdit m_editHex; // Edit window to display the color hex value. + CRect m_rcNew; // Size of the rectangle that represents the new color. + CRect m_rcCurrent; // Size of the rectangle that represents the current color. + COLORREF m_clrNew; // A COLORREF value that contains the RGB information for the new color. + COLORREF m_clrCurrent; // A COLORREF value that contains the RGB information for the current color. + +public: + + // Input: clr - An RGB value that represents the color. + // bNotify - TRUE to notify tab pages of a color change. + // Summary: Call this member function to set the current color selection to the + // color value specified in 'clr'. The dialog box will automatically update + // the user’s selection based on the value of the 'clr' parameter. + void SetNewColor(COLORREF clr, BOOL bNotify=TRUE); + + // Input: clr - An RGB value that represents the color. + // Summary: Call this function to set the new color selection to the color + // value specified in 'clr'. + void SetCurrentColor(COLORREF clr); + + // Returns: A COLORREF value that contains the RGB information for + // the current color specified when the dialog was instantiated. + // Summary: Call this member function to retrieve the information about the current + // color. + COLORREF GetCurrentColor(); + + // Returns: A COLORREF value that contains the RGB information + // for the new color selected in the color dialog box. + // Summary: Call this member function to retrieve the information about the color + // the user selected. + COLORREF GetColor(); + + // Input: strText - A NULL terminated string. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to copy the string specified by 'strText' to the + // Windows clipboard. + BOOL CopyToClipboard(CString strText); + + // Input: clr - An RGB value that represents the color. + // Returns: A CString object. + // Summary: This member function returns a CString object that represents the + // HEX conversion for the specified RGB color. + CString RGBtoHex(COLORREF clr) const; + + // Ignore: + //{{AFX_VIRTUAL(CXTColorDialog) + public: + virtual BOOL OnInitDialog(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTColorDialog) + afx_msg void OnPaint(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE COLORREF CXTColorDialog::GetCurrentColor() { + return m_clrCurrent; +} +AFX_INLINE COLORREF CXTColorDialog::GetColor() { + return m_clrNew; +} + +#define WM_XT_UPDATECOLOR (WM_USER+1024) + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTCOLORSHEET_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTColorPageCustom.h b/Editor/XT/Include/XTColorPageCustom.h new file mode 100644 index 0000000..f8c7af4 --- /dev/null +++ b/Editor/XT/Include/XTColorPageCustom.h @@ -0,0 +1,338 @@ +// XTColorPageCustom.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCOLORCUSTOM_H__) +#define __XTCOLORCUSTOM_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: XT_HAS_FOCUS is an enumeration used by CXTColorBase for determining +// which color window has focus. +typedef enum XT_HAS_FOCUS +{ + none, // Neither color window has focus. + wnd, // Color wheel window has focus. + lum // Lumination window has focus. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorBase is a CStatic derived base class. It is used to create +// custom color selection windows. +class _XT_EXT_CLASS CXTColorBase : public CStatic +{ +public: + + // Summary: Constructs a CXTColorBase object. + CXTColorBase(); + + // Summary: Destroys a CXTColorBase object, handles cleanup and de-allocation. + virtual ~CXTColorBase(); + +protected: + + CDC m_dcPicker; // Background device context. + COLORREF m_clrColor; // An RGB value that represents the color selection. + static XT_HAS_FOCUS m_eHasFocus; // Determines which color has focus. + +protected: + + bool m_bInitControl; // true for initialization. + +public: + + double m_nLum; // Current lumination value. + double m_nSat; // Current saturation value. + double m_nHue; // Current hue value. + CPoint m_ptMousePos; // Current mouse postion relative to the device context. + + // Input: clr - An RGB value that represents the color. + // bUpdate - true to update the cursor position. + // Summary: Call this member function to set the color for the selection window. + virtual void SetColor(COLORREF clr, bool bUpdate=true); + + // Returns: An RGB value that indicates the color selection. + // Summary: Call this member function to return the current color selection. + virtual COLORREF GetColor(); + + // Input: point - Current cursor location relative to the device context. + // bNotify - TRUE to notify the parent of change. + // Summary: Call this member function to update the cursor position. + virtual void UpdateCursorPos(CPoint point, BOOL bNotify=TRUE); + + // Input: color - An RGB value that represents the value to convert to HSL. + // h - Represents the color hue. + // s - Represents the color saturation. + // l - Represents the color lumination. + // Summary: This member function is called to convert an RGB color value to + // an HSL value. + static void RGBtoHSL(COLORREF color, double *h, double *s, double *l ); + + // Input: h - Represents the color hue. + // l - Represents the color lumination. + // s - Represents the color saturation. + // Returns: A COLORREF value. + // Summary: This member function is called to convert an HLS value to an RGB + // color value. + static COLORREF HLStoRGB(double h, double l, double s ); + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTColorBase) + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTColorBase) + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE COLORREF CXTColorBase::GetColor() { + return m_clrColor; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorWnd is a CXTColorBase derived class. It is used to create a +// color selection window. +class _XT_EXT_CLASS CXTColorWnd : public CXTColorBase +{ +public: + + // Summary: Constructs a CXTColorWnd object. + CXTColorWnd(); + + // Summary: Destroys a CXTColorWnd object, handles cleanup and de-allocation. + virtual ~CXTColorWnd(); + +public: + + // Input: clr - An RGB value that represents the color. + // bUpdate - true to update cursor position. + // Summary: Call this member function to set the color for the selection window. + virtual void SetColor(COLORREF clr, bool bUpdate=true); + + // Input: point - Current cursor location relative to the device context. + // bNotify - TRUE to notify the parent of change. + // Summary: Call this member function to update the cursor position. + virtual void UpdateCursorPos(CPoint point, BOOL bNotify=TRUE); + + // Input: pDC - A CDC pointer that represents the current device context. + // Summary: This member function is called to update the cross hair cursor. + void DrawCrossHair(CDC* pDC); + + // Input: h - Represents the new hue value to set. + // Summary: This member function is called to set the hue for the color window. + void SetHue(double h); + + // Input: s - Represents the new saturation value to set. + // Summary: This member function is called to set the saturation for the color + // window. + void SetSaturation(double s); + + // Ignore: + //{{AFX_VIRTUAL(CXTColorWnd) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + //}}AFX_VIRTUAL + +protected: + // Ignore: + //{{AFX_MSG(CXTColorWnd) + afx_msg void OnPaint(); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorLum is a CXTColorBase derived class. It is used to create a +// color luminance selection bar. +class _XT_EXT_CLASS CXTColorLum : public CXTColorBase +{ +public: + + // Summary: Constructs a CXTColorLum object. + CXTColorLum(); + + // Summary: Destroys a CXTColorLum object, handles cleanup and de-allocation. + virtual ~CXTColorLum(); + +protected: + + int m_nSliderPos; // Current location of the slider. + +public: + + // Input: clr - An RGB value that represents the color. + // bUpdate - true to update the cursor position. + // Summary: Call this member function to set the color for the selection window. + virtual void SetColor(COLORREF clr, bool bUpdate=true); + + // Input: point - Current cursor location relative to the device context. + // bNotify - TRUE to notify the parent of change. + // Summary: Call this member function to update the cursor position. + virtual void UpdateCursorPos(CPoint point, BOOL bNotify=TRUE); + + // Input: pDC - A CDC pointer that represents the current device context. + // Summary: This member function is called to draw the indicator arrow. + void DrawSliderArrow(CDC* pDC); + + // Input: pDC - A CDC pointer that represents the current device context. + // Summary: This member function is called to draw the selection bar. + void DrawLuminanceBar(CDC* pDC); + + // Input: l - Represents the new luminance value to set. + // Summary: This member function is called to set the luminance for the color window. + void SetLuminance(double l); + + // Input: rect - Address to a CRect object. + // Summary: This member function is called to get the display size of the luminance + // bar. + void GetLumBarRect(CRect& rect); + + // Ignore: + //{{AFX_VIRTUAL(CXTColorLum) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTColorLum) + afx_msg void OnPaint(); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +// forwards + +class CXTColorDialog; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorPageCustom is a multiple inheritance class derived from CXTDialogState +// and CPropertyPage. It is used to create a CXTColorPageCustom dialog. +class _XT_EXT_CLASS CXTColorPageCustom : CXTDialogState, public CPropertyPage +{ + DECLARE_DYNCREATE(CXTColorPageCustom) + +public: + + // Input: pParentSheet - A pointer to the parent sheet. + // Summary: Constructs a CXTColorPageCustom object. + CXTColorPageCustom(CXTColorDialog* pParentSheet=NULL); + + // Summary: Destroys a CXTColorPageCustom object, handles cleanup and de-allocation. + virtual ~CXTColorPageCustom(); + + //{{AFX_DATA(CXTColorPageCustom) + + enum { IDD = XT_IDD_COLORCUSTOM }; + CXTColorWnd m_colorWnd; + CXTColorLum m_colorLum; + CStatic m_txtSat; + CStatic m_txtRed; + CStatic m_txtLum; + CStatic m_txtHue; + CStatic m_txtGreen; + CStatic m_txtBlue; + CSpinButtonCtrl m_spinSat; + CSpinButtonCtrl m_spinRed; + CSpinButtonCtrl m_spinLum; + CSpinButtonCtrl m_spinHue; + CSpinButtonCtrl m_spinGreen; + CSpinButtonCtrl m_spinBlue; + CXTEdit m_editHue; + CXTEdit m_editGreen; + CXTEdit m_editBlue; + CXTEdit m_editLum; + CXTEdit m_editRed; + CXTEdit m_editSat; + int m_nR; + int m_nB; + int m_nG; + int m_nH; + int m_nL; + int m_nS; + //}}AFX_DATA + +protected: + + CXTColorDialog* m_pParentSheet; // A pointer to the parent sheet. + +public: + + // Input: color - An RGB value that represents the color. + // lum - Address of the integer to receive the lumination value (0-255). + // sat - Address of the integer to receive the saturation value (0-255). + // hue - Address of the integer to receive the hue value (0-255). + // Summary: This member function is called to retrieve the HSL values of the RGB + // specified by color. + void RGBtoHSL(COLORREF color, int* lum, int* sat, int* hue); + + // Ignore: + //{{AFX_VIRTUAL(CXTColorPageCustom) + public: + virtual BOOL OnSetActive(); + protected: + virtual void DoDataExchange(CDataExchange* pDX); + virtual BOOL OnInitDialog(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTColorPageCustom) + afx_msg void OnChangeEdit(); + afx_msg void OnChangeEditLum(); + afx_msg void OnChangeEditHue(); + afx_msg void OnChangeEditSat(); + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + //}}AFX_MSG + + afx_msg LRESULT OnUpdateColor(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTCOLORCUSTOM_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTColorPageStandard.h b/Editor/XT/Include/XTColorPageStandard.h new file mode 100644 index 0000000..ad34163 --- /dev/null +++ b/Editor/XT/Include/XTColorPageStandard.h @@ -0,0 +1,224 @@ +// XTColorPageStandard.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCOLORSTANDARD_H__) +#define __XTCOLORSTANDARD_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: XT_COLORCELL is a stand alone helper structure class. It is used by +// the CXTColorHex class. +struct XT_COLORCELL +{ + int direction[4]; // Array that indicates which cell index is to the left, top, right and bottom of the color cell. + BOOL bSmall; // TRUE if the color cell is a standard selection rectangle. + CPoint* pPoint; // Represents the current cursor position. + COLORREF clr; // An RGB value. +}; + +// Summary: Definition for the color cell array. +typedef CList CCXTColorCell; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorHex is a CStatic derived class. It displays a color selection +// grid used by CXTColorPageStandard. +class _XT_EXT_CLASS CXTColorHex : public CStatic +{ +public: + + // Summary: Constructs a CXTColorHex object. + CXTColorHex(); + + // Summary: Destroys a CXTColorHex object, handles cleanup and de-allocation. + virtual ~CXTColorHex(); + +protected: + + CDC m_dcPicker; // Background device context. + bool m_bInitControl; // true for initialization. + BOOL m_bLBtnDown; // TRUE when the left mouse button is pressed. + BOOL m_bSmallCell; // TRUE when a small color cell is selected. + CPoint m_ptCurrent; // Holds the last known selection point. + COLORREF m_clrColor; // A COLORREF value that contains the RGB information for the current color. + CCXTColorCell m_arCells; // Array of XT_COLORCELL structs that represent displayed color cells. + +public: + + // Input: point - XY location of the color to get RGB information for. + // Summary: Call this member function to retrieve RGB information for the color + // found at the location specified by point. Returns a COLORREF value. + COLORREF ColorFromPoint(CPoint point); + + // Input: clr - An RGB value that represents the color. + // Returns: A pointer to an XT_COLORCELL struct. + // Summary: Call this member function to get a pointer to the XT_COLORCELL struct + // that is represented by 'clr'. + XT_COLORCELL* GetColorCell(COLORREF clr); + + // Input: iIndex - Index into m_arCells list. + // Summary: Call this member function to select the color specified by 'iIndex'. + void SetSelectedColor(int iIndex); + + // Input: clr - An RGB value that represents the color. + // Summary: Call this member function to select the color specified by 'clr'. + void SetSelectedColor(COLORREF clr); + + // Returns: An RGB color value that represents the selected color. + // Summary: Call this member function to return the currently selected color. + COLORREF GetSelectedColor() const; + +protected: + + // Input: pDC - A CDC pointer that represents the current device context. + // point - XY position of the starting point for the first pixel drawn. + // clr - An RGB value that represents the color of the cell to draw. + // l - Index of the cell to be selected when VK_LEFT is pressed. + // u - Index of the cell to be selected when VK_UP is pressed. + // r - Index of the cell to be selected when VK_RIGHT is pressed. + // d - Index of the cell to be selected when VK_DOWN is pressed. + // Summary: This member function is called by the class to draw a single color cell. + void DrawCell(CDC* pDC, CPoint point, COLORREF clr, int l, int u, int r, int d); + + // Input: pDC - A CDC pointer that represents the current device context. + // point - XY position of the starting point for the first pixel drawn. + // clr - An RGB value that represents the color of the cell to draw. + // l - Index of the cell to be selected when VK_LEFT is pressed. + // u - Index of the cell to be selected when VK_UP is pressed. + // r - Index of the cell to be selected when VK_RIGHT is pressed. + // d - Index of the cell to be selected when VK_DOWN is pressed. + // Summary: This member function is called by the class to draw a single large + // color cell. + void DrawLargeCell(CDC* pDC, CPoint point, COLORREF clr, int l, int u, int r, int d); + + // Input: pDC - A CDC pointer that represents the current device context. + // Summary: This member function is called to draw the selection window. + void DrawColorSelector(CDC* pDC); + + // Input: pDC - A CDC pointer that represents the current device context. + // Summary: This member function is called to select a color cell if any are selected. + void DrawSelectCell(CDC* pDC); + + // Input: pDC - A CDC pointer that represents the current device context. + // Summary: This member function is called to select a large color cell if any + // are selected. + void DrawLargeSelectCell(CDC* pDC); + + // Input: point - Current location of the color to select. + // Summary: This member function updates the color selection based on the XY + // coordinates specified by 'point'. + void UpdateSelection(CPoint point); + + // Input: pDC - A CDC pointer that represents the current device context. + // Summary: This member function is called to select a cell when a new selection is made. + void SelectColorCell(CDC* pDC); + + // Ignore: + //{{AFX_VIRTUAL(CXTColorHex) + protected: + virtual void PreSubclassWindow(); + virtual BOOL PreTranslateMessage(MSG* pMsg); + //}}AFX_VIRTUAL + + virtual bool IsValidColor(COLORREF cr) const; + +protected: + + // Ignore: + //{{AFX_MSG(CXTColorHex) + afx_msg void OnPaint(); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE COLORREF CXTColorHex::GetSelectedColor() const { + return m_clrColor; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorPageStandard is a multiple inheritance class derived from +// CXTDialogState and CPropertyPage. It is used to create a CXTColorPageStandard +// dialog. +class _XT_EXT_CLASS CXTColorPageStandard : CXTDialogState, public CPropertyPage +{ + DECLARE_DYNCREATE(CXTColorPageStandard) + +public: + + // Input: pParentSheet - Points to the parent property sheet. + // Summary: Constructs a CXTColorPageStandard object. + CXTColorPageStandard(CXTColorDialog* pParentSheet=NULL); + + // Summary: Destroys a CXTColorPageStandard object, handles cleanup and de-allocation. + virtual ~CXTColorPageStandard(); + + // Input: clr - An RGB value that represents the color. + // Summary: This member function is called to set the selected color for the page. + void SetColor(COLORREF clr); + +protected: + + CXTColorDialog* m_pParentSheet; // Points to the parent property sheet. + + //{{AFX_DATA(CXTColorPageStandard) + + enum { IDD = XT_IDD_COLORSTANDARD }; + CXTColorHex m_colorHex; + //}}AFX_DATA + + // Ignore: + //{{AFX_VIRTUAL(CXTColorPageStandard) + protected: + virtual void DoDataExchange(CDataExchange* pDX); + virtual BOOL OnInitDialog(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTColorPageStandard) + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + //}}AFX_MSG + + afx_msg LRESULT OnUpdateColor(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTColorPageStandard::SetColor(COLORREF clr) { + m_colorHex.SetSelectedColor(clr); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTCOLORSTANDARD_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTColorPicker.h b/Editor/XT/Include/XTColorPicker.h new file mode 100644 index 0000000..ea93696 --- /dev/null +++ b/Editor/XT/Include/XTColorPicker.h @@ -0,0 +1,187 @@ +// XTColorPicker.h : interface for the CXTColorPicker class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCOLORPICKER_H__) +#define __XTCOLORPICKER_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// class forwards + +class CXTColorPopup; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorPicker is a CButton derived class. It displays a color picker +// popup window (CXTColorPopup) for Office™ style color selection. +class _XT_EXT_CLASS CXTColorPicker : public CButton +{ + DECLARE_DYNAMIC(CXTColorPicker) + +public: + + // Summary: Constructs a CXTColorPicker object. + CXTColorPicker(); + + // Summary: Destroys a CXTColorPicker object, handles cleanup and de-allocation. + virtual ~CXTColorPicker(); + +protected: + + BOOL m_bShowText; // TRUE if the color picker displays text. + BOOL m_bColorText; // TRUE if the color picker text is colorized, only valid if m_bShowText is TRUE. + BOOL m_bPopupActive; // TRUE if the popup window is currently active. + bool m_bInitControl; // true for initialization. + DWORD m_dwPopup; // Represents the style for the color picker. + COLORREF m_clrSelected; // An RGB value that represents the color for the display color. + COLORREF m_clrDefault; // An RGB value that represents the color for the default color. + +public: + + // Input: clr - An RGB value that represents the new RGB color for the control. + // Summary: This member function will set the color value for the color picker. + virtual void SetColor(COLORREF clr); + + // Returns: An RGB color value that represents the currently selected color. + // Summary: This member function will return the currently selected color. + virtual COLORREF GetColor() const; + + // Input: bShowText - TRUE to display button text. + // Summary: This member function will display any text associated with the color + // picker button control. If the button has text, then it will be displayed. + virtual void ShowText(BOOL bShowText); + + // Returns: TRUE if the color picker displays text, otherwise returns FALSE. + // Summary: This member function will determine if text is displayed for the color + // picker button control. + virtual BOOL IsTextShown() const; + + // Input: bColorText - TRUE to display the button text in color. + // Summary: This member function will display any text associated with the color picker + // button control in color. + virtual void ShowTextInColor(BOOL bColorText); + + // Returns: TRUE if the button text is in color, otherwise returns FALSE. + // Summary: This member function will determine if the text for the color picker button + // control is displayed in color. + virtual BOOL IsTextInColor() const; + + // Input: clrDefault - An RGB value that represents the default color for the + // color picker. + // Summary: This member function will set the default RGB color value for the + // color picker. + virtual void SetDefaultColor(COLORREF clrDefault); + + // Returns: An RGB value that represents the default color value for the color picker. + // Summary: This member function will return the default RGB color value for + // the color picker. + virtual COLORREF GetDefaultColor() const; + + // BULLETED LIST: + + // Input: dwRemove - Specifies the window styles to be removed during style modification. + // dwAdd - Specifies the window styles to be added during style modification. + // Summary: Call this member function to modify the color picker style. Styles + // to be added or removed can be combined by using the bitwise OR (|) + // operator. It can be one or more of the following: + // [ul] + // [li]CPS_XT_NOFILL The color picker will display a No Fill + // button rather than the default Automatic Color button.[/li] + // [li]CPS_XT_EXTENDED The color picker will display 40 extended + // colors rather than the default 16 colors.[/li] + // [li]CPS_XT_MORECOLORS The color picker will display a More + // Colors button which will display a CXTColorDialog.[/li] + // [li]CPS_XT_SHOW3DSELECTION Displays the color selection + // box with a 3D raised border in CXTColorDialog.[/li] + // [li]CPS_XT_SHOWHEXVALUE Displays the hex equivalent of the + // selected color.[/li] + // [/ul] + virtual void ModifyCPStyle(DWORD dwRemove,DWORD dwAdd); + + // Summary: This member function will activate the color picker and display the + // color popup window. + virtual void ShowPopupWindow(); + +protected: + + // Returns: An RGB value either BLACK or WHITE. + // Summary: This member function is called to return the contrast color for the color + // picker button. The contrast color is used when text is displayed to + // contrast with the currently selected color. For example, if the currently + // selected color is WHITE then BLACK would be returned so the text is legible. + virtual COLORREF GetContrastColor() const; + + // Ignore: + //{{AFX_VIRTUAL(CXTColorPicker) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTColorPicker) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + //}}AFX_MSG + + afx_msg LRESULT OnSelChange(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnDropDown(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnCloseUp(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSelEndOK(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSelEndCancel(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSelNoFill(WPARAM wParam, LPARAM lParam); + afx_msg void OnShowPopup(); + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE COLORREF CXTColorPicker::GetColor() const { + return m_clrSelected; +} +AFX_INLINE void CXTColorPicker::ShowText(BOOL bShowText) { + m_bShowText = bShowText; RedrawWindow(); +} +AFX_INLINE BOOL CXTColorPicker::IsTextShown() const { + return m_bShowText; +} +AFX_INLINE void CXTColorPicker::ShowTextInColor(BOOL bColorText) { + m_bColorText = bColorText; RedrawWindow(); +} +AFX_INLINE BOOL CXTColorPicker::IsTextInColor() const { + return m_bColorText; +} +AFX_INLINE void CXTColorPicker::SetDefaultColor(COLORREF clrDefault) { + m_clrDefault = clrDefault; RedrawWindow(); +} +AFX_INLINE COLORREF CXTColorPicker::GetDefaultColor() const { + return m_clrDefault; +} +AFX_INLINE void CXTColorPicker::ModifyCPStyle(DWORD dwRemove, DWORD dwAdd) { + m_dwPopup &= ~dwRemove; m_dwPopup |= dwAdd; RedrawWindow(); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTCOLORPICKER_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTColorPopup.h b/Editor/XT/Include/XTColorPopup.h new file mode 100644 index 0000000..171dfd7 --- /dev/null +++ b/Editor/XT/Include/XTColorPopup.h @@ -0,0 +1,152 @@ +// XTColorPopup.h : interface for the CXTColorPopup class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCOLORPOPUP_H__) +#define __XTCOLORPOPUP_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorPopup is a CXTColorSelectorCtrl derived class. It is used to create a CXTColorPopup +// window that will allow a user to select colors and add custom colors +// to a color list. +class _XT_EXT_CLASS CXTColorPopup : public CXTColorSelectorCtrl +{ +public: + + // Input: bAutoDelete - TRUE if the color picker window is to be self deleting. + // callerParam - Caller parameter, will be reported back as an LPARAM of + // color popup notification messages. + // Summary: Constructs a CXTColorPopup object. + CXTColorPopup(BOOL bAutoDelete=FALSE, LPARAM callerParam = 0); + + // Summary: Destroys a CXTColorPopup object, handles cleanup and de-allocation. + virtual ~CXTColorPopup(); + +protected: + + BOOL m_bAutoDelete; // TRUE if the popup window is to be self deleting. + BOOL m_bDisplayShadow; // TRUE if the popup window shall render its shadow. + CRect m_rcExclude; // Area to exclude from shadow display. + const LPARAM m_callerParam; // Caller parameter that will be reported back as an LPARAM of all notification messages. + +public: + + // Input: clrColor - An RGB value that represents the user defined color to display in + // the recent color list. + // Summary: This member function will add a color to the user defined color list. + static void AddUserColor(COLORREF clrColor); + + // Summary: Call this member function to reset the user defined color list. Calling + // this function will remove all user defined colors from the MRU list. + static void ResetUserColors(); + + // BULLETED LIST: + + // Input: rect - A reference to a CRect object that represents the + // size of the color popup window. + // pParentWnd - Points to the parent window for the color popup. + // dwPopup - Style for the popup window. Styles can be one or + // more of the following: + // [ul] + // [li]CPS_XT_NOFILL The color picker will display a No Fill + // button rather than the default Automatic Color button.[/li] + // [li]CPS_XT_EXTENDED The color picker will display 40 + // extended colors rather than the default 16 colors.[/li] + // [li]CPS_XT_MORECOLORS The color picker will display + // a More Colors button which will display a CXTColorDialog.[/li] + // [li]CPS_XT_SHOW3DSELECTION Displays the color selection + // box with a 3D raised border in CXTColorDialog.[/li] + // [li]CPS_XT_SHOWHEXVALUE Displays the hex equivalent + // of the selected color.[/li] + // [/ul] + // clrColor - An RGB value that represents the currently selected color for the + // popup window. + // clrDefault - Specifies the default color for the color popup. If the + // current style includes CPS_NOFILL this parameter is ignored. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function handles the creation of the color popup window. + virtual BOOL Create(CRect& rect,CWnd* pParentWnd,DWORD dwPopup,COLORREF clrColor,COLORREF clrDefault=CLR_DEFAULT); + + // Input: hwndListener - A handle to the listener window. Messages will be sent to it. + // Summary: This member function adds a window to send color picker notifications to. + void AddListener(HWND hwndListener); + + // Input: bDisplayShadow - Flag that tells if the shadow is to be displayed. + // Summary: This member function enables or disables the drawing of popup shadows. + // Call this function after instantiating the color popup as a part of an + // object's initialization. Do not call it after popup creation since + // doing so may cause unpredictable results. + void DisplayShadow(BOOL bDisplayShadow = TRUE); + +protected: + + // Input: nCurSel - Current index of the selected color box or button + // in the color popup window. + // Summary: This member function will finish the selection process for the color + // box or button in the color popup window. + virtual void EndSelection(int nCurSel); + + // Ignore: + //{{AFX_VIRTUAL(CXTColorPopup) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual void PostNcDestroy(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTColorPopup) + afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); + afx_msg void OnDestroy(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnPaint(); + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnNcPaint(); + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); + //}}AFX_MSG + +public: +#if _MFC_VER >= 0x0700 //MFC 7.0 + afx_msg void OnActivateApp(BOOL bActive, DWORD dwThreadID); +#else + afx_msg void OnActivateApp(BOOL bActive, HTASK hTask); +#endif //MFC 7.0 + + DECLARE_MESSAGE_MAP() + +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTColorPopup::AddUserColor(COLORREF clrColor) { + m_arUserDefColors.Add( clrColor ); +} +AFX_INLINE void CXTColorPopup::ResetUserColors() { + m_arUserDefColors.RemoveAll(); +} +AFX_INLINE void CXTColorPopup::DisplayShadow( BOOL bDisplayShadow/* = TRUE*/) { + m_bDisplayShadow = bDisplayShadow; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_COLORPOPUP_H__C0330BB1_9A77_4EE4_9F15_00ECAFC5FFC9__INCLUDED_) \ No newline at end of file diff --git a/Editor/XT/Include/XTColorRef.h b/Editor/XT/Include/XTColorRef.h new file mode 100644 index 0000000..b750b30 --- /dev/null +++ b/Editor/XT/Include/XTColorRef.h @@ -0,0 +1,476 @@ +// XTColorRef.h: interface for the CXTColorRef class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCOLORREF_H__) +#define __XTCOLORREF_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorRef is a stand alone class. It is used to create a +// CXTColorRef object. This object is used for manipulation of RGB values. +class _XT_EXT_CLASS CXTColorRef +{ +public: + + // Summary: Constructs a CXTColorRef object. + CXTColorRef(); + + // Input: r - An RGB value. + // Summary: Constructs a CXTColorRef object. + CXTColorRef(COLORREF r); + + // Input: r - Specifies the intensity of the red color component. 'r' can range + // from 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // g - Specifies the intensity of the green color component. 'g' can range + // from 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // b - Specifies the intensity of the blue color component. 'b' can range + // from 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Summary: Constructs a CXTColorRef object. + CXTColorRef(int r, int g, int b); + + // Input: cr - An RGB value. + // Returns: A reference to a valid CXTColorRef object. + // Summary: This assignment operator is used to initialize a CXTColorRef object. + CXTColorRef& operator = (COLORREF cr); + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Returns: A CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef operator + (int val) const; + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Returns: A CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef operator - (int val) const; + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Returns: A CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef operator * (int val) const; + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Returns: A CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef operator / (int val) const; + + // Input: cr - An RGB value. + // Returns: A CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef operator + (COLORREF cr) const; + + // Input: cr - An RGB value. + // Returns: A CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef operator - (COLORREF cr) const; + + // Input: cr - An RGB value. + // Returns: A CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef operator * (COLORREF cr) const; + + // Input: cr - An RGB value. + // Returns: A CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef operator / (COLORREF cr) const; + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Returns: A reference to a valid CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef& operator += (int val); + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Returns: A reference to a valid CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef& operator -= (int val); + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Returns: A reference to a valid CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef& operator *= (int val); + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Returns: A reference to a valid CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef& operator /= (int val); + + // Input: cr - An RGB value. + // Returns: A reference to a valid CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef& operator += (COLORREF cr); + + // Input: cr - An RGB value. + // Returns: A reference to a valid CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef& operator -= (COLORREF cr); + + // Input: cr - An RGB value. + // Returns: A reference to a valid CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef& operator *= (COLORREF cr); + + // Input: cr - An RGB value. + // Returns: A reference to a valid CXTColorRef object. + // Summary: This assignment operator is used to modify a CXTColorRef object. + CXTColorRef& operator /= (COLORREF cr); + + // Returns: An RGB value. + // Summary: This operator retrieves the RGB value for the CXTColorRef object. + operator COLORREF () const; + + ////////////////////////////////////////////////////////////// + // RGB Values + ////////////////////////////////////////////////////////////// + + // Returns: The red component of the color. + // Summary: This method gets the red component of this object. + int getRValue() const; + + // Returns: The green component of the color. + // Summary: This method gets the green component of this object. + int getGValue() const; + + // Returns: The blue component of the color. + // Summary: This method gets the blue component of this object. + int getBValue() const; + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Summary: Call this member function to set the red intensity value for the CXTColorRef + // object. + void setRValue(int val); + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Summary: Call this member function to set the green intensity value for the + // CXTColorRef object. + void setGValue(int val); + + // Input: val - Specifies the intensity of the color component. 'val' can range from + // 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Summary: Call this member function to set the blue intensity value for the CXTColorRef + // object. + void setBValue(int val); + + ////////////////////////////////////////////////////////////// + // Misc Information + ////////////////////////////////////////////////////////////// + + // Returns: A double that represents the current color intensity. + // Summary: This member function will retrieve the overall intensity of the + // CXTColorRef object. + double getIntensity() const; + + ////////////////////////////////////////////////////////////// + // Color Conversion + ////////////////////////////////////////////////////////////// + + // Input: h - The variable to receive the hue value. + // s - The variable to receive the saturation value. + // l - The variable to receive the luminance value. + // Summary: This function converts the RGB color to an HSL (hue, saturation, + // luminance) trio. + void toHSL(double& h, double& s, double& l) const; + + // Input: h - The variable to receive the hue value. + // s - The variable to receive the saturation value. + // b - The variable to receive the brightness value. + // Summary: This function converts the RGB color to an HSB (hue, saturation, + // brightness) trio. + void toHSB(double& h, double& s, double& b) const; + + // Input: h - The hue of the source color. + // s - The saturation of the source color. + // l - The luminance of the source color. + // Summary: This function sets an RGB value that is the equivalent of a specific + // HSL (hue, saturation, luminance) color. + void setHSL(double h, double s, double l); + + // Input: h - The hue of the source color. + // s - The saturation of the source color. + // b - The brightness of the source color. + // Summary: This function sets an RGB value that is the equivalent of a specific + // HSB (hue, saturation, brightness) color. + void setHSB(double h, double s, double b); + + // Input: h - The hue of the source color. + // s - The saturation of the source color. + // l - The luminance of the source color. + // Summary: This static function creates a new CXTColorRef object out of an HSL + // (hue, saturation, luminance) color trio. Returns a CXTColorRef object. + static CXTColorRef fromHSL(double h, double s, double l); + + // Input: h - The hue of the source color. + // s - The saturation of the source color. + // b - The brightness of the source color. + // Summary: This static function creates a new CXTColorRef object out of an HSB + // (hue, saturation, brightness) color trio. Returns a CXTColorRef object. + static CXTColorRef fromHSB(double h, double s, double b); + + ////////////////////////////////////////////////////////////////////// + // Color Manipulation + ////////////////////////////////////////////////////////////////////// + + // Input: clr - A reference to a valid CXTColorRef object. + // opacity - The amount of transparency. + // Returns: A reference to a valid CXTColorRef object. + // Summary: Call this member function to blend the CXTColorRef object with the + // object specified by 'clr'. + CXTColorRef& blend(const CXTColorRef& clr, int opacity); + + // Input: clr - A reference to a valid CXTColorRef object. + // Returns: A reference to a valid CXTColorRef object. + // Summary: Call this member function to add the CXTColorRef object specified by 'clr'. + CXTColorRef& add(const CXTColorRef& clr); + + // Input: clr - A reference to a valid CXTColorRef object. + // Returns: A reference to a valid CXTColorRef object. + // Summary: Call this member function to subtract the CXTColorRef object specified + // by 'clr'. + CXTColorRef& subtract(const CXTColorRef& clr); + + ////////////////////////////////////////////////////////////////////// + // Standard Colors + ////////////////////////////////////////////////////////////////////// + + static const CXTColorRef BLACK; // RGB value that represents the color black. + static const CXTColorRef WHITE; // RGB value that represents the color white. + static const CXTColorRef GRAY_25; // RGB value that represents the 25% gray color. + static const CXTColorRef GRAY_50; // RGB value that represents the 50% gray color. + static const CXTColorRef GRAY_75; // RGB value that represents the 75% gray color. + + ////////////////////////////////////////////////////////////////////// + // Helper Functions + ////////////////////////////////////////////////////////////////////// + + // Input: iVal - Specifies the color intensity which is the source of + // the operation. + // iAdd - Specifies the intensity to add to the source. It can be + // negative. + // Summary: This member function adds two color intensities, ensuring that the + // sum is in the proper color value range (0-255). For example, + // addColorValue(200, 100) will return 255 and not 300. + // addColorValue(100, -200) will return 0. + static inline int addColorValue(int iVal, int iAdd); + + // Input: iVal - Specifies the color intensity which is the source of the operation. + // iMult - Specifies a value by which to multiply the source. + // iDiv - Specifies a value by which to divide the source. + // Summary: This member function manipulates a color value by performing a + // multiplication and then a division. For instance, + // multiplyColorValue(10, 2, 3) will return 10 * 2 / 3 which is 6. + // The function guarantees that the resulting value does not exceeded 255. + static inline int multiplyColorValue(int iVal, int iMult, int iDiv); + + // Input: iClrFront - Specifies the intensity of the foreground color component. + // 'iClrFront' can range from 0 to 255. Zero is the minimum color intensity; + // 255 is the maximum color intensity. + // iClrBack - Specifies the intensity of the background color component. + // 'iClrBack' can range from 0 to 255. Zero is the minimum color intensity; + // 255 is the maximum color intensity. + // opacity - The amount of transparency. + // Summary: This function takes a blended color intensity which is (100-opacity)% + // * iClrFront and opacity% * iClrBack. + static inline int BlendColor(int iClrFront, int iClrBack, int opacity); + + // Input: iVal - Specifies the intensity of the color component. 'iVal' can range + // from 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Summary: This function takes in a color intensity and ensures that it is between + // 0-255. Anything out of range will be adjusted to the closest number + // in range (i.e. -100 will become 0, 300 will become 255). + static int fixColorValue(int iVal); + + // Summary: This function will refresh the display element colors defined in the + // CXTColorRef object. + static void RefreshColors(); + + // BULLETED LIST: + + // Input: nIndex - Specifies the display element whose color is to be retrieved. + // This parameter can be one of the following values: + // [ul] + // [li]XPCOLOR_BASE An RGB value that represents the XP base color.[/li] + // [li]XPCOLOR_BARFACE An RGB value that represents the XP toolbar + // background color.[/li] + // [li]XPCOLOR_HIGHLIGHT An RGB value that represents the XP menu item + // selected color.[/li] + // [li]XPCOLOR_HIGHLIGHT_BORDER An RGB value that represents the XP menu + // item selected border color.[/li] + // [li]XPCOLOR_HIGHLIGHT_PUSHED An RGB value that represents the XP menu + // item pushed color.[/li] + // [li]XPCOLOR_ICONSHADDOW An RGB value that represents the XP menu item + // icon shadow.[/li] + // [li]XPCOLOR_GRAYTEXT An RGB value that represents the XP menu item + // disabled text color.[/li] + // [li]XPCOLOR_HIGHLIGHT_CHECKED An RGB value that represents the XP menu + // item checked color.[/li] + // [li]XPCOLOR_HIGHLIGHT_CHECKED_BORDER An RGB value that represents the + // XP menu item checked border color.[/li] + // [li]XPCOLOR_GRIPPER An RGB value that represents the XP toolbar gripper + // color.[/li] + // [li]XPCOLOR_SEPARATOR An RGB value that represents the XP toolbar + // separator color.[/li] + // [li]XPCOLOR_DISABLED An RGB value that represents the XP menu icon + // disabled color.[/li] + // [li]XPCOLOR_MENUTEXT_BACK An RGB value that represents the XP menu + // item text background color.[/li] + // [li]XPCOLOR_MENU_EXPANDED An RGB value that represents the XP hidden + // menu commands background color.[/li] + // [li]XPCOLOR_MENU_BORDER An RGB value that represents the XP menu + // border color.[/li] + // [li]XPCOLOR_MENUTEXT An RGB value that represents the XP menu item + // text color.[/li] + // [li]XPCOLOR_HIGHLIGHT_TEXT An RGB value that represents the XP menu + // item selected text color.[/li] + // [li]XPCOLOR_BARTEXT An RGB value that represents the XP toolbar text + // color.[/li] + // [li]XPCOLOR_BARTEXT_PUSHED An RGB value that represents the XP toolbar + // pushed text color.[/li] + // [li]XPCOLOR_TAB_INACTIVE_BACK An RGB value that represents the XP + // inactive tab background color.[/li] + // [li]XPCOLOR_TAB_INACTIVE_TEXT An RGB value that represents the XP + // inactive tab text color.[/li] + // [/ul] + // Returns: The red, green, blue (RGB) color value of the given element. + // Summary: This function retrieves the current color of the specified xp display + // element. Display elements are the parts of a window and the display that + // appear on the system display screen. + static COLORREF GetColor(int nIndex); + +protected: + + COLORREF m_ColorRef; // Current RGB value for this object. + + // Input: temp1 - Temp value. + // temp2 - Temp value. + // temp3 - Temp value. + // Returns: A double that represents either an r, g, or b COLORREF value. + // Summary: This member function is called by setHSL() to convert hue. + static double HuetoRGB(double temp1, double temp2, double temp3); + + // Input: r - Specifies the intensity of the red color component. 'r' can range + // from 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // g - Specifies the intensity of the green color component. 'g' can range + // from 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // b - Specifies the intensity of the blue color component. 'b' can range + // from 0 to 255. Zero is the minimum color intensity; 255 is the maximum + // color intensity. + // Returns: An RGB value. + // Summary: This function takes in a color intensity and ensures that it is between + // 0-255. Anything out of range will be adjusted to the closest number + // in range (i.e. -100 will become 0, 300 will become 255). + static COLORREF SafeRGB(int r, int g, int b); + +////////////////////////////////////////////////////////////////////// +// XP Color Functions +////////////////////////////////////////////////////////////////////// + +private: + static COLORREF m_arrColor[50]; + + static void RefreshSysColors(); + static void RefreshXPColors(); + + static float ColorWidth(int nLength, int nWidth); + static float ColorDelta(COLORREF clrA, COLORREF clrB); + static float Length(COLORREF clrA, COLORREF clrB); + static BOOL LongColor(COLORREF clrMain, COLORREF clrSub, BOOL bCalcLength, float fDistance); + static COLORREF MixColor(COLORREF clrMain, COLORREF clrSub, float fDistance); + static COLORREF AdjustColor(COLORREF clrMain, COLORREF clrSub, float fDistance); + static COLORREF LightColor(COLORREF clrLight, COLORREF clrDark, int nDelta); + + static double GetRDelta(COLORREF clr) { return GetRValue(clr) * (195.0/255.0); }; + static double GetGDelta(COLORREF clr) { return GetGValue(clr) * (390.0/255.0); }; + static double GetBDelta(COLORREF clr) { return GetBValue(clr) * (65.0/255.0); }; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTColorRef::CXTColorRef() { +} +AFX_INLINE CXTColorRef::CXTColorRef(COLORREF r) { + *this = r; +} +AFX_INLINE CXTColorRef::CXTColorRef(int r, int g, int b) { + *this = RGB(r, g, b); +} +AFX_INLINE CXTColorRef& CXTColorRef::operator = (COLORREF cr) { + m_ColorRef = cr; return *this; +} +AFX_INLINE CXTColorRef::operator COLORREF () const { + return m_ColorRef; +} +AFX_INLINE int CXTColorRef::getRValue() const { + return GetRValue(m_ColorRef); +} +AFX_INLINE int CXTColorRef::getGValue() const { + return GetGValue(m_ColorRef); +} +AFX_INLINE int CXTColorRef::getBValue() const { + return GetBValue(m_ColorRef); +} +AFX_INLINE void CXTColorRef::setRValue(int val) { + m_ColorRef = RGB(val, getGValue(), getBValue()); +} +AFX_INLINE void CXTColorRef::setGValue(int val) { + m_ColorRef = RGB(getRValue(), val, getBValue()); +} +AFX_INLINE void CXTColorRef::setBValue(int val) { + m_ColorRef = RGB(getRValue(), getGValue(), val); +} +AFX_INLINE double CXTColorRef::getIntensity() const { + return ((299 * getRValue()) + (587 * getGValue()) + (114 * getBValue())) / 1000.0; +} +AFX_INLINE int CXTColorRef::addColorValue(int iVal, int iAdd) { + return fixColorValue(iVal + iAdd); +} +AFX_INLINE int CXTColorRef::multiplyColorValue(int iVal, int iMult, int iDiv) { + return fixColorValue(iVal * iMult / iDiv); +} +AFX_INLINE int CXTColorRef::BlendColor(int iClrFront, int iClrBack, int opacity) { + return fixColorValue(((iClrFront * opacity) + (iClrBack * (100 - opacity))) / 100); +} +AFX_INLINE int CXTColorRef::fixColorValue(int iVal) { + if (iVal > 255) return 255; if (iVal < 0) return 0; return iVal; +} + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTCOLORREF_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTColorSelectorCtrl.h b/Editor/XT/Include/XTColorSelectorCtrl.h new file mode 100644 index 0000000..fc732e3 --- /dev/null +++ b/Editor/XT/Include/XTColorSelectorCtrl.h @@ -0,0 +1,208 @@ +// XTColorSelectorCtrl.h : interface for the CXTColorSelectorCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCOLORCTRL_H__) +#define __XTCOLORCTRL_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: XT_COLOR_CELL is a stand alone helper structure class. It is used by +// the CXTColorSelectorCtrl class. +struct XT_COLOR_CELL +{ + UINT nID; // Command ID of the color cell. + UINT nIndex; // Index of the color cell. + bool bChecked; // true if the cell is checked. + CRect rect; // Size of the color cell. + DWORD dwStyle; // Windows style for the cell. + TCHAR szText[256]; // Tooltip text displayed for the color cell. + COLORREF clr; // An RGB value that represents the color of the cell. +}; + +// Summary: CList definition for the color cell structure array. +typedef CList CXTColorCellArray; + +// Summary: Array of listener windows to send notifications to. +typedef CArray CXTListenerArray; + +///////////////////////////////////////////////////////////////////////////// +// Summary: CXTColorSelectorCtrl is a CWnd derived class. It is used to create a CXTColorSelectorCtrl +// control that will allow a user to select colors. +class _XT_EXT_CLASS CXTColorSelectorCtrl : public CWnd +{ + +public: + + // Summary: Constructs a CXTColorSelectorCtrl object. + CXTColorSelectorCtrl(); + + // Summary: Destroys a CXTColorSelectorCtrl object, handles cleanup and de-allocation. + virtual ~CXTColorSelectorCtrl(); + +protected: + + int m_nRows; // Number of rows in the color popup window. + int m_nCols; // Number of columns in the color popup window. + int m_nLastIndex; // Index of the last button on the popup window. + int m_nBtnCount; // Number of buttons in this window. + int m_nCurSel; // Currently selected index. + int m_nPressed; // Pressed button. + BOOL m_bColorDlg; // TRUE if the color dialog is open. + CWnd* m_pParentWnd; // Points to the parent window for the popup window. + CSize m_sizeButton; // cx and cy size for a color picker button. + CRect m_rcWnd; // Rect for the popup window. + CRect m_rcBorders; // Control borders + DWORD m_dwPopup; // Color popup window style. + CPoint m_point; // Last known cursor position. + COLORREF m_clrColor; // An RGB value that represents the currently selected color. + COLORREF m_clrDefault; // An RGB value that represents the default color for the popup window. + CToolTipCtrl m_tooltip; // Tooltip control. + CXTListenerArray m_listeners; // Array of listener windows to be sent notifications. + CXTColorCellArray m_arCells; // Array of color items. + static CUIntArray m_arUserDefColors; // Array of user defined colors. + +public: + + // Input: pColorCell - Receives a pointer to the currently selected button. + // Returns: The zero (0) based index of the currently selected button. + // Summary: This member function will return the index of the currently selected + // color and will initialize 'pColorCell' struct. + int GetCurSel(XT_COLOR_CELL* pColorCell); + + // Input: nIndex - An integer value that represents the zero (0) based + // index of the button to be selected. + // Summary: This member function will select a button based upon its index. + void SetCurSel(int nIndex); + + // BULLETED LIST: + + // Input: rect - A reference to a CRect object that represents the + // size of the color popup window. + // pParentWnd - Points to the parent window for the color popup. + // dwPopup - Style for the popup window. Styles can be one or + // more of the following: + // [ul] + // [li]CPS_XT_NOFILL The color picker will display a No Fill + // button rather than the default Automatic Color button.[/li] + // [li]CPS_XT_EXTENDED The color picker will display 40 + // extended colors rather than the default 16 colors.[/li] + // [li]CPS_XT_MORECOLORS The color picker will display + // a More Colors button which will display a CXTColorDialog.[/li] + // [li]CPS_XT_SHOW3DSELECTION Displays the color selection + // box with a 3D raised border in CXTColorDialog.[/li] + // [li]CPS_XT_SHOWHEXVALUE Displays the hex equivalent + // of the selected color.[/li] + // [/ul] + // clrColor - An RGB value that represents the currently selected color for the + // popup window. + // clrDefault - Specifies the default color for the color popup. If the + // current style includes CPS_NOFILL this parameter is + // ignored. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function handles the creation of the color popup window. + BOOL Create(CRect rect,CWnd* pParentWnd,DWORD dwPopup,COLORREF clrColor,COLORREF clrDefault=CLR_DEFAULT); + + // Input: hwndListener - A handle to the listener window. Messages will be + // sent to it. + // Summary: This member function adds a window to send color picker notifications to. + void AddListener(HWND hwndListener); + + // Input: hwndListener - A handle to the listener window to remove. + // Summary: This member function remove a window from notification list. + void RemoveListener(HWND hwndListener); + + // Input: pColorCell - Points to an XT_COLOR_CELL object. + // Summary: This member function is called to select a color cell. + void SelectColorCell(XT_COLOR_CELL* pColorCell); + + // Input: clr - Color of selected cell. + // Summary: This member function is called to select a color cell. + void SelectColor(COLORREF clr); + + // Input: iIndex - Index into the color cell array. + // Returns: An XT_COLOR_CELL object. + // Summary: This member function is called to return an XT_COLOR_CELL struct + // from the color cell array. + XT_COLOR_CELL* GetCellFromIndex(int iIndex); + + // Input: cxLeft - Specifies the left position. + // cyTop - Specifies the top. + // cxRight - Specifies the right. + // cyBottom - Specifies the bottom. + // Summary: This member function is called to set the size of the borders + // for the control. + void SetBorders(int cxLeft = 0, int cyTop = 0, int cxRight = 0, int cyBottom = 0); + +protected: + + // Input: pDC - A CDC pointer that represents the current device context. + // Summary: This member function is called to draw the color selector. + void DrawColorSelector(CDC* pDC); + + // Input: pColorCell - An XT_COLOR_CELL object. + // pDC - A CDC pointer that represents the current device context. + // bHilite - TRUE to highlight the color cell. + // bPressed - TRUE to press the color cell. + // Summary: This member function is called to draw the cell specified by 'pColorCell'. + void DrawColorCell(XT_COLOR_CELL* pColorCell, CDC* pDC, BOOL bHilite, BOOL bPressed); + + // Input: nCurSel - Current index of the selected color box or button + // in the color popup window. + // Summary: This member function will finish the selection process for the color + // box or button in the color popup window. + virtual void EndSelection(int nCurSel); + + // Ignore: + //{{AFX_VIRTUAL(CXTColorSelectorCtrl) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + //}}AFX_VIRTUAL + + void _EndSelection(int nCurSel, LPARAM callerParam); + +protected: + // Ignore: + //{{AFX_MSG(CXTColorSelectorCtrl) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnPaint(); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnMouseLeave(); + afx_msg UINT OnNcHitTest(CPoint point); + //}}AFX_MSG + + friend class CXTPopupColorTearOff; + + DECLARE_MESSAGE_MAP() + +}; + +///////////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTColorSelectorCtrl::SetBorders(int cxLeft, int cyTop, int cxRight, int cyBottom) { + m_rcBorders.left = cxLeft; m_rcBorders.top = cyTop; m_rcBorders.right = cxRight; m_rcBorders.bottom = cyBottom; +} + +////////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif //__XTCOLORCTRL_H__ diff --git a/Editor/XT/Include/XTComboBoxEx.h b/Editor/XT/Include/XTComboBoxEx.h new file mode 100644 index 0000000..25f3c8f --- /dev/null +++ b/Editor/XT/Include/XTComboBoxEx.h @@ -0,0 +1,215 @@ +// XTComboBoxEx.h : interface for the CXTComboBoxEx class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCOMBOBOXEX_H__) +#define __XTCOMBOBOXEX_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: The CXTComboBoxEx class is a CComboBox derived class. It extends the +// combo box control by providing support for image lists. By using CXTComboBoxEx +// to create combo box controls, you no longer need to implement your own +// image drawing code. Instead, use CXTComboBoxEx to access images from +// an image list. +class _XT_EXT_CLASS CXTComboBoxEx : public CComboBox +{ + DECLARE_DYNAMIC(CXTComboBoxEx) + +public: + + // Summary: Constructs a CXTComboBoxEx object. + CXTComboBoxEx(); + + // Summary: Destroys a CXTComboBoxEx object, handles cleanup and de-allocation. + virtual ~CXTComboBoxEx(); + + // Input: dwStyle - Specifies the combination of combo box styles applied to the + // combo box. + // rect - A reference to a CRect object or RECT structure that specifies + // the position and size of the combo box. + // pParentWnd - A pointer to a CWnd object that is the parent window of the + // combo box (usually a CDialog). It must not be NULL. + // nID - Specifies the combo box’s control ID. + // Returns: Nonzero if the operation was successful, otherwise returns zero. + // Summary: This member function creates the combo box and attaches it to the + // CXTComboBoxEx object. + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +#if _MFC_VER >= 0x0700 //MFC 7.0 + using CComboBox::DeleteItem; +#endif //MFC 7.0 + + // Input: iIndex - Zero-based index of the item to be removed. + // Returns: The number of items remaining in the control. If 'iIndex' is + // invalid, the function returns CB_ERR. + // Summary: This member function removes an item from a ComboBoxEx control. + int DeleteItem(int iIndex); + + // Input: pCBItem - A pointer to a COMBOBOXEXITEM structure that will receive the + // item information. + // Returns: Nonzero if the operation was successful, otherwise returns zero. + // Summary: This member function retrieves item information for a given ComboBoxEx item. + BOOL GetItem(COMBOBOXEXITEM* pCBItem); + + // Input: pCBItem - A pointer to a COMBOBOXEXITEM structure that will receive the + // item information. This structure contains callback flag values for the item. + // Returns: The index at which the new item was inserted if successful, + // otherwise returns -1. + // Summary: This member function inserts a new item in a ComboBoxEx control. + int InsertItem(const COMBOBOXEXITEM* pCBItem); + + // Input: iItem - Item index. + // nStringID - String resource. + // iIndent - Amount, in pixels, image is to be indented. + // iImage - Image index. + // iSelectedImage - Selected image index. + // mask - Style mask. + // Returns: The index at which the new item was inserted if successful, + // otherwise returns -1. + // Summary: This member function inserts a new item in a ComboBoxEx control. + int InsertItem(int iItem, UINT nStringID, int iIndent=0, int iImage=0, int iSelectedImage=0, UINT mask=CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT); + + // Input: iItem - Item index. + // lpszItem - Item string. + // iIndent - Amount, in pixels, image is to be indented. + // iImage - Image index. + // iSelectedImage - Selected image index. + // mask - Style mask. + // Returns: The index at which the new item was inserted if successful, + // otherwise returns -1. + // Summary: This member function inserts a new item in a ComboBoxEx control. + int InsertItem(int iItem, LPCTSTR lpszItem, int iIndent=0, int iImage=0, int iSelectedImage=0, UINT mask=CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT); + + // Input: pCBItem - A pointer to a COMBOBOXEXITEM structure that will receive the + // item information. + // Returns: Nonzero if the operation was successful, otherwise returns zero. + // Summary: This member function sets the attributes for an item in a ComboBoxEx control. + BOOL SetItem(const COMBOBOXEXITEM* pCBItem); + + // Returns: The DWORD value that contains the extended styles that are used for + // the combo box control. + // Summary: This member function retrieves the extended styles control. + DWORD GetExtendedStyle() const; + + // Input: dwExMask - A DWORD value that indicates which styles in 'dwExStyles' are + // to be affected. Only the extended styles in 'dwExMask' will be changed. + // All other styles will be maintained as is. If this parameter is zero, + // then all of the styles in 'dwExStyles' will be affected. + // dwExStyles - A DWORD value that contains the combo box control extended styles + // to set for the control. + // Summary: This member function sets extended styles within a combo box control. + // Returns: A DWORD value that contains the extended styles previously + // used for the control. + DWORD SetExtendedStyle(DWORD dwExMask, DWORD dwExStyles); + + // Returns: Nonzero if the user has typed in the control's edit box, otherwise + // returns zero. + // Summary: This member function is used to determine if the text in the combo + // has changed by typing. + BOOL HasEditChanged(); + + // Returns: A pointer to a CEdit object. + // Summary: Call this member function to get a pointer to the edit control for + // a combo box. + CEdit* GetEditCtrl(); + + // Returns: A pointer to a CComboBox object. + // Summary: Call this member function to get a pointer to a combo box control + // within a CXTComboBoxEx object. + CComboBox* GetComboBoxCtrl(); + + // Returns: A pointer to a CImageList object. If it fails, this member function + // returns NULL. + // Summary: Call this member function to retrieve a pointer to the image list + // used by a CXTComboBoxEx control. + CImageList* GetImageList() const; + + // Input: pImageList - A pointer to a CImageList object containing the images to use + // with the CXTComboBoxEx control. + // Returns: A pointer to a CImageList object containing the images previously used by + // the CXTComboBoxEx control. Returns NULL if no image list was previously set. + // Summary: Sets an image list for a ComboBoxEx control. + CImageList* SetImageList(CImageList* pImageList); + + // Un-supported base class message. + int Dir(UINT attr, LPCTSTR lpszWildCard); + + // Un-supported base class message. + int FindString(int nIndexStart, LPCTSTR lpszFind) const; + + // Un-supported base class message. + int AddString(LPCTSTR lpszString); + + // Un-supported base class message. + BOOL SetEditSel(int nStartChar, int nEndChar); + + // Un-supported base class message. + int InsertString(int nIndex, LPCTSTR lpszString); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTComboBoxEx::CXTComboBoxEx() { + +} +AFX_INLINE DWORD CXTComboBoxEx::GetExtendedStyle() const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, CBEM_GETEXTENDEDSTYLE, 0, 0); +} +AFX_INLINE DWORD CXTComboBoxEx::SetExtendedStyle(DWORD dwExMask, DWORD dwExStyles) { + ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, CBEM_SETEXTENDEDSTYLE, (DWORD) dwExMask, (LPARAM) dwExStyles); +} +AFX_INLINE BOOL CXTComboBoxEx::HasEditChanged() { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, CBEM_HASEDITCHANGED, 0, 0); +} +AFX_INLINE CEdit* CXTComboBoxEx::GetEditCtrl() { + ASSERT(::IsWindow(m_hWnd)); return (CEdit*) CEdit::FromHandle((HWND) ::SendMessage(m_hWnd, CBEM_GETEDITCONTROL, 0, 0)); +} +AFX_INLINE CComboBox* CXTComboBoxEx::GetComboBoxCtrl() { + ASSERT(::IsWindow(m_hWnd)); return (CComboBox*) CComboBox::FromHandle((HWND) ::SendMessage(m_hWnd, CBEM_GETCOMBOCONTROL, 0, 0)); +} +AFX_INLINE CImageList* CXTComboBoxEx::SetImageList(CImageList* pImageList) { + ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, CBEM_SETIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); +} +AFX_INLINE CImageList* CXTComboBoxEx::GetImageList() const { + ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, CBEM_GETIMAGELIST, 0, 0)); +} +//--------------------------------------------------------------------------- +// While CXTComboBoxEx derives from CComboBox, there are some +// CB_messages the underlying ComboBoxEx control doesn't support. +//--------------------------------------------------------------------------- + +AFX_INLINE int CXTComboBoxEx::Dir(UINT attr, LPCTSTR lpszWildCard) { + UNUSED_ALWAYS(attr); UNUSED_ALWAYS(lpszWildCard); ASSERT(FALSE); return CB_ERR; +} +AFX_INLINE int CXTComboBoxEx::FindString(int nIndexStart, LPCTSTR lpszFind) const { + UNUSED_ALWAYS(nIndexStart); UNUSED_ALWAYS(lpszFind); ASSERT(FALSE); return CB_ERR; +} +AFX_INLINE int CXTComboBoxEx::AddString(LPCTSTR lpszString) { + UNUSED_ALWAYS(lpszString); ASSERT(FALSE); return CB_ERR; +} +AFX_INLINE BOOL CXTComboBoxEx::SetEditSel(int nStartChar, int nEndChar) { + UNUSED_ALWAYS(nStartChar); UNUSED_ALWAYS(nEndChar); ASSERT(FALSE); return FALSE; +} +AFX_INLINE int CXTComboBoxEx::InsertString(int nIndex, LPCTSTR lpszString) { + UNUSED_ALWAYS(nIndex); UNUSED_ALWAYS(lpszString); ASSERT(FALSE); return CB_ERR; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTCOMBOBOXEX_H__) diff --git a/Editor/XT/Include/XTCommandsListBox.h b/Editor/XT/Include/XTCommandsListBox.h new file mode 100644 index 0000000..b3c54ad --- /dev/null +++ b/Editor/XT/Include/XTCommandsListBox.h @@ -0,0 +1,103 @@ +// XTCommandsListBox.h : interface for the CXTCommandsListBox class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCOMMANDSLISTBOX_H__) +#define __XTCOMMANDSLISTBOX_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CXTCustomGroupItemInfo; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCommandsListBox is a CListBox derived class. It is used during toolbar +// customization to display a list of currently available commands. +class _XT_EXT_CLASS CXTCommandsListBox : public CListBox +{ + +public: + + // Summary: This object site API. + interface ISite + { + // Input: nCmdID - Command ID whose icon is queried for. + // hIcon - destination to store command icon, valid if function returns true + // hDisabledIcon - destination to store disabled command icon, can be NULL, + // valid if function returns true + // hHotIcon - destination to store the hot command icon, can be NULL, valid if the + // function returns true. + // Returns: true if found, false otherwise + // Summary: This member function gets a command icon. + virtual bool GetCommandIcon(UINT nCmdID,HICON& hIcon, HICON& hDisabledIcon,HICON& hHotIcon) = 0; + + // Input: pos - Position (item data) of the item in the list box. + // Returns: A UINT object. + // Summary: This member function gets command ID by its position. + virtual UINT GetItemCommand(int pos) = 0; + + // Input: pos - Position (item data) of the item in the list box. + // Summary: This member function performs a drag and drop of an item at the position + // provided. + virtual void DragNDrop(int pos) = 0; + }; + +private: + + CSize m_sizeIcon; + ISite* const m_site; + +public: + + + ISite* GetSite() const { + return m_site; + } + CSize& GetIconSize() { + return m_sizeIcon; + } + + // Input: site - Points to an ISite object. + // Summary: Constructs a CXTCommandsListBox object. + CXTCommandsListBox(ISite* site); + + // Summary: Destroys a CXTCommandsListBox object, handles cleanup and de-allocation. + virtual ~CXTCommandsListBox(); + +public: + + // Ignore: + //{{AFX_VIRTUAL(CXTCommandsListBox) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTCommandsListBox) + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTCOMMANDSLISTBOX_H__) diff --git a/Editor/XT/Include/XTControlBar.h b/Editor/XT/Include/XTControlBar.h new file mode 100644 index 0000000..2791f3a --- /dev/null +++ b/Editor/XT/Include/XTControlBar.h @@ -0,0 +1,503 @@ +// XTControlBar.h : interface for the CXTControlBar class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCONTROLBAR_H__) +#define __XTCONTROLBAR_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// Forwards + +class CXTControlBar; +class CXTDockWindow; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTDockContextWndHook is a CXTWndHook derived class. It listens to +// the relevant messages the parent frame receives. +class CXTDockContextWndHook : public CXTWndHook +{ + DECLARE_DYNAMIC(CXTDockContextWndHook) + + CXTControlBar* m_pBar; + +public: + // Summary: Constructs a CXTDockContextWndHook object. + CXTDockContextWndHook( + CXTControlBar* pBar) + : m_pBar(pBar) + { } + + virtual LRESULT WindowProc( + UINT message, + WPARAM wParam, + LPARAM lParam); +}; + +// Summary: XT_BARPLACEMENT is a stand alone helper structure class. It is used +// by CXTControlBar to save and restore the control bar's size, location, +// and style. +struct XT_BARPLACEMENT +{ + BOOL bUnique; // TRUE if the control bar is the only one docked in a row or column. + BOOL bMaximized; // TRUE if the control bar is maximized. + CSize sizeVert; // Vertical size of the control bar. + CSize sizeHorz; // Horizontal size of the control bar. + CSize sizeFloat; // Floating size of the control bar. + CSize sizeDefault; // Default size the control bar should be. + DWORD dwStyle; // Control bar style flags. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTControlBar is a CControlBar derived class. It is the base class +// for the control bar classes CXTStatusBar, CXTToolBar, CXTDialogBar and +// CXTReBar. A control bar is a window that is usually aligned to the left +// or right of a frame window. It may contain child items that are either +// HWND-based controls, which are Windows windows that generate and respond +// to Windows messages, or non-HWND-based items, which are not windows +// and are managed by application code or framework code. List boxes and +// edit controls are examples of HWND-based controls; status-bar panes +// and bitmap buttons are examples of non-HWND-based controls. +// +// Control bar windows are usually child windows of a parent frame window +// and are usually siblings to the client view or MDI client of the frame +// window. A CXTControlBar object uses information about the parent window’s +// client rectangle to position itself. It then informs the parent window +// as to how much space remains unallocated in the parent window’s client +// area. +class _XT_EXT_CLASS CXTControlBar : public CControlBar +{ + friend CXTDockContextWndHook; + + DECLARE_DYNAMIC(CXTControlBar) + +public: + // Summary: A delegate to notify when visibility of this control bar changes. + typedef CXTMultiCastDelegate1 NOTEBARVISIBLE; + NOTEBARVISIBLE NoteBarVisible; + +protected: + + // Summary: Constructs a CXTControlBar object. + CXTControlBar(); + + // Input: lpRect - Pointer to a RECT structure that represents the border size. + // Summary: This member function is called to set the size of the borders + // for the control bar. + virtual void SetBorders(LPCRECT lpRect); + + // Input: cxLeft - Specifies the left position. + // cyTop - Specifies the top. + // cxRight - Specifies the right. + // cyBottom - Specifies the bottom. + // Summary: This member function is called to set the size of the borders + // for the control bar. + virtual void SetBorders(int cxLeft = 0, int cyTop = 0, int cxRight = 0, int cyBottom = 0); + + + // Returns: A CRect object. + // Summary: This member function is called to return the size of the control + // bar's borders. + virtual CRect GetBorders() const; + +protected: + + + XT_BARPLACEMENT m_bp; // Placement struct to hold size and style information. + +private: + CFrameWnd* m_pOriginalFrame; + CXTDockContextWndHook* m_pHook; + CXTDockContextWndHook* m_pHookParent; +protected: + + int m_nPos; // Index of the popup menu contained in the menu. + UINT m_menuID; // Popup menu resource ID. + bool m_bInReBar; // true if the parent is a rebar. + bool m_bContextMenus; // true to display context menus for control bars. + CFont m_font; // 8pt control bar font. + CFont m_fontVert; // 8pt vert control bar font. + CFont m_fontBold; // 8pt bold control bar font. + +private: + + bool m_bEnableMultiFrameDocking; + +public: + + // Input: bEnable - true to enable context menus. false to disable. + // Summary: This member function is called to enable or disable context menus for + // the control bar. + void EnableContextMenus(bool bEnable); + + // Returns: true if context menus are enabled, otherwise returns false. + // Summary: Call this member function to determine if the control bar has context + // menus enabled. + bool HasContextMenu(); + + // Returns: true if the control is nested inside of a rebar. + // Summary: This member function is called to determine if the control bar is nested + // inside of a CXTReBar object. + bool InRebar() const; + + // Summary: Destroys a CXTControlBar object, handles cleanup and de-allocation. + virtual ~CXTControlBar(); + + // Returns: The current CBRS_XT_ (control bar) settings for the control bar. + // See ModifyXTBarStyle for the complete list of available styles. + // Summary: Call this member function to determine which CBRS_XT_ (control bar) + // settings are currently set for the control bar. It does not + // handle WS_ (window style) or CBRS_ (control bar style). + virtual DWORD GetXTBarStyle(); + + // Input: dwStyle - New CBRS_XT_ style for the control bar, see ModifyXTBarStyle() + // for available styles. + // Summary: This member function will set the style for the control bar. It does not + // handle WS_ (window style) or CBRS_ (control bar style). + virtual void SetXTBarStyle(DWORD dwStyle); + + // BULLETED LIST: + + // Input: dwRemove - Specifies CBRS_XT_ styles to be removed during style + // modification. + // dwAdd - Specifies CBRS_XT_ styles to be added during style + // modification. + // bRedraw - The desired styles for the control bar can be one or more of + // the following: + // [ul] + // [li]CBRS_XT_BUTTONS The control bar has a minimize and + // close button when docked.[/li] + // [li]CBRS_XT_GRIPPER The control bar has a gripper when + // docked.[/li] + // [li]CBRS_XT_GRIPPER_FLAT The control bar has a flat + // gripper. Use with CBRS_XT_GRIPPER.[/li] + // [li]CBRS_XT_GRIPPER_GRAD The control bar has a gradient + // flat gripper. Use with CBRS_XT_GRIPPER_FLAT.[/li] + // [li]CBRS_XT_GRIPPER_TEXT The control bar draws text + // in the gripper area. Use with CBRS_XT_GRIPPER.[/li] + // [li]CBRS_XT_BUTTONS_FLAT The control bar min and max + // buttons are flat. Use with CBRS_XT_BUTTONS.[/li] + // [li]CBRS_XT_BORDERS_FLAT The control bar borders are flat.[/li] + // [li]CBRS_XT_CLIENT_OUTLINE Draw a single black border + // outline around the client area.[/li] + // [li]CBRS_XT_CLIENT_STATIC Draw a static rect around + // the client area.[/li] + // [li]CBRS_XT_CLIENT_MODAL Draw a modal rect around the + // client area.[/li] + // [li]CBRS_XT_ALL_FLAT The following styles combined by + // using the bitwise OR (|) operator; CBRS_XT_GRIPPER_FLAT, + // CBRS_XT_BUTTONS_FLAT and CBRS_XT_BORDERS_FLAT.[/li] + // [li]CBRS_XT_DEFAULT The following styles combined by + // using the bitwise OR (|) operator; CBRS_XT_BUTTONS, + // CBRS_XT_GRIPPER, CBRS_XT_GRIPPER_TEXT.[/li] + // [/ul] + // Returns: Nonzero if the style was successfully modified, otherwise returns zero. + // Summary: Call this member function to modify a control bar style. Styles to + // be added or removed can be combined by using the bitwise OR (|) + // operator. + virtual BOOL ModifyXTBarStyle(DWORD dwRemove,DWORD dwAdd,BOOL bRedraw=TRUE); + + // Input: menuID - Resource ID of the menu to be used. + // nPos - Zero-based index of the popup menu located in the + // menu resource. For example IDR_MAINFRAME's "File" + // popup menu would be 0. + // Summary: This member function is used to set the resource ID for the + // popup menu associated with the control bar. + virtual void SetMenuID(UINT menuID,int nPos=0); + + // Returns: A UNIT value that represents the popup menu ID associated + // with the control bar. + // Summary: This member function retrieves the resource ID of the popup menu. + virtual UINT GetMenuID(); + + // Input: pDC - A CDC pointer that represents the current device context. + // Summary: This member function is called by the control bar to perform paint + // operations. + virtual void DoPaint(CDC* pDC); + + // Input: pDC - A CDC pointer that represents the current device context. + // rect - A CRect reference that represents the size of the gripper to draw. + // Summary: This member function is called to draw the gripper for the control bar. + virtual void DrawGripper(CDC* pDC, const CRect& rect); + + // Input: pDC - A CDC pointer that represents the current device context. + // rect - A CRect reference that represents the border area to draw. + // Summary: This member function is called to draw the borders for the control bar. + virtual void DrawBorders(CDC* pDC, CRect& rect); + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides of + // its parent window to which the control bar can be docked, if supported. + // It can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control + // bar will not dock. + // Summary: Call this member function to enable a control bar to be docked. + // The sides specified must match one of the sides enabled for + // docking in the destination frame window, or the control bar + // cannot be docked to that frame window. + void EnableDocking(DWORD dwDockStyle); + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports + // docking and the sides of its parent window to + // which the control bar can be docked, if supported. + // It can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control + // bar will not dock. + // dwFlatStyle - Specifies the splitter's, inside dockbars, look. + // It can be one of the following: + // [ul] + // [li]CBRS_XT_NONFLAT Thick devstudio like non-flat + // splitters.[/li] + // [li]CBRS_XT_SEMIFLAT Thin 3D non-flat splitters.[/li] + // [li]CBRS_XT_FLAT Flat splitters.[/li] + // [/ul] + // Summary: Call this member function to enable a control bar to be docked. + // The sides specified must match one of the sides enabled for + // docking in the destination frame window, or the control bar + // cannot be docked to that frame window. + void EnableDockingEx(DWORD dwDockStyle, DWORD dwFlatStyle); + + // Returns: Nonzero if it is docked on the left side, otherwise returns zero. + // Summary: This member function is used to determine if the control bar + // is docked on the left side. + virtual BOOL IsLeftDocked() const; + + // Returns: Nonzero if it is docked on the right side, otherwise returns zero. + // Summary: This member function is used to determine if the control bar + // is docked on the right side. + virtual BOOL IsRightDocked() const; + + // Returns: Nonzero if it is docked on the top side, otherwise returns zero. + // Summary: This member function is used to determine if the control bar + // is docked on the top side. + virtual BOOL IsTopDocked() const; + + // Returns: Nonzero if it is docked on the bottom side, otherwise returns zero. + // Summary: This member function is used to determine if the control bar + // is docked on the bottom side. + virtual BOOL IsBottomDocked() const; + + // Returns: Nonzero if it is docked on the top or bottom side, otherwise returns zero. + // Summary: This member function is used to determine if the control bar + // is docked on the top or bottom side. + virtual BOOL IsHorzDocked() const; + + // Returns: Nonzero if it is docked on the left or right side, otherwise returns zero. + // Summary: This member function is used to determine if the control bar + // is docked on the left or right side. + virtual BOOL IsVertDocked() const; + + // Returns: Nonzero if it is floating, otherwise returns 0. + // Summary: This member function is used to determine if the control bar + // is docked or floating. + virtual BOOL IsFloating() const; + + // Returns: An RGB color value. + // Summary: This member function is used to determine the correct background fill + // color to be used during paint operations. + virtual COLORREF GetBackgroundColor() const; + + // Input: bEnable - Tells if this feature is turned on. Set this parameter to true + // to allow this control bar to be docked to all CFrameWnd's descendants + // that have issued EnableDocking(). + // Summary: Enables or disables redocking of this control bar. You can also override + // CanDock() for precisely controlling which control bar can be docked + // to what frame window. By default, this feature is turned off, and should + // be enabled before you actually create the control bar. + void EnableMultiFrameDocking(bool bEnable = true); + + // Input: pFrame - The frame this control bar will be redocked to. + // Returns: true if it is allowed to dock, otherwise returns false. + // Summary: Tells if this control bar is allowed to dock to a specific frame. + virtual bool CanDock(CFrameWnd* pFrame); + + // Input: pRBBI - Pointer to a rebar bar descriptor to use to fill in the sizing + // information. + // bHorz - true if the control bar is horizontally oriented. + // Returns: true if successful, otherwise returns false. + // Summary: This notification is called whenever this control bar is added to a + // CXTReBar object. Default implementation sizes the rebar bar such that + // it fully displays this control bar. + virtual bool OnAddedToRebar(REBARBANDINFO* pRBBI, bool bHorz); + + // Input: pInfo - Descriptor of the band that contains this control bar. + // bHorz - Tells if it is horizontally oriented. + // Summary: This member function is called whenever this control bar is embedded + // in a CXTReBar control that has just resized the band in which this + // control resides. Default implementation does nothing. + virtual void OnRebarBandResized(XT_REBARSIZECHILDINFO* pInfo, bool bHorz); + + // Returns: true to enable full window drag, or false to use the wire frame. + // Summary: This member function tells if this control bar shall be visualized + // when dragging or the system shall render it with a wire frame. Default + // implementation uses a wire frame. + virtual bool IsFullWindowDrag(); + + // BULLETED LIST: + + // Input: pSize - + // [ul] + // [li]IN Extent of the rectangle in which the hot spot must be defined.[/li] + // [li]OUT Offset of the hot spot from the rect's top-left corner.[/li] + // [/ul] + // Summary: This member function calculates the position of the control bar hot + // spot, i.e. the point that is used to pin the control bar rect to the + // mouse cursor when dragging it. Returns true if the menu bar defines + // a hot spot. In which case, a buffer pointed to by 'pSize' is filled + // with the hot spot offset from the top-left corner. Returns false + // to indicate that no hot spot is defined (the default). + virtual bool GetHotSpot(LPSIZE pSize); + + // Returns: A pointer to a dialog window if successful; otherwise NULL. + // Summary: Call this member function to retrieve the parent dialog window. The + // member function searches up the parent chain until a CDialog (or + // derived class) object is found. + CDialog* GetParentDialog() const; + + // Returns: A pointer to a docking window if successful; otherwise NULL. + // Summary: Call this member function to retrieve the parent docking window. The + // member function searches up the parent chain until a CXTDockWindow (or + // derived class) object is found. + CXTDockWindow* GetParentDockWnd() const; + +public: + + #ifdef _DEBUG + virtual void AssertValidCtrlID(bool bCheckUnique = true); + static void AssertValidCtrlID(CControlBar *pBar, bool bCheckUnique = true); +#endif //_DEBUG + virtual void DockTrackingDone(); + virtual void UpdateControlBarFonts(); + virtual bool ShowMoveCursor() const; + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTControlBar) + //}}AFX_VIRTUAL + + virtual BOOL OnPopupMenu(CPoint& point, CFrameWnd* pFrameWnd); + virtual LRESULT WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam); + virtual void CalcInsideRect(CRect& rect, BOOL bHorz) const; + virtual void EraseNonClient(); + virtual BOOL SetStatusText(int nHit); + virtual void DelayShow(BOOL bShow); + virtual bool HasCmdHandlers(CWnd* pWnd); + + // Ignore: + //{{AFX_MSG(CXTControlBar) + afx_msg void OnWindowPosChanging(LPWINDOWPOS lpWndPos); + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnNcPaint(); + afx_msg void OnPaint(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnDestroy(); + afx_msg LRESULT OnIdleUpdateCmdUI (WPARAM wParam, LPARAM lParam); + //}}AFX_MSG + + afx_msg LRESULT OnAddRebar(WPARAM wp, LPARAM lp); + afx_msg LRESULT OnRebarSizeChild(WPARAM wp, LPARAM lp); + afx_msg LRESULT OnQueryVisualize(WPARAM wp, LPARAM lp); + afx_msg LRESULT OnDragTrackingDone(WPARAM wp, LPARAM lp); + afx_msg LRESULT OnQueryHotSpot(WPARAM wp, LPARAM lp); + + DECLARE_MESSAGE_MAP() + + friend class CXTReBar; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE bool CXTControlBar::InRebar() const { + ASSERT(::IsWindow(m_hWnd)); return m_bInReBar; +} +AFX_INLINE void CXTControlBar::SetBorders(LPCRECT lpRect) { + /*ASSERT(::IsWindow(m_hWnd));*/ SetBorders(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); +} +AFX_INLINE CRect CXTControlBar::GetBorders() const { + /*ASSERT(::IsWindow(m_hWnd));*/ return CRect(m_cxLeftBorder, m_cyTopBorder, m_cxRightBorder, m_cyBottomBorder); +} +AFX_INLINE UINT CXTControlBar::GetMenuID() { + /*ASSERT(::IsWindow(m_hWnd));*/ return m_menuID; +} +AFX_INLINE void CXTControlBar::SetMenuID(UINT menuID, int nPos) { + /*ASSERT(::IsWindow(m_hWnd));*/ m_menuID=menuID; m_nPos=nPos; +} +AFX_INLINE BOOL CXTControlBar::IsVertDocked() const { + ASSERT(::IsWindow(m_hWnd)); return (IsLeftDocked() || IsRightDocked()); +} +AFX_INLINE BOOL CXTControlBar::IsHorzDocked() const { + ASSERT(::IsWindow(m_hWnd)); return (IsTopDocked() || IsBottomDocked()); +} +AFX_INLINE BOOL CXTControlBar::IsBottomDocked() const { + ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_DOCKBAR_BOTTOM); +} +AFX_INLINE BOOL CXTControlBar::IsTopDocked() const { + ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_DOCKBAR_TOP); +} +AFX_INLINE BOOL CXTControlBar::IsRightDocked() const { + ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_DOCKBAR_RIGHT); +} +AFX_INLINE BOOL CXTControlBar::IsLeftDocked() const { + ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_DOCKBAR_LEFT); +} +AFX_INLINE BOOL CXTControlBar::IsFloating() const { + ASSERT(::IsWindow(m_hWnd)); return (!IsHorzDocked() && !IsVertDocked()); +} +AFX_INLINE void CXTControlBar::EnableContextMenus(bool bEnable) { + m_bContextMenus = bEnable; +} +AFX_INLINE bool CXTControlBar::HasContextMenu() { + if (!xtAfxData.bControlBarMenus) return false; return m_bContextMenus; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTCONTROLBAR_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTCoolMenu.h b/Editor/XT/Include/XTCoolMenu.h new file mode 100644 index 0000000..838f4d7 --- /dev/null +++ b/Editor/XT/Include/XTCoolMenu.h @@ -0,0 +1,582 @@ +// XTCoolMenu.h : interface for the CXTCoolMenu class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCOOLMENU_H__) +#define __XTCOOLMENU_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTItemData is a stand alone helper class. It is used by CXTCoolMenu. +class _XT_EXT_CLASS CXTItemData +{ +public: + + // Summary: Constructs a CXTItemData object. + CXTItemData (); + + // Summary: Destroys a CXTItemData object, handles cleanup and de-allocation. + virtual ~CXTItemData(); + + long m_itemID; // Unique identifying number. + UINT m_nPosition; // Menu item position. + UINT m_commandID; // Menu item (command) ID. + BOOL m_bHidden; // TRUE if the item has been removed. + HMENU m_hMenu; // Handle to the menu this item belongs to. + HMENU m_hSubMenu; // Handle to a submenu, if any, that belongs to this item. + DWORD m_dwType; // Original item type flags. + DWORD m_dwState; // Item state. + DWORD m_dwHideType; // Used for drawing hidden items. + DWORD m_iMBAlign; // Alignment of the associated menu bar. + CString m_strText; // Item text. + + // Returns: TRUE if the cool menu belongs to to the cool menu object. + // Summary: This member function is called to determine if the item data for the + // cool menu belongs to to the cool menu object. + BOOL IsXTItemData(); +}; + +////////////////////////////////////////////////////////////////////// + +class CXTMemDC; +class CXTCoolMenu; +class CXTWndShadow; + +class CXTPopupMenu : public CXTWndHook +{ +protected: + + bool m_bOffset; + BOOL m_bAnimationFinished; + HMENU m_hMenu; + CRect m_rectExclude; + static int m_iRefCount; + static BOOL m_bSysMenuAnimation; + static BOOL m_bSysDropShadows; + static BOOL m_bSysDropShadowsAvailable; + CXTCoolMenu* m_pParent; + + enum { WM_XT_FIX_XP_PAINT = WM_APP + 10, WM_XT_DEFER_DRAW_SHADOW }; + +public: + + CXTPopupMenu(); + virtual ~CXTPopupMenu(); + + HWND GetHWnd(); + HMENU GetHMenu(); + + void SetParams(HMENU hMenu); + void SetCoolMenuParent(CXTCoolMenu *pParent); + void HideBeforeExpand(); + void DisableXPEffects(); + void OnDrawBorder(CDC* pDC); + void ShowShadows(); + + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + friend class CXTCoolMenu; +}; + +// Summary: CList definition for the popup menu array. +typedef CList CXTPopupMenuList; + +// Summary: CList definition for the CMenu array. +typedef CList CXTMenuList; + +// Summary: CList definition for the CXTItemData array. +typedef CList CXTItemList; + +// NUMBERED LIST: + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCoolMenu is a CXTWndHook derived class. CXTCoolMenu manages the +// cool menus for the application. The images are drawn based upon toolbar +// resources that are passed in and are displayed next to the menu text +// associated with the toolbar command ID. +// +// Some restrictions apply to cool menus if the XT menu bar (CXTMenuBar) is +// not used: +// [ol] +// [li]Intelligent menus cannot be used.[/li] +// [li]XP skinning and shadows can only be used on Win2k or later operating +// systems.[/li] +// [/ol] +class _XT_EXT_CLASS CXTCoolMenu : public CXTWndHook +{ + friend class CXTColorPopup; + friend class CXTMenu; + + DECLARE_DYNAMIC(CXTCoolMenu) + +public: + + // Input: bNoToolbar - DEPRECATED: The value of this parameter is ignored. + // Summary: Constructs a CXTCoolMenu object. + CXTCoolMenu(BOOL bNoToolbar=FALSE); + + // Summary: Destroys a CXTCoolMenu object, handles cleanup and de-allocation. + virtual ~CXTCoolMenu(); + +protected: + + int m_nRecentList; // Number of items the recent item list cycles through. + int m_nIDEvent; // Menu timer ID. + int m_nTimeOut; // Time-out value, in milliseconds. + BOOL m_bIntelligent; // TRUE if intelligent menus are enabled. + bool m_bTimerActive; // true when the timer has been activated. + BOOL m_bHasMnemonics; // (Win2K) TRUE if 'use menu underlines' is turned off in the control panel. + BOOL m_bIsTrackPopup; // TRUE if the current menu was activated through TrackPopupMenu. + CSize m_sizeBmp; // Size of the button bitmap. + CSize m_sizeBtn; // Size of the button, including shadow. + static int m_iIgnoreCount; // Incremented when user calls IgnoreNextPopup();. + CUIntArray m_arCommandID; // Array of command IDs to hide. + static bool m_bLastMouseEvent; // true if last message was WM_MOUSEMOVE and not WM_KEYDOWN + static CSize m_szPopupBorder; // Size of the border of popup menus. + static CSize m_szIconMargin; // Size of the icon margins. + CXTMenuList m_menuList; // List of the CMenu objects initialized. + CXTItemList m_itemList; // List of the item data pointers. + +public: + + static int m_nAnimationDelay; // The number of milliseconds for animation effect. Default value is 300. + static int m_nAnimationSteps; // The number of steps used in the animation effect. Default value is 5. + static bool m_bShowAll; // true when the cool menu displays hidden commands. + static bool m_bAllowIntelligent; // Set to true when the popup is generated through CXTMenu which implements part of the intelligent menu's logic. + static bool m_bIsPopup; // true if the menu is not owned by CXTMenuBar. + + // BULLETED LIST: + + // Summary: Type of animation to perform. + // This parameter can be one of the following values: + // [ul] + // [li]animateWindowsDefault Animation as defined in the "Display" settings.[/li] + // [li]animateRandom Any of the first three in random selection.[/li] + // [li]animateUnfold Unfold top to bottom.[/li] + // [li]animateSlide Slide in from left.[/li] + // [li]animateFade Fade-in.[/li] + // [li]animateNone No animation.[/li] + // [/ul] + // The default value is animateWindowsDefault. + // You can add a new animation effect, see the CXTAnimationMemDC description. + // See Also: CXTAnimationMemDC + static int m_nAnimationType; + + static int m_iMenuBarAlign; // Used by menu bar for linking menu bar button to menu (XP style) + static CRect m_rectExclude; + + // Input: nID - The command ID to get the index for. + // bEnabled - true if the command ID is from the enabled image list. + // Returns: The index of the specified command, or -1 if the command + // is not found. + // Summary: This member function returns the index for the specified command. + int GetButtonIndex(WORD nID, bool bEnabled=true); + + // Input: nElapse - Specifies the time-out value, in milliseconds. + // nIDEvent - Specifies a nonzero timer identifier. + // Summary: This member function will set the timer identifier and time-out value + // for the cool menu. The timer is activated when the mouse hovers over a + // chevron when using intelligent menus. NOTE: if you are not using + // the CXTMenuBar with your application you should set this to a + // value of 100, otherwise you will need to also call CXTMenuBar::SetTimerInfo() + // if you are changing the 'nIDEvent' parameter. + void SetTimerInfo(UINT nElapse, UINT nIDEvent=1000); + + // Input: bIntelligent - TRUE to enable intelligent menus. FALSE to disable intelligent menus. + // Summary: This member function will enable or disable the intelligent menu feature. + void SetIntelligentMode(BOOL bIntelligent=TRUE); + + // Input: pFrame - Pointer to a CFrameWnd object that represents the application's main + // window. If NULL, this will uninstall the cool menus. + // Summary: This member function is called to install cool menus for the application. + virtual void Install(CFrameWnd* pFrame); + + // Input: nToolbarID - The resource ID of a toolbar to extract images + // from, to be displayed in cool menus. + // bEnabled - true if the toolbar is for enabled images. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will load a toolbar resource and extract + // each button image to be used with its associated menu command. + virtual BOOL LoadToolbar(UINT nToolbarID, bool bEnabled=true); + + // Input: toolbar - Reference to a CToolBarCtrl object. + // bEnabled - true if the toolbar is for enabled images. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will load a toolbar resource and extract + // each button image to be used with its associated menu command. + virtual BOOL LoadToolbar(CToolBarCtrl& toolbar, bool bEnabled=true); + + // Input: nToolbarIDs - An array of toolbar resource IDs used to extract + // images from, to be displayed in cool menus. + // nSize - Size of the array passed in. + // bEnabled - true if the toolbar array is for enabled images. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will load a toolbar resource and extract + // each button image to be used with its associated menu command. + virtual BOOL LoadToolbars(const UINT* nToolbarIDs, int nSize, bool bEnabled=true); + + // Input: nCommandID - The command ID of a menu item to hide. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified command to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideCommand(UINT nCommandID); + + // Input: lpszItem - Text string representing the popup menu item to hide. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified menu item to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideCommand(LPCTSTR lpszItem); + + // Input: nCommandIDs - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified commands to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideCommands(const UINT* nCommandIDs, int nSize); + + // Input: lpszItems - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified menu items to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideCommands(const LPCTSTR lpszItems, int nSize); + + // Input: hIcon - Handle to the icon to add. + // uCmdID - Command id of the icon. + // bEnabled - true if the image is to be added to the enabled image list. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will append the specified image resource (hIcon) + // to the existing cool menu image list, and map the associated + // command ID (uCmdID) to the newly added image. + virtual BOOL AppendImageList(HICON hIcon, UINT uCmdID, bool bEnabled/*=true*/); + + // Input: nBitmapID - Resource ID of the new bitmap to add to the cool + // menu's image list. + // arCmdIDs - Array of menu command(s) to be associated with the + // newly added image. + // nSize - Size of the array passed in. + // bEnabled - true if the image is to be added to the enabled image list. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will append the specified image resource (bitmap) + // to the existing cool menu image list, and map the associated + // command IDs to the newly added images. + virtual BOOL AppendImageList(UINT nBitmapID, UINT* arCmdIDs, int nSize, bool bEnabled=true); + + // Input: hBitmap - Handle of the new bitmap to add to the cool menu's image list. + // arCmdIDs - Array of menu command(s) to be associated with the + // newly added image. + // nSize - Size of the array passed in. + // bEnabled - true if the image is to be added to the enabled image list. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will append the specified image resource (bitmap) + // to the existing cool menu image list, and map the associated + // command IDs to the newly added images. + virtual BOOL AppendImageList(HBITMAP hBitmap, UINT* arCmdIDs, int nSize, bool bEnabled=true); + + // Input: pMenu - Points to the active menu. + // nCommandID - Command ID of a menu item. + // Returns: The position of the menu item if it exists, otherwise returns -1. + // Summary: Call this member function to check for the existence of a menu item. + virtual int MenuItemExists(CMenu* pMenu, UINT nCommandID); + + // Input: nLength - Number of items the recent item list contains. Set to 0 to + // disable this feature. + // Summary: This member function sets the number of hidden items that can be + // added to the short menu at any given time. + virtual void SetRecentItemLength(int nLength); + + // Summary: This member function is called to reset the recent item list used to + // add recently used hidden items to the short menu. + virtual void ResetUsageData(); + + // Summary: Call this member function if the next popup menu is not to be + // transformed by the CXTCoolMenu class. For instance, use this before + // displaying system menus. + static void IgnoreNextPopup(); + + // Input: size - Represents the new size of the cool menu icons. + // Summary: Call this member function to set the default icon size for cool menus. + // This will override the size that was set when LoadToolbar was called. + // This member should be called after InstallCoolMenus has been called + // in the frame class. Standard size is 16x15 pixels. + virtual void SetIconSize(CSize size); + + // Returns: A CSize object that represents the current icon size for cool menu + // images. + // Summary: Call this member function to get the default icon size for cool menus. + virtual CSize GetIconSize(); + + // Input: nIDCmd - Command ID to associate with the newly added image. + // hIcon - Icon handle of the image to add. + // sz - Width and height of the newly added item. + // bEnabled - true if the image is to be added to the enabled image list. + // Summary: This member function is called to add an image to the image map for + // the cool menus. + virtual void AddImageToMap(UINT nIDCmd, HICON hIcon, CSize sz, bool bEnabled=true); +public: + virtual BOOL HookWindow(HWND hWnd); + virtual BOOL HookWindow(CWnd* pWnd); + +protected: + + // Input: pDC - Points to the current device context. + // rect - Size of the area to paint. + // strText - A CString object that represents the text to be displayed. + // clrColor - An RGB value that represents the color of the text to be displayed. + // Summary: This member function is called by the cool menu to paint a menu item's text. + virtual void DrawMenuText(CDC* pDC, CRect rect, CString strText, COLORREF clrColor); + + // Input: pDC - Points to the current device context. + // rect - Size of the area to paint. + // bSelected - TRUE if the checkmark is to be drawn highlighted. + // bDisabled - TRUE if the checkmark is to be drawn disabled. + // hbmCheck - HBITMAP handle to the menu item info checkmark. It can be NULL. + // Summary: This member function is called by the cool menu to paint checkmarks + // and radio buttons for each item. + virtual void Draw3DCheckmark(CDC* pDC,const CRect& rect,BOOL bSelected,BOOL bDisabled,HBITMAP hbmCheck); + + // Input: pDC - Points to the current device context. + // rcItem - Size of the area to paint. + // bSelected - TRUE if the chevron is to be drawn highlighted. + // Summary: This member function is called by the cool menu to paint a chevron + // that is used to display hidden menu items. + virtual void DrawChevron(CDC* pDC,CRect rcItem,BOOL bSelected); + + // Input: pMenu - Points to a CMenu object to be made 'cool'. + // bHasButtons - TRUE if the menu has icons. + // Summary: This member function is called by the cool menu to convert the specified + // CMenu object to a 'cool' menu. + virtual void ConvertMenu(CMenu* pMenu,BOOL bHasButtons); + + // Input: nCommandID - Command ID of a menu item. + // Returns: TRUE if the item is hidden, otherwise returns FALSE. + // Summary: This member function is called by the cool menu to check to see + // if the specified menu item is to be hidden. + virtual BOOL IsItemHidden(UINT nCommandID); + + // Input: pMenu - Points to the active menu. + // nPos - Position of a menu item. + // Returns: TRUE if the menu item is a separator, otherwise returns FALSE. + // Summary: This member function is called by the cool menu to check to see + // if the menu item is a separator. + BOOL IsItemSeparator(CMenu* pMenu,int nPos); + + // Input: pMenu - Points to the active menu. + // nPos - Position of a menu item. + // Returns: TRUE if the previous menu item is hidden, otherwise returns FALSE. + // Summary: This member function is called by the cool menu to check to see + // if the previous menu item is hidden. + virtual BOOL IsPrevItemHidden(CMenu* pMenu,int nPos); + + // Input: pMenu - Points to the active menu. + // nPos - Position of a menu item. + // Returns: TRUE if the next menu item is hidden, otherwise returns FALSE. + // Summary: This member function is called by the cool menu to check to see + // if the next menu item is hidden. + virtual BOOL IsNextItemHidden(CMenu* pMenu,int nPos); + + // Input: hMenu - Points to the active menu. + // nPos - Position of a menu item. + // Returns: TRUE if the menu item is the first one visible, otherwise returns FALSE. + // Summary: This member function is called by the cool menu to check to see + // if the menu item is the first one visible. + virtual BOOL IsFirstVisibleItem(HMENU hMenu,UINT nPos); + + // Input: hMenu - Points to the active menu. + // nPos - Position of a menu item. + // cmd - Command ID of the item to check. + // Returns: TRUE if the menu item is the last one visible, otherwise returns FALSE. + // Summary: This member function is called by the cool menu to check to see if + // the menu item is the last one visible. + virtual BOOL IsLastVisibleItem(HMENU hMenu,UINT nPos,UINT cmd); + + // Input: pMenu - CMenu pointer to the active menu. + // bAppend - TRUE to append the menu. + // Returns: TRUE if the menu was actually modified. + // Summary: This member function is called by the cool menu to append a chevron + // menu item if the menu has hidden commands. + virtual BOOL UpdateChevronItem(CMenu* pMenu,BOOL bAppend); + + // Input: pMenu - CMenu pointer to the active menu. + // Returns: TRUE if the menu item is a system menu, otherwise returns FALSE. + // Summary: This member function is called by the cool menu to verify if the + // specified menu is a system menu or not. + virtual BOOL IsSysMenu(CMenu* pMenu); + + // Input: pMenu - CMenu pointer to the active menu. + // Returns: TRUE if there was a change to the menu. + // Summary: This member function is called by the cool menu to restore previously + // hidden menu items. + virtual BOOL RestoreMenuItems(CMenu* pMenu); + + // Input: pMenu - CMenu pointer to the active menu. + // Summary: This member function is called by the cool menu to hide menu items. + virtual void HideMenuItems(CMenu* pMenu); + + // Input: pMenu - CMenu pointer to the active menu. + // Returns: TRUE if the menu has hidden items, otherwise returns FALSE. + // Summary: This member function is called by the cool menu to check for hidden + // items. + virtual BOOL HasHiddenItems(CMenu* pMenu); + + // Input: nItem - Menu item command ID. + // Returns: TRUE if the menu item was added to the recent item list, otherwise returns FALSE. + // Summary: This member function is called by the cool menu to add a hidden + // item to the short menu. + virtual BOOL AddRecentItem(UINT nItem); + + // Input: nItem - Menu item command ID. + // Returns: TRUE if the menu item is in the recent item list, otherwise returns FALSE. + // Summary: This member function is called by the cool menu to see if the specified + // item is in the recent item list. + virtual BOOL IsRecentItem(UINT nItem); + + // Returns: true if the menus are allowed to use intelligent mode, otherwise returns false. + // The default implementation allows intelligent menus only if the menu was + // created through the CXTMenu class. + // Summary: This internal member function checks to see if the menus are allowed + // to use intelligent mode. + virtual bool IsIntelligentModeAllowed(); + + + // Used by owner-drawn menu overrides + + static void UnhookCBTHook(); + static void HookCBTHook(); + static void RemoveBorder(HWND hWnd); + static HHOOK m_hCBTHook; + static LRESULT CALLBACK CBTHook(int nCode, WPARAM wParam, LPARAM lParam); + + friend class CXTCoolMenuInit; + friend class CXTPopupMenu; + + // Ignore: + //{{AFX_VIRTUAL(CXTCoolMenu) + virtual void Destroy(); + virtual void Refresh(); + virtual void OnMenuTimer(int nIDEvent); + virtual void OnInitMenuPopup(CMenu* pMenu, UINT nIndex, BOOL bSysMenu); + virtual BOOL OnMeasureItem(LPMEASUREITEMSTRUCT lpms); + virtual BOOL OnDrawItem(LPDRAWITEMSTRUCT lpds); + virtual LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu); + virtual void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu); + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + //}}AFX_VIRTUAL + +public: + static bool m_bInstalled; + +private: + static bool m_bIs95orNT4; + static bool m_bChevronSelected; + static HMENU m_hMenuLast; + static CXTPopupMenu* m_pPopupLast; + static CXTPopupMenuList m_listPopups; + int m_nTextHeight; +}; + +// BULLETED LIST: + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMenu is a CMenu derived class. It is used to create a CXTMenu object. +// Use this class if you want your popup to be 'intelligent'. +// +// Please note that intelligent menus have somewhat more limited capabilities +// under Windows 95 and Windows NT 4 (all other versions of Windows do +// not suffer from these limitations): +// [ul] +// [li]The menu will not expand automatically if you hover over the chevron.[/li] +// [li]Clicking on a chevron in a submenu will cause the submenu to close.[/li] +// [li]Intelligent menus are not available if you do not use the docking +// XT menu bar (CXTMenuBar).[/li] +// [/ul] +class _XT_EXT_CLASS CXTMenu : public CMenu +{ +public: + + // Summary: Constructs a CXTMenu object. + CXTMenu(); + + // Summary: Destroys a CXTMenu object, handles cleanup and de-allocation. + virtual ~CXTMenu(); + + // Input: nFlags - nFlags - Specifies a screen-position flag and a mouse-button flag. + // x - Specifies the horizontal position in screen coordinates + // of the popup menu. + // y - Specifies the vertical position, in screen coordinates, of + // the top of the menu on the screen. + // pWnd - Identifies the window that owns the popup menu. + // lpRect - Points to a RECT structure or a CRect object that contains + // the screen coordinates of a rectangle within which the user + // can click, without dismissing the popup menu. + // bNotify - TRUE to send WM_COMMAND notification back to the owner window. + // Returns: Nonzero if the function is successful, otherwise returns zero. + // Summary: Call this member function to display a floating popup menu at the + // specified location and track the selection of items on the popup menu. + BOOL TrackPopupMenu(UINT nFlags,int x,int y,CWnd* pWnd,LPCRECT lpRect = NULL,BOOL bNotify = TRUE); + + // Input: nFlags - Specifies a screen-position flag and a mouse-button flag. + // x - Specifies the horizontal position, in screen coordinates, + // of the popup menu. + // y - Specifies the vertical position, in screen coordinates, of + // the top of the menu on the screen. + // pWnd - Identifies the window that owns the popup menu. + // lptpm - Pointer to a TPMPARAMS structure that specifies an area + // of the screen the menu should not overlap. + // bNotify - TRUE to send WM_COMMAND notification back to the owner window. + // Returns: Nonzero if the function is successful, otherwise returns zero. + // Summary: Call this member function to display a floating popup menu at the + // specified location and track the selection of items on the popup menu. + BOOL TrackPopupMenuEx(UINT nFlags,int x,int y,CWnd* pWnd,LPTPMPARAMS lptpm = NULL,BOOL bNotify = TRUE); + + // Input: hMenu - A Windows handle to a menu. + // Returns: A pointer to a CMenu object. The pointer may be temporary or permanent. + // Summary: Call this member function to get a pointer to a CMenu object given + // a Windows handle to a menu. + static CXTMenu* PASCAL FromHandle(HMENU hMenu); + + // Input: hMenu - A Windows handle to a menu. + // Returns: A pointer to a CMenu object. If a CMenu object is not attached to the handle, + // NULL is returned. + // Summary: Call this member function to get a pointer to a CMenu object when + // given a handle to a window. + static CXTMenu* PASCAL FromHandlePermanent(HMENU hMenu); + + // Input: nPos - Specifies the position of the popup menu contained in the menu. + // Returns: A pointer to a CMenu object, if a popup menu exists at the given position, + // otherwise returns NULL. + // Summary: Call this member function to get a pointer to a CMenu object whose + // m_hMenu member contains a handle to the popup menu, if a popup menu + // exists at the given position. + CXTMenu* GetSubMenu(int nPos) const; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTCoolMenu::SetIntelligentMode(BOOL bIntelligent/*=TRUE*/) { + m_bIntelligent = bIntelligent; +} +AFX_INLINE void CXTCoolMenu::SetRecentItemLength(int nLength) { + m_nRecentList = nLength; +} +AFX_INLINE BOOL CXTCoolMenu::HookWindow(CWnd* pWnd) { + return HookWindow(pWnd->GetSafeHwnd()); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTCOOLMENU_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTCustomToolbar.h b/Editor/XT/Include/XTCustomToolbar.h new file mode 100644 index 0000000..19f8ff4 --- /dev/null +++ b/Editor/XT/Include/XTCustomToolbar.h @@ -0,0 +1,95 @@ +// XTCustomToolBar.h interface for the CXTCustomToolBar class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XT_CUSTOMTOOLBAR__) +#define __XT_CUSTOMTOOLBAR__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +///////////////////////////////////////////////////////////////////////////// +// Summary: CXTCustomToolbar is a toolbar that gets dynamically created from +// within toolbar customization page +class _XT_EXT_CLASS CXTCustomToolBar : public CXTToolBar +{ + DECLARE_DYNCREATE(CXTCustomToolBar) + +// Construction + +public: + + // Summary: Constructs a CXTCustomToolBar object. + CXTCustomToolBar(); + +// Attributes + +private: + + CString m_strTitle; // Persistently stored title + CImageList m_images; // images of the added buttons + CImageList m_disabledImages; // disabled images of the added buttons, created only when CreateDisabledImageList() gets called + +// Operations + +public: + + // Input: strNewName - Reference to the new name for the toolbar. + // Summary: Persistently renames this toolbar + void RenameCustomBar(const CString& strNewName); + + // Summary: Deletes this toolbar + void DeleteCustomBar(); + + // Returns: True if successful, otherwise returns false. + // Summary: Creates and enables disabled image list + bool CreateDisabledImageList(); + +// Overrides + + // Input: pInfo - Pointer to a CXTCustomControlBarInfo object. + // Summary: Fills in supported customizable features + virtual void GetCustomBarInfo(CXTCustomControlBarInfo* pInfo); + + // ClassWizard generated virtual function overrides + // Ignore: + //{{AFX_VIRTUAL(CXTCustomToolBar) + //}}AFX_VIRTUAL + +// Implementation + +public: + + // Summary: Destroys a CXTCustomToolBar object, handles cleanup and de-allocation. + virtual ~CXTCustomToolBar(); + virtual void PostNcDestroy(); + virtual void ReportCustomGroups(CXTCustomGroups& groups); + + // Generated message map functions + +protected: + + // Ignore: + //{{AFX_MSG(CXTCustomToolBar) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XT_CUSTOMTOOLBAR__) \ No newline at end of file diff --git a/Editor/XT/Include/XTCustomizeAPI.h b/Editor/XT/Include/XTCustomizeAPI.h new file mode 100644 index 0000000..5572975 --- /dev/null +++ b/Editor/XT/Include/XTCustomizeAPI.h @@ -0,0 +1,420 @@ +// XTCustomizeAPI.h APIs used in toolbar customization +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCUSTOMIZEAPI_H__) +#define __XTCUSTOMIZEAPI_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// f.forwards + +struct XT_DROPDOWNBUTTON; +class CXTIconMap; + +// Summary: Descriptor of a control bar that supports customizations +class CXTCustomControlBarInfo +{ +public: + + + bool m_bCanShowHide; // true if this control bar can toggle its visibility on/off + bool m_bDynamic; // true if this bar was dynamically created + CControlBar* m_pBar; // A control bar that supports customizations + + // Summary: Callback for renaming the control bar or NULL if operation is not supported. + typedef CXTDelegate1 RENAME; + RENAME Rename; + + // Summary: Callback for deleting the control bar or NULL if operation is not supported. + typedef CXTDelegate0 REMOVE; + REMOVE Remove; + + // Summary: Callback for resetting the control bar or NULL if operation is not supported. + typedef CXTDelegate0 RESET; + RESET Reset; + + CXTCustomControlBarInfo() + : m_pBar(0) + , m_bCanShowHide(false) + , m_bDynamic(false) + {} + +}; + +// Summary: A delegate to store CXTCustomControlBarInfo's +typedef CXTDelegate1 STORECUSTOMINFO; + +// Summary: A request to create a new customizable control bar +class CXTNewCustomBarRequest +{ +public: + + UINT m_nBarID; // ID of the control bar to create + CString m_strTitle; // The toolbar title + CFrameWnd* m_pFrame; // Frame window on which to create the toolbar + CControlBar* m_pNewBar; // Newly created custom bar + + CXTNewCustomBarRequest() + : m_pFrame(0) + , m_nBarID(0) + , m_pNewBar(0) + { } +}; + +// Summary: An item included in the custom group +class CXTCustomGroupItemInfo +{ +public: + + + CString m_strTitle; // Item title, will be displayed in commands listbox in customize dialog + + // Summary: Known types of items being transferred + enum Type + { + Button, // Toolbar button + Control // A control on the toolbar + }; + const Type m_type; + + bool m_bOwnsDropDown; // true if owning a private copy of XT_DROPDOWNBUTTON + UINT m_nCmdID; // Command or control identifier + UINT m_nWidth; // Control width, valid for controls + CString m_strLabel; // Button label + CXTIconHandle m_icon; // Icon assigned to the command + CXTIconHandle m_disabledIcon; // Disabled icon assigned to the command + CXTIconHandle m_hotIcon; // Hot icon assigned to the command + XT_DROPDOWNBUTTON* m_pDropDown; // Descriptor of the dropdown button + + +// Construction + + CXTCustomGroupItemInfo(Type type); + virtual ~CXTCustomGroupItemInfo(); + +// Operations + + // Summary: Implement if you derive from this class + virtual CXTCustomGroupItemInfo* Clone() const; + +private: + + // no implementation + + CXTCustomGroupItemInfo(const CXTCustomGroupItemInfo& other); + CXTCustomGroupItemInfo& operator=(const CXTCustomGroupItemInfo& other); +}; + +// Summary: CTypedPtrArray definition for the custom group item info array. +typedef CTypedPtrArray CXTCustomGroupItemInfoArray; + +// Summary: Customizable group descriptor, the group is identified by a group owner (can later +// be queried for group content) and group ID to uniquely identify the group with its owner +class CXTCustomGroupInfo +{ +public: + + int m_nSortPriority; // Sort priority customize dialog sorts groups by this number + CString m_strTitle; // Group title + CXTCustomGroupItemInfoArray m_items; // Items included in this group + +// Construction + + // Summary: Constructs a CustomGroupInfo object. + CXTCustomGroupInfo(); + // Summary: Destroys a CustomGroupInfo object, handles cleanup and de-allocation. + virtual ~CXTCustomGroupInfo(); + + void Copy(const CXTCustomGroupInfo* other); + void DeleteItems(); + void DeleteItem(int nIndex); + +private: + // no implementation + + CXTCustomGroupInfo(const CXTCustomGroupInfo& other); + CXTCustomGroupInfo& operator=(const CXTCustomGroupInfo& other); +}; + +// Summary: Array of custom groups +class CXTCustomGroups : public CTypedPtrArray +{ +public: + + // Summary: Constructs a CXTCustomGroups object. + CXTCustomGroups(); + // Summary: Destroys a CXTCustomGroups object, handles cleanup and de-allocation. + virtual ~CXTCustomGroups(); + void RemoveAll(); +}; + +// Summary: Definition of the drop target +interface IXTCustDropTarget +{ + + // Input: ptCursor - location in screen coordinates + // Returns: true to indicate the drop is possible + // Summary: Checks to see if cursor is over the target + virtual bool IsDropPoint(CPoint ptCursor) = 0; + + // Input: pInfo - item being dragged + // ptCursor - location in screen coordinates + // bCopyAllowed - OUT: tells if copy operation is acceptable + // Returns: true if the data has been accepted for the drop + // Summary: Drag cursor is over the target notification + virtual bool DragEnter(CXTCustomGroupItemInfo* pInfo,CPoint ptCursor,bool& bCopyAllowed) = 0; + + + // Input: ptCursor - location in screen coordinates + // Summary: Mouse is still over the target but position has changed + virtual void DragMove(CPoint ptCursor) = 0; + + // Summary: Mouse has left the building. + virtual void DragLeave() = 0; + + // Input: pInfo - item being dropped + // ptCursor - location in screen coordinates + // Summary: Mouse dropped, must accept the data + virtual void Drop(CXTCustomGroupItemInfo* pInfo,CPoint ptCursor) = 0; +}; + + +// Summary: A sink to report a drop target +interface IXTCustDropSink +{ + virtual void Add(IXTCustDropTarget* target) = 0; +}; + +// Summary: A connection point for objects involved in customize toolbar operations +class CXTCustomizeConnection : public CObject +{ + + bool m_bEnableCmdUI; + bool m_bCustMode; + CPoint m_startPoint; // Last known point of a newly created toolbar. + CObArray m_garbage; // Array of objects scheduled for garbage collection. + + +// Construction + +private: + CXTCustomizeConnection(); + +public: + static _XT_EXT_CLASS CXTCustomizeConnection* GetInstance(); + +// Operations + +public: + + // Summary: A delegate to check if the command shall be displayed in the customization dialog . + typedef CXTDelegate1Ret ISCUSTCMD; + ISCUSTCMD IsCustCmd; + + // Summary: A delegate to create new customizable control bar. + typedef CXTDelegate1 CREATEBAR; + CREATEBAR CreateBar; + + // Summary: A delegate to properly place newly created customizable control bar. + typedef CXTDelegate2 PLACEBAR; + PLACEBAR PlaceBar; + + // Summary: A delegate for to get info about custom command groups. + typedef CXTMultiCastDelegate1 GETCUSTOMGROUPS; + GETCUSTOMGROUPS GetCustomGroups; + + // Summary: A delegate to collect all command-to-icon associations. + typedef CXTMultiCastDelegate1 GETICONS; + GETICONS GetIcons; + + // Summary: A delegate for to get info about customizable control bars. + typedef CXTMultiCastDelegate1 GETCUSTOMBARINFO; + GETCUSTOMBARINFO GetCustomBarInfo; + + // Summary: A delegate for resetting tracking state. + typedef CXTMultiCastDelegate0 RESETTRACKING; + RESETTRACKING ResetTracking; + + // Summary: A delegate to receive notifications on customize mode on/off events. + typedef CXTMultiCastDelegate1 SETCUSTMODE; + SETCUSTMODE SetCustMode; + + // Summary: A delegate to obtain current drop targets. + typedef CXTMultiCastDelegate1 GETTARGETS; + GETTARGETS GetTargets; + + // Summary: Notifies that a control bar has been hidden/shown. + typedef CXTMultiCastDelegate2 ONSHOWHIDE; + ONSHOWHIDE OnShowHide; + + // Summary: Notifies a new customizable bar has been created. + typedef CXTMultiCastDelegate1 ONNEWBAR; + ONNEWBAR OnNewBar; + + // Summary: Notifies customizable bar has been renamed. + typedef CXTMultiCastDelegate2 ONBARRENAMED; + ONBARRENAMED OnBarRenamed; + + // Summary: Notifies customizable bar has been destroyed. + typedef CXTMultiCastDelegate1 ONBARDESTROYED; + ONBARDESTROYED OnBarDestroyed; + + // Summary: Returns a menu handle given its ID (a DWORD). + typedef CXTDelegate1Ret GETMENUPOPUP; + GETMENUPOPUP GetMenuPopup; + + // Summary: Application command removed event, gets ID of the command removed. + typedef CXTMultiCastDelegate1 ONCMDCHANGE; + ONCMDCHANGE OnCmdRemoved; + + // Returns: false if no data is in the profile. + // Summary: A delegate to define operation for persisting toolbars to/from the registry. + // Takes a parent frame pointer and a profile name to load from. + // Default refers to LoadDynamicBarsImp(). + typedef CXTDelegate2Ret PERSISTER; + + + PERSISTER LoadDynamicBars; // A delegate to load dynamic custom toolbars from the registry (defaults to LoadDynamicBarsImp()) + PERSISTER SaveDynamicBars; // A delegate to store dynamically created toolbars to the registry (defaults to SaveBarsImp()) + + // Summary: A delegate to find out if a command is defined in the app. + // Takes a command ID, returns true if the command is defined in the app. + // Default refers to IsAppCmdImp(). + typedef CXTDelegate1Ret ISAPPCMD; + ISAPPCMD IsAppCmd; + + // Returns: True if successful, otherwise returns false. + // Summary: Tells if customization is currently active. + bool IsCustMode() const; + + // Returns: True if successful, otherwise returns false. + // Summary: Tells if UI shall be enabled during customization (valid if IsCustMode() + // returns true). + bool IsEnableCmdUI() const; + + // Input: bEnableCmdUI - True to enable command. + // Summary: Sets the flag telling if UI shall be enabled during toolbar customization + // default (as set when toolbar customization is turned on) is true. + void SetEnableCmdUI(bool bEnableCmdUI); + + // Input: pTarget - Points to a CObject object. + // Summary: Removes a target. + void Remove(CObject* pTarget); + + // Input: pWnd - A window to capture the mouse + // canMove - True if the data can be moved to other locations + // pInfo - Item to move/copy + // Returns: true to indicate a move operation has been requested. + // Summary: Processes drag-n-drop during toolbar customization. + bool DragNDrop(CWnd* pWnd,bool canMove,CXTCustomGroupItemInfo* pInfo); + + // Input: pRequest - Points to a CXTNewCustomBarRequest object. + // Example: To customize, replace CreateBar delegate with you own version such as + // shown below: + //
+    //          BOOL CMyApp::InitInstance()
+    //          {
+    //                  CXTCustomizeConnection::GetInstance()->CreateBar =
+    //                      CXTCustomizeConnection::CREATEBAR(this,
+    //                      CXTCustomizeConnection::CREATEBAR::CB(OnCreateCustomBar));
+    //                  ..... other stuff ...
+    //          }
+    //          void CMyApp::OnCreateCustomBar(CXTNewCustomBarRequest* pRequest)
+    //          {
+    //                  // create default toolbar
+    //                  CXTCustomizeConnection::GetInstance()->CreateBarImp(pRequest);
+    //                  CXTCustomToolBar* pBar = (CXTCustomToolBar*)pRequest->m_pNewBar;
+    //               .... customize pBar ....
+    //          }
+ // Summary: Default implementation of the CreateBar delegate. + // It creates CXTCustomToolBar objects. + void CreateBarImp(CXTNewCustomBarRequest* pRequest); + + // Input: obj - Points to a CObject object. + // Summary: VC7 has ushered a bug that they call DestroyWindow() twice on the same dangling pointer + // hence effectively precluding you from using 'delete this' + // in PostNcDestroy(). All control bars created in your implementation: + // [ol] + // [li]shall not self-delete in PostNcDestroy()[/li] + // [li]shall use garbage collection facility below where obj is the object + // to be deleted later[/li] + // [/ol] + void ScheduleGC(CObject* obj); + + // Summary: Companion to ScheduleGC() that actually deletes cached objects, called + // when it is safe to do so. + void RunGC(); + + // Input: nCmdID - Comamnd identifier. + // Returns: True if successful, otherwise returns false. + // Summary: Default implementation of the IsCustCmd delegate. + // This function filters out IDs for MRU file list (ID_FILE_MRU1 thru 16) + // Example: To customize, replace IsCustomizableCommand delegate with you own + // version such as shown below. + //
+    //          BOOL CMyApp::InitInstance()
+    //          {
+    //                  CXTCustomizeConnection::GetInstance()->IsCustCmd =
+    //                      CXTCustomizeConnection::ISCUSTCMD(this,
+    //                      CXTCustomizeConnection::ISCUSTCMD::CB(IsCustCmd));
+    //                  ..... other stuff ...
+    //          }
+    //          bool CMyApp::IsCustCmd(UINT nCmdID)
+    //          {
+    //                  return CXTCustomizeConnection::GetInstance()->IsCustCmdImp(nCmdID) &&
+    //                          nCmdID != ID_A_COMMAND;
+    //          }
+ bool IsCustCmdImp(UINT nCmdID); + + // Input: pFrame - Points to a CFrameWnd object. + // lpszProfileName - Profile name to store in registry. + // Returns: True if successful, otherwise returns false. + // Summary: Default implementation of restoring dynamic custom toolbars + // from the data persistently stored in the registry. + bool LoadDynamicBarsImp(CFrameWnd* pFrame, LPCTSTR lpszProfileName); + + // Input: pFrame - Points to a CFrameWnd object. + // lpszProfileName - Profile name to store in registry. + // Returns: True if successful, otherwise returns false. + // Summary: Default implementation of saving dynamic custom toolbars + // to the data persistently stored in the registry. + bool SaveDynamicBarsImp(CFrameWnd* pFrame, LPCTSTR lpszProfileName); + + // Input: pFrame - Points to a CFrameWnd object. + // pBar - Points to a CControlBar object. + // Summary: Default implementation of newly created toolbar placement + // Floats the control bar. + void PlaceBarImp(CFrameWnd* pFrame, CControlBar* pBar); + +private: + void OnSetCustMode(bool bMode); +}; + + +////////////////////////////////////////////////////////////////////////////// + +AFX_INLINE bool CXTCustomizeConnection::IsCustMode() const { + return m_bCustMode; +} +AFX_INLINE bool CXTCustomizeConnection::IsEnableCmdUI() const { + return m_bEnableCmdUI; +} +AFX_INLINE void CXTCustomizeConnection::SetEnableCmdUI(bool bEnableCmdUI) { + m_bEnableCmdUI = bEnableCmdUI; +} +////////////////////////////////////////////////////////////////////////////// + + +#endif //__XTCUSTOMIZEAPI_H__ diff --git a/Editor/XT/Include/XTCustomizePage.h b/Editor/XT/Include/XTCustomizePage.h new file mode 100644 index 0000000..7ded3b7 --- /dev/null +++ b/Editor/XT/Include/XTCustomizePage.h @@ -0,0 +1,449 @@ +// XTCustomizePage.h interface for the CXTCustToolBarPage class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCUSTOMIZEPAGE_H__) +#define __XTCUSTOMIZEPAGE_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// forwards + +class CXTCustomizeSheet; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCustomizeContext is a CObject derived class. It creates a customization +// context. +class CXTCustomizeContext : public CObject +{ + +private: + CFrameWnd* const m_pFrameWnd; // A frame on which customizations are executed. + +public: + + // Input: pFrameWnd - A pointer to a CFrameWnd object. + // Summary: Constructs a CXTCustomizeContext object. + CXTCustomizeContext(CFrameWnd* pFrameWnd); + + // Summary: Destroys a CXTCustomizeContext object, handles cleanup and de-allocation. + virtual ~CXTCustomizeContext(); + + // Returns: A pointer to a CFrameWnd. + // Summary: This member function gets the frame being customized. + CFrameWnd* GetFrame() const; + +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CFrameWnd* CXTCustomizeContext::GetFrame() const { + return m_pFrameWnd; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCustToolBarPage is a multiple inheritance class derived from CXTDialogState +// and CXTResizePropertyPage. It is displayed during toolbar customization as the +// first page in the customize tab control. +class _XT_EXT_CLASS CXTCustToolBarPage : CXTDialogState, public CXTResizePropertyPage +{ + DECLARE_DYNAMIC(CXTCustToolBarPage) + + // Summary: Descriptor of a toolbar rendered on this page. + typedef CXTCustomControlBarInfo TBINFO; + + // Summary: Array of toolbars rendered on this page. + // NB: Can contain zeroed spots for destroyed control bars. + CArray m_infos; + + // Summary: Current customization context. + CXTCustomizeContext* const m_context; + +public: + + // Input: context - Current customization context. + // Summary: Constructs a CXTCustToolBarPage object. + CXTCustToolBarPage(CXTCustomizeContext* context); + + // Summary: Destroys a CXTCustToolBarPage object, handles cleanup and de-allocation. + virtual ~CXTCustToolBarPage(); + + //{{AFX_DATA(CXTCustToolBarPage) + + enum { IDD = XT_IDD_CUSTPAGE1 }; + CXTCheckListBox m_checkList; + CButton m_resetButton; + CButton m_renameButton; + CButton m_deleteButton; + CButton m_newButton; + //}}AFX_DATA + + // Ignore: + //{{AFX_VIRTUAL(CXTCustToolBarPage) +protected: + virtual void DoDataExchange(CDataExchange* pDX); + virtual BOOL OnInitDialog(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTCustToolBarPage) + afx_msg void OnChkChange(); + afx_msg void OnNew(); + afx_msg void OnSelchangeChecklist(); + afx_msg void OnRename(); + afx_msg void OnDelete(); + afx_msg void OnDestroy(); + afx_msg void OnClear(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() + + // Input: nSel - Index of the list box item to select. + // Summary: This member function is called by the page to set the selection + // in the toolbar list box. + void SetSelectItem(int nSel=0); + + // Input: pInfo - A pointer to a CXTCustomControlBarInfo object. + // Returns: An int value. + // Summary: This member function adds an item. + int AddItem(CXTCustomControlBarInfo* pInfo); + + // Input: pBar - A pointer to a CControlBar object. + // Summary: This member function removes an item by its position in the context. + void OnBarDestroyed(CControlBar* pBar); + + // Input: pBar - A pointer to a CControlBar object. + // Returns: An int value. + // Summary: This member function finds an item index by its position in the context. + int CXTCustToolBarPage::FindItem(CControlBar* pBar) const; + + // Input: pBar - A pointer to a CControlBar object. + // bVisible - True to show, false to hide. + // Summary: This member function is called when a control bar's visibility changes. + void OnShowHideBar(CControlBar* pBar,bool bVisible); + + // Input: pBar - A pointer to a CControlBar object. + // pszText - A pointer to a string. + // Summary: This member function is called when a control bar is renamed. + void OnBarRenamed(CControlBar* pBar, LPCTSTR pszText); + + // Input: pInfo - A pointer to a CXTCustomControlBarInfo object. + // Summary: This member function adds custom bar information. + void StoreInfo(CXTCustomControlBarInfo* pInfo); + + // Input: pInfo - A pointer to a CXTCustomControlBarInfo object. + // Summary: This member function adds custom bar information. + void StoreNewInfo(CXTCustomControlBarInfo* pInfo); +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCustCommandsPage is a multiple inheritance class derived from CXTDialogState, +// CXTResizePropertyPage, and CXTCommandsListBox::ISite. It is displayed during +// toolbar customization as the second page in the customize tab control. +class _XT_EXT_CLASS CXTCustCommandsPage : CXTDialogState, + public CXTResizePropertyPage, + public CXTCommandsListBox::ISite +{ + DECLARE_DYNAMIC(CXTCustCommandsPage) + + CXTIconMap m_iconMap; // A map of command IDs to their icons. + CXTCustomGroups m_groups; // Array of groups. + CXTCustomizeContext* const m_context; // Current customization context. + +public: + + // Input: context - Current customization context. + // Summary: Constructs a CXTCustCommandsPage object. + CXTCustCommandsPage(CXTCustomizeContext* context); + + + // Summary: Destroys a CXTCustCommandsPage object, handles cleanup and de-allocation. + virtual ~CXTCustCommandsPage(); + + //{{AFX_DATA(CXTCustCommandsPage) + + enum { IDD = XT_IDD_CUSTPAGE2 }; + CXTCommandsListBox m_listCommands; + CXTListBox m_listGroups; + CButton m_btnDescription; + CStatic m_txtSelected; + //}}AFX_DATA + + CXTTipWindow m_tipWindow; // Displays information about the selected command. + + // Summary: The page calls this member function to update the commands list + // box contents. + void UpdateListContents(); + + // Input: bEnable - TRUE to enable, FALSE to disable. + // Summary: The page calls this member function to enable or disable the displayed + // dialog controls. + void SetEnableControls(BOOL bEnable); + + // Input: nCmdID - Position (item data) of the item in the list box. + // hIcon - destination to store command icon, valid if function returns true. + // hDisabledIcon - destination to store disabled command icon, can be NULL, valid if function returns true. + // hHotIcon - destination to store hot command icon, can be NULL, valid if function returns true. + // Returns: true if found, false otherwise + // Summary: This member function gets icons of a command . + // Implements CXTCommandsListBox::ISite interface. + virtual bool GetCommandIcon(UINT nCmdID,HICON& hIcon, HICON& hDisabledIcon,HICON& hHotIcon); + + // Input: pos - Position (item data) of the item in the list box. + // Returns: A UINT value. Implements CXTCommandsListBox::ISite interface. + // Summary: This member function gets a command ID by its position. + virtual UINT GetItemCommand(int pos); + + // Input: pos - Position (item data) of the item in the list box. + // Summary: This member function performs drag and drop of an item at the position + // provided. Implements CXTCommandsListBox::ISite interface. + virtual void DragNDrop(int pos); + + // Input: nCmdID - Command ID + // Summary: notification handler for a command removed event + void OnCmdRemoved(UINT nCmdID); + + // Ignore: + //{{AFX_VIRTUAL(CXTCustCommandsPage) +protected: + virtual void DoDataExchange(CDataExchange* pDX); + virtual BOOL OnInitDialog(); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTCustCommandsPage) + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + afx_msg void OnSelchangeListCategories(); + afx_msg void OnBtnDescription(); + afx_msg void OnSelchangeListCommands(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCustAccelerators is a multiple inheritance class derived from CXTDialogState +// and CXTResizePropertyPage. It is displayed during toolbar customization as the +// keyboard page in the customize tab control. This class is used to create a +// shortcut assignments dialog page for the keyboard tab in the customize dialog. +class _XT_EXT_CLASS CXTCustAccelerators : CXTDialogState, public CXTResizePropertyPage +{ + DECLARE_DYNAMIC(CXTCustAccelerators) + + + CXTCustomizeContext* const m_context; // Current customization context + +public: + + // Input: context - Current customization context. + // Summary: Constructs a CXTCustAccelerators object. + CXTCustAccelerators(CXTCustomizeContext* const context); + + // Summary: Destroys a CXTCustAccelerators object, handles cleanup and de-allocation. + virtual ~CXTCustAccelerators(); + + //{{AFX_DATA(CXTCustAccelerators) + + enum { IDD = XT_IDD_CUSTPAGE3 }; + CXTAccelKeyEdit m_editShortcutKey; + CXTListBox m_lboxKeys; + CXTListBox m_lboxCommands; + CComboBox m_comboCategory; + CString m_strTitle; + CString m_strDesc; + int m_iCategory; + //}}AFX_DATA + + // Ignore: + //{{AFX_VIRTUAL(CXTCustAccelerators) +public: + virtual BOOL OnSetActive(); + protected: + virtual void DoDataExchange(CDataExchange* pDX); + //}}AFX_VIRTUAL + + // Summary: This member function is called by the page to reload the list items. + void ReloadList(); + + // Summary: This member function is called by the page to enable the assignment buttons. + void EnableControls(); + +protected: + + // Ignore: + //{{AFX_MSG(CXTCustAccelerators) + virtual BOOL OnInitDialog(); + afx_msg void OnSelchangeCategory(); + afx_msg void OnSelchangeCommands(); + afx_msg void OnSelchangeCurKeys(); + afx_msg void OnChangeShortcutKey(); + afx_msg void OnAssign(); + afx_msg void OnResetAll(); + afx_msg void OnRemove(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +typedef CList CXTToolsList; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCustTools is a multiple inheritance class derived from CXTDialogState +// and CXTResizePropertyPage. It is displayed during toolbar customization as the +// second page in the customize tab control. +class _XT_EXT_CLASS CXTCustTools : CXTDialogState, public CXTResizePropertyPage +{ + DECLARE_DYNAMIC(CXTCustTools) + + // Summary: Current customization context + CXTCustomizeContext* const m_context; + +public: + + // Input: context - Current customization context. + // Summary: Constructs a CXTCustTools object. + CXTCustTools(CXTCustomizeContext* const context); + + // Summary: Destroys a CXTCustTools object, handles cleanup and de-allocation. + virtual ~CXTCustTools(); + + //{{AFX_DATA(CXTCustTools) + + enum { IDD = XT_IDD_CUSTPAGE4 }; + CStatic m_txtToolsDir; + CStatic m_txtToolsArg; + CStatic m_txtToolsCmd; + CString m_strToolsDir; + CString m_strToolsArg; + CString m_strToolsCmd; + CXTBrowseEdit m_editToolsDir; + CXTBrowseEdit m_editToolsArg; + CXTBrowseEdit m_editToolsCmd; + CXTEditListBox m_lboxToolsList; + //}}AFX_DATA + + CXTToolsList m_arTools; + XT_TOOL* m_pOldData; + + enum { XT_TOOLCMD, XT_TOOLARG, XT_TOOLDIR }; + + void UpdateToolsItem(LPCTSTR lpszText, int iWhich, bool bAppend); + void UpdateToolData(); + void EnableControls(bool bEnable); + void UpdateToolsList(); + void FreeToolsList(CXTToolsList& arTools, bool bAddTool=false); + bool ValidateTools(); + + // Ignore: + //{{AFX_VIRTUAL(CXTCustTools) +public: + virtual BOOL OnKillActive(); + protected: + virtual void DoDataExchange(CDataExchange* pDX); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTCustTools) + virtual BOOL OnInitDialog(); + afx_msg void OnSelchangeEditList(); + afx_msg void OnChangeToolsCmd(); + afx_msg void OnChangeToolsArg(); + afx_msg void OnChangeToolsDir(); + afx_msg void OnDestroy(); + //}}AFX_MSG + + afx_msg void OnLabelEditEnd(); + afx_msg void OnLabelEditCancel(); + afx_msg void OnNewItem(); + afx_msg void OnPreDeleteItem(); + afx_msg void OnDeleteItem(); + afx_msg void OnMoveItemUp(); + afx_msg void OnMoveItemDown(); + DECLARE_MESSAGE_MAP() +}; + +// forwards + +class CXTOptionsManager; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCustOptions is a multiple inheritance class derived from CXTDialogState +// and CXTResizePropertyPage. It is displayed during toolbar customization as the +// second page in the customize tab control. +class _XT_EXT_CLASS CXTCustOptions : CXTDialogState, public CXTResizePropertyPage +{ + DECLARE_DYNAMIC(CXTCustOptions) + + CXTCustomizeContext* const m_context; // Current customization context + +public: + + // Input: context - Current customization context. + // Summary: Constructs a CXTCustOptions object. + CXTCustOptions(CXTCustomizeContext* const context); + + // Summary: Destroys a CXTCustOptions object, handles cleanup and de-allocation. + virtual ~CXTCustOptions(); + + //{{AFX_DATA(CXTCustOptions) + + enum { IDD = XT_IDD_CUSTPAGE5 }; + CComboBox m_comboAnimationType; + CButton m_chkShowFull; + CButton m_chkToolBarAccelTips; + BOOL m_bMenuShadows; + BOOL m_bMenuRecentCommands; + BOOL m_bToolBarScreenTips; + BOOL m_bShowFullAfterDelay; + BOOL m_bToolBarAccelTips; + BOOL m_bToolBarVisualize; + int m_nAnimationType; + //}}AFX_DATA + + // Ignore: + //{{AFX_VIRTUAL(CXTCustOptions) +protected: + virtual void DoDataExchange(CDataExchange* pDX); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTCustOptions) + afx_msg void OnMenuShadows(); + afx_msg void OnRecentMenu(); + afx_msg void OnShowFull(); + afx_msg void OnBtnReset(); + afx_msg void OnScreenTips(); + afx_msg void OnShowShortcutKeys(); + afx_msg void OnVisualize(); + afx_msg void OnAnimation(); + virtual BOOL OnInitDialog(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() + + void AddString( UINT nIDResource ); +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTCUSTOMIZEPAGE_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTCustomizeSheet.h b/Editor/XT/Include/XTCustomizeSheet.h new file mode 100644 index 0000000..6cb2a8f --- /dev/null +++ b/Editor/XT/Include/XTCustomizeSheet.h @@ -0,0 +1,107 @@ +// XTCustomizeSheet.h interface for the CXTCustomizeSheet class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTCUSTOMIZESHEET_H__) +#define __XTCUSTOMIZESHEET_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTCustomizeSheet is a multiple inheritance class derived from CXTDialogState +// and CXTResizePropertySheet. It is a property sheet that is displayed during +// toolbar customization. +class _XT_EXT_CLASS CXTCustomizeSheet : CXTDialogState, public CXTResizePropertySheet +{ + DECLARE_DYNAMIC(CXTCustomizeSheet) + + CMap m_map; // A map to store active custom bars that get mouse input. + +public: + + // BULLETED LIST: + + // Input: pFrameWnd - Pointer to the frame window on which to execute customizations. + // dwCustStyle - Specifies which pages to include when the customize dialog is + // displayed. It can be one or more of the following: + // [ul] + // [li]CUST_XT_TOOLBARS Displays the Toolbars tab in the toolbar customize property sheet.[/li] + // [li]CUST_XT_COMMANDS Displays the Commands tab in the toolbar customize property sheet.[/li] + // [li]CUST_XT_KEYBOARD Displays the Keyboard tab in the toolbar customize property sheet.[/li] + // [li]CUST_XT_TOOLS Displays the Tools tab in the toolbar customize property sheet.[/li] + // [li]CUST_XT_OPTIONS Displays the Options tab in the toolbar customize property sheet.[/li] + // [li]CUST_XT_DEFAULT Same as CUST_XT_TOOLBARS|CUST_XT_COMMANDS|CUST_XT_KEYBOARD|CUST_XT_OPTIONS.[/li] + // If no flags are defined the constructor will ASSERT. + // Summary: Constructs a CXTCustomizeSheet object. + CXTCustomizeSheet(CFrameWnd* pFrameWnd,DWORD dwCustStyle); + + // Summary: Destroys a CXTCustomizeSheet object, handles cleanup and de-allocation. + virtual ~CXTCustomizeSheet(); + + bool m_bAppActive; // true if the application is currently active, or false otherwise. + CRect m_rcPage; // Size for each page displayed. + CXTCustTools* m_pPage4; // Fourth property page. + CXTCustOptions* m_pPage5; // Fifth property page. + CXTCustToolBarPage* m_pPage1; // First property page. + CXTCustomizeContext m_context; // Current context. + CXTCustCommandsPage* m_pPage2; // Second property page. + CXTCustAccelerators* m_pPage3; // Third property page. + + // Input: bMode - true to enable toolbar customization. + // Summary: This member function sets the customization mode on or off in all applicable + // control bars. + void SetCustMode(bool bMode); + + // Ignore: + //{{AFX_VIRTUAL(CXTCustomizeSheet) + public: + virtual BOOL OnInitDialog(); + virtual INT_PTR DoModal(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTCustomizeSheet) + afx_msg void OnDestroy(); + afx_msg BOOL OnNcActivate(BOOL bActive); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnCloseBtn(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() + +private: + + CFrameWnd* m_pWndParent; + + bool FilterMouse(LPARAM lParam); + bool FilterKey(LPARAM lParam); + void StoreInfo(CXTCustomControlBarInfo* pInfo); + void OnBarDestroyed(CControlBar* pBar); + + friend class CXTCustomizeContext; + friend class CXTCustToolBarPage; + friend class CXTCustCommandsPage; + friend class CXTCustAccelerators; + friend class CXTCustTools; + friend class CXTCustOptions; +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTCUSTOMIZESHEET_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTDateTimeCtrl.h b/Editor/XT/Include/XTDateTimeCtrl.h new file mode 100644 index 0000000..cf54c96 --- /dev/null +++ b/Editor/XT/Include/XTDateTimeCtrl.h @@ -0,0 +1,759 @@ +// XTDateTimeCtrl.h interface for the CXTDateTimeCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTDATETIMECTRL_H__) +#define __XTDATETIMECTRL_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// class forwards + +class CXTMonthCalCtrl; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTDateTimeCtrl is a CWnd derived class. A CXTDateTimeCtrl object encapsulates +// the functionality of a date and time picker control. The date and time +// picker control (DTP control) provides a simple interface to exchange +// date and time information with a user. This interface contains fields, +// each of which displays a part of the date and time information stored +// in the control. The user can change the information stored in the control +// by changing the content of the string in a given field. The user can +// move from field to field using the mouse or the keyboard. +// +// You can customize the date and time picker control by applying a variety +// of styles to the object when you create it. See Date and Time Picker +// Control Styles in the Platform SDK for more information about styles +// specific to the date and time picker control. You can set the display +// format of the DTP control using format styles. These format styles +// are described in Preset DTP Display Formats in the Platform SDK. +// +// The date and time picker control also uses notifications and callbacks, +// which are described in Using CXTDateTimeCtrl in the Xtreme Toolkit online +// help. +class _XT_EXT_CLASS CXTDateTimeCtrl : public CWnd +{ + DECLARE_DYNAMIC(CXTDateTimeCtrl) + +public: + + // Summary: Constructs a CXTDateTimeCtrl object. + CXTDateTimeCtrl(); + + // Summary: Destroys a CXTDateTimeCtrl object, handles cleanup and de-allocation. + virtual ~CXTDateTimeCtrl(); + + // Input: dwStyle - Specifies the combination of date time control + // styles. See Date and Time Picker Control Styles + // in the Platform SDK for more information about + // date and time picker styles. + // rect - A reference to a RECT structure, which is the + // position and size of the date and time picker control. + // pParentWnd - A pointer to a CWnd object that is the parent + // window of the date and time picker control. It + // must not be NULL. + // nID - Specifies the date and time picker control's + // control ID. + // Returns: Nonzero if creation was successful, otherwise returns 0. + // Summary: This member function creates the date and time picker control and + // attaches it to the CXTDateTimeCtrl object. + BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID); + + // Input: iColor - An int value specifying which color area of the month calendar + // to retrieve. For a list of values, see the 'iColor' parameter for + // SetMonthCalColor. + // Returns: A COLORREF value that represents the color setting for the specified + // portion of the month calendar control if successful. The function + // returns -1 if unsuccessful. + // Summary: This member function retrieves the color for a given portion of + // the month calendar within the date and time picker control. + COLORREF GetMonthCalColor(int iColor) const; + + // BULLETED LIST: + + // Input: iColor - An int value specifying which area of the month calendar + // control to set. This value can be one of the following: + // [ul] + // [li]MCSC_BACKGROUND Set the background color displayed + // between months.[/li] + // [li]MCSC_MONTHBK Set the background color displayed + // within a month.[/li] + // [li]MCSC_TEXT Set the color used to display text within + // a month.[/li] + // [li]MCSC_TITLEBK Set the background color displayed + // in the calendar's title.[/li] + // [li]MCSC_TITLETEXT Set the color used to display text + // within the calendar's title.[/li] + // [li]MCSC_TRAILINGTEXT Set the color used to display + // header and trailing-day text. Header and trailing days are the + // days from the previous and following months that appear on the + // current calendar.[/li] + // [/ul] + // ref - A RGB value representing the color that will be set + // for the specified area of the month calendar. + // Returns: A COLORREF value that represents the previous color setting for the specified + // portion of the month calendar control if successful. Otherwise, the + // message returns -1. + // Summary: This member function sets the color for a given portion of the month + // calendar within a date and time picker control. Returns + COLORREF SetMonthCalColor(int iColor,COLORREF ref); + + // Input: pstrFormat - A pointer to a zero-terminated format string that + // defines the desired display. Setting this parameter to + // NULL will reset the control to the default format + // string for the current style. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the display of a date and time picker + // control based on a given format string. + BOOL SetFormat(LPCTSTR pstrFormat); + + // Returns: A pointer to a DDX_XTMonthCalCtrl object, + // or NULL if unsuccessful or the window is not visible. + // Summary: This member function retrieves the date and time picker's child + // month calendar control. + CXTMonthCalCtrl* GetMonthCalCtrl() const; + + // Returns: A pointer to a CFont object, or returns NULL if unsuccessful. + // Summary: This member function retrieves the font currently used by the date + // and time picker control's child month calendar control. + CFont* GetMonthCalFont() const; + + // Input: hFont - Handle to the font that will be set. + // bRedraw - Specifies whether the control should be redrawn + // immediately upon setting the font. Setting this + // parameter to TRUE causes the control to redraw itself. + // Summary: This member function sets the font to be used by the date and time + // picker control's child month calendar control. + void SetMonthCalFont(HFONT hFont,BOOL bRedraw = TRUE); + + // Input: pMinRange - A pointer to a COleDateTime object containing the + // earliest time allowed in the CXTDateTimeCtrl object. + // pMaxRange - A pointer to a COleDateTime object containing the + // latest time allowed in the CXTDateTimeCtrl object. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the minimum and maximum allowable system + // times for a date and time picker control. + BOOL SetRange(const COleDateTime* pMinRange,const COleDateTime* pMaxRange); + + // Input: pMinRange - A pointer to a CTime object containing the earliest + // time allowed in the CXTDateTimeCtrl object. + // pMaxRange - A pointer to a CTime object containing the latest + // time allowed in the CXTDateTimeCtrl object. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the minimum and maximum allowable system + // times for a date and time picker control. + BOOL SetRange(const CTime* pMinRange,const CTime* pMaxRange); + + // Input: pMinRange - A pointer to a CTime object containing the earliest + // time allowed in the CXTDateTimeCtrl object. + // pMaxRange - A pointer to a CTime object containing the latest + // time allowed in the CXTDateTimeCtrl object. + // Returns: A DWORD value containing flags that indicate which ranges are set. + // Summary: This member function retrieves the current minimum and maximum allowable + // system times for a date and time picker control. Returns + DWORD GetRange(COleDateTime* pMinRange,COleDateTime* pMaxRange) const; + + // Input: pMinRange - A pointer to a CTime object containing the earliest + // time allowed in the CXTDateTimeCtrl object. + // pMaxRange - A pointer to a CTime object containing the latest + // time allowed in the CXTDateTimeCtrl object. + // Returns: A DWORD value containing flags that indicate which ranges are set. + // Summary: This member function retrieves the current minimum and maximum allowable + // system times for a date and time picker control. + DWORD GetRange(CTime* pMinRange,CTime* pMaxRange) const; + + // Input: pTimeNew - A pointer to a CTime object containing the time to + // which the control will be set. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the time in a date and time picker control. + BOOL SetTime(const CTime* pTimeNew); + + // Input: timeNew - A reference to a COleDateTime object containing the time to + // which the control will be set. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the time in a date and time picker control. + BOOL SetTime(const COleDateTime& timeNew); + + // Input: pTimeNew - A pointer to a SYSTEMTIME structure containing + // the time to which the control will be set. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the time in a date and time picker control. + BOOL SetTime(LPSYSTEMTIME pTimeNew = NULL); + + // Input: timeDest - A reference to a CTime object that will receive + // the system time information. + // Returns: A DWORD value equal to the dwFlag member set in the NMDATETIMECHANGE + // structure. + // Summary: This member function retrieves the currently selected time from + // a date and time picker control and places it in a specified SYSTEMTIME + // structure. + DWORD GetTime(CTime& timeDest) const; + + // Input: timeDest - A reference to a COleDateTime object that will + // receive the system time information. + // Returns: Nonzero if the time is successfully written to the + // COleDateTime object, otherwise returns zero. + // Summary: This member function retrieves the currently selected time from + // a date and time picker control and places it in a specified SYSTEMTIME + // structure. + BOOL GetTime(COleDateTime& timeDest) const; + + // Input: pTimeDest - A pointer to the SYSTEMTIME structure to receive + // the system time information. Must not be NULL. + // Returns: A DWORD value equal to the dwFlag member set in the NMDATETIMECHANGE + // structure. + // Summary: This member function retrieves the currently selected time from + // a date and time picker control and places it in a specified SYSTEMTIME + // structure. + DWORD GetTime(LPSYSTEMTIME pTimeDest) const; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTDateTimeCtrl::CXTDateTimeCtrl() { + +} +AFX_INLINE CFont* CXTDateTimeCtrl::GetMonthCalFont() const { + ASSERT(::IsWindow(m_hWnd)); return CFont::FromHandle((HFONT) ::SendMessage(m_hWnd, DTM_GETMCFONT, 0, 0)); +} +AFX_INLINE CXTMonthCalCtrl* CXTDateTimeCtrl::GetMonthCalCtrl() const { + ASSERT(::IsWindow(m_hWnd)); return (CXTMonthCalCtrl*) CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, DTM_GETMONTHCAL, 0, 0)); +} +AFX_INLINE void CXTDateTimeCtrl::SetMonthCalFont(HFONT hFont, BOOL bRedraw /* = TRUE */) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, DTM_SETMCFONT, (WPARAM) hFont, MAKELONG(bRedraw, 0)); +} +AFX_INLINE COLORREF CXTDateTimeCtrl::SetMonthCalColor(int iColor, COLORREF ref) { + ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, DTM_SETMCCOLOR, (WPARAM) iColor, (LPARAM) ref); +} +AFX_INLINE DWORD CXTDateTimeCtrl::GetTime(LPSYSTEMTIME pTimeDest) const { + ASSERT(::IsWindow(m_hWnd)); ASSERT(pTimeDest != NULL); return (DWORD) ::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM) pTimeDest); +} +AFX_INLINE COLORREF CXTDateTimeCtrl::GetMonthCalColor(int iColor) const { + ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, DTM_GETMCCOLOR, (WPARAM) iColor, 0); +} +AFX_INLINE BOOL CXTDateTimeCtrl::SetFormat(LPCTSTR pstrFormat) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, DTM_SETFORMAT, 0, (LPARAM) pstrFormat); +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMonthCalCtrl is a CWnd derived class. A CXTMonthCalCtrl object encapsulates +// the functionality of a month calendar control. The month calendar control +// provides the user with a simple calendar interface, from which the user +// can select a date. The user can change the display by: +// [ul] +// [li]Scrolling backward and forward, from month to month.[/li] +// [li]Clicking the Today text to display the current day (if the MCS_NOTODAY +// style is not used).[/li] +// [li]Picking a month or a year from a popup menu.[/li] +// [/ul] +// You can customize the month calendar control by applying a variety of +// styles to the object when you create it. These styles are described +// in Month Calendar Control Styles in the Platform SDK. +// +// The month calendar control can display more than one month, and it can +// indicate special days, such as holidays, by bolding the date. +// +// For more information on using the month calendar control, see Using +// CXTMonthCalCtrl in the Xtreme Toolkit online help. +class _XT_EXT_CLASS CXTMonthCalCtrl : public CWnd +{ + DECLARE_DYNAMIC(CXTMonthCalCtrl) + +public: + + // Summary: Constructs a CXTMonthCalCtrl object. + CXTMonthCalCtrl(); + + // Summary: Destroys a CXTMonthCalCtrl object, handles cleanup and de-allocation. + virtual ~CXTMonthCalCtrl(); + + // Input: dwStyle - Specifies the combination of Windows styles applied to the month + // calendar control. See Month Calendar Control Styles in the Platform + // SDK for more information about the styles. + // rect - A reference to a RECT structure. Contains the position + // and size of the month calendar control + // pParentWnd - A pointer to a CWnd object that is the parent window + // of the month calendar control. It must not be NULL. + // nID - Specifies the month calendar control’s control ID. + // Returns: Nonzero if initialization was successful, otherwise returns zero. + // Summary: This member function creates a month calendar control and attaches + // it to the DDX_XTMonthCalCtrl object. + BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID); + + // Input: dwStyle - Specifies the combination of Windows styles applied to the month + // calendar control. See Month Calendar Control Styles in the Platform + // SDK for more information about the styles. + // pt - A reference to a POINT structure that identifies the location + // of the month calendar control. + // pParentWnd - A pointer to a CWnd object that is the parent window + // of the month calendar control. It must not be NULL. + // nID - Specifies the month calendar control’s control ID. + // Returns: Nonzero if initialization was successful, otherwise returns zero. + // Summary: This member function creates a month calendar control and attaches + // it to the DDX_XTMonthCalCtrl object. + BOOL Create(DWORD dwStyle,const POINT& pt,CWnd* pParentWnd,UINT nID); + + // Input: pRect - A pointer to a RECT structure that will receive + // bounding rectangle information. This parameter must be a valid + // address and cannot be NULL. + // Returns: Nonzero and 'lpRect' receives the applicable bounding information. If + // unsuccessful, this member function returns zero. + // Summary: This member function retrieves the minimum size required to show + // a full month in a month calendar control. + BOOL GetMinReqRect(RECT* pRect) const; + + // Input: iDelta - The number of months to be set as the control's scroll rate. + // If this value is zero, the month delta is reset to the default, which + // is the number of months displayed in the control. + // Returns: The previous scroll rate. If the scroll rate has not been previously + // set, the return value is zero. + // Summary: This member function sets the scroll rate for a month calendar control. + int SetMonthDelta(int iDelta); + + // Returns: An integer value that represents the scroll rate for the month calendar + // control. + // Summary: This member function retrieves the scroll rate for a month calendar + // control. The scroll rate is the number of months that the control + // moves its display when the user clicks a scroll button once. + int GetMonthDelta() const; + + // Input: iDay - An integer value representing which day is to be set as the + // first day of the week. This value must be one of the day numbers. + // See GetFirstDayOfWeek for a description of the day numbers. + // lpnOld - A pointer to an integer indicating the first day of + // the week previously set. + // Returns: Nonzero if the previous first day of the week is set to a value other than + // that of LOCALE_IFIRSTDAYOFWEEK, which is the day indicated in the control + // panel setting. Otherwise, this function returns zero. + // Summary: This member function sets the day of the week to be displayed in + // the leftmost column of the calendar. + BOOL SetFirstDayOfWeek(int iDay,int* lpnOld = NULL); + + // Input: pbLocal - A pointer to a BOOL value. If the value is nonzero, the control's + // setting does not match the setting in the control panel. + // Returns: An integer value that represents the first day of the week. The days of the week are + // represented by integers, as follows: + //
+	//			Value   Day of the Week
+    //			0       Monday
+    //			1       Tuesday
+    //			2       Wednesday
+    //			3       Thursday
+    //			4       Friday
+    //			5       Saturday
+    //			6       Sunday
+	//			
+ // Summary: This member function gets the first day of the week to be displayed + // in the left most column of the calendar. + int GetFirstDayOfWeek(BOOL* pbLocal = NULL) const; + + // Input: nRegion - The region of the month calendar control from which the color + // is retrieved. For a list of values, see the 'nRegion' parameter of SetColor. + // Returns: A COLORREF value specifying the color associated + // with the portion of the month calendar control, if successful. + // Otherwise, this member function returns -1. + // Summary: This member function gets the color of a specified area of a month + // calendar control. + COLORREF GetColor(int nRegion) const; + + // BULLETED LIST: + + // Input: nRegion - An integer value specifying which month calendar color + // to set. This value can be one of the following: + // [ul] + // [li]MCSC_BACKGROUND The background color displayed between + // months.[/li] + // [li]MCSC_MONTHBK The background color displayed within + // the month.[/li] + // [li]MCSC_TEXT The color used to display text within a month.[/li] + // [li]MCSC_TITLEBK The background color displayed in the + // calendar's title.[/li] + // [li]MCSC_TITLETEXT The color used to display text within + // the calendar's title.[/li] + // [li]MCSC_TRAILINGTEXT The color used to display header + // and trailing-day text. Header and trailing days are the days + // from the previous and following months that appear on the current + // calendar.[/li] + // [/ul] + // ref - A COLORREF value for the new color setting for the specified + // portion of the month calendar control. + // Returns: A COLORREF value that represents the previous + // color setting for the specified portion of the month calendar + // control, if successful. Otherwise this message returns -1. + // Summary: This member function sets the color of a specified area of a month + // calendar control. + COLORREF SetColor(int nRegion,COLORREF ref); + + // Input: bRepaint - Specifies whether the control is to be repainted. By default, + // TRUE. If FALSE, no repainting occurs. + // Returns: Nonzero if the month calendar control is sized to its minimum, otherwise + // returns zero. + // Summary: This member function repaints the month calendar control to its + // minimum, one-month size. + BOOL SizeMinReq(BOOL bRepaint = TRUE); + + // Input: refDateTime - A reference to a COleDateTime object that contains the current + // date. + // Summary: This member function sets the calendar control to the current day. + void SetToday(const COleDateTime& refDateTime); + + // Input: pDateTime - A pointer to a CTime object containing the current date + // information. + // Summary: This member function sets the calendar control to the current day. + void SetToday(const CTime* pDateTime); + + // Input: pDateTime - A pointer to a SYSTEMTIME structure that + // contains the current date information. + // Summary: This member function sets the calendar control to the current day. + void SetToday(const LPSYSTEMTIME pDateTime); + + // Input: refTime - A reference to a CTime object indicating the current day. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function retrieves the date information for the date specified + // as "today" for a month calendar control. + BOOL GetToday(CTime& refTime) const; + + // Input: refDateTime - A reference to a COleDateTime object indicating the current day. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function retrieves the date information for the date specified + // as "today" for a month calendar control. + BOOL GetToday(COleDateTime& refDateTime) const; + + // Input: pDateTime - A pointer to a SYSTEMTIME structure that + // will receive the date information. This parameter must be + // a valid address and cannot be NULL. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function retrieves the date information for the date specified + // as "today" for a month calendar control. + BOOL GetToday(LPSYSTEMTIME pDateTime) const; + + // Input: pDateTime - A pointer to a SYSTEMTIME structure that will receive the currently selected + // date information. This parameter must be a valid address and cannot + // be NULL. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function retrieves the system time as indicated by the + // currently selected date. + BOOL GetCurSel(LPSYSTEMTIME pDateTime) const; + + // Input: refDateTime - A reference to a CTime object. It receives the current time. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function retrieves the system time as indicated by the + // currently selected date. + BOOL GetCurSel(CTime& refDateTime) const; + + // Input: refDateTime - A reference to a COleDateTime object. It receives the current time. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function retrieves the system time as indicated by the + // currently selected date. + BOOL GetCurSel(COleDateTime& refDateTime) const; + + // Input: pDateTime - Pointer to a SYSTEMTIME structure that contains the date to + // be set as the current selection. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the currently selected date for a month calendar + // control. + BOOL SetCurSel(const LPSYSTEMTIME pDateTime); + + // Input: refDateTime - A reference to a CTime object indicating the currently selected + // month calendar control. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the currently selected date for a month calendar + // control. + BOOL SetCurSel(const CTime& refDateTime); + + // Input: refDateTime - A reference to a COleDateTime indicating the currently selected + // month calendar control. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the currently selected date for a month calendar + // control. + BOOL SetCurSel(const COleDateTime& refDateTime); + + // Input: nMonths - Value indicating how many elements are in the array that 'pStates' + // points to. + // pStates - A pointer to a MONTHDAYSTATE array of values that define + // how the month calendar control will draw each day in its + // display. The MONTHDAYSTATE data type is a bit field, where + // each bit (1 through 31) represents the state of a day in a + // month. If a bit is on, the corresponding day will be displayed + // in bold; otherwise it will be displayed with no emphasis. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the display for days in a month calendar control. + BOOL SetDayState(int nMonths,LPMONTHDAYSTATE pStates); + + // Input: nMax - Specifies the value that will be set to represent the maximum + // number of selectable days. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the maximum number of days that can be selected + // in a month calendar control. + BOOL SetMaxSelCount(int nMax); + + // Returns: An integer value that represents the total number of days that can be selected + // for the control. + // Summary: This member function retrieves the current maximum number of days that can + // be selected in a month calendar control. + int GetMaxSelCount() const; + + // Input: pMinRange - A pointer to a COleDateTime object containing + // the date at the lowest end of the range. + // pMaxRange - A pointer to a COleDateTime object containing the + // date at the highest end of the range. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the minimum and maximum allowable dates for a month + // calendar control. + BOOL SetRange(const COleDateTime* pMinRange,const COleDateTime* pMaxRange); + + // Input: pMinRange - A pointer to a CTime object containing the date at the lowest + // end of the range. + // pMaxRange - A pointer to a CTime object containing the date at the highest + // end of the range. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the minimum and maximum allowable dates for a month + // calendar control. + BOOL SetRange(const CTime* pMinRange,const CTime* pMaxRange); + + // Input: pMinRange - A pointer to a SYSTEMTIME structure containing + // the date at the lowest end of the range. + // pMaxRange - A pointer to a SYSTEMTIME structure containing the + // date at the highest end of the range. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the minimum and maximum allowable dates for a month + // calendar control. + BOOL SetRange(const LPSYSTEMTIME pMinRange,const LPSYSTEMTIME pMaxRange); + + // BULLETED LIST: + + // Input: pMinRange - A pointer to a COleDateTime object containing + // the date at the lowest end of the range. + // pMaxRange - A pointer to a COleDateTime object containing the + // date at the highest end of the range. + // Returns: A DWORD that can be zero (no limits are set) or a combination + // of the following values that specify limit information: + // [ul] + // [li]GDTR_MAX A maximum limit is set for the control; pMaxRange + // is valid and contains the applicable date information.[/li] + // [li]GDTR_MIN A minimum limit is set for the control; pMinRange + // is valid and contains the applicable date information.[/li] + // [/ul] + // Summary: This member function retrieves the current minimum and maximum dates set + // in a month calendar control. + DWORD GetRange(COleDateTime* pMinRange,COleDateTime* pMaxRange) const; + + // BULLETED LIST: + + // Input: pMinRange - A pointer to a CTime object containing the date at the lowest + // end of the range. + // pMaxRange - A pointer to a CTime object containing the date at the highest + // end of the range. + // Returns: A DWORD that can be zero (no limits are set) or a combination + // of the following values that specify limit information: + // [ul] + // [li]GDTR_MAX A maximum limit is set for the control; pMaxRange + // is valid and contains the applicable date information.[/li] + // [li]GDTR_MIN A minimum limit is set for the control; pMinRange + // is valid and contains the applicable date information.[/li] + // [/ul] + // Summary: This member function retrieves the current minimum and maximum dates set + // in a month calendar control. + DWORD GetRange(CTime* pMinRange,CTime* pMaxRange) const; + + // BULLETED LIST: + + // Input: pMinRange - A pointer to a SYSTEMTIME structure containing + // the date at the lowest end of the range. + // pMaxRange - A pointer to a COleDateTime object, a CTime object, + // or SYSTEMTIME structure containing the date at the highest + // end of the range. + // Returns: A DWORD that can be zero (no limits are set) or a combination + // of the following values that specify limit information: + // [ul] + // [li]GDTR_MAX A maximum limit is set for the control; pMaxRange + // is valid and contains the applicable date information.[/li] + // [li]GDTR_MIN A minimum limit is set for the control; pMinRange + // is valid and contains the applicable date information.[/li] + // [/ul] + // Summary: This member function retrieves the current minimum and maximum dates set + // in a month calendar control. + DWORD GetRange(LPSYSTEMTIME pMinRange,LPSYSTEMTIME pMaxRange) const; + + // BULLETED LIST: + + // Input: refMinRange - A reference to a COleDateTime object + // containing the minimum date allowed. + // refMaxRange - A reference to a COleDateTime object containing + // the maximum date allowed. + // dwFlags - Value specifying the scope of the range limits to + // be retrieved. This value must be one of the following: + // [ul] + // [li]GMR_DAYSTATE Include preceding and trailing months + // of visible range that are only partially displayed.[/li] + // [li]GMR_VISIBLE Include only those months that are entirely + // displayed.[/li] + // [/ul] + // Returns: An integer that represents the range, in months, spanned by the two + // limits indicated by 'refMinRange' and 'refMaxRange'. + // Summary: This member function retrieves date information representing the + // high and low limits of a month calendar control's display. + int GetMonthRange(COleDateTime& refMinRange,COleDateTime& refMaxRange,DWORD dwFlags) const; + + // BULLETED LIST: + + // Input: refMinRange - A reference to a CTime object containing the minimum date allowed. + // refMaxRange - A reference to a CTime object containing the maximum date allowed. + // dwFlags - Value specifying the scope of the range limits to + // be retrieved. This value must be one of the following: + // [ul] + // [li]GMR_DAYSTATE Include preceding and trailing months + // of visible range that are only partially displayed.[/li] + // [li]GMR_VISIBLE Include only those months that are entirely + // displayed.[/li] + // [/ul] + // Returns: An integer that represents the range, in months, spanned by the two + // limits indicated by 'refMinRange' and 'refMaxRange'. + // Summary: This member function retrieves date information representing the + // high and low limits of a month calendar control's display. + int GetMonthRange(CTime& refMinRange,CTime& refMaxRange,DWORD dwFlags) const; + + // BULLETED LIST: + + // Input: pMaxRange - A pointer to a SYSTEMTIME structure containing the date at the + // lowest end of the range. + // pMaxRange - A pointer to a SYSTEMTIME structure containing the date at the + // highest end of the range. + // dwFlags - Value specifying the scope of the range limits to + // be retrieved. This value must be one of the following: + // [ul] + // [li]GMR_DAYSTATE Include preceding and trailing months + // of visible range that are only partially displayed.[/li] + // [li]GMR_VISIBLE Include only those months that are entirely + // displayed.[/li] + // [/ul] + // Returns: An integer that represents the range, in months, spanned by the two + // limits indicated by 'refMinRange' and 'refMaxRange'. + // Summary: This member function retrieves date information representing the + // high and low limits of a month calendar control's display. + int GetMonthRange(LPSYSTEMTIME pMinRange,LPSYSTEMTIME pMaxRange,DWORD dwFlags) const; + + // Input: pMinRange - A pointer to a COleDateTime object containing + // the date at the lowest end of the range. + // pMaxRange - A pointer to a COleDateTime object containing the + // date at the highest end of the range. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the selection for a month calendar control + // to a given date range. + BOOL SetSelRange(const COleDateTime& pMinRange,const COleDateTime& pMaxRange); + + // Input: pMinRange - A pointer to a CTime object containing the date at the lowest + // end of the range. + // pMaxRange - A pointer to a CTime object containing the date at the highest + // end of the range. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the selection for a month calendar control + // to a given date range. + BOOL SetSelRange(const CTime& pMinRange,const CTime& pMaxRange); + + // Input: pMinRange - A pointer to a SYSTEMTIME structure containing the date at the + // lowest end of the range. + // pMaxRange - A pointer to a SYSTEMTIME structure containing the date at the + // highest end of the range. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets the selection for a month calendar control + // to a given date range. + BOOL SetSelRange(const LPSYSTEMTIME pMinRange,const LPSYSTEMTIME pMaxRange); + + // Input: refMinRange - A reference to a COleDateTime object containing the minimum + // date allowed. + // refMaxRange - A reference to a COleDateTime object containing the maximum + // date allowed. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function retrieves date information representing the + // upper and lower limits of the date range currently selected by the + // user. + BOOL GetSelRange(COleDateTime& refMinRange,COleDateTime& refMaxRange) const; + + // Input: refMinRange - A reference to a CTime object containing the minimum date + // allowed. + // refMaxRange - A reference to a CTime object containing the maximum date + // allowed. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function retrieves date information representing the + // upper and lower limits of the date range currently selected by the + // user. + BOOL GetSelRange(CTime& refMinRange,CTime& refMaxRange) const; + + // Input: pMinRange - A pointer to a SYSTEMTIME structure containing + // the date at the lowest end of the range. + // pMaxRange - A pointer to a SYSTEMTIME structure containing the + // date at the highest end of the range. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function retrieves date information representing the + // upper and lower limits of the date range currently selected by the + // user. + BOOL GetSelRange(LPSYSTEMTIME pMinRange,LPSYSTEMTIME pMaxRange) const; + + // Input: pMCHitTest - A pointer to a MCHITTESTINFO structure containing hit testing + // points for the month calendar control. + // Returns: A DWORD value equal to the 'uHit' member of the MCHITTESTINFO structure. + // Summary: This member function determines which portion of a month calendar + // control is at a given point on the screen. + DWORD HitTest(PMCHITTESTINFO pMCHitTest); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTMonthCalCtrl::CXTMonthCalCtrl() { + +} +AFX_INLINE DWORD CXTMonthCalCtrl::HitTest(PMCHITTESTINFO pMCHitTest) { + ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, MCM_HITTEST, 0, (LPARAM) pMCHitTest); +} +AFX_INLINE BOOL CXTMonthCalCtrl::GetMinReqRect(RECT* pRect) const { + ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETMINREQRECT, 0, (LPARAM) pRect); +} +AFX_INLINE int CXTMonthCalCtrl::SetMonthDelta(int iDelta) { + ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_SETMONTHDELTA, (WPARAM) iDelta, 0); +} +AFX_INLINE int CXTMonthCalCtrl::GetMonthDelta() const { + ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_GETMONTHDELTA, 0, 0); +} +AFX_INLINE COLORREF CXTMonthCalCtrl::GetColor(int nRegion) const { + ASSERT(m_hWnd != NULL); return (COLORREF) ::SendMessage(m_hWnd, MCM_GETCOLOR, (WPARAM) nRegion, 0); +} +AFX_INLINE COLORREF CXTMonthCalCtrl::SetColor(int nRegion, COLORREF ref) { + ASSERT(m_hWnd != NULL); return (COLORREF) ::SendMessage(m_hWnd, MCM_SETCOLOR, (WPARAM) nRegion, (LPARAM) ref); +} +AFX_INLINE BOOL CXTMonthCalCtrl::SetMaxSelCount(int nMax) { + ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_SETMAXSELCOUNT, nMax, 0); +} +AFX_INLINE int CXTMonthCalCtrl::GetMaxSelCount() const { + ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_GETMAXSELCOUNT, 0, 0); +} +AFX_INLINE void CXTMonthCalCtrl::SetToday(const LPSYSTEMTIME pDateTime) { + ASSERT(m_hWnd != NULL); ::SendMessage(m_hWnd, MCM_SETTODAY, 0, (LPARAM) pDateTime); +} +AFX_INLINE BOOL CXTMonthCalCtrl::GetToday(LPSYSTEMTIME pDateTime) const { + ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETTODAY, 0, (LPARAM) pDateTime); +} +AFX_INLINE BOOL CXTMonthCalCtrl::SetCurSel(const LPSYSTEMTIME pDateTime) { + ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_SETCURSEL, 0, (LPARAM) pDateTime); +} +AFX_INLINE BOOL CXTMonthCalCtrl::GetCurSel(LPSYSTEMTIME pDateTime) const { + ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM) pDateTime); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTDATETIMECTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTDefines.h b/Editor/XT/Include/XTDefines.h new file mode 100644 index 0000000..5ee4b65 --- /dev/null +++ b/Editor/XT/Include/XTDefines.h @@ -0,0 +1,1500 @@ +// XTDefines.h interface for the XT_AUX_DATA struct. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTDEFINES_H__) +#define __XTDEFINES_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#include + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTColorRef" +////////////////////////////////////////////////////////////////////////// + +const UINT XPCOLOR_BASE = 30; // An RGB value that represents the XP base color. +const UINT XPCOLOR_BARFACE = XPCOLOR_BASE; // An RGB value that represents the XP toolbar background color. +const UINT XPCOLOR_HIGHLIGHT = 31; // An RGB value that represents the XP menu item selected color. +const UINT XPCOLOR_HIGHLIGHT_BORDER = 32; // An RGB value that represents the XP menu item selected border color. +const UINT XPCOLOR_HIGHLIGHT_PUSHED = 33; // An RGB value that represents the XP menu item pushed color. +const UINT XPCOLOR_ICONSHADDOW = 34; // An RGB value that represents the XP menu item icon shadow +const UINT XPCOLOR_GRAYTEXT = 35; // An RGB value that represents the XP menu item disabled text color. +const UINT XPCOLOR_HIGHLIGHT_CHECKED = 36; // An RGB value that represents the XP menu item checked color. +const UINT XPCOLOR_HIGHLIGHT_CHECKED_BORDER = 37; // An RGB value that represents the XP menu item checked border color. +const UINT XPCOLOR_GRIPPER = 38; // An RGB value that represents the XP toolbar gripper color. +const UINT XPCOLOR_SEPARATOR = 39; // An RGB value that represents the XP toolbar separator color. +const UINT XPCOLOR_DISABLED = 40; // An RGB value that represents the XP menu icon disabled color. +const UINT XPCOLOR_MENUTEXT_BACK = 41; // An RGB value that represents the XP menu item text background color. +const UINT XPCOLOR_MENU_EXPANDED = 42; // An RGB value that represents the XP hidden menu commands background color. +const UINT XPCOLOR_MENU_BORDER = 43; // An RGB value that represents the XP menu border color. +const UINT XPCOLOR_MENUTEXT = 44; // An RGB value that represents the XP menu item text color. +const UINT XPCOLOR_HIGHLIGHT_TEXT = 45; // An RGB value that represents the XP menu item selected text color. +const UINT XPCOLOR_BARTEXT = 46; // An RGB value that represents the XP toolbar text color. +const UINT XPCOLOR_BARTEXT_PUSHED = 47; // An RGB value that represents the XP toolbar pushed text color. +const UINT XPCOLOR_TAB_INACTIVE_BACK = 48; // An RGB value that represents the XP inactive tab background color. +const UINT XPCOLOR_TAB_INACTIVE_TEXT = 49; // An RGB value that represents the XP inactive tab text color. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTControlBar" +////////////////////////////////////////////////////////////////////////// + +const UINT XT_IDW_CONTROLBAR_MIN = AFX_IDW_CONTROLBAR_FIRST; // Minimum control ID value for a CXTControlBar (59392). +const UINT XT_IDW_CONTROLBAR_MAX = AFX_IDW_CONTROLBAR_LAST; // Maximum control ID value for a CXTControlBar (59647). +const UINT XT_IDC_TOOLSMANAGER_MIN = 0xCF08; // Minimum command ID for tools manager user defined commands (53000). +const UINT XT_IDC_TOOLSMANAGER_MAX = 0xD002; // Maximum command ID for tools manager user defined commands (53250). + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTSplitterDock" +////////////////////////////////////////////////////////////////////////// + +const UINT XT_SPLITTER_VERT = 0x0001; // Vertical docking window splitter. +const UINT XT_SPLITTER_HORZ = 0x0002; // Horizontal docking window splitter. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTSplitterWnd" +////////////////////////////////////////////////////////////////////////// + +const UINT XT_SPLIT_DOTTRACKER = 0x0001; // Has a dotted tracker. +const UINT XT_SPLIT_NOFULLDRAG = 0x0002; // Show pane contents while dragging. +const UINT XT_SPLIT_NOBORDER = 0x0004; // Do not draw a border around the pane. +const UINT XT_SPLIT_NOSIZE = 0x0008; // Do allow sizing. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTDockWindow" +////////////////////////////////////////////////////////////////////////// + +const UINT CBRS_XT_GRIPPER = 0x0001; // Has a gripper when docked. +const UINT CBRS_XT_GRIPPER_TEXT = 0x0002; // Draws text in the gripper area when docked. Only valid with CBRS_XT_GRIPPER styles. +const UINT CBRS_XT_TWOGRIP = 0x0004; // Has a gripper with two grip bars. +const UINT CBRS_XT_GRIPPER_FLAT = 0x0008; // Has a flat gripper. Must be used with CBRS_XT_GRIPPER. +const UINT CBRS_XT_GRIPPER_GRAD = 0x0010; // Has a gradient style gripper. Must be used with CBRS_XT_GRIPPER_FLAT. +const UINT CBRS_XT_BUTTONS = 0x0020; // Has min, max, and close frame buttons. +const UINT CBRS_XT_BUTTONS_FLAT = 0x0040; // Draws buttons flat. Only valid with CBRS_XT_BUTTONS style. +const UINT CBRS_XT_BORDERS_FLAT = 0x0080; // Draws the borders flat. +const UINT CBRS_XT_SEMIFLAT = 0x0100; // Draws buttons and borders with a thin 3D border. +const UINT CBRS_XT_CLIENT_OUTLINE = 0x0200; // Draws an outline around the client area. +const UINT CBRS_XT_CLIENT_STATIC = 0x0400; // Draws a static rect around the client area. +const UINT CBRS_XT_CLIENT_MODAL = 0x0800; // Draws a modal rect around the client area. +const UINT CBRS_XT_NEWDOCKED = 0x1000; // Used internally by docking windows. +const UINT CBRS_XT_DEFAULT = 0x0023; // Same as CBRS_XT_BUTTONS | CBRS_XT_GRIPPER | CBRS_XT_GRIPPER_TEXT. +const UINT CBRS_XT_ALL_FLAT = 0x00EB; // Same as CBRS_XT_DEFAULT | CBRS_XT_GRIPPER_FLAT | CBRS_XT_BUTTONS_FLAT | CBRS_XT_BORDERS_FLAT. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTDockBar" +////////////////////////////////////////////////////////////////////////// + +const UINT CBRS_XT_NONFLAT = 0x0000; // 3D borders. +const UINT CBRS_XT_FLAT = 0x0080; // Flat borders. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTButton" +////////////////////////////////////////////////////////////////////////// + +const UINT BS_XT_FLAT = 0x0001; // Draws a flat button. +const UINT BS_XT_SEMIFLAT = 0x0002; // Draws a semi-flat button. +const UINT BS_XT_TWOROWS = 0x0004; // Draws images and text are centered. + +// OBSOLETE + +const UINT BS_XT_CENTER = 0x0008; + +const UINT BS_XT_SHOWFOCUS = 0x0010; // Draws a focus rect when the button has input focus. +const UINT BS_XT_HILITEPRESSED = 0x0020; // Highlights the button when pressed. +const UINT BS_XT_XPFLAT = 0x0040; // Draws a flat button ala Office XP. +const UINT BS_XT_WINXP_COMPAT = 0x1000; // Uses Windows XP themes if available. This setting overrides BS_XT_FLAT and BS_XT_SEMIFLAT, but does not override BS_XT_XPFLAT. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTBrowseEdit" +////////////////////////////////////////////////////////////////////////// + +const UINT BES_XT_CHOOSEDIR = 0x0001; // Display the choose folder dialog. +const UINT BES_XT_CHOOSEFILE = 0x0002; // Display the choose file dialog. +const UINT BES_XT_POPUPMENU = 0x0004; // Display a user defined context menu. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTColorPopup" +////////////////////////////////////////////////////////////////////////// + +const UINT CPS_XT_NOFILL = 0x0001; // Use No Fill style in place of Automatic. +const UINT CPS_XT_EXTENDED = 0x0002; // Display extended colors. +const UINT CPS_XT_MORECOLORS = 0x0004; // Display more colors button. +const UINT CPS_XT_USERCOLORS = 0x0020; // Display a list of user selected colors. + +// *** Used internally by the color popup window. + +const UINT CPS_XT_PICKBOX = 0x0008; +const UINT CPS_XT_DEFAULT = 0x0010; + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTColorDialog" +////////////////////////////////////////////////////////////////////////// + +const UINT CPS_XT_SHOWHEXVALUE = 0x0020; // Displays color in hex format. +const UINT CPS_XT_SHOW3DSELECTION = 0x0040; // Shows new / current display box with a 3D border. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTEditListBox" +////////////////////////////////////////////////////////////////////////// + +const UINT LBS_XT_DEFAULT = 0x0000; // Standard edit field. +const UINT LBS_XT_CHOOSEDIR = 0x0001; // Choose directory browse edit field. +const UINT LBS_XT_CHOOSEFILE = 0x0002; // Choose file browse edit field. +const UINT LBS_XT_NOTOOLBAR = 0x0008; // Do not display edit toolbar. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTTipWindow" +////////////////////////////////////////////////////////////////////////// + +const UINT TWS_XT_THICKBORDER = 0x0001; // Show a 3D border. +const UINT TWS_XT_DROPSHADOW = 0x0002; // Show a drop shadow when the window is active. +const UINT TWS_XT_ALPHASHADOW = 0x0004; // Show alpha style drop shadow. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTCaption" +////////////////////////////////////////////////////////////////////////// + +const UINT CPWS_EX_GROOVE_EDGE = 0x0001; // Show the caption with a sunken border. +const UINT CPWS_EX_RAISED_EDGE = 0x0002; // Show the caption with a raised border. +const UINT CPWS_EX_CLOSEBUTTON = 0x0004; // Caption has a close button. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTFlatTabCtrl" +////////////////////////////////////////////////////////////////////////// + +const UINT FTS_XT_BOTTOM = 0x0001; // Show tabs on bottom. +const UINT FTS_XT_HASARROWS = 0x0002; // Show back and next arrows. +const UINT FTS_XT_HASHOMEEND = 0x0004; // Show home and end arrows. Used with FTS_XT_HASARROWS. +const UINT FTS_XT_TOOLTIPS = 0x0008; // Show tooltips. +const UINT FTS_XT_DEFAULT = 0x000F; // Same as FTS_XT_BOTTOM | FTS_XT_HASARROWS | FTS_XT_HASHOMEEND | FTS_XT_TOOLTIPS. +const UINT FTS_XT_HSCROLL = 0x0010; // Show a horizontal scroll bar. +const UINT FTS_XT_MASK = 0x001F; // All FTS_ mask items. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTFrameWnd, CXTMDIFrameWnd, CXTOleIPFrameWnd" +////////////////////////////////////////////////////////////////////////// + +const UINT CUST_XT_TOOLBARS = 0x0001; // Displays the Toolbars tab in the toolbar customize property sheet. +const UINT CUST_XT_COMMANDS = 0x0002; // Displays the Commands tab in the toolbar customize property sheet. +const UINT CUST_XT_KEYBOARD = 0x0004; // Displays the Keyboard tab in the toolbar customize property sheet. +const UINT CUST_XT_TOOLS = 0x0008; // Displays the Tools tab in the toolbar customize property sheet. +const UINT CUST_XT_OPTIONS = 0x0010; // Displays the Options tab in the toolbar customize property sheet. +const UINT CUST_XT_DEFAULT = (CUST_XT_TOOLBARS|CUST_XT_COMMANDS|CUST_XT_KEYBOARD|CUST_XT_TOOLS|CUST_XT_OPTIONS); // Same as CUST_XT_TOOLBARS|CUST_XT_COMMANDS|CUST_XT_KEYBOARD|CUST_XT_TOOLS|CUST_XT_OPTIONS. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTOutBarCtrl" +////////////////////////////////////////////////////////////////////////// + +const UINT OBS_XT_SMALLICON = 0x0001; // Sets small icon mode. +const UINT OBS_XT_LARGEICON = 0x0002; // Sets large icon mode. +const UINT OBS_XT_EDITGROUPS = 0x0004; // Enables folder local editing (renaming). +const UINT OBS_XT_EDITITEMS = 0x0008; // Enables item local editing (renaming). +const UINT OBS_XT_REMOVEGROUPS = 0x0010; // Enables the "Remove" command for folders in context menu. +const UINT OBS_XT_REMOVEITEMS = 0x0020; // Enables the "Remove" command for items in context menu. +const UINT OBS_XT_ADDGROUPS = 0x0040; // Enables folder insertion. +const UINT OBS_XT_DRAGITEMS = 0x0080; // Enables item dragging to rearrange position. +const UINT OBS_XT_ANIMATION = 0x0100; // Enables animation while changing folder selection. +const UINT OBS_XT_SELHIGHLIGHT = 0x0200; // Enables dimmed highlight of last pressed item. +const UINT OBS_XT_DEFAULT = 0x00FC; // Same as OBS_XT_DRAGITEMS | OBS_XT_EDITGROUPS | OBS_XT_EDITITEMS | OBS_XT_REMOVEGROUPS | OBS_XT_REMOVEITEMS | OBS_XT_ADDGROUPS. + +////////////////////////////////////////////////////////////////////////// +//:Associate with "Styles - CXTTreeCtrl" +////////////////////////////////////////////////////////////////////////// + +const UINT TVIS_FOCUSED = 0x0001; // For determining tree item focus state. + +//:Associate with "Notification Handlers - CXTColorPicker" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// color selection has changed. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_CPN_XT_SELCHANGE(IDC_CTRL_ID, OnSelChange)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnSelChange()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnSelChange( );
+const UINT CPN_XT_SELCHANGE = (WM_APP + 2500); + +//:Associate with "Notification Handlers - CXTColorPicker" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// color selection window is displayed. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_CPN_XT_DROPDOWN(IDC_CTRL_ID, OnDropDown)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnDropDown()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnDropDown( );
+const UINT CPN_XT_DROPDOWN = (WM_APP + 2501); + +//:Associate with "Notification Handlers - CXTColorPicker" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// color selection window has closed. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_CPN_XT_CLOSEUP(IDC_CTRL_ID, OnCloseUp)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnCloseUp()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnCloseUp( );
+const UINT CPN_XT_CLOSEUP = (WM_APP + 2502); + +//:Associate with "Notification Handlers - CXTColorPicker" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever a +// color selection has been made. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_CPN_XT_SELENDOK(IDC_CTRL_ID, OnSelEndOk)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnSelEndOk()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnSelEndOk( );
+const UINT CPN_XT_SELENDOK = (WM_APP + 2503); + +//:Associate with "Notification Handlers - CXTColorPicker" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever a +// color selection has been canceled. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_CPN_XT_SELENDCANCEL(IDC_CTRL_ID, OnSelEndCancel)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnSelEndCancel()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnSelEndCancel( );
+const UINT CPN_XT_SELENDCANCEL = (WM_APP + 2504); + +//:Associate with "Notification Handlers - CXTColorPicker" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// no fill / automatic color selection has been made. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_CPN_XT_SELNOFILL(IDC_CTRL_ID, OnSelNoFill)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnSelNoFill()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnSelNoFill( );
+const UINT CPN_XT_SELNOFILL = (WM_APP + 2505); + +#define ON_CPN_XT_SELCHANGE(id, memberFxn) \ + ON_CONTROL(CPN_XT_SELCHANGE, id, memberFxn) +#define ON_CPN_XT_DROPDOWN(id, memberFxn) \ + ON_CONTROL(CPN_XT_DROPDOWN, id, memberFxn) +#define ON_CPN_XT_CLOSEUP(id, memberFxn) \ + ON_CONTROL(CPN_XT_CLOSEUP, id, memberFxn) +#define ON_CPN_XT_SELENDOK(id, memberFxn) \ + ON_CONTROL(CPN_XT_SELENDOK, id, memberFxn) +#define ON_CPN_XT_SELENDCANCEL(id, memberFxn) \ + ON_CONTROL(CPN_XT_SELENDCANCEL, id, memberFxn) +#define ON_CPN_XT_SELNOFILL(id, memberFxn) \ + ON_CONTROL(CPN_XT_SELNOFILL, id, memberFxn) + +//:Associate with "Notification Handlers - CXTBrowseEdit" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// label edit operation has ended. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_BEN_XT_LABELEDITEND(IDC_CTRL_ID, OnLabelEditEnd)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnLabelEditEnd()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnLabelEditEnd( );
+const UINT BEN_XT_LABELEDITEND = (WM_APP + 2506); + +//:Associate with "Notification Handlers - CXTBrowseEdit" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// label edit operation has been canceled. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_BEN_XT_LABELEDITCANCEL(IDC_CTRL_ID, OnLabelEditCancel)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnLabelEditCancel()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnLabelEditCancel( );
+const UINT BEN_XT_LABELEDITCANCEL = (WM_APP + 2507); + +#define ON_BEN_XT_LABELEDITEND(id, memberFxn) \ + ON_CONTROL(BEN_XT_LABELEDITEND, id, memberFxn) +#define ON_BEN_XT_LABELEDITCANCEL(id, memberFxn) \ + ON_CONTROL(BEN_XT_LABELEDITCANCEL, id, memberFxn) + +//:Associate with "Notification Handlers - CXTEditListBox" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// label edit operation has ended. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_LBN_XT_LABELEDITEND(IDC_CTRL_ID, OnLabelEditEnd)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnLabelEditEnd()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnLabelEditEnd( );
+const UINT LBN_XT_LABELEDITEND = BEN_XT_LABELEDITEND; + +//:Associate with "Notification Handlers - CXTEditListBox" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// label edit operation has been canceled. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_LBN_XT_LABELEDITCANCEL(IDC_CTRL_ID, OnLabelEditCancel)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnLabelEditCancel()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnLabelEditCancel( );
+const UINT LBN_XT_LABELEDITCANCEL = BEN_XT_LABELEDITCANCEL; + +//:Associate with "Notification Handlers - CXTEditListBox" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// new item button has been pressed. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_LBN_XT_NEWITEM(IDC_CTRL_ID, OnNewItem)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnNewItem()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnNewItem( );
+const UINT LBN_XT_NEWITEM = (WM_APP + 2508); + +//:Associate with "Notification Handlers - CXTEditListBox" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner just before an item +// is deleted. This is useful for retrieving information about the selected +// item, such as item data, before it is removed from the edit list control. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_LBN_XT_PREDELETEITEM(IDC_CTRL_ID, OnPreDeleteItem)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnPreDeleteItem()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnPreDeleteItem( );
+const UINT LBN_XT_PREDELETEITEM = (WM_APP + 2509); + +//:Associate with "Notification Handlers - CXTEditListBox" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// delete item button has been pressed. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_LBN_XT_DELETEITEM(IDC_CTRL_ID, OnDeleteItem)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnDeleteItem()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnDeleteItem( );
+const UINT LBN_XT_DELETEITEM = (WM_APP + 2510); + +//:Associate with "Notification Handlers - CXTEditListBox" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// move item up button has been pressed. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_LBN_XT_MOVEITEMUP(IDC_CTRL_ID, OnMoveItemUp)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnMoveItemUp()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnMoveItemUp( );
+const UINT LBN_XT_MOVEITEMUP = (WM_APP + 2511); + +//:Associate with "Notification Handlers - CXTEditListBox" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// move item down button has been pressed. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_LBN_XT_MOVEITEMDOWN(IDC_CTRL_ID, OnMoveItemDown)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnMoveItemDown()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnMoveItemDown( );
+const UINT LBN_XT_MOVEITEMDOWN = (WM_APP + 2512); + +#define ON_LBN_XT_LABELEDITEND(id, memberFxn) \ + ON_CONTROL(LBN_XT_LABELEDITEND, id, memberFxn) +#define ON_LBN_XT_LABELEDITCANCEL(id, memberFxn) \ + ON_CONTROL(LBN_XT_LABELEDITCANCEL, id, memberFxn) +#define ON_LBN_XT_NEWITEM(id, memberFxn) \ + ON_CONTROL(LBN_XT_NEWITEM, id, memberFxn) +#define ON_LBN_XT_PREDELETEITEM(id, memberFxn) \ + ON_CONTROL(LBN_XT_PREDELETEITEM, id, memberFxn) +#define ON_LBN_XT_DELETEITEM(id, memberFxn) \ + ON_CONTROL(LBN_XT_DELETEITEM, id, memberFxn) +#define ON_LBN_XT_MOVEITEMUP(id, memberFxn) \ + ON_CONTROL(LBN_XT_MOVEITEMUP, id, memberFxn) +#define ON_LBN_XT_MOVEITEMDOWN(id, memberFxn) \ + ON_CONTROL(LBN_XT_MOVEITEMDOWN, id, memberFxn) + +//:Associate with "Notification Handlers - CXTTrayIcon" + +///////////////////////////////////////////////////////////////////////////// +// Input: uID - Value of wParam specifies the resource ID of the icon associated with the +// CXTTrayIcon object. +// uMouseMsg - Value of lParam specifies the mouse or keyboard message associated with the event. +// +// Returns: If the application is to process this message, the return value should be 0. +// +// Remarks: When a mouse or keyboard event occurs on a tray icon, the TIN_XT_TRAYICON +// message is sent to the tray icon's owner window. +// +// Example: Here is an example of how an application would process the TIN_XT_TRAYICON +// message. +// +//
BEGIN_MESSAGE_MAP(CMainFrame, CXTMDIFrameWnd)
+//			    //{{AFX_MSG_MAP(CMainFrame)
+//			    ON_MESSAGE(TIN_XT_TRAYICON, OnTrayIconNotify)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
LRESULT CMainFrame::OnTrayIconNotify(WPARAM wParam, LPARAM lParam) 
+//			{
+//			    UINT uID = (UINT) wParam;        // resource ID of the tray icon.
+//			    UINT uMouseMsg = (UINT) lParam;  // mouse message that was sent.
+//				
+//			    switch( uMouseMsg )
+//			    {
+//			        case WM_RBUTTONUP:
+//			        {
+//			            CMenu menu;
+//			            VERIFY(menu.LoadMenu(IDR_MAINFRAME));
+//						
+//			            CMenu* pPopup = menu.GetSubMenu(0);
+//			            ASSERT(pPopup != NULL);
+//			            CWnd* pWndPopupOwner = this;
+//						
+//			            // Insert the restore menu command into the popup.
+//			            if (m_bIsVisible == false)
+//			            {
+//			                pPopup->InsertMenu(0, MF_BYPOSITION,
+//			                    IDR_RESTORE, _T("&Restore Window..."));
+//			
+//			                pPopup->InsertMenu(1, MF_BYPOSITION|MF_SEPARATOR,
+//			                    IDR_RESTORE);
+//			
+//			                // Make restore command bold.
+//			                ::SetMenuDefaultItem(pPopup->m_hMenu, IDR_RESTORE, FALSE);
+//			            }
+//			            else
+//			            {
+//			                // Make the exit command bold.
+//			                ::SetMenuDefaultItem(pPopup->m_hMenu, ID_APP_EXIT, FALSE);
+//			            }
+//			
+//			            // Display the menu at the current mouse location. There's a "bug"
+//			            // (Microsoft calls it a feature) in Windows 95 that requires calling
+//			            // SetForegroundWindow. To find out more, search for Q135788 in MSDN.
+//			            //
+//			            CPoint point;
+//			            GetCursorPos( &point );
+//			            ::SetForegroundWindow(m_hWnd);
+//			
+//			            while (pWndPopupOwner->GetStyle() & WS_CHILD)
+//			                pWndPopupOwner = pWndPopupOwner->GetParent();
+//			
+//			            int iCmd = pPopup->TrackPopupMenu(
+//			                TPM_RETURNCMD | TPM_LEFTALIGN | TPM_RIGHTBUTTON, 
+//			                point.x, point.y, pWndPopupOwner);
+//			
+//			            // at this point we want to make sure that the app is visible
+//			            // after the user makes a menu selection - this is just one way
+//			            // of doing so:
+//			
+//			            switch (iCmd)
+//			            {
+//			                case 0:
+//			                    // user cancelled menu - do nothing
+//			                    break;
+//			
+//			                // these are commands for which we don't need to make the
+//			                // main app window visible
+//			                case ID_APP_EXIT:
+//			                    PostMessage(WM_COMMAND, iCmd, 0);  // just post the command
+//			                    break;
+//			
+//			                // for all other menu commands - make sure the window is
+//			                // visible before we continue
+//			                default:
+//			                    // make main window visible
+//			                    OnRestore();
+//			                    PostMessage(WM_COMMAND, iCmd, 0); // post the command
+//			                    break;
+//			            }
+//			
+//			            return 1; // let the tray icon know that we handled this message.
+//			        }
+//			
+//			        case WM_LBUTTONDBLCLK:
+//			            OnRestore();
+//			            return 1; // let the tray icon know that we handled this message.
+//			    }
+//			
+//			    return 0;
+//			}
+// Summary: The TIN_XT_TRAYICON message is sent to the CXTTrayIcon window's owner +// whenever a mouse event occurs in the CXTTrayIcon. +// +//
TIN_XT_TRAYICON 
+//			uID = (UINT) wParam;        // resource ID of the tray icon.
+//			uMouseMsg = (UINT) lParam;  // mouse message that was sent.
+const UINT TIN_XT_TRAYICON = (WM_APP + 2513); + +//:Associate with "Notification Handlers - CXTControlBar" + +///////////////////////////////////////////////////////////////////////////// +// Input: pBar - Value of wParam specifies a CXTControlBar object that represents the toolbar +// where the context menu event occurred. +// +// Returns: If the application is to process this message, the return value should be 0. +// +// Remarks: When the user right clicks on a control bar, the CBRN_XT_CONTEXTMENU +// message is sent to the control bar's owner window. +// +// Example: Here is an example of how an application would process the CBRN_XT_CONTEXTMENU +// message. +// +//
BEGIN_MESSAGE_MAP(CMainFrame, CXTMDIFrameWnd)
+//			    //{{AFX_MSG_MAP(CMainFrame)
+//			    ON_MESSAGE(CBRN_XT_CONTEXTMENU, OnBarContextMenu)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
LRESULT CMainFrame::OnBarContextMenu(WPARAM wParam, LPARAM lParam)
+//			{
+//			    UNREFERENCED_PARAMETER(lParam);
+//			
+//			    CXTControlBar* pBar = (CXTControlBar*)wParam;
+//			    ASSERT_KINDOF(CXTControlBar, pBar);
+//			
+//			    return 0;
+//			}
+// +// Summary: The CBRN_XT_CONTEXTMENU message is sent to the CXTControlBar window's owner +// whenever a context menu event occurs in the CXTControlBar. +// +//
CBRN_XT_CONTEXTMENU 
+//			pBar = (NMTOOLBAR*)wParam;  // pointer to the control bar context menu owner
+const UINT CBRN_XT_CONTEXTMENU = (WM_APP + 2514); + +//:Associate with "Notification Handlers - CXTToolBar" + +///////////////////////////////////////////////////////////////////////////// +// Input: pNMTB - Value of wParam specifies a NMTOOLBAR structure that represents the toolbar +// Button where the dropdown event occurred. +// +// pRect - Value of lParam points to a CRect object that represents the size and location +// of the toolbar button where the dropdown event occurred. +// +// Returns: Dropdown is displaying a modal window, the return value should be 0, otherwise +// return 1 for menu style displays. +// +// Remarks: When the user clicks on a dropdown arrow for a toolbar button, the CBRN_XT_DROPDOWN +// message is sent to the toolbar's owner window. +// +// Example: Here is an example of how an application would process the CBRN_XT_DROPDOWN +// message. +// +//
BEGIN_MESSAGE_MAP(CMainFrame, CXTMDIFrameWnd)
+//			    //{{AFX_MSG_MAP(CMainFrame)
+//			    ON_MESSAGE(CBRN_XT_DROPDOWN, OnDropDown)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
LRESULT CMainFrame::OnDropDown(WPARAM wParam, LPARAM lParam)
+//			{
+//			    NMTOOLBAR* pNMTB = (NMTOOLBAR*)wParam;
+//			    ASSERT(pNMTB != NULL);
+//			
+//			    CRect* pRect = (CRect*)lParam;
+//			    ASSERT(pRect != NULL);
+//			
+//			    // TODO: Handle toolbar dropdown notification (click on REDO drop arrow).
+//			
+//			    return 0;
+//			}
+// Summary: The CBRN_XT_DROPDOWN message is sent to the CXTToolBar window +// whenever a dropdown event occurs in the CXTToolBar. +// +//
CBRN_XT_DROPDOWN 
+//			pNMTB = (NMTOOLBAR*)wParam;  // pointer to a NMTOOLBAR struct 
+//			pRect = (CRect*)lParam;      // pointer to a CRect object
+const UINT CBRN_XT_DROPDOWN = (WM_APP + 2515); + +//:Associate with "Notification Handlers - CXTCaptionPopupWnd" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: When the user makes a selection of the push pin button, the CPWN_XT_PUSHPINBUTTON message is +// sent to the caption popup window's owner window. +// +// Example: Here is an example of how an application would process the TCN_XT_SELCHANGE +// message. +// +//
BEGIN_MESSAGE_MAP(CMainFrame, CXTMDIFrameWnd)
+//			    //{{AFX_MSG_MAP(CMainFrame)
+//			    ON_MESSAGE_VOID(CPWN_XT_PUSHPINBUTTON, OnPushPinButton)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CMainFrame::OnPushPinButton()
+//			{
+//			    // TODO: Add your message handler code here and/or call default
+//			    m_wndSplitter2.ShowColumn();
+//			    m_nColumn = 1;
+//			}
+// Summary: The CPWN_XT_PUSHPINBUTTON message is sent to the owner of a CXTCaptionPopupWnd whenever +// the push pin button selection has been made. +const UINT CPWN_XT_PUSHPINBUTTON = (WM_APP + 2516); + +//:Associate with "Notification Handlers - CXTCaptionPopupWnd" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: When the user cancels a selection of the push pin button, the CPWN_XT_PUSHPINCANCEL message is +// sent to the caption popup window's owner window. +// +// Example: Here is an example of how an application would process the TCN_XT_SELCHANGE +// message. +// +//
BEGIN_MESSAGE_MAP(CMainFrame, CXTMDIFrameWnd)
+//			    //{{AFX_MSG_MAP(CMainFrame)
+//			    ON_MESSAGE_VOID(CPWN_XT_PUSHPINCANCEL, OnPushPinCancel)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CMainFrame::OnPushPinCancel()
+//			{
+//			    // TODO: Add your message handler code here and/or call default
+//			}
+// Summary: The CPWN_XT_PUSHPINCANCEL message is sent to the owner of a CXTCaptionPopupWnd whenever +// the push pin button selection has been canceled. +const UINT CPWN_XT_PUSHPINCANCEL = (WM_APP + 2517); + +//:Associate with "Notification Handlers - CXTOutBarCtrl" + +// BULLETED LIST: + +///////////////////////////////////////////////////////////////////////////// +// Input: nBarAction - Value of wParam specifies an Outlook bar value that indicates the users +// request. This parameter can be one of the following values: +// [ul] +// [li]OBN_XT_ITEMCLICK The user has selected an item in the +// Outlook bar.[/li] +// [li]OBN_XT_ONLABELENDEDIT The user has completed editing an +// item's label.[/li] +// [li]OBN_XT_ONGROUPENDEDIT The user has completed editing a +// folder's label.[/li] +// [li]OBN_XT_DRAGITEM The user has dragged an item to a new +// location in the Outlook bar.[/li] +// [li]OBN_XT_FOLDERCHANGE The user has selected a new folder +// item.[/li] +// [li]OBN_XT_ITEMHOVER The user's mouse is hovering over an item +// in the Outlook bar.[/li] +// [li]OBN_XT_DELETEITEM The user has chosen to delete an item +// from the Outlook bar.[/li] +// [li]OBN_XT_DELETEFOLDER The user has chosen to delete a folder +// from the Outlook bar.[/li] +// [li]OBN_XT_ITEMRCLICK The user has right clicked on the Outlook +// bar folder.[/li] +// [/ul] +// pOBInfo - Value of lParam points to an XT_OUTBAR_INFO structure that contains information for the +// specified item. The item can either be a folder group or icon item, depending on the +// value of the nBarAction parameter. This pointer should never be NULL. +// +// Returns: If the application is to process this message, the return value should be TRUE. If the +// return value is FALSE, the user's action is ignored. +// +// Remarks: When the user performs an action in the Outlook bar, the XTWM_OUTBAR_NOTIFY message is +// sent to the Outlook bar's owner window. +// +// Example: Here is an example of how an application would process the XTWM_OUTBAR_NOTIFY +// message. +// +//
int nBarAction = (int)wParam;
+// +//
// Cast the lParam to an XT_OUTBAR_INFO* struct pointer.
+//			XT_OUTBAR_INFO* pOBInfo = (XT_OUTBAR_INFO*)lParam;
+//			ASSERT(pOBInfo);
+// +//
switch (nBarAction)
+//			{
+//			    case OBN_XT_ITEMCLICK:
+//			    case OBN_XT_FOLDERCHANGE:
+//			    case OBN_XT_ONLABELENDEDIT:
+//			    case OBN_XT_ONGROUPENDEDIT:
+//			    case OBN_XT_DRAGITEM:
+//			    case OBN_XT_ITEMHOVER:
+//			    case OBN_XT_ITEMRCLICK:
+//			        TRACE2( "Index: %d, Name: %s.\n", pOBInfo->nIndex, pOBInfo->lpszText);
+//			        break;
+//			
+//			    case OBN_XT_DELETEITEM:
+//			        if (AfxMessageBox(_T("Remove this folder shortcut?"),
+//			            MB_ICONWARNING|MB_YESNO) == IDNO)
+//			        {
+//			            return FALSE; // Return FALSE to abort the action.
+//			        }
+//			        break;
+//			
+//			    case OBN_XT_DELETEFOLDER:
+//			        if (AfxMessageBox(_T("Remove the specified folder?"),
+//			            MB_ICONWARNING|MB_YESNO) == IDNO)
+//			        {
+//			            return FALSE; // Return FALSE to abort the action.
+//			        }
+//			        break;
+//			}
+//			return TRUE;
+// Summary: The XTWM_OUTBAR_NOTIFY message is sent to the CXTOutBarCtrl owner window +// whenever an action occurs within the CXTOutBarCtrl. +// +//
XTWM_OUTBAR_NOTIFY 
+//			nBarAction = (int) wParam;           // Outlook bar action 
+//			pOBInfo = (XT_OUTBAR_INFO*) lParam;  // pointer to an XT_OUTBAR_INFO struct
+const UINT XTWM_OUTBAR_NOTIFY = (WM_APP + 2518); +const UINT OBN_XT_ITEMCLICK = 1; // Item was selected. See XTWM_OUTBAR_NOTIFY. +const UINT OBN_XT_ONLABELENDEDIT = 2; // Item label edit completed. See XTWM_OUTBAR_NOTIFY. +const UINT OBN_XT_ONGROUPENDEDIT = 3; // Folder label edit completed. See XTWM_OUTBAR_NOTIFY. +const UINT OBN_XT_DRAGITEM = 4; // Item drag operation in process. See XTWM_OUTBAR_NOTIFY. +const UINT OBN_XT_FOLDERCHANGE = 5; // Folder selection changed. See XTWM_OUTBAR_NOTIFY. +const UINT OBN_XT_ITEMHOVER = 6; // Mouse is hovering over item. See XTWM_OUTBAR_NOTIFY. +const UINT OBN_XT_DELETEITEM = 7; // Item deleted. See XTWM_OUTBAR_NOTIFY. +const UINT OBN_XT_DELETEFOLDER = 8; // Folder deleted. See XTWM_OUTBAR_NOTIFY. +const UINT OBN_XT_BEGINDRAG = 9; // Item drag operation begun. See XTWM_OUTBAR_NOTIFY. +const UINT OBN_XT_ITEMRCLICK = 10; // Right click on Outlook bar occurred. See XTWM_OUTBAR_NOTIFY. + +//:Associate with "Notification Handlers - CXTShellListCtrl, CXTShellListView, CXTShellTreeCtrl, CXTShellTreeView" + +// BULLETED LIST: + +///////////////////////////////////////////////////////////////////////////// +// Input: nShellAction - Value of wParam specifies a shell tree value that indicates the users +// request. This parameter can be one of the following values: +// [ul] +// [li]SHN_XT_SHELLMENU Shell context menu selection made.[/li] +// [li]SHN_XT_TREESELCHANGE Tree selection made.[/li] +// [li]SHN_XT_SELECTCHILD Child tree node selected.[/li] +// [li]SHN_XT_NOFOLDER Item selected was not a folder.[/li] +// [li]SHN_XT_INETFOLDER Item selected was the internet folder.[/li] +// [/ul] +// pItemData - Value of lParam points to an XT_TVITEMDATA structure that contains information for the +// specified item. Depending on the action, this pointer can be NULL. +// +// Returns: If the application is to process this message, the return value should be 0. +// +// Remarks: When the user performs an action in the shell tree, the XTWM_SHELL_NOTIFY message is +// sent to the shell tree's owner window. +// +// Example: Here is an example of how an application would process the XTWM_SHELL_NOTIFY +// message. +// +//
int nShellAction = (int)wParam;
+// +//
// Cast the lParam to an XT_TVITEMDATA* struct pointer.
+//			XT_TVITEMDATA* pItemData = (XT_TVITEMDATA*)lParam;
+//			ASSERT(pItemData);
+// +//
switch (nBarAction)
+//			{
+//			    case SHN_XT_SHELLMENU:
+//			    case SHN_XT_TREESELCHANGE:
+//			    case SHN_XT_SELECTCHILD:
+//			    case SHN_XT_NOFOLDER:
+//			    case SHN_XT_INETFOLDER:
+//			        // TODO: Handle shell notification message.
+//			        TRACE0("Shell notification was sent.\n");
+//			        break;
+//			}
+//			return 0;
+// Summary: The XTWM_SHELL_NOTIFY message is sent to the CXTShellTree and list owner window +// whenever an action occurs within the CXTShellTree and list. +//
XTWM_SHELL_NOTIFY 
+//			nShellAction = (int) wParam;         // tree or list action 
+//			pItemData = (XT_TVITEMDATA*) lParam;  // pointer to an XT_TVITEMDATA struct
+const UINT XTWM_SHELL_NOTIFY = (WM_APP + 2519); +const UINT SHN_XT_SHELLMENU = 1; // Shell context menu selection made. See XTWM_SHELL_NOTIFY +const UINT SHN_XT_TREESELCHANGE = 2; // Tree selection made. See XTWM_SHELL_NOTIFY. +const UINT SHN_XT_SELECTCHILD = 3; // Child tree node selected. See XTWM_SHELL_NOTIFY. +const UINT SHN_XT_NOFOLDER = 4; // Item selected was not a folder. See XTWM_SHELL_NOTIFY. +const UINT SHN_XT_INETFOLDER = 5; // Item selected was the internet folder. See XTWM_SHELL_NOTIFY. + +//:Associate with "Notification Handlers - CXTTabCtrl" + +///////////////////////////////////////////////////////////////////////////// +// Input: nID - Dialog control ID for the tab control. +// pTabCtrl - Points to the tab control whose selection has changed. +// +// Remarks: When the user selects a new tab in the tab control, the TCN_XT_SELCHANGE message is +// sent to the tab control's owner window. +// +// Example: Here is an example of how an application would process the TCN_XT_SELCHANGE +// message. +// +//
BEGIN_MESSAGE_MAP(CMainFrame, CXTMDIFrameWnd)
+//			    //{{AFX_MSG_MAP(CMainFrame)
+//			    ON_MESSAGE(TCN_XT_SELCHANGE, OnTabSelChange)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
LRESULT CMainFrame::OnTabSelChange(WPARAM wParam, LPARAM lParam)
+//			{
+//			    CXTTabCtrl* pTabCtrl = (CXTTabCtrl*)lParam;
+//			    ASSERT_VALID(pTabCtrl);
+//			
+//			    int nID = (int)wParam;
+//			    if (nID == ID_VIEW_WORKSPACEBAR)
+//			    {
+//				      // TODO: handle TCN_SELCHANGE from tab control bar.
+//			    }
+//			    return 0;
+//			}
+// Summary: The TCN_XT_SELCHANGE message is sent to the owner of a CXTTabCtrl whenever +// the tab selection has changed. +// +//
TCN_XT_SELCHANGE 
+//			nID = (int) wParam;               // dialog control ID 
+//			pTabCtrl = (CXTTabCtrl*) lParam;  // pointer to a CXTTabCtrl object
+const UINT TCN_XT_SELCHANGE = (WM_APP + 2520); + +//:Associate with "Notification Handlers - CXTTabCtrl" + +///////////////////////////////////////////////////////////////////////////// +// Input: nID - Dialog control ID for the tab control. +// pTabCtrl - Points to the tab control whose selection is about to change. +// +// Remarks: When the user selects a new tab in the tab control, the TCN_XT_SELCHANGING message is +// sent to the tab control's owner window. +// +// Example: Here is an example of how an application would process the TCN_XT_SELCHANGING +// message. +// +//
BEGIN_MESSAGE_MAP(CMainFrame, CXTMDIFrameWnd)
+//			    //{{AFX_MSG_MAP(CMainFrame)
+//			    ON_MESSAGE(TCN_XT_SELCHANGING, OnTabSelChanging)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
LRESULT CMainFrame::OnTabSelChanging(WPARAM wParam, LPARAM lParam)
+//			{
+//			    CXTTabCtrl* pTabCtrl = (CXTTabCtrl*)lParam;
+//			    ASSERT_VALID(pTabCtrl);
+//			
+//			    int nID = (int)wParam;
+//			
+//			    if (nID == ID_VIEW_WORKSPACEBAR)
+//			    {
+//				      // TODO: handle TCN_SELCHANGE from tab control bar.
+//			    }
+//			    return 0;
+//			}
+// Summary: The TCN_XT_SELCHANGING message is sent to the owner of a CXTTabCtrl whenever +// the tab selection is about to change. +// +//
TCN_XT_SELCHANGING 
+//			nID = (int) wParam;               // dialog control ID 
+//			pTabCtrl = (CXTTabCtrl*) lParam;  // pointer to a CXTTabCtrl object
+const UINT TCN_XT_SELCHANGING = (WM_APP + 2521); + +//:Associate with "Notification Handlers - CXTSearchOptionsCtrl" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// search options control is expanding. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_SON_XT_ITEMEXPANDING(IDC_CTRL_ID, OnItemExpanding)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnItemExpanding()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnItemExpanding( );
+const UINT SON_XT_ITEMEXPANDING = (WM_APP + 2522); + +//:Associate with "Notification Handlers - CXTSearchOptionsCtrl" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// search options control has expanded. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_SON_XT_ITEMEXPAND(IDC_CTRL_ID, OnItemExpand)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnItemExpand()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnItemExpand( );
+const UINT SON_XT_ITEMEXPAND = (WM_APP + 2523); + +#define ON_SON_XT_ITEMEXPANDING(id, memberFxn) \ + ON_CONTROL(SON_XT_ITEMEXPANDING, id, memberFxn) +#define ON_SON_XT_ITEMEXPAND(id, memberFxn) \ + ON_CONTROL(SON_XT_ITEMEXPAND, id, memberFxn) + +//:Associate with "Notification Handlers - CXTSearchOptionsCtrl" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// search options control is contracting. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_SON_XT_ITEMCONTRACTING(IDC_CTRL_ID, OnItemContracting)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnItemContracting()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnItemContracting( );
+const UINT SON_XT_ITEMCONTRACTING = (WM_APP + 2524); + +//:Associate with "Notification Handlers - CXTSearchOptionsCtrl" + +///////////////////////////////////////////////////////////////////////////// +// Remarks: This command handler is called to inform the owner whenever the +// search options control has contracted. +// +// Example: Here is an example of how an application would handle this message. +// +//
BEGIN_MESSAGE_MAP(CAppDialog, CDialog
+//			    //{{AFX_MSG_MAP(CAppDialog)
+//			    ON_SON_XT_ITEMCONTRACT(IDC_CTRL_ID, OnItemContract)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
void CAppDialog::OnItemContract()
+//			{
+//			    // TODO: Handle command.
+//			}
+// Summary:
function prototype: afx_msg void OnItemContract( );
+const UINT SON_XT_ITEMCONTRACT = (WM_APP + 2525); + +#define ON_SON_XT_ITEMCONTRACTING(id, memberFxn) \ + ON_CONTROL(SON_XT_ITEMCONTRACTING, id, memberFxn) +#define ON_SON_XT_ITEMCONTRACT(id, memberFxn) \ + ON_CONTROL(SON_XT_ITEMCONTRACT, id, memberFxn) + +//:Associate with "Notification Handlers - General" + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Summary: This message handler is used to send initial update notifications to +// controls when they are created. This message is primarily used by the +// toolkit during initialization, however you can use this message to initialize +// your own control as well. +const UINT XTWM_INITIAL_UPDATE = (WM_APP + 2526); + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Notification message: toolbar expansion popup window has closed. +// NB: This is a private XT toolkit library message subject to changes. + +const UINT XTWM_POPUPCLOSED = (WM_APP + 2527); + +//:Associate with "Notification Handlers - CXTReBar" + +///////////////////////////////////////////////////////////////////////////// +// Input: bHorz - TRUE if horizontally oriented, FALSE otherwise. +// pRBBI - A pointer to a BARBANDINFO structure, the window can modify its parameters as appropriate. +// +// Returns: If the application is to process this message, the return value should be TRUE. +// +// Remarks: When a window is added to a rebar, the XTWM_ADDREBAR message is sent to the window. +// +// Example: Here is an example of how an application would process the XTWM_ADDREBAR +// message. +// +//
BEGIN_MESSAGE_MAP(CWidget, CWnd)
+//			    //{{AFX_MSG_MAP(CWidget)
+//			    ON_MESSAGE(XTWM_ADDREBAR, OnAddReBar)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
LRESULT CWidget::OnAddReBar(WPARAM wParam, LPARAM lParam) 
+//			{
+//			    BOOL bHorz = (BOOL) wParam;
+//			
+//			    REBARBANDINFO* pRBBI = (REBARBANDINFO*) lParam;
+//			        // TODO: Handle message.
+//			
+//			    return TRUE;
+//			}
+// Summary: The XTWM_ADDREBAR message is sent to a window whenever it is added +// to a CXTReBar control. +// +//
XTWM_ADDREBAR 
+//			bHorz = (BOOL) wParam;            // TRUE if horizontal.
+//			pRBBI = (REBARBANDINFO*) lParam;  // Points to a REBARBANDINFO structure.
+const UINT XTWM_ADDREBAR = (WM_APP + 2528); + +//:Associate with "Notification Handlers - CXTReBar" + +///////////////////////////////////////////////////////////////////////////// +// Input: bHorz - TRUE if horizontally oriented, FALSE otherwise. +// pRBSCI - A pointer to an XT_REBARSIZECHILDINFO structure, the window can modify its parameters as appropriate. +// +// Returns: If the application is to process this message, the return value should be TRUE. +// +// Remarks: When a window is added to a rebar, the XTWM_REBAR_SIZECHILD message is sent to the window. +// +// Example: Here is an example of how an application would process the XTWM_REBAR_SIZECHILD +// message. +// +//
BEGIN_MESSAGE_MAP(CWidget, CWnd)
+//			    //{{AFX_MSG_MAP(CWidget)
+//			    ON_MESSAGE(XTWM_REBAR_SIZECHILD, OnReBarSizeChild)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
LRESULT CWidget::OnReBarSizeChild(WPARAM wParam, LPARAM lParam) 
+//			{
+//			    BOOL bHorz = (BOOL) wParam;
+//			
+//			    XT_REBARSIZECHILDINFO* pRBSCI = (XT_REBARSIZECHILDINFO*) lParam;
+//			        // TODO: Handle message.
+//			
+//			    return TRUE;
+//			}
+// Summary: The XTWM_REBAR_SIZECHILD message is sent when CXTReBar control has resized +// the band in which the recipient resides. +// +//
XTWM_REBAR_SIZECHILD 
+//			bHorz = (BOOL) wParam; // TRUE if horizontal.
+//			pRBSCI = (XT_REBARSIZECHILDINFO*) lParam;  // Points to an XT_REBARSIZECHILDINFO structure.
+const UINT XTWM_REBAR_SIZECHILD = (WM_APP + 2529); + +//:Associate with "Notification Handlers - CXTDockContext" + +///////////////////////////////////////////////////////////////////////////// +// Returns: TRUE if the control bar shall be fully visualized, FALSE if just a wire frame must be rendered. +// +// Remarks: When a control bar is dragged the XTWM_QUERYVISUALIZE message is sent to the control bar. +// +// Example: Here is an example of how an application would process the XTWM_QUERYVISUALIZE +// message. +// +//
BEGIN_MESSAGE_MAP(CWidget, CXTControlBar)
+//			    //{{AFX_MSG_MAP(CWidget)
+//			    ON_MESSAGE(XTWM_QUERYVISUALIZE, OnQueryVisualize)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
LRESULT CWidget::OnQueryVisualize(WPARAM wParam, LPARAM lParam) 
+//			{
+//			    UNREFERENCED_PARAMETER( wParam );
+//			    UNREFERENCED_PARAMETER( lParam );
+//			    // Allow full visualizations.
+//			    return TRUE;
+//			}
+// Summary: CXTDockContext sends the XTWM_QUERYVISUALIZE message to a control bar to +// check if the control bar shall be visualized while dragging or just a wire +// frame shall be rendered. +// +//
XTWM_QUERYVISUALIZE 
+//			wParam - not used, must be zero
+//			lParam - not used, must be zero
+const UINT XTWM_QUERYVISUALIZE = (WM_APP + 2530); + +//:Associate with "Notification Handlers - CXTDockContext" + +///////////////////////////////////////////////////////////////////////////// +// Returns: TRUE if control bar has a hot spot, FALSE if it does not. +// +// Remarks: CXTDockContext sends the XTWM_QUERYHOTSPOT message the control bar to check +// for a hot spot. +// +// Example: Here is an example of how an application would process the XTWM_QUERYHOTSPOT +// message. +// +//
BEGIN_MESSAGE_MAP(CWidget, CXTControlBar)
+//			    //{{AFX_MSG_MAP(CWidget)
+//			    ON_MESSAGE(XTWM_QUERYHOTSPOT, OnQueryHotSpot)
+//			    //}}AFX_MSG_MAP
+//			END_MESSAGE_MAP()
+// +//
LRESULT CWidget::OnQueryHotSpot(WPARAM wParam, LPARAM lParam) 
+//			{
+//			    UNREFERENCED_PARAMETER( wParam );
+//			    LPSIZE lpSize = (LPSIZE) lParam;  // Points to a LPSIZE structure.
+//			    // TODO: Handle message.
+//			    return TRUE;
+//			}
+// Summary: CXTDockContext sends the XTWM_QUERYHOTSPOT message to a control bar to +// check if the control bar has a hot spot, a point that must match the position +// of the cursor. +// +//
XTWM_QUERYHOTSPOT 
+//			wParam - not used, must be zero
+//			lpSize = (LPSIZE) lParam;  // IN  - Extent of the rectangle in which 
+//			                           //       hot spot is to be defined
+//			                           // OUT - Offset of the hot spot location 
+//			                           //       within the rectangle.
+const UINT XTWM_QUERYHOTSPOT = (WM_APP + 2531); + +//:Associate with "Notification Handlers - CXTPropertyGrid" + +// BULLETED LIST: + +///////////////////////////////////////////////////////////////////////////// +// Input: nGridAction - Value of wParam specifies an Outlook bar value that indicates the users +// request. This parameter can be one of the following values: +// [ul] +// [li]XT_PGN_SORTORDER_CHANGED The sort order has changed in the property grid.[/li] +// [li]XT_PGN_SELECTION_CHANGED The selection has changed in the property grid.[/li] +// [li]XT_PGN_ITEMVALUE_CHANGED The value has changed for pItem in the property grid.[/li] +// [li]XT_PGN_EDIT_CHANGED The edit value has changed in the property grid.[/li] +// [/ul] +// pItem - Value of lParam points to an CXTPropertyGridItem object that contains information for the +// specified item. This pointer should never be NULL. +// +// Returns: If the application is to process this message, the return value should be TRUE; otherwise the +// return value is FALSE. +// +// Remarks: When the user performs an action in the property grid, the XTWM_PROPERTYGRID_NOTIFY message is +// sent to the property grid's owner window. +// +// Example: Here is an example of how an application would process the XTWM_PROPERTYGRID_NOTIFY +// message. +// +//
int nGridAction = (int)wParam;
+// +//
// Cast the lParam to an CXTPropertyGridItem* object pointer.
+//			CXTPropertyGridItem* pItem = (CXTPropertyGridItem*)lParam;
+//			ASSERT(pItem);
+// +//
switch (nGridAction)
+//			{
+//			    case XT_PGN_SORTORDER_CHANGED:
+//					  {
+//			             m_nSort = m_wndXTPropertyGrid.GetPropertySort();
+//			             UpdateData(FALSE);
+//					  }
+//			        break;
+//			    case XT_PGN_SELECTION_CHANGED:
+//					  {
+//			             TRACE(_T("Value Changed. Caption = %s, ID = %i, Value = %s\n"),
+//			                 pItem->GetCaption(), pItem->GetID(), pItem->GetValue());
+//					  }
+//			        break;
+//			    case XT_PGN_ITEMVALUE_CHANGED:
+//					  {
+//			             TRACE(_T("Selection Changed. Item = %s\n"), pItem->GetCaption());
+//					  }
+//			        break;
+//			}
+//			return TRUE;
+// Summary: The XTWM_PROPERTYGRID_NOTIFY message is sent to the CXTPropertyGrid owner window +// whenever an action occurs within the CXTPropertyGrid. +// +//
XTWM_PROPERTYGRID_NOTIFY 
+//			nGridAction = (int) wParam;             // Property grid action 
+//			pItem = (CXTPropertyGridItem*) lParam;  // pointer to an CXTPropertyGridItem object
+const UINT XTWM_PROPERTYGRID_NOTIFY = (WM_APP + 2533); +const UINT XT_PGN_SORTORDER_CHANGED = 1; // The sort order has changed in the property grid. +const UINT XT_PGN_SELECTION_CHANGED = 2; // The selection has changed in the property grid. +const UINT XT_PGN_ITEMVALUE_CHANGED = 3; // The value has changed for pItem in the property grid. +const UINT XT_PGN_EDIT_CHANGED = 4; // The edit value has changed in the property grid. + +// used internally - notifies rebar control that the ideal size of the +// embedded control has changed. +// wParam - control's handle, HWND +// lParam - new ideal size, UINT +// Return value is ignored. + +const UINT XTWM_IDEALSIZECHANGED = (WM_APP + 2534); + +// Note: If your application supports docking controlbars, you should +// not use the following IDs for your own controlbars. We suggest that +// you use 59500 (0xE86C) and higher for your control bar numbering. + +#ifndef AFX_IDW_MENUBAR +#define AFX_IDW_MENUBAR 0xE858 +#endif + +////////////////////////////////////////////////////////////////////// +// Summary: This macro will free the dynamically allocated memory specified by +// 'p' and set its value to NULL. +//#define SAFE_DELETE(p) if(p) { delete p; p = NULL; } +#define _delete SAFE_DELETE + +////////////////////////////////////////////////////////////////////// +// Summary: This macro will free the dynamically allocated memory for an array +// specified by 'p' and set its value to NULL. +#define SAFE_DELETE_AR(p) if(p) { delete [] p; p = NULL; } +#define _deleteArray SAFE_DELETE_AR + +////////////////////////////////////////////////////////////////////// +// Summary: This macro will release the resources for the COM object specified +// by 'p' and set its value to NULL. +//#define SAFE_RELEASE(p) if(p) { (p)->Release(); (p)=NULL; } + +///////////////////////////////////////////////////////////////////////////// +// UNICODE support definitions: + +#ifdef _UNICODE +#ifndef UNICODE +#define UNICODE +#endif +#endif + +///////////////////////////////////////////////////////////////////////////// +// Windows 2000 or greater tray icon support definitions: + +#ifdef NOTIFYICONDATA_V1_SIZE +#define SYSTRAY_USEW2K +#endif//NOTIFYICONDATA_V1_SIZE + +#ifndef NIIF_NONE +#define NIIF_NONE 0x00000000 +#endif//NIIF_NONE + +#ifndef NIIF_INFO +#define NIIF_INFO 0x00000001 +#endif//NIIF_INFO + +#ifndef NIIF_WARNING +#define NIIF_WARNING 0x00000002 +#endif//NIIF_WARNING + +#ifndef NIIF_ERROR +#define NIIF_ERROR 0x00000003 +#endif//NIIF_ERROR + +#ifndef NIN_SELECT +#define NIN_SELECT (WM_USER + 0) +#endif//NIN_SELECT + +#ifndef NINF_KEY +#define NINF_KEY 0x1 +#endif//NINF_KEY + +#ifndef NIN_KEYSELECT +#define NIN_KEYSELECT (NIN_SELECT | NINF_KEY) +#endif//NIN_KEYSELECT + +#ifndef NIN_BALLOONSHOW +#define NIN_BALLOONSHOW (WM_USER + 2) +#endif//NIN_BALLOONSHOW + +#ifndef NIN_BALLOONHIDE +#define NIN_BALLOONHIDE (WM_USER + 3) +#endif//NIN_BALLOONHIDE + +#ifndef NIN_BALLOONTIMEOUT +#define NIN_BALLOONTIMEOUT (WM_USER + 4) +#endif//NIN_BALLOONTIMEOUT + +#ifndef NIN_BALLOONUSERCLICK +#define NIN_BALLOONUSERCLICK (WM_USER + 5) +#endif//NIN_BALLOONUSERCLICK + +#ifndef IDANI_CAPTION +#define IDANI_CAPTION 3 +#endif//IDANI_CAPTION + +///////////////////////////////////////////////////////////////////////////// +// VC5 support definitions: + +#ifndef VERSION_WIN4 +#define VERSION_WIN4 MAKELONG(0, 4) +#endif +#ifndef VERSION_IE401 +#define VERSION_IE401 MAKELONG(72,4) +#endif +#ifndef CBRS_GRIPPER +#define CBRS_GRIPPER 0x00400000L +#endif +#ifndef AFX_IDW_REBAR +#define AFX_IDW_REBAR 0xE804 +#endif +#ifndef ID_VIEW_REBAR +#define ID_VIEW_REBAR 0xE804 +#endif +#ifndef AFX_IDW_DIALOGBAR +#define AFX_IDW_DIALOGBAR 0xE805 +#endif +#ifndef COLOR_GRADIENTACTIVECAPTION +#define COLOR_GRADIENTACTIVECAPTION 27 +#endif +#ifndef COLOR_GRADIENTINACTIVECAPTION +#define COLOR_GRADIENTINACTIVECAPTION 28 +#endif +#ifndef SPI_GETGRADIENTCAPTIONS +#define SPI_GETGRADIENTCAPTIONS 0x1008 +#endif +#ifndef SPI_GETMENUUNDERLINES +#define SPI_GETMENUUNDERLINES 0x100A +#endif +#ifndef SPI_GETFLATMENU +#define SPI_GETFLATMENU 0x1022 +#endif +#ifndef BIF_NEWDIALOGSTYLE +#define BIF_NEWDIALOGSTYLE 0x0040 +#endif +#ifndef AFX_INLINE +#define AFX_INLINE inline +#endif +#ifndef AFX_STATIC +#define AFX_STATIC static +#endif +#ifndef BTNS_WHOLEDROPDOWN +#define BTNS_WHOLEDROPDOWN 0x80 /* draw dropdown arrow, but without split arrow section */ +#endif +// Summary: The I_IMAGENONE constant is used when defining text-only toolbar buttons with no +// space allocated to the button icon +// The constant is normally defined in version 5.81 and greater SDK headers +#ifndef I_IMAGENONE +#define I_IMAGENONE (-2) +#endif//I_IMAGENONE + +////////////////////////////////////////////////////////////////////// + +#endif // #if !defined(__XTDEFINES_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTDelegate.h b/Editor/XT/Include/XTDelegate.h new file mode 100644 index 0000000..168d5ae --- /dev/null +++ b/Editor/XT/Include/XTDelegate.h @@ -0,0 +1,261 @@ +// XTDelegate.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTDELEGATE_H__) +#define __XTDELEGATE_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// Summary: A base class for delegates defined here +template +class CXTDelegateBase +{ +public: + typedef TCallback CB; + +protected: + + CB m_cb; // A callback. + CObject* m_target; // A target on which to invoke the callback. + +public: + CXTDelegateBase(CObject* target, CB cb) + : m_target(target) + , m_cb(cb) + { } + + operator bool () const + { + return m_target != 0 && m_cb != 0; + } + + void Set(CObject* target, CB cb) + { + m_target = target; + m_cb = cb; + } + + bool Remove(CObject* target) + { + bool removed = m_target == target; + if (removed) + { + m_target = 0; + m_cb = 0; + } + return removed; + } + + bool Remove(CObject* target, CB cb) + { + bool removed = (m_target == target) && (m_cb == cb); + if (removed) + { + m_target = 0; + m_cb = 0; + } + return removed; + } + +}; + +// Summary: No parameters, void return. +class CXTDelegate0 : public CXTDelegateBase +{ +public: + CXTDelegate0(CObject* target = 0, CB cb = 0) + : CXTDelegateBase(target, cb) + {} + + void operator () () const + { + (m_target->*m_cb)(); + } +}; + +// Summary: One parameter, void return. +template +class CXTDelegate1 : public CXTDelegateBase +{ +public: + CXTDelegate1(CObject* target = 0, CB cb = 0) + : CXTDelegateBase(target, cb) + {} + + void operator () (TParam param) const + { + (m_target->*m_cb)(param); + } +}; + +// Summary: One parameter, typed return. +template +class CXTDelegate1Ret : public CXTDelegateBase +{ +public: + CXTDelegate1Ret(CObject* target = 0, CB cb = 0) + : CXTDelegateBase(target, cb) + {} + + TReturn operator () (TParam param) const + { + return (m_target->*m_cb)(param); + } +}; + +// Summary: Two parameters, void return. +template +class CXTDelegate2 : public CXTDelegateBase +{ +public: + CXTDelegate2(CObject* target = 0, CB cb = 0) + : CXTDelegateBase(target, cb) + {} + + void operator () (TParam1 param1, TParam2 param2) const + { + (m_target->*m_cb)(param1, param2); + } +}; + +// Summary: Two parameters, returns a type. +template +class CXTDelegate2Ret : public CXTDelegateBase +{ +public: + CXTDelegate2Ret(CObject* target = 0, CB cb = 0) + : CXTDelegateBase(target, cb) + {} + + TReturn operator () (TParam1 param1, TParam2 param2) const + { + return (m_target->*m_cb)(param1, param2); + } +}; + +// Summary: A multicast delegate. +template +class CXTMultiCastDelegate : public CArray +{ +public: + +#if _MSC_VER < 1200 // MFC 5.0 + typedef TDelegate DELEGATE; + typedef DELEGATE::CB CB; +#else + typedef typename TDelegate DELEGATE; + typedef typename DELEGATE::CB CB; +#endif + + // Input: target - Points to a CObject object. + // Summary: Removes all registrations for a target. + void Remove(CObject* target) + { + for (int i = GetUpperBound(); i >= 0; i--) + { + if (ElementAt(i).Remove(target)) + { + RemoveAt(i); + } + } + ReleaseMemory(); + } + + // Summary: Frees up the memory once there is nothing in the array. + void ReleaseMemory() + { + if (GetSize() == 0) + { + FreeExtra(); + } + } + + + // Input: target - Points to a CObject object. + // cb - delegate + // Summary: removes all registrations for a target. + void Remove(CObject* target, CB cb) + { + for (INT_PTR i = GetUpperBound(); i >= 0; i--) + { + if (ElementAt(i).Remove(target, cb)) + { + RemoveAt(i); + } + } + ReleaseMemory(); + } + + // Input: target - Pointst to a CObject object. + // cb - delegate. + // Returns: Index into array where callback was added. + // Summary: Adds new callback. + int Add(CObject* target, CB cb) + { + return CArray::Add(DELEGATE(target, cb)); + } +}; + +// Summary: No-parameter delegate. +class CXTMultiCastDelegate0 : public CXTMultiCastDelegate +{ +public: + void operator() () + { + for (int i = 0; i < GetSize(); i++) + { + CXTDelegate0& delegate = ElementAt(i); + delegate(); + } + } + +}; + +// Summary: One parameter delegate. +template +class CXTMultiCastDelegate1 : public CXTMultiCastDelegate< CXTDelegate1 > +{ +public: + void operator() (TParam param) + { + for (int i = 0; i < GetSize(); i++) + { + const CXTDelegate1& delegate = ElementAt(i); + delegate(param); + } + } +}; + +// Summary: Two parameter delegate. +template +class CXTMultiCastDelegate2 : public CXTMultiCastDelegate< CXTDelegate2 > +{ +public: + void operator() (TParam1 param1, TParam2 param2) + { + for (int i = 0; i < GetSize(); i++) + { + const CXTDelegate2& delegate = ElementAt(i); + delegate(param1, param2); + } + } +}; + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#endif +// __XTDELEGATE_H__ diff --git a/Editor/XT/Include/XTDialogBar.h b/Editor/XT/Include/XTDialogBar.h new file mode 100644 index 0000000..7456731 --- /dev/null +++ b/Editor/XT/Include/XTDialogBar.h @@ -0,0 +1,162 @@ +// XTDialogBar.h interface for the CXTDialogBar class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTDIALOGBAR_H__) +#define __XTDIALOGBAR_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: The CXTDialogBar class provides the functionality of a Windows modeless +// dialog box in a control bar. A dialog bar resembles a dialog box in +// that it contains standard Windows controls that the user can tab between. +// Another similarity is that you create a dialog template to represent +// the dialog bar. +// +// Creating and using a dialog bar is similar to creating and using a CFormView +// object. First, use the dialog editor (described in the MSDN Visual C++ +// User's Guide) to define a dialog template with the style WS_CHILD and +// no other style. The template must not have the style WS_VISIBLE. In +// your application code, call the constructor to construct the CXTDialogBar +// object, then call Create to create the dialog bar window and attach +// it to the CXTDialogBar object. +class _XT_EXT_CLASS CXTDialogBar : public CXTControlBar +{ + DECLARE_DYNAMIC(CXTDialogBar) + +public: + + // Summary: Constructs a CXTDialogBar object. + CXTDialogBar(); + + // Summary: Destroys a CXTDialogBar object, handles cleanup and de-allocation. + virtual ~CXTDialogBar(); + +protected: + + CWnd* m_pParentWnd; // Points to the parent window. + CSize m_sizeDefault; // Default size of the dialog bar. + +public: + + // BULLETED LIST: + + // Input: pParentWnd - A pointer to the parent CWnd object. + // lpszTemplateName - A pointer to the name of the CXTDialogBar + // object’s dialog box resource template. + // nStyle - The alignment style of the dialog bar. The + // following styles are supported: + // [ul] + // [li]CBRS_TOP Control bar is at the top of the frame + // window.[/li] + // [li]CBRS_BOTTOM Control bar is at the bottom of the + // frame window.[/li] + // [li]CBRS_NOALIGN Control bar is not repositioned when + // the parent is resized.[/li] + // [li]CBRS_LEFT Control bar is at the left of the frame + // window.[/li] + // [li]CBRS_RIGHT Control bar is at the right of the frame + // window.[/li] + // [/ul] + // nID - The control ID of the dialog bar. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function loads the dialog box resource template specified + // by 'lpszTemplateName'. It creates the dialog bar window, sets + // its style, and associates it with the CXTDialogBar object. + // + // If you specify the CBRS_TOP or CBRS_BOTTOM alignment style, the + // dialog bar’s width is that of the frame window and its height is + // that of the resource specified by 'lpszTemplateName'. If you specify the + // CBRS_LEFT or CBRS_RIGHT alignment style, the dialog bar’s height is + // that of the frame window and its width is that of the resource + // specified by 'lpszTemplateName'. + virtual BOOL Create(CWnd* pParentWnd,LPCTSTR lpszTemplateName,UINT nStyle = CBRS_ALIGN_TOP,UINT_PTR nID = AFX_IDW_DIALOGBAR); + + // BULLETED LIST: + + // Input: pParentWnd - A pointer to the parent CWnd object. + // nIDTemplate - The resource ID of the CXTDialogBar object’s + // dialog box template. + // nStyle - The alignment style of the dialog bar. The + // following styles are supported: + // [ul] + // [li]CBRS_TOP Control bar is at the top of the frame + // window.[/li] + // [li]CBRS_BOTTOM Control bar is at the bottom of the + // frame window.[/li] + // [li]CBRS_NOALIGN Control bar is not repositioned when + // the parent is resized.[/li] + // [li]CBRS_LEFT Control bar is at the left of the frame + // window.[/li] + // [li]CBRS_RIGHT Control bar is at the right of frame + // window.[/li] + // [/ul] + // nID - The control ID of the dialog bar. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function loads the dialog box resource template specified + // by 'nIDTemplate'. It creates the dialog bar window, sets + // its style, and associates it with the CXTDialogBar object. + // + // If you specify the CBRS_TOP or CBRS_BOTTOM alignment style, the + // dialog bar’s width is that of the frame window and its height is + // that of the resource specified by 'nIDTemplate'. If you specify the + // CBRS_LEFT or CBRS_RIGHT alignment style, the dialog bar’s height is + // that of the frame window and its width is that of the resource + // specified by 'nIDTemplate'. + virtual BOOL Create(CWnd* pParentWnd,UINT nIDTemplate,UINT nStyle = CBRS_ALIGN_TOP,UINT nID = AFX_IDW_DIALOGBAR); + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTDialogBar) + virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz); + virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); + //}}AFX_VIRTUAL + +#ifndef _AFX_NO_OCC_SUPPORT + ////////////////////////////////////////////////////////////////////// + // Data and functions necessary for OLE control containment + ////////////////////////////////////////////////////////////////////// + + _AFX_OCC_DIALOG_INFO* m_pOccDialogInfo; + LPCTSTR m_lpszTemplateName; + + virtual BOOL SetOccDialogInfo( + _AFX_OCC_DIALOG_INFO* pOccDialogInfo); + +#endif //!_AFX_NO_OCC_SUPPORT + + // Ignore: + //{{AFX_MSG(CXTDialogBar) +#ifndef _AFX_NO_OCC_SUPPORT + afx_msg LRESULT HandleInitDialog(WPARAM wParam, LPARAM lParam); +#endif + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE BOOL CXTDialogBar::Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID) { + return Create(pParentWnd, MAKEINTRESOURCE(nIDTemplate), nStyle, nID); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. +#endif // #if !defined(__XTDIALOGBAR_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTDockBar.h b/Editor/XT/Include/XTDockBar.h new file mode 100644 index 0000000..9d714f4 --- /dev/null +++ b/Editor/XT/Include/XTDockBar.h @@ -0,0 +1,295 @@ +// XTDockBar.h interface for the CXTDockBar class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTDOCKBAR_H__) +#define __XTDOCKBAR_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// class forwards. + +class CXTDockWindow; + +// Summary: CArray definition for CXTSplitterDock pointer array. +typedef CArray CXTSplitterDockArray; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTDockBar is a CDockBar derived class. It is used by CXTFrameWnd and +// CXTMDIFrameWnd to offset CXTToolBars to allow 3D borders. +class _XT_EXT_CLASS CXTDockBar : public CDockBar +{ + DECLARE_DYNAMIC(CXTDockBar) + +public: + + // Summary: Constructs a CXTDockBar object. + CXTDockBar(); + + // Summary: Destroys a CXTDockBar object, handles cleanup and de-allocation. + virtual ~CXTDockBar(); + +protected: + + + int m_nTrackSplitter; // Splitter used to drag. + BOOL m_bTracking; // TRUE when tracking. + HWND m_hWndFocus; // Previous focus window when tracking. + DWORD m_dwXTStyle; // FLAT styles. + CXTSplitterDockArray m_arrSplitters; // Array of CXTSplitterDock objects. + +public: + + // Input: nBar - Index of the bar in the control bar array. + // Returns: A pointer to a valid CXTDockWindow object. + // Summary: This member function is called to determine if the docking window specified + // by 'nBar' is maximized. + CXTDockWindow* IsRowMaximized(int nBar); + + // Input: pBar - A pointer to a valid CControlBar object. + // lpRect - Initial size of the docked bar. + // Summary: This member function is called to dock the control bar specified by 'pBar'. + void DockControlBar(CControlBar* pBar,LPCRECT lpRect); + + // Input: pMaxBar - A pointer to a valid CXTDockWindow object. + // bRecalcLayout - TRUE if the parent frame needs to recalculate the layout. + // Summary: This member function is called to maximize the control bar specified + // by 'pMaxBar'. + void Maximize(CXTDockWindow* pMaxBar,BOOL bRecalcLayout = TRUE); + + // Input: pMaxBar - A pointer to a valid CXTDockWindow object. + // bRecalcLayout - TRUE if the parent frame needs to recalculate the layout. + // Summary: This member function is called to normalize the control bar specified + // by 'pMaxBar'. + void Normalize(CXTDockWindow* pMaxBar,BOOL bRecalcLayout = TRUE); + + // Returns: The current CBRS_XT_ (Control bar) settings for the control bar. See + // CXTDockWindow::ModifyXTBarStyle for the complete list of available + // styles. + // Summary: Call this member function to determine which CBRS_XT_ (control bar) + // settings are currently set for the control bar. It does not handle + // WS_ (window style) or CBRS_ (control bar style). + // See Also: CXTDockWindow::ModifyXTBarStyle + DWORD GetXTBarStyle(); + + // Input: dwNewStyle - New CBRS_XT_ style for the control bar. See CXTDockWindow::ModifyXTBarStyle + // for the complete list of available styles. + // Summary: This member function will set the style for the control bar. It does not + // handle WS_ (window style) or CBRS_ (control bar style). + void SetXTBarStyle(DWORD dwNewStyle); + + // Ignore: + //{{AFX_VIRTUAL(CXTDockBar) + public: + virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz); + virtual void HitTest(const CPoint& point); + virtual void DoPaint(CDC* pDC); + //}}AFX_VIRTUAL + + virtual int InsertEx(CControlBar* pBarIns, CRect rect, CPoint ptMid); + +#if _MSC_VER < 1200 // MFC 5.0 + virtual void DrawGripper(CDC* pDC, const CRect& rect); +#endif //_MSC_VER < 1200 + +protected: + + // Input: nInitPos - Initial position of the control bar whose row is to have its borders + // removed. + // dwBarStyle - Style for the row can be any CBRS_BORDER style. See + // CControlBar::SetBarStyle for more details. + // bOnlySized - TRUE if the control bar is to be only one sized. + // Summary: This member function is called to remove the row borders for the row + // of the control bar specified by 'nInitPos'. + void RemoveRowBorders(int nInitPos,DWORD dwBarStyle = CBRS_BORDER_ANY,BOOL bOnlySized = FALSE); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // nNewHeight - Size, in pixels, of the new row height. + // Returns: The amount, in pixels, the row was adjusted. + // Summary: This member function is called to set the height for the row of the + // control bar specified by 'nInitPos'. + int SetRowHeight(int nInitPos,int nNewHeight); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // nIncWidth - Amount, in pixels, to increment the width by. + // Returns: The amount, in pixels, the row was adjusted. + // Summary: This member function is called to stretch the row of control bars to + // the left. + int StretchRowLeft(int nInitPos,int nIncWidth); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // nIncWidth - Amount, in pixels, to increment the width by. + // Returns: The amount, in pixels, the row was adjusted. + // Summary: This member function is called to stretch the row of control bars to + // the right. + int StretchRowRight(int nInitPos,int nIncWidth); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // pNewBar - A pointer to a valid CControlBar object. + // Returns: The number of control bars docked on the row specified. + // Summary: This member function gets the number of control bars docked on the + // row that the control bar, specified by 'nInitPos', resides. + int GetRowSizeBars(int nInitPos,CControlBar* pNewBar = NULL); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // pNewBar - A pointer to a valid CControlBar object. + // Returns: The width of the fixed bar including the splitters. + // Summary: This member function gets the width of the fixed bar including the + // splitter sizes. + int GetRowFixedWidth(int nInitPos,CControlBar* pNewBar = NULL); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // pNewBar - A pointer to a valid CControlBar object. + // Returns: The minimum width of the row specified. + // Summary: This member function gets the minimum width of the row for the control + // bar specified by 'nInitPos'. + int GetRowMinSizedWidth(int nInitPos,CControlBar* pNewBar = NULL); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // pNewBar - A pointer to a valid CControlBar object. + // Returns: The normal width of the row specified. + // Summary: This member function gets the normal width of the row for the control + // bar specified by 'nInitPos'. + int GetRowSizedWidth(int nInitPos,CControlBar* pNewBar = NULL); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // pNewBar - A pointer to a valid CControlBar object. + // Returns: The minimum height of the row specified. + // Summary: This member function gets the minimum height of the row for the + // control bar specified by 'nInitPos'. + int GetRowMaxHeight(int nInitPos,CControlBar* pNewBar = NULL); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // pNewBar - A pointer to a valid CControlBar object. + // Returns: The minimum height of the row specified. + // Summary: This member function gets the minimum height of the row for the + // control bar specified by 'nInitPos'. + int GetRowMinHeight(int nInitPos,CControlBar* pNewBar = NULL); + + // Returns: The dockbar's available height. + // Summary: This member function gets the available height for the dockbar. + int GetAvailableHeight(); + + // Input: pBar - A pointer to a valid CControlBar object. + // Returns: An int value that represents first control bar in + // the row. + // Summary: This member function gets a pointer to the first control bar in + // the row. + int GetFirstBarInRow(CControlBar* pBar); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // Summary: This member function is called to adjust the row sizes of the row for + // the control bar specified by 'nInitPos'. + void AdjustRowSizes(int nInitPos); + + // Input: dc - A CDC pointer to a valid device context. + // Summary: This member function is called to draw the splitter bars that separate + // the docked control bars. + void DrawSplitters(CDC* dc); + + // Input: nStart - Starting position of the bar in the control bar array. + // nType - Type of splitter bar; either XT_SPLITTER_VERT or XT_SPLITTER_HORZ. + // nLength - Initial size of the splitter. + // Summary: This member function is called to set the length of the splitters for + // the docked control bars. + void SetSplittersLength(int nStart,int nType,int nLength); + + // Summary: This member function is called to free resources allocated for dock + // splitters. + void DeleteSplitters(); + + // Input: rcSplitter - A CRect object. + // nType - Type of splitter bar; either XT_SPLITTER_VERT or XT_SPLITTER_HORZ. + // bInterRow - TRUE if the splitter is an interior row. + // nPos - Initial position of the splitter bar. + // Summary: This member function is called to add a splitter to the dockbar. + void AddSplitter(CRect rcSplitter,int nType,BOOL bInterRow,int nPos); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // Returns: A pointer to a valid CControlBar object. + // Summary: This member function is called to return a pointer to the bar specified + // by 'nInitPos'. + CControlBar *FindNewBar(int nInitPos); + + // Input: nInitPos - Initial position of the bar in the control bar array. + // Returns: A pointer to a valid CXTDockWindow object. + // Summary: This member function is called to return a pointer to the control bar + // specified by 'nInitPos'. 'nInitPos' is the index of the bar in the control + // bar array. + CXTDockWindow *FindUniqueBar(int nInitPos); + + // Summary: This member function is called during sizing operations to cancel the + // drag event. + void OnCancel(); + + // Input: pBar - A pointer to a valid CControlBar object. + // Returns: A pointer to a valid CXTDockWindow object, otherwise returns NULL. + // Summary: This member function is called to get a valid handle for the control + // bar specified by 'pBar'. + CXTDockWindow* GetSafeDockWindow(CControlBar* pBar); + + // Input: nPos - Initial position of the bar in the control bar array. + // Returns: true if the bar is the last in the row, otherwise returns false. + // Summary: This member function is called to determine if the control bar specified + // by 'nPos' is the last control bar in the row. + bool IsLastBarInRow(int nPos); + + // Summary: This member function is called to determine the number of + // visible docked control bars. + int GetDockedVisibleCount() const; + + // Input: pDC - A CDC pointer to a valid device context. + // rect - A reference to a valid CRect object. + // Summary: This member function is called during paint operations to draw the + // non-client areas of the dockbar. + void DrawNcBorders(CDC* pDC,CRect& rect); + + // Ignore: + //{{AFX_MSG(CXTDockBar) + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + afx_msg void OnNcPaint(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() + + friend class CXTDockWindow; + friend class CXTSplitterWnd; + friend class CXTSplitterDock; + friend class CXTSplitterRowDock; + friend class CXTMiniDockFrameWnd; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTDockBar::SetXTBarStyle(DWORD dwNewStyle) { + m_dwXTStyle = dwNewStyle; +} +AFX_INLINE DWORD CXTDockBar::GetXTBarStyle() { + ASSERT(::IsWindow(m_hWnd)); return m_dwXTStyle; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTDOCKBAR_H__) + diff --git a/Editor/XT/Include/XTDockColorSelector.h b/Editor/XT/Include/XTDockColorSelector.h new file mode 100644 index 0000000..fe109ea --- /dev/null +++ b/Editor/XT/Include/XTDockColorSelector.h @@ -0,0 +1,77 @@ +// XTDockColorSelector.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTDOCKCOLORSELECTOR_H__) +#define __XTDOCKCOLORSELECTOR_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTDockColorSelector is a CXTDockWindow derived class. It is used to create +// sizing / docking windows with color selector as a child. +class _XT_EXT_CLASS CXTDockColorSelector : public CXTDockWindow +{ + DECLARE_DYNAMIC(CXTDockColorSelector) + +public: + // Summary: Constructs a CXTColorPopup object. + CXTDockColorSelector(); + + // Summary: Destroys a CXTColorPopup object, handles cleanup and de-allocation. + virtual ~CXTDockColorSelector(); + + // Input: pParentWnd - Pointer to the window that is the control bar’s parent. + // nID - The control bar’s window ID. + // lpszCaption - Points to a null-terminated character string that + // represents the control bar name. Used as text for + // the caption. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function creates a CXTDockColorSelector. + BOOL Create(CWnd* pParentWnd,UINT nID,LPCTSTR lpszCaption=NULL); + + // Summary: Call this member function to get Color Selector control. + CXTColorSelectorCtrl* GetColorSelector(); + +protected: + + // Ignore: + //{{AFX_MSG(CDockWinEx1) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + afx_msg void OnButtonClose(); + afx_msg void OnUpdateButtonClose(CCmdUI* pCmdUI); + afx_msg LRESULT OnSelEndOK(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnQueryVisualize(WPARAM, LPARAM); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() + +private: + + CXTColorSelectorCtrl m_wndColors; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTColorSelectorCtrl* CXTDockColorSelector::GetColorSelector() { + return &m_wndColors; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif //__XTDOCKCOLORSELECTOR_H__ diff --git a/Editor/XT/Include/XTDockContext.h b/Editor/XT/Include/XTDockContext.h new file mode 100644 index 0000000..f30574b --- /dev/null +++ b/Editor/XT/Include/XTDockContext.h @@ -0,0 +1,145 @@ +// XTDockContext.h interface for the CXTDockContext class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTDOCKCONTEXT_H__) +#define __XTDOCKCONTEXT_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// class forwards + +class CXTDockBar; +class CXTDockWindow; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTDockContext is a CDockContext derived class. It is used by CXTDockWindow +// and CXTMiniDockFrameWnd for docking and sizing control bars. +class _XT_EXT_CLASS CXTDockContext : public CDockContext +{ +public: + // Listeners for drag state changes. + + typedef CXTCallbacks LISTENERS; + typedef LISTENERS::NOTIFYCB LISTENERCB; + +public: + + // Input: pBar - Pointer to a CControlBar object. + // Summary: Constructs a CXTDockContext object. + CXTDockContext(CControlBar* pBar); + + // Summary: Destroys a CXTDockContext object, handles cleanup and de-allocation. + virtual ~CXTDockContext(); + +protected: + + bool m_bFullWindowDrag; // Tells if full window drag is shall be executed. + bool m_bRecalcPending; + bool m_bTracking; // Tells if the context currently tracking mouse during drag/resize operation + CPoint m_ptOrig; // Cursor position. + LISTENERS m_trackStateListeners; // Listeners for tracking state change notifications + CTypedPtrArray m_arrFramesPendingRecalc; + +public: + + // Returns: true if it is tracking a mouse, otherwise it returns false. + // Summary: This member function tells if this object is currently tracking a mouse + // during a drag or resize operation. + bool IsTracking() const; + + // Summary: This member function is called by CXTDockContext when a drag operation + // completes. + void EndDrag(); + + // Input: pt - CPoint object that represents the current cursor location. + // Summary: This member function is called by CXTDockWindow and CXTMiniDockFrameWnd + // whenever a drag operation begins. + virtual void StartDrag(CPoint pt); + + // Returns: A DWORD value. + // Summary: This member function is called by CXTDockContext to determine whether + // a control bar is dockable. + DWORD CanDock(); + + // Input: rect - Size of the control bar. + // dwDockStyle - Control bar style. + // ppDockBar - Points to a CDockBar pointer. + // Returns: A DWORD value. + // Summary: This member function is called by CXTDockContext to determine whether + // a control bar is dockable. + DWORD CanDock(CRect rect,DWORD dwDockStyle,CDockBar** ppDockBar = NULL); + + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is called by CXTDockContext whenever a drag + // operation begins. + BOOL Track(); + + // Input: dwOverDockStyle - Control bar style. + // Returns: A CXTDockBar pointer. + // Summary: This member function is called by CXTDockContext to get a pointer + // to a CXTDockBar object. + CXTDockBar* GetDockBar(DWORD dwOverDockStyle); + + // Summary: This member function is used to toggle the docked state of a control + // bar. + virtual void ToggleDocking(); + + // Input: pt - CPoint object that represents the current cursor location. + // Summary: This member function is called to enable diagonal sizing for + // the control bar. + void Stretch(CPoint pt); + + // Input: listener - A pointer to a CObject object. + // cb - LISTENERCB object. + // Summary: This member function adds a listener for drag state change notifications. + void AddTrackStateListener(CObject* listener, LISTENERCB cb); + + // Input: listener - A pointer to a CObject object. + // Summary: This member function removes a listener. + void RemoveListener(CObject* listener); + + void DeferRecalcLayout(CFrameWnd* pFrame); + virtual void StartResize(int nHitTest, CPoint pt); + void Move(CPoint pt); + void DrawFocusRect(BOOL bRemoveRect = FALSE); + void OnKey(int nChar, BOOL bDown); + void UpdateState(BOOL* pFlag, BOOL bNewValue); + bool CanDock(CFrameWnd* pFrame, DWORD& dwResult, CRect rect, DWORD dwDockStyle, CDockBar** ppDockBar); + void FlushRecalcLayout(CFrameWnd* pFrame); + virtual CFrameWnd* GetAlternateSite(); + +private: + void InitLoop(); + void CancelLoop(); + void EndResize(); + + void AdjustRectangle(CRect& rect, CPoint pt); + void FloatControlBar(DWORD dwFloatStyle); + friend class CXTControlBar; + friend class CXTTrackDockContextCleanup; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE bool CXTDockContext::IsTracking() const { + return m_bTracking; +} + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTDOCKCONTEXT_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTDockState.h b/Editor/XT/Include/XTDockState.h new file mode 100644 index 0000000..d57dde7 --- /dev/null +++ b/Editor/XT/Include/XTDockState.h @@ -0,0 +1,109 @@ +// XTDockState.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#ifndef __XTDOCKSTATE_H__ +#define __XTDOCKSTATE_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTControlBarInfo is a CControlBarInfo derived class. It is used to +// load and save the information about control bars. +class CXTControlBarInfo : public CControlBarInfo +{ +public: + + // Input: lpszProfileName - Points to a null-terminated string that specifies the name of a section + // in the initialization file or a key in the Windows registry where + // state information is stored. + // nIndex - Index of the control bar in the array. + // pDockState - A pointer to a valid CDockState object. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this function to retrieve state information from the registry + // or .INI file. The profile name is the section of the application's + // .INI file or the registry that contains the bars' state information. + // You can save control bar state information to the registry or .INI + // file with SaveState. + BOOL LoadState(LPCTSTR lpszProfileName,int nIndex,CDockState* pDockState); + + // Input: lpszProfileName - Points to a null-terminated string that specifies the name of a section + // in the initialization file or a key in the Windows registry where + // state information is stored. + // nIndex - Index of the control bar in the array. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this function to save the state information to the registry or + // .INI file. The profile name is the section of the application's .INI + // file or the registry that contains the control bar's state information. + // SaveState also saves the current screen size. You can retrieve control + // bar information from the registry or .INI file with LoadState. + BOOL SaveState(LPCTSTR lpszProfileName,int nIndex); +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTDockState is a serialized CObject derived class. It loads, unloads, +// or clears the state of one or more docking control bars in persistent +// memory (a file). The dock state includes the size and position of the +// bar and whether or not it is docked. When retrieving the stored dock +// state, CXTDockState checks the bar's position and, if the bar is not +// visible with the current screen settings, CXTDockState scales the bar's +// position so that it is visible. The main purpose of CXTDockState is +// to hold the entire state of a number of control bars and to allow that +// state to be saved and loaded either to the registry, the application's +// .INI file, or in binary form as part of a CArchive object's contents. +// +// The bar can be any dockable control bar, including a toolbar, status +// bar, or dialog bar. CXTDockState objects are written and read to, or +// from, a file via a CArchive object. +// +// CXTFrameWnd::GetDockState retrieves the state information of all the +// frame window's CXTControlBar objects and puts it into the CXTDockState +// object. You can then write the contents of the CXTDockState object +// to storage with Serialize or CXTDockState::SaveState. If you later want +// to restore the state of the control bars in the frame window, you can +// load the state with Serialize or CXTDockState::LoadState, then use +// CXTFrameWnd::SetDockState to apply the saved state to the frame window's +// control bars. +class CXTDockState : public CDockState +{ + DECLARE_SERIAL(CXTDockState) +public: + + // Input: lpszProfileName - Points to a null-terminated string that specifies the name of a section + // in the initialization file or a key in the Windows registry where + // state information is stored. + // Summary: Call this function to retrieve state information from the registry + // or .INI file. The profile name is the section of the application's + // .INI file or the registry that contains the bar's state information. + // You can save control bar state information to the registry or .INI + // file with SaveState. + void LoadState(LPCTSTR lpszProfileName); + + // Input: lpszProfileName - Points to a null-terminated string that specifies the name of a section + // in the initialization file or a key in the Windows registry where + // state information is stored. + // Summary: Call this function to save the state information to the registry or + // .INI file. The profile name is the section of the application's .INI + // file or the registry that contains the control bar's state information. + // SaveState also saves the current screen size. You can retrieve control + // bar information from the registry or .INI file with LoadState. + void SaveState(LPCTSTR lpszProfileName); +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // __XTDOCKSTATE_H__ diff --git a/Editor/XT/Include/XTDockWindow.h b/Editor/XT/Include/XTDockWindow.h new file mode 100644 index 0000000..b075c03 --- /dev/null +++ b/Editor/XT/Include/XTDockWindow.h @@ -0,0 +1,459 @@ +// XTDockWindow.h interface for the CXTDockWindow class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTDOCKWINDOW_H__) +#define __XTDOCKWINDOW_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// forwards + +class CXTBarButton; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTDockWindow is a CXTControlBar derived class. It is used to create +// sizing / docking windows similar to those seen in Developer Studio. +class _XT_EXT_CLASS CXTDockWindow : public CXTControlBar +{ + DECLARE_DYNAMIC(CXTDockWindow) + + friend class CXTBarButton; + +public: + + // Summary: Constructs a CXTDockWindow object. + CXTDockWindow(); + + // Summary: Destroys a CXTDockWindow object, handles cleanup and de-allocation. + virtual ~CXTDockWindow(); + +protected: + + int m_cxOffset; // Used to offset the horizontal client area to allow room for the caption when docked. + int m_nBtnIndex; // Used to determine which button icon to display when the control bar is minimized or maximized depending on which side docked. + CWnd* m_pChildWnd; // CWnd pointer which contains the child window that is displayed in the control bar. See SetChild(CWnd* pWnd). + BOOL m_bActive; // TRUE if the docking window is currently active. + BOOL m_bMenuRemoved; // TRUE when the system menu is removed from a floating docking window. + CFrameWnd* m_pParentFrame; // Points to the parent frame. + CToolTipCtrl m_ToolTip; // Tooltip used for caption buttons. + CXTBarButton* m_pBtnClose; // Close button used in caption area. + CXTBarButton* m_pBtnMinim; // Minimize button used in the caption area. + CXTIconHandle m_hIconHide; // Hide button icon. + CXTIconHandle m_hIconMaxHDisable; // Horizontal max button icon disabled. + CXTIconHandle m_hIconMaxHEnable; // Horizontal max button icon enabled. + CXTIconHandle m_hIconMaxVDisable; // Vert max button icon disabled. + CXTIconHandle m_hIconMaxVEnable; // Vert max button icon enabled. + CXTIconHandle m_hIconHDisable; // Horizontal button icon disabled. + CXTIconHandle m_hIconHEnabled; // Horizontal button icon enabled. + CXTIconHandle m_hIconVDisable; // Vert button icon disabled. + CXTIconHandle m_hIconVEnabled; // Vert button icon enabled. + +private: + + DWORD m_dwInitSignature; // Used to validate pending initialization requests + +public: + + //BULLETED LIST: + + // Input: dwAdd - Specifies CBRS_XT_ styles to be removed during style + // modification. + // dwAdd - Specifies CBRS_XT_ styles to be added during style + // modification. + // bRedraw - TRUE to redraw the control bar. + // Returns: Nonzero if style was successfully modified, otherwise returns zero. + // Summary: Call this member function to modify a control bar style. Styles to + // be added or removed can be combined by using the bitwise OR (|) + // operator. + // + // The desired styles for the control bar can be one or more of + // the following: + // [ul] + // [li]CBRS_XT_BUTTONS The control bar has a minimize and close + // button when docked.[/li] + // [li]CBRS_XT_GRIPPER The control bar has a gripper when docked.[/li] + // [li]CBRS_XT_GRIPPER_FLAT The control bar has a flat gripper. + // Use with CBRS_XT_GRIPPER.[/li] + // [li]CBRS_XT_GRIPPER_GRAD The control bar has a gradient + // flat gripper. Use with CBRS_XT_GRIPPER_FLAT.[/li] + // [li]CBRS_XT_GRIPPER_TEXT The control bar draws text in the + // gripper area. Use with CBRS_XT_GRIPPER.[/li] + // [li]CBRS_XT_BUTTONS_FLAT The control bar min and max buttons + // are flat. Use with CBRS_XT_BUTTONS.[/li] + // [li]CBRS_XT_BORDERS_FLAT The control bar borders are flat.[/li] + // [li]CBRS_XT_CLIENT_OUTLINE Draw a single black border outline + // around the client area.[/li] + // [li]CBRS_XT_CLIENT_STATIC Draw a static rect around the + // client area.[/li] + // [li]CBRS_XT_CLIENT_MODAL Draw a modal rect around the client + // area.[/li] + // [li]CBRS_XT_ALL_FLAT The following styles combined by using + // the bitwise OR (|) operator CBRS_XT_GRIPPER_FLAT, CBRS_XT_BUTTONS_FLAT, + // and CBRS_XT_BORDERS_FLAT.[/li] + // [li]CBRS_XT_DEFAULT The following styles combined by using + // the bitwise OR (|) operator CBRS_XT_BUTTONS, CBRS_XT_GRIPPER, + // and CBRS_XT_GRIPPER_TEXT.[/li] + // [/ul] + virtual BOOL ModifyXTBarStyle(DWORD dwRemove,DWORD dwAdd,BOOL bRedraw=TRUE); + + // BULLETED LIST: + + // Input: pParentWnd - Pointer to the window that is the control bar’s parent. + // nID - The control bar’s window ID. + // lpszCaption - Points to a null-terminated character string that + // represents the control bar name. Used as text for + // the caption. + // size - Specifies the default size of the control bar. + // dwStyle - The control bar style. Additional toolbar styles + // supported are: + // [ul] + // [li]CBRS_TOP Control bar is at the top of the frame window.[/li] + // [li]CBRS_BOTTOM Control bar is at the bottom of the frame + // window.[/li] + // [li]CBRS_NOALIGN Control bar is not repositioned when + // the parent is resized.[/li] + // [li]CBRS_TOOLTIPS Control bar displays tool tips.[/li] + // [li]CBRS_SIZE_DYNAMIC Control bar is dynamic.[/li] + // [li]CBRS_SIZE_FIXED Control bar is fixed.[/li] + // [li]CBRS_FLOATING Control bar is floating.[/li] + // [li]CBRS_FLYBY Status bar displays information about + // the button.[/li] + // [li]CBRS_HIDE_INPLACE Control bar is not displayed to + // the user.[/li] + // [/ul] + // dwBarStyle - Specifies CBRS_XT_ styles to be used during creation. + // See ModifyXTBarStyle for information about the available + // control bar styles. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function creates a CXTDockWindow (a docking window). + // It also sets the control bar default size, style, ID, and caption text. + virtual BOOL Create(CWnd* pParentWnd,UINT nID,LPCTSTR lpszCaption=NULL, CSize size=CSize(200,100),DWORD dwStyle=CBRS_LEFT,DWORD dwBarStyle=CBRS_XT_DEFAULT); + + // Input: rect - Reference to a CRect object which contains the size of + // the child window associated with the control bar. + // Summary: This member function is called by the control bar, and can be overloaded + // in derived classes to return the rect for the child window associated + // with the control bar. + virtual void GetInsideRect(CRect &rect); + + // Returns: The minimum extent for a minimized control bar. + // Summary: This member function is called to determine the minimum extent of + // the control bar when minimized or maximized. + virtual int GetMinExt(); + + // Returns: Nonzero if the docked control bar is maximized, otherwise returns zero. + // Summary: This member function is used to determine if the docked control + // bar is maximized. + virtual BOOL IsMaximized() const; + + // Returns: Nonzero if the docked control bar is unique, otherwise returns zero. + // Summary: This member function is used to determine if the docked control + // bar is unique. + virtual BOOL IsUnique() const; + + // Input: size - A reference to a CSize object that contains the normal + // size that the control bar should be. + // Summary: This member function is called to set the normal size the for + // the control bar. + virtual void SetNormalSize(const CSize &size); + + // Summary: This member function is called to initialize the default size + // to the current float size. + virtual void SetFloatSize(); + + // Summary: This member function is called to return the control bar to + // its normal size. + virtual void Normalize(); + + // Returns: The docking window's minimized size in pixels. + // Summary: This member function is called to minimize the control bar. + virtual int Minimize(); + + // Input: size - Indicates the width or height of the bar. + // Summary: This member function is called to maximize the control bar. + virtual void Maximize(int size); + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking + // and the sides of its parent window to which the + // control bar can be docked, if supported. It can be one + // or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window. If 0 (that is, indicating + // no flags), the control bar will not dock.[/li] + // [/ul] + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the + // destination frame window, or the control bar cannot be docked to + // that frame window. + virtual void EnableDocking(DWORD dwDockStyle); + + // Returns: An int value that represents the current width of the vertically docked + // control bar. + // Summary: This member function is used to determine the width of the control + // bar when docked vertically. + virtual int GetVertSize(); + + // Returns: An int value that represents the current height of the horizontally docked + // control bar. + // Summary: This member function is used to determine the width of the control + // bar when docked horizontally. + virtual int GetHorzSize(); + + // Input: strSection - Name of a section in the initialization file or a key + // in the Windows registry where state information is stored. + // Summary: Call this member function to restore the settings of each control + // bar owned by the frame window. This information is written to the + // initialization file using SaveBarSize. Information restored includes + // visibility, horizontal/vertical orientation, docking state, and control bar + // position. This function call is handled by CXTFrameWnd::LoadBarState, + // and should not be called directly. + void LoadBarSize(CString strSection); + + // Input: strSection - Name of a section in the initialization file or a key + // in the Windows registry where state information is stored. + // Summary: Call this function to store information about each control bar owned + // by the frame window. This information can be read from the initialization + // file using LoadBarSize. Information stored includes visibility, + // horizontal/vertical orientation, docking state, and control bar + // position. This function call is handled by CXTFrameWnd::SaveBarState, + // and should not be called directly. + void SaveBarSize(CString strSection); + + // Input: pViewClass - CView runtime class associated with the tab. + // pDocument - CDocument associated with the view. + // pContext - Create context for the view. + // Returns: A CWnd pointer to the newly created view if successful, otherwise returns NULL. + // Summary: Call this member function to create a view. You can then call SetChild + // to add the view to this docking window. + virtual CWnd* CreateView(CRuntimeClass *pViewClass,CDocument *pDocument,CCreateContext *pContext); + + // Input: pFrameClass - CFrameWnd runtime class. + // pViewClass - CView runtime class. + // pDocument - CDocument runtime class, can be NULL. + // bNoBorder - Set to true to display 3D border for the frame, by default the + // views border is used. + // Returns: A pointer to a CFrameWnd object. + // Summary: This member function is called to create a CFrameWnd object that is used + // to display a view inside of a docking window. Using views with controls bars is a + // complex issue. The problem results from the MFC ‘frame-doc-view’ architecture + // which makes the implementation difficult due to the close relationship that a + // view has with a frame window. Because of this relationship, messages are + // sometimes not routed correctly and view activation can have undesired results when + // used inside of a control bar. + // + // In order to use a CView object with a docking window, or any control bar object + // you will need to create a pseudo CFrameWnd object to act as the parent frame for + // the CView. You can then use this frame as the child of the docking window to + // display your view. This trick will allow messages to correctly route + // throughout your applications framework, and view activation will not interfere + // with your applications primary ‘frame-doc-view’ architecture. + CFrameWnd* CreateFrameDocView(CRuntimeClass* pFrameClass,CRuntimeClass* pViewClass,CDocument* pDocument=NULL,bool bNoBorder=true); + + // Input: pWnd - Points to the child CWnd object that is associated with the control + // bar. This pointer is used to resize the child window accordingly. + // Summary: This member function is used to associate a child window that is to be + // displayed in the control bar. + virtual void SetChild(CWnd* pWnd); + + // Input: pBP - Points to an XT_BARPLACEMENT struct which is used to + // initialize the placement for the control bar. + // Summary: This member function is called to initialize the XT_BARPLACEMENT struct + // which contains size, location, and style information for the control bar. + virtual void SetBarPlacement(XT_BARPLACEMENT* pBP); + + // Returns: A CRect value that represents the size and location of the first grip line + // in the caption area when docked. + // Summary: This member function is called to calculate the size of the gripper + // displayed in the caption area of a docked control bar. + virtual CRect GetGripperRect(); + + // Returns: A CRect value that represents the size and location of the close frame + // button when docked. + // Summary: This member function is called to calculate the size of the frame + // buttons used in the caption area of a docked control bar. + virtual CRect GetButtonRect(); + + // Input: pObject - Represents a valid CObject pointer. + // Returns: TRUE if the object is a CXTDockWindow object, otherwise returns FALSE. + // Summary: This member function checks to see if the object passed in as 'pObject' + // is a CXTDockWindow object. + static BOOL IsDockWindow(CObject* pObject); + + // Input: lpszCaption - Points to a CString object or null-terminated string to + // be used as the new title or control text. + // Summary: This member function overrides CWnd::SetWindowText(...), and sets + // the control bar’s title to the specified text. + virtual void SetCaption(LPCTSTR lpszCaption); + +protected: + + // Input: pDC - Points to a device context. The function draws the gripper into + // this device context. + // Summary: This member function is called by the control bar to draw the gripper + // in the caption area of a docked control bar. + virtual void OnDrawGripper(CDC* pDC); + + // Input: pDC - Points to a device context. The function draws the borders into + // this device context. + // rect - A reference to a CRect object that represents the size of the + // border to be drawn. + // Summary: This member function is called by the control bar to draw its borders. + virtual void DrawBorders(CDC* pDC,CRect &rect); + + // Summary: This member function is called by the control bar to perform + // paint operations. + virtual void EraseNonClient(); + + // Input: pDC - Pointer to the current device context. + // rect - Size of the area to paint. + // Summary: This member function is called by the docking window to draw the + // caption area for the docked bars. + virtual void DrawCaption(CDC* pDC,const CRect& rect); + + // Input: bActive - Set to TRUE to cause the caption bar to appear active. + // Summary: This member function is called by the docking window to set the + // caption bar to an "active" or "inactive" state. + virtual void SetActiveState(BOOL bActive); + + // Summary: This member function is called to refresh the caption button display + // for the docking window. + virtual void UpdateButtonXStyles(); + + // Ignore: + //{{AFX_VIRTUAL(CXTDockWindow) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); + virtual CSize CalcDynamicLayout(int nLength, DWORD nMode); + virtual void DoPaint(CDC* pDC); + //}}AFX_VIRTUAL + + virtual void DelayShow(BOOL bShow); + virtual void HideShowButtons(int nCmdShow); + virtual void SetDockWindowStyle(DWORD dwStyle); + +// Generated message map functions + + protected: + + bool HasGripper(); + bool HasButtons(); + bool HasFlatButtons(); + bool HasCaption(); + bool HasGradientCaption(); + bool HasText(); + bool HasTwoGrips(); + bool HasSemiFlatBorder(); + bool HasClientBorderOutline(); + bool HasClientBorderStatic(); + bool HasClientBorderModal(); + + // Ignore: + //{{AFX_MSG(CXTDockWindow) + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + afx_msg void OnButtonClose(); + afx_msg void OnUpdateButtonClose(CCmdUI* pCmdUI); + afx_msg void OnButtonMinimize(); + afx_msg void OnUpdateButtonMinimize(CCmdUI* pCmdUI); + afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); + //}}AFX_MSG + + afx_msg LRESULT OnXTInitialUpdate(WPARAM, LPARAM); + afx_msg void OnInitialUpdate(); + + DECLARE_MESSAGE_MAP() + + friend class CXTDockBar; + friend class CXTFrameWnd; + friend class CXTSplitterDock; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE int CXTDockWindow::GetVertSize() { + ASSERT(::IsWindow(m_hWnd)); return m_bp.sizeDefault.cx; +} +AFX_INLINE int CXTDockWindow::GetHorzSize() { + ASSERT(::IsWindow(m_hWnd)); return m_bp.sizeDefault.cy; +} +AFX_INLINE BOOL CXTDockWindow::IsMaximized() const { + ASSERT(::IsWindow(m_hWnd)); return (m_bp.bMaximized); +} +AFX_INLINE BOOL CXTDockWindow::IsUnique() const { + ASSERT(::IsWindow(m_hWnd)); return (m_bp.bUnique); +} +AFX_INLINE void CXTDockWindow::SetFloatSize() { + ASSERT(::IsWindow(m_hWnd)); m_bp.sizeDefault = m_bp.sizeFloat; +} +AFX_INLINE bool CXTDockWindow::HasGripper() { + return ((m_bp.dwStyle & CBRS_XT_GRIPPER) == CBRS_XT_GRIPPER); +} +AFX_INLINE bool CXTDockWindow::HasButtons() { + return (HasGripper() && ((m_bp.dwStyle & CBRS_XT_BUTTONS) == CBRS_XT_BUTTONS)); +} +AFX_INLINE bool CXTDockWindow::HasFlatButtons() { + return (HasButtons() && (((m_bp.dwStyle & CBRS_XT_BUTTONS_FLAT) == CBRS_XT_BUTTONS_FLAT) || xtAfxData.bXPMode)); +} +AFX_INLINE bool CXTDockWindow::HasCaption() { + return (HasGripper() && xtAfxData.bXPMode || ((m_bp.dwStyle & CBRS_XT_GRIPPER_FLAT) == CBRS_XT_GRIPPER_FLAT)); +} +AFX_INLINE bool CXTDockWindow::HasGradientCaption() { + return (HasCaption() && ((m_bp.dwStyle & CBRS_XT_GRIPPER_GRAD) == CBRS_XT_GRIPPER_GRAD)); +} +AFX_INLINE bool CXTDockWindow::HasText() { + return (HasGripper() && ((m_bp.dwStyle & CBRS_XT_GRIPPER_TEXT) == CBRS_XT_GRIPPER_TEXT)); +} +AFX_INLINE bool CXTDockWindow::HasTwoGrips() { + return (HasGripper() && ((m_bp.dwStyle & CBRS_XT_TWOGRIP) == CBRS_XT_TWOGRIP)); +} +AFX_INLINE bool CXTDockWindow::HasSemiFlatBorder() { + return ((m_bp.dwStyle & CBRS_XT_SEMIFLAT) == CBRS_XT_SEMIFLAT && !xtAfxData.bXPMode); +} +AFX_INLINE bool CXTDockWindow::HasClientBorderOutline() { + return ((m_bp.dwStyle & CBRS_XT_CLIENT_OUTLINE) == CBRS_XT_CLIENT_OUTLINE); +} +AFX_INLINE bool CXTDockWindow::HasClientBorderStatic() { + return ((m_bp.dwStyle & CBRS_XT_CLIENT_STATIC) == CBRS_XT_CLIENT_STATIC); +} +AFX_INLINE bool CXTDockWindow::HasClientBorderModal() { + return ((m_bp.dwStyle & CBRS_XT_CLIENT_MODAL) == CBRS_XT_CLIENT_MODAL); +} +AFX_INLINE BOOL CXTDockWindow::IsDockWindow(CObject* pObject) { + return pObject->IsKindOf(RUNTIME_CLASS(CXTDockWindow)); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTDOCKWINDOW_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTDropSource.h b/Editor/XT/Include/XTDropSource.h new file mode 100644 index 0000000..0d4833d --- /dev/null +++ b/Editor/XT/Include/XTDropSource.h @@ -0,0 +1,147 @@ +// XTDropSource.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#ifndef __XTDROPSOURCE_H__ +#define __XTDROPSOURCE_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// NUMBERED LIST: + +////////////////////////////////////////////////////////////////////// +// Summary: CXTDropSource class is derived from IDropSource. It is used by the +// shell list control to provide drag-and-drop operations in your application. +// +// It contains methods used in any application used as a data source in +// a drag-and-drop operation. The data source application in a drag-and-drop +// operation is responsible for: +// [ol] +// [li]Determining the data being dragged based on the user's selection.[/li] +// [li]Initiating the drag-and-drop operation based on the user's mouse actions. [/li] +// [li]Generating some of the visual feedback during the drag-and-drop operation, such +// as setting the cursor and highlighting the data selected for the +// drag-and-drop operation.[/li] +// [li]Canceling or completing the drag-and-drop operation based on the +// user's mouse actions.[/li] +// [li]Performing any action on the original data caused by the drop operation, +// such as deleting the data on a drag move.[/li] +// [/ol] +// CXTDropSource contains the methods for generating visual feedback to +// the end user and for canceling or completing the drag-and-drop operation. +// You also need to call the DoDragDrop, RegisterDragDrop, and RevokeDragDrop +// functions in drag-and-drop operations. +class _XT_EXT_CLASS CXTDropSource : public IDropSource +{ +protected: + + UINT m_uiRefCount; // Indicates the current reference count. + +public: + // Summary: Constructs a CXTDropSource object. + CXTDropSource(); + + // Summary: Destroys a CXTDropSource object, handles clean up and de-allocation. + ~CXTDropSource(); + + ////////////////////////////////////////////////////////////////////// + // IUnknown Interface Members + ////////////////////////////////////////////////////////////////////// + + // Input: riid - Identifier of the interface being requested. + // ppReturn - Address of the pointer variable that receives the interface pointer + // requested in 'riid'. Upon successful return, 'ppReturn' contains + // the requested interface pointer to the object. If the object does + // not support the interface specified in 'riid', 'ppReturn' is set to NULL. + // Returns: A pointer to an interface if successful, otherwise returns NULL. + // Summary: The QueryInterface method gives a client access to other interfaces + // on an object. For any one object, a specific query for the IUnknown + // interface on any of the object's interfaces must always return the + // same pointer value. This allows a client to determine whether two pointers + // point to the same component by calling QueryInterface on both, and comparing + // the results. It is specifically not the case that queries for interfaces + // (even the same interface through the same pointer) must return the + // same pointer value. + STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppReturn); + + // Returns: A ULONG value that represents the new reference count. The return value can be an + // integer from 1 to n, the value of the new reference count. This information + // is meant to be used for diagnostic and testing purposes only, because, in certain + // situations, the value may be unstable. + // Summary: The AddRef method increments the reference count for an interface on + // an object. It should be called for every new copy of a pointer to + // an interface on a given object. + STDMETHODIMP_(ULONG) AddRef(void); + + // Returns: A ULONG value that represents the resulting value of the reference count, + // which is used for diagnostic and testing purposes only. + // Summary: This method decrements the reference count for the calling interface + // on a object. If the reference count on the object falls to 0, the object + // is freed from memory. + STDMETHODIMP_(ULONG) Release(void); + + ////////////////////////////////////////////////////////////////////// + // IDropSource Interface Members + ////////////////////////////////////////////////////////////////////// + + // BULLETED LIST: + + // Input: bEsc - Specifies whether the ESC key has been pressed since the previous + // call to QueryContinueDrag, or to DoDragDrop if this is the first call + // to QueryContinueDrag. A TRUE value indicates the end user has pressed + // the escape key. A FALSE value indicates it has not been pressed. + // dwKeyState - Current state of the keyboard modifier keys on the keyboard. Valid + // values can be a combination of any of the flags MK_CONTROL, MK_SHIFT, + // MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON. + // Returns: An HRESULT value. + // Summary: This method determines whether a drag-and-drop operation should be + // continued, canceled, or completed. You do not call this method directly. + // The OLE DoDragDrop function calls this method during a drag-and-drop + // operation. This method supports the standard return values E_UNEXPECTED + // and E_OUTOFMEMORY, as well as the following: + // [ul] + // [li]S_OK Drag operation should continue. This result occurs if no + // errors are detected, the mouse button starting the drag-and-drop + // operation has not been released, and the ESC key has not been detected.[/li] + // [li]DRAGDROP_S_DROP Drop operation should occur completing the drag + // operation. This result occurs if DWORD indicates that the key that + // started the drag-and-drop operation has been released.[/li] + // [li]DRAGDROP_S_CANCEL Drag operation should be canceled with no drop + // operation occurring. This result occurs if BOOL is TRUE, indicating + // the ESC key has been pressed.[/li] + // [/ul] + STDMETHODIMP QueryContinueDrag(BOOL bEsc,DWORD dwKeyState); + + // BULLETED LIST: + + // Input: DWORD - Effect of a drop operation. + // Returns: An HRESULT value. + // Summary: This method enables a source application to give visual feedback to + // the end user during a drag-and-drop operation by providing the DoDragDrop + // function with an enumeration value specifying the visual effect. This + // method supports the standard return values E_INVALIDARG, E_UNEXPECTED, + // and E_OUTOFMEMORY, as well as the following: + // [ul] + // [li]S_OK Method completed its task successfully, using the cursor + // set by the source application.[/li] + // [li]DRAGDROP_S_USEDEFAULTCURSORS Successful completion of the method, + // and requests OLE to update the cursor using the OLE-provided default + // cursors.[/li] + // [/ul] + STDMETHODIMP GiveFeedback(DWORD); +}; + +////////////////////////////////////////////////////////////////////// + +#endif // __XTDROPSOURCE_H__ \ No newline at end of file diff --git a/Editor/XT/Include/XTEditListBox.h b/Editor/XT/Include/XTEditListBox.h new file mode 100644 index 0000000..edc969e --- /dev/null +++ b/Editor/XT/Include/XTEditListBox.h @@ -0,0 +1,492 @@ +// XTEditListBox.h interface for the CXTEditGroup class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTEDITLISTBOX_H__) +#define __XTEDITLISTBOX_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTListBox is a CListBox derived class. CXTListBox extends the standard +// list box control to enable flicker free drawing. +class _XT_EXT_CLASS CXTListBox : public CListBox +{ + DECLARE_DYNAMIC(CXTListBox) + +public: + + // Summary: Constructs a CXTListBox object. + CXTListBox(); + + // Summary: Destroys a CXTListBox object, handles cleanup and de-allocation. + virtual ~CXTListBox(); + + bool m_bAutoFont; // If true, the font will automatically be set for the control. + bool m_bInitControl; // true for initialization. + + // Ignore: + //{{AFX_VIRTUAL(CXTListBox) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTListBox) + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + //}}AFX_MSG + + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +// Summary: List used for enumerating XT_LOGFONT structures. +typedef CList CXTFontList; + + +////////////////////////////////////////////////////////////////////// +// Summary: CXTFontEnum is a stand alone singleton font enumeration class. It is +// used to enumerate a list of fonts found installed for the operating +// system. CXTFontEnum is a singleton class, which means it can only be +// instantiated a single time. The constructor is private, so the only +// way to access members of this class is to use the objects Get() method, +// to retrieve a list of available fonts for your operating system, you +// would make the following call: +// +//
CXTFontEnum::Get().GetFontList()
+class _XT_EXT_CLASS CXTFontEnum +{ + // Summary: Constructs a CXTFontEnum object. CXTFontEnum is a singleton + // class, to instantiate an object, use the static method Get(). + CXTFontEnum(); + +public: + + // Summary: Destroys a CXTFontEnum object, handles cleanup and de-allocation. + virtual ~CXTFontEnum(); + +protected: + + CXTFontList m_listFonts; // List of fonts found during enumeration. + +public: + + // Example:
CXTFontEnum::Get().GetFontList()
+ // Returns: A reference to a CXTFontEnum object. + // Summary: This static member function will return a reference to the one + // and only CXTFontEnum object. You can use this function to access + // data members for the CXTFontEnum class. + static CXTFontEnum& Get(); + + // Input: strFaceName - Reference to a NULL terminated string that represents the font name. + // Returns: true if the font exists, otherwise returns false. + // Summary: This member function is used to determine the existence of the font + // specified by 'strFaceName'. + bool DoesFontExist(CString& strFaceName); + + // Input: strFaceName - A NULL terminated string that represents the font name. + // Returns: A pointer to the XT_LOGFONT structure for the specified item, or NULL if no font + // was found. + // Summary: This member function is used to get a pointer to the font specified + // by 'strFaceName'. + XT_LOGFONT* GetLogFont(CString strFaceName); + + // Returns: An integer value that represents the width for the longest font in the list. + // Summary: This member function is used by the callback function to retrieve the + // current width for the longest font name in the list. + int GetMaxWidth(); + + // Returns: A reference to the CXTFontList used by this class. + // Summary: This member function is used to get a reference to the font list. + CXTFontList& GetFontList(); + + // Input: pDC - Points to a valid device context, if NULL, the screen device context + // is used. + // nCharSet - Represents the character set to enumerate. + // Summary: This member function is called by the CXTFontEnum class to initialize + // the font list. You can also call this member function to reinitialize + // the font enumeration. For example, if you changed printers and you want + // to enumerate printer fonts, or you wanted to use a different character + // set. + void Init(CDC* pDC=NULL,BYTE nCharSet=DEFAULT_CHARSET); + +protected: + + // BULLETED LIST: + + // Input: pelf - Pointer to an ENUMLOGFONTEX structure that contains information + // about the logical attributes of the font. + // lpntm - Pointer to a structure that contains information about the physical + // attributes of a font. The function uses the NEWTEXTMETRICEX structure + // for TrueType fonts; and the TEXTMETRIC structure for other fonts. + // dwFontType - Specifies the type of the font. This parameter can be a combination + // of these values: + // [ul] + // [li]DEVICE_FONTTYPE The font is a device font. + // [li]RASTER_FONTTYPE The font is a raster font. + // [li]TRUETYPE_FONTTYPE The font is a TrueType font. + // [/ul] + // lParam - Specifies the application-defined data passed by the EnumFontFamiliesEx + // function. + // Returns: The return value must be a nonzero value to continue enumeration. + // To stop enumeration, the return value must be zero. + // Summary: The EnumFontFamExProc function is an application defined–callback + // function used with the EnumFontFamiliesEx function. It is used to process + // the fonts. It is called once for each enumerated font. The FONTENUMPROC + // type defines a pointer to this callback function. EnumFontFamExProc + // is a placeholder for the application defined–function name. + static BOOL CALLBACK EnumFontFamExProc(ENUMLOGFONTEX* pelf,NEWTEXTMETRICEX* lpntm,DWORD dwFontType,LPARAM lParam); + + // BULLETED LIST: + + // Input: pLF - Points to a valid LOGFONT structure. + // dwType - Specifies the type of the font. This parameter can be a combination + // of these values: + // [ul] + // [li]DEVICE_FONTTYPE The font is a device font.[/li] + // [li]RASTER_FONTTYPE The font is a raster font.[/li] + // [li]TRUETYPE_FONTTYPE The font is a TrueType font.[/li] + // [/ul] + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called by the font enumeration callback to + // add a font to the font list. + bool AddFont(const LOGFONT* pLF,DWORD dwType); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTFontList& CXTFontEnum::GetFontList() { + return m_listFonts; +} + +////////////////////////////////////////////////////////////////////// + +// Summary: Enumerated style that is used to define how the font list box will display +// the font listings. +enum eSTYLE +{ + XT_FLB_NAME_GUI = 0, // Display font name with GUI font style. + XT_FLB_NAME_SAMPLE, // Display font name with its own font style. + XT_FLB_BOTH, // Display font name with GUI font style, then a sample display to the right. +}; + +// forwards + +class CXTFontListBoxWndHook; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTFontListBox is a CXTListBox derived class. It is used to create +// a font selection list box. You can choose to display the font name +// with the GUI font style, display the font name with its own font style, +// or display the font name with the default GUI font style and a sample +// display to the right. +class _XT_EXT_CLASS CXTFontListBox : public CXTListBox +{ +public: + + // Summary: Constructs a CXTFontListBox object. + CXTFontListBox(); + + // Summary: Destroys a CXTFontListBox object, handles cleanup and de-allocation. + virtual ~CXTFontListBox(); + +protected: + + eSTYLE m_eStyle; // Enumerated style indicating how to display the font list. + CString m_strSymbol; // String displayed for the symbol characters. + CImageList m_ilFontType; // True type font image list. + +public: + + // Input: lf - Reference to an XT_LOGFONT structure. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to get the logfont for the currently selected + // item. + virtual bool GetSelFont(XT_LOGFONT& lf); + + // Input: strFaceName - A reference to a valid CString object to receive the logfont face + // name. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to get the logfont for the currently selected + // item. + virtual bool GetSelFont(CString& strFaceName); + + // Input: lf - Reference to an XT_LOGFONT structure. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to select the logfont for the list box. + virtual bool SetSelFont(XT_LOGFONT& lf); + + // Input: strFaceName - A NULL terminated string that represents the logfont face name. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to select the logfont for the list box. + virtual bool SetSelFont(CString strFaceName); + + // Input: eStyle - Specifies the style for the font list box. Styles can be any one of + // the following combinations: + // [ul] + // [li]XT_FLB_NAME_GUI Display font name in GUI font style.[/li] + // [li]XT_FLB_NAME_SAMPLE Display font name with its own font + // style.[/li] + // [li]XT_FLB_BOTH Display font name in GUI font style, then + // a sample display to the right.[/li] + // [/ul] + // Summary: Call this member function to set the font display style for the font + // list box. There are three styles to choose from. They include displaying + // the font in the default GUI font, displaying the font in its own font + // style, or displaying both the font name in the default GUI font and + // a sample to the right. + void SetListStyle(eSTYLE eStyle); + + // Summary: Call this member function to initialize the font list box and populate it + // with a list of avaliable fonts. + virtual void InitControl(); + + // Ignore: + //{{AFX_VIRTUAL(CXTFontListBox) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); + virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTFontListBox) + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTFontListBox::SetListStyle(eSTYLE eStyle) { + m_eStyle = eStyle; +} + +////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////// +// Summary: CXTEditGroup is a CStatic derived class. It used by the CXTEditListBox +// class to create a toolbar above the edit list box to display icons for +// editing. It can be used for other classes by setting the notify window +// in Initialize. This window will receive notification messages whenever +// the new, delete, up, and down buttons are pressed. You can handle these +// messages by adding an ON_BN_CLICKED handler for each of the buttons +// XT_IDC_BTN_NEW, XT_IDC_BTN_DELETE, XT_IDC_BTN_UP and XT_IDC_BTN_DOWN. +class _XT_EXT_CLASS CXTEditGroup : public CStatic +{ + DECLARE_DYNAMIC(CXTEditGroup) + +public: + + // Summary: Constructs a CXTEditGroup object. + CXTEditGroup(); + + // Summary: Destroys a CXTEditGroup object, handles cleanup and de-allocation. + virtual ~CXTEditGroup(); + +protected: + + CWnd* m_pNotifyWnd; // Points to a CWnd object where notification messages are sent. + CSize m_sizeBtn; // Initial size of the edit buttons. + CRect m_rClip[4]; // Size of each button in the edit group. + CXTButton m_btnNew; // New edit button. + CXTButton m_btnDelete; // Delete edit button. + CXTButton m_btnUp; // Move Up edit button. + CXTButton m_btnDown; // Move Down edit button. + CImageList m_ImageList; // Holds the images for the edit buttons. + CToolTipCtrl m_tooltip; // Tooltip control for edit buttons. + CXTIconHandle m_hIconDown; // Down button icon handle. + CXTIconHandle m_hIconUp; // Up button icon handle. + CXTIconHandle m_hIconDelete; // Delete button icon handle. + CXTIconHandle m_hIconNew; // New button icon handle. + +public: + + // Input: pNotifyWnd - A CWnd object that represents the window that is to receive notification + // messages. + // Summary: This member function will initialize the edit group control. + virtual void Initialize(CWnd* pNotifyWnd); + + // Ignore: + //{{AFX_VIRTUAL(CXTEditGroup) + virtual BOOL PreTranslateMessage(MSG* pMsg); + //}}AFX_VIRTUAL + + virtual void MoveButtons(); + + // Ignore: + //{{AFX_MSG(CXTEditGroup) + afx_msg void OnButtonNew(); + afx_msg void OnButtonDelete(); + afx_msg void OnButtonUp(); + afx_msg void OnButtonDown(); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnEnable(BOOL bEnable); + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +// forwards + +class CXTItemEdit; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTEditListBox is a CXTListBox derived class. It is used to create an +// editable list box. This list box can be configured to display a toolbar +// for editing. You can define browse styles to search for files or folders. +// Each entry is made editable with a double mouse click. +class _XT_EXT_CLASS CXTEditListBox : public CXTListBox +{ + DECLARE_DYNAMIC(CXTEditListBox) + +public: + + // Summary: Constructs a CXTEditListBox object. + CXTEditListBox(); + + // Summary: Destroys a CXTEditListBox object, handles cleanup and de-allocation. + virtual ~CXTEditListBox(); + + // Input: lpszTitle - NULL terminated string that represents the caption title. + // dwLStyle - Style for the list edit control. Pass in LBS_XT_NOTOOLBAR + // if you do not wish the caption edit navigation control + // bar to be displayed. + // Summary: This member function will create the edit group control. + void SetListEditStyle(LPCTSTR lpszTitle,DWORD dwLStyle=LBS_XT_DEFAULT); + + // Input: nTitle - Resource ID of the string to load for the caption title. + // dwLStyle - Style for the list edit control. Pass in LBS_XT_NOTOOLBAR + // if you do not wish the caption edit navigation control + // bar to be displayed. + // Summary: This member function will create the edit group control. + void SetListEditStyle(UINT nTitle,DWORD dwLStyle=0x0); + + // Returns: An integer value that represents the edit control index. + // Summary: Call this member function to get the current index for the edit control. + // Similar to GetCurSel, however the current index is the index of the + // last item to be modified or added to the edit list box, and not necessarily + // the selected item. + int GetCurrentIndex(); + + // Input: iItem - Index of the item to edit. + // Summary: This member function will enable editing for the list box item. + void EditItem(int iItem); + + // Returns: A reference to a CXTEditGroup object. + // Summary: Call this member function to return a reference to the CXTEditGroup + // control that is associated with the edit list box. + CXTEditGroup& GetEditGroup(); + + // Input: strFilter - Points to a NULL terminated string that represents the file filter + // used by the file open dialog. + // Summary: Call this member function to set the default filter for the file dialog. + virtual void SetDlgFilter(LPCTSTR strFilter=NULL); + + // Returns: true if the toolbar is turned on, otherwise returns false. + // Summary: Call this member function to determine if the edit list has a toolbar. + bool HasToolbar(); + +protected: + + int m_nIndex; // Current index when edit functions are performed. + bool m_bInitControl; // true for initialization. + BOOL m_bNewItem; // TRUE if a new item is being entered into the list box. + DWORD m_dwLStyle; // List edit styles. + CString m_strTitle; // Caption area title. + CString m_strFilter; // Default file filter. + CString m_strItemText; // Current text of a selected item during edit. + CXTItemEdit* m_pItemEdit; // Points to the in-place edit item. + CXTEditGroup m_editGroup; // The edit group (toolbar) that appears above the list box. + + + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will create the edit group control. + virtual BOOL CreateEditGroup(); + + // Input: bNewItem - TRUE to add a new item. + // Summary: This member function will enable editing for the currently selected + // list box item. If 'bNewItem' is TRUE, a new item is added to the end + // of the list box. + void EditListItem(BOOL bNewItem); + + // Ignore: + //{{AFX_VIRTUAL(CXTEditListBox) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + + virtual void PositionEditGroup(bool bSizeList=false); + + // Ignore: + //{{AFX_MSG(CXTEditListBox) + afx_msg void OnEndLabelEdit(); + afx_msg void OnNewItem(); + afx_msg void OnDeleteItem(); + afx_msg void OnMoveItemUp(); + afx_msg void OnMoveItemDown(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); + afx_msg void OnNcMButtonDown(UINT nHitTest, CPoint point); + afx_msg void OnNcRButtonDown(UINT nHitTest, CPoint point); + afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + afx_msg void OnEnable(BOOL bEnable); + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + //}}AFX_MSG + + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE int CXTEditListBox::GetCurrentIndex() { + return m_nIndex; +} +AFX_INLINE CXTEditGroup& CXTEditListBox::GetEditGroup() { + return m_editGroup; +} +AFX_INLINE void CXTEditListBox::SetDlgFilter(LPCTSTR strFilter/*=NULL*/) { + m_strFilter = strFilter; +} +AFX_INLINE bool CXTEditListBox::HasToolbar() { + return ((m_dwLStyle & LBS_XT_NOTOOLBAR) == 0); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTEDITLISTBOX_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTFlatComboBox.h b/Editor/XT/Include/XTFlatComboBox.h new file mode 100644 index 0000000..b70e372 --- /dev/null +++ b/Editor/XT/Include/XTFlatComboBox.h @@ -0,0 +1,373 @@ +// XTFlatComboBox.h interface for the CXTFlatComboBox class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTFLATCOMBOBOX_H__) +#define __XTFLATCOMBOBOX_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTFlatComboBox is a CComboBox derived class. The CXTFlatComboBox class +// can easily give your application's standard CComboBox control the Flat +// Look that is seen in many of the Microsoft® Office™ products. To use +// the control, use Class Wizard to add the CComboBox member variable ( +// Class Wizard -> Member Variables Tab -> Add Variable ) and rename CComboBox +// to CXTFlatComboBox. +class _XT_EXT_CLASS CXTFlatComboBox : public CComboBox +{ + DECLARE_DYNAMIC(CXTFlatComboBox) + +public: + + // Summary: Constructs a CXTFlatComboBox object. + CXTFlatComboBox(); + + // Summary: Destroys a CXTFlatComboBox object, handles cleanup and de-allocation. + virtual ~CXTFlatComboBox(); + +protected: + + // Summary: This enum is used to determine the state the combo box should be. + enum STATE + { + NORMAL = 1, // Value to display the combo box as normal. + RAISED = 2, // Value to display the combo box as raised. + PRESSED = 3 // Value to display the combo box as pressed. + }; + + BOOL m_bLBtnDown; // TRUE if the left mouse button is pressed. + BOOL m_bPainted; // Used during paint operations. + BOOL m_bHasFocus; // TRUE if the control has focus. + BOOL m_bAutoComp; // Used by Autocompleting. + BOOL m_bFlatLook; // TRUE if the control is flat. + BOOL m_bDisableAC; // TRUE when autocomplete is disabled internally. + +public: + + // Input: bDisable - TRUE to disable flat appearance. + // Summary: This member function will disable the flat look for the combo box. + void DisableFlatLook(BOOL bDisable); + + // Returns: TRUE if the control is flat, otherwise returns FALSE. + // Summary: Call this member function to determine if the combobox control's appearance is + // flat. + BOOL IsFlat(); + + // Input: bEnable - TRUE to enable auto completion, otherwise FALSE. + // Summary: This member function enables or disables auto completion. + virtual void EnableAutoCompletion(BOOL bEnable=TRUE); + + // Returns: TRUE if the mouse is over the combo box, otherwise returns FALSE. + // Summary: This member function determines if the mouse is within the control's + // rect. + virtual BOOL PointInRect(); + +protected: + + // Input: pDC - Points to the current device context. + // eState - Current state of the combo box, either NORMAL, RAISED, or PRESSED. + // Summary: This member function is called by the combo box whenever a paint + // operation should occur. + virtual void DrawCombo(CDC* pDC,STATE eState); + + // Ignore: + //{{AFX_VIRTUAL(CXTFlatComboBox) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + //}}AFX_VIRTUAL + + virtual void RenderContent(CDC* pDC); + + // Ignore: + //{{AFX_MSG(CXTFlatComboBox) + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnPaint(); + afx_msg void OnSetFocus(); + afx_msg void OnKillFocus(); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnEditUpdate(); + afx_msg void OnEndSel(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + //}}AFX_MSG + + afx_msg LRESULT OnPrintClient(WPARAM wp, LPARAM lp); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTFlatComboBox::EnableAutoCompletion(BOOL bEnable/*=TRUE*/) { + ASSERT(::IsWindow(m_hWnd)); m_bAutoComp = bEnable; +} +AFX_INLINE BOOL CXTFlatComboBox::PointInRect() { + ASSERT(::IsWindow(m_hWnd)); CPoint pt; GetCursorPos(&pt); CRect rcItem; GetWindowRect(&rcItem); return rcItem.PtInRect(pt); +} +AFX_INLINE BOOL CXTFlatComboBox::IsFlat() { + return m_bFlatLook; +} + +////////////////////////////////////////////////////////////////////// + +// BULLETED LIST: + +////////////////////////////////////////////////////////////////////// +// Summary: CXTEdit is a CEdit derived class. The CXTEdit class provides the functionality +// of a Windows edit control. An edit control is a rectangular child window +// in which the user can enter text. +// +// You can create an edit control either from a dialog template or directly +// in your code. In both cases, first call the constructor CXTEdit to construct +// the CXTEdit object, then call the Create member function to create the +// Windows edit control and attach it to the CXTEdit object. +// +// Construction can be a one-step process in a class derived from CXTEdit. +// Write a constructor for the derived class and call Create from within +// the constructor. +// +// CXTEdit inherits significant functionality from CWnd. To set and retrieve +// text from a CXTEdit object, use the CWnd member functions SetWindowText +// and GetWindowText, which set or get the entire contents of an edit control, +// even if it is a multiline control. Also, if an edit control is multiline, +// get and set part of the control’s text by calling the CXTEdit member +// functions GetLine, SetSel, GetSel, and ReplaceSel. +// +// If you want to handle Windows notification messages sent by an edit +// control to its parent (usually a class derived from CDialog), add a +// message-map entry and message-handler member function to the parent +// class for each message. +// +// Each message-map entry takes the following form: +// +//
ON_Notification( id, memberFxn )
+// +// where 'id' specifies the child window ID of the edit control sending the +// notification, and 'memberFxn' is the name of the parent member function +// you have written to handle the notification. +// +// The parent’s function prototype is as follows: +// +//
afx_msg void memberFxn( );
+// +// Following is a list of potential message-map entries and a description +// of the cases in which they would be sent to the parent: +// [ul] +// [li]ON_EN_CHANGE The user has taken an action that may have altered +// text in an edit control. Unlike the EN_UPDATE notification message, +// this notification message is sent after Windows updates the display.[/li] +// [li]ON_EN_ERRSPACE The edit control cannot allocate enough memory +// to meet a specific request.[/li] +// [li]ON_EN_HSCROLL The user clicks an edit control’s horizontal scroll +// bar. The parent window is notified before the screen is updated.[/li] +// [li]ON_EN_KILLFOCUS The edit control loses the input focus.[/li] +// [li]ON_EN_MAXTEXT The current insertion has exceeded the specified +// number of characters for the edit control and has been truncated. +// Also sent when an edit control does not have the ES_AUTOHSCROLL +// style and the number of characters to be inserted would exceed the +// width of the edit control. Also sent when an edit control does not +// have the ES_AUTOVSCROLL style and the total number of lines resulting +// from a text insertion would exceed the height of the edit control.[/li] +// [li]ON_EN_SETFOCUS Sent when an edit control receives the input focus.[/li] +// [li]ON_EN_UPDATE The edit control is about to display altered text. +// Sent after the control has formatted the text but before it screens +// the text so that the window size can be altered, if necessary.[/li] +// [li]ON_EN_VSCROLL The user clicks an edit control’s vertical scroll +// bar. The parent window is notified before the screen is updated.[/li] +// [/ul] +// If you create a CXTEdit object within a dialog box, the CXTEdit object +// is automatically destroyed when the user closes the dialog box. +// +// If you create a CXTEdit object from a dialog resource using the dialog +// editor, the CXTEdit object is automatically destroyed when the user +// closes the dialog box. +// +// If you create a CXTEdit object within a window, you may also need to +// destroy it. If you create the CXTEdit object on the stack, it is destroyed +// automatically. If you create the CXTEdit object on the heap by using +// the new function, you must call delete on the object to destroy it when +// the user terminates the Windows edit control. If you allocate any memory +// in the CXTEdit object, override the CXTEdit destructor to dispose of +// the allocations. +class _XT_EXT_CLASS CXTEdit : public CEdit +{ + DECLARE_DYNAMIC(CXTEdit) + +public: + + // Summary: Constructs a CXTEdit object. + CXTEdit(); + + // Summary: Destroys a CXTEdit object, handles clean up and de-allocation. + virtual ~CXTEdit(); + +protected: + + bool m_bInitInCreate; // true for initialization in OnCreate, set to true for dynamically created controls. + CXTCoolMenu m_coolMenu; // Cool menu hook for this edit control. + +public: + + // Returns: TRUE if the Clipboard contains data in a format which this edit view can + // accept, otherwise it returns FALSE. + // Summary: Call this member function to determine if the Clipboard contains information + // that can be pasted into this edit view. + virtual BOOL CanPaste(); + + // Returns: TRUE if a selection has been made, otherwise returns FALSE. + // Summary: Call this member function to determine if a selection has been made. + virtual BOOL SelectionMade(); + + // Input: bInitInCreate - true to perform initialization in OnCreate. + // Summary: Call this member function to set the initialization for the edit control. + // If 'binitInCreate' is true, the edit control will perform initialization + // in OnCreate, if false the edit control will perform initialization + // in PreSubclassWindow. If your edit control is dynamically created + // you should set this to true. + void InitOnCreate(bool bInitInCreate); + + // Ignore: + //{{AFX_VIRTUAL(CXTEdit) + public: + virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + + virtual void Init(); + +protected: + + // Ignore: + //{{AFX_MSG(CXTEdit) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnContextMenu(CWnd*, CPoint point); + afx_msg void OnEditUndo(); + afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI); + afx_msg void OnEditCut(); + afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI); + afx_msg void OnEditCopy(); + afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI); + afx_msg void OnEditPaste(); + afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI); + afx_msg void OnEditClear(); + afx_msg void OnUpdateEditClear(CCmdUI* pCmdUI); + afx_msg void OnEditSelectAll(); + afx_msg void OnUpdateEditSelectAll(CCmdUI* pCmdUI); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTEdit::InitOnCreate(bool bInitInCreate) { + m_bInitInCreate = bInitInCreate; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTFlatEdit is a CXTEdit derived class. The CXTFlatEdit class can easily +// give your application's standard CEdit control the flat look that is +// seen in many of the Microsoft® Office™ products. To use the control, +// use Class Wizard to add the CEdit member variable ( Class Wizard -> +// Member Variables Tab -> Add Variable ) and rename CEdit to CXTFlatEdit. +class _XT_EXT_CLASS CXTFlatEdit : public CXTEdit +{ + DECLARE_DYNAMIC(CXTFlatEdit) + +public: + + // Summary: Constructs a CXTFlatEdit object. + CXTFlatEdit(); + + // Summary: Destroys a CXTFlatEdit object, handles cleanup and de-allocation. + virtual ~CXTFlatEdit(); + +protected: + + // Summary: This enum is used to determine the state the edit control should be. + enum STATE + { + NORMAL = 1, // Value to make the edit control normal. + RAISED = 2, // Value to make the edit control raised. + }; + + BOOL m_bLBtnDown; // TRUE if the left mouse button is pressed. + BOOL m_bHasFocus; // TRUE if the control has focus. + BOOL m_bFlatLook; // TRUE if the control is flat. + +public: + + // Input: bDisable - TRUE to disable the flat appearance. + // Summary: This member function will disable the flat look for the edit control. + void DisableFlatLook(BOOL bDisable); + + // Returns: TRUE if the control is flat, otherwise returns FALSE. + // Summary: Call this member function to determine if the edit control's appearance is + // flat. + BOOL IsFlat(); + + // Returns: TRUE if the mouse is over the edit box, otherwise returns FALSE. + // Summary: This member function determines if the mouse is within the control's + // rect. + virtual BOOL PointInRect(); + +protected: + + // Input: pDC - Points to the current device context. + // eState - Current state of the edit control, either NORMAL or RAISED. + // Summary: This member function is called by the edit control whenever a paint + // operation should occur. + virtual void DrawEdit(CDC* pDC,STATE eState); + + // Ignore: + //{{AFX_VIRTUAL(CXTFlatEdit) + //}}AFX_VIRTUAL + + virtual void RenderContent(CDC* pDC); + +protected: + + // Ignore: + //{{AFX_MSG(CXTFlatEdit) + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnPaint(); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnKillFocus(CWnd* pNewWnd); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// +AFX_INLINE BOOL CXTFlatEdit::PointInRect() { + ASSERT(::IsWindow(m_hWnd)); CPoint pt; ::GetCursorPos(&pt); CRect rcItem; GetWindowRect(&rcItem); return rcItem.PtInRect(pt); +} +AFX_INLINE BOOL CXTFlatEdit::IsFlat() { + return m_bFlatLook; +} +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTFLATCOMBOBOX_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTFlatHeaderCtrl.h b/Editor/XT/Include/XTFlatHeaderCtrl.h new file mode 100644 index 0000000..4503551 --- /dev/null +++ b/Editor/XT/Include/XTFlatHeaderCtrl.h @@ -0,0 +1,325 @@ +// XTFlatHeaderCtrl.h interface for the CXTFlatHeaderCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTFLATHEADERCTRL_H__) +#define __XTFLATHEADERCTRL_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTHeaderCtrl is a CHeaderCtrl derived class. It is used to create +// a CXTHeaderCtrl window similar to CHeaderCtrl, but with additional functionality. +// +// A “header control” is a window usually positioned above columns of text +// or numbers. It contains a title for each column, and it can be divided +// into parts. The user can drag the dividers that separate the parts to +// set the width of each column. +// +// Use a header control, represented by class CXTHeaderCtrl, to display +// column headers for a columnar list. For example, a header control would +// be useful for implementing column controls in a spreadsheet. +// +// The header control is usually divided into parts, called "header items," +// each bearing a title for the associated column of text or numbers. Depending +// on the styles you set, you can provide a number of direct ways for users +// to manipulate the header items. +class _XT_EXT_CLASS CXTHeaderCtrl : public CHeaderCtrl +{ + DECLARE_DYNAMIC(CXTHeaderCtrl) + +public: + + // Summary: Constructs a CXTHeaderCtrl object. + CXTHeaderCtrl(); + + // Summary: Destroys a CXTHeaderCtrl object, handles cleanup and de-allocation. + virtual ~CXTHeaderCtrl(); + +protected: + + int m_iMinSize; // Minimum column size for an auto-size header control. + bool m_bRTL; // Used internally to determine if text is right-to-left or left-to-right (depends on system locale). + bool m_bAutoSize; // true if the header control columns are auto-sizing. + CUIntArray m_arFrozenCols; // List of columns that are not sizable. + +public: + + // Input: bEnable - true to enable an auto-sizing header control. + // Summary: Call this member function to enable auto-sizing for the header control. + // This will cause the columns in the list control to be sized to fit + // in the available space when the list control is resized. + void EnableAutoSize(bool bEnable=true); + + // Input: iCol - Index of the column to freeze. + // Summary: Call this member function to freeze a column in the header control. + // Freezing a column will disable sizing for the column. + void FreezeColumn(int iCol); + + // Input: iCol - Index of the column to thaw. + // Summary: Call this member function to thaw a column in the header control. + // Thawing a column will enable sizing for the column if it was previously + // frozen. + void ThawColumn(int iCol); + + // Input: iCol - Index of the column to check. + // Returns: true if the column is frozen, otherwise returns false. + // Summary: Call this member function to determine if the specified column is + // frozen. + bool IsColFrozen(int iCol); + + // Input: iMinSize - Minimum column size. + // Summary: Call this member to set the minimum size for auto-sizing columns. + // The minimum size represents the smallest size that all columns can + // be sized to. + void SetMinSize(int iMinSize); + +protected: + + // Returns: true if the text alignment is right-to-left, and false if the text + // alignment is left-to-right. + // Summary: This member function is used by the header control to determine + // the text alignment for the system locale. + virtual bool DetermineRTL(); + + // Input: iNewWidth - New width to resize all columns to. + // Summary: This member function is used by the header control to auto-size the + // columns for the list control. + virtual void ApplyFieldWidths(int iNewWidth); + + // Input: iNewWidth - New width to resize all columns to. + // Summary: This member function is used by the header control to determine + // the new width for auto-sized columns. + virtual void FitFieldWidths(int iNewWidth); + + // Returns: The combined size, in pixels, of all frozen columns. + // Summary: This member function is used by the header control to determine + // the total width of all frozen columns in the header control. + virtual int GetFrozenColWidth(); + + // Ignore: + //{{AFX_VIRTUAL(CXTHeaderCtrl) + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTHeaderCtrl) + afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + //}}AFX_MSG + + afx_msg BOOL OnItemchanging(NMHDR* pNMHDR, LRESULT* pResult); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTFlatHeaderCtrl is a CHeaderCtrl derived class. It is used to create +// list box flat header controls that are similar to list box flat header +// controls seen in Visual Studio&trade and Outlook™. +class _XT_EXT_CLASS CXTFlatHeaderCtrl : public CXTHeaderCtrl +{ + DECLARE_DYNAMIC(CXTFlatHeaderCtrl) + +public: + + // Summary: Constructs a CXTFlatHeaderCtrl object. + CXTFlatHeaderCtrl(); + + // Summary: Destroys a CXTFlatHeaderCtrl object, handles cleanup and de-allocation. + virtual ~CXTFlatHeaderCtrl(); + +protected: + + int m_nPos; // Index of the popup menu contained in the menu. + int m_nOffset; // Amount to offset the sort arrow. + int m_nSortedCol; // Last column pressed during sort. + UINT m_popupMenuID; // Popup menu resource ID. + BOOL m_bLBtnDown; // TRUE if left mouse button is pressed. + BOOL m_bAscending; // Used, when column is pressed, to draw a sort arrow. + BOOL m_bSortArrow; // TRUE to draw a sort arrow. + BOOL m_bEnableMenus; // TRUE to disable the popup menu display. + bool m_bInitControl; // true for initialization. + CPoint m_pt; // Point where right click took place. + +public: + + // Returns: TRUE if the header control displays a sort arrow, otherwise returns FALSE. + // Summary: Call this member function to determine if the header control displays + // a sort arrow. + BOOL HasSortArrow(); + + // Input: popupMenuID - Resource ID for the popup menu used with the header. + // nPos - Position of the submenu to be displayed. + // Summary: This member function is called to associate a menu and toolbar + // resource with the context menu. + virtual void SetMenuID(UINT popupMenuID,int nPos=0); + + // Input: bBoldFont - TRUE if the header's font should be bold. + // Summary: This member function must be called after creation to initialize + // the font the header will use. + virtual void InitializeHeader(BOOL bBoldFont); + + // Input: bBoldFont - TRUE if the header's font should be bold. + // Summary: This member function can be used to toggle the font from bold to normal. + virtual void SetFontBold(BOOL bBoldFont = TRUE); + + // Input: nCol - Zero-based index of the column to set the sort image for. + // bAsc - TRUE if ascending, otherwise FALSE. + // Returns: A zero-based index of the previously sorted column. + // Summary: This member function will set the sort image for the specified column. + virtual int SetSortImage(int nCol,BOOL bAsc); + + // Input: bSortArrow - Set to TRUE to draw the column sort arrow. + // Summary: Call this member function to enable or disable the column sort arrow. + virtual void ShowSortArrow(BOOL bSortArrow); + + // Input: pt - Point to be tested. + // Returns: The index of the item at the position specified by 'pt', otherwise returns -1. + // Summary: This member function determines which header item, if any, is at + // a specified cursor position. + virtual int HitTest(CPoint pt) const; + + // Input: nFlag - Text alignment, either LVCFMT_CENTER, LVCFMT_LEFT, or LVCFMT_RIGHT. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to set the text justification for the + // header control. + virtual BOOL SetAlingment(int nFlag); + + // Returns: The index of the currently sorted column. + // Summary: Call this member function to return the index to the currently sorted + // column. + int GetSortedCol() const; + + // Returns: TRUE if the sorting order is ascending, otherwise returns FALSE. + // Summary: Call this member function to return the current sorting order. + BOOL GetAscending() const; + + // Input: iCol - Zero-based index of the column to set the sort image for. + // uBitmapID - Resource ID of the bitmap to use. + // dwRemove - Style bits to be removed from the HD_ITEM::fmt variable. For + // a column that does not display text, pass in HDF_STRING. + // Summary: Call this member function to set the bitmap image for the specified + // header item. + void SetBitmap(int iCol,UINT uBitmapID,DWORD dwRemove=NULL); + + // Input: bEnableMenus - TRUE to enable popup menus, and FALSE to disable. + // Summary: Call this member function to enable or disable the popup menu display whenever + // a user right clicks on the header control. + void EnablePopupMenus(BOOL bEnableMenus); + +protected: + + // Input: pDC - Points to the current device context. + // rect - Area to be drawn. + // Summary: This member function is called by the header during paint operations. + virtual void DrawBorders(CDC* pDC,CRect& rect); + +#if _MSC_VER < 1200 // MFC 5.0 + + // Returns: The number of header control items, if successful, otherwise returns -1. + // Summary: This member function retrieves a count of the items in a header + // control. + virtual int GetItemCount() const; + + // Input: piArray - A pointer to the address of a buffer that receives the index + // values of the items in the header control, in the order in which + // they appear from left to right. + // iCount - The number of header control items. + // Summary: This member function retrieves the index values of the items in + // the header control, in the order in which they appear from left to right. + // If you use the default value of 'iCount', GetOrderArray fills the + // parameter using GetItemCount. Returns nonzero if successful, otherwise, + // it returns zero. + virtual BOOL GetOrderArray(LPINT piArray,int iCount=-1); + + // Input: nIndex - The zero-based index of the header control item. + // lpRect - A pointer to the address of a RECT structure that receives the + // bounding rectangle information. + // Returns: Nonzero if successful, otherwise it returns zero. + // Summary: This method implements the behavior of the Win32 message HDM_GETITEMRECT, + // as described in the Platform SDK. + virtual BOOL GetItemRect(int nIndex,LPRECT lpRect) const; +#endif + + // Input: iIndex - Index of the column to be sorted. + // Summary: Called to send WM_NOTIFY to tell parent's owner that the column needs + // to be sorted. + void SendNotify(int iIndex); + + // Ignore: + //{{AFX_VIRTUAL(CXTFlatHeaderCtrl) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTFlatHeaderCtrl) + afx_msg void OnPaint(); + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + //}}AFX_MSG + + afx_msg void OnSortAsc(); + afx_msg void OnSortDsc(); + afx_msg void OnAlignLeft(); + afx_msg void OnAlignCenter(); + afx_msg void OnAlignRight(); + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE BOOL CXTFlatHeaderCtrl::HasSortArrow() { + return m_bSortArrow; +} +AFX_INLINE void CXTFlatHeaderCtrl::SetFontBold(BOOL bBoldFont) { + ASSERT(::IsWindow(m_hWnd)); SetFont(bBoldFont?&xtAfxData.fontBold:&xtAfxData.font); +} +AFX_INLINE void CXTFlatHeaderCtrl::ShowSortArrow(BOOL bSortArrow) { + ASSERT(::IsWindow(m_hWnd)); m_bSortArrow = bSortArrow; Invalidate(); +} +AFX_INLINE int CXTFlatHeaderCtrl::GetSortedCol() const { + ASSERT(::IsWindow(m_hWnd)); return m_nSortedCol; +} +AFX_INLINE BOOL CXTFlatHeaderCtrl::GetAscending() const { + ASSERT(::IsWindow(m_hWnd)); return m_bAscending; +} +AFX_INLINE void CXTFlatHeaderCtrl::EnablePopupMenus(BOOL bEnableMenus) { + m_bEnableMenus = bEnableMenus; +} +#if _MSC_VER < 1200 // MFC 5.0 +AFX_INLINE int CXTFlatHeaderCtrl::GetItemCount() const { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, HDM_GETITEMCOUNT, 0, 0L); +} +AFX_INLINE BOOL CXTFlatHeaderCtrl::GetItemRect(int nIndex, LPRECT lpRect) const { + ASSERT(::IsWindow(m_hWnd)); ASSERT(lpRect != NULL); return (BOOL)::SendMessage(m_hWnd, HDM_GETITEMRECT, nIndex, (LPARAM)lpRect); +} +#endif + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTFLATHEADERCTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTFlatTabCtrl.h b/Editor/XT/Include/XTFlatTabCtrl.h new file mode 100644 index 0000000..c493074 --- /dev/null +++ b/Editor/XT/Include/XTFlatTabCtrl.h @@ -0,0 +1,431 @@ +// XTFlatTabCtrl.h interface for the CXTFlatTabCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTFLATTABCTRL_H__) +#define __XTFLATTABCTRL_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTFlatTabCtrl is a CWnd derived class. It is used to create an Excel +// style sheet control. This control allows you to define if you want the +// control to have home, end, back, and next buttons. +class _XT_EXT_CLASS CXTFlatTabCtrl : public CWnd +{ + DECLARE_DYNAMIC(CXTFlatTabCtrl) + +public: + + // Summary: Constructs a CXTFlatTabCtrl object. + CXTFlatTabCtrl(); + + // Summary: Destroys a CXTFlatTabCtrl object, handles cleanup and de-allocation. + virtual ~CXTFlatTabCtrl(); + +protected: + + int m_cx; // Width for each arrow button. + int m_cy; // Height for each arrow button. + int m_nCurSel; // Index of the currently selected tab. + int m_nClientWidth; // Width, in pixels, of the tab control client area. + int m_nClientHeight; // Height, in pixels, of the tab control client area. + int m_nOffset; // Amount, in pixels, of the displayed tab offset. + int m_xGripperPos; // The current gripper position, in pixels, from the left. + int m_iGripperPosPerCent; // The current gripper position in percent of the control width. + bool m_bManagingViews; // true if the control is managing views. + bool m_bUserColors; // true if user defined colors are used. + DWORD m_dwStyle; // Tab control style. + CRect m_rectTabs; // Area occupied by tabs. + CRect m_rectViews; // Area occupied by managed views. + CRect m_rectSB_H; // Area occupied by the horizontal scroll bar. + CRect m_rectGripper; // Area occupied by the sizing gripper. + CFont* m_pNormFont; // Font that is used for non-selected tabs. + CFont* m_pBoldFont; // Font that is used for selected tabs. + COLORREF m_clr3DShadow; // RGB value that represents the tab shadow color. + COLORREF m_clrBtnText; // RGB value that represents the tab outline color. + COLORREF m_clr3DHilight; // RGB value that represents the tab highlight color. + COLORREF m_clrWindow; // RGB value that represents the selected tab face color. + COLORREF m_clr3DFace; // RGB value that represents the normal tab face color. + COLORREF m_clrWindowText; // RGB value that represents the tab text color. + CScrollBar m_wndHScrollBar; // The horizontal scroll bar (used with FTS_XT_HSCROLL). + CToolTipCtrl m_ToolTip; // Tooltip for the flat tab control. + + // Pens used by painting code + + CPen m_penShadow; + CPen m_penBackSel; + CPen m_penBackNonSel; + CPen m_penOutline; + CPen m_penWindow; + + // Summary: Template list containing tab information. + CArray m_tcbItems; + + // Tracking related variables + + bool m_bTracking; + int m_xTrackingDelta; + CWnd * m_pWndLastFocus; + + // Summary: Enumerated type that specifies which arrow to display for a particular button. + enum icon_type + { + arrow_left = 0x0200, // Left arrow display. + arrow_left_home = 0x0201, // Left home arrow display. + arrow_right = 0x0000, // Right arrow display. + arrow_right_home = 0x0001 // Right home arrow display. + }; + + // Internal structures/variables used to control button information + + class CXTFTButtonState + { + public: + CXTFTButtonState(); + + void SetInfo(CRect rect, int iCommand, icon_type iconType); + + CRect m_rect; + bool m_bPressed; + bool m_bEnabled; + int m_iCommand; + icon_type m_IconType; + }; + + int m_iBtnLeft; // Index of "left" button in button array. + int m_iBtnRight; // Index of "right" button in button array. + int m_iBtnHome; // Index of "home" button in button array. + int m_iBtnEnd; // Index of "end" button in button array. + CXTFTButtonState m_buttons[4]; // Array of button information. + +public: + + // Input: nIndex - The index of the tab whose text is to be retrieved. + // Returns: The text of a particular tab, or NULL if an error occurs. + // Summary: This member function gets the text of a specific tab. + LPCTSTR GetItemText(int nIndex) const; + + // Input: nIndex - The index of the tab whose text is to be changed. + // pszText - The new title for the tab. + // Returns: true when successful. + // Summary: This member function will set the text of a particular tab. + bool SetItemText(int nIndex,LPCTSTR pszText); + + // Input: nIndex - The index of the tab whose managed window is to be retrieved. + // Returns: A pointer to the window that is associated with a tab, or it returns NULL + // if no window is associated with (managed by) the tab. + // Summary: This member function gets a CWnd pointer to the window that is associated + // with a specific tab. + CWnd *GetItemWindow(int nIndex) const; + + // Input: pNormFont - Represents the font used by non-selected tabs. + // pBoldFont - Represents the font used by selected tabs. + // Summary: This member function will set the fonts to be used by the tab control. + virtual void SetTabFonts(CFont* pNormFont,CFont* pBoldFont); + + // Input: nItem - Index of the tab to insert. + // nTextID - String resource ID of the tab label. + // pWndControl - Optional pointer to the managed control. + // Returns: The index of the tab that has been inserted if successful, otherwise + // returns -1. + // Summary: This member function will insert a tab into the flat tab control. + virtual int InsertItem(int nItem,UINT nTextID,CWnd *pWndControl = NULL); + + // Input: nItem - Index of the tab to insert. + // lpszItem - NULL terminated string that represents the tab label. + // pWndControl - Optional pointer to the managed control. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will insert a tab into the flat tab control. + virtual BOOL InsertItem(int nItem,LPCTSTR lpszItem,CWnd *pWndControl = NULL); + + // Input: nItem - Index of the tab to delete. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will delete the tab specified by 'nItem' from the + // tab control. + virtual BOOL DeleteItem(int nItem); + + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will remove all of the tabs from the tab control. + virtual BOOL DeleteAllItems(); + + // Input: nItem - Index of the tab to retrieve the size of. + // lpRect - Points to a RECT structure to receive the size of the tab. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will retrieve the size of the tab specified by + // 'nItem'. + virtual BOOL GetItemRect(int nItem,LPRECT lpRect); + + // Input: pHitTestInfo - Pointer to a TCHITTESTINFO structure, as + // described in the Platform SDK, which specifies + // the screen position to test. + // Returns: The zero-based index of the tab, or returns -1 if no tab is at the specified + // position. + // Summary: Call this function to determine which tab, if any, is at the specified + // screen position. + virtual int HitTest(TCHITTESTINFO *pHitTestInfo) const; + + // Returns: A zero-based index of the selected tab if successful, or returns -1 if no tab + // is selected. + // Summary: Call this function to retrieve the currently selected tab in a flat + // tab control. + virtual int GetCurSel() const; + + // Input: nItem - The zero-based index of the item to be selected. + // Returns: A zero-based index of the previously selected tab if successful, otherwise + // returns -1. + // Summary: This member function selects a tab in a flat tab control. + virtual int SetCurSel(int nItem); + + // Returns: The number of items in the tab control. + // Summary: Call this function to retrieve the number of tabs in the tab control. + virtual int GetItemCount() const; + + // Input: nItem - The zero-based index of tab to receive the tooltip text. + // lpszTabTip - A pointer to a string containing the tooltip text. + // Summary: This member function will set the tooltip for the tab specified + // by 'nItem'. + virtual void SetTipText(int nItem,LPCTSTR lpszTabTip); + + // Input: nItem - The zero-based index of the tab to retrieve the tooltip + // text for. + // Returns: A CString object containing the text to be used in the tooltip. + // Summary: This member function will get the tooltip text associated with the + // tab specified by 'nItem'. + virtual CString GetTipText(int nItem); + + // Summary: This member function will cause the tab control to reposition + // the tabs to the home position. + virtual void Home(); + + // Input: x - The position for the gripper, relative to the left-hand-side of + // the control. + // bPercent - Indicates that the position is a percent of the control width, + // as opposed to an absolute location in pixels. + // Summary: This member function changes the location of the sizing gripper. + // The function has no effect if the FTS_XT_HSCROLL is not used. + void SetGripperPosition(int x,bool bPercent); + + // Returns: An integer value representing the location of the sizing gripper, in pixels, + // relative to the left hand side of the control. + // Summary: This member function gets the location of the sizing gripper, in pixels, + // relative to the left hand side of the control. + int GetGripperPosition() const; + + // Summary: Call this function to synchronize the tab control's horizontal scroll + // bar with the horizontal scroll bar of the current view. + // + // You should call this function if anything happens in the view that + // affects the horizontal scroll bar (e.g. a user typing text into an + // edit control could make the text wider, thus requiring a call to this + // function). + void SyncScrollBar(); + + // Input: crShadow - RGB value that represents the tab shadow color. + // Summary: This member function is called to set the shadow color for all tabs. + void SetTabShadowColor(COLORREF crShadow); + + // Returns: An RGB value that represents the tab shadow color. + // Summary: This member function gets an RGB value that represents the shadow color + // of the tab. + COLORREF GetTabShadowColor() const; + + // Input: crHilight - RGB value that represents the tab highlight color. + // Summary: This member function is called to set the highlight color for all tabs. + void SetTabHilightColor(COLORREF crHilight); + + + // Returns: An RGB value that represents the tab highlight color. + // Summary: This member function gets an RGB value that represents the highlight + // color of the tab. + COLORREF GetTabHilightColor() const; + + // Input: crBack - RGB value that represents the tab background color. + // Summary: This member function is called to set the background color for normal tabs. + void SetTabBackColor(COLORREF crBack); + + // Returns: An RGB value that represents the tab background color. + // Summary: This member function gets an RGB value that represents the background + // color of the tab. + COLORREF GetTabBackColor() const; + + // Input: crText - RGB value that represents the tab text color. + // Summary: This member function is called to set the text color for normal tabs. + void SetTabTextColor(COLORREF crText); + + // Returns: An RGB value that represents the tab text color. + // Summary: This member function gets an RGB value that represents the text color + // of the tab. + COLORREF GetTabTextColor() const; + + // Input: crBack - RGB value that represents the selected tab background color. + // Summary: This member function is called to set the background color for selected tabs. + void SetSelTabBackColor(COLORREF crBack); + + // Returns: An RGB value that represents the selected tabs background color. + // Summary: This member function gets an RGB value that represents the background + // color for selected tabs. + COLORREF GetSelTabBackColor() const; + + // Input: crText - RGB value that represents the selected tab text color. + // Summary: This member function is called to set the text color for selected tabs. + void SetSelTabTextColor(COLORREF crText); + + // Returns: An RGB value that represents the selected tab text color. + // Summary: This member function gets an RGB value that represents the text color + // for selected tabs. + COLORREF GetSelTabTextColor() const; + + // Summary: Call this member function to reset the tab control to use default system colors. + void UpdateDefaultColors(); + + // Ignore: + //{{AFX_VIRTUAL(CXTFlatTabCtrl) + virtual BOOL Create(DWORD dwStyle, const CRect& rect, CWnd* pParentWnd, UINT nID); + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual BOOL OnNotify(WPARAM, LPARAM lParam, LRESULT* pResult); + virtual CScrollBar* GetScrollBarCtrl(int nBar) const; + //}}AFX_VIRTUAL + +protected: + + // Input: pt - A CPoint reference representing the specified screen position. + // Returns: The zero-based index of the button within the button's array or -1 if no + // button is at the specified position. + // Summary: Call this function to determine which button, if any, is at the specified + // screen position. + virtual int ButtonHitTest(CPoint& pt) const; + + // Input: nItem - The zero-based index of the tab to retrieve the width for. + // Returns: The width, in pixels, of the tab. + // Summary: This member function will get the width, in pixels, of the tab specified + // by 'nItem'. + int GetTabWidth(int nItem) const; + + // Returns: The total combined width, in pixels, of all the tabs in the control. + // Summary: This member function will return the total width of all of the tabs + // in the flat tab control. + int GetTotalTabWidth() const; + + // Returns: The total width, in pixels, of all the visible arrow buttons. + // Summary: This member function will return the total width of all of the arrow + // buttons that are visible in the flat tab control. + int GetTotalArrowWidth() const; + + // Returns: The total area width, in pixels, of all the tabs in the flat tab control. + // Summary: This member function will return the total area width of all of the + // tabs in the flat tab control. + int GetTotalTabAreaWidth() const; + + // Input: pDC - Points to the device context to draw the tab to. + // pt - XY location of the top left corner of the tab to draw. + // bSelected - true if the tab is currently selected. + // lpszTabLabel - A NULL terminated string that represents the tab label. + // Returns: The x position of the next tab to be drawn. + // Summary: This member function will draw a tab to the device context specified + // by 'pDC'. + int DrawTab(CDC* pDC,const CPoint& pt,bool bSelected,LPCTSTR lpszTabLabel); + + // Input: pDC - Points to the device context to draw the tab to. + // button_state - XY location of the top left corner of the tab to draw. + // Summary: This member function is used by the flat tab control to draw an arrow + // button to the device context specified by 'pDC'. + void DrawButton(CDC* pDC,CXTFTButtonState& button_state) const; + + // Summary: This member function will force all of the tabs to be repainted. + void InvalidateTabs(); + + // Summary: This member function will enable or disable the arrow buttons + // depending on the current tab display state. + void EnableButtons(); + + // Summary: This member function will free the resources allocated for the + // icons used by the arrow buttons. + void FreeButtonIcons(); + + // Summary: This member function will create the icon resources that are + // used by the arrow buttons. + void CreateButtonIcons(); + + // Input: pDC - Points to the device context to draw the gripper to. + // rect - Location of the gripper. + // Summary: This member function will draw the horizontal sizing gripper at a + // specified location. + void DrawGripper(CDC* pDC,CRect rect) const; + + // Input: bTracking - true to enable tracking, or false to disable tracking. + // Summary: The member function is used internally to toggle the state of the + // sizing-grip tracking mode. + void SetTracking(bool bTracking); + + // Summary: This member function frees all memory occupied by the tab items. + void ClearAllItems(); + + // Summary: This member function is called when the tab control is resized. It + // is responsible for updating internal structures which are dependant + // on the control's size. + void RecalcLayout(); + + // Input: nItem - Index of the tab to delete. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This internal function deletes an item from the tab item list. + virtual BOOL _DeleteItem(int nItem); + + // Returns: An integer value that represents the overlap between the tabs. + // Summary: This internal function calculates the overlap between two tabs. + virtual int GetOverlap() const; + + // Ignore: + //{{AFX_MSG(CXTFlatTabCtrl) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnLeftArrow(); + afx_msg void OnRightArrow(); + afx_msg void OnHomeArrow(); + afx_msg void OnEndArrow(); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnSysColorChange(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE BOOL CXTFlatTabCtrl::InsertItem(int nItem, UINT nTextID, CWnd *pWndControl) { + ASSERT(IsWindow(m_hWnd)); CString strItem; strItem.LoadString(nTextID); return InsertItem(nItem, strItem, pWndControl); +} +AFX_INLINE int CXTFlatTabCtrl::GetCurSel() const { + ASSERT(IsWindow(m_hWnd)); return m_nCurSel; +} +AFX_INLINE int CXTFlatTabCtrl::GetItemCount() const { + ASSERT(IsWindow(m_hWnd)); int iItemCount = (int)m_tcbItems.GetSize(); return iItemCount; +} +AFX_INLINE void CXTFlatTabCtrl::SetTabFonts(CFont* pNormFont, CFont* pBoldFont) { + if (pNormFont){ m_pNormFont = pNormFont; } if (pBoldFont){ m_pBoldFont = pBoldFont; } +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTFLATTABCTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTFontCombo.h b/Editor/XT/Include/XTFontCombo.h new file mode 100644 index 0000000..5f26013 --- /dev/null +++ b/Editor/XT/Include/XTFontCombo.h @@ -0,0 +1,122 @@ +// XTFontCombo.h interface for the CXTFontCombo class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTFONTCOMBO_H__) +#define __XTFONTCOMBO_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTFontCombo is a CXTFlatComboBox derived class. It is used to create +// a combo box that displays a drop list of available fonts for your system. +// The fonts are displayed in their various styles. +class _XT_EXT_CLASS CXTFontCombo : public CXTFlatComboBox +{ + DECLARE_DYNAMIC(CXTFontCombo) + +public: + + // Summary: Constructs a CXTFontCombo object. + CXTFontCombo(); + + // Summary: Destroys a CXTFontCombo object, handles cleanup and de-allocation. + virtual ~CXTFontCombo(); + +protected: + + int m_cyHScroll; // Represents system metrics for SM_CYHSCROLL. + int m_cyEdge; // Represents system metrics for SM_CYEDGE. + eSTYLE m_eStyle; // Enumerated style indicating how to display the font list. + CString m_strSymbol; // String displayed for symbol characters. + CImageList m_ilFontType; // true type font image list. + +public: + + // Input: lf - Reference to an XT_LOGFONT structure. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to get the logfont for the currently selected + // item. + virtual bool GetSelFont(XT_LOGFONT& lf); + + // Input: strFaceName - A reference to a valid CString object to receive the logfont face + // name. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to get the logfont for the currently selected + // item. + virtual bool GetSelFont(CString& strFaceName); + + // Input: lf - Reference to an XT_LOGFONT structure. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to select the logfont for the list box. + virtual bool SetSelFont(XT_LOGFONT& lf); + + // Input: strFaceName - A NULL terminated string that represents the logfont face name. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to select the logfont for the list box. + virtual bool SetSelFont(CString strFaceName); + + // BULLETED LIST: + + // Input: eStyle - Specifies the style for the font list box. Styles can be any one of + // the following combinations: + // [ul] + // [li]XT_FLB_NAME_GUI Display font name with GUI font style.[/li] + // [li]XT_FLB_NAME_SAMPLE Display font name with its own font + // style.[/li] + // [li]XT_FLB_BOTH Display font name with GUI font style, then + // a sample display to the right.[/li] + // [/ul] + // Summary: Call this member function to set the font display style for the font + // list box. There are three styles to choose from. They include displaying + // the font in the default GUI font, displaying the font in its own font + // style, or displaying both the font name in the default GUI font and + // a sample to the right. + void SetListStyle(eSTYLE eStyle); + + // Input: lpszFaceName - A NULL terminated string that represents the logfont face name. + // nWidth - The minimum allowable width of the list box portion of the combo + // box, in pixels. + // bEnable - TRUE to enable autocompletion, otherwise FALSE. + // Summary: Call this member function to initialize the font list box and populate it + // with a list of avaliable fonts. + virtual void InitControl(LPCTSTR lpszFaceName=NULL,UINT nWidth=0,BOOL bEnable=TRUE ); + + // Ignore: + //{{AFX_VIRTUAL(CXTFontCombo) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT); + virtual void MeasureItem(LPMEASUREITEMSTRUCT); + virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTFontCombo) + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTFontCombo::SetListStyle(eSTYLE eStyle) { + m_eStyle = eStyle; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTFONTCOMBO_H__) diff --git a/Editor/XT/Include/XTFrameImpl.h b/Editor/XT/Include/XTFrameImpl.h new file mode 100644 index 0000000..12e346a --- /dev/null +++ b/Editor/XT/Include/XTFrameImpl.h @@ -0,0 +1,310 @@ +// XTFrameImpl.h interface for the CXTFrameImpl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTFRAMEIMPL_H__) +#define __XTFRAMEIMPL_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// forwards + +class CXTDockState; +class CXTCustomizeSheet; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTFrameImpl is a stand alone helper class. It is used to provide additional +// support for cool menu and other control bar functionality. It is an +// additional base class for CXTFrameWnd, CXTMDIChildWnd, CXTMDIFrameWnd, +// and CXTOleIPFrameWnd. +class _XT_EXT_CLASS CXTFrameImpl +{ + +public: + + // Summary: Constructs a CXTFrameImpl object. + CXTFrameImpl(); + + // Summary: Destroys a CXTFrameImpl object, handles cleanup and de-allocation. + virtual ~CXTFrameImpl(); + + CXTCoolMenu m_coolMenu; // Handles the display of old-style 'cool' menus. + +protected: + + CXTMenuBar m_wndMenuBar; // Menu bar. + static DWORD m_dwCustStyle; // Customize dialog style, you can set this style in your frame's constructor, see CXTCustomizeSheet for more details. + static CXTCustomizeSheet* m_pCustomizeSheet; // Pointer to the toolbar customize dialog. + +protected: + + // Input: pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Returns: A CXTCoolMenu pointer to the cool menu object associated with the frame. + // Summary: Call this member function to retrieve a pointer to the cool menu object + // associated with the frame. + CXTCoolMenu* GetCoolMenuImpl(CFrameWnd* pFrameWnd); + + // Input: pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Returns: A CXTMenuBar pointer to the menu bar associated with the frame. + // Summary: Call this member function to retrieve a pointer to the application's + // menu bar. To use this function, the menu bar must have been created using + // the default control ID AFX_IDW_MENUBAR. + CXTMenuBar* GetMenuBarImpl(CFrameWnd* pFrameWnd) const; + + // Input: nIDToolBars - Array of toolbar resource IDs. The cool menu will use the toolbar + // commands to map the icons placed next to the corresponding menu commands. + // nSize - Size of the array of toolbars. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Summary: Call this member function to install cool menus for your application. + // Cool menus are menus that appear with icons next to the menu titles. + // Pass in your toolbar resource array to initialize. + void InstallCoolMenusImpl(const UINT* nIDToolBars,int nSize,CFrameWnd* pFrameWnd); + + // Input: nIDToolBar - Toolbar resource ID. The cool menu will use the toolbar commands + // to map the icons placed next to the corresponding menu commands. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Summary: Call this member function to install cool menus for your application. + // Cool menus are menus that appear with icons next to the menu titles. + // Pass in your toolbar resource to initialize. + void InstallCoolMenusImpl(const UINT nIDToolBar,CFrameWnd* pFrameWnd); + + // Input: lpszProfileName - Name of a section in the initialization file or a key in the Windows + // registry where state information is stored. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Summary: This member function is called by the frame window to restore the + // settings of the control bar. + void LoadBarStateImpl(LPCTSTR lpszProfileName,CFrameWnd* pFrameWnd); + + // Input: lpszProfileName - Name of a section in the initialization file or a key in the Windows + // registry where state information is stored. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Summary: This member function is called by the frame window to save the settings + // of the control bar. + void SaveBarStateImpl(LPCTSTR lpszProfileName,CFrameWnd* pFrameWnd) const; + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides of + // its parent window to which the control bar can be docked, if supported. + // The style can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control bar will not dock. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDockingImpl(DWORD dwDockStyle,CFrameWnd* pFrameWnd); + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides of + // its parent window to which the control bar can be docked, if supported. + // The style can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control bar will not dock. + // dwFlatStyle - Specifies the splitter's, inside dockbars, look. The style can be + // one of the following: + // [ul] + // [li]CBRS_XT_NONFLAT Thick devstudio like non-flat splitters.[/li] + // [li]CBRS_XT_SEMIFLAT Thin 3D non-flat splitters.[/li] + // [li]CBRS_XT_FLAT Flat splitters.[/li] + // [/ul] + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDockingExImpl(DWORD dwDockStyle,DWORD dwFlatStyle,CFrameWnd* pFrameWnd); + + // Input: pBar - A CControlBar pointer to the control bar to be docked. + // pDockBar - A CDockBar pointer to the dockbar the control bar is docked to. + // lpRect - Determines, in screen coordinates, where the control bar will be docked + // in the non-client area of the destination frame window. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Summary: This member function causes a control bar to be docked to the frame + // window. The control bar will be docked to one of the sides of the + // frame window specified in the calls to both CXTDockWindow::EnableDocking + // and CXTFrameWnd::EnableDocking. The side chosen is determined by the + // dockbar represented by 'pDockBar'. + void DockControlBarImpl(CControlBar* pBar,CDockBar* pDockBar,LPCRECT lpRect,CFrameWnd* pFrameWnd); + + // BULLETED LIST: + + // Input: pBar - A CControlBar pointer to the control bar to be docked. + // nDockBarID - Determines which sides of the frame window to consider for docking. + // It can be 0, or one or more of the following: + // [ul] + // [li]AFX_IDW_DOCKBAR_TOP Dock to the top side of the + // frame window.[/li] + // [li]AFX_IDW_DOCKBAR_BOTTOM Dock to the bottom side of + // the frame window.[/li] + // [li]AFX_IDW_DOCKBAR_LEFT Dock to the left side of the + // frame window.[/li] + // [li]AFX_IDW_DOCKBAR_RIGHT Dock to the right side of + // the frame window.[/li] + // [/ul] + // If 0, the control bar can be docked to any side enabled for + // docking in the destination frame window. + // lpRect - Determines, in screen coordinates, where the control bar will be docked + // in the non-client area of the destination frame window. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Summary: This member function causes a control bar to be docked to the frame + // window. The control bar will be docked to one of the sides of the frame + // window specified in the calls to both CXTDockWindow::EnableDocking + // and CXTFrameWnd::EnableDocking. The side chosen is determined by 'nDockBarID'. + void DockControlBarImpl(CControlBar* pBar,UINT nDockBarID,LPCRECT lpRect,CFrameWnd* pFrameWnd); + + // Input: pBar1 - A CControlBar pointer to the control bar to be docked. + // pBar2 - A CControlBar pointer to the already docked control bar to be + // redocked on the left of 'pBar1'. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Summary: This member function will redock a control bar specified by 'pBar2' + // to the left of a newly docked control bar specified by 'pBar1'. + void DockControlBarLeftOfImpl(CControlBar* pBar1,CControlBar* pBar2,CFrameWnd* pFrameWnd); + + // Input: pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Returns: A pointer to a CMenu object that represents the active + // menu for the frame. + // Summary: This member function retrieves a pointer to the menu for the frame + // window. + CMenu* GetMenuImpl(CFrameWnd* pFrameWnd) const; + + // Input: nCommandID - The command ID of a menu item to hide. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified command to the list of menu + // items to hide until activated by clicking on the chevron. + BOOL HideMenuItemImpl(UINT nCommandID,CFrameWnd* pFrameWnd); + + // Input: lpszItem - Text string representing the popup menu item to hide. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified menu item to the list of + // menu items to hide until activated by clicking on the chevron. + BOOL HideMenuItemImpl(LPCTSTR lpszItem,CFrameWnd* pFrameWnd); + + // Input: nCommandIDs - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified commands to the list of + // menu items to hide until activated by clicking on the chevron. + BOOL HideMenuItemsImpl(const UINT* nCommandIDs,int nSize,CFrameWnd* pFrameWnd); + + // Input: lpszItems - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified menu items to the list of + // menu items to hide until activated by clicking on the chevron. + BOOL HideMenuItemsImpl(const LPCTSTR lpszItems,int nSize,CFrameWnd* pFrameWnd); + + // Input: pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Summary: This member function redraws the menu bar. If a menu bar is changed + // after Windows has created the window, call this function to draw the + // changed menu bar. Overrides the CWnd implementation. + void DrawMenuBarImpl(CFrameWnd* pFrameWnd); + + // Input: pFrameWnd - A CFrameWnd pointer to the calling frame window. + // Returns: true if successful, otherwise returns false. + // Summary: This member function will initialize the accelerator manager for the + // framework. + bool InitAccelManagerImpl(CFrameWnd* pFrameWnd); + + // Input: pFrameWnd - A pointer to a CFrameWnd object. + // iNormalIndex - Index where the 'Tools' menu should be inserted into the Standard menu. + // iWindowIndex - Index where the 'Tools' menu should be inserted into the MDI window menu. + // iArgPopupMenu - Resource ID of the popup menu to be displayed for the Arguments + // browse edit box. + // iDirPopupMenu - Resource ID of the popup menu to be displayed for the Initial + // Directory browse edit box. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to initialize the Tools manager for your + // application. The Tools manager will insert a "Tools" menu into your + // application's menu which allows the user to customize and add custom + // commands to the menu. Typically used with toolbar customization, + // the Tools manager should be initialized when your frame is loaded by + // overriding the virtual function CFrameWnd::LoadFrame and can be managed + // by selecting the 'Tools' tab in the Customize dialog. + bool InitToolsManagerImpl(CFrameWnd* pFrameWnd,int iNormalIndex,int iWindowIndex,int iArgPopupMenu,int iDirPopupMenu); + + // Input: pFrameWnd - A pointer to a CFrameWnd object. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to initialize the Options manager for your + // application. Typically used with toolbar customization, the Options + // manager will allow the user to configure options related to the toolbar + // and menu behavior for the application. The options manager should + // be initialized when your frame is loaded by overriding the virtual + // function CFrameWnd::LoadFrame and can be managed by selecting the 'Options' + // tab in the Customize dialog. + bool InitOptionsManagerImpl(CFrameWnd* pFrameWnd); + + // Input: lpszText - String to append to the browse edit string. + // iWhich - Enumerated value that specifies which browse edit to update. + // It can be either XT_TOOLARG or XT_TOOLDIR. + // bAppend - true to append the string, false to replace the string. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to update the Tools manager argument + // or directory string by appending the string displayed in the corresponding + // edit field. This function is used by the framework whenever the argument + // or directory browse edit in the Tools manager tab of the toolbar Customize + // dialog is configured to use a popup menu. + bool UpdateToolsItem(LPCTSTR lpszText,int iWhich,bool bAppend); + + void SetDockStateImpl(const CXTDockState& state, CFrameWnd* pFrameWnd); + void GetDockStateImpl(CXTDockState& state, CFrameWnd* pFrameWnd) const; + BOOL PreCreateWindowImpl(CREATESTRUCT& cs, UINT uIcon, CFrameWnd* pFrameWnd); + BOOL PreTranslateMessageImpl(MSG* pMsg, CFrameWnd* pFrameWnd); + void OnSysColorChangeImpl(CFrameWnd* pFrameWnd); + void OnSettingChangeImpl(UINT uFlags, LPCTSTR lpszSection, CFrameWnd* pFrameWnd); + void OnCustomizeBarImpl(CFrameWnd* pFrameWnd); + void OnInitMenuPopupImpl(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); + BOOL OnToolsManagerImpl(UINT nID); + void OnUpdateToolsManagerImpl(CCmdUI* pCmdUI); + void OnUpdateChevronImpl(CCmdUI* pCmdUI); + + friend class CXTToolBar; +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTFRAMEIMPL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTFrameWnd.h b/Editor/XT/Include/XTFrameWnd.h new file mode 100644 index 0000000..576fd91 --- /dev/null +++ b/Editor/XT/Include/XTFrameWnd.h @@ -0,0 +1,299 @@ +// XTFrameWnd.h interface for the CXTFrameWnd class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTFRAMEWND_H__) +#define __XTFRAMEWND_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTFrameWnd is a multiple inheritance class derived from CFrameWnd and +// CXTFrameImpl. CXTFrameWnd extends the standard CFrameWnd class to allow +// CXTDockWindow and CXTToolBar docking, customization, and cool menu support. +class _XT_EXT_CLASS CXTFrameWnd : public CFrameWnd, public CXTFrameImpl +{ + DECLARE_DYNCREATE(CXTFrameWnd) + +public: + + // Summary: Constructs a CXTFrameWnd object. + CXTFrameWnd(); + + // Summary: Destroys a CXTFrameWnd object, handles cleanup and de-allocation. + virtual ~CXTFrameWnd(); + +protected: + +public: + + // Input: pViewClass - A pointer to a CRuntimeClass structure associated with your view. + // pDocument - A pointer to the document to be used with the view. If NULL + // the same document will be used for all SDI views. + // pContext - Specifies the type of view and document, if NULL this will be + // created for you. + // Summary: Call this member function to switch views for your SDI application. + virtual void SwitchSDIView(CRuntimeClass *pViewClass,CDocument *pDocument=NULL,CCreateContext *pContext=NULL); + + // Returns: A CXTCoolMenu pointer that represents the cool menu object associated with + // the frame. + // Summary: Call this member function to retrieve a pointer to the cool menu + // object associated with the frame. + CXTCoolMenu* GetCoolMenu(); + + // Returns: A CXTMenuBar pointer that represents the menu bar associated with the frame. + // Summary: Call this member function to retrieve a pointer to the menu bar associated + // with the frame. + CXTMenuBar* GetMenuBar(); + + // Input: nIDToolBars - Array of toolbar resource IDs. The cool menu will use the toolbar + // commands to map the icons placed next to the corresponding menu commands. + // nSize - Size of the array of toolbars. + // Summary: Call this member function to install cool menus for your application. + // Cool menus are menus that appear with icons next to the menu titles. + // Pass in your toolbar resource array to initialize. + void InstallCoolMenus(const UINT* nIDToolBars,int nSize); + + // Input: nIDToolBar - Toolbar resource ID. The cool menu will use the toolbar commands + // to map the icons placed next to the corresponding menu commands. + // Summary: Call this member function to install cool menus for your application. + // Cool menus are menus that appear with icons next to the menu titles. + // Pass in your toolbar resource to initialize. + void InstallCoolMenus(const UINT nIDToolBar); + + // Input: lpszProfileName - Name of a section in the initialization file or a key in the + // Windows registry where state information is stored. + // Summary: This member function is called by the frame window to restore the + // settings of the control bar. + virtual void LoadBarState(LPCTSTR lpszProfileName); + + // Input: lpszProfileName - Name of a section in the initialization file or a key in the + // Windows registry where state information is stored. + // Summary: This member function is called by the frame window to save the settings + // of the control bar. + virtual void SaveBarState(LPCTSTR lpszProfileName) const; + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides + // of its parent window to which the control bar can be docked, if supported. + // The style can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control bar will not dock. + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDocking(DWORD dwDockStyle); + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides + // of its parent window to which the control bar can be docked, if supported. + // The style can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control bar will not + // dock. + // dwFlatStyle - Specifies the splitter's, inside dockbars, look. It can be one + // of the following: + // [ul] + // [li]CBRS_XT_NONFLAT Thick devstudio like non-flat splitters.[/li] + // [li]CBRS_XT_SEMIFLAT Thin 3D non-flat splitters.[/li] + // [li]CBRS_XT_FLAT Flat splitters.[/li] + // [/ul] + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDockingEx(DWORD dwDockStyle,DWORD dwFlatStyle); + + // Input: pBar - A CControlBar pointer to the control bar to be docked. + // pDockBar - A CDockBar pointer to the dockbar the control bar is docked to. + // lpRect - Determines, in screen coordinates, where the control bar will + // be docked in the non-client area of the destination frame window. + // Summary: This member function causes a control bar to be docked to the frame + // window. The control bar will be docked to one of the sides of the frame + // window specified in the calls to both CXTDockWindow::EnableDocking + // and CXTFrameWnd::EnableDocking. The side chosen is determined by the + // dockbar represented by 'pDockBar'. + void DockControlBar(CControlBar* pBar,CDockBar* pDockBar,LPCRECT lpRect = NULL); + + // BULLETED LIST: + + // Input: pBar - A CControlBar pointer to the control bar to be docked. + // nDockBarID - Determines which sides of the frame window to consider for docking. + // It can be 0, or one or more of the following: + // [ul] + // [li]AFX_IDW_DOCKBAR_TOP to the top side of the frame + // window.[/li] + // [li]AFX_IDW_DOCKBAR_BOTTOM Dock to the bottom side of + // the frame window.[/li] + // [li]AFX_IDW_DOCKBAR_LEFT Dock to the left side of the + // frame window.[/li] + // [li]AFX_IDW_DOCKBAR_RIGHT Dock to the right side of + // the frame window.[/li] + // [/ul] + // If 0, the control bar can be docked to any side enabled for + // docking in the destination frame window. + // lpRect - Determines, in screen coordinates, where the control bar will + // be docked in the non-client area of the destination frame window. + // Summary: This member function causes a control bar to be docked to the frame + // window. The control bar will be docked to one of the sides of the + // frame window specified in the calls to both CXTDockWindow::EnableDocking + // and CXTFrameWnd::EnableDocking. The side chosen is determined by nDockBarID. + void DockControlBar(CControlBar* pBar,UINT nDockBarID = 0,LPCRECT lpRect = NULL); + + // Input: pBar1 - A CControlBar pointer to the control bar to be docked. + // pBar2 - A CControlBar pointer to the already docked control bar to be + // redocked on the left of 'pBar1'. + // Summary: This member function will redock a control bar specified by 'pBar2' + // to the left of a newly docked control bar specified by 'pBar1'. + virtual void DockControlBarLeftOf(CControlBar* pBar1,CControlBar* pBar2); + + // Returns: A pointer to a CMenu object that represents the active menu for the frame. + // Summary: This member function retrieves a pointer to the menu for the frame + // window. + virtual CMenu* GetMenu() const; + + // Input: nCommandID - The command ID of a menu item to hide. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified command to the list of menu + // items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItem(UINT nCommandID); + + // Input: lpszItem - Text string representing the popup menu item to hide. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified menu item to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItem(LPCTSTR lpszItem); + + // Input: nCommandIDs - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified commands to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItems(const UINT* nCommandIDs,int nSize); + + // Input: lpszItems - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified menu items to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItems(const LPCTSTR lpszItems,int nSize); + + // Summary: This member function redraws the menu bar. If a menu bar is changed + // after Windows has created the window, call this function to draw the + // changed menu bar. Overrides the CWnd implementation. + void DrawMenuBarX(); + + // Summary: Call this function to display the Customize Toolbar dialog box. + // This dialog box allows the user to customize the toolbar by adding + // and deleting buttons. + void Customize(); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function will initialize the accelerator manager for the + // framework. + bool InitAccelManager(); + + // Input: iNormalIndex - Index where the 'Tools' menu should be inserted into the standard menu. + // iWindowIndex - Index where the 'Tools' menu should be inserted into the MDI window menu. + // iArgPopupMenu - Resource ID of the popup menu to be displayed for the Arguments + // browse edit box. + // iDirPopupMenu - Resource ID of the popup menu to be displayed for the Initial + // Directory browse edit box. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to initialize the Tools manager for your + // application. The tools manager will insert a "Tools" menu into your + // application's menu which allows the user to customize and add custom + // commands to the menu. Typically used with toolbar customization, the + // Tools manager should be initialized when your frame is loaded by overriding + // the virtual function CFrameWnd::LoadFrame and can be managed by selecting + // the 'Tools' tab in the customize dialog. + bool InitToolsManager(int iNormalIndex,int iWindowIndex=-1,int iArgPopupMenu=0,int iDirPopupMenu=0); + + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to initialize the Options manager for your + // application. Typically used with toolbar customization, the Options + // manager will allow the user to configure options related to the toolbar + // and menu behavior for the application. The Options manager should + // be initialized when your frame is loaded by overriding the virtual + // function CFrameWnd::LoadFrame and can be managed by selecting the 'Options' + // tab in the Customize dialog. + bool InitOptionsManager(); + +protected: + + virtual void SetDockState(const CXTDockState& state); + virtual void GetDockState(CXTDockState& state) const; + + // Ignore: + //{{AFX_VIRTUAL(CXTFrameWnd) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs, UINT uIcon); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTFrameWnd) + afx_msg void OnSysColorChange(); + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); + //}}AFX_MSG + + afx_msg void OnCustomizeBar(); + afx_msg BOOL OnToolsManager(UINT nID); + afx_msg void OnUpdateToolsManager(CCmdUI* pCmdUI); + afx_msg void OnUpdateChevron(CCmdUI* pCmdUI); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTFrameWnd::Customize() { + OnCustomizeBar(); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTFRAMEWND_H__) diff --git a/Editor/XT/Include/XTFunctions.h b/Editor/XT/Include/XTFunctions.h new file mode 100644 index 0000000..ffedd97 --- /dev/null +++ b/Editor/XT/Include/XTFunctions.h @@ -0,0 +1,336 @@ +// XTFunctions.h interface for the XT_AUX_DATA struct. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTFUNCTIONS_H__) +#define __XTFUNCTIONS_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +//:Associate with "Global Functions" + +#if defined(XT_INIT_BY_REGULAR_DLL) +////////////////////////////////////////////////////////////////////// +// Summary: This member function will initialize the resources for the Xtreme Toolkit. +// If using the Xtreme Toolkit as an extension DLL within a regular DLL, +// add the following two lines to your stdafx.h file. This will give you +// access to the exported function InitXtremeExtDll(): +// +//
#define XT_INIT_BY_REGULAR_DLL
+//			#include "XTToolkit.h"
+// +// You will then need to add XT_INIT_BY_REGULAR_DLL to the Xtreme Toolkit +// preprocessor definitions and rebuild it. After you have done this +// locate your CWinApp::InitInstance() method for your regular DLL and make +// the following call: +// +//
InitXtremeExtDLL();
+// +// This will initialize the resources for the Xtreme Toolkit. +extern _XT_EXT_CLASS void WINAPI InitXtremeExtDLL(); +#endif // defined(XT_INIT_BY_REGULAR_DLL) + +// Input: pWnd - Pointer to a valid CWnd object. +// pFont - Pointer to the new font to set for the window. +// Summary: This member function will set the font for the window specified by +// 'pWnd' and all of the child windows owned by 'pWnd'. +extern _XT_EXT_CLASS void AFXAPI _xtAfxChangeWindowFont(CWnd* pWnd,CFont* pFont); + +// Input: pDC - Pointer to the current device context. +// imageList - Address of an image list. +// nIndex - Index of the image in the image list. +// point - XY location of where to draw the icon. +// bInColor - TRUE to draw the item in color, otherwise the +// icon will be drawn with the default disabled look. +// Summary: This member function will draw an embossed icon from the image +// list that is passed in, into the specified device context. Typically +// used by toolbars and menus to draw a disabled icon in color. +extern _XT_EXT_CLASS void AFXAPI _xtAfxDrawEmbossed(CDC* pDC,CImageList& imageList,int nIndex,CPoint point,BOOL bInColor); + +// Input: hInst - Instance handle of the module that has the required resource. +// hRsrc - Bitmap resource handle. +// bMono - Tells if monochrome conversion shall be applied. +// Summary: This member function loads a bitmap from resource and translates the +// bitmap color such that they suit requirements for a toolbar bitmap. +extern _XT_EXT_CLASS HBITMAP AFXAPI _xtAfxLoadSysColorBitmap(HINSTANCE hInst,HRSRC hRsrc,BOOL bMono = FALSE); + +// Input: pDC - Points to the current device context. +// rect - Size of the area to draw. +// Summary: This member function will draw a shadow rect into the specified +// device context. +extern _XT_EXT_CLASS void AFXAPI _xtAfxDrawShadedRect(CDC *pDC,CRect& rect); + +// Input: hWnd - HWND handle of the parent window to find the child for. +// pt - Current cursor position. +// Returns: An HWND handle for the child window at 'pt'. +// Summary: This member function will retrieve an HWND handle for the child window +// found directly under the cursor position specified by 'pt'. +extern _XT_EXT_CLASS HWND AFXAPI _xtAfxChildWindowFromPoint(HWND hWnd,POINT pt); + +// Input: strText - A reference to a CString object. +// Summary: This member function will search a string, strip off the mnemonic +// '&', and reformat the string. +extern _XT_EXT_CLASS void AFXAPI _xtAfxStripMnemonics(CString& strText); + +// Input: lpszFileName - Fully qualified path for the item to find. +// Returns: TRUE if successful, otherwise returns FALSE. +// Summary: This member function will test for the existence of a file or folder. +extern _XT_EXT_CLASS BOOL AFXAPI _xtAfxExist(LPCTSTR lpszFileName); + +// Input: pszPath - Pointer to a NULL-terminated string with the path. Paths are delimited +// by backslashes or by the NULL at the end of the path. +// Returns: A pointer to a NULL-terminated string with the next path component +// if successful, or NULL otherwise. +// Summary: This member function parses a path for the next path component, not +// dependent on shell32.dll, and is a replacement for the windows API +// PathFindNextComponent. +extern _XT_EXT_CLASS LPTSTR AFXAPI _xtAfxPathFindNextComponent(LPCTSTR pszPath); + +// Input: pParentWnd - Points to the parent of the view to be created. The parent must be +// valid. +// pViewClass - CView runtime class. +// pDocument - CDocument associated with the view. It can be NULL. +// pContext - Create context for the view. It can be NULL. +// dwStyle - Default style for the view. +// pOwnerWnd - Owner of the view. If NULL, 'pParentWnd' is used. +// nID - Control ID of the view. +// Returns: A CWnd* pointer to the newly created view if successful, +// otherwise returns NULL. +// Summary: This member function dynamically creates a view based on a CRuntimeClass +// object. +extern _XT_EXT_CLASS CWnd* AFXAPI _xtAfxCreateView(CWnd* pParentWnd,CRuntimeClass *pViewClass, CDocument *pDocument=NULL,CCreateContext *pContext=NULL,DWORD dwStyle=AFX_WS_DEFAULT_VIEW,CWnd* pOwnerWnd=NULL,UINT nID=AFX_IDW_PANE_FIRST); + +// Input: lparam1 - Corresponds to the lParam member of the TV_ITEM structure for the +// two items being compared. +// lparam2 - Corresponds to the lParam member of the TV_ITEM structure for the +// two items being compared. +// lparamSort - The 'lParamSort' member corresponds to the lParam member of TV_SORTCB. +// Returns: A negative value if the first item should precede the second, +// a positive value if the first item should follow the second, or zero +// if the two items are equivalent. +// Summary: This member function is a callback function used by CXTShellTreeCtrl +// and CXTShellTreeView, and is called during a sort operation each +// time the relative order of two list items needs to be compared. +extern _XT_EXT_CLASS int CALLBACK _xtAfxTreeViewCompareProc(LPARAM lparam1,LPARAM lparam2,LPARAM lparamSort); + +// Input: lparam1 - Corresponds to the lParam member of the LV_ITEM structure for the +// two items being compared. +// lparam2 - Corresponds to the lParam member of the LV_ITEM structure for the +// two items being compared. +// lparamSort - The 'lParamSort' member corresponds to the lParam member of LV_SORTCB. +// Returns: A negative value if the first item should precede the second, +// a positive value if the first item should follow the second, or zero +// if the two items are equivalent. +// Summary: This member function is a callback function used by CXTShellListCtrl +// and CXTShellListView, and is called during a sort operation each time +// the relative order of two list items needs to be compared. +extern _XT_EXT_CLASS int CALLBACK _xtAfxListViewCompareProc(LPARAM lparam1,LPARAM lparam2,LPARAM lparamSort); + +// Input: pView - Pointer to the view to dispaly print preview for. +// Returns: true if successful, otherwise returns false. +// Summary: Call this global function to display an office style print preview window +// for your CView derived class. +_XT_EXT_CLASS bool _xtAfxShowPrintPreview(CView* pView); + +extern _XT_EXT_CLASS void AFXAPI _xtAfxMakeOleVariant(COleVariant &ov, LPCITEMIDLIST pidl); +#ifdef _DEBUG +extern _XT_EXT_CLASS void AFXAPI _xtAfxAssertValidBarIDs(CFrameWnd* pFrameWnd); +#endif //_DEBUG + +//:Associate with "Dialog Data Exchange" + +// Input: pDX - A pointer to a CDataExchange object. The framework supplies this +// object to establish the context of the data exchange, including its +// direction. +// nIDC - The resource ID of the color picker control associated with the +// control property. +// value - A reference to a member variable of the dialog box, form view, or +// control view object with which data is exchanged. +// Summary: CXTColorPicker - The DDX_XTColorPicker function manages the transfer +// of integer data between a color picker control in a dialog box, form view, +// or control view object and a COLORREF data member of the dialog box, +// form view, or control view object. +// +// When DDX_XTColorPicker is called, 'value' is set to the current state +// of the color picker control. +extern _XT_EXT_CLASS void AFXAPI DDX_XTColorPicker(CDataExchange* pDX,int nIDC,COLORREF& value); + +//:Associate with "Dialog Data Exchange" + +// Input: pDX - A pointer to a CDataExchange object. The framework supplies this +// object to establish the context of the data exchange, including its +// direction. You do not need to delete this object. +// nIDC - The resource ID of the date and time picker control associated with +// the member variable. +// value - A reference to a COleDateTime member variable, dialog box, form +// view, or control view object with which data is exchanged. +// Summary: CXTDateTimeCtrl - The DDX_XTDateTimeCtrl function manages the transfer +// of date and/or time data between a date and time picker control (CXTDateTimeCtrl) +// in a dialog box or form view object and a COleDateTime data member of the +// dialog box or form view object. +// +// When CXTDateTimeCtrl is called, 'value' is set to the current state +// of the date and time picker control, or the control is set to 'value', +// depending on the direction of the exchange. +extern _XT_EXT_CLASS void AFXAPI DDX_XTDateTimeCtrl(CDataExchange* pDX,int nIDC,COleDateTime& value); + +//:Associate with "Dialog Data Exchange" + +// Input: pDX - A pointer to a CDataExchange object. The framework supplies this +// object to establish the context of the data exchange, including its +// direction. You do not need to delete this object. +// nIDC - The resource ID of the date and time picker control associated with +// the member variable. +// value - A reference to a CTime member variable, dialog box, form view, or +// control view object with which data is exchanged. +// Summary: CXTDateTimeCtrl - The DDX_XTDateTimeCtrl function manages the transfer +// of date and/or time data between a date and time picker control (CXTDateTimeCtrl) +// in a dialog box or form view object, and a CTime data member of the dialog +// box or form view object. +// +// When CXTDateTimeCtrl is called, 'value' is set to the current state +// of the date and time picker control, or the control is set to 'value', +// depending on the direction of the exchange. +extern _XT_EXT_CLASS void AFXAPI DDX_XTDateTimeCtrl(CDataExchange* pDX,int nIDC,CTime& value); + +//:Associate with "Dialog Data Validation" + +// Input: pDX - A pointer to a CDataExchange object. The framework supplies this +// object to establish the context of the data exchange, including its +// direction. You do not need to delete this object. +// refValue - A reference to a CTime object associated with a member variable +// of the dialog box, form view, or control view object. This object contains +// the data to be validated. +// pMinRange - Minimum date/time value allowed. +// pMaxRange - Maximum date/time value allowed. +// Summary: CXTDateTimeCtrl - Call DDV_XTMinMaxDateTime to verify that the time/date +// value in the date and time picker control (CXTDateTimeCtrl) associated +// with 'refValue' falls between 'pMinRange' and 'pMaxRange'. +extern _XT_EXT_CLASS void AFXAPI DDV_XTMinMaxDateTime(CDataExchange* pDX,CTime& refValue,const CTime* pMinRange,const CTime* pMaxRange); + +//:Associate with "Dialog Data Validation" + +// Input: pDX - A pointer to a CDataExchange object. The framework supplies this +// object to establish the context of the data exchange, including its +// direction. You do not need to delete this object. +// refValue - A reference to a COleDateTime object associated with a member variable +// of the dialog box, form view, or control view object. This object +// contains the data to be validated. +// pMinRange - Minimum date/time value allowed. +// pMaxRange - Maximum date/time value allowed. +// Summary: CXTDateTimeCtrl - Call DDV_XTMinMaxDateTime to verify that the time/date +// value in the date and time picker control (CXTDateTimeCtrl) associated +// with 'refValue' falls between 'pMinRange' and 'pMaxRange'. +extern _XT_EXT_CLASS void AFXAPI DDV_XTMinMaxDateTime(CDataExchange* pDX,COleDateTime& refValue,const COleDateTime* pMinRange,const COleDateTime* pMaxRange); + +//:Associate with "Dialog Data Exchange" + +// Input: pDX - A pointer to a CDataExchange object. The framework supplies this +// object to establish the context of the data exchange, including its +// direction. You do not need to delete this object. +// nIDC - The resource ID of the month calendar control associated with the +// member variable. +// value - A reference to a COleDateTime member variable of the dialog box, +// form view, or control view object with which data is exchanged. +// Summary: CXTMonthCalCtrl - The DDX_XTMonthCalCtrl function manages the transfer +// of date data between a month calendar control (DDX_XTMonthCalCtrl), +// in a dialog box, form view, or control view object, and a COleDateTime +// data member, of the dialog box, form view, or control view object. +// +// Remarks: The control manages a date value only. The time fields in the +// time object are set to reflect the creation time of the control window, +// or whatever time was set in the control with a call to CXTMonthCalCtrl::SetCurSel. +// +// When DDX_XTMonthCalCtrl is called, 'value' is set to the current state of +// the month calendar control. +extern _XT_EXT_CLASS void AFXAPI DDX_XTMonthCalCtrl(CDataExchange* pDX, int nIDC,COleDateTime& value); + +//:Associate with "Dialog Data Exchange" + +// Input: pDX - A pointer to a CDataExchange object. The framework supplies this +// object to establish the context of the data exchange, including its +// direction. You do not need to delete this object. +// nIDC - The resource ID of the month calendar control associated with the +// member variable. +// value - A reference to a CTime member variable of the dialog box, form view, +// or control view object with which data is exchanged. +// Remarks: The control manages a date value only. The time fields in the +// time object are set to reflect the creation time of the control window, +// or whatever time was set in the control with a call to CXTMonthCalCtrl::SetCurSel. +// +// When DDX_XTMonthCalCtrl is called, 'value' is set to the current state of +// the month calendar control. +// Summary: CXTMonthCalCtrl - The DDX_XTMonthCalCtrl function manages the transfer +// of date data between a month calendar control (DDX_XTMonthCalCtrl), in +// a dialog box, form view, or control view object, and a CTime data +// member of the dialog box, form view, or control view object. +extern _XT_EXT_CLASS void AFXAPI DDX_XTMonthCalCtrl(CDataExchange* pDX,int nIDC,CTime& value); + +//:Associate with "Dialog Data Validation" + +// Input: pDX - A pointer to a CDataExchange object. The framework supplies this +// object to establish the context of the data exchange, including its +// direction. +// refValue - A reference to an object of type CTime associated with a member +// variable of the dialog box, form view, or control view object. This +// object contains the data to be validated. MFC passes this reference +// when DDV_XTMinMaxMonth is called. +// pMinRange - Minimum date/time value allowed. +// pMaxRange - Maximum date/time value allowed. +// Summary: CXTMonthCalCtrl - Call DDV_XTMinMaxMonth to verify that the time/date +// value in the month calendar control (CXTMonthCalCtrl) associated with +// 'refValue' falls between 'pMinRange' and 'pMaxRange'. +extern _XT_EXT_CLASS void AFXAPI DDV_XTMinMaxMonth(CDataExchange* pDX,CTime& refValue,const CTime* pMinRange,const CTime* pMaxRange); + +//:Associate with "Dialog Data Validation" + +// Input: pDX - A pointer to a CDataExchange object. The framework supplies this +// object to establish the context of the data exchange, including its +// direction. +// refValue - A reference to an object of type CTime associated with a member +// variable of the dialog box, form view, or control view object. This +// object contains the data to be validated. MFC passes this reference +// when DDV_XTMinMaxMonth is called. +// pMinRange - Minimum date/time value allowed. +// pMaxRange - Maximum date/time value allowed. +// Summary: CXTMonthCalCtrl - Call DDV_XTMinMaxMonth to verify that the time/date +// value in the month calendar control (CXTMonthCalCtrl) associated with +// 'refValue' falls between 'pMinRange' and 'pMaxRange'. +extern _XT_EXT_CLASS void AFXAPI DDV_XTMinMaxMonth(CDataExchange* pDX,COleDateTime& refValue,const COleDateTime* pMinRange,const COleDateTime* pMaxRange); + +class CXTDateEdit; + +//:Associate with "Dialog Data Exchange" + +// Input: pDX - A pointer to a CDataExchange object. The framework supplies this +// object to establish the context of the data exchange, including its +// direction. +// nIDC - The resource ID of the date edit control associated with the control +// property. +// rControl - A reference to a member variable of the dialog box, form view, or +// control view object with which data is exchanged. +// rDateTime - A reference to a member variable of the dialog box, form view, or +// control view object with which data is exchanged. +// Summary: CXTDateEdit - The DDX_XTOleDateTime function manages the transfer of +// integer data between a date edit control, in a dialog box, form view, or +// control view object, and a COleDateTime data member of the dialog box, +// form view, or control view object. +// +// When DDX_XTOleDateTime is called, 'value' is set to the current state +// of the date edit control. +extern _XT_EXT_CLASS void AFXAPI DDX_XTOleDateTime(CDataExchange* pDX,int nIDC,CXTDateEdit& rControl,COleDateTime& rDateTime); + +////////////////////////////////////////////////////////////////////// + +#endif // #if !defined(__XTFUNCTIONS_H__) diff --git a/Editor/XT/Include/XTGlobal.h b/Editor/XT/Include/XTGlobal.h new file mode 100644 index 0000000..904eb51 --- /dev/null +++ b/Editor/XT/Include/XTGlobal.h @@ -0,0 +1,750 @@ +// XTGlobal.h interface for the XT_AUX_DATA struct. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTGLOBALS_H__) +#define __XTGLOBALS_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Uncomment this definition if your application uses a resource dll, +// and add #include "XTResource.rc" to your resource dll's .rc2 file. +// You will have to call xtAfxData.InitResources(HINSTANCE) once you +// have a resource handle, to initialize the Xtreme Toolkit resources. +// You will need to rebuild the library after you have done this. +//#define _XT_USES_RESOURCE_DLL + +////////////////////////////////////////////////////////////////////// +// Summary: XT_ASSERT_MSG is similar to ASSERT, except that it allows a custom +// message to be specified. +#ifdef _DEBUG + +#ifndef _AFX_NO_DEBUG_CRT + +#define XT_ASSERT_MSG(exp, msg) \ +{ \ + if ( !(exp) && (_CrtDbgReport( _CRT_ASSERT, __FILE__, __LINE__, NULL, "\n-----------------------\n" msg "\n-----------------------" ) ) ) \ + AfxDebugBreak(); \ +} \ + +#else +#define XT_ASSERT_MSG(exp, msg) (void)( (exp) || (_assert("\n-----------------------\n" msg "\n-----------------------", __FILE__, __LINE__), 0) ) +#endif//_AFX_NO_DEBUG_CRT + +#else +#define XT_ASSERT_MSG(exp, msg) ((void)0) +#endif//_DEBUG + +////////////////////////////////////////////////////////////////////// +// Summary: XT_DROPDOWNBUTTON is a stand alone helper structure class. It is used +// by the CXTToolBar class to handle popup menu and color picker. +struct XT_DROPDOWNBUTTON +{ +public: + + // Summary: Constructs a XT_DROPDOWNBUTTON object with default values. + XT_DROPDOWNBUTTON(); + + // Input: pOther - A pointer to a valid XT_DROPDOWNBUTTON structure. + // Summary: Constructs a XT_DROPDOWNBUTTON object by copying values from an existing + // XT_DROPDOWNBUTTON structure. + XT_DROPDOWNBUTTON(const XT_DROPDOWNBUTTON* pOther); + + UINT idButton; // Command ID of the button. + UINT idMenu; // Popup menu to display. + BOOL bShowColor; // TRUE to draw a color box for color selection. + BOOL bMenuBarPopup; // It is mutually exclusive with 'bShowColor'. TRUE if a toolbar dropdown was created from a menu bar popup. + BOOL bColorPicker; // TRUE if the dropdown is a color picker. + BOOL bArrow; // TRUE to render arrows for the dropdown. + DWORD dwPopup; // Style flags for color popup window. + DWORD dwMenuBarPopupID; // Unique ID of the menu bar popup. It is valid if 'bMenuBarPopup' is TRUE. + COLORREF clrDefault; // Default color for the color popup window. + COLORREF clrColor; // An RGB value for the current color for the color popup window. + + +}; + + +////////////////////////////////////////////////////////////////////// +// Summary: XT_LVITEMDATA is a stand alone helper structure class. It holds list +// item data for a shell list. It is used by CXTShellTreeCtrl, CXTShellTreeView, +// CXTShellListCtrl and CXTShellListView. +struct XT_LVITEMDATA +{ + ULONG ulAttribs; // Shell item attributes. + LPITEMIDLIST lpi; // Pointer to an item ID list. + LPSHELLFOLDER lpsfParent; // Points to the parent shell folder item. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_TVITEMDATA is a stand alone helper structure class. It is used to +// create a structure that holds tree item data for a shell tree. It is +// used by CXTShellTreeCtrl, CXTShellTreeView, CXTShellListCtrl and CXTShellListView. +struct XT_TVITEMDATA +{ + LPITEMIDLIST lpi; // Pointer to an item ID list. + LPITEMIDLIST lpifq; // Pointer to an item ID list. + LPSHELLFOLDER lpsfParent; // Pointer to the parent shell folder item. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_CMDINFO is a stand alone helper structure class. It is used by +// CXTCommandsListBox and CXTCustCommands during toolbar customization. +struct XT_CMDINFO +{ + UINT nCmdID; // Command identifier. + HICON hIcon; // Icon associated with the command. + LPCTSTR lpszItem; // Text for the menu or toolbar command. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_OUTBAR_INFO is a stand alone helper structure class. It is used by +// CXTOutBarCtrl to store and send information for an Outlook bar folder +// or item. +struct XT_OUTBAR_INFO +{ + int nIndex; // Index of the item. + int nDragTo; // Ending drag index. + int nDragFrom; // Starting drag index. + bool bFolder; // true if the item is a folder + LPCTSTR lpszText; // Item text. + +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_TCB_ITEM is a stand alone helper structure class. It is used by +// CXTTabCtrl and CXTTabView to store information for a particular tab +// item. +struct XT_TCB_ITEM +{ + UINT uiToolTipId; // Resource ID for the tooltip. + CWnd* pWnd; // A CWnd pointer to the window associated with a tab. + CString szTabLabel; // User specified label for the tab. + CString szToolTipLabel; // Tooltip text for the tab. + CString szCondensedLabel; // The label actually being displayed for auto-condensing tabs. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_DLLVERSIONINFO is a stand alone helper structure class. It is used +// to store version information for a specified module. +struct XT_DLLVERSIONINFO +{ + DWORD cbSize; // Size of the structure, in bytes. This member must be filled in before calling the function. + DWORD dwMajorVersion; // Major version of the DLL. If the DLL's version is 4.0.950, this value will be 4. + DWORD dwMinorVersion; // Minor version of the DLL. If the DLL's version is 4.0.950, this value will be 0. + DWORD dwBuildNumber; // Build number of the DLL. If the DLL's version is 4.0.950, this value will be 950. + + // BULLETED LIST: + + // Identifies the platform for which the DLL was built. This can + // be one of the following values: + // [ul] + // [li]DLLVER_PLATFORM_WINDOWS The DLL was built for all Windows + // platforms.[/li] + // [li]DLLVER_PLATFORM_NT The DLL was built specifically for + // Windows NT.[/li] + // [/ul] + DWORD dwPlatformID; +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_CLRFONT is a stand alone helper structure class. It is used by CXTTreeCtrl +// and CXTTreeView to store information for a specified tree item. +struct XT_CLRFONT +{ + LOGFONT logfont; // A LOGFONT object that represents the tree item font. + COLORREF color; // An RGB value that represents the color for a tree item. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_TOOLBARDATA is a stand alone helper structure class. It is used +// by CXTTabCtrl and CXTTabView to store information for a specified tab +// item. +struct XT_TOOLBARDATA +{ + WORD wVersion; // Version number should be 1. + WORD wWidth; // Width of one bitmap. + WORD wHeight; // Height of one bitmap. + WORD wItemCount; // Number of items. + WORD items[1]; // Array of command IDs. The actual size is 'wItemCount'. + + // Input: nItem - Index of the item to retrieve the command ID for. + // Returns: A WORD object that represents the command identifier. + // Summary: This function is used by CXTCoolMenu and CXTToolBar to return + // the command identifier specified by the index 'nItem'. + WORD GetItem(int nItem); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE WORD XT_TOOLBARDATA::GetItem( int nItem ) { + return items[nItem]; +} + +////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////// +// Summary: XT_LOGFONT is a self initializing LOGFONT derived structure class. It +// will allow you to create or copy a LOGFONT object, and defines the attributes +// of a font. +struct XT_LOGFONT : public LOGFONT +{ + // Summary: Constructs an XT_LOGFONT object. + XT_LOGFONT(); + + // Input: logfont - Valid address of a LOGFONT structure. + // Summary: Copy constructor will construct an XT_LOGFONT object and copy the + // data specified by 'logfont' into the structure's data members. + XT_LOGFONT(LOGFONT& logfont); + + // Input: logfont - Valid address of a LOGFONT structure. + // Summary: This overloaded operator will copy the data specified by 'logfont' + // into the structure's data members. + void operator = (LOGFONT& logfont); + + DWORD dwType; // Used to hold the font type, i.e. TT_FONT, DEVICE_FONT. +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE XT_LOGFONT::XT_LOGFONT() { + ::ZeroMemory(this, sizeof(XT_LOGFONT)); dwType = 0; +} +AFX_INLINE XT_LOGFONT::XT_LOGFONT( LOGFONT& logfont ) { + ::CopyMemory((void*)&*this, (const void*) &logfont, (DWORD)sizeof(LOGFONT)); dwType = 0; +} +AFX_INLINE void XT_LOGFONT::operator = (LOGFONT& logfont) { + ::CopyMemory((void*)&*this, (const void*)&logfont, (DWORD)sizeof(LOGFONT)); +} + +////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////// +// Summary: XT_MENUITEMINFO is a self initializing MENUITEMINFO derived structure +// class. It is used by CXTCoolMenu and CXTMenuBar, and contains +// information about menu items. +struct _XT_EXT_CLASS XT_MENUITEMINFO : public MENUITEMINFO +{ + // Summary: Constructs an XT_MENUITEMINFO object. + XT_MENUITEMINFO(); +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_NONCLIENTMETRICS is a self initializing NONCLIENTMETRICS derived +// structure class. It contains the scalable metrics associated with the +// non-client area of a non-minimized window. This structure is used by +// the SPI_GETNONCLIENTMETRICS and SPI_SETNONCLIENTMETRICS actions of +// SystemParametersInfo. +struct XT_NONCLIENTMETRICS : public NONCLIENTMETRICS +{ + // Summary: Constructs an XT_NONCLIENTMETRICS object. + XT_NONCLIENTMETRICS(); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE XT_NONCLIENTMETRICS::XT_NONCLIENTMETRICS() { + memset(this, 0, sizeof(NONCLIENTMETRICS)); cbSize = sizeof(NONCLIENTMETRICS); /*// Retrieves the value of the specified system-wide parameter.*/VERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), this, 0)); +} + +////////////////////////////////////////////////////////////////////// +// Summary: XT_REBARSIZECHILDINFO is a stand alone structure class. It is used to +// create an XT_REBARSIZECHILDINFO structure. +struct XT_REBARSIZECHILDINFO +{ + REBARBANDINFO* pBandInfo; // Points to a REBARBANDINFO structure that contains information that defines a band in a rebar control. + NMREBARCHILDSIZE* pSizeInfo; // Points to a NMREBARCHILDSIZE structure that contains information used in handling the RBN_CHILDSIZE notification message. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_AUX_DATA is a stand alone global item data structure class. It is +// used by the toolkit to initialize and store resource and item data shared +// by all objects. Items include system colors, icons, fonts and OS flags. +struct _XT_EXT_CLASS XT_AUX_DATA +{ +private: + + // Summary: Constructs an XT_AUX_DATA object. + XT_AUX_DATA(); + +public: + + // Summary: Destroys an XT_AUX_DATA object, handles cleanup and de-allocation. + virtual ~XT_AUX_DATA(); + + //////////////////////////////////////////////////////////////////// + // (RGB) System colors used by Xtreme Toolkit + //////////////////////////////////////////////////////////////////// + + COLORREF clr3DFace; // An RGB value that represents the face color for three dimensional display elements. + COLORREF clr3DShadow; // An RGB value that represents the shadow color for three dimensional display elements. + COLORREF clr3DDkShadow; // An RGB value that represents the dark shadow for three dimensional display elements. + COLORREF clr3DHilight; // An RGB value that represents the highlight color for three dimensional display elements. + COLORREF clr3DLight; // An RGB value that represents the light color for three dimensional display elements. + COLORREF clrBtnText; // An RGB value that represents the text color on push buttons. + COLORREF clrGrayText; // An RGB value that represents the grayed (disabled) text. + COLORREF clrHighlight; // An RGB value that represents the item(s) selected in a control. + COLORREF clrHighlightText; // An RGB value that represents the text color of item(s) selected in a control. + COLORREF clrMenu; // An RGB value that represents the menu background. + COLORREF clrMenuText; // An RGB value that represents the text color in menus. + COLORREF clrWindow; // An RGB value that represents the window background. + COLORREF clrWindowFrame; // An RGB value that represents the window frame. + COLORREF clrWindowText; // An RGB value that represents the text color in windows. + COLORREF clrActiveCaption; // An RGB value that represents the active window title bar. + COLORREF clrInActiveCaption; // An RGB value that represents the inactive window title bar. + COLORREF clrGradActiveCapt; // An RGB value that represents the gradient active title bar. + COLORREF clrGradInActiveCapt; // An RGB value that represents the gradient inactive title bar. + COLORREF clrActiveCaptText; // An RGB value that represents the active caption text. + COLORREF clrInactiveCaptText; // An RGB value that represents the inactive caption text. + COLORREF clrXPBarFace; // An RGB value that represents the XP toolbar background color. + COLORREF clrXPHighlight; // An RGB value that represents the XP menu item selected color. + COLORREF clrXPHighlightBorder; // An RGB value that represents the XP menu item selected border color. + COLORREF clrXPHighlightPushed; // An RGB value that represents the XP menu item pushed color. + COLORREF clrXPIconShadow; // An RGB value that represents the XP menu item icon shadow. + COLORREF clrXPGrayText; // An RGB value that represents the XP menu item disabled text color. + COLORREF clrXPHighlightChecked; // An RGB value that represents the XP menu item checked color. + COLORREF clrXPHighlightCheckedBorder; // An RGB value that represents the XP menu item checked border color. + COLORREF clrXPGripper; // An RGB value that represents the XP toolbar gripper color. + COLORREF clrXPSeparator; // An RGB value that represents the XP toolbar separator color. + COLORREF clrXPDisabled; // An RGB value that represents the XP menu icon disabled color. + COLORREF clrXPMenuTextBack; // An RGB value that represents the XP menu item text background color. + COLORREF clrXPMenuExpanded; // An RGB value that represents the XP hidden menu commands background color. + COLORREF clrXPMenuBorder; // An RGB value that represents the XP menu border color. + COLORREF clrXPMenuText; // An RGB value that represents the XP menu item text color. + COLORREF clrXPHighlightText; // An RGB value that represents the XP menu item selected text color. + COLORREF clrXPBarText; // An RGB value that represents the XP toolbar text color. + COLORREF clrXPBarTextPushed; // An RGB value that represents the XP toolbar pushed text color. + COLORREF clrXPTabInactiveBack; // An RGB value that represents the XP inactive tab background color. + COLORREF clrXPTabInactiveText; // An RGB value that represents the XP inactive tab text color. + + //////////////////////////////////////////////////////////////////// + // Cursors used by Xtreme Toolkit + //////////////////////////////////////////////////////////////////// + + HCURSOR hcurDragCopy; // Drag copy. + HCURSOR hcurDragMove; // Drag move. + HCURSOR hcurDragNone; // Drag none. + HCURSOR hcurHand; // Hand. + HCURSOR hcurHandNone; // No Hand. + HCURSOR hcurHSplitBar; // Horizontal Splitter. + HCURSOR hcurVSplitBar; // Vertical Splitter. + HCURSOR hcurMove; // 4 way move. + + //////////////////////////////////////////////////////////////////// + // System metrics for small icons. + //////////////////////////////////////////////////////////////////// + + int cxSmIcon; // cx small icon size (width). + int cySmIcon; // cy small icon size (height). + int cxSize; // Width, in pixels, of a button in a window's caption or title bar. + int cySize; // Height, in pixels, of a button in a window's caption or title bar. + int cxHThumb; // Width, in pixels, of the thumb box in a horizontal scroll bar. + int cyVThumb; // Height, in pixels, of the thumb box in a vertical scroll bar. + int cyMenuItem; // Height, in pixels, of single-line menu bar. + int nMenuAnimation; // Type of menu animation. + + //////////////////////////////////////////////////////////////////// + // Fonts used by Xtreme Toolkit + //////////////////////////////////////////////////////////////////// + + CFont font; // Default GUI font. + CFont fontBold; // Default bold GUI font. + CFont fontULine; // Default underlined GUI font. + CFont fontHCapt; // Default horizontal caption font. + CFont fontVCapt; // Default vertical caption font. + CFont fontVCaptBold; // Default vertical caption bold font. + CFont fontVCaptR; // Default vertical caption font, right aligned. + CFont fontVCaptRBold; // Default vertical caption bold font, right aligned. + + //////////////////////////////////////////////////////////////////// + // Fonts used by Xtreme Toolkit ( face name ) + //////////////////////////////////////////////////////////////////// + + CString strHorzFont; // Face name of the horizontal font used by the toolkit. + CString strVertFont; // Face name of the vertical font used by the toolkit. + + //////////////////////////////////////////////////////////////////// + // OS flags used by Xtreme Toolkit + //////////////////////////////////////////////////////////////////// + + int iComCtlVersion; // Common control dll (comctl32.dll) version information. + BOOL bWin95; // TRUE if Win 95. + BOOL bWin98; // TRUE if Win 98. + BOOL bWinNT; // TRUE if Win NT. + BOOL bWin2K; // TRUE if Win 2000. + BOOL bWinXP; // TRUE if Win XP. + BOOL bCoolMenuCompatMode; // TRUE to enable cool menu compatibility mode. + BOOL bXPMode; // TRUE to use XP style menus. + BOOL bMenuShadows; // TRUE to use shadows under the menus. + BOOL bToolBarVisualize; // TRUE to render the toolbar while dragging or resizing. + BOOL bControlBarMenus; // TRUE to display right click control bar menus. + BOOL bDockBarMenus; // TRUE to display right click dockbar menus. + BOOL bMenuRecentCommands; // TRUE to use intelligent menus to hide selected menu commands. + BOOL bShowFullAfterDelay; // TRUE to display hidden menu commands after a short delay. + BOOL bToolBarScreenTips; // TRUE to show tooltips on toolbar commands. + BOOL bToolBarAccelTips; // TRUE to add accelerator keys to toolbar tips. + BOOL bDisableFadedIcons; // TRUE to disable icons fading . + BOOL bUseSolidShadows; // TRUE to use solid shadows in Operation Systems that are not supported layered windows. + CString strINIFileName; // Name of an ini file for registry settings. + HINSTANCE hInstance; // Instance handle for resources. + + // Summary: This member function loads the cursors used by Xtreme Toolkit. + void LoadSysCursors(); + + // Summary: This member function frees cursor resources. + void FreeSysCursors(); + + // Summary: This member function creates the fonts used by Xtreme Toolkit. + void LoadSysFonts(); + + // Summary: This member function frees font resources. + void FreeSysFonts(); + + // Summary: This member function updates system colors used by Xtreme Toolkit. + void UpdateSysColors(); + + // Summary: This member function updates system metrics used by Xtreme Toolkit. + void UpdateSysMetrics(); + + // Returns: A DWORD value. + // Summary: This member function is called to retrieve the version information + // for the common control dll (comctl32.dll). + DWORD GetComCtlVersion(); + + // Input: hInst - Instance handle for resources. + // Summary: This member function is called by the library to initialize resources. + void InitResources(HINSTANCE hInst); + + // Input: pFont - Points to a valid CFont object that is used to define the fonts + // the toolkit will use. + // pVertFont - Points to a valid CFont object that is used to define the vertical + // fonts used by the toolkit. If NULL, 'pFont' will be used. + // Example:
CGUI_VisualStudioApp::CGUI_VisualStudioApp()
+    //			{
+    //			    // TODO: add construction code here,
+    //			    m_bFirstTime = true;
+    //			
+    //			    // Place all significant initialization in InitInstance
+    //			    xtAfxData.SetGlobalFont( _T( "Verdana" ) );
+    //			}
+ // Summary: Call this member function to set the font the toolkit will use. + // This member function should be called from the constructor of your + // CWinApp derived class for the fonts to be properly initialized. + void SetGlobalFont(CFont* pFont,CFont* pVertFont=NULL); + + // Input: lpszFaceName - Points to a NULL terminated string that is used to define the fonts + // the toolkit will use. + // lpszVertFaceName - Points to a NULL terminated string that is used to define the vertical + // fonts used by the toolkit. If NULL, the name defined in 'lpszFaceName' + // will be used. + // Example:
CGUI_VisualStudioApp::CGUI_VisualStudioApp()
+    //			{
+    //			    // TODO: add construction code here,
+    //			    m_bFirstTime = true;
+    //			
+    //			    // Place all significant initialization in InitInstance
+    //			    xtAfxData.SetGlobalFont( _T( "Verdana" ) );
+    //			}
+ // Summary: Call this member function to set the font the toolkit will use. + // This member function should be called from the constructor of your + // CWinApp derived class for the fonts to be properly initialized. + void SetGlobalFont(LPCTSTR lpszFaceName,LPCTSTR lpszVertFaceName=NULL); + + // Input: lpszINIFullPath - Full path to the ini file. + // Summary: Call this member function to store registry settings in an ini file + // instead of the system's registry. + void SetINIFileName(LPCTSTR lpszINIFullPath); + + // Returns: An LPCTSTR data type. + // Summary: This member function will get the full path to the ini file + // used to store registry settings. + LPCTSTR GetINIFileName(); + + // Returns: A reference to the one and only XT_AUX_DATA object. + // Example:
XT_AUX_DATA::Get().InitResources( m_hInstance );
+ // Summary: This static member function will retrieve a reference to the one + // and only XT_AUX_DATA object. You can use this function to access + // data members for the XT_AUX_DATA structure. You can also use the + // macro xtAfxData. + static XT_AUX_DATA& Get(); + + // Input: bVerNumOnly - true to return the version number only, minus "Xtreme Toolkit v". + // Returns: A NULL terminated string that indicates the version of the Xtreme Toolkit. + // Summary: Call this member function to retrieve a CString object that represents + // the current version of the Xtreme Toolkit. The string returned is + // formatted like so: "Xtreme Toolkit v1.94". + CString GetXTVersion(bool bVerNumOnly=false); + +private: + bool FontExists(CString& strFaceName); + bool CreateSysFont(XT_LOGFONT& lf, CFont& font, long lfWeight=FW_NORMAL, char lfUnderline=0, long lfOrientation=0, long lfEscapement=0); +}; + +//:Associate with "Global Data" + +// Summary: XT_AUX_DATA is a singleton object and can only be instantiated +// one time. The macro xtAfxData is used to access the members of this +// structure. +#define xtAfxData XT_AUX_DATA::Get() + +////////////////////////////////////////////////////////////////////// +// Summary: CXTIconHandle is a stand alone helper class. It is used to automatically +// destroy dynamically created hIcon handles. +class _XT_EXT_CLASS CXTIconHandle +{ +public: + + // Summary: Constructs a CXTIconHandle object. + CXTIconHandle(); + + // Input: hIcon - Handle to a dynamically created icon. + // Summary: Constructs a CXTIconHandle object. + CXTIconHandle(HICON hIcon); + + // Summary: Destroys a CXTIconHandle object, handles cleanup and de-allocation. + virtual ~CXTIconHandle(); + +protected: + + HICON m_hIcon; // Handle to a dynamically created icon. + +public: + + // Returns: An HICON handle to the icon. + // Summary: This operator is used to retrieve a handle to the icon associated with + // the CXTIconHandle object. + operator HICON() const; + + // Input: hIcon - Handle to a dynamically created icon. + // Summary: This operator is used to initialize the icon associated with the + // CXTIconHandle object. + CXTIconHandle& operator =(HICON hIcon); + + // Input: hIcon - Icon handle whose dimensions are to be retrieved. + // Returns: A CSize object. + // Summary: This member function gets the extent of an icon. + static CSize GetExtent(HICON hIcon); + + // Returns: A CSize object. + // Summary: This member function gets the extent of an icon attached to this object. + CSize GetExtent() const; + + // Input: hIcon - Icon to be fitted. + // desiredExtent - Desired icon extent. + // Returns: An icon handle. + // Summary: This member function scales an icon to fit into a rectangle. The width + // and height ration is retained as much as possible. The caller assumes + // ownership of the returned icon handle. + static HICON ScaleToFit(HICON hIcon,CSize desiredExtent); + + // Input: desiredExtent - Desired icon extent. + // Returns: An icon handle. + // Summary: This member function scales an icon to fit into a rectangle. The width + // and height ration is retained as much as possible. The caller assumes + // ownership of the returned icon handle. + HICON ScaleToFit(CSize desiredExtent) const; + +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTLoadLibrary is a stand alone utility class. It is used to load a +// module (DLL) and free the instance handle upon destruction. It wraps +// the LoadLibrary and the FreeLibrary API's. +class _XT_EXT_CLASS CXTLoadLibrary +{ +public: + + // Input: lpszModule - Pointer to a null-terminated string that names the .DLL file. The + // name specified is the filename of the module and is not related to + // the name stored in the library module itself, as specified by the + // LIBRARY keyword in the module-definition (.DEF) file. + // + // If the string specifies a path but the file does not exist in + // the specified directory, the function fails. When specifying a path, + // be sure to use backslashes (\), not forward slashes (/). + // Summary: Constructs a CXTLoadLibrary object. + CXTLoadLibrary(LPCTSTR lpszModule=NULL); + + // Summary: Destroys a CXTLoadLibrary object, handles cleanup and de-allocation. + virtual ~CXTLoadLibrary(); + +protected: + + HINSTANCE m_hInstance; // A handle to the module indicates success. + +public: + + // Input: lpszModule - Pointer to a null-terminated string that names the .DLL file. The + // name specified is the filename of the module and is not related to + // the name stored in the library module itself, as specified by the + // LIBRARY keyword in the module-definition (.DEF) file. + // + // If the module does not exist in the specified directory, the + // function will fail. When specifying a path, be sure to use backslashes + // (\), not forward slashes (/). + // Summary: This member function is called to load the library specified by + // 'lpszModule'. Once the library is loaded, you can retrieve the instance + // handle by using the HINSTANCE operator. + void LoadLibrary(LPCTSTR lpszModule); + + // Returns: A handle to the module if successful, otherwise returns NULL. + // Summary: This overloaded operator returns a handle to the module indicating + // success. NULL indicates failure. + operator HINSTANCE() const; + + // Returns: A DWORD value if successful, otherwise 0L. + // Summary: Use this member function to return the version number of the + // module attached to this CLoadLibrary object. The high-order + // word of the return value represents the major version number and + // the low-order word of the returned value represents the minor + // version number. + DWORD GetModuleVersion(); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTLoadLibrary::operator HINSTANCE() const { + return m_hInstance; +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTNoFlickerWnd is a BASE_CLASS derived general purpose template helper +// class. CXTNoFlickerWnd class is used for drawing flicker free controls. +// To use, instantiate the template using any CWnd derived class. For example, +// to create a tab control that is flicker free you would use the +// following declaration: +// +//
CXTNoFlickerWnd  m_tabCtrl;
+template +class CXTNoFlickerWnd : public BASE_CLASS +{ +public: + + // Summary: Constructs a CXTNoFlickerWnd object. + inline CXTNoFlickerWnd() {m_crBack = xtAfxData.clr3DFace;} + + // Input: crBack - An RGB value. + // Summary: This member function is called to set the background fill + // color for the flicker free control. + inline void SetBackColor(COLORREF crBack) {m_crBack = crBack;} + + // Returns: An RGB value. + // Summary: This member function is called to retrieve the background fill color + // for the flicker free control. + inline COLORREF GetBackColor() { + return m_crBack; // An RGB value. + } + +protected: + + COLORREF m_crBack; // An RGB value. + + // Input: message - Specifies the Windows message to be processed. + // wParam - Provides additional information used in processing the message. The + // parameter value depends on the message. + // lParam - Provides additional information used in processing the message. The + // parameter value depends on the message. + // Returns: The return value depends on the message. + // Summary: This method provides a CE procedure (WindowProc) for a CWnd object. + // It dispatches messages through the window message map. + virtual LRESULT WindowProc(UINT message,WPARAM wParam,LPARAM lParam) + { + switch (message) + { + case WM_PAINT: + { + CPaintDC dc(this); + + // Get the client rect, and paint to a memory device context. This + // will help reduce screen flicker. Pass the memory device context to the + // default window procedure to do default painting. + + CRect r; + GetClientRect(&r); + CXTMemDC memDC(&dc, r, m_crBack); + + return BASE_CLASS::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 ); + } + + case WM_ERASEBKGND: + { + return TRUE; + } + } + + return BASE_CLASS::WindowProc(message, wParam, lParam); + } +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTDialogState is a stand alone class. It is an internal class used +// by toolkit dialogs to manage resource context. +class CXTDialogState +{ +protected: + + // Summary: Constructs a CXTDialogState object. + CXTDialogState(); + + // Summary: Destroys a CXTDialogState object, handles cleanup and de-allocation. + ~CXTDialogState(); + + // Summary: Restores the application resource context. Should be used within + // the derived class's constructor. + void RevertResourceContext(); + + class CXTManageState *m_pState; // A pointer is used so we don't have to include the definition of the private CXTManageState in a public header +}; + +#if _MSC_VER < 1200 // MFC 5.0 + +///////////////////////////////////////////////////////////////////////////// +// CXTString class is for VC5 CString compatibility only. + +class _XT_EXT_CLASS CXTString : public CString +{ +public: + + CXTString() { } + CXTString(CString strIn); + int Find(LPCTSTR lpszSub, int nStart) const; + int Find( TCHAR ch ) const { return CString::Find(ch); } + int Find( LPCTSTR lpszSub ) const { return CString::Find(lpszSub); } + int Insert(int nIndex, TCHAR ch); + int Insert(int nIndex, LPCTSTR pstr); + const CString& operator =( const CString& stringSrc ) { return CString::operator =(stringSrc); } + const CString& operator =( TCHAR ch ) { return CString::operator =(ch); } + const CString& operator =( const unsigned char* psz ) { return CString::operator =(psz); } + const CString& operator =( LPCWSTR lpsz ) { return CString::operator =(lpsz); } + const CString& operator =( LPCSTR lpsz ) { return CString::operator =(lpsz); } + int Remove(TCHAR chRemove); + int Replace(TCHAR chOld, TCHAR chNew); + int Replace(LPCTSTR lpszOld, LPCTSTR lpszNew); + int Delete(int nIndex, int nCount=1); + CXTString Left(int nCount) const; +}; + +#else + +typedef CString CXTString; + +#endif // MFC 5.0 + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTGLOBALS_H__) diff --git a/Editor/XT/Include/XTHexEdit.h b/Editor/XT/Include/XTHexEdit.h new file mode 100644 index 0000000..81c628e --- /dev/null +++ b/Editor/XT/Include/XTHexEdit.h @@ -0,0 +1,427 @@ +// XTHexEdit.h interface for the CXTHexEdit class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +//-------------------------------------------------------------------- +// Based on the code created by Andreas Saurwein +// mailto:saurwein@uniwares.de +//-------------------------------------------------------------------- +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTHEXEDIT_H__) +#define __XTHEXEDIT_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTHexEdit is a CEdit derived class. It is used to create an edit control +// which will allow editing in hex display format. +class _XT_EXT_CLASS CXTHexEdit : public CEdit +{ + DECLARE_DYNAMIC(CXTHexEdit) + +public: + + // Summary: Constructs a CXTHexEdit object. + CXTHexEdit(); + + // Summary: Destroys a CXTHexEdit object, handles cleanup and de-allocation. + virtual ~CXTHexEdit(); + +public: + + // Summary: Enumerated value that represents the current editing mode. + enum EDITMODE + { + EDIT_NONE, // No editing mode specified. + EDIT_ASCII, // ASCII editing mode. + EDIT_HIGH, // High editing mode. + EDIT_LOW // Low editing mode. + }; + + int m_nLength; // Length of data. + int m_nTopIndex; // Offset of first visible byte on the screen. + int m_nCurrentAddress; // Address under the cursor. + int m_nSelStart; // Start address of the selection. + int m_nSelEnd; // End address of the selection. + int m_nBytePerRow; // Bytes per row. + int m_nLinesPerPage; // Lines per page. + int m_nLineHeight; // Height, in pixels, of a single line displayed in the control. + int m_nNullWidth; // Width, in pixels, of a single character displayed in the control (uniform width). + int m_nOffHex; // Internally used value - X position where hex part starts. + int m_nOffAscii; // Internally used value - X position where ASCII part starts. + int m_nOffAddress; // Internally used value - X position where address part starts. + bool m_bAllowDeletes; // A boolean value indicating whether or not deletions are allowed. + BOOL m_bDynamicBPR; // Calculate bytes-per-row dynamically. + BOOL m_bShowAddress; // TRUE when showing the address part. + BOOL m_bShowAscii; // TRUE when showing the ASCII part. + BOOL m_bShowHex; // TRUE when showing the hex part. + BOOL m_bAddressIsWide; // 4/8 byte address. + BOOL m_bUpdate; // Value used internally to indicate that the font and size info need to be updated on the next paint cycle. + UINT m_nMaxLength; // Maximum size of data. + DWORD m_dwBaseAddress; // Base address for data. + CPoint m_ptEditPos; // Current caret position. + LPBYTE m_pData; // Pointer to data. + EDITMODE m_eEditMode; // Current editing mode: address/hex/ASCII. + +protected: + + BOOL m_bShowCaret; // TRUE to display a flashing caret at the current caret position. + CSize m_szCaret; // Current size of caret. + CFont m_fontHex; // Represents the default font used by the hex edit control. + COLORREF m_crBack; // RGB value that represents the background color of the hex edit control. + COLORREF m_crText; // RGB value that represents the text color of the hex edit control. + COLORREF m_crDisabledBack; // RGB value that represents the disabled background color for the hex edit control. + COLORREF m_crDisabledText; // RGB value that represents the disabled text color of the hex edit control. + COLORREF m_crHighlightText; // RGB value that represents the highlighted text color of the hex edit control. + COLORREF m_crHighlightBack; // RGB value that represents the highlighted background color of the hex edit control. + COLORREF m_crDisabledHighlightText; // RGB value that represents the disabled highlighted text color of the hex edit control. + COLORREF m_crDisabledHighlightBack; // RGB value that represents the disabled highlighted background color of the hex edit control. + +public: + + // Ignore: + //{{AFX_VIRTUAL(CXTHexEdit) + public: + virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); + protected: + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + //}}AFX_VIRTUAL + +public: + + // Returns: An RGB value that represents the current background color for the control. + // Summary: Call this member function to return the current background color for + // the hex edit control. The current background color depends on the + // enabled, disabled, or read-only state of the control. + COLORREF GetActualBackColor(); + + // Returns: An RGB value that represents the current text color for the control. + // Summary: Call this member function to return the current text color for the hex + // edit control. The current text color depends on the enabled, disabled, + // or read-only state of the control. + COLORREF GetActualTextColor(); + + // Returns: An RGB value that represents the current highlight background + // color for the control. + // Summary: Call this member function to return the current highlight background + // color for the hex edit control. The current highlight background color + // depends on the enabled, disabled, or read-only state of the control. + COLORREF GetActualHighlightBackColor(); + + // Returns: An RGB value that represents the current highlight text color for the + // control. + // Summary: Call this member function to return the current highlight text color + // for the hex edit control. The current highlight text color depends + // on the enabled, disabled, or read-only state of the control. + COLORREF GetActualHighlightTextColor(); + + // Input: crBack - An RGB value that represents the background color of the hex edit + // control. + // Summary: Call this member function to set the background color for the hex edit + // control. + void SetBackColor(COLORREF crBack); + + // Returns: An RGB value that represents the current background color for the hex edit + // control. + // Summary: Call this member function to retrieve the current background color + // for the hex edit control. + COLORREF GetBackColor(); + + // Input: crText - An RGB value that represents the text color of the hex edit control. + // Summary: Call this member function to set the text color for the hex edit control. + void SetTextColor(COLORREF crText); + + // Returns: An RGB value that represents the current text color for the hex edit control. + // Summary: Call this member function to retrieve the current text color for the + // hex edit control. + COLORREF GetTextColor(); + + // Input: crDisabledBack - An RGB value that represents the disabled background color of the + // hex edit control. + // Summary: Call this member function to set the disabled background color for + // the hex edit control. + void SetDisabledBackColor(COLORREF crDisabledBack); + + // Returns: An RGB value that represents the current disabled background color for the hex + // edit control. + // Summary: Call this member function to retrieve the current disabled background + // color for the hex edit control. + COLORREF GetDisabledBackColor(); + + // Input: crDisabledText - An RGB value that represents the disabled text color of the hex edit + // control. + // Summary: Call this member function to set the disabled text color for the hex + // edit control. + void SetDisabledTextColor(COLORREF crDisabledText); + + // Returns: An RGB value that represents the current disabled text color for the hex + // edit control. + // Summary: Call this member function to retrieve the current disabled text color + // for the hex edit control. + COLORREF GetDisabledTextColor(); + + // Input: crHighlightText - An RGB value that represents the highlighted text color of the hex + // edit control. + // Summary: Call this member function to set the highlighted text color for the + // hex edit control. + void SetHighlightTextColor(COLORREF crHighlightText); + + // Returns: An RGB value that represents the current highlighted text color for the + // hex edit control. + // Summary: Call this member function to retrieve the current highlighted text + // color for the hex edit control. + COLORREF GetHighlightTextColor(); + + // Input: crHighlight - An RGB value that represents the highlight background color of the + // hex edit control. + // Summary: Call this member function to set the highlight background color for + // the hex edit control. + void SetHighlightBackColor(COLORREF crHighlight); + + // Returns: An RGB value that represents the current highlight background color for the + // hex edit control. + // Summary: Call this member function to retrieve the current highlight background + // color for the hex edit control. + COLORREF GetHighlightBackColor(); + + // Input: crDisabledHighlightText - An RGB value that represents the disabled highlight + // text color of the hex edit control. + // Summary: Call this member function to set the disabled highlight text color for + // the hex edit control. + void SetDisabledHighlightTextColor(COLORREF crDisabledHighlightText); + + // Returns: An RGB value that represents the current disabled highlight text color + // for the hex edit control. + // Summary: Call this member function to retrieve the current disabled highlight + // text color for the hex edit control. + COLORREF GetDisabledHighlightTextColor(); + + // Input: crDisabledHighlight - An RGB value that represents the disabled highlight background color + // of the hex edit control. + // Summary: Call this member function to set the disabled highlight background + // color for the hex edit control. + void SetDisabledHighlightBackColor(COLORREF crDisabledHighlight); + + // Returns: An RGB value that represents the current disabled highlight background color + // for the hex edit control. + // Summary: Call this member function to retrieve the current disabled highlight + // background color for the hex edit control. + COLORREF GetDisabledHighlightBackColor(); + + // Summary: This member function sets the font for the hex edit control to the + // default "Courier New" font. + void RestoreDefaultFont(); + + // Input: pFont - Points to a valid CFont object. + // Summary: This member function sets the font used by the hex edit control. + void SetHexFont(CFont* pFont); + + // Input: pLogFont - Points to a valid LOGFONT structure. + // Summary: This member function sets the font used by the hex edit control. + void SetHexFont(LOGFONT* pLogFont); + + // Input: bEnable - true to enable caret, false to disable. + // Summary: This member function enables or disables a flashing screen caret. + void EnableCaret(bool bEnable); + + // Input: bVertical - true to display vertical scroll bar. + // bHorizontal - true to display horizontal scroll bar. + // Summary: This member function enables or disables a vertical and horizontal scroll + // bar display. + void EnableScrollBars(bool bVertical,bool bHorizontal); + + // Input: dwBase - DWORD value that represents the base address. + // Returns: A DWORD value. + // Summary: Call this member function to set the base address for the hex edit + // control. + DWORD SetAddressBase(DWORD dwBase); + + // Input: pData - Pointer to the buffer that will be receiving the data. + // nBufferLength - Length of the target data buffer. + // Returns: The length of the data. + // Summary: Call this method to extract the data in the hex edit control. + int GetData(LPBYTE pData,int nBufferLength); + + // Input: pData - Pointer to a buffer that contains the initial data for the control. + // nLength - Length of the data buffer. + // nMaxLength - Optional maximum length that the buffer can grow, or -1 if you + // want to allow the buffer to grow indefinitely. + // Summary: Call this member function to initialize the hex edit control with data + // specified by 'pData'. + void SetData(LPBYTE pData,int nLength,int nMaxLength = 0); + + // Input: bVal - The new value for this setting. + // Returns: The previous value. + // Summary: Call this method to allow or disallow the deletion of characters + // within the control. For instance, calling SetAllowDeletes(false) will + // disable the delete, backspace, and other such keys. + bool SetAllowDeletes(bool bVal = true); + + // Returns: true if the Allow Deletes setting is enabled, or false if it is disabled. + // Summary: This member function retrieves the current value of the Allow Deletes + // setting. + // See Also: SetAllowDeletes + bool GetAllowDeletes() const; + + // Returns: A CSize object. + // Summary: Call this member function to get the size of the current selection. + CSize GetSel(); + + // Input: nSelStart - Represents the position of the first character in the selection. + // nSelEnd - Represents the position of the last character in the selection. + // Summary: Call this member function to set the current selection. + void SetSel(int nSelStart,int nSelEnd); + + // Input: nBytePerRow - Represents the number of bytes to display. + // Summary: Call this member function to set the number of bytes per row. + void SetBPR(int nBytePerRow); + + // Input: bShowAddress - TRUE to display the address value. + // bShowHex - TRUE to display the hex value. + // bShowAscii - TRUE to display the ASCII value. + // bAddressIsWide - TRUE if the display is 8 byte, FALSE for 4 byte display. + // Summary: Call this member function to set the display options for the hex edit + // control. + void SetOptions(BOOL bShowAddress,BOOL bShowHex,BOOL bShowAscii,BOOL bAddressIsWide); + +protected: + + void ScrollIntoView(int pData); + void RepositionCaret(int pData); + void Move(int x, int y); + BOOL IsSelected(); + void UpdateScrollbars(); + void CreateEditCaret(); + void CreateAddressCaret(); + CPoint CalcPos(int x, int y); + void SelInsert(int nSelStart, int nLength); + void SelDelete(int nSelStart, int nSelEnd); + void NormalizeSel(); + void RecalcBPR(); + void DoVScroll(UINT nSBCode, bool bMoveCaret); + + // Ignore: + //{{AFX_MSG(CXTHexEdit) + afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg void OnPaint(); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg UINT OnGetDlgCode(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnContextMenu(CWnd*, CPoint point); + afx_msg void OnEditClear(); + afx_msg void OnEditCopy(); + afx_msg void OnEditCut(); + afx_msg void OnEditPaste(); + afx_msg void OnEditSelectAll(); + afx_msg void OnEditUndo(); + afx_msg void OnNcPaint(); + afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE UINT CXTHexEdit::OnGetDlgCode() { + return DLGC_WANTALLKEYS; +} +AFX_INLINE void CXTHexEdit::SetOptions(BOOL bShowAddress, BOOL bShowHex, BOOL bShowAscii, BOOL bAddressIsWide) { + m_bShowHex = bShowHex; m_bShowAscii = bShowAscii; m_bShowAddress = bShowAddress; m_bAddressIsWide = bAddressIsWide; m_bUpdate = TRUE; RepositionCaret(m_nCurrentAddress); +} +AFX_INLINE void CXTHexEdit::SetBPR(int nBytePerRow) { + m_nBytePerRow = nBytePerRow; m_bUpdate = TRUE; RepositionCaret(m_nCurrentAddress); +} +AFX_INLINE BOOL CXTHexEdit::IsSelected() { + return m_nSelStart != 0xffffffff; +} +AFX_INLINE CSize CXTHexEdit::GetSel() { + return CSize(m_nSelStart, m_nSelEnd); +} +AFX_INLINE int CXTHexEdit::GetData(LPBYTE pData, int nLength) { + memcpy(pData, m_pData, __min(nLength, m_nLength)); return m_nLength; +} +AFX_INLINE void CXTHexEdit::SetBackColor(COLORREF crBack) { + m_crBack = crBack; +} +AFX_INLINE void CXTHexEdit::SetTextColor(COLORREF crText) { + m_crText = crText; +} +AFX_INLINE void CXTHexEdit::SetDisabledBackColor(COLORREF crDisabledBack) { + m_crDisabledBack = crDisabledBack; +} +AFX_INLINE void CXTHexEdit::SetDisabledTextColor(COLORREF crDisabledText) { + m_crDisabledText = crDisabledText; +} +AFX_INLINE void CXTHexEdit::SetHighlightTextColor(COLORREF crHighlightText) { + m_crHighlightText = crHighlightText; +} +AFX_INLINE void CXTHexEdit::SetHighlightBackColor(COLORREF crHighlightBack) { + m_crHighlightBack = crHighlightBack; +} +AFX_INLINE void CXTHexEdit::SetDisabledHighlightTextColor(COLORREF crDisabledHighlightText) { + m_crDisabledHighlightText = crDisabledHighlightText; +} +AFX_INLINE void CXTHexEdit::SetDisabledHighlightBackColor(COLORREF crDisabledHighlightBack) { + m_crDisabledHighlightBack = crDisabledHighlightBack; +} +AFX_INLINE COLORREF CXTHexEdit::GetBackColor() { + return m_crBack; +} +AFX_INLINE COLORREF CXTHexEdit::GetTextColor() { + return m_crText; +} +AFX_INLINE COLORREF CXTHexEdit::GetDisabledBackColor() { + return m_crDisabledBack; +} +AFX_INLINE COLORREF CXTHexEdit::GetDisabledTextColor() { + return m_crDisabledText; +} +AFX_INLINE COLORREF CXTHexEdit::GetHighlightTextColor() { + return m_crHighlightText; +} +AFX_INLINE COLORREF CXTHexEdit::GetHighlightBackColor() { + return m_crHighlightBack; +} +AFX_INLINE COLORREF CXTHexEdit::GetDisabledHighlightTextColor() { + return m_crDisabledHighlightText; +} +AFX_INLINE COLORREF CXTHexEdit::GetDisabledHighlightBackColor() { + return m_crDisabledHighlightBack; +} +AFX_INLINE void CXTHexEdit::EnableCaret(bool bEnable) { + m_bShowCaret = bEnable; +} + +AFX_INLINE bool CXTHexEdit::SetAllowDeletes(bool bVal) { + const bool bOldVal = m_bAllowDeletes; m_bAllowDeletes = bVal; return bOldVal; +} + +AFX_INLINE bool CXTHexEdit::GetAllowDeletes() const { + return m_bAllowDeletes; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTHEXEDIT_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTHtmlView.h b/Editor/XT/Include/XTHtmlView.h new file mode 100644 index 0000000..ee14b66 --- /dev/null +++ b/Editor/XT/Include/XTHtmlView.h @@ -0,0 +1,791 @@ +// XTHtmlView.h interface for the CXTHtmlView class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTHTMLVIEW_H__) +#define __XTHTMLVIEW_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTHtmlView is a CFormView derived class. The CXTHtmlView class provides +// the functionality of the WebBrowser control within the context of MFC's +// document/view architecture. The WebBrowser control is a window in which +// the user can browse sites on the World Wide Web, as well as folders +// in the local file system and on a network. The WebBrowser control supports +// hyperlinking, Uniform Resource Locator (URL) navigation, and maintains +// a history list. +// +// Using the CXTHtmlView Class in an MFC Application +// +// In the standard MFC framework application (either SDI or MDI based), +// the view object is commonly derived from a specialized set of classes. +// These classes, all derived from CView, provide specialized functionality +// beyond that provided by CView. +// +// Basing the application's view class on CXTHtmlView provides the view +// with the WebBrowser control. This effectively makes the application +// a web browser. The preferred method of creating a web browser-style +// application is to use the MFC AppWizard, and specify CXTHtmlView as +// the view class. For more information on implementing and using the +// WebBrowser control within MFC applications, see Web Browser-Style Applications. +// +// The functionality of CXTHtmlView is designed for applications that access +// the Web (and/or HTML documents). The following CXTHtmlView member functions +// apply to the Internet Explorer application only. These functions will +// succeed on the WebBrowser control, but they will have no visible effect. +class _XT_EXT_CLASS CXTHtmlView : public CFormView +{ + DECLARE_DYNCREATE(CXTHtmlView) + DECLARE_EVENTSINK_MAP() + +protected: + + // Summary: Constructs a CXTHtmlView object. + CXTHtmlView(); + + // Summary: Destroys a CXTHtmlView object, handles cleanup and de-allocation. + virtual ~CXTHtmlView(); + + bool m_bLoading; // true when loading the browser. + bool m_bLoadingMessage; // true to display a loading message while a page is updating. + CString m_strLoading; // Loading message string. + IWebBrowser2* m_pBrowserApp; // Points to the IWebBrowser2 object associated with this view. + +public: + + CWnd m_wndBrowser; // CWnd object that represents the internet browser control associated with this view. + + // Returns: A CString object containing the type name of the contained active document. + // Summary: Call this member function to retrieve the type name of the contained + // active document. Applies to Internet Explorer and WebBrowser. + CString GetType() const; + + // Returns: The left-edge distance, in pixels. + // Summary: Call this member function to retrieve the distance between the internal + // left edge of the WebBrowser control and the left edge of its container. + // Applies to Internet Explorer and WebBrowser. + long GetLeft() const; + + // Input: nNewValue - The screen coordinate of the left edge of the main window. + // Summary: Call this member function to set the horizontal position of the Internet + // Explorer main window. + void SetLeft(long nNewValue); + + // Returns: The address of a variable that receives the screen coordinate of the main + // window's top edge. + // Summary: Call this member function to retrieve the screen coordinate of the + // top edge of the WebBrowser control’s main window. Applies to Internet + // Explorer and WebBrowser. + long GetTop() const; + + // Input: nNewValue - The screen coordinate of the top edge of the main window. + // Summary: Call this member function to set the distance between the internal top edge + // of the WebBrowser control and the top edge of its container. Applies to + // Internet Explorer and WebBrowser. + void SetTop(long nNewValue); + + // Returns: The control’s frame window height, in pixels. + // Summary: Call this member function to retrieve the height, in pixels, of the + // WebBrowser control’s frame window. + long GetHeight() const; + + // Input: nNewValue - The height, in pixels, of the main window. + // Summary: Call this member function to set the height of the Internet Explorer + // main window. Applies to Internet Explorer and WebBrowser. + void SetHeight(long nNewValue); + + // Input: bNewValue - Nonzero if the control is visible, otherwise zero. + // Summary: Call this member function to set the visibility state of the WebBrowser + // control. Applies to Internet Explorer and WebBrowser. + void SetVisible(BOOL bNewValue); + + // Returns: Nonzero if the object is visible, otherwise returns zero. + // Summary: Call this member function to determine if the contained object is visible. + // Applies to Internet Explorer and WebBrowser. + BOOL GetVisible() const; + + // Returns: A CString object containing the name of the resource currently + // displayed in the WebBrowser. + // Summary: Call this member function to get the name of the resource being displayed + // in the WebBrowser. If the resource is an HTML page on the World Wide + // Web, the name is the title of that page. If the resource is a folder + // or file on the network or local computer, the name is the UNC or full + // path of the folder or file. Applies to Internet Explorer and WebBrowser. + CString GetLocationName() const; + + // Returns: A READYSTATE value, as described in the Platform SDK. + // Summary: Call this member function to retrieve the ready state of the WebBrowser + // object. Applies to Internet Explorer and WebBrowser. + READYSTATE GetReadyState() const; + + // Returns: Nonzero if the web browser is currently offline, otherwise returns zero. + // Summary: Call this member function to determine whether the web browser is operating + // offline. Applies to Internet Explorer and WebBrowser. + BOOL GetOffline() const; + + // Input: bNewValue - Nonzero to read from the local cache, otherwise zero. + // Summary: Call this member function to set a value indicating whether the WebBrowser + // control is currently operating in offline mode. In offline mode, the + // browser reads HTML pages from the local cache rather than from the + // source document. Applies to Internet Explorer and WebBrowser. + void SetOffline(BOOL bNewValue); + + // Returns: Nonzero if dialog boxes cannot be displayed from + // the WebBrowser control, otherwise returns zero. + // Summary: Call this member function to determine whether any dialog boxes can + // be shown in the WebBrowser control. Applies to Internet Explorer and + // WebBrowser. + BOOL GetSilent() const; + + // Input: bNewValue - If nonzero, dialog boxes will not be displayed. If zero, dialog boxes + // will be displayed. The default value is zero. + // Summary: Call this member function to set a value indicating whether any dialog + // boxes can be shown. Applies to Internet Explorer and WebBrowser. + void SetSilent(BOOL bNewValue); + + // Returns: Nonzero if the container is the top-level container, otherwise returns zero. + // Summary: Call this member function to determine whether Internet Explorer is + // the top-level container of the WebBrowser control. Applies to Internet + // Explorer and WebBrowser. + BOOL GetTopLevelContainer() const; + + // Returns: A CString object containing the URL of the resource currently displayed in + // the WebBrowser. + // Summary: Call this member function to retrieve the URL of the resource that + // the WebBrowser control is currently displaying. If the resource is + // a folder or file on the network or local computer, the name is the + // UNC or full path of the folder or file. Applies to Internet Explorer + // and WebBrowser. + CString GetLocationURL() const; + + // Returns: Nonzero if the web browser is busy, otherwise returns zero. + // Summary: Call this member function to determine whether the WebBrowser control + // is engaged in a navigation or downloading operation. Applies to Internet + // Explorer and WebBrowser. + BOOL GetBusy() const; + + // Returns: A pointer to the IDispatch interface of the active document object. + // Summary: Call this member function to retrieve the automation object supported + // by the application that contains the WebBrowser control. Applies to + // Internet Explorer and WebBrowser. + LPDISPATCH GetApplication() const; + + // Returns: A pointer to the IDispatch interface of the object that is + // the parent of the WebBrowser control. + // Summary: Call this member function to retrieve a pointer to the parent object + // of the WebBrowser control. Applies to Internet Explorer and WebBrowser. + LPDISPATCH GetParentBrowser() const; + + // Returns: A pointer to the IDispatch interface of the active document object. + // Summary: Call this member function to retrieve an object that points to the + // container of the web browser. Applies to Internet Explorer and WebBrowser. + LPDISPATCH GetContainer() const; + + // Returns: A pointer to the IDispatch interface of the active document object. + // Summary: Call this member function to retrieve the HTML document for the active + // document. Applies to Internet Explorer and WebBrowser. + LPDISPATCH GetHtmlDocument() const; + + // Returns: A CString object containing the path and name of the currently displayed + // file. If no path and filename exist, GetFullName returns an empty CString. + // Summary: Call this member function to retrieve the full path of the file that + // Internet Explorer is currently displaying. Applies to Internet Explorer. + // If you use this call with a WebBrowser control, it will return no error, + // but it will ignore this call. + CString GetFullName() const; + + // Returns: A value indicating whether the toolbar is visible. Nonzero + // if the toolbar is visible, otherwise zero. + // Summary: Call this member function to determine whether the toolbar is visible. + int GetToolBar() const; + + // Input: nNewValue - Indicates whether to display the toolbar. Nonzero if the toolbar + // is to be displayed, otherwise zero. + // Summary: Call this member function to show or hide the Internet Explorer toolbar. + // Applies to Internet Explorer. If you use this call with a WebBrowser + // control, it will not return an error, but it will ignore this call. + void SetToolBar(int nNewValue); + + // Returns: Nonzero if the menu bar is visible, otherwise returns zero. + // Summary: Call this member function to determine whether the menu bar is visible. + // Applies to Internet Explorer and WebBrowser. + BOOL GetMenuBar() const; + + // Input: bNewValue - Nonzero to show the menu bar, otherwise zero. + // Summary: Call this member function to show or hide the Internet Explorer menu bar. + // Applies to Internet Explorer. If you use this call with a WebBrowser + // control, it will not return an error, but it will ignore this call. + void SetMenuBar(BOOL bNewValue); + + // Returns: Nonzero if the WebBrowser is operating in full-screen mode, otherwise + // returns zero. + // Summary: Call this member function to determine whether the WebBrowser control + // is operating in full-screen mode or in normal window mode. In full-screen + // mode, the Internet Explorer main window is maximized and the status + // bar, toolbar, menu bar, and title bar are hidden. Applies to Internet + // Explorer and WebBrowser. + BOOL GetFullScreen() const; + + // Input: bNewValue - Nonzero for full-screen mode, otherwise zero. + // Summary: Call this member function to set Internet Explorer to either full-screen + // or normal window mode. In full-screen mode, the Internet Explorer + // main window is maximized and the status bar, toolbar, menu bar, and + // title bar are hidden. Applies to Internet Explorer. If you use this + // call with a WebBrowser control, it will not return an error, but it will + // ignore this call. + void SetFullScreen(BOOL bNewValue); + + // Input: cmdID - The OLECMDID value of the command for which the caller needs status + // information. + // Returns: The address of the OLECMDF value that receives the status of the command. + // Summary: Call this member function to query a command status. QueryStatusWB + // implements the behavior of the IOleCommandTarget::QueryStatus method. + // Applies to Internet Explorer and WebBrowser. + OLECMDF QueryStatusWB(OLECMDID cmdID) const; + + // Returns: Nonzero if the browser is registered as a top-level browser, otherwise + // returns zero. + // Summary: Call this member function to determine whether the WebBrowser object + // is registered as a top-level browser for target name resolution. Applies + // to Internet Explorer and WebBrowser. + BOOL GetRegisterAsBrowser() const; + + // Input: bNewValue - Determines whether Internet Explorer is registered as a top-level + // browser. If nonzero, the web browser is registered as a top-level + // browser. If zero, it is not a top-level browser. The default value + // is zero. + // Summary: Call this member function to set a value indicating whether the WebBrowser + // control is registered as a top-level browser for target name resolution. + // A top-level browser is the browser set in the registry as the default + // browser. Applies to Internet Explorer and WebBrowser. + void SetRegisterAsBrowser(BOOL bNewValue); + + // Returns: Nonzero if the browser is registered as a drop target, otherwise returns zero. + // Summary: Call this member function to determine whether the WebBrowser control + // is registered as a drop target for navigation. Applies to Internet + // Explorer and WebBrowser. + BOOL GetRegisterAsDropTarget() const; + + // Input: bNewValue - Determines if the WebBrowser control is registered as a drop target + // for navigation. If nonzero, the object is registered as a drop target. + // If zero, it is not a drop target. + // Summary: Call this member function to set a value indicating whether the WebBrowser + // control is registered as a drop target for navigation. Applies to + // Internet Explorer and WebBrowser. + void SetRegisterAsDropTarget(BOOL bNewValue); + + // Returns: Nonzero if the web browser is in theater mode, otherwise returns zero. + // Summary: Call this member function to determine whether the web browser is in + // theater mode. When the web browser is in theater mode, the browser + // main window fills the entire screen, a toolbar with a minimal set of + // navigational tools appears, and the status bar appears in the upper + // right-hand corner of the screen. Applies to Internet Explorer and + // WebBrowser. + BOOL GetTheaterMode() const; + + // Input: bNewValue - Nonzero to set the WebBrowser control to theater mode, otherwise zero. + // The default value is zero. + // Summary: Call this member function to set a value indicating whether the WebBrowser + // control is in theater mode. When the web browser is in theater mode, + // the browser main window fills the entire screen, a toolbar with a minimal + // set of navigational tools appears, and the status bar appears in the + // upper right-hand corner of the screen. Applies to Internet Explorer + // and WebBrowser. + void SetTheaterMode(BOOL bNewValue); + + // Returns: Nonzero if the address bar is visible, otherwise returns zero. + // Summary: Call this member function to retrieve Internet Explorer’s address bar. + // Applies to Internet Explorer. If you use this call with a WebBrowser + // control, it will return no error, but it will ignore this call. + BOOL GetAddressBar() const; + + // Input: bNewValue - Nonzero to show address bar, otherwise zero. + // Summary: Call this member function to show or hide the Internet Explorer object's + // address bar. Applies to Internet Explorer. If you use this call with + // a WebBrowser control, it will return no error, but it will ignore this + // call. + void SetAddressBar(BOOL bNewValue); + + // Returns: Nonzero if the status bar can be displayed, otherwise returns zero. + // Summary: Call this member function to determine whether the WebBrowser control + // displays a status bar. Applies to Internet Explorer. If you use this + // call with a WebBrowser control, it will return no error, but it will + // ignore this call. + BOOL GetStatusBar() const; + + // Input: bNewValue - Nonzero if the status bar is visible, otherwise zero. + // Summary: Call this member function to display the status bar. Applies to Internet + // Explorer. If you use this call with a WebBrowser control, it will + // return no error, but it will ignore this call. + void SetStatusBar(BOOL bNewValue); + + // Summary: This member function navigates backward one item in the history list. + // Applies to Internet Explorer and WebBrowser. + void GoBack(); + + // Summary: This member function navigates forward one item in the history list. + // Applies to Internet Explorer and WebBrowser. + void GoForward(); + + // Summary: This member function navigates to the current home or start page specified + // in the Internet Explorer Internet Options dialog box or the Internet + // Properties dialog box, accessed from the Control Panel. Applies to + // Internet Explorer and WebBrowser. + void GoHome(); + + // Summary: This member function navigates to the current search page, as specified + // in the Internet Explorer Internet Options dialog box or the Internet + // Properties dialog box, accessed from the Control Panel. Applies to + // Internet Explorer and WebBrowser. + void GoSearch(); + + // Input: URL - A caller-allocated string that contains the URL to navigate to, or + // the full path of the file to display. + // dwFlags - The flags of a variable that specifies whether to add the resource + // to the history list, whether to read to or write from the cache, and + // whether to display the resource in a new window. The variable can + // be a combination of the values defined by the BrowserNavConstants + // enumeration. + // lpszTargetFrameName - A pointer to a string that contains the name of the frame in which + // to display the resource. + // lpszHeaders - A pointer to a value that specifies the HTTP headers to send to the + // server. These headers are added to the default Internet Explorer + // headers. The headers can specify such things as the action required + // of the server, the type of data being passed to the server, or a status + // code. This parameter is ignored if the URL is not an HTTP URL. + // lpvPostData - A pointer to the data to send with the HTTP POST transaction. For + // example, the POST transaction is used to send data gathered by an + // HTML form. If this parameter does not specify any post data, Navigate + // issues an HTTP GET transaction. This parameter is ignored if the URL + // is not an HTTP URL. + // dwPostDataLen - Data to send with the HTTP POST transaction. For example, the POST + // transaction is used to send data gathered by an HTML form. If this + // parameter does not specify any post data, Navigate issues an HTTP + // GET transaction. This parameter is ignored if the URL is not an HTTP URL. + // Summary: Call this member function to navigate to the resource identified by + // a URL. Applies to Internet Explorer and WebBrowser. + void Navigate(LPCTSTR URL,DWORD dwFlags = 0,LPCTSTR lpszTargetFrameName = NULL,LPCTSTR lpszHeaders = NULL,LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0); + + // Input: pIDL - A pointer to an ITEMIDLIST structure. + // dwFlags - The flags of a variable that specifies whether to add the resource + // to the history list, whether to read to or write from the cache, and + // whether to display the resource in a new window. The variable can + // be a combination of the values defined by the BrowserNavConstants + // enumeration. + // lpszTargetFrameName - A pointer to a string that contains the name of the frame in which + // to display the resource. + // Summary: Call this member function to navigate to the resource identified by + // a URL, or to the file identified by a full path. This member function + // extends the Navigate member function by supporting browsing on special + // folders, such as Desktop and My Computer, that are represented by the + // parameter 'pIDL'. Applies to Internet Explorer and WebBrowser. + void Navigate2(LPITEMIDLIST pIDL,DWORD dwFlags = 0,LPCTSTR lpszTargetFrameName = NULL); + + // Input: lpszURL - A pointer to a string containing the URL. + // dwFlags - The flags of a variable that specifies whether to add the resource + // to the history list, whether to read to or write from the cache, and + // whether to display the resource in a new window. The variable can + // be a combination of the values defined by the BrowserNavConstants + // enumeration. + // lpszTargetFrameName - A pointer to a string that contains the name of the frame in which + // to display the resource. + // lpszHeaders - A pointer to a value that specifies the HTTP headers to send to the + // server. These headers are added to the default Internet Explorer headers. + // The headers can specify such things as the action required of the + // server, the type of data being passed to the server, or a status code. + // This parameter is ignored if the URL is not an HTTP URL. + // lpvPostData - Data to send with the HTTP POST transaction. For example, the POST + // transaction is used to send data gathered by an HTML form. If this + // parameter does not specify any post data, Navigate2 issues an HTTP + // GET transaction. This parameter is ignored if the URL is not an HTTP URL. + // dwPostDataLen - Length in bytes of the data pointed to by the 'lpvPostData' parameter. + // Summary: Call this member function to navigate to the resource identified by + // a URL, or to the file identified by a full path. This member function + // extends the Navigate member function by supporting browsing on special + // folders, such as Desktop and My Computer, that are represented by the + // parameter 'pIDL'. Applies to Internet Explorer and WebBrowser. + void Navigate2(LPCTSTR lpszURL, DWORD dwFlags = 0, LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeaders = NULL, LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0); + + // Input: lpszURL - A pointer to a string containing the URL. + // dwFlags - A pointer to a string that contains the name of the frame in which + // to display the resource. + // baPostedData - A reference to a CByteArray object. + // lpszTargetFrameName - A pointer to a string that contains the name of the frame in which + // to display the resource. + // lpszHeader - A pointer to a value that specifies the HTTP headers to send to the + // server. These headers are added to the default Internet Explorer headers. + // The headers can specify such things as the action required of the + // server, the type of data being passed to the server, or a status code. + // This parameter is ignored if the URL is not an HTTP URL. + // Summary: Call this member function to navigate to the resource identified by + // a URL, or to the file identified by a full path. This member function + // extends the Navigate member function by supporting browsing on special + // folders, such as Desktop and My Computer, that are represented by the + // parameter 'pIDL'. Applies to Internet Explorer and WebBrowser. + void Navigate2(LPCTSTR lpszURL, DWORD dwFlags, CByteArray& baPostedData, LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeader = NULL); + + // Summary: This member function reloads the URL or file that the web browser is + // currently displaying. Refresh contains no parameters for setting the + // refresh level. Applies to Internet Explorer and WebBrowser. + void Refresh(); + + // Input: nLevel - The address of the variable specifying the refresh level. The possible + // variables are defined in RefreshConstants, in the Platform SDK. + // Summary: This member function reloads the file that Internet Explorer is currently + // displaying. Unlike Refresh, Refresh2 contains a parameter that specifies + // the refresh level. Applies to Internet Explorer and WebBrowser. + void Refresh2(int nLevel); + + // Summary: Call this member function to cancel any pending navigation or download + // operation and stop any dynamic page elements, such as background sounds + // and animations. Applies to Internet Explorer and WebBrowser. + void Stop(); + + // Input: lpszProperty - A string containing the property to set. + // vtValue - The new value of the property indicated by 'lpszProperty'. + // Summary: Call this member function to set the property associated with a given + // object. Applies to Internet Explorer and WebBrowser. + void PutProperty(LPCTSTR lpszProperty, const VARIANT& vtValue); + + // Input: lpszPropertyName - A pointer to a string containing the name of the property to set. + // dValue - The new value of the property. + // Summary: Call this member function to set the property associated with a given + // object. Applies to Internet Explorer and WebBrowser. + void PutProperty(LPCTSTR lpszPropertyName, double dValue); + + // Input: lpszPropertyName - A pointer to a string containing the name of the property to set. + // lpszValue - A pointer to a string containing the new value of the property. + // Summary: Call this member function to set the property associated with a given + // object. Applies to Internet Explorer and WebBrowser. + void PutProperty(LPCTSTR lpszPropertyName, LPCTSTR lpszValue); + + // Input: lpszPropertyName - A pointer to a string containing the name of the property to set. + // lValue - The new value of the property. + // Summary: Call this member function to set the property associated with a given + // object. Applies to Internet Explorer and WebBrowser. + void PutProperty(LPCTSTR lpszPropertyName, long lValue); + + // Input: lpszPropertyName - A pointer to a string containing the name of the property to set. + // nValue - The new value of the property. + // Summary: Call this member function to set the property associated with a given + // object. Applies to Internet Explorer and WebBrowser. + void PutProperty(LPCTSTR lpszPropertyName, short nValue); + + // Input: lpszProperty - A pointer to a string containing the property to retrieve. + // strValue - A reference to a CString object that receives the current value of + // the property. + // Returns: Nonzero if completed successfully, otherwise returns zero. + // Summary: Call this member function to get the value of the property currently + // associated with the control. Applies to Internet Explorer and WebBrowser. + BOOL GetProperty(LPCTSTR lpszProperty, CString& strValue); + + // Input: lpszProperty - A pointer to a string containing the property to retrieve. + // Returns: A COleVariant object. + // Summary: Call this member function to get the value of the property currently + // associated with the control. Applies to Internet Explorer and WebBrowser. + COleVariant GetProperty(LPCTSTR lpszProperty); + + // Input: cmdID - The command to execute. + // cmdexecopt - The options set for executing the command. + // pvaIn - A variant used for specifying the command input arguments. + // pvaOut - A variant used for specifying the command output arguments. + // Summary: Call this member function to execute a command in the WebBrowser or + // Internet Explorer. See IWebBrowser2::ExecWB in the Platform SDK. + void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT* pvaIn, VARIANT* pvaOut); + + // Input: lpszResource - A pointer to a string containing the name of the resource to load. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to load the specified resource into the WebBrowser + // control. Applies to Internet Explorer and WebBrowser. + BOOL LoadFromResource(LPCTSTR lpszResource); + + // Input: nRes - The ID of the buffer containing the name of the resource to load. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to load the specified resource into the WebBrowser + // control. Applies to Internet Explorer and WebBrowser. + BOOL LoadFromResource(UINT nRes); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + + // Input: pDC - A pointer to the device context to be used for rendering an image. + // Summary: This member function is called by the framework to draw the view. + // Applies to Internet Explorer and WebBrowser. + virtual void OnDraw(CDC* pDC); + + // Input: lpszClassName - Points to a null-terminated character string that names the Windows + // class. The class name can be any name registered with the + // AfxRegisterWndClass global function or the RegisterClass Windows function. + // If NULL, it uses the predefined default CFrameWnd attributes. + // lpszWindowName - Points to a null-terminated character string that represents the window's + // name. + // dwStyle - Specifies the window style attributes. By default, the WS_VISIBLE + // and WS_CHILD Windows styles are set. + // rect - A reference to a RECT structure specifying the size and position of + // the window. The rectDefault value allows Windows to specify the size + // and position of the new window. + // pParentWnd - A pointer to the parent window of the control. + // nID - The ID number of the view. By default, set to AFX_IDW_PANE_FIRST. + // pContext - A pointer to a CCreateContext. It is NULL by default. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to create a WebBrowser control or container + // for the Internet Explorer executable. + virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); + + // Input: strURL - A string expression that evaluates to the URL, UNC file name, or PIDL (a + // pointer to an item identifier list) that was navigated to. + // Summary: This member function is called by the framework after a navigation + // to a hyperlink completes (on either a window or frameset element). + // The URL parameter can be a PIDL in the case of a shell name space entity + // for which there is no URL representation. Note that the URL contained + // in 'strURL' can be different from the URL that the browser was told to + // navigate to, because this URL is the canonicalized and qualified URL. + // For example, if an application specifies a URL of "www.microsoft.com" + // in a call to Navigate or Navigate2, the URL passed by OnNavigateComplete2 + // will be "http://www.microsoft.com/". Also, if the server has redirected + // the browser to a different URL, the redirected URL will be reflected + // here. + virtual void OnNavigateComplete2(LPCTSTR strURL); + + // Input: lpszURL - Pointer to a string containing the URL to navigate to. + // nFlags - Reserved for future use. + // lpszTargetFrameName - A string that contains the name of the frame in which to display the + // resource, or NULL if no named frame is targeted for the resource. + // baPostedData - A reference to a CByteArray object containing the data to send to + // the server if the HTTP POST transaction is being used. + // lpszHeaders - A pointer to a string containing additional HTTP headers to send to + // the server (HTTP URLs only). The headers can specify such things + // as the action required of the server, the type of data being passed + // to the server, or a status code. + // pbCancel - A pointer to a cancel flag. An application can set this parameter + // to nonzero to cancel the navigation operation, or to zero to allow + // it to proceed. + // Summary: This member function is called by the framework to cause an event to fire + // before a navigation occurs in the web browser. + virtual void OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel); + + // Input: lpszText - A string that contains the new status bar text. + // Summary: This member function is called by the framework to notify an application + // that the text of the status bar associated with the WebBrowser control + // has changed. + virtual void OnStatusTextChange(LPCTSTR lpszText); + + // Input: nProgress - Amount of total progress to show, or -1 when progress is complete. + // nProgressMax - Maximum progress value. + // Summary: This member function is called by the framework to notify an application + // that the progress of a download operation has been updated. The container + // can use the information provided by this event to display the number + // of bytes downloaded so far or to update a progress indicator. + virtual void OnProgressChange(long nProgress, long nProgressMax); + + // Input: nCommand - Identifier of the command whose enabled state has changed. + // bEnable - Enabled state. This parameter is nonzero if the command is enabled, + // or zero if it is disabled. + // Summary: This member function is called by the framework to notify an application + // that the enabled state of a web browser command has changed. + virtual void OnCommandStateChange(long nCommand, BOOL bEnable); + + // Summary: This member function is called by the framework to begin downloading + // a document. This event is fired shortly after the OnBeforeNavigate2 + // event, unless the navigation is canceled. Any animation or "busy" + // indication that the container needs to display should be connected + // to this event. + virtual void OnDownloadBegin(); + + // Summary: This member function is called by the framework to indicate that a + // navigation operation finished, was halted, or failed. + virtual void OnDownloadComplete(); + + // Input: lpszText - The new document title. + // Summary: This member function is called by the framework to notify an application + // if the title of a document in the WebBrowser control becomes available + // or changes. For HTML, the title might change. While HTML is still + // downloading, the URL of the document is set as the title. After the + // real title (if there is one) is parsed from the HTML, the title is + // changed to reflect the actual title. + virtual void OnTitleChange(LPCTSTR lpszText); + + // Input: lpszProperty - A pointer to a string containing the name of the property. + // Summary: This member function is called by the framework to notify an application + // that PutProperty has changed the value of a property. + virtual void OnPropertyChange(LPCTSTR lpszProperty); + + // Input: ppDisp - A pointer to an interface pointer that, optionally, receives the + // IDispatch interface pointer of a new WebBrowser or Internet Explorer + // object. + // Cancel - A pointer to a cancel flag. An application can set this parameter + // to nonzero to cancel the navigation operation, or to zero to allow + // it to proceed. + // Summary: This member function is called by the framework when a new window is + // to be created for displaying a resource. This event precedes the creation + // of a new window from within the WebBrowser. + virtual void OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel); + + // Input: lpszURL - A pointer to a string that evaluates to the URL, UNC file name, or + // a PIDL (a pointer to an item identifier list) that was navigated to. + // Summary: This member function is called by the framework to notify an application + // that a document has reached the READYSTATE_COMPLETE state. Not every + // frame will fire this event, but each frame that fires an OnDownloadBegin + // event will fire a corresponding OnDocumentComplete event. The URL + // indicated by 'lpszURL' can be different from the URL that the browser + // was told to navigate to, because this URL is the canonicalized and + // qualified URL. For example, if an application specifies a URL of + // "www.microsoft.com" in a call to Navigate or Navigate2, the URL passed + // by OnNavigateComplete2 will be "http://www.microsoft.com/". Also, if + // the server has redirected the browser to a different URL, the redirected + // URL will be reflected here. + virtual void OnDocumentComplete(LPCTSTR lpszURL); + + // Summary: This member function is called by the framework to notify an application + // that the Internet Explorer application is ready to quit. + virtual void OnQuit(); + + // Input: bVisible - Nonzero if the object is visible or zero otherwise. + // Summary: This member function is called by the framework when the window for + // the WebBrowser should be shown or hidden. This allows the object control + // host window to behave the same way the Internet Explorer window would + // behave. + virtual void OnVisible(BOOL bVisible); + + // Input: bToolBar - Nonzero if Internet Explorer's toolbar is visible or zero otherwise. + // Summary: This member function is called by the framework when the ToolBar property + // has changed. + virtual void OnToolBar(BOOL bToolBar); + + // Input: bMenuBar - Nonzero if the Internet Explorer menu bar is visible or zero otherwise. + // Summary: This member function is called by the framework when the MenuBar property + // has changed. + virtual void OnMenuBar(BOOL bMenuBar); + + // Input: bStatusBar - Nonzero if Internet Explorer's status bar is visible or zero otherwise. + // Summary: This member function is called by the framework when the StatusBar property + // has changed. + virtual void OnStatusBar(BOOL bStatusBar); + + // Input: bFullScreen - Nonzero if Internet Explorer is in full screen mode or zero otherwise. + // Summary: This member function is called by the framework when the FullScreen property + // has changed. + virtual void OnFullScreen(BOOL bFullScreen); + + // Input: bTheaterMode - Nonzero if Internet Explorer is in theater mode or zero otherwise. + // Summary: This member function is called by the framework when the TheaterMode property + // has changed. + virtual void OnTheaterMode(BOOL bTheaterMode); + + // Ignore: + //{{AFX_VIRTUAL(CXTHtmlView) + protected: + virtual void NavigateComplete2(LPDISPATCH pDisp, VARIANT* URL); + virtual void BeforeNavigate2(LPDISPATCH pDisp, VARIANT* URL, VARIANT* Flags, VARIANT* TargetFrameName, VARIANT* PostData, VARIANT* Headers, BOOL* Cancel); + virtual void DocumentComplete(LPDISPATCH pDisp, VARIANT* URL); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTHtmlView) + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnDestroy(); + afx_msg void OnFilePrint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTHtmlView::SetRegisterAsBrowser(BOOL bNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_RegisterAsBrowser((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); +} +AFX_INLINE void CXTHtmlView::SetRegisterAsDropTarget(BOOL bNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_RegisterAsDropTarget((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); +} +AFX_INLINE void CXTHtmlView::SetTheaterMode(BOOL bNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_TheaterMode((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); +} +AFX_INLINE void CXTHtmlView::SetVisible(BOOL bNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Visible((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); +} +AFX_INLINE void CXTHtmlView::SetMenuBar(BOOL bNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_MenuBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); +} +AFX_INLINE void CXTHtmlView::SetToolBar(int nNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_ToolBar(nNewValue); +} +AFX_INLINE void CXTHtmlView::SetOffline(BOOL bNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Offline((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); +} +AFX_INLINE void CXTHtmlView::SetSilent(BOOL bNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Silent((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); +} +AFX_INLINE void CXTHtmlView::GoBack() { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoBack(); +} +AFX_INLINE void CXTHtmlView::GoForward() { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoForward(); +} +AFX_INLINE void CXTHtmlView::GoHome() { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoHome(); +} +AFX_INLINE void CXTHtmlView::GoSearch() { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoSearch(); +} +AFX_INLINE void CXTHtmlView::Refresh() { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Refresh(); +} +AFX_INLINE void CXTHtmlView::Refresh2(int nLevel) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Refresh2(COleVariant((long) nLevel, VT_I4)); +} +AFX_INLINE void CXTHtmlView::Stop() { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Stop(); +} +AFX_INLINE void CXTHtmlView::SetFullScreen(BOOL bNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_FullScreen((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); +} +AFX_INLINE void CXTHtmlView::SetAddressBar(BOOL bNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_AddressBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); +} +AFX_INLINE void CXTHtmlView::SetHeight(long nNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Height(nNewValue); +} +AFX_INLINE void CXTHtmlView::PutProperty(LPCTSTR lpszPropertyName, long lValue) { + ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(lValue, VT_UI4)); +} +AFX_INLINE void CXTHtmlView::PutProperty(LPCTSTR lpszPropertyName, short nValue) { + ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(nValue, VT_UI2)); +} +AFX_INLINE void CXTHtmlView::PutProperty(LPCTSTR lpszPropertyName, LPCTSTR lpszValue) { + ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(lpszValue, VT_BSTR)); +} +AFX_INLINE void CXTHtmlView::PutProperty(LPCTSTR lpszPropertyName, double dValue) { + ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(dValue)); +} +AFX_INLINE void CXTHtmlView::SetTop(long nNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Top(nNewValue); +} +AFX_INLINE void CXTHtmlView::SetLeft(long nNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Left(nNewValue); +} +AFX_INLINE void CXTHtmlView::SetStatusBar(BOOL bNewValue) { + ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_StatusBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE)); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTHTMLVIEW_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTHyperLink.h b/Editor/XT/Include/XTHyperLink.h new file mode 100644 index 0000000..f69881e --- /dev/null +++ b/Editor/XT/Include/XTHyperLink.h @@ -0,0 +1,250 @@ +// XTHyperLink.h interface for the CXTHyperLink class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTHYPERLINK_H__) +#define __XTHYPERLINK_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTHyperLink is a CStatic derived class. It is used to display a text +// string that is used as a hyperlink control. The link's active, hover, +// and selected color attributes are configurable. +class _XT_EXT_CLASS CXTHyperLink : public CStatic +{ + DECLARE_DYNAMIC(CXTHyperLink) + +public: + + // Summary: Constructs a CXTHyperLink object. + CXTHyperLink(); + + // Summary: Destroys a CXTHyperLink object, handles cleanup and de-allocation. + virtual ~CXTHyperLink(); + +// Attributes +protected: + + bool m_bShellExec; // true to cause the hyperlink to call ShellExecute for the specified URL. + bool m_bInitControl; // true for initialization. + bool m_bUnderline; // Set to true for underlined text. + bool m_bMouseOver; // Set to true when the cursor is hovering over the control. + bool m_bVisited; // Set to true when the hyperlink has been activated. + bool m_bTipEnabled; // Set to false to disable tooltips. + CString m_strLink; // String object that represents the URL for this control. + CString m_strTipText; // String object that represents the tooltip text for this control. + HCURSOR m_hcurHand; // Handle to the default cursor for this control. + COLORREF m_clrLink; // An RGB value representing the color for the hyperlink text color. + COLORREF m_clrHover; // An RGB value representing the color for the hyperlink text color when the mouse is hovering. + COLORREF m_clrVisited; // An RGB value representing the color for the hyperlink text color when the URL has been visited. + COLORREF m_clrBack; // An RGB value representing the background fill color for the hyperlink control. + CToolTipCtrl m_toolTip; // Tooltip to be displayed for the control. + +public: + + // Input: bEnable - true to enable ShellExecute, false to disable. + // Summary: Call this member function to enable or disable ShellExecute to be called + // for the URL that is specified for the hyperlink control. If disabled, + // you can add a BN_CLICKED message handler to perform your own task when + // the link is clicked. + void EnableShellExecute(bool bEnable); + + // Input: lpszLink - A NULL terminated character string that + // represents the URL for the hyperlink. + // Summary: This member function sets the URL for the hyperlink control. + virtual void SetURL(LPCTSTR lpszLink); + + // Returns: A CString object that represents the URL for the hyperlink control. + // Summary: This member function retrieves the URL for the hyperlink. + virtual CString GetURL() const; + + // Input: clrLink - An RGB value representing the color for the hyperlink text color. + // clrVisited - An RGB value representing the color for the hyperlink text color + // when the mouse is hovering. + // clrHover - An RGB value representing the color for the hyperlink text color + // when the URL has been visited. + // Summary: This member function will set the RGB color values for the hyperlink text. + virtual void SetColors(COLORREF clrLink,COLORREF clrVisited,COLORREF clrHover); + + // Returns: An RGB color value that represents the current hyperlink text color. + // Summary: This member function retrieves the current hyperlink text color. + virtual COLORREF GetLinkColor() const; + + // Returns: An RGB color value that represents the current hyperlink text color when + // the link has been activated. + // Summary: This member function retrieves the current hyperlink text color + // when the link has been activated. + virtual COLORREF GetVisitedColor() const; + + // Returns: An RGB color value that represents the current hyperlink text color when + // the mouse hovers over the hyperlink. + // Summary: This member function retrieves the current hyperlink text color + // when the mouse hovers over the hyperlink. + virtual COLORREF GetHoverColor() const; + + // Input: bVisited - A boolean flag that, when set to true, causes the control to + // display the hyperlink text color as visited. + // Summary: This member function will cause the control to display the hyperlink + // text color as visited. + virtual void SetVisited(bool bVisited = true); + + // Returns: true if the URL has been visited, otherwise returns false. + // Summary: This member function checks to see if the user has visited the URL + // associated with the hyperlink. + virtual bool GetVisited() const; + + // Input: hCursor - Handle of the cursor to be associated with the hyperlink control. + // Summary: This member function will set the cursor to be displayed when the + // mouse hovers over the hyperlink control. + virtual void SetLinkCursor(HCURSOR hCursor); + + // Returns: A handle to the current cursor for the hyperlink control. + // Summary: This member function will get a handle to the current cursor associated + // with the hyperlink control. + virtual HCURSOR GetLinkCursor() const; + + // Input: bUnderline - A boolean flag that, when set to true, causes the control to + // display the text as underlined. + // Summary: This member function will cause the hyperlink to display the text + // as underlined. The default value is 'true.' + virtual void SetUnderline(bool bUnderline = true); + + // Returns: true if the hyperlink text is underlined, otherwise returns false. + // Summary: This member function checks to see if the hyperlink text is underlined. + virtual bool GetUnderline() const; + + // Input: clrBack - An RGB value representing the background fill color. + // Summary: This member function will set the background fill color for the hyperlink + // control. By default the hyperlink control uses the system color for COLOR_3DFACE. + virtual void SetBackColor(COLORREF clrBack); + + // Returns: A COLOREF value. + // Summary: This member function will return the current background fill color for the + // hyperlink control. + virtual COLORREF GetBackColor() const; + + // Input: lpszLink - Points to a null terminated string that represents the URL to + // jump to. If NULL, the default URL is activated. + // nShowCmd - Display state for shell command associated with the URL. The default + // is SW_SHOW. + // Returns: A value greater than 32 if successful, or an error value that is less than + // or equal to 32 if unsuccessful. + // Summary: This member function is called to execute the shell command associated + // with the current URL. + virtual HINSTANCE GotoURL(LPCTSTR lpszLink=NULL,int nShowCmd=SW_SHOW); + + // Returns: true if the hyperlink control is a text control, otherwise returns false. + // Summary: This member function checks to see if the hyperlink control is a + // text control. + virtual bool IsTextControl(); + + // Input: bEnable - true to enable tooltips. + // Summary: Call this member function to enable or disable tooltips for the hyperlink + // control. + void EnableToolTips(bool bEnable=true); + + // Input: lpszTipText - NULL terminated string that represents the new tooltip text to display. + // Summary: Call this member function to set the tooltip text for the tooltip associated + // with the hyperlink control. + void SetTipText(LPCTSTR lpszTipText); + + // Ignore: + //{{AFX_VIRTUAL(CXTHyperLink) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + + virtual bool IsLinkHot(); + virtual void ReportError(int iErrorNo); + + // Ignore: + //{{AFX_MSG(CXTHyperLink) + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnClicked(); + //}}AFX_MSG + + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTHyperLink::SetURL(LPCTSTR lpszLink) { + m_strLink = lpszLink; if (!m_bInitControl) m_toolTip.UpdateTipText(lpszLink, this); +} +AFX_INLINE CString CXTHyperLink::GetURL() const { + return m_strLink; +} +AFX_INLINE void CXTHyperLink::SetColors(COLORREF clrLink, COLORREF clrVisited, COLORREF clrHover) { + m_clrLink = clrLink; m_clrVisited = clrVisited; m_clrHover = clrHover; Invalidate(); +} +AFX_INLINE COLORREF CXTHyperLink::GetLinkColor() const { + return m_clrLink; +} +AFX_INLINE COLORREF CXTHyperLink::GetVisitedColor() const { + return m_clrVisited; +} +AFX_INLINE COLORREF CXTHyperLink::GetHoverColor() const { + return m_clrHover; +} +AFX_INLINE void CXTHyperLink::SetVisited(bool bVisited) { + m_bVisited = bVisited; InvalidateRect(NULL); +} +AFX_INLINE bool CXTHyperLink::GetVisited() const { + return m_bVisited; +} +AFX_INLINE void CXTHyperLink::SetLinkCursor(HCURSOR hCursor) { + m_hcurHand = hCursor; +} +AFX_INLINE HCURSOR CXTHyperLink::GetLinkCursor() const { + return m_hcurHand; +} +AFX_INLINE void CXTHyperLink::SetUnderline(bool bUnderline) { + m_bUnderline = bUnderline; SetFont(m_bUnderline ? &xtAfxData.fontULine : &xtAfxData.font); Invalidate(); +} +AFX_INLINE bool CXTHyperLink::GetUnderline() const { + return m_bUnderline; +} +AFX_INLINE bool CXTHyperLink::IsTextControl() { + return ((GetStyle() & 0xFF) <= SS_RIGHT) ? true:false; +} +AFX_INLINE void CXTHyperLink::EnableShellExecute(bool bEnable) { + m_bShellExec = bEnable; +} +AFX_INLINE void CXTHyperLink::SetBackColor(COLORREF clrBack) { + m_clrBack = clrBack; +} +AFX_INLINE COLORREF CXTHyperLink::GetBackColor() const { + return ( m_clrBack == -1 ) ? xtAfxData.clr3DFace : m_clrBack; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTHYPERLINK_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTIconMap.h b/Editor/XT/Include/XTIconMap.h new file mode 100644 index 0000000..f1c8af3 --- /dev/null +++ b/Editor/XT/Include/XTIconMap.h @@ -0,0 +1,77 @@ +// XTIconMap.h: interface for the CXTIconMap class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTICONMAP_H__) +#define __XTICONMAP_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: Strucure used by CXTIconMap to hold up to three +// icons per command that represent normal, disabled +// and active icon states. +struct XT_MAPENTRY +{ + HICON hIcon; // Image icon. + HICON hDisabledIcon; // Disabled image icon. + HICON hHotIcon; // Hot image icon. +}; + +// Summary: CMap definition for mapping XT_MAPENTRY structures. +typedef CMap CXTMapEntry; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTIconMap is a CObject derived class. This class stores command to +// icon associations. Icons are owned by this map and will be destroyed +// once this object is destroyed. +class CXTIconMap : public CObject +{ + CXTMapEntry m_map; // A map of commands to their icons. + +public: + // Summary: Constructs a CXTIconMap object. + CXTIconMap(); + + // Summary: Destroys a CXTIconMap object, handles cleanup and de-allocation. It + // destroys the icons currently in the map. + virtual ~CXTIconMap(); + + // Summary: This member function removes and destroys all icons in the map. + void RemoveAll(); + + // Input: nCmdID - A UINT value that represents the command ID associated with the icon. + // hIcon - Handle of the icon to associate with 'nCmdID'. + // hDisabledIcon - Handle of the disabled icon to associate with 'nCmdID'. + // hHotIcon - Handle of the hot icon to associate with 'nCmdID'. + // Summary: This member function sets a command to icon association. The existing + // icon, if any, will be destroyed. + void SetAt(UINT nCmdID, HICON hIcon,HICON hDisabledIcon,HICON hHotIcon); + + // Input: nCmdID - A UINT value that represents the command ID associated with the icon. + // hIcon - Reference to an HICON object to receive the handle of the icon associated + // with 'nCmdID'. + // hDisabledIcon - Reference to an HICON object to receive the handle of the disabled + // icon associated with 'nCmdID'. + // hHotIcon - Reference to an HICON object to receive the handle of the hot + // icon associated with 'nCmdID'. + // Returns: TRUE if the icon exists, or FALSE if the icon does not exist. + // Summary: This member function looks up an icon by its command ID. + BOOL Lookup(UINT nCmdID, HICON& hIcon,HICON& hDisabledIcon,HICON& hHotIcon); + +private: + static void DestroyEntry(XT_MAPENTRY& entry); +}; + +#endif // !defined(__XTICONMAP_H__) diff --git a/Editor/XT/Include/XTIncludes.h b/Editor/XT/Include/XTIncludes.h new file mode 100644 index 0000000..077e221 --- /dev/null +++ b/Editor/XT/Include/XTIncludes.h @@ -0,0 +1,238 @@ +// XTIncludes.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTINCLUDES_H__) +#define __XTINCLUDES_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +//-------------- +// MFC includes: +//-------------- + +#ifndef _AFX_NO_OLE_SUPPORT +#include +#endif // _AFX_NO_OLE_SUPPORT + +#ifdef _MFC_OVERRIDES_NEW +#define _INC_MALLOC +#endif +// MFC support for docking windows +#include +// MFC template classes +#include +// MFC ListView / TreeView support +#include + +#if _MFC_VER >= 0x0700 //MFC 7.0 +// MFC Global data +#include <..\src\mfc\afximpl.h> +#else +// MFC Global data +#include <..\src\mfc\\afximpl.h> +#endif + +// MFC support for shell extensions +#include + +////////////////////////////////////////////////////////////////////// +// Summary: NOTE: If using the Xtreme Toolkit as a static library linked to an application +// that is dynamically linked with MFC, you will need to do the following: +// +// Open the XTToolkit_Lib project workspace and select one of the +// Win32 Dynamic build settings and build the library. Add the following lines +// of code to your stdafx.h file: +// +//
#define _XT_STATICLINK
+//			#include 
+// +// Add the following line of code to your *.rc2 file after the comment: +// "Add manually edited resources here...": +// +//
#include "XTResource.rc"
+#if !defined( _AFXDLL ) || defined( _XT_STATICLINK ) +#define _XT_EXT_CLASS +#else +#define _XT_EXT_CLASS __declspec( dllimport ) +#endif // !defined( _AFXDLL ) || defined( _XT_STATICLINK ) + +//----------------------------------------- +// Xtreme global and resource definitions: +//----------------------------------------- + +#include "XTDefines.h" +#include "XTGlobal.h" +#include "XTResource.h" +#include "XTFunctions.h" +#include "XTVersion.h" +#include "XTMemDC.h" + +//------------------------- +// Xtreme control classes: +//------------------------- + +#include "XTButton.h" +#include "XTWndHook.h" +#include "XTCoolMenu.h" +#include "XTHexEdit.h" +#include "XTFlatComboBox.h" +#include "XTMaskEdit.h" +#include "XTBrowseEdit.h" +#include "XTCaption.h" +#include "XTCaptionPopupWnd.h" +#include "XTColorRef.h" +#include "XTColorSelectorCtrl.h" +#include "XTColorPopup.h" +#include "XTColorPicker.h" +#include "XTColorPageCustom.h" +#include "XTColorPageStandard.h" +#include "XTColorDialog.h" +#include "XTEditListBox.h" +#include "XTFontCombo.h" +#include "XTComboBoxEx.h" +#include "XTTabCtrl.h" +#include "XTFlatTabCtrl.h" +#include "XTTreeCtrl.h" +#include "XTTreeView.h" +#include "XTFlatHeaderCtrl.h" +#include "XTListCtrl.h" +#include "XTOutBarCtrl.h" +#include "XTOutlookBar.h" +#include "XTPagerCtrl.h" +#include "XTDateTimeCtrl.h" +#include "XTHyperLink.h" +#include "XTTipWindow.h" +#include "XTTipOfTheDay.h" +#include "XTSplitterWnd.h" +#include "XTStatusBar.h" +#include "XTLogoPane.h" +#include "XTMDIWndTab.h" +#include "XTOSVersionInfo.h" + +//------------------------------------------------------------------------------------ +// Xtreme resizing dialog controls +//------------------------------------------------------------------------------------ + +#include "XTResizeRect.h" +#include "XTResizePoint.h" +#include "XTResize.h" +#include "XTResizeDialog.h" +#include "XTResizeFormView.h" +#include "XTResizePropertyPage.h" +#include "XTResizePropertySheet.h" +#include "XTSearchOptionsCtrl.h" +#include "XTCBarDialog.h" + +//------------------------------------------------------------------------------------ +// Xtreme manager controls +//------------------------------------------------------------------------------------ + +#include "XTIconMap.h" +#include "XTToolsManager.h" +#include "XTOptionsManager.h" +#include "XTAccelManager.h" +#include "XTAccelKeyEdit.h" + +//----------------------------------------------- +// Xtreme control bars - +// Replaces: CControlBar, CDockBar, CDockContext: +//----------------------------------------------- + +#include "XTDelegate.h" +#include "XTCustomizeAPI.h" +#include "XTCallbacks.h" +#include "XTControlBar.h" +#include "XTDialogBar.h" +#include "XTSplitterDock.h" +#include "XTDockBar.h" +#include "XTDockContext.h" +#include "XTDockWindow.h" +#include "XTTabCtrlBar.h" +#include "XTDockColorSelector.h" + +//------------------------------------------------------ +// Xtreme toolbars - +// Replaces: CToolBar, CToolBarCtrl, CReBar, CReBarCtrl: +//------------------------------------------------------ + +#include "XTToolBarCtrl.h" +#include "XTToolBar.h" +#include "XTMenuBar.h" +#include "XTReBar.h" +#include "XTReBarCtrl.h" +#include "XTToolBarPopupWnd.h" +#include "XTPopupTearOffWnd.h" + +//------------------------------------------------------------------------------------ +// Xtreme frame windows - +// Replaces: CFrameWnd, CMDIFrameWnd, CMDIChildWnd, COleIPFrameWnd, CMiniDockFrameWnd: +//------------------------------------------------------------------------------------ + +#include "XTFrameImpl.h" +#include "XTFrameWnd.h" +#include "XTMDIFrameWnd.h" +#include "XTMDIChildWnd.h" + +#ifndef _AFX_NO_OLE_SUPPORT +#include "XTOleIPFrameWnd.h" +#endif // _AFX_NO_OLE_SUPPORT + +#include "XTMiniDockFrameWnd.h" + +//----------------------- +// Xtreme customization: +//----------------------- + +#include "XTCheckListBox.h" +#include "XTCommandsListBox.h" +#include "XTNewToolbarDlg.h" +#include "XTCustomizePage.h" +#include "XTCustomizeSheet.h" + +//----------------------- +// Xtreme CView classes: +//----------------------- + +#include "XTHtmlView.h" +#include "XTListView.h" +#include "XTPreviewView.h" +#include "XTTabView.h" + +//-------------------------- +// Xtreme shell extensions: +//-------------------------- + +#include "XTDropSource.h" +#include "XTShellPidl.h" +#include "XTShellSettings.h" +#include "XTShellTreeView.h" +#include "XTShellTreeCtrl.h" +#include "XTShellListView.h" +#include "XTShellListCtrl.h" +#include "XTTrayIcon.h" +#include "XTBrowseDialog.h" + +//---------------------------- +// Xtreme utility classes: +//---------------------------- + +#include "XTWindowPos.h" +#include "XTMemFile.h" +#include "XTSortClass.h" +#include "XTRegistryManager.h" + +///////////////////////////////////////////////////////////////////////////// + +#endif // #if !defined(__XTINCLUDES_H__) diff --git a/Editor/XT/Include/XTListCtrl.h b/Editor/XT/Include/XTListCtrl.h new file mode 100644 index 0000000..f6c5d33 --- /dev/null +++ b/Editor/XT/Include/XTListCtrl.h @@ -0,0 +1,369 @@ +// XTListCtrl.h interface for the CXTListCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTLISTCTRL_H__) +#define __XTLISTCTRL_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTListCtrlBase is a non-inherited class. It implements the extended +// list control services provided by the Xtreme Toolkit list control classes. +class _XT_EXT_CLASS CXTListCtrlBase +{ + +public: + + // Summary: Constructs a CXTListCtrlBase object. + CXTListCtrlBase(); + + // Summary: Destroys a CXTListCtrlBase object, handles cleanup and de-allocation. + virtual ~CXTListCtrlBase(); + + BOOL m_bAutoFont; // If TRUE, the font will automatically be set for the control. + +protected: + + class CListCtrl_Friendly : public CListCtrl + { + // Needed in order to access protected functions. + + friend class CXTListCtrlBase; + }; + + void ImplAttach(CListCtrl *pListCtrl); + CListCtrl_Friendly *m_pListCtrl; + + int m_nMinColWidth; // Minimum width for columns. + int m_nMaxColWidth; // Maximum width for columns. + int m_nSortedCol; // Index of the currently selected column. + bool m_bNoColSizing; // If true, column sizing is disabled. + bool m_bAscending; // Flag to determine the sorting order. + bool m_bAutoSave; // true if saving the column widths. + CString m_strSection; // Registry section name. + CString m_strEntry; // Registry entry name. + CString m_strDefault; // Registry default value. + COLORREF m_clrText; // RGB value representing the row text color. + COLORREF m_clrTextBk; // RGB value representing the row text background color. + CXTFlatHeaderCtrl m_flatHeader; // Subclassed flat header control. + + +public: + + // Returns: A pointer to a CXTFlatHeaderCtrl if subclassed, otherwise returns NULL. + // Summary: Call this member function to get a pointer to the flat header control. + CXTFlatHeaderCtrl* GetFlatHeaderCtrl() const; + + // Input: nCol - Zero-based index of the column to set the sort image for. + // bAsc - TRUE if ascending, otherwise FALSE. + // Returns: The zero-based index of the previously sorted column. + // Summary: This member function will set the sort image for the specified column. + virtual int SetSortImage(int nCol,BOOL bAsc); + + // Input: nCol - Zero-based index of the column. + // Returns: The column width stored in the registry. + // Summary: This member function will return the column width stored in the + // registry. + virtual int GetStoredWidth(int nCol); + + // Input: nCol - Zero-based index of the column. + // Summary: This member function will set the column width from the registry + // settings. + virtual void SetStoredWidth(int nCol); + + // Summary: This member function loads the column widths from the registry. + virtual void LoadColumnWidths(); + + // Summary: This member function saves the column widths to the registry. + virtual void SaveColumnWidths(); + + // Input: nCol - Zero-based index of the column. + // Summary: This member function will automatically size a given column. Pass + // in a -1 to auto-fit all columns. + virtual void AutoSizeColumn(int nCol=-1); + + // Input: lpszSection - Registry section name. If NULL, the default is "Settings". + // lpszEntry - Registry entry name. If NULL, the default is "Column Info". + // lpszDefault - Registry default value. If NULL, the default ID. + // Summary: This member function will initialize the autosave feature. If called, + // column widths will be saved to the system registry when the list control + // window is destroyed. + virtual void AutoSaveColumns(LPCTSTR lpszSection=NULL,LPCTSTR lpszEntry=NULL,LPCTSTR lpszDefault=NULL); + + // Input: bBoldFont - true to use a bold font in the header control. + // Summary: Call this member function to subclass the flat header control. + virtual bool SubclassHeader(bool bBoldFont=false); + + // Input: nCol - Passed in from the control. Index of the column clicked. + // bAscending - Passed in from the control. true if sort order should + // be ascending. + // Summary: Override this member function in your derived class to perform custom + // sort routines. + virtual bool SortList(int nCol, bool bAscending); + + // Input: dwExStyle - DWORD value that specifies the extended list-view control style. This + // parameter can be a combination of Extended List-View Styles. + // Summary: This member function is called to set extended styles for the list + // control, ie: LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, etc. See MSDN + // documentation for a complete list of available styles. + virtual void SetExtendedStyle(DWORD dwExStyle); + + // Returns: A DWORD value that represents the extended style of the list control. + // Summary: This member function is called to return the list control extended + // style. + virtual DWORD GetExtendedStyle(); + + // Input: bDisable - true to disable column sizing. false to enable. + // Summary: Call this member function to enable or disable column sizing. + virtual void DisableColumnSizing(bool bDisable); + + // Input: nSize - Size, in pixels, of the column's minimum size. + // Summary: Call this member function to set a minimum column size. + void SetMinimumColSize(int nSize); + + // Returns: An integer value that represents the minimum column size for the list control. + // Summary: Call this member function to get the minimum column size for the list + // control. + int GetMinimumColSize(); + + // Returns: An integer value that represents the maximum column size for the list control. + // Summary: Call this member function to get the maximum column size for the list control. + int GetMaximumColSize(); + + // Input: point - Point to be tested. + // col - Address of the column index + // Returns: The row index, or -1 if 'point' is not over a row. + // Summary: Call this member function to determine the row index and column + // index for a 'point'. + virtual int HitTestEx(CPoint &point,int *col) const; + + // Input: lpszColHeading - The column's heading. + // nWidth - Width of the column, in pixels. If this + // parameter is -1, the column width is the + // same as the previous column. + // nFormat - The alignment of the column. It can be LVCFMT_LEFT, + // LVCFMT_RIGHT, or LVCFMT_CENTER. + // Returns: The index of the new column if successful, or -1 if unsuccessful. + // Summary: Call this member function to add a column after the right most column. + virtual int AddColumn(LPCTSTR lpszColHeading,int nWidth = -1,int nFormat=LVCFMT_LEFT); + + // Input: nCols - Number of columns the list control contains. + // nWidth - 'int' array containing the column widths. + // strColString - CString array containing the string for each column. + // Returns: true if successful, or false if an error occurred. + // Summary: This member function will build the columns for the list control. + virtual bool BuildColumns(int nCols,int* nWidth,CString* strColString ); + + // Input: nCols - Number of columns the list control contains. + // nWidth - 'int' array containing the column widths. + // nColString - 'int' array containing the string resource ID + // for each column. + // Returns: true if successful, or false if an error occurred. + // Summary: This member function will build the columns for the list control. + virtual bool BuildColumns(int nCols,int* nWidth,int* nColString ); + + // Input: clrText - RGB value representing the row text color. + // clrTextBk - RGB value representing the row background color. + // Summary: This member function sets the row, text, and background colors for + // the list control. + virtual void SetRowColors(COLORREF clrText,COLORREF clrTextBk); + + // Returns: An RGB value that represents the background color. + // Summary: This member function gets the RGB value defined for the list control's + // background color. + COLORREF GetBackColor(); + + // Returns: An RGB value that represents the text color. + // Summary: This member function gets the RGB value defined for the list control's + // text color. + COLORREF GetTextColor(); + + // Returns: An integer value that represents the number of columns in the list. + // Summary: This member function gets the number of columns in the list. + virtual int GetColumnCount(); + + // Input: nFrom - Index of the source row. + // nTo - Index of the destination row. + // Returns: The index of the source row specified by 'nFrom'. + // Summary: This member function copies a row to a new location. + virtual int CopyRow(int nFrom,int nTo); + + // Input: nFrom - Index of the source row + // nTo - Index of the destination row + // Returns: true if successful, or false if an error occurred. + // Summary: This member function moves a row to a new location. + virtual bool MoveRow(int nFrom,int nTo); + + // Returns: A CHeaderCtrl pointer to the associated header control. + // Summary: This member function is a utility function to retrieve the associated + // header control. + CHeaderCtrl *_xtGetHeaderCtrl() const; + +#if _MSC_VER < 1200 //Ignore: MFC 5.0 + POSITION GetFirstSelectedItemPosition() const; + int GetNextSelectedItem(POSITION& pos) const; +#endif //Ignore: MFC 5.0 + +protected: + + // message implementation + + virtual BOOL OnNotifyImpl(WPARAM wParam, LPARAM lParam, LRESULT* pResult); + virtual void PreSubclassWindowImpl_Post(); + afx_msg void OnCustomDrawImpl(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDestroyImpl_Pre(); + afx_msg BOOL OnEraseBkgndImpl(CDC* pDC); + afx_msg void OnPaintImpl(); + afx_msg int OnCreateImpl_Post(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnSettingChangeImpl_Post(UINT uFlags, LPCTSTR lpszSection); +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTListCtrl is a multiple inheritance class derived from CListCtrl and +// CXTListCtrlBase. This class implements flat header and generic sorting +// routines. See CXTListCtrlBase for additional functionality. +// See Also: CXTListCtrlBase +class _XT_EXT_CLASS CXTListCtrl : public CListCtrl, public CXTListCtrlBase +{ + DECLARE_DYNAMIC(CXTListCtrl) + +public: + + // Summary: Constructs a CXTListCtrl object. + CXTListCtrl(); + + // Summary: Destroys a CXTListCtrl object, handles cleanup and de-allocation. + virtual ~CXTListCtrl(); + + // Input: dwExStyle - DWORD value that specifies the extended list-view control style. This + // parameter can be a combination of Extended List-View Styles. + // Summary: This member function is called to set extended styles for the list + // control, ie: LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, etc. See MSDN + // documentation for a complete list of available styles. + virtual void SetExtendedStyle(DWORD dwExStyle ); + + // Returns: A DWORD data type that represents the extended style of the list control. + // Summary: This member function is called to retrieve the list control extended + // style. + DWORD GetExtendedStyle(); + +protected: + + bool m_bInitControl; // true for initialization. + + // Ignore: + //{{AFX_VIRTUAL(CXTListCtrl) + protected: + virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult); + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTListCtrl) + afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDestroy(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + //}}AFX_MSG + + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE DWORD CXTListCtrl::GetExtendedStyle() { + return CXTListCtrlBase::GetExtendedStyle(); +} +AFX_INLINE void CXTListCtrl::SetExtendedStyle(DWORD dwExStyle){ + CXTListCtrlBase::SetExtendedStyle(dwExStyle); +} + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE DWORD CXTListCtrlBase::GetExtendedStyle() { + ASSERT(::IsWindow(m_pListCtrl->GetSafeHwnd())); return (DWORD)m_pListCtrl->SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); +} +AFX_INLINE void CXTListCtrlBase::SetExtendedStyle(DWORD dwExStyle) { + ASSERT(::IsWindow(m_pListCtrl->GetSafeHwnd())); m_pListCtrl->SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, GetExtendedStyle()|dwExStyle); +} +AFX_INLINE int CXTListCtrlBase::SetSortImage( int nCol, BOOL bAsc ) { + ASSERT(::IsWindow(m_pListCtrl->GetSafeHwnd())); return GetFlatHeaderCtrl()->SetSortImage(nCol, bAsc); +} +AFX_INLINE void CXTListCtrlBase::SetRowColors(COLORREF clrText, COLORREF clrTextBk) { + m_clrText = clrText; m_clrTextBk = clrTextBk; m_pListCtrl->Invalidate(); +} +AFX_INLINE void CXTListCtrlBase::SetMinimumColSize(int nSize) { + m_nMinColWidth = nSize; GetFlatHeaderCtrl()->SetMinSize(nSize); +} +AFX_INLINE int CXTListCtrlBase::GetMinimumColSize() { + return m_nMinColWidth; +} +AFX_INLINE int CXTListCtrlBase::GetMaximumColSize() { + return m_nMaxColWidth; +} +AFX_INLINE void CXTListCtrlBase::DisableColumnSizing(bool bDisable) { + m_bNoColSizing = bDisable; +} +AFX_INLINE CXTFlatHeaderCtrl* CXTListCtrlBase::GetFlatHeaderCtrl() const +{ + CHeaderCtrl* pHeaderCtrl = _xtGetHeaderCtrl(); + if (pHeaderCtrl && pHeaderCtrl->IsKindOf(RUNTIME_CLASS(CXTFlatHeaderCtrl))) { + return (CXTFlatHeaderCtrl*)pHeaderCtrl; + } + return NULL; +} +AFX_INLINE CHeaderCtrl* CXTListCtrlBase::_xtGetHeaderCtrl() const +{ + CHeaderCtrl * const pHeaderCtrl = + (CHeaderCtrl*)m_pListCtrl->GetDlgItem(0); + + // If the following assertion fails, you are performing an operation that + // requires columns to be added, before you added columns. + // For example, if you called SubclassHeader(), you need to make sure + // that the call to SubClassHeader() is placed after calls to + // InsertColumn(). + + ASSERT(pHeaderCtrl != NULL); + return pHeaderCtrl; +} +AFX_INLINE COLORREF CXTListCtrlBase::GetBackColor() { + return m_clrTextBk; +} +AFX_INLINE COLORREF CXTListCtrlBase::GetTextColor() { + return m_clrText; +} +////////////////////////////////////////////////////////////////////// + +#if _MSC_VER < 1200 // MFC 5.0 +AFX_INLINE POSITION CXTListCtrlBase::GetFirstSelectedItemPosition() const { + ASSERT(::IsWindow(m_pListCtrl->GetSafeHwnd())); return (POSITION) (1+m_pListCtrl->GetNextItem(-1, LVIS_SELECTED)); +} +AFX_INLINE int CXTListCtrlBase::GetNextSelectedItem(POSITION& pos) const { + ASSERT(::IsWindow(m_pListCtrl->GetSafeHwnd())); int nOldPos = (int)pos-1; pos = (POSITION) (1+m_pListCtrl->GetNextItem(nOldPos, LVIS_SELECTED)); return nOldPos; +} +#endif // MFC 5.0 + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTLISTCTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTListView.h b/Editor/XT/Include/XTListView.h new file mode 100644 index 0000000..56972c5 --- /dev/null +++ b/Editor/XT/Include/XTListView.h @@ -0,0 +1,98 @@ +// XTListView.h interface for the CXTListView class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTLISTVIEW_H__) +#define __XTLISTVIEW_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTListView is a multiple inheritance class derived from CListView and +// CXTListCtrlBase. This class implements flat header and generic sorting +// routines. +// See Also: CXTListCtrlBase +class _XT_EXT_CLASS CXTListView : public CListView, public CXTListCtrlBase +{ + DECLARE_DYNCREATE(CXTListView) + +public: + + // Summary: Constructs a CXTListView object. + CXTListView(); + + // Summary: Destroys a CXTListView object, handles cleanup and de-allocation. + virtual ~CXTListView(); + + // Input: dwExStyle - DWORD value that specifies the extended list-view control style. This + // parameter can be a combination of Extended List-View Styles. + // Summary: This member function is called to set extended styles for the list + // control, ie: LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, etc. See MSDN + // documentation for a complete list of available styles. + virtual void SetExtendedStyle(DWORD dwExStyle ); + + // Returns: A DWORD value representing the extended style of the list control. + // Summary: This member function is called to return the list control extended + // style. + DWORD GetExtendedStyle(); + +protected: + +public: + // Ignore: + //{{AFX_VIRTUAL(CXTListView) + public: + virtual void OnInitialUpdate(); + protected: + virtual void OnDraw(CDC* pDC); + virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult); + //}}AFX_VIRTUAL + +#ifdef _DEBUG + + virtual void AssertValid() const; + + virtual void Dump( + CDumpContext& dc) const; + +#endif + + // Ignore: + //{{AFX_MSG(CXTListView) + afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDestroy(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE DWORD CXTListView::GetExtendedStyle() { + return CXTListCtrlBase::GetExtendedStyle(); +} +AFX_INLINE void CXTListView::SetExtendedStyle(DWORD dwExStyle){ + CXTListCtrlBase::SetExtendedStyle(dwExStyle); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTLISTVIEW_H__) diff --git a/Editor/XT/Include/XTLogoPane.h b/Editor/XT/Include/XTLogoPane.h new file mode 100644 index 0000000..104d545 --- /dev/null +++ b/Editor/XT/Include/XTLogoPane.h @@ -0,0 +1,204 @@ +// XTLogoPane.h interface for the CXTLogoPane class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTLOGOPANE_H__) +#define __XTLOGOPANE_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTBasePane is a CWnd derived class. It is the base class used for +// creating CWnd objects to place in status bar panes that do custom paint +// routines. +class _XT_EXT_CLASS CXTBasePane : public CWnd +{ + DECLARE_DYNCREATE(CXTBasePane) + +public: + + // Summary: Constructs a CXTBasePane object. + CXTBasePane(); + + // Summary: Destroys a CXTBasePane object, handles cleanup and de-allocation. + virtual ~CXTBasePane(); + +protected: + + CString m_strWindowText; // NULL terminated string that represents the pane text. + + // Ignore: + //{{AFX_VIRTUAL(CXTLogoPane) + //}}AFX_VIRTUAL + +public: + + // Input: lpszWindowName - Text string to be associated with this pane. + // pParentWnd - Pointer to the owner status bar window. + // dwStyle - Window style. + // nID - Control ID. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to create a status bar pane object that performs + // custom draw routines. + virtual BOOL Create(LPCTSTR lpszWindowName,CWnd* pParentWnd,DWORD dwStyle=WS_CHILD|WS_VISIBLE,UINT nID=0xffff); + +protected: + + // Input: pDC - Pointer to the device context. + // rcClient - Size of the client area to draw. + // Summary: Override this virtual function in your derived class to perform your + // custom drawing routines. + virtual void DoPaint(CDC* pDC,CRect& rcClient); + + // Ignore: + //{{AFX_MSG(CXTBasePane) + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTLogoPane is a CXTBasePane derived class. CXTLogoPane works with +// CXTStatusBar and allows you to create a logo to place in your status +// bar area. +class _XT_EXT_CLASS CXTLogoPane : public CXTBasePane +{ +public: + + // Summary: Constructs a CXTLogoPane object. + CXTLogoPane(); + + // Summary: Destroys a CXTLogoPane object, handles cleanup and de-allocation. + virtual ~CXTLogoPane(); + +protected: + + CFont m_Font; // Font to be used. + CSize m_sizeText; // Size of the text to be displayed. + +public: + + // Input: lpszLogoText - A NULL terminated string that represents the text to be displayed. + // Summary: This member function will set the text to be displayed in the logo + // pane. + virtual void SetLogoText(LPCTSTR lpszLogoText); + + // Returns: A CString object that represents the text that is displayed + // in the logo pane. + // Summary: This member function returns a CString that represents the logo text. + virtual CString GetLogoText(); + + // Input: lpszFontName - A NULL terminated string that represents the text to be displayed. + // nHeight - Initial height for the font. + // nWeight - Initial weight for the font. + // bItalic - TRUE if the font is italic. + // bUnderline - TRUE if the font is underlined. + // Summary: This member function sets the font to be displayed in the logo pane. + virtual void SetLogoFont(LPCTSTR lpszFontName,int nHeight=24,int nWeight=FW_BOLD,BOOL bItalic=TRUE,BOOL bUnderline=FALSE); + + // Input: logFont - Address of a LOGFONT structure. + // Summary: This member function sets the font to be displayed in the logo pane. + virtual void SetLogoFont(LOGFONT& logFont); + + // Returns: A CSize object that represents the current size of the logo pane text. + // Summary: This member function will return the size of the text displayed in + // the logo pane. + CSize GetTextSize(); + + // Summary: This member function will calculate the size of the text that is displayed + // in the logo pane and initializes 'm_sizeText'. + void SetTextSize(); + + // Ignore: + //{{AFX_VIRTUAL(CXTLogoPane) + //}}AFX_VIRTUAL + +protected: + + // Input: pDC - Pointer to the device context. + // rcClient - Size of the client area to draw. + // Summary: Override this virtual function in your derived class to perform your + // custom drawing routines. + virtual void DoPaint(CDC* pDC,CRect& rcClient); + + // Ignore: + //{{AFX_MSG(CXTLogoPane) + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CSize CXTLogoPane::GetTextSize() { + SetTextSize(); m_sizeText.cx+=2; return m_sizeText; +} +AFX_INLINE void CXTLogoPane::SetLogoText(LPCTSTR lpszLogoText) { + m_strWindowText = lpszLogoText; +} +AFX_INLINE CString CXTLogoPane::GetLogoText() { + return m_strWindowText; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTIconPane is a CXTBasePane derived class. CXTIconPane works with +// CXTStatusBar and allows you to create a logo to place in your status +// bar area. +class _XT_EXT_CLASS CXTIconPane : public CXTBasePane +{ +public: + + // Summary: Constructs a CXTIconPane object. + CXTIconPane(); + + // Summary: Destroys a CXTIconPane object, handles cleanup and de-allocation. + virtual ~CXTIconPane(); + +protected: + + CSize m_sizeIcon; // Size of the icon to display. + CXTIconHandle m_hIcon; // Icon that is displayed in the status pane. + +public: + + // Input: nIconID - Resource ID of the icon to display. + // Summary: Call this member function to set the pane icon for this object. + void SetPaneIcon(int nIconID); + + // Input: lpszIconID - Resource ID of the icon to display. + // Summary: Call this member function to set the pane icon for this object. + void SetPaneIcon(LPCTSTR lpszIconID); + + // Input: pDC - Pointer to the device context. + // rcClient - Size of the client area to draw. + // Summary: Override this virtual function in your derived class to perform your + // custom drawing routines. + virtual void DoPaint(CDC* pDC,CRect& rcClient); + + // Ignore: + //{{AFX_MSG(CXTIconPane) + afx_msg void OnEnable(BOOL bEnable); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTLOGOPANE_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTMDIChildWnd.h b/Editor/XT/Include/XTMDIChildWnd.h new file mode 100644 index 0000000..3b197ab --- /dev/null +++ b/Editor/XT/Include/XTMDIChildWnd.h @@ -0,0 +1,194 @@ +// XTMDIChildWnd.h interface for the CXTMDIChildWnd class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTMDICHILDWND_H__) +#define __XTMDICHILDWND_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMDIChildWnd is a multiple inheritance class derived from CMDIChildWnd +// and CXTFrameImpl. CXTMDIChildWnd extends the standard CMDIChildWnd class +// to allow CXTDockWindow and CXTToolBar docking, customization, and cool +// menu support. +class _XT_EXT_CLASS CXTMDIChildWnd : public CMDIChildWnd, public CXTFrameImpl +{ + DECLARE_DYNCREATE(CXTMDIChildWnd) + +public: + + // Summary: Constructs a CXTMDIChildWnd object. + CXTMDIChildWnd(); + + // Summary: Destroys a CXTMDIChildWnd object, handles cleanup and de-allocation. + virtual ~CXTMDIChildWnd(); + + // Input: lpszProfileName - Name of a section in the initialization file or a key in the + // Windows registry where state information is stored. + // Summary: This member function is called by the frame window to restore the + // settings of the control bar. + virtual void LoadBarState(LPCTSTR lpszProfileName); + + // Input: lpszProfileName - Name of a section in the initialization file or a key in the + // Windows registry where state information is stored. + // Summary: This member function is called by the frame window to save the settings + // of the control bar. + virtual void SaveBarState(LPCTSTR lpszProfileName) const; + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides + // of its parent window to which the control bar can be docked, if supported. + // The style can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control bar will not + // dock. + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDocking(DWORD dwDockStyle); + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides + // of its parent window to which the control bar can be docked, if supported. + // The style can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control bar will not + // dock. + // dwFlatStyle - Specifies the look of the splitters that are inside dockbars. + // It can be one of the following: + // [ul] + // [li]CBRS_XT_NONFLAT Thick devstudio like non-flat splitters.[/li] + // [li]CBRS_XT_SEMIFLAT Thin 3D non-flat splitters.[/li] + // [li]CBRS_XT_FLAT Flat splitters.[/li] + // [/ul] + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDockingEx(DWORD dwDockStyle,DWORD dwFlatStyle); + + // Input: pBar - Points to the control bar to be docked. + // pDockBar - Points to the dockbar the control bar is docked to. + // lpRect - Determines, in screen coordinates, where the control bar will + // be docked in the non-client area of the destination frame window. + // Summary: This member function causes a control bar to be docked to the frame + // window. The control bar will be docked to one of the sides of the + // frame window specified in the calls to both CXTDockWindow::EnableDocking + // and CXTFrameWnd::EnableDocking. The side chosen is determined by the + // dockbar specified by 'pDockBar'. + void DockControlBar(CControlBar* pBar,CDockBar* pDockBar,LPCRECT lpRect = NULL); + + // BULLETED LIST: + + // Input: pBar - Points to the control bar to be docked. + // nDockBarID - Determines which sides of the frame window to consider for docking. + // It can be 0, or one or more of the following: + // [ul] + // [li]AFX_IDW_DOCKBAR_TOP Dock to the top side of the + // frame window.[/li] + // [li]AFX_IDW_DOCKBAR_BOTTOM Dock to the bottom side of + // the frame window.[/li] + // [li]AFX_IDW_DOCKBAR_LEFT Dock to the left side of the + // frame window.[/li] + // [li]AFX_IDW_DOCKBAR_RIGHT Dock to the right side of + // the frame window.[/li] + // [/ul] + // If 0, the control bar can be docked to any side enabled for + // docking in the destination frame window. + // lpRect - Determines, in screen coordinates, where the control bar will + // be docked in the non-client area of the destination frame window. + // Summary: This member function causes a control bar to be docked to the frame + // window. The control bar will be docked to one of the sides of the + // frame window specified in the calls to both CXTDockWindow::EnableDocking + // and CXTFrameWnd::EnableDocking. The side chosen is determined by + // 'nDockBarID'. + void DockControlBar(CControlBar* pBar,UINT nDockBarID = 0,LPCRECT lpRect = NULL); + + // Input: pBar1 - A CControlBar pointer to the control bar to be docked. + // pBar2 - A CControlBar pointer to the already docked control bar to be + // redocked on the left of 'pBar1'. + // Summary: This member function will redock a control bar specified by 'pBar2' + // to the left of a newly docked control bar specified by 'pBar1'. + virtual void DockControlBarLeftOf(CControlBar* pBar1,CControlBar* pBar2); + + // Summary: Call this function to display the Customize Toolbar dialog box. + // This dialog box allows the user to customize the toolbar by adding + // and deleting buttons. + void Customize(); + +protected: + + CXTCoolMenu m_hookCoolMenus; // Cool menu hook. + + // Ignore: + //{{AFX_VIRTUAL(CXTMDIChildWnd) + public: + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs, UINT uIcon); + virtual void OnUpdateFrameTitle(BOOL bAddToTitle); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTMDIChildWnd) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + afx_msg void OnCustomizeBar(); + afx_msg void OnUpdateChevron(CCmdUI* pCmdUI); + + DECLARE_MESSAGE_MAP() + + friend class CXTMDIFrameWnd; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTMDIChildWnd::Customize() { + OnCustomizeBar(); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTMDICHILDWND_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTMDIFrameWnd.h b/Editor/XT/Include/XTMDIFrameWnd.h new file mode 100644 index 0000000..8299ca6 --- /dev/null +++ b/Editor/XT/Include/XTMDIFrameWnd.h @@ -0,0 +1,292 @@ +// XTMDIFrameWnd.h interface for the CXTMDIFrameWnd class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTMDIFRAMEWND_H__) +#define __XTMDIFRAMEWND_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMDIFrameWnd is a multiple inheritance class derived from CMDIFrameWnd +// and CXTFrameImpl. CXTMDIFrameWnd extends the standard CMDIFrameWnd +// class to allow CXTDockWindow and CXTToolBar docking, customization, +// and cool menu support. +class _XT_EXT_CLASS CXTMDIFrameWnd : public CMDIFrameWnd, public CXTFrameImpl +{ + DECLARE_DYNCREATE(CXTMDIFrameWnd) + +public: + + // Summary: Constructs a CXTMDIFrameWnd object. + CXTMDIFrameWnd(); + + // Summary: Destroys a CXTMDIFrameWnd object, handles cleanup and de-allocation. + virtual ~CXTMDIFrameWnd(); + +public: + + // Returns: A pointer to a CXTCoolMenu object that represents the cool menu object + // associated with the frame. + // Summary: This member function gets a pointer to the cool menu object associated + // with the frame. + CXTCoolMenu* GetCoolMenu(); + + // Returns: A pointer to a CXTMenuBar object that represents the menu bar associated + // with the frame. + // Summary: This member function gets a pointer to the menu bar associated with + // the frame. + CXTMenuBar* GetMenuBar(); + + // Input: nIDToolBars - Array of toolbar resource IDs. The cool menu will use the toolbar + // commands to map the icons placed next to the corresponding menu commands. + // nSize - Size of the array of toolbars. + // Summary: Call this member function to install cool menus for your application. + // Cool menus are menus that appear with icons next to the menu titles. + // Pass in your toolbar resource array to initialize. + void InstallCoolMenus(const UINT* nIDToolBars,int nSize); + + // Input: nIDToolBar - Toolbar resource ID. The cool menu will use the toolbar commands + // to map the icons placed next to the corresponding menu commands. + // Summary: Call this member function to install cool menus for your application. + // Cool menus are menus that appear with icons next to the menu titles. + // Pass in your toolbar resource to initialize. + void InstallCoolMenus(const UINT nIDToolBar); + + // Input: lpszProfileName - Name of a section in the initialization file or a key in the + // Windows registry where state information is stored. + // Summary: This member function is called by the frame window to restore the + // settings of the control bar. + virtual void LoadBarState(LPCTSTR lpszProfileName); + + // Input: lpszProfileName - Name of a section in the initialization file or a key in the + // Windows registry where state information is stored. + // Summary: This member function is called by the frame window to save the settings + // of the control bar. + virtual void SaveBarState(LPCTSTR lpszProfileName) const; + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides + // of its parent window to which the control bar can be docked, if supported. + // The style can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control + // bar will not dock. + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDocking(DWORD dwDockStyle); + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides + // of its parent window to which the control bar can be docked, if supported. + // The style can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control + // bar will not dock. + // dwFlatStyle - Specifies the look of the splitters that are inside dockbars. It can be one + // of the following: + // [ul] + // [li]CBRS_XT_NONFLAT Thick devstudio like non-flat splitters.[/li] + // [li]CBRS_XT_SEMIFLAT Thin 3D non-flat splitters.[/li] + // [li]CBRS_XT_FLAT Flat splitters.[/li] + // [/ul] + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDockingEx(DWORD dwDockStyle,DWORD dwFlatStyle); + + // Input: pBar - A CControlBar pointer to the control bar to be docked. + // pDockBar - A CDockBar pointer to the dockbar the control bar is docked to. + // lpRect - Determines, in screen coordinates, where the control bar will + // be docked in the non-client area of the destination frame window. + // Summary: This member function causes a control bar to be docked to the frame + // window. The control bar will be docked to one of the sides of the + // frame window specified in the calls to both CXTDockWindow::EnableDocking + // and CXTFrameWnd::EnableDocking. The side chosen is determined by the + // dockbar specified by 'pDockBar'. + void DockControlBar(CControlBar* pBar,CDockBar* pDockBar,LPCRECT lpRect = NULL); + + // Input: pBar - A CControlBar pointer to the control bar to be docked. + // nDockBarID - Determines which sides of the frame window to consider for docking. + // It can be 0, or one or more of the following: + // [ul] + // [li]AFX_IDW_DOCKBAR_TOP Dock to the top side of the + // frame window.[/li] + // [li]AFX_IDW_DOCKBAR_BOTTOM Dock to the bottom side of + // the frame window.[/li] + // [li]AFX_IDW_DOCKBAR_LEFT Dock to the left side of the + // frame window.[/li] + // [li]AFX_IDW_DOCKBAR_RIGHT Dock to the right side of + // the frame window.[/li] + // [/ul] + // If 0, the control bar can be docked to any side enabled for + // docking in the destination frame window. + // lpRect - Determines, in screen coordinates, where the control bar will + // be docked in the non-client area of the destination frame window. + // Summary: This member function causes a control bar to be docked to the frame + // window. The control bar will be docked to one of the sides of the frame + // window specified in the calls to both CXTDockWindow::EnableDocking + // and CXTFrameWnd::EnableDocking. The side chosen is determined by 'nDockBarID'. + void DockControlBar(CControlBar* pBar,UINT nDockBarID = 0,LPCRECT lpRect = NULL); + + // Input: pBar1 - A CControlBar pointer to the control bar to be docked. + // pBar2 - A CControlBar pointer to the already docked control bar to be + // redocked on the left of 'pBar1'. + // Summary: This member function will redock a control bar specified by 'pBar2' + // to the left of a newly docked control bar specified by 'pBar1'. + virtual void DockControlBarLeftOf(CControlBar* pBar1,CControlBar* pBar2); + + // Returns: A pointer to a CMenu object that represents the active + // menu for the frame. + // Summary: This member function retrieves a pointer to the menu for the frame + // window. + virtual CMenu* GetMenu() const; + + // Input: nCommandID - The command ID of a menu item to hide. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified command to the list of menu + // items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItem(UINT nCommandID); + + // Input: lpszItem - Text string representing the popup menu item to hide. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified menu item to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItem(LPCTSTR lpszItem); + + // Input: IDs - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified commands to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItems(const UINT* nCommandIDs,int nSize); + + // Input: lpszItems - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified menu items to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItems(const LPCTSTR lpszItems,int nSize); + + // Summary: This member function redraws the menu bar. If a menu bar is changed + // after Windows has created the window, call this function to draw the + // changed menu bar. Overrides the CWnd implementation. + void DrawMenuBarX(); + + // Summary: Call this function to display the Customize Toolbar dialog box. + // This dialog box allows the user to customize the toolbar by adding + // and deleting buttons. + void Customize(); + + // Returns: true if successful, otherwise returnsfalse. + // Summary: This member function will initialize the accelerator manager for the + // framework. + bool InitAccelManager(); + + // Input: iNormalIndex - Index where the 'Tools' menu should be inserted into the standard menu. + // iWindowIndex - Index where the 'Tools' menu should be inserted into the MDI window menu. + // iArgPopupMenu - Resource ID of the popup menu to be displayed for the Arguments + // browse edit box. + // iDirPopupMenu - Resource ID of the popup menu to be displayed for the Initial + // Directory browse edit box. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to initialize the Tools manager for your + // application. The Tools manager will insert a "Tools" menu into your + // application's menu which allows the user to customize and add custom + // commands the the menu. Typically used with toolbar customization, + // the Tools manager should be initialized when your frame is loaded by + // overriding the virtual function CFrameWnd::LoadFrame and can be managed + // by selecting the 'Tools' tab in the Customize dialog. + bool InitToolsManager(int iNormalIndex,int iWindowIndex=-1,int iArgPopupMenu=0,int iDirPopupMenu=0); + + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to initialize the Options manager for your + // application. Typically used with toolbar customization, the Options + // manager will allow the user to configure options related to the toolbar + // and menu behavior for the application. The Options manager should + // be initialized when your frame is loaded by overriding the virtual + // function CFrameWnd::LoadFrame and can be managed by selecting the 'Options' + // tab in the Customize dialog. + bool InitOptionsManager(); + +protected: + + virtual void SetDockState(const CXTDockState& state); + virtual void GetDockState(CXTDockState& state) const; + + // Ignore: + //{{AFX_VIRTUAL(CXTMDIFrameWnd) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs, UINT uIcon); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTMDIFrameWnd) + afx_msg void OnSysColorChange(); + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); + //}}AFX_MSG + + afx_msg void OnCustomizeBar(); + afx_msg void OnWindowList(); + afx_msg BOOL OnToolsManager(UINT nID); + afx_msg void OnUpdateToolsManager(CCmdUI* pCmdUI); + afx_msg void OnUpdateChevron(CCmdUI* pCmdUI); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTMDIFrameWnd::Customize() { + OnCustomizeBar(); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTMDIFRAMEWND_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTMDIWndTab.h b/Editor/XT/Include/XTMDIWndTab.h new file mode 100644 index 0000000..8c33dce --- /dev/null +++ b/Editor/XT/Include/XTMDIWndTab.h @@ -0,0 +1,276 @@ +// XTMDIWndTab.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTMDIWNDTAB_H__) +#define __XTMDIWNDTAB_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// forwards + +class CXTMDIWndTab; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMDIClientWnd is a CWnd derived helper class for the CXTMDIWndTab tab +// control. This class routes messages sent to the client window back +// to the tab control. +class _XT_EXT_CLASS CXTMDIClientWnd : public CWnd +{ +public: + + // Input: pMDIWndTab - Pointer to a CXTMDITabWnd object. + // Summary: Constructs a CXTMDIClientWnd object. + CXTMDIClientWnd(CXTMDIWndTab* pMDIWndTab); + + // Summary: Destroys a CXTMDIClientWnd object, handles cleanup and de-allocation. + virtual ~CXTMDIClientWnd(); + +protected: + + int m_iBorderGap; // Amount, in pixels, between the client and the tab control. + CXTMDIWndTab* m_pMDIWndTab; // Pointer to the MDI tab control. + +public: + + // Input: iSize - Amount, in pixels, of gap between the tab control and the client. + // Summary: This member function will set the size of the gap between the client + // area and the tab control. + void SetBorderGap(int iSize); + + // Ignore: + //{{AFX_VIRTUAL(CXTMDIClientWnd) + protected: + virtual void CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType = adjustBorder); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTMDIClientWnd) + //}}AFX_MSG + + afx_msg LRESULT OnMDICreate(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnMDIDestroy(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnMDIActivate(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTMDIClientWnd::SetBorderGap(int iBorderGap) { + m_iBorderGap = iBorderGap; +} + +////////////////////////////////////////////////////////////////////// +// Summary: XT_MDICHILD is a stand alone structure class. It is used to create +// an XT_MDICHILD structure. +struct XT_MDICHILD +{ + int iItem; // Index of the item in the tab control. + HWND hWnd; // Window handle of the tab item. + CString strItem; // Tab label. +}; + +// Summary: Array of XT_MDICHILD structs that represent each item in the tab control. +typedef CList CMDIChildArray; + +// Summary: CMap definition for mapping icons with window handles. +typedef CMap CXTIconWndMap; + +// Summary: CMap definition for mapping strings to window handles. +typedef CMap CXTStringMap; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMDIWndTab is a multiple inheritance class derived from CTabCtrl and +// CXTTabCtrlBase. CXTMDIWndTab is used to create a tab control for a multiple +// document interface (MDI) application. +class _XT_EXT_CLASS CXTMDIWndTab : public CTabCtrl, public CXTTabCtrlBase +{ + DECLARE_DYNAMIC(CXTMDIWndTab) + +public: + + // Summary: Constructs a CXTMDIWndTab object. + CXTMDIWndTab(); + + // Summary: Destroys a CXTMDIWndTab object, handles cleanup and de-allocation. + virtual ~CXTMDIWndTab(); + +protected: + + int m_iBorderGap; // Amount, in pixels, between the client and the tab control. + int m_iHitTest; // Index of the tab that received a right click. + int m_nPos; // Index of the popup menu contained in the menu. + UINT m_nDefCmd; // Command ID of the default menu item for the popup menu. + UINT m_popupMenuID; // Popup menu resource ID. + HWND m_hActiveChild; // Active MDI child. + BOOL m_bNoIcons; // TRUE if no icons are used. + BOOL m_bRecalcLayoutPending; // Tells if a request to recalc the parent frame is pending. + DWORD m_dwInitSignature; // Initialization state signature to synch up posted init requests. + CImageList m_imageList; // Tab image list. + CMDIFrameWnd* m_pMDIFrameWnd; // Points to the owner frame. + CMDIChildArray m_arMDIChildern; // Array of the MDI windows added to the tab control. + CXTMDIClientWnd* m_pMDIClientWnd; // Window that receives messages on behalf of the MDI client. + CXTIconWndMap m_mapTabIcons; // Hash table that maps icons to the MDI child frame windows. + CXTStringMap m_mapTabLabels; // Hash table that maps labels to the MDI child frame windows. + +public: + + // Input: iIndex - Zero-based index of the tab to set the tab icon for. + // hIcon - Reference to an HICON handle that represents the tab icon. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to set the icon for the tab item specified + // by 'iIndex'. + bool SetTabIcon(int iIndex,HICON& hIcon); + + // Input: hChildWnd - Valid HWND of the MDI child window to set the tab icon for. + // hIcon - Reference to an HICON handle that represents the tab icon. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to set the icon for the tab item specified + // by 'hChildWnd'. + bool SetTabIcon(HWND hChildWnd,HICON& hIcon); + + // Input: iIndex - Zero-based index of the tab to set the tab text for. + // strLabel - Reference to a CString object that represents the tab label. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to set the label for the tab item specified + // by 'iIndex'. + bool SetTabLabel(int iIndex,CString& strLabel); + + // Input: hChildWnd - Valid HWND of the MDI child window to set the tab text for. + // strLabel - Reference to a CString object that represents the tab label. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to set the label for the tab item specified + // by 'hChildWnd'. + bool SetTabLabel(HWND hChildWnd,CString& strLabel); + + // Input: pMDIFrameWnd - Points to the parent MDI frame window. + // dwStyle - Style for the tab control. It can be any of the TCS_ values. + // bNoIcons - Set to TRUE for no icon to display + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will install the MDI tab views with your application. + virtual BOOL Install(CMDIFrameWnd* pMDIFrameWnd,DWORD dwStyle=TCS_BOTTOM|TCS_HOTTRACK,BOOL bNoIcons=xtAfxData.bXPMode); + + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will uninstall the MDI tab views from your application. + virtual BOOL UnInstall(); + + // Input: point - Pointer to a CPoint object that contains the cursor screen + // coordinates. Use default for the current cursor position. + // Returns: The zero-based index of the tab, or -1 if no tab is at the specified point. + // Summary: Call this member function to retrieve the tab index from the current + // cursor position. + int TabFromPoint(CPoint point) const; + + // Input: iIndex - Index of the tab control. If -1, then the tab under the mouse when + // the last right click was performed will be used. + // Returns: A CWnd object if successful, otherwise returns NULL. + // Summary: This member function will return a pointer to the child frame associated + // with the tab item. + CMDIChildWnd* GetFrameWnd(int iIndex=-1) const; + + // Input: point - CPoint object that represents the cursor position. + // Returns: A CWnd object if successful, otherwise returns NULL. + // Summary: This member function will return a pointer to the child frame associated + // with the tab item. + CMDIChildWnd* GetFrameWnd(CPoint point) const; + + // Input: popupMenuID - ID for the tab control popup menu. + // nPos - Index position in the menu resource. + // nDefCmd - ID of the default menu command, will display bold. + // Summary: This member function is used to set the resource ID for the popup menu + // used by the tab control. + void SetMenuID(UINT popupMenuID,int nPos=0,UINT nDefCmd=-1); + + // Input: iSize - Amount, in pixels, of gap between the tab control and the client. + // Summary: This member function will set the size of the gap between the client + // area and the tab control. + void SetBorderGap(int iSize); + + // Input: hWnd - Handle to a valid CMDIChildWnd object. + // Returns: A const CString object that represents the document title. + // Summary: This member function will get the text for the specified MDI child + // window. + CString GetChildWndText(HWND hWnd) const; + +protected: + + // Summary: This member function is called to initialize the font for the tab control + // associated with this view. + virtual void InitializeFont(); + + // Input: pChildFrame - A pointer to a valid child frame window. + // bRecalcLayout - TRUE to force the MDI frame window to recalc the layout. + // Summary: This member function is called to insert a child frame into the MDI + // tab control. + virtual void InsertTabWnd(CMDIChildWnd* pChildFrame,BOOL bRecalcLayout=TRUE); + + // Returns: FALSE if there is no active document, otherwise returns TRUE. + // Summary: This member function is called by the tab control to ensure the current + // selection matches the active document. + BOOL RefreshActiveSel(); + + // Summary: This member function is called by the tab control to ensure the tab + // labels match their corresponding views. + void RefreshTabLabels(); + + // Summary: This member function is called by the tab control to ensure the stored + // indexes match their corresponding tab indexes. + void RefreshIndexes(); + + // Ignore: + //{{AFX_VIRTUAL(CXTMDIWndTab) + //}}AFX_VIRTUAL + + virtual void OnMDICreate(HWND hWnd); + virtual void OnMDIDestroy(HWND hWnd); + virtual void OnMDIActivate(HWND hWnd); + + // Ignore: + //{{AFX_MSG(CXTMDIWndTab) + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); + afx_msg void OnNcPaint(); + afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDestroy(); + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + //}}AFX_MSG + + afx_msg void OnIdleUpdateCmdUI(); + afx_msg LRESULT OnXtUpdate(WPARAM, LPARAM); + afx_msg void OnPaint(); + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + afx_msg void OnSysColorChange(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnTabClose(); + + DECLARE_MESSAGE_MAP() + + friend class CXTMDIClientWnd; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTMDIWndTab::SetMenuID(UINT popupMenuID, int nPos, UINT nDefCmd) { + m_popupMenuID = popupMenuID; m_nPos = nPos; m_nDefCmd = nDefCmd; +} +AFX_INLINE void CXTMDIWndTab::SetBorderGap(int iBorderGap) { + m_iBorderGap = iBorderGap; m_pMDIClientWnd->SetBorderGap(iBorderGap + ::GetSystemMetrics(SM_CXSIZEFRAME)); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTMDIWNDTAB_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTMaskEdit.h b/Editor/XT/Include/XTMaskEdit.h new file mode 100644 index 0000000..68919a4 --- /dev/null +++ b/Editor/XT/Include/XTMaskEdit.h @@ -0,0 +1,344 @@ +// XTMaskEdit.h interface for the CXTMaskEdit class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTMASKEDIT_H__) +#define __XTMASKEDIT_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMaskEdit is a CXTFlatEdit derived class. It allows text masking to be +// applied to the control to format it for special editing restrictions. +class _XT_EXT_CLASS CXTMaskEdit : public CXTFlatEdit +{ + DECLARE_DYNAMIC(CXTMaskEdit) + +public: + + // Summary: Constructs a CXTMaskEdit object. + CXTMaskEdit(); + + // Summary: Destroys a CXTMaskEdit object, handles cleanup and de-allocation. + virtual ~CXTMaskEdit(); + +protected: + + int m_nStartChar; // Current position of the first character in the current selection. + int m_nEndChar; // Current position of the first non-selected character past the end of the current selection. + bool m_bUseMask; // true to use the edit mask. + bool m_bOverType; // true to over type the text, set with VK_INSERT key press. + bool m_bRedo; // true to redo, or false to undo. + bool m_bModified; // true if mask edit has been modified. + TCHAR m_chPrompt; // Prompt character used to identify the text entry. + CString m_strMask; // Buffer that holds the actual edit mask value. + CString m_strDefault; // Contains the edit controls default display text. + CString m_strUndoBuffer; // Holds the contents of the undo buffer. + CString m_strRedoBuffer; // Holds the contents of the redo buffer. + CXTString m_strWindowText; // Buffer that holds the actual edit text. + CXTString m_strLiteral; // Literal format that restricts where the user can enter text. + +public: + + // Input: bUseMask - true to enable the mask. false to disable the mask. + // Summary: Call this member function to enable or disable the mask for the mask + // edit control. + void SetUseMask(bool bUseMask); + + // Returns: true if the mask can be used, otherwise returns false. + // Summary: This member function is called to determine if the mask for the edit + // control can be used. + bool CanUseMask(); + + // Input: bOverType - true to enable type over. + // Summary: This member function is called to enable or disable type over, also + // known as insert mode. + void SetOverType(bool bOverType); + + // Returns: true if type over is enabled, otherwise returns false. + // Summary: This member function is called to determine if type over has been enabled. + bool CanOverType(); + + // Input: iPos - Index of the character to check. + // Returns: true if the index is valid, otherwise returns false. + // Summary: This member function is called to determine if the index specified + // by 'iPos' is a valid index for the currently displayed edit text. + bool PosInRange(int iPos); + + // Returns: A TCHAR data type. + // Summary: This member function retrieves the character that is currently used as + // the mask prompt. The mask prompt indicates that the field is editable. + TCHAR GetPromptChar(); + + // Input: ch - A TCHAR data type. + // Summary: This member function is called to set the prompt character that is + // displayed to the user that indicates the field can be edited. + void SetPromptChar(TCHAR ch); + + // Summary: This member function is called to perform a cut operation using the + // currently selected text. + void MaskCut(); + + // Summary: This member function is called to perform a copy operation using the + // currently selected text. + void MaskCopy(); + + // Summary: This member function is called to perform a paste operation using the + // current clipboard text. + void MaskPaste(); + + // Summary: This member function is called to clear the current text selection. + void MaskClear(); + + // Summary: This member function is called to undo the previous action. + void MaskUndo(); + + // Summary: This member function is called to select all text in the mask edit + // control. + void MaskSelectAll(); + + // Returns: true if the text has changed, otherwise returns false. + // Summary: This member function is called to determine if the text has been modified. + bool IsModified(); + + // Input: lpszMask - The format for the mask field. For example, if you wanted to set + // the mask for a phone number, and you only wanted digits to be entered, + // your mask might look like this; _T("(000) 000-0000"). + // lpszLiteral - The literal format is entered here. Wherever you place an underscore + // ('_') is where the user will be allowed to enter data only. Using + // the phone number example; _T("(___) ___-____"). + // lpszDefault - Text that is to be displayed when the control is initialized. For + // example; _T("(800) 555-1212"). If NULL, 'lpszLiteral' is used to initialize + // the edit text. + // Summary: This member function will set the mask for the edit control. The values + // that can be set are: + // + //
+	//			Mask Character    Description
+	//			-------------------------------------------------
+	//			0                 Numeric (0-9)
+	//			9                 Numeric (0-9) or space (' ')
+	//			#                 Numeric (0-9) or space (' ') or ('+') or ('-')
+	//			L                 Alpha (a-Z) 
+	//			?                 Alpha (a-Z) or space (' ') 
+	//			A                 Alpha numeric (0-9 and a-Z)
+	//			a                 Alpha numeric (0-9 and a-Z) or space (' ') 
+	//			&                 All print character only 
+	//			H                 Hex digit (0-9 and A-F)
+	//			X                 Hex digit (0-9 and A-F) and space (' ')
+	//			>                 Forces characters to upper case (A-Z)
+	//			<                 Forces characters to lower case (a-z)
+ virtual void SetEditMask(LPCTSTR lpszMask,LPCTSTR lpszLiteral,LPCTSTR lpszDefault=NULL); + + // Input: nChar - Contains the character code value of the key. + // bBeep - true to enable beep. false to disable beep. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is used internally to validate the character indicated + // by 'nChar'. + virtual bool CheckChar(UINT& nChar,bool bBeep=true); + + // Input: nChar - Contains the character code value of the key. + // nEndPos - Index of character in display string. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is used internally to process the character passed + // in by 'nChar' whose index is specified by 'nEndPos'. + virtual bool ProcessMask(UINT& nChar,int nEndPos); + + // Ignore: + //{{AFX_VIRTUAL(CXTMaskEdit) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + //}}AFX_VIRTUAL + + virtual bool CorrectPosition(int& iPos, bool bForward=true, bool bBeep=true); + virtual void DeleteCharAt(int iPos); + virtual void InsertCharAt(int iPos, TCHAR nChar); + virtual bool CopyToClipboard(LPCTSTR lpszText); + virtual CString GetMaskedText(int iPos=0); + virtual BOOL SelectionMade(); + +protected: + + // Ignore: + //{{AFX_MSG(CXTMaskEdit) + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI); + afx_msg void OnEditCut( ); + afx_msg void OnEditCopy( ); + afx_msg void OnEditPaste( ); + afx_msg void OnEditClear( ); + afx_msg void OnEditUndo( ); + afx_msg void OnEditSelectAll( ); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTMaskEdit::SetUseMask(bool bUseMask ) { + m_bUseMask = bUseMask; +} +AFX_INLINE bool CXTMaskEdit::CanUseMask() { + return m_bUseMask; +} +AFX_INLINE void CXTMaskEdit::SetOverType(bool bOverType) { + m_bOverType = bOverType; +} +AFX_INLINE bool CXTMaskEdit::CanOverType() { + return m_bOverType; +} +AFX_INLINE bool CXTMaskEdit::PosInRange(int iPos) { + return ( ( iPos >= 0 ) && ( iPos < m_strLiteral.GetLength( ) ) ); +} +AFX_INLINE TCHAR CXTMaskEdit::GetPromptChar() { + return m_chPrompt; +} +AFX_INLINE BOOL CXTMaskEdit::SelectionMade() { + GetSel( m_nStartChar, m_nEndChar ); return ( m_nStartChar != m_nEndChar ); +} +AFX_INLINE bool CXTMaskEdit::IsModified() { + return m_bModified; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTDateEdit is a CXTMaskEdit derived class. It is specifically +// geared toward editing date fields. +class _XT_EXT_CLASS CXTDateEdit : public CXTMaskEdit +{ + DECLARE_DYNAMIC(CXTDateEdit) + +public: + + // Summary: Constructs a CXTDateEdit object. + CXTDateEdit(); + + // Input: dt - A reference to a COleDateTime object that represents the + // date to display. + // Summary: This member function will set the time based on the text string + // passed in as 'strDate'. + virtual void SetDateTime(COleDateTime& dt); + + // Input: strDate - A NULL terminated string that represents the date to display. + // Summary: This member function will set the time based on the text string + // passed in as 'strDate'. + virtual void SetDateTime(CString strDate); + + // Returns: A COleDateTime object representing the currently displayed date. + // Summary: This member function will retrieve a COleDateTime object that + // represents the currently displayed date. + virtual COleDateTime GetDateTime(); + + // Returns: A CString object representing the currently displayed date. + // Summary: This member function will retrieve a CString object that represents + // the currently displayed date. + virtual CString GetWindowDateTime(); + + // Input: lpszData - A NULL terminated string that represents the date to convert. + // Returns: A COleDateTime object that represents the converted date string. + // Summary: This member function will read the date string passed in as 'lpszData' + // and is converted and returned as a COleDateTime object. + virtual COleDateTime ReadOleDateTime(LPCTSTR lpszData); + + // Input: nChar - Contains the character code value of the key. + // nEndPos - Index of character in display string. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is used internally to process the character passed + // in by 'nChar' whose index is specified by 'nEndPos'. + virtual bool ProcessMask(UINT nChar,int nEndPos); + + // Input: strData - String reference that is filled with the date. + // dt - COleDateTime object that represents the date to format. + // Summary: This member function will read the date passed in as 'dt', and format + // the 'strData' string as DD/MM/YY. + virtual void FormatOleDateTime(CString& strData,COleDateTime dt); +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTimeEdit is a CXTDateEdit derived class. It is specifically geared +// toward editing time fields. +class _XT_EXT_CLASS CXTTimeEdit : public CXTDateEdit +{ + DECLARE_DYNAMIC(CXTTimeEdit) + +public: + + // Summary: Constructs a CXTTimeEdit object. + CXTTimeEdit(); + +protected: + + int m_iHours; // Represents the hours to display. + int m_iMins; // Represents the minutes to display. + bool m_bMilitary; // true if military time is used. + +public: + + // Input: nHours - The new hour to be displayed. + // Summary: This member function will update the hours displayed. + virtual void SetHours(int nHours); + + // Input: nMins - The new minutes to be displayed. + // Summary: This member function will update the minutes displayed. + virtual void SetMins(int nMins); + + // Input: nHours - The new hour to be displayed. + // nMins - The new minutes to be displayed. + // Summary: This member function will update the hours and minutes that are displayed + // for the time edit control. + virtual void SetTime(int nHours,int nMins); + + // Returns: An integer value that represents the hours displayed. + // Summary: This member function will retrieve the hours displayed for the time edit + // control. + int GetHours() const; + + // Returns: An integer value that represents the minutes displayed. + // Summary: This member function will retrieve the minutes displayed for the time + // edit control. + int GetMins() const; + + // Input: nChar - Contains the character code value of the key. + // nEndPos - Index of the character in the display string. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is used internally to process the character + // passed in by 'nChar' whose index is specified by 'nEndPos'. + virtual bool ProcessMask(UINT nChar,int nEndPos); + + // Input: strData - String reference that is filled with the time. + // dt - COleDateTime object that represents the time to format. + // Summary: This member function will read the time passed in as 'dt', + // and format the 'strData' string as HH:MM. + virtual void FormatOleDateTime(CString& strData,COleDateTime dt); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE int CXTTimeEdit::GetHours() const { + return m_iHours; +} +AFX_INLINE int CXTTimeEdit::GetMins() const { + return m_iMins; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTMASKEDIT_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTMemDC.h b/Editor/XT/Include/XTMemDC.h new file mode 100644 index 0000000..04d0464 --- /dev/null +++ b/Editor/XT/Include/XTMemDC.h @@ -0,0 +1,82 @@ +// XTMemDC.h interface for the CXTMemDC class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTMEMDC_H__) +#define __XTMEMDC_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMemDC is a CDC derived class. CXTMemDC is an extension of CDC that +// helps eliminate screen flicker when windows are resized, by painting +// to an off screen bitmap. The class then uses CDC::BitBlt to copy the +// bitmap back into the current device context after all items have been +// painted. +class _XT_EXT_CLASS CXTMemDC : public CDC +{ +public: + DECLARE_DYNAMIC(CXTMemDC); + + // Input: pDC - A Pointer to the current device context. + // rect - Represents the size of the area to paint. + // clrColor - An RGB value that represents the background color of the area to paint. + // Defaults to COLOR_3DFACE. Pass in a value of -1 to disable background + // painting. + // Summary: Constructs a CXTMemDC object. + CXTMemDC(CDC* pDC,const CRect& rect,COLORREF clrColor=xtAfxData.clr3DFace); + + // Summary: Destroys a CXTMemDC object, handles cleanup and de-allocation. + virtual ~CXTMemDC(); + + // Summary: This member function is called to set the valid flag to false so the + // offscreen device context will not be drawn. + void Discard(); + + // Summary: This member function gets content from the given DC. + void FromDC(); + + // Returns: A reference to the CBitmap object associated with the memory device context. + // Summary: This member function retrieves a reference to the CBitmap object + // associated with the memory device context. + CBitmap& GetBitmap(); + +protected: + + CDC* m_pDC; // Saves the CDC passed in constructor. + BOOL m_bValid; // Flag used for autodraw in destructor. + CRect m_rc; // Rectangle of the drawing area. + CBitmap m_bitmap; // Offscreen bitmap. + HBITMAP m_hOldBitmap; // Original GDI object. + +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CBitmap& CXTMemDC::GetBitmap() { + return m_bitmap; +} +AFX_INLINE void CXTMemDC::Discard() { + m_bValid = FALSE; +} +AFX_INLINE void CXTMemDC::FromDC() { + BitBlt(0, 0, m_rc.Width(), m_rc.Height(), m_pDC, m_rc.left, m_rc.top, SRCCOPY); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTMEMDC_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTMemFile.h b/Editor/XT/Include/XTMemFile.h new file mode 100644 index 0000000..11b89c5 --- /dev/null +++ b/Editor/XT/Include/XTMemFile.h @@ -0,0 +1,278 @@ +// XTMemFile.h interface for the CXTMemFile class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +//--------------------------------------------------------------------------- +// Used with permission Copyright © 1999 Maxallion +// XFile@maxallion.8m.com +//--------------------------------------------------------------------------- +// ICQ# 32304418 +// +// CCJMemFile - Extended Memory File - Beta - w/o a lot of error checking +// - Is used like a normal CFile or CStdioFile or CMemFile object +// - String Functions : ReadString, WriteString +// - Loads physical files into memory on creation and saves them back to disk on destruction +// - Can duplicate itself to other CFile derived objects +// - Has a Search function +// - can be read-accessed like an array +// +// OVERLOADED OPERATORS: +// = Imports from another file or sets file Position +// += Appends another file +// [] reads a byte like an array +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTMEMFILE_H__) +#define __XTMEMFILE_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMemFile is a CMemFile derived class. It is used to create a CXTMemFile +// object to support memory files. +// +// These memory files behave like disk files except that the file is stored +// in RAM rather than on disk. A memory file is useful for fast temporary +// storage or for transferring raw bytes or serialized objects between +// independent processes. +// +// CXTMemFile objects can automatically allocate their own memory, or you +// can attach your own memory block to the CXTMemFile object by calling +// Attach. In either case, memory for growing the memory file automatically +// is allocated in nGrowBytes-sized increments if 'nGrowBytes' is not zero. +// +// The memory block will automatically be deleted upon destruction of the +// CXTMemFile object if the memory was originally allocated by the CXTMemFile +// object. Otherwise, you are responsible for de-allocating the memory you +// attached to the object. +// +// You can access the memory block through the pointer supplied when you +// detach it from the CXTMemFile object by calling Detach. +// +// The most common use of CXTMemFile is to create a CXTMemFile object and +// use it by calling CFile member functions. Note that creating a CXTMemFile +// automatically opens it: you do not call CFile::Open, which is only used +// for disk files. Because CXTMemFile doesn't use a disk file, the data +// member CFile::m_hFile is not used and has no meaning. +// +// The CFile member functions Duplicate, LockRange, and UnlockRange are +// not implemented for CXTMemFile. If you call these functions on a CXTMemFile +// object, you will get a CNotSupportedException. +// +// CXTMemFile uses the run-time library functions malloc, realloc, and +// free to allocate, reallocate, and deallocate memory, and the intrinsic +// memcpy to block copy memory when reading and writing. If you would like +// to change this behavior or the behavior when CXTMemFile grows a file, +// derive your own class from CXTMemFile and override the appropriate functions. +class _XT_EXT_CLASS CXTMemFile : public CMemFile +{ + +public: + + // Input: nGrowBytes - The memory allocation increment in bytes. + // Summary: Constructs a CXTMemFile object. This overload opens an empty memory + // file. Note that the file is opened by the constructor and that you + // should not call CFile::Open. + CXTMemFile(UINT nGrowBytes = 1024 ); + + // Input: lpBuffer - Pointer to the buffer to be attached to CXTMemFile. + // nBufferSize - An integer that specifies the size of the buffer in bytes. + // nGrowBytes - The memory allocation increment in bytes. + // Summary: Constructs a CXTMemFile object. This overload acts the same as + // if you used the first constructor and immediately called Attach with + // the same parameters. + CXTMemFile(BYTE* lpBuffer,UINT nBufferSize,UINT nGrowBytes = 0); + + // Input: lpstFilename - A string that is the path to the desired file. The path can be relative, + // absolute, or a network name (UNC). + // uiOpenFlags - A UINT that defines the file’s sharing and access mode. It specifies + // the action to take when opening the file. You can combine options + // by using the bitwise-OR ( | ) operator. One access permission and + // one share option are required. The modeCreate and modeNoInherit modes + // are optional. See the CFile constructor for a list of mode options. + // Summary: Constructs a CXTMemFile object. + CXTMemFile(LPCTSTR lpstFilename,UINT uiOpenFlags); + + // Summary: Destroys a CXTMemFile object, handles cleanup and de-allocation. + virtual ~CXTMemFile(); + +private: + + UINT m_uiOpenFlags; + bool m_bOpen; + CFile m_File; + CFileException* m_pError; + +public: + + // Summary: This member function forces any data remaining in the file buffer + // to be written to the file. The use of Flush does not guarantee flushing + // of CArchive buffers. If you are using an archive, call CArchive::Flush + // first. + virtual void Flush(); + +#if _MFC_VER >= 0x0700 //MFC 7.0 + using CMemFile::Open; +#endif + + // Input: strFilename - Specifies a NULL terminated string that is the path to the desired file. + // uiOpenFlags - Specifies a UINT that defines the sharing and access mode in the file. + // It specifies the action to take when opening the file. You can combine + // options by using the bitwise-OR ( | ) operator. One access permission + // and one share option are required. The modeCreate and modeNoInherit + // modes are optional. See the CFile constructor for a list of mode options. + // pError - Specifies a pointer to an existing file-exception object that receives + // the status of a failed operation. + // Returns: true if successful, or false if it fails. + // Summary: This member function opens and loads a physical File into memory. + virtual bool Open(CString strFilename, UINT uiOpenFlags, CFileException* pError = NULL); + + // Summary: This member function saves the contents of the memory to the disk + // and closes it. + virtual void Close(); + + // Input: rString - A CString reference to an object to receive the string that is read. + // Returns: TRUE if successful, or FALSE if there is an error. + // Summary: This member function reads a string. + virtual BOOL ReadString(CString& rString); + + // Input: lpsz - Specifies a pointer to a buffer containing a null-terminated text + // string. + // Summary: This method writes data from a buffer to the file associated with + // the CArchive object. The terminating null character, \0, is not written + // to the file, nor is a newline character automatically written. + virtual void WriteString( LPCTSTR lpsz ); + +#if _MFC_VER >= 0x0700 //MFC 7.0 + using CMemFile::Duplicate; +#endif //MFC 7.0 + + // Input: fDuplicate - A pointer to a valid CFile object. + // Returns: true if successful, otherwise returns false. + // Summary: This member function will initialize the CXTMemFile object with + // the information specified in the 'fDuplicate' object. + virtual bool Duplicate(CFile *fDuplicate); + + // Input: strDup - A NULL terminated string. + // Returns: true if successful, otherwise returns false. + // Summary: This member function will initialize the CXTMemFile object with + // the information specified in the 'strDup' string object. + virtual bool Duplicate(CString strDup); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function discards all changes to file since Open() or + // last Flush(). + virtual bool Discard(); + + // Input: fSrc - A pointer to a valid CFile object. + // dwSourcePos - Represents the source file position. + // dwDestPos - Represents the destination file position. + // dwBytes - Number of bytes to insert. + // Returns: A DWORD value that represents the length of the copied bytes. + // Summary: This member function inserts any File and returns the length of the actual + // copied bytes. + virtual DWORD Insert(CFile* fSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes); + + // Input: strSrc - Specifies a NULL terminated string that is the path to the desired + // file. + // dwSourcePos - Represents the source file position. + // dwDestPos - Represents the destination file position. + // dwBytes - Number of bytes to insert. + // Returns: A DWORD value that represents the length of the copied bytes. + // Summary: This member function inserts any File and returns the length of + // the actual copied bytes. + virtual DWORD Insert(CString strSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes); + + // Input: fDest - A pointer to a valid CFile object. + // dwStartPos - Represents the starting position. + // dwBytes - Number of bytes to extract. + // Returns: A DWORD value that represents the length of the copied bytes. + // Summary: This member function extracts bytes to a file and returns the length + // of the actual copied bytes. + virtual DWORD Extract(CFile *fDest,DWORD dwStartPos, DWORD dwBytes); + + // Input: strDest - Specifies a NULL terminated string that is the path to the desired + // file. + // dwStartPos - Represents the starting position. + // dwBytes - Number of bytes to extract. + // Returns: A DWORD value that represents the length of the copied bytes. + // Summary: This member function extracts bytes to a file and returns the length + // of the actual copied bytes. + virtual DWORD Extract(CString strDest, DWORD dwStartPos, DWORD dwBytes); + + // Input: pData - Pointer to the buffer to receive the data found. + // dwDataLen - Size of the data to find. + // lStartPos - Starting position. + // Returns: A LONG data type. + // Summary: This member function finds data in the file. + LONG FindData(void* pData, DWORD dwDataLen, LONG lStartPos); + + // Input: fDup - A pointer to a valid CFile object. + // Summary: This member operator will initialize the CXTMemFile object with + // the object specified by 'fDup'. + void operator =(CFile* fDup); + + // Input: strDup - Specifies a NULL terminated string that is the path to the desired + // file. + // Summary: This member operator will initialize the CXTMemFile object with + // the object specified by 'strDup'. + void operator =(CString strDup); + + // Input: dwFilePos - DWORD value that specifies file position. + // Summary: This member operator will adjust the file position. + void operator =(DWORD dwFilePos); + + // Input: fApp - A pointer to a valid CFile object. + // Summary: This member operator will append the CXTMemFile object with the object + // specified by 'fApp'. + void operator +=(CFile *fApp); + + // Input: strApp - Specifies a NULL terminated string that is the path to the desired + // file. + // Summary: This member operator will append the CXTMemFile object with the object + // specified by 'strApp'. + void operator +=(CString strApp); + + // Input: dwFilePos - DWORD value that specifies file position. + // Summary: This member operator will perform indexing operations for the CXTMemFile + // object. Returns a BYTE data type. + BYTE operator [](DWORD dwFilePos); + +protected: + + // Returns: true if successful, otherwise returns false. + // Summary: This member function loads the file into memory. + virtual bool Load(); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function saves the file to disk. + virtual bool Save(); + + // Input: fImp - A pointer to a valid CFile object. + // Returns: true if successful, otherwise returns false. + // Summary: This member function imports the data of a CFile derived object + // (operator = ). + virtual bool Import(CFile *fImp); + + // Input: fApp - A pointer to a valid CFile object. + // Returns: true if successful, otherwise returns false. + // Summary: This member function appends a CFile derived object to the file + // (operator += ). + virtual bool Append(CFile* fApp); +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTMEMFILE_H__) diff --git a/Editor/XT/Include/XTMenuBar.h b/Editor/XT/Include/XTMenuBar.h new file mode 100644 index 0000000..dcfce24 --- /dev/null +++ b/Editor/XT/Include/XTMenuBar.h @@ -0,0 +1,702 @@ +// XTMenuBar.h interface for the CXTMenuBar class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTMENUBAR_H__) +#define __XTMENUBAR_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// forwards + +class CXTMenu; +class CXTMenuBarItem; +class CXTToolsManager; +class CXTSysMenuBarItem; +class CXTSubMenuBarItem; +class CXTControlMenuBarItem; +class CXTMenuCustomHandler; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_TRACK_STATE - Enumeration used by CXTMenuBar to determine the current +// state of the menu bar. +typedef enum XT_TRACK_STATE +{ + TRACK_NONE = 0, // Normal, not tracking anything. + TRACK_BUTTON, // Tracking buttons (F10/Alt mode). + TRACK_POPUP // Tracking popups. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMenuBarItem - Descriptor of a generic menu bar item +class _XT_EXT_CLASS CXTMenuBarItem : public CObject +{ + bool m_bWrapped; // Tells if this item is a line wrap + CPoint m_ptOrigin; // Origin of this item (its NW corner) + CXTMenuBar* const m_pMenuBar; // Owner of this item + +public: + + // Input: pMenuBar - Points to a CXTMenuBar object. + // Summary: Constructor initializes with default values + CXTMenuBarItem(CXTMenuBar* pMenuBar); + + // Returns: true if the item is hidden, otherwise returns false. + // Summary: Tells if this item is currently hidden. + virtual bool IsHidden() const; + + // Returns: A pointer to a CXTMenuBar object. + // Summary: Call this member function to return a pointer to the menubar. + CXTMenuBar* GetMenuBar() const; + + // Input: pDC - Pointer to a valid device context. + // Summary: Renders this item. + virtual void Render(CDC* pDC) = 0; + + // Input: pchAccelerator - A NULL terminated string. + // Returns: true if successful, otherwise returns false. + // Summary: Retrieves accelerator for this item if one exists . + virtual bool GetAccelerator(TCHAR* pchAccelerator); + + // Returns: A CSize object. + // Summary: Gets this item extent. + virtual CSize GetExtent() = 0; + + // Returns: true if the menubar is wrapped, otherwise returns false. + // Summary: Call this member function to determine if the menubar is wrapped. + bool IsWrapped() const; + + // Returns: true if the menubar is wrappable, otherwise returns false. + // Summary: Call this member function to determine if the menubar is wrappable. + virtual bool IsWrappable() const; + + // Input: bWrapped - True if the menubar is to be wrappable. + // Summary: Call this member funciton to set the wrappable state for the menubar. + void SetWrapped(bool bWrapped); + + // Returns: A CPoint object. + // Summary: Gets this item origin (its NW point) + CPoint GetOrigin() const; + + // Input: ptOrigin - A CPoint object. + // Summary: Gets this item origin (its NW point). + void SetOrigin(CPoint ptOrigin); + + // Returns: The amount in pixels representing spacing. + // Summary: Spacer specifies a distance between this and the following + // menu bar item, applicable if there is next item and this one is not + // wrapped. + virtual int GetSpacer() const; + + // Summary: Tracks associated popup menu, if any. + virtual void TrackMenu(); + + // Summary: Handles double click on this item. + virtual void OnDblClick(); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE bool CXTMenuBarItem::IsHidden() const { + /*// not hidden by default*/return false; +} +AFX_INLINE CXTMenuBar* CXTMenuBarItem::GetMenuBar() const { + return m_pMenuBar; +} +AFX_INLINE bool CXTMenuBarItem::GetAccelerator(TCHAR* /*pchAccelerator*/) { + return false; +} +AFX_INLINE bool CXTMenuBarItem::IsWrapped() const { + return IsWrappable() && m_bWrapped; +} +AFX_INLINE bool CXTMenuBarItem::IsWrappable() const { + return true; +} +AFX_INLINE void CXTMenuBarItem::SetWrapped(bool bWrapped) { + ASSERT(IsWrappable()); m_bWrapped = bWrapped; +} +AFX_INLINE CPoint CXTMenuBarItem::GetOrigin() const { + return m_ptOrigin; +} +AFX_INLINE void CXTMenuBarItem::SetOrigin(CPoint ptOrigin) { + m_ptOrigin = ptOrigin; +} +AFX_INLINE int CXTMenuBarItem::GetSpacer() const { + return 0; +} +AFX_INLINE void CXTMenuBarItem::TrackMenu() { +} +AFX_INLINE void CXTMenuBarItem::OnDblClick() { +} + +// Summary: CMap definition for mapping OLE items. +typedef CMap CXTMenu2OLEItemMap; + +// Summary: CTypedPtrArray definition for CXTMenuBarItem object arrays. +typedef CTypedPtrArray CXTMenuBarItemArray; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMenuBar is a CXTControlBar derived class. It is used to create an +// Office™ style menu bar. Use it the way you would a CToolBar, only you +// need to call LoadMenuBar instead of LoadToolbar. +class _XT_EXT_CLASS CXTMenuBar : public CXTControlBar +{ + DECLARE_DYNAMIC(CXTMenuBar) + +public: + + // Summary: Constructs a CXTMenuBar object. + CXTMenuBar(); + + // Summary: Destroys a CXTMenuBar object, handles cleanup and de-allocation. + virtual ~CXTMenuBar(); + +protected: + + int m_iDepressedItem; // Index of the currently depressed item. + int m_iTracking; // Index of the frame control button being tracked. + int m_iHotItem; // Index of the currently hot item. + int m_nIDEvent; // Menu timer ID. + int m_nTimeOut; // Time-out value, in milliseconds. + int m_iPopupTracking; // Index of which popup is being tracked, if any. + int m_iNewPopup; // Index of the next menu to track. + int m_iButton; // Index of the currently selected menu bar item. + int m_nMenuID; // Menu bar resource ID. + int m_nMRUMaxWidth; // Most recently used max width, or -1 if not set. + bool m_bTimerActive; // true when the timer is activated. + bool m_bMoreWindows; // true to display the "More Windows" menu command for MDI document management. + bool m_bStretchToFit; // true if the menu bar is stretched to fit the entire window space. + bool m_bPtMouseInit; // Tells if the last mouse position (m_ptMouse) has been initialized. + bool m_bShowMDIButtons; // Tells if MDI buttons shall be rendered when the MDI child is maximized. + bool m_bDown; // true when the button is pressed. + bool m_bProcessRightArrow; // true to process left/right arrow keys. + bool m_bProcessLeftArrow; // true to move to prev/next popup. + bool m_bEscapeWasPressed; // true if the user pressed escape to exit the menu. + bool m_bDelayCheckMouse; // Tells if idle update shall check for the mouse position to reset the hot item once the mouse leaves the window. + BOOL m_bMenuUnderlines; // Win2000, TRUE if 'use menu underlines' is turned off in the control panel. + BOOL m_bActive; // TRUE, if the application has activation. + BOOL m_bMDIMaximized; // TRUE, if the window is maximized. + HWND m_hWndMDIClient; // If this is an MDI application. + HMENU m_hMenu; // Handle to the currently active menu. + HMENU m_hMenuDefault; // Handle to the menu loaded via LoadMenuBar. + HMENU m_hMenuShared; // Handle to the "Window" menu. + CPoint m_ptMouse; // Mouse location when tracking the popup. + CString m_strValueName; // Null-terminated string that specifies the value name in the registry. + CString m_strSubKey; // Null-terminated string that specifies the key name in the registry. + CXTMenu* m_pMenuPopup; // Pointer to the current popup being tracked. + CUIntArray m_arrHiddenCommands; // Array of hidden menu commands. + static int m_iHookRefCount; // Counts number of times the hook has been set. + CImageList m_imageList; // Image list used by the MDI frame buttons. + CToolTipCtrl m_toolTip; // MDI frame button tooltip. + static HHOOK m_hMsgHook; // Handle to the message hook. Set during menu tracking. + XT_TRACK_STATE m_iTrackingState; // Current tracking state. + CXTMBarWndHook* m_pFrameHook; // Hooks frame window messages. + CXTMBarMDIWndHook* m_pChildFrameHook; // Hooks MDI client messages. + static CXTMenuBar* m_pMenuBar; // Holds a 'this' pointer. Set during menu tracking. + CXTMenu2OLEItemMap m_mapMenu2OLEItem; // OLE menu item routing map. + CXTMenuBarItemArray m_arrItems; // Array of menu bar items. + +private: + + CXTMenuCustomHandler* m_pCustomHandler; + CMap m_mapTools; + +public: + + static bool m_bShowAll; // true when hidden menu items are displayed. + static bool m_bAltKey; // true when the alt key is pressed. + + // Input: pMsg - Pointer to an MSG structure. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This function translates special menu keys and mouse actions, and is + // called from CXTFrameWnd's PreTranslateMessage. + virtual BOOL TranslateFrameMessage(MSG* pMsg); + + // Input: hMenu - Handle to the new menu. + // hMenuShared - Handle to the new shared menu. + // Returns: A handle to the old menu. 'hMenuShared' is the MDI "Window" menu, if any + // (similar to WM_MDISETMENU). + // Summary: Call this function to load a different menu. The HMENU must not belong + // to any CMenu, and you must free it when you are done. + HMENU LoadMenu(HMENU hMenu,HMENU hMenuShared); + + // Returns: A CMenu pointer object to the currently active menu. + // Summary: This member function retrieves a pointer to the currently active menu. + CMenu* GetMenu() const; + + // Input: nMenuID - Resource ID of the menu to load. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to load the menu bar specified by 'nMenuID'. + BOOL LoadMenuBar(UINT nMenuID); + + // Input: lpszMenuName - Pointer to the resource name of the menu bar to be loaded. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to load the menu bar specified by 'lpszMenuName'. + BOOL LoadMenuBar(LPCTSTR lpszMenuName); + + // BULLETED LIST: + + // Input: pParentWnd - Pointer to the window that is the menu bar’s parent. + // dwStyle - The menu bar style. Additional menu bar styles supported are: + // [ul] + // [li]CBRS_TOP Control bar is at the top of the frame window.[/li] + // [li]CBRS_BOTTOM Control bar is at the bottom of the frame window.[/li] + // [li]CBRS_NOALIGN Control bar is not repositioned when the + // parent is resized.[/li] + // [li]CBRS_TOOLTIPS Control bar displays tool tips.[/li] + // [li]CBRS_SIZE_DYNAMIC Control bar is dynamic.[/li] + // [li]CBRS_SIZE_FIXED Control bar is fixed.[/li] + // [li]CBRS_FLOATING Control bar is floating.[/li] + // [li]CBRS_FLYBY Status bar displays information about the button.[/li] + // [li]CBRS_HIDE_INPLACE Control bar is not displayed to the user.[/li] + // [/ul] + // nID - The menu bar’s child-window ID. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function creates a Windows menu bar, a child window, and + // associates it with the CXTMenuBar object. It also sets the menu bar + // height to a default value. + virtual BOOL Create(CWnd* pParentWnd,DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP,UINT nID = AFX_IDW_MENUBAR); + + // Input: pParentWnd - Pointer to the window that is the menu bar’s parent. + // dwUnused - Not used, should be zero. + // dwStyle - The menu bar style. See Toolbar Control and Button Styles in the Platform + // SDK for a list of appropriate styles. + // rcBorders - A CRect object that defines the widths of the menu bar window borders. + // These borders are set to (0,0,0,0) by default, thereby resulting in + // a menu bar window with no borders. + // nID - The menu bar’s child-window ID. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to create a Windows menu bar, a child window, + // and associate it with the CXTToolBar object. It also sets the menu bar + // height to a default value. + // + // Use CreateEx, instead of Create, when certain styles need to be present + // during the creation of the embedded menu bar control. For example, set + // 'dwCtrlStyle' to TBSTYLE_FLAT | TBSTYLE_TRANSPARENT to create a menu bar + // that resembles the Internet Explorer 4 menu bars. + virtual BOOL CreateEx(CWnd* pParentWnd,DWORD dwUnused = 0,DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP,CRect rcBorders = CRect(0, 0, 0, 0),UINT nID = AFX_IDW_MENUBAR); + + // Input: nElapse - Specifies the time-out value, in milliseconds. + // nIDEvent - Specifies a nonzero timer identifier. + // Summary: This member function will set the timer identifier and time-out value + // for the cool menu. The timer is activated when the mouse hovers over a + // menu bar button when using intelligent menus. NOTE: You will need to also + // call CXTCoolMenu::SetTimerInfo() if you are changing the 'nIDEvent' parameter. + void SetTimerInfo(UINT nElapse,UINT nIDEvent=1000); + + // Input: bStretchToFit - TRUE to stretch to fit the entire application area, FALSE to fit only + // the area occupied by menu items. + // Summary: Call this member function to enable the menu bar to occupy the entire + // application area or size the menu bar to the area occupied by menu items + // only. + void SetStretchToFit(BOOL bStretchToFit); + + // Returns: TRUE if the menu occupies the entire application area, or FALSE if it only + // occupies the area the size of the menu items. + // Summary: Call this member function to get the stretch state of the menu bar. + BOOL GetStretchToFit(); + + // Input: bShowMDIButtons - TRUE to display MDI buttons, FALSE to hide them. + // Summary: Call this member function to enable or disable rendering of the MDI buttons + // when an MDI frame is maximized. Call this function after you have created + // your menubar. The button layout will be automatically adjusted. + void ShowMDIButtons(BOOL bShowMDIButtons); + + // Returns: TRUE if the MDI buttons are rendered, otherwise returns FALSE. + // Summary: This member function tells if MDI buttons are currently rendered. + BOOL IsShowMDIButtons() const; + + // Input: nCommandID - The command ID of a menu item to hide. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified command to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideCommand(UINT nCommandID); + + // Input: nCommandIDs - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified commands to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideCommands(const UINT* nCommandIDs,int nSize); + + // Input: pObject - Represents a valid CObject pointer. + // Returns: TRUE if the object passed in is a CXTMenuBar object, otherwise returns FALSE. + // Summary: This function checks if the object passed in as 'pObject' is a CXTMenuBar + // object. + static BOOL IsMenuBar(CObject* pObject); + + // Returns: TRUE if the active MDI frame is maximized, otherwise returns FALSE. + // Summary: This function tells if the active MDI frame is currently maximized. + BOOL IsMDIMaximized() const; + + // Input: bEnable - true to show "More Windows", or false to hide. + // Summary: Call this member function to enable or disable the "More Windows" menu + // item that is displayed in the "Windows" pull down menu. + void EnableMoreWindows(bool bEnable=true); + + // Input: bSend - A reference to a valid BOOL value. + // nMsg - Specifies the message to be sent. + // wParam - Specifies additional message-specific information. + // lParam - Specifies additional message-specific information. + // Returns: An HWND data type that represents the window handle. + // Summary: This menu function is called to determine the window handle for command + // routing. + HWND OleMenuDescriptor(BOOL& bSend,UINT nMsg,WPARAM wParam,LPARAM lParam); + + // Returns: A pointer to a valid CFrameWnd object. + // Summary: This member function returns a pointer to the menu bar owner frame. + CFrameWnd* GetOwnerFrame(); + + // Returns: A pointer to a valid COleDocument object. + // Summary: This member function returns a pointer to the OLE document that sent + // the last command if the menu bar is used with an OLE framework. + COleDocument* GetCmdSentOleDoc(); + + // Returns: A pointer to a valid CWnd object. + // Summary: This member function returns a pointer to the OLE window that sent + // the last command if the menu bar is used with an OLE framework. + CWnd* GetCmdSentOleWnd(); + + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is called to fill the routing map for the OLE + // framework. + BOOL FillCommandRoutingMap(); + +protected: + + // Input: rcButton - A reference to a valid CRect object that represents the size of the + // button. + // tpm - Reference to a TPMPARAMS struct. + // nFlags - A reference to TrackPopupMenu flags + // Returns: A CPoint object. + // Summary: This member function will insure the menu always appears inside the + // window. It will, given a button rectangle, compute point and "exclude + // rect" for TrackPopupMenu, based on the current docking style, so that + // the menu will always appear inside the window. + virtual CPoint ComputeMenuTrackPoint(const CRect& rcButton, TPMPARAMS& tpm, UINT &nFlags); + + // Summary: This member function initializes an MDI "Window" menu by adding names + // of all the MDI children. This duplicates what the default handler + // for WM_MDISETMENU does, but it is necessary to reinvent the wheel since + // menu bars manage the menus themselves. This function is called when + // the frame gets WM_INITMENUPOPUP. + virtual void OnInitWindowMenu(); + + // BULLETED LIST: + + // Input: message - Message identifier. + // nFlags - Indicates whether various virtual keys are down. This parameter + // can be any combination of the following values: + // [ul] + // [li]MK_CONTROL Set if the CTRL key is down.[/li] + // [li]MK_LBUTTON Set if the left mouse button is down.[/li] + // [li]MK_MBUTTON Set if the middle mouse button is down.[/li] + // [li]MK_RBUTTON Set if the right mouse button is down.[/li] + // [li]MK_SHIFT Set if the SHIFT key is down.[/li] + // [/ul] + // pt - Specifies the x- and y-coordinate of the cursor. These coordinates + // are always relative to the upper-left corner of the window. + // Returns: TRUE if handled; i.e., caller should eat the mouse message. + // Summary: Call this member function to handle a mouse message. It looks for + // a click on one of the buttons. + virtual BOOL OnMouseMessage(UINT message,UINT nFlags,CPoint pt); + + // Summary: This member function makes the frame recalculate the control bar sizes + // after a menu change. + void DoLayout(); + + // Input: iButton - Index of the starting button. + // bPrev - TRUE to search for the previous button. FALSE to search for the next + // button. + // Returns: The index of the previous, or next, button found. + // Summary: This member function gets the button index of the button before, or + // after, a given button specified by 'iButton'. + int GetNextOrPrevButton(int iButton,BOOL bPrev) const; + + // Input: iState - Passed in XT_TRACT_STATE structure. + // iButton - Index of the button to set the state for. + // Summary: This member function sets the tracking state for a button to either none, + // button, or popup. + void SetTrackingState(XT_TRACK_STATE iState,int iButton=-1); + + // Input: iButton - The index of the button item to make hot. + // Summary: This member function sets an 'iButton' item as hot-selected. + void SetHotItem(int iButton); + + // Input: iButton - The index of the button item to depress. + // Summary: This member function makes an 'iButton' item appear pressed. Pass in + // -1 to release all buttons. + void PressItem(int iButton); + + // Input: pItem - A pointer to a valid CXTMenuBarItem object. + // Returns: The index of the item, or -1 if the item is not found. + // Summary: This member function searches for a CXTMenuBarItem object. + int FindItem(CXTMenuBarItem* pItem); + + // Input: iButton - Index of the button to track. + // Summary: This member function tracks the popup submenu associated with the active + // button in the menu bar. This function actually goes into a loop, tracking + // different menus until the user selects a command or exits the menu. + void TrackPopup(int iButton); + + // Input: pt - Specifies the x- and y-coordinate of the cursor. These coordinates + // are always relative to the upper-left corner of the window. + // itemsBegin - Pointer to the first entry in an array of item indices that need to be + // checked. + // itemsEnd - Pointer past the last entry in an array of item indices that need + // to be checked. + // Returns: The index of the item that contains 'pt', or -1 if there was no match. + // Summary: This member function determines which menu bar item, within the range of + // 'itemsBegin' to 'itemsEnd', a point is in ('pt' in client coordinates). + virtual int HitTest(CPoint pt,int* itemsBegin,int* itemsEnd) const; + + // Summary: This member function toggles the state from home state to button-tracking, + // and back. + void ToggleTrackButtonMode(); + + // Input: iButton - Index of the new popup to track, or -1 to quit tracking. + // Summary: This member function cancels the current popup menu by posting WM_CANCELMODE, + // and tracks a new menu. + void CancelMenuAndTrackNewOne(int iButton); + + // Input: hMenu - Handle to the menu. + // nItemID - Menu item ID or submenu index of the item selected. + // Summary: This member function is called by the menu bar when a user selects a + // new menu item. This will determine if the selected item is a submenu + // and or parent menu item. This way the menu bar knows whether the right + // or left arrow key should move to the next menu popup. + void OnMenuSelect(HMENU hMenu,UINT nItemID); + + // Input: bDoLayout - Tells if the layout shall be recalculated if a change is detected. + // Summary: This member function checks whether the MDI maximized state has changed. + // If so, add or delete the min/max/close buttons to or from the menu bar. + void CheckMinMaxState(bool bDoLayout); + + // Input: iButton - Index of the button to check. + // Returns: TRUE if it is a valid index, otherwise returns FALSE. + // Summary: This member function is called to check to see if the button specified + // by 'iButton' is a valid index. + BOOL IsValidButton(int iButton) const; + + // Input: m - A Reference to a valid tagMSG structure. + // pWndMenu - A pointer to a valid CWnd object. + // Returns: TRUE if message is handled (to eat it). + // Summary: This member function handles a menu input event. It looks for a left + // or right arrow key to change the popup menu, or mouse movement over + // a different menu button for "hot" popup effect. + virtual BOOL OnMenuInput(MSG& m,CWnd* pWndMenu = NULL); + + // Input: bAltKey - true if the alt key was used to activate menu. + // Summary: This member function is called to update the display for Windows 2000 menus. + void UpdateDisplay(bool bAltKey); + + // Returns: The window styles for the active MDI client window. + // Summary: The control bar calls this method to return the window style for the + // active MDI child. + long GetMDIWindowStyle(); + + // Summary: This member function removes all menu bar items. + void RemoveAll(); + + // Input: itemsBegin - Beginning of the buffer to store indices. + // itemsEnd - Points past the last item in the buffer. + // flags - OR'ed (|) combination of the ITEMTYPE_... flags. + // Returns: A pointer past the last initialized buffer item. + // Summary: This member function gets the indices of all the items currently visible. + int* CXTMenuBar::GetItems(int* itemsBegin,int* itemsEnd,int flags) const; + + // Input: pItem - A pointer to a valid CXTMenuBarItem object. + // Returns: A CRect object that represents the item. + // Summary: This member function computes the item rectangle, as per current menu bar + // orientation. + CRect GetItemRect(CXTMenuBarItem* pItem) const; + + // Input: bHorz - true if horizontal border size is to be calculated. + // Returns: A CSize object that represents the width and height of all the borders. + // Summary: This member function computes the total width and height of all the + // borders. + CSize GetBorderSize(bool bHorz) const; + + // Summary: This member function resets the state tracking variables. + void ResetTrackingState(); + + // Returns: true to enable full window drag, or false to use the wire frame. + // Summary: This member function tells if this menu bar shall be visualized when + // dragging or if the system shall render it with a wire frame. Default + // implementation uses full window drag. + virtual bool IsFullWindowDrag(); + + // BULLETED LIST: + + // Input: pSize - [ul] + // [li]IN Extent of the rectangle in which the hot spot must be defined.[/li] + // [li]OUT Offset of the hot spot from the rect's top-left corner.[/li] + // [/ul] + // Returns: true if the menu bar defines a hot spot (the default) in which case a + // buffer, pointed to by 'pSize', is filled with the hot spot offset from + // the top-left corner. Returns false to indicate that no hot spot is defined. + // Summary: This member function calculates the position of the menu bar hot spot, + // i.e., the point that is used to pin the control bar rect to the mouse + // cursor when dragging it. + virtual bool GetHotSpot(LPSIZE pSize); + + // Input: dwMenuPopupID - Popup menu ID + // Returns: A menu popup by its CRC32-based ID + // Summary: This member function returns a HMENU handle for the popup menu specified by dwMenuPopupID. + HMENU GetMenuPopupByCrc(DWORD dwMenuPopupID); + + // Ignore: + //{{AFX_VIRTUAL(CXTMenuBar) + virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); + virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz); + virtual CSize CalcDynamicLayout(int nLength, DWORD nMode); + //}}AFX_VIRTUAL + + virtual XT_TRACK_STATE GetTrackingState(int& iPopup); + virtual void OnInitMenuPopup(); + virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const; + virtual void OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle); + virtual bool HasCmdHandlers(CWnd* pWnd); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + + // Ignore: + //{{AFX_MSG(CXTMenuBar) + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint pt); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnPaint(); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnDestroy(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() + + // Input: code - An integer value. + // wParam - Specifies additional message-specific information. + // lParam - Specifies additional message-specific information. + // Returns: An LRESULT Object + // Summary: Menu filter hook just passes to virtual CXTMenuBar function. + static LRESULT CALLBACK MenuInputFilter(int code, WPARAM wParam, LPARAM lParam); + + // drawing helpers + + void OnDrawIcon(CDC* pDC, CXTSysMenuBarItem* pItem); + void OnDrawMenuItem(CDC* pDC, CXTSubMenuBarItem* pItem); + void OnRenderControl(CDC* pDC, CXTControlMenuBarItem* pItem); + void DrawMenuItemText(CDC* pDC, CRect& rcItem, CXTSubMenuBarItem* pItem, bool bHorz); + void DrawVertText(CDC* pDC, CRect& rcItem, CXTSubMenuBarItem* pItem, COLORREF crText); + void DrawHorzText(CDC* pDC, CRect& rcItem, CXTSubMenuBarItem* pItem); + + // these track menu popups + + void OnTrackSubMenu(CXTSubMenuBarItem* pItem); + void OnTrackWindowMenu(CXTSysMenuBarItem* pItem); + void OnDblClickWindowMenu(CXTSysMenuBarItem* pItem); + + // Layout helpers + + CSize CalcLayout(DWORD nMode, int nLength = -1); + CSize CalcItemExtent(bool bHorz); + int WrapMenuBar(int nWidth); + void SizeMenuBar(int nLength, bool bHorz); + void CalcItemLayout(bool bHorz); + int GetClipBoxLength(bool bHorz); + + // alignment (CBRS_ALIGN_...) with regard to floating status + + DWORD GetAlignmentStyle() const; + void DrawXPFrameControl(CDC* pDC, CRect& r, UINT uStyle, bool bHilite=false, bool bPushed=false); + CFont& GetTextFont() const; + CSize GetTextSize(CDC* pDC, CString strMenuText) const; + TCHAR GetHotKey(LPCTSTR lpszMenuName) const; + virtual void ActivateToolTips(CPoint point, UINT uState); + + virtual BOOL IsFloating() const; + virtual BOOL IsHorzDocked() const; + + // Input: lp - Pointer to a rebar bar descriptor to use to fill in the sizing information. + // bHorz - Tells if this control bar must be oriented horizontally. + // Summary: This notification is called whenever this menu bar is added to a CXTReBar object. + virtual bool OnAddedToRebar(REBARBANDINFO* lp,bool bHorz); + + // Input: pInfo - Descriptor of the band + // bHorz - Tells if horizontally oriented + // Summary: Called whenever this menu bar is embedded in CXTReBar control + // that has just resized the band in which this menu bar resides. + virtual void OnRebarBandResized(XT_REBARSIZECHILDINFO* pInfo, bool bHorz); + + // Input: bMode - True to enable customization. + // Summary: Sets customization mode on/off. + void SetCustMode(bool bMode); + + // Returns: An RGB color value. + // Summary: This member function is used to determine the correct background fill + // color to be used during paint operations. + virtual COLORREF GetBackgroundColor() const; + + friend class CXTMenu; + friend class CXTCustTools; + friend class CXTMBarWndHook; + friend class CXTToolsManager; + friend class CXTMBarMDIWndHook; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE BOOL CXTMenuBar::IsValidButton(int iButton) const { + ASSERT(::IsWindow(m_hWnd)); return 0 <= iButton && iButton < m_arrItems.GetSize(); +} +AFX_INLINE XT_TRACK_STATE CXTMenuBar::GetTrackingState(int& iPopup) { + ASSERT(::IsWindow(m_hWnd)); iPopup = m_iPopupTracking; return m_iTrackingState; +} +AFX_INLINE CMenu* CXTMenuBar::GetMenu() const { + ASSERT(::IsWindow(m_hWnd)); return CMenu::FromHandle(m_hMenu); +} +AFX_INLINE void CXTMenuBar::SetStretchToFit(BOOL bStretchToFit) { + m_bStretchToFit = (bStretchToFit != 0); +} +AFX_INLINE BOOL CXTMenuBar::GetStretchToFit() { + return m_bStretchToFit; +} +AFX_INLINE void CXTMenuBar::ShowMDIButtons(BOOL bShowMDIButtons) { + ASSERT(::IsWindow(m_hWnd)); m_bShowMDIButtons = (bShowMDIButtons != 0); DoLayout(); +} +AFX_INLINE BOOL CXTMenuBar::IsShowMDIButtons() const { + return m_bShowMDIButtons; +} +AFX_INLINE BOOL CXTMenuBar::IsMenuBar(CObject* pObject) { + return pObject->IsKindOf(RUNTIME_CLASS(CXTMenuBar)); +} +AFX_INLINE void CXTMenuBar::EnableMoreWindows(bool bEnable/*=true*/) { + m_bMoreWindows = bEnable; +} +AFX_INLINE BOOL CXTMenuBar::IsMDIMaximized() const { + return m_bMDIMaximized; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTMENUBAR_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTMiniDockFrameWnd.h b/Editor/XT/Include/XTMiniDockFrameWnd.h new file mode 100644 index 0000000..e3f7bfb --- /dev/null +++ b/Editor/XT/Include/XTMiniDockFrameWnd.h @@ -0,0 +1,111 @@ +// XTMiniDockFrameWnd.h interface for the CXTMiniDockFrameWnd class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTMINIDOCKFRAMEWND_H__) +#define __XTMINIDOCKFRAMEWND_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// forwards + +class CXTDockBar; +class CXTControlBar; +class CXTDockContext; +class CXTFrameButton; +class CXTExpMenuWnd; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMiniDockFrameWnd is a CMiniDockFrameWnd class. It is used to +// handle docking for the CXTDockWindow class. +class _XT_EXT_CLASS CXTMiniDockFrameWnd : public CMiniDockFrameWnd +{ + DECLARE_DYNCREATE(CXTMiniDockFrameWnd) + +public: + + // Summary: Constructs a CXTMiniDockFrameWnd object. + CXTMiniDockFrameWnd(); + + // Summary: Destroys a CXTMiniDockFrameWnd object, handles cleanup and de-allocation. + virtual ~CXTMiniDockFrameWnd(); + +protected: + + // Summary: Appearance as most recently rendered + enum APPEARANCE_STYLE + { + APPEARANCE_UNDEFINED, // Undefined style + APPEARANCE_XPSTYLE, // Office xp style. + APPEARANCE_CLASSIC, // Classic Windows style. + } m_currentAppearance; + + // Returns: An APPEARANCE_STYLE enumeration. + // Summary: Prescribed current appearance + static APPEARANCE_STYLE GetCurrentAppearance(); + + bool m_bInitCompleted; // Tells if initial update completed + CPtrList m_arrButtons; // Frame button array + CImageList m_imageList; // Image list used by mini-frame buttons. + CToolTipCtrl m_toolTip; // Button tooltip control. + CXTExpMenuWnd* m_pPopupWnd; // Customize popup window. + CXTFrameButton* m_pPressedBtn; // Points to the active frame button. + + // Ignore: + //{{AFX_VIRTUAL(CXTMiniDockFrameWnd) + public: + virtual BOOL Create(CWnd* pParent, DWORD dwBarStyle); + //}}AFX_VIRTUAL + + virtual bool IsValidBar(CControlBar* pBar) const; + virtual bool IsControlBar(CControlBar* pBar) const; + virtual bool IsToolbar(CControlBar* pBar) const; + virtual bool IsMenubar(CControlBar* pBar) const; + virtual bool IsDockWindow(CControlBar* pBar) const; + virtual CXTDockBar* GetXTDockBar() const; + virtual CXTControlBar* GetXTControlBar() const; + virtual CXTDockContext* GetXTDockContext(CControlBar* pBar) const; + virtual void DrawXPFrameControl(CDC* pDC, CRect& r, CXTFrameButton* pFrameButton); + virtual void ActivateToolTips(CPoint point, bool bIsCloseButton); + virtual void CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType = adjustBorder); + + // Ignore: + //{{AFX_MSG(CXTMiniDockFrameWnd) + afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); + afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point); + afx_msg void OnNcPaint(); + afx_msg BOOL OnNcActivate(BOOL bActive); + afx_msg void OnIdleUpdateCmdUI(); + afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point); + afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point); + afx_msg void OnCustomize(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + //}}AFX_MSG + + afx_msg LRESULT OnInitMiniFrame(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSetText(WPARAM, LPARAM); + afx_msg void OnPopupClosed(); + + DECLARE_MESSAGE_MAP() + + friend class CDockBar; +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTMINIDOCKFRAMEWND_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTNewToolbarDlg.h b/Editor/XT/Include/XTNewToolbarDlg.h new file mode 100644 index 0000000..b9510cf --- /dev/null +++ b/Editor/XT/Include/XTNewToolbarDlg.h @@ -0,0 +1,69 @@ +// XTNewToolbarDlg.h interface for the CXTNewToolbarDlg class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTNEWTOOLBARDLG_H__) +#define __XTNEWTOOLBARDLG_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTNewToolbarDlg is a multiple inheritance class derived from CXTDialogState +// and CDialog. CXTNewToolbarDlg is used to create the customize dialog +// that is used during toolbar customization. +class _XT_EXT_CLASS CXTNewToolbarDlg : CXTDialogState, public CDialog +{ + +public: + + // Input: pWndParent - Points to the top-level frame window. + // Summary: Constructs a CXTNewToolbarDlg object. + CXTNewToolbarDlg(CFrameWnd* pWndParent=NULL); + + //{{AFX_DATA(CXTNewToolbarDlg) + + enum { IDD = XT_IDD_NEWTOOLBAR }; + CXTEdit m_editToolbar; + CString m_strToolbar; + //}}AFX_DATA + + int m_nNewID; // ID for a newly created toolbar. + CString m_strExistingName; // A NULL terminated string that represents the toolbar name. + CFrameWnd* m_pFrameWnd; // Pointer to the top-level frame window. + + // Summary: This member function is called by the dialog to determine the next + // available suggested name to be displayed in the new toolbar dialog. + void SetSuggestedName(); + + // Ignore: + //{{AFX_VIRTUAL(CXTNewToolbarDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTNewToolbarDlg) + virtual BOOL OnInitDialog(); + virtual void OnOK(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTNEWTOOLBARDLG_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTOSVersionInfo.h b/Editor/XT/Include/XTOSVersionInfo.h new file mode 100644 index 0000000..7caf1c2 --- /dev/null +++ b/Editor/XT/Include/XTOSVersionInfo.h @@ -0,0 +1,176 @@ +// XTOSVersionInfo.h: interface for the CXTOSVersionInfo class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTOSVERSIONINFO_H__) +#define __XTOSVERSIONINFO_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTOSVersionInfo is a OSVERSIONINFO derived class. This class wraps +// the Win32 API GetVersionEx(...), used to get the current Windows OS +// version. CXTOSVersionInfo is a single instance, or "singleton" object, +// that is accessed with the Get() method. +class _XT_EXT_CLASS CXTOSVersionInfo : public OSVERSIONINFO +{ +public: + + // Example:
bool bIsWinNT = CXTOSVersionInfo::Get().IsWinNT4();
+ // Summary: Call this member function to access the class members. Since this + // class is designed as a single instance object you can only access version + // info thru this static method. You cannot directly instantiate an object + // of type CXTOSVersionInfo. + static CXTOSVersionInfo &Get(); + + // Returns: true if the OS is Windows 3.1, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // Windows 3.1. + bool IsWin31() const; + + // Returns: true if the OS is Windows 95, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // Windows 95. + bool IsWin95() const; + + // Returns: true if the OS is Windows 98, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // Windows 98. + bool IsWin98() const; + + // Returns: true if the OS is Windows ME, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // Windows ME. + bool IsWinME() const; + + // Returns: true if the OS is Windows NT 4, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // Windows NT 4. + bool IsWinNT4() const; + + // Returns: true if the OS is Windows 2000, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // Windows 2000. + bool IsWin2K() const; + + // Returns: true if the OS is Windows XP, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // Windows XP. + bool IsWinXP() const; + + // Returns: true if the OS is greater than or equal to Windows 3.1, otherwise returns + // false. + // Summary: Call this member function to check to see if the operating system is + // greater than or equal to Windows 3.1. + bool IsWin31OrGreater() const; + + // Returns: true if the OS is of the Windows 9x family, and is Windows 95 or + // a later version, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // of the Windows 9x family, and is Windows 95 or a later version. + bool IsWin95OrGreater() const; + + // Returns: true if the OS is of the Windows 9x family, and is Windows 98 or + // a later version, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // of the Windows 9x family, and is Windows 98 or a later version. + bool IsWin98OrGreater() const; + + // Returns: true if the OS is of the Windows 9x family, and is Windows ME or + // a later version, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // of the Windows 9x family, and is Windows ME or a later version. + bool IsWinMEOrGreater() const; + + // Returns: true if the OS is of the Windows NT family, and is Windows NT 4 or + // a later version, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // of the Windows NT family, and is Windows NT 4 or a later version. + bool IsWinNT4OrGreater() const; + + // Returns: true if the OS is of the Windows NT family, and is Windows 2000 or + // a later version, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // of the Windows NT family, and is Windows 2000 or a later version. + bool IsWin2KOrGreater() const; + + // Returns: true if the OS is of the Windows NT family, and is Windows XP or + // a later version, otherwise returns false. + // Summary: Call this member function to check to see if the operating system is + // of the Windows NT family, and is Windows XP or a later version. + bool IsWinXPOrGreater() const; + +private: + + // greater or equal a version number + + inline bool gte_ver(const DWORD maj, const DWORD min) const; + + inline bool eq_ver(const DWORD maj, const DWORD min) const; + + // Constructs a CXTOSVersionInfo object. + CXTOSVersionInfo(); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE bool CXTOSVersionInfo::IsWin31() const { + return (dwPlatformId == VER_PLATFORM_WIN32s); +} +AFX_INLINE bool CXTOSVersionInfo::IsWin95() const { + return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && (dwMajorVersion == 4) && (dwMinorVersion < 10); +} +AFX_INLINE bool CXTOSVersionInfo::IsWin98() const { + return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && eq_ver(4, 10); +} +AFX_INLINE bool CXTOSVersionInfo::IsWinME() const { + return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && eq_ver(4, 90); +} +AFX_INLINE bool CXTOSVersionInfo::IsWinNT4() const { + return (dwPlatformId == VER_PLATFORM_WIN32_NT) && eq_ver(4, 0); +} +AFX_INLINE bool CXTOSVersionInfo::IsWin2K() const { + return (dwPlatformId == VER_PLATFORM_WIN32_NT) && eq_ver(5, 0); +} +AFX_INLINE bool CXTOSVersionInfo::IsWinXP() const { + return (dwPlatformId == VER_PLATFORM_WIN32_NT) && eq_ver(5, 1); +} +AFX_INLINE bool CXTOSVersionInfo::IsWin95OrGreater() const { + return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && (dwMajorVersion >= 4); +} +AFX_INLINE bool CXTOSVersionInfo::IsWin98OrGreater() const { + return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && gte_ver(4, 10); +} +AFX_INLINE bool CXTOSVersionInfo::IsWinMEOrGreater() const { + return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && gte_ver(4, 90); +} +AFX_INLINE bool CXTOSVersionInfo::IsWinNT4OrGreater() const { + return (dwPlatformId >= VER_PLATFORM_WIN32_NT) && (dwMajorVersion >= 4); +} +AFX_INLINE bool CXTOSVersionInfo::IsWin2KOrGreater() const { + return (dwPlatformId >= VER_PLATFORM_WIN32_NT) && (dwMajorVersion >= 5); +} +AFX_INLINE bool CXTOSVersionInfo::IsWinXPOrGreater() const { + return (dwPlatformId >= VER_PLATFORM_WIN32_NT) && gte_ver(5, 1); +} +AFX_INLINE bool CXTOSVersionInfo::gte_ver(const DWORD maj, const DWORD min) const { + return (dwMajorVersion > maj) || (dwMajorVersion == maj && dwMinorVersion >= min); +} +AFX_INLINE bool CXTOSVersionInfo::eq_ver(const DWORD maj, const DWORD min) const { + return (dwMajorVersion == maj) && (dwMinorVersion == min); +} + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTOSVERSIONINFO_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTOleIPFrameWnd.h b/Editor/XT/Include/XTOleIPFrameWnd.h new file mode 100644 index 0000000..123cce7 --- /dev/null +++ b/Editor/XT/Include/XTOleIPFrameWnd.h @@ -0,0 +1,297 @@ +// XTOleIPFrameWnd.h interface for the CXTOleIPFrameWnd class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTOLEIPFRAMEWND_H__) +#define __XTOLEIPFRAMEWND_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// forwards + +class CXTDockState; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTOleIPFrameWnd is a multiple inheritance class derived from COleIPFrameWnd +// and CXTFrameImpl. CXTOleIPFrameWnd extends the standard COleIPFrameWnd +// class to allow CXTDockWindow and CXTToolBar docking, customization and +// cool menu support. +class _XT_EXT_CLASS CXTOleIPFrameWnd : public COleIPFrameWnd, public CXTFrameImpl +{ + DECLARE_DYNCREATE(CXTOleIPFrameWnd) + +public: + + // Summary: Constructs a CXTOleIPFrameWnd object. + CXTOleIPFrameWnd(); + + // Summary: Destroys a CXTOleIPFrameWnd object, handles cleanup and de-allocation. + virtual ~CXTOleIPFrameWnd(); + +protected: + +public: + + // Returns: A CXTCoolMenu pointer that represents the cool menu object associated with + // the frame. + // Summary: This member function gets a pointer to the cool menu object associated + // with the frame. + CXTCoolMenu* GetCoolMenu(); + + // Returns: A CXTMenuBar pointer that represents the menu bar associated with the frame. + // Summary: This member function gets a pointer to the menu bar associated with + // the frame. + CXTMenuBar* GetMenuBar(); + + // Input: nIDToolBars - Array of toolbar resource IDs. The cool menu will use the toolbar + // commands to map the icons placed next to the corresponding menu commands. + // nSize - Size of the array of toolbars. + // Summary: Call this member function to install cool menus for your application. + // Cool menus are menus that appear with icons next to the menu titles. + // Pass in your toolbar resource array to initialize. + void InstallCoolMenus(const UINT* nIDToolBars,int nSize); + + // Input: nIDToolBar - Toolbar resource ID. The cool menu will use the toolbar commands + // to map the icons placed next to the corresponding menu commands. + // Summary: Call this member function to install cool menus for your application. + // Cool menus are menus that appear with icons next to the menu titles. + // Pass in your toolbar resource to initialize. + void InstallCoolMenus(const UINT nIDToolBar); + + // Input: lpszProfileName - Name of a section in the initialization file or a key in the + // Windows registry where state information is stored. + // Summary: This member function is called by the frame window to restore the + // settings of the control bar. + virtual void LoadBarState(LPCTSTR lpszProfileName); + + // Input: lpszProfileName - Name of a section in the initialization file or a key in the + // Windows registry where state information is stored. + // Summary: This member function is called by the frame window to save the + // settings of the control bar. + virtual void SaveBarState(LPCTSTR lpszProfileName) const; + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides + // of its parent window to which the control bar can be docked, if supported. + // The style can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control + // bar will not dock. + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDocking(DWORD dwDockStyle); + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides + // of its parent window to which the control bar can be docked, if supported. + // The style can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control + // bar will not dock. + // dwFlatStyle - Specifies the splitters, inside dockbars, look. It can be one + // of the following: + // [ul] + // [li]CBRS_XT_NONFLAT Thick devstudio like non-flat splitters.[/li] + // [li]CBRS_XT_SEMIFLAT Thin 3D non-flat splitters.[/li] + // [li]CBRS_XT_FLAT Flat splitters.[/li] + // [/ul] + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDockingEx(DWORD dwDockStyle,DWORD dwFlatStyle); + + // Input: pBar - A CControlBar pointer to the control bar to be docked. + // pDockBar - A CDockBar pointer to the dockbar the control bar is docked to. + // lpRect - Determines, in screen coordinates, where the control bar will + // be docked in the non-client area of the destination frame window. + // Summary: This member function causes a control bar to be docked to the frame + // window. The control bar will be docked to one of the sides of the frame + // window specified in the calls to both CXTDockWindow::EnableDocking and + // CXTFrameWnd::EnableDocking. The side chosen is determined by the + // dockbar specified by 'pDockBar'. + void DockControlBar(CControlBar* pBar,CDockBar* pDockBar,LPCRECT lpRect = NULL); + + // BULLETED LIST: + + // Input: pBar - A CControlBar pointer to the control bar to be docked. + // nDockBarID - Determines which sides of the frame window to consider for docking. + // It can be 0, or one or more of the following: + // [ul] + // [li]AFX_IDW_DOCKBAR_TOP Dock to the top side of the + // frame window.[/li] + // [li]AFX_IDW_DOCKBAR_BOTTOM Dock to the bottom side of + // the frame window.[/li] + // [li]AFX_IDW_DOCKBAR_LEFT Dock to the left side of the + // frame window.[/li] + // [li]AFX_IDW_DOCKBAR_RIGHT Dock to the right side of + // the frame window.[/li] + // [/ul] + // If 0, the control bar can be docked to any side enabled for + // docking in the destination frame window. + // lpRect - Determines, in screen coordinates, where the control bar will + // be docked in the non-client area of the destination frame window. + // Summary: This member function causes a control bar to be docked to the frame + // window. The control bar will be docked to one of the sides of the frame + // window specified in the calls to both CXTDockWindow::EnableDocking and + // CXTFrameWnd::EnableDocking. The side chosen is determined by + // 'nDockBarID'. + void DockControlBar(CControlBar* pBar,UINT nDockBarID = 0,LPCRECT lpRect = NULL); + + // Input: pBar1 - A CControlBar pointer to the control bar to be docked. + // pBar2 - A CControlBar pointer to the already docked control bar to be + // redocked on the left of 'pBar1'. + // Summary: This member function will redock a control bar specified by 'pBar2' + // to the left of a newly docked control bar specified by 'pBar1'. + virtual void DockControlBarLeftOf(CControlBar* pBar1,CControlBar* pBar2); + + // Returns: A pointer to a CMenu object that represents the active menu for the frame. + // Summary: This member function retrieves a pointer to the menu for the frame window. + virtual CMenu* GetMenu() const; + + // Input: nCommandID - The command ID of a menu item to hide. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified command to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItem(UINT nCommandID); + + // Input: lpszItem - Text string representing the popup menu item to hide. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified menu item to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItem(LPCTSTR lpszItem); + + // Input: nCommandIDs - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified commands to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItems(const UINT* nCommandIDs,int nSize); + + // Input: lpszItems - An array of command IDs, of menu items, to hide. + // nSize - Size of the array passed in. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds the specified menu items to the list of + // menu items to hide until activated by clicking on the chevron. + virtual BOOL HideMenuItems(const LPCTSTR lpszItems,int nSize); + + // Summary: This member function redraws the menu bar. If a menu bar is changed + // by the window, call this function to draw the changed menu bar. Overrides + // the CWnd implementation. + void DrawMenuBarX(); + + // Summary: Call this function to display the Customize Toolbar dialog box. + // This dialog box allows the user to customize the toolbar by adding + // and deleting buttons. + void Customize(); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function will initialize the accelerator manager for the + // framework. + bool InitAccelManager(); + + // Input: iNormalIndex - Index where the 'Tools' menu should be inserted into the standard menu. + // iWindowIndex - Index where the 'Tools' menu should be inserted into the MDI window menu. + // iArgPopupMenu - Resource ID of the popup menu to be displayed for the Arguments + // browse edit box. + // iDirPopupMenu - Resource ID of the popup menu to be displayed for the Initial + // Directory browse edit box. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to initialize the Tools manager for your + // application. The Tools manager will insert a "Tools" menu into your + // application's menu which allows the user to customize and add custom + // commands the the menu. Typically used with toolbar customization, + // the tools manager should be initialized when your frame is loaded by + // overriding the virtual function CFrameWnd::LoadFrame and can be managed + // by selecting the 'Tools' tab in the Customize dialog. + bool InitToolsManager(int iNormalIndex,int iWindowIndex=-1,int iArgPopupMenu=0,int iDirPopupMenu=0); + + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to initialize the Options manager for your + // application. Typically used with toolbar customization, the Options + // manager will allow the user to configure options related to the toolbar + // and menu behavior for the application. The Options manager should + // be initialized when your frame is loaded by overriding the virtual + // function CFrameWnd::LoadFrame and can be managed by selecting the 'Options' + // tab in the Customize dialog. + bool InitOptionsManager(); + +protected: + + virtual void SetDockState(const CXTDockState& state); + virtual void GetDockState(CXTDockState& state) const; + + // Ignore: + //{{AFX_VIRTUAL(CXTOleIPFrameWnd) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs, UINT uIcon); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTOleIPFrameWnd) + afx_msg void OnSysColorChange(); + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); + //}}AFX_MSG + + afx_msg void OnCustomizeBar(); + afx_msg BOOL OnToolsManager(UINT nID); + afx_msg void OnUpdateToolsManager(CCmdUI* pCmdUI); + afx_msg void OnUpdateChevron(CCmdUI* pCmdUI); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTOleIPFrameWnd::Customize() { + OnCustomizeBar(); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTOLEIPFRAMEWND_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTOptionsManager.h b/Editor/XT/Include/XTOptionsManager.h new file mode 100644 index 0000000..f61778c --- /dev/null +++ b/Editor/XT/Include/XTOptionsManager.h @@ -0,0 +1,137 @@ +// XTOptionsManager.h: interface for the CXTOptionsManager class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTOPTIONSMANAGER_H__) +#define __XTOPTIONSMANAGER_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// forwards + +class CXTCoolMenu; +class CXTAccelManager; +class CXTToolsManager; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_OPTIONS is a stand alone structure class. It is used by CXTOptionsManager +// to manage option data settings. +struct XT_OPTIONS +{ + int nAnimationType; // Animation type + bool bToolBarVisualize; // true to render the toolbar while dragging or resizing. + bool bMenuShadows; // true to use shadows under the menus. + bool bMenuRecentCommands; // true to use intelligent menus to hide selected menu commands. + bool bToolBarScreenTips; // true to show tooltips on toolbar commands. + bool bShowFullAfterDelay; // true to display hidden menu commands after a short delay. + bool bToolBarAccelTips; // true to add accelerator keys to toolbar tips. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTOptionsManager is a stand alone class. It is used to create a CXTOptionsManager +// object that is used to manage toolbar and menu options for the application. +class CXTOptionsManager +{ +private: + + // Summary: Constructs a CXTOptionsManager object. + CXTOptionsManager(); + + +public: + + // Summary: Destroys a CXTOptionsManager object, handles cleanup and de-allocation. + virtual ~CXTOptionsManager(); + +protected: + + bool m_bInitialized; // true if the options data has been initialized for the frame object. + bool m_bAutoSave; // true if the options data is automatically saved when this class is destroyed. + bool m_bChanged; // true if the contents of 'm_options' has been changed. + bool m_bRemoveAll; // true if all options data is to be removed from the system registry. + CFrameWnd* m_pFrameWnd; // Pointer to the frame window for the application. + XT_OPTIONS m_options; // Option value structure. + CXTCoolMenu* m_pCoolMenu; // Pointer to the cool menu manager for the frame specified by 'm_pFrameWnd'. + +public: + + // Returns: A reference to the one and only CXTOptionsManager object. + // Example:
CXTOptionsManager::Get().Init( this, GetCoolMenu() );
+ // Summary: This static member function will retrieve a reference to the one + // and only CXTOptionsManager object. You can use this function to access + // data members for the CXTOptionsManager class. + static CXTOptionsManager& Get(); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to save the options data to the system registry. + bool Save(); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to load the options data from the system + // registry. + bool Load(); + + // Input: pFrameWnd - A pointer to a valid CFrameWnd object. + // pCoolMenu - A pointer to a valid CXTCoolMenu object. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to initialize the Options manager. + // This function is called by the framework, usually from an overrode + // LoadFrame handler. + bool Init(CFrameWnd* pFrameWnd,CXTCoolMenu* pCoolMenu); + + // Returns: true if it has been initialized, otherwise returns false. + // Summary: This member function is called to determine if the Options manager + // has been initialized. + bool IsInitialized(); + + // Input: options - A reference to a valid XT_OPTIONS structure. + // Summary: This member function is called to update the option data for the Options + // manager. + void SetOptions(XT_OPTIONS& options); + + // Returns: A reference to an XT_OPTIONS structure. + // Summary: This member function is called to return a reference to the options + // data for the Options manager. + XT_OPTIONS& GetOptions(); + + // Summary: This member function is called to reset the the cool menus usage data + // for recently used commands. Calling this function will remove the list + // of recently used commands for intelligent menus. + void Reset(); + +protected: + + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called by the Options manager during load + // operations. + virtual bool OnLoad(); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called by the Options manager during save + // operations. + virtual bool OnSave(); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE bool CXTOptionsManager::IsInitialized() { + return m_bInitialized; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTOPTIONSMANAGER_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTOutBarCtrl.h b/Editor/XT/Include/XTOutBarCtrl.h new file mode 100644 index 0000000..31d9a83 --- /dev/null +++ b/Editor/XT/Include/XTOutBarCtrl.h @@ -0,0 +1,951 @@ +// XTOutBarCtrl.h interface for the CXTOutBarCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTOUTBARCTRL_H__) +#define __XTOUTBARCTRL_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// forwards + +class CXTBarItem; +class CXTBarFolder; +class CXTEditItem; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTOutBarCtrl is a CWnd derived class. It is used to create a shortcut +// bar window similar to the shortcut bar seen in Outlook™. +class _XT_EXT_CLASS CXTOutBarCtrl : public CWnd +{ + DECLARE_DYNCREATE(CXTOutBarCtrl) + +public: + + // Summary: Constructs a CXTOutBarCtrl object. + CXTOutBarCtrl(); + + // Summary: Destroys a CXTOutBarCtrl object, handles cleanup and de-allocation. + virtual ~CXTOutBarCtrl(); + +protected: + + // used internally + + int m_nFolderHeight; + int m_nSelFolder; + int m_nFolderHilighted; + int m_nItemHilighted; + int m_nLastFolderSelected; + int m_nLastItemSelected; + int m_nFirstItem; + int m_nIconSpacingLarge; + int m_nIconSpacingSmall; + int m_nHitInternal1; + int m_nHitInternal2; + int m_nLastDragItemDraw; + int m_nLastDragItemDrawType; + int m_nSelAnimCount; + int m_nSelAnimTiming; + int m_nAnimationTickCount; + CPen m_penBlack; + BOOL m_bUpArrow; + BOOL m_bDownArrow; + BOOL m_bUpPressed; + BOOL m_bDownPressed; + BOOL m_bIconPressed; + BOOL m_bLooping; + BOOL m_bPressedHighlight; + BOOL m_bUserClrBack; + BOOL m_bUserClrText; + CFont m_font; + DWORD m_dwFlags; + CRect m_rcUpArrow; + CRect m_rcDownArrow; + CSize m_sizeOffset; + CSize m_sizeMargin; + COLORREF m_clrBack; + COLORREF m_clrText; + CPtrArray m_arFolder; + CImageList* m_pLargeImageList; + CImageList* m_pSmallImageList; + + // used internally + + typedef enum { F_NORMAL, F_SELECT, F_HILIGHT } FOLDER_HILIGHT; + +public: + + // Input: iTime - Specifies the time, in milliseconds, that the selected item will animate. + // Summary: Call this member function to set an animation effect for the currently + // selected item. Not to be used with OBS_XT_SELHIGHLIGHT flag. + virtual void SetAnimSelHighlight(const int iTime); + + // Input: iFolder - The index of the folder to retrieve item data for. If -1, the currently + // selected folder item data is returned. + // Returns: A DWORD value. + // Summary: Call this member function to retrieve the item data that was set for + // the specified folder. + virtual DWORD GetFolderData(int iFolder = -1); + + // Input: iFolder - Index of the folder to retrieve the CWnd object for, if -1 the currently + // selected folder CWnd object is used. + // Returns: If 'iFolder' is -1, the child of the currently selected folder is returned. + // If no object has been set for the folder, the return value is NULL. + // Summary: Call this member function to retrieve the CWnd object that has been set + // for the folder specified by 'iFolder'. + virtual CWnd* GetFolderChild(int iFolder = -1); + + // Input: lpszFolderName - Name of the folder to add. + // pWndChild - Points to a valid CWnd object. The object must be created before + // inserting. + // dwData - Item data (lParam) for the folder. + // Returns: The integer value that represents the index of the added folder. + // Summary: Call this member function to add a folder with a CWnd child nested + // inside of it. You can insert a folder with any CWnd object, such as + // a tree control (see the OutlookBar sample). + virtual int AddFolderBar(LPCTSTR lpszFolderName,CWnd* pWndChild,const DWORD dwData = 0); + + // Input: iIndex - Index of the item to retrieve the text for. + // Returns: A CString object containing the retrieved text. + // Summary: Call this member function to get the text of the specified item for + // the currently selected folder. + virtual CString GetItemText(const int iIndex); + + // Input: lValue - Specifies the time, in milliseconds, between animation. A value of + // -1 will disable animation playback. + // Summary: Call this member function to set the tick count, in milliseconds, between + // each animation frame in folder scrolling. If you set a value of -1, + // or minor, no animation will be played. Animation requires the OBS_XT_ANIMATION + // flag be set. + virtual void SetAnimationTickCount(const long lValue); + + // Returns: An integer value representing the current tick count. + // Summary: Call this member function to get the current animation tick count. + virtual int GetAnimationTickCount(); + + // Input: iIndex - Index of the item in the currently selected folder. + // iImage - Index of the image, in the image list, to use for the specified item. + // Summary: Call this member function to set the image index, in the image list, + // for the 'iIndex' item of the currently selected folder. + virtual void SetItemImage(const int iIndex,const int iImage); + + // Input: iIndex - Index of the item to set item data for. + // dwData - Item data (lParam) to set. + // Summary: Call this member function to set the item data (lParam) for the specified + // item in the currently selected folder. + virtual void SetItemData(const int iIndex,const DWORD dwData); + + // Input: iIndex - Index of the item to retrieve the image index for. + // Returns: An integer value that represents the index of the desired image. + // Summary: Call this member function to retrieve the index of the image associated + // with the specified item in the currently selected folder. + virtual int GetItemImage(const int iIndex) const; + + // Input: iIndex - Index of the item to retrieve item data for. + // Returns: A DWORD value. + // Summary: Call this member function to get the item data (lParam) for the specified + // item in the currently selected folder. + virtual DWORD GetItemData(const int iIndex) const; + + // Input: iFolder - Index of the folder to insert the item into. + // bNofify - true to send an XTWM_OUTBAR_NOTIFY message. + // Summary: Call this member function to remove all items from the folder specified + // by 'iFolder'. + virtual void RemoveAllItems(int iFolder,bool bNofify=false); + + // Input: iIndex - Index of the item to remove. + // Summary: Call this member function to remove the specified item from the currently + // selected folder. + virtual void RemoveItem(const int iIndex); + + // Input: iIndex - Index of the item to set the text for. + // lpszItemName - Points to a NULL terminated string. + // Summary: Call this member function to set the text for the specified item in the + // currently selected folder. + virtual void SetItemText(const int iIndex,LPCTSTR lpszItemName); + + // Input: iIndex - Index of the item to begin editing for. + // Summary: Call this member function to begin local editing of the specified item + // in the currently selected folder. + virtual void StartItemEdit(const int iIndex); + + // Input: iIndex - Index of the folder to set the text label for. + // lpszFolderName - Points to a NULL terminated string. + // Summary: Call this member function to set the text label for the specified folder. + virtual void SetFolderText(const int iIndex,LPCTSTR lpszFolderName); + + // Input: iIndex - Index of the folder to begin editing. + // Summary: Call this member function to begin editing of the specified folder + // item's label. + virtual void StartGroupEdit(const int iIndex); + + // Input: iIndex - Index of the folder to retrieve the image list for. + // bSmall - TRUE to return the small image list. FALSE to return the large image + // list. + // Returns: A CImageList pointer representing the image list for the folder specified + // by 'iIndex'. + // Summary: Call this member function to get a pointer to the image list for the + // specified folder. + virtual CImageList* GetFolderImageList(const int iIndex,const BOOL bSmall) const; + + // Input: dwImageList - If OBS_XT_SMALLICON, the small image list is returned, if OBS_XT_LARGEICON, + // the large image list is returned. + // Returns: A CImageList pointer representing the global image list for the OutlookBar + // control. + // Summary: Call this member function to return the global image list for the OutlookBar + // control. + virtual CImageList* GetImageList(DWORD dwImageList); + + // Input: iFolder - Index of the folder to set the image list for. + // pImageList - Points to the new image list. + // dwImageList - If OBS_XT_SMALLICON, the small image list is set, if OBS_XT_LARGEICON, + // the large image list is set. + // Returns: A pointer to the previously set image list, or NULL if no previous + // image list exists. + // Summary: Call this member function to set the image list for the specified folder. + virtual CImageList* SetFolderImageList(const int iFolder,CImageList* pImageList,DWORD dwImageList); + + // Input: pImageList - Points to the new image list. + // dwImageList - If OBS_XT_SMALLICON, the small image list is set, if OBS_XT_LARGEICON, + // the large image list is set. + // Returns: A pointer to the previously set image list, or NULL if no previous image + // list exists. + // Summary: This member function will set the main image list. You can link different + // imagelists to the folders using the SetFolderImageList function. If a + // folder has been linked to an image list with the SetFolderImageList function, + // it will own the linked image list. Otherwise, it will use the image list + // set with this function. + virtual CImageList* SetImageList(CImageList* pImageList,DWORD dwImageList); + + // Input: iIndex - Index of the folder to remove. + // Summary: Call this member function to remove the specified folder and its items. + virtual void RemoveFolder(const int iIndex); + + // Returns: An integer value representing the index of the currently selected folder. + // Summary: This member function will get the index of the currently selected folder. + virtual int GetSelFolder() const; + + // Returns: An integer value representing the number of folders in the Outlook bar. + // Summary: This member function will get the total number of folders found in + // the Outlook bar. + virtual int GetFolderCount() const; + + // Input: iIndex - Index of the new selected folder. + // Summary: This member function will set the selected folder for the Outlook bar. + virtual void SetSelFolder(const int iIndex); + + // Returns: An integer value representing the number of items in the current folder. + // Summary: This member function gets the number of items found in the currently + // selected folder. + virtual int GetItemCount() const; + + // Input: iFolder - Index of the folder to insert the item into. + // iIndex - Index or position of the item to insert into the folder. + // lpszItemName - A NULL terminated string that represents the item label. This value + // cannot be set to NULL. + // iImage - Index into the folder's image list. + // dwData - User defined item data that you can assign to the item. Use GetItemData + // and SetItemData to access and change this data. + // Returns: The index of the newly inserted item. + // Summary: Call this member function to insert an item into the specified folder. + virtual int InsertItem(const int iFolder,const int iIndex,LPCTSTR lpszItemName,const int iImage = -1,const DWORD dwData = 0); + + // Input: lpszFolderName - A NULL terminated string that represents the folder's label. + // dwData - User defined item data for the folder. + // Returns: The index of the newly inserted folder. + // Summary: Call this member function to add a folder to the Outlook bar control. + virtual int AddFolder(LPCTSTR lpszFolderName,const DWORD dwData); + + // BULLETED LIST: + + // Input: dwRemove - Specifies OBS_XT_ styles to be removed during style modification. + // dwAdd - Specifies OBS_XT_ styles to be added during style modification. + // bRedraw - true to redraw the Outlook bar. + // Summary: Call this member function to modify an Outlook bar style. Styles + // to be added or removed can be combined by using the bitwise OR (|) + // operator. + // + // The desired styles for the Outlook bar can be one or more of the + // following: + // [ul] + // [li]OBS_XT_EDITGROUPS Enables folder local editing (renaming).[/li] + // [li]OBS_XT_EDITITEMS Enables item local editing (renaming).[/li] + // [li]OBS_XT_REMOVEGROUPS Enables the "Remove" command for + // folders in context menu.[/li] + // [li]OBS_XT_REMOVEITEMS Enables the "Remove" command for + // items in context menu.[/li] + // [li]OBS_XT_ADDGROUPS Enables folder insertion.[/li] + // [li]OBS_XT_DRAGITEMS Enables item dragging to rearrange + // position.[/li] + // [li]OBS_XT_ANIMATION Enables animation while changing folder + // selection.[/li] + // [li]OBS_XT_SELHIGHLIGHT Enables dimmed highlight of last + // pressed item.[/li] + // [li]OBS_XT_DEFAULT Same as OBS_XT_DRAGITEMS | OBS_XT_EDITGROUPS + // | OBS_XT_EDITITEMS | OBS_XT_REMOVEGROUPS | OBS_XT_REMOVEITEMS + // | OBS_XT_ADDGROUPS.[/li] + // [/ul] + virtual void ModifyFlag(const DWORD& dwRemove,const DWORD& dwAdd,const bool bRedraw = false); + + // Returns: A DWORD value representing the current style of the Outlook bar. + // Summary: Call this member function to get the current style set for the Outlook bar. + virtual DWORD GetFlag() const; + + // Input: bSet - TRUE to display small icons, or FALSE to display large icons. + // iFolder - Index of the folder to set the icon size for. If -1, all folder icons + // are set. + // Summary: Call this member function to set the size of the icons displayed in the + // Outlook bar control for the specified folder. + virtual void SetSmallIconView(const BOOL bSet,const int iFolder=-1); + + // Input: iFolder - Index of the folder to check. If -1, the currently selected folder + // is checked. + // Returns: TRUE if small icons are displayed, and FALSE if large icons are displayed. + // Summary: Call this member function to return the current state of the icon display + // for the Outlook bar control. + virtual BOOL IsSmallIconView(const int iFolder=-1) const; + + // Input: dwStyle - Style for the Outlook bar. It usually includes the + // WS_CHILD|WS_VISIBLE flags. + // rect - Size of the Outlook bar. + // pParentWnd - Parent of the control. + // nID - Identifier of the Outlook bar control. + // dwFlag - Specifies the style flags for the control. See ModifyFlag for a list + // of available styles. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to create the Outlook bar control. + virtual BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID,const DWORD dwFlag = OBS_XT_DEFAULT); + + // Input: dwExStyle - Extended style for the Outlook bar such as WS_EX_STATICEDGE. It can + // be NULL. + // dwStyle - Style for the Outlook bar. It usually includes the WS_CHILD|WS_VISIBLE + // flags. + // rect - Size of the Outlook bar. + // pParentWnd - Parent of the control. + // nID - Identifier of the Outlook bar control. + // dwFlag - Specifies the style flags for the control. See ModifyFlag for a list + // of available styles. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to create the Outlook bar control. + virtual BOOL CreateEx(DWORD dwExStyle,DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID,const DWORD dwFlag = OBS_XT_DEFAULT); + + // Input: pFont - Points to the font to be used by the Outlook bar. + // Summary: Call this member function to set the font used by the Outlook bar control. + virtual void SetFontX(CFont* pFont); + + // Returns: A pointer to a CFont object representing the font used by the Outlook bar + // control. + // Summary: Call this member function to retrieve the font used by the Outlook + // bar control. + virtual CFont* GetFontX(); + + // Input: iFolder - Index of the folder to retrieve. + // Returns: A pointer to a CXTBarFolder object. + // Summary: Call this member function to return a pointer to the CXTBarFolder data + // that is associated with the specified folder. + virtual CXTBarFolder* GetBarFolder(const int iFolder); + + // Input: iFolder - Index of the folder to retrieve. + // iIndex - Index of the item to retrieve. + // Returns: A pointer to a CXTBarItem object. + // Summary: Call this member function to return a pointer to the CXTBarItem data + // that is associated with the specified folder and item. + virtual CXTBarItem* GetBarFolderItem(const int iFolder,const int iIndex); + + // Input: clrBack - An RGB value that represents the background color. + // Summary: Call this member function to set the background color for the Outlook + // bar control. + virtual void SetBackColor(COLORREF clrBack); + + // Input: clrText - An RGB value that represents the text item color. + // Summary: Call this member function to set the text color for items in the Outlook + // bar control. + virtual void SetTextColor(COLORREF clrText); + + // Input: iFolder - Index of the folder where the item is located. + // iIndex - Index of the item. + // rect - Address of a CRect object that will receive the label size. + // Summary: Call this member function to retrieve the size of the label for the + // specified item. + virtual void GetLabelRect(const int iFolder,const int iIndex,CRect& rect); + + // Input: iFolder - Index of the folder where the item is located. + // iIndex - Index of the item. + // rect - Address of a CRect object that will receive the icon size. + // Summary: Call this member function to retrieve the size of the icon for the + // specified item. + virtual void GetIconRect(const int iFolder,const int iIndex,CRect& rect); + + // Input: rect - Address of a CRect object that will receive the size. + // Summary: Call this member function to retrieve the size of the client area for + // the Outlook bar. This is the inside area that contains the folders. + virtual void GetInsideRect(CRect& rect) const; + + // Input: iFolder - Index of the folder where the item is located. + // iIndex - Index of the item. + // rect - Address of a CRect object that will receive the item size. + // Summary: Call this member function to retrieve the size of the specified item. + // The size includes the area occupied by the item's label and icon. + virtual void GetItemRect(const int iFolder,const int iIndex,CRect& rect); + + // Input: iIndex - Index of the folder item. + // rect - Address of a CRect object that will receive the folder size. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to retrieve the size of the specified folder. + virtual BOOL GetFolderRect(const int iIndex,CRect& rect) const; + + // Returns: An integer value representing the index of the selected item. + // Summary: This member function will return the index of the currently selected + // item for the currently selected folder. + inline int GetCurSel(); + + // Input: iItem - Index of the item to select. + // bPressed - true if the item is to be pressed when selected. + // Summary: This member function will set the currently selected item for the currently + // selected folder. + inline void SetCurSel(int iItem,const BOOL bPressed=false); + + // Input: iFolder - Index of the folder that owns the item. + // iItem - Index of the item to enable or disable. + // bEnable - true to enable item, false to disable. + // Summary: Call this member function to enable or disable a folder item. + void EnableItem(int iFolder,int iItem,bool bEnable); + +protected: + + virtual void DrawScrollButton(CDC* pDC, CRect rect, UINT uType, UINT uState); + virtual void DrawItem(CDC* pDC, const int iFolder, CRect rc, const int iIndex, const BOOL bOnlyImage = false); + virtual void DrawDragArrow(CDC* pDC, const int iFrom, const int iTo); + virtual void DrawAnimItem(const int iOffsetX, const int iOffsetY, const int iIndex); + virtual void DrawFolder(CDC* pDC, const int iIndex, CRect rect, const FOLDER_HILIGHT eHilight); + virtual void DrawIcon(CDC* pDC, int iIcon, int iFolder, bool bHilight); + virtual void PaintItems(CDC* pDC, const int iFolder, CRect rc); + virtual void GetVisibleRange(const int iFolder, int& iFirst, int& iLast); + virtual int GetDragItemRect(const int iIndex, CRect& rect); + virtual CSize GetItemSize(const int iFolder, const int iIndex, const int iType); + virtual void AnimateFolderScroll(const int iFrom, const int iTo); + virtual void HighlightItem(const int iIndex, const BOOL bPressed = false); + virtual void HighlightFolder(const int iIndex); + virtual int HitTestEx(const CPoint& point, int& iIndex); + virtual BOOL IsValidItem(const int iIndex) const; + virtual void EndLabelEdit(CXTEditItem* pEdit, bool bIsFolder); + virtual void OnLabelChanged (const XT_OUTBAR_INFO* pObi); + virtual void DrawItemIcon( CDC* pDC, CPoint pt, CXTIconHandle hIcon, BOOL bEnabled ); + virtual void DrawItemText( CDC* pDC, CRect rc, CString strText, UINT nFormat, BOOL bEnabled ); + + // Ignore: + //{{AFX_VIRTUAL(CXTOutBarCtrl) + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTOutBarCtrl) + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnLargeIcon(); + afx_msg void OnUpdateLargeIcon(CCmdUI* pCmdUI); + afx_msg void OnSmallIcon(); + afx_msg void OnUpdateSmallIcon(CCmdUI* pCmdUI); + afx_msg void OnRemoveItem(); + afx_msg void OnUpdateRemoveItem(CCmdUI* pCmdUI); + afx_msg void OnRenameItem(); + afx_msg void OnUpdateRenameItem(CCmdUI* pCmdUI); + afx_msg void OnRButtonUp(UINT nFlags, CPoint point); + afx_msg void OnDestroy(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() + + friend class CXTEditItem; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE int CXTOutBarCtrl::GetCurSel() { + return m_nItemHilighted; +} +AFX_INLINE void CXTOutBarCtrl::SetCurSel(int iItem, const BOOL bPressed/*=false*/) { + HighlightItem(iItem, bPressed); +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTBarItem is a stand alone helper class. It is used by the CXTOutBarCtrl +// to maintain information about each folder item specified in the Outlook +// bar control. +class _XT_EXT_CLASS CXTBarItem +{ +public: + + // Input: lpszName - A NULL terminated string that represents the item name. + // nImageIndex - An index into the folders image list. + // dwData - User item data (lParam). + // Summary: Constructs a CXTBarItem object. + CXTBarItem(LPCTSTR lpszName,const int nImageIndex,DWORD dwData); + + // Summary: Destroys a CXTBarItem object, handles cleanup and de-allocation. + virtual ~CXTBarItem(); + + // Returns: An integer value that represents the zero-based index of the folder item. + // Summary: Call this member function to retrieve the zero-based index of the folder + // item. + int GetIndex(); + + // Input: iIndex - New index of the folder item. + // Summary: Call this member function to set the zero-based index of the folder item. + void SetIndex(int iIndex); + + // Returns: A DWORD value that represents the user data. + // Summary: Call this member function to return the user specified item data (lParam) + // for the folder item. + DWORD GetData(); + + // Input: dwData - Specifies the user data (lparam) value to be associated with the + // folder item. + // Summary: Call this member function to set a user data (lParam) value for the + // folder item. + void SetData(DWORD dwData); + + // Returns: A CString object that contains the folder item label. + // Summary: Call this member function to retrieve the label of the folder item. + CString GetName(); + + // Input: strName - A NULL terminated string that represents the item label. + // Summary: Call this member function to set the label of the folder item. + void SetName(CString strName); + + // Input: bSelected - true to set the item state to selected. + // Summary: Call this member function to set the items selected state. + void SelectItem(bool bSelected); + + // Returns: true if the item is selected, otherwise returns false. + // Summary: Call this member function to see if the item is selected. + bool IsSelected(); + + // Input: bEnable - true to enable, false to disable. + // Summary: Call this member function to toggle the enabled state for the outlook + // bar item. + void EnableItem(bool bEnable); + + // Returns: true if the item is enabled, otherwise returns false. + // Summary: Call this member function to determine if the item is enabled. + bool IsEnabled(); + +protected: + + int m_nIndex; + bool m_bEnabled; // true if the icon is enabled. + bool m_bSelected; + DWORD m_dwData; + CString m_strName; + + friend class CXTOutBarCtrl; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTBarItem::SelectItem(bool bSelected) { + m_bSelected = bSelected; +} +AFX_INLINE bool CXTBarItem::IsSelected() { + return m_bSelected; +} +AFX_INLINE void CXTBarItem::EnableItem(bool bEnable) { + m_bEnabled = bEnable; +} +AFX_INLINE bool CXTBarItem::IsEnabled() { + return m_bEnabled; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTBarFolder is a stand alone helper class. It is used by the CXTOutBarCtrl +// to maintain information about each folder specified in the Outlook bar +// control. +class _XT_EXT_CLASS CXTBarFolder +{ +public: + + // Input: lpszName - A NULL terminated string that represents the item name. + // dwData - User item data (lParam). + // Summary: Constructs a CXTBarFolder object. + CXTBarFolder(LPCTSTR lpszName,DWORD dwData); + + // Summary: Destroys a CXTBarFolder object, handles cleanup and de-allocation. + virtual ~CXTBarFolder(); + + // Returns: The number of folders in the Outlook bar. + // Summary: Call this member function to get the number of folders found in the + // Outlook bar. + int GetItemCount(); + + // Input: iIndex - Index of the item. + // lpszName - A NULL terminated string that represents the label of the item. + // nImage - Index into the folder's image list. + // dwData - User item data (lParam). + // Returns: An integer value. + // Summary: Call this member function to insert an item into the Outlook bar folder. + int InsertItem(int iIndex,LPCTSTR lpszName,const int nImage,const DWORD dwData); + + // Input: iIndex - Index of the item to retrieve. + // Returns: A pointer to a CXTBarItem object. + // Summary: Call this member function to retrieve the specified item. + CXTBarItem* GetItemAt(int iIndex); + + // Input: iIndex - Zero-based index of where to insert the new item. + // pBarItem - Points to a valid CXTBarItem object. + // Summary: Call this member function to insert a folder item into the location + // specified by 'iIndex'. + void InsertItemAt(int iIndex,CXTBarItem* pBarItem); + + // Input: iIndex - Index of the item to remove. + // Returns: A pointer to the removed item. + // Summary: Call this member function to remove the specified item from the folder. + CXTBarItem* RemoveItemAt(int iIndex); + + // Returns: A CString object. + // Summary: Call this member function to return the label of the folder item. + CString GetName(); + + // Input: strName - A NULL terminated string that represents the folder's new label. + // Summary: Call this member function to set the label for the folder item. + void SetName(CString strName); + + // Returns: A DWORD value that represents the item data. + // Summary: Call this member function to return the user item data (lParam) for + // the folder. + DWORD GetData(); + + // Input: dwData - User item data (lParam). + // Summary: Call this member function to set the user item data (lParam) for the + // folder. + void SetData(DWORD dwData); + + // Returns: A pointer to CImageList object if successful, otherwise returns NULL. + // Summary: Call this member function to return a pointer to the large image list + // for the folder. + CImageList* GetLargeImageList(); + + // Input: pLargeList - Points to a CImageList object. + // Summary: Call this member function to set the large image list for the folder. + void SetLargeImageList(CImageList* pLargeList); + + // Returns: A CImageList object if successful, otherwise returns NULL. + // Summary: Call this member function to return a pointer to the small image list + // for the folder. + CImageList* GetSmallImageList(); + + // Input: pSmallList - Points to a CImageList object. + // Summary: Call this member function to set the small image list for the folder. + void SetSmallImageList(CImageList* pSmallList); + + // Returns: A CWnd pointer to the child associated with the folder, or NULL if no + // objects were found. + // Summary: Call this member function to retrieve a CWnd pointer to the child object + // that is associated with this folder item. + CWnd* GetChild(); + + // Input: pChild - Points to a valid CWnd object. + // Summary: Call this member function to set the CWnd child to be associated with this + // folder item. + void SetChild(CWnd* pChild); + + // Input: iItem - Index of the item to select + // Summary: Call this member function to set the currently selected item for the folder. + void SetSelItem(int iItem); + + // Returns: A pointer to a CXTBarItem object if successful, otherwise returns NULL. + // Summary: Call this member function to return a pointer to the currently selected + // item. + CXTBarItem* GetSelItem(); + + // Returns: The index of the currently selected item if successful, otherwise returns -1. + // Summary: Call this member function to return the index for the currently selected + // item. + int GetSelIndex(); + +protected: + + BOOL m_bSmallIcons; + CWnd* m_pChild; + DWORD m_dwData; + CString m_strName; + CImageList* m_pLargeList; + CImageList* m_pSmallList; + CList m_barItems; + + friend class CXTOutBarCtrl; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTOutBarCtrl::SetFontX(CFont* pFont) { + ASSERT_VALID(pFont); LOGFONT lf; pFont->GetLogFont(&lf); m_font.DeleteObject(); m_font.CreateFontIndirect(&lf); +} +AFX_INLINE CFont* CXTOutBarCtrl::GetFontX() { + return &m_font; +} +AFX_INLINE void CXTOutBarCtrl::SetAnimationTickCount(const long lValue) { + m_nAnimationTickCount = lValue; +} +AFX_INLINE int CXTOutBarCtrl::GetAnimationTickCount() { + return m_nAnimationTickCount; +} +AFX_INLINE CXTBarFolder* CXTOutBarCtrl::GetBarFolder(const int iFolder) { + return (CXTBarFolder*)m_arFolder.GetAt(iFolder); +} +AFX_INLINE CXTBarItem* CXTOutBarCtrl::GetBarFolderItem(const int iFolder, const int iIndex) { + return GetBarFolder(iFolder)->GetItemAt(iIndex); +} +AFX_INLINE void CXTOutBarCtrl::SetBackColor(COLORREF clrBack) { + m_bUserClrBack = TRUE; + m_clrBack = clrBack; +} +AFX_INLINE void CXTOutBarCtrl::SetTextColor(COLORREF clrText) { + m_bUserClrText = TRUE; + m_clrText = clrText; +} + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE int CXTBarItem::GetIndex() { + return m_nIndex; +} +AFX_INLINE void CXTBarItem::SetIndex(int iIndex) { + m_nIndex = iIndex; +} +AFX_INLINE DWORD CXTBarItem::GetData() { + return m_dwData; +} +AFX_INLINE void CXTBarItem::SetData(DWORD dwData) { + m_dwData = dwData; +} +AFX_INLINE CString CXTBarItem::GetName() { + return m_strName; +} +AFX_INLINE void CXTBarItem::SetName(CString strName) { + m_strName = strName; +} + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE int CXTBarFolder::GetItemCount() { + return (int)m_barItems.GetCount(); +} +AFX_INLINE CString CXTBarFolder::GetName() { + return m_strName; +} +AFX_INLINE void CXTBarFolder::SetName(CString strName) { + m_strName = strName; +} +AFX_INLINE DWORD CXTBarFolder::GetData() { + return m_dwData; +} +AFX_INLINE void CXTBarFolder::SetData(DWORD dwData) { + m_dwData = dwData; +} +AFX_INLINE CImageList* CXTBarFolder::GetLargeImageList() { + return m_pLargeList; +} +AFX_INLINE void CXTBarFolder::SetLargeImageList(CImageList* pLargeList) { + m_pLargeList = pLargeList; +} +AFX_INLINE CImageList* CXTBarFolder::GetSmallImageList() { + return m_pSmallList; +} +AFX_INLINE void CXTBarFolder::SetSmallImageList(CImageList* pSmallList) { + m_pSmallList = pSmallList; +} +AFX_INLINE CWnd* CXTBarFolder::GetChild() { + return m_pChild; +} +AFX_INLINE void CXTBarFolder::SetChild(CWnd* pChild) { + m_pChild = pChild; +} + +////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////// +// Summary: CXTEditItem is a helper class derived from CXTEdit. It is used by +// CXTOutBarCtrl, an Outlook like control, to create an in-place edit box +// that is used to modify a folder or an item within the control. +class _XT_EXT_CLASS CXTEditItem : public CXTEdit +{ + DECLARE_DYNAMIC(CXTEditItem) + +public: + + // Summary: Constructs a CXTEditItem object. + CXTEditItem(); + + // Summary: Destroys a CXTEditItem object, handles cleanup and de-allocation. + virtual ~CXTEditItem(); + +protected: + + int m_iIndex; // Index of the folder or item. + bool m_bEscapeKey; // true if the escape key was pressed. + bool m_bSmallIcons; // true if the folder is using small icons. + bool m_bIsFolder; // true if the edit box is for a folder. + CRect m_rcOriginal; // Original size of the edit box when it was first created. + CString m_strText; // Original string of the edit box when it was first created, and the new text on edit completion. + CXTOutBarCtrl* m_pParentWnd; // Parent Outlook bar control. + +public: + + // Returns: An integer value that represents the index of the folder or item. + // Summary: Call this member function to return the index of the folder or item + // currently being edited. + int GetIndex() const; + + // Returns: A CString object that represents the text originally + // set for the edit control. If called after the edit is destroyed, it + // returns the modified text value. + // Summary: Call this member function to return the text associated with this edit + // control. + CString GetText() const; + + // Input: lpszText - NULL terminated string to be displayed in the edit control. + // dwStyle - Window style for the edit control. + // rect - Size of the edit control. + // pParentWnd - Owner window. + // nID - Control ID. + // nIndex - Folder or item index. + // bIsFolder - true if the edit is for a folder item. + // bSmallIcons - true if the parent folder is displaying small icons. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: The Outlook bar control calls this member to create an in-place edit + // control. + virtual BOOL Create(LPCTSTR lpszText,DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID,UINT nIndex,bool bIsFolder,bool bSmallIcons); + + // Ignore: + //{{AFX_VIRTUAL(CXTEditItem) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual void PostNcDestroy(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTEditItem) + + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE int CXTEditItem::GetIndex() const { + return m_iIndex; +} +AFX_INLINE CString CXTEditItem::GetText() const { + return m_strText; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTToolBox is a CXTOutBarCtrl derived class. It is used to create a +// toolbox control similar to the toolbox control seen in VisualStudio.NET. +class _XT_EXT_CLASS CXTToolBox : public CXTOutBarCtrl +{ + DECLARE_DYNCREATE(CXTToolBox) + +public: + + // Summary: Constructs a CXTToolBox object. + CXTToolBox(); + + // Summary: Destroys a CXTToolBox object, handles cleanup and de-allocation. + virtual ~CXTToolBox(); + +protected: + + int m_iFirst; // Index of the first visible item. + int m_iLast; // Index of the last visible item. + bool m_bAnimating; // true if the folder selection is changing. + +public: + + // Input: iItem - Index of the item to select. + // iFolder - Index of the folder the item belongs to. + // Summary: Call this member function to set the selection for the item specified + // by 'iItem'. + void SetSelItem(int iItem,int iFolder); + + // Input: dwExStyle - Extended style for the toolbox, such as WS_EX_STATICEDGE. It can be + // NULL. + // dwStyle - Style for the toolbox. It usually includes the WS_CHILD|WS_VISIBLE + // flags. + // rect - Size of the toolbox. + // pParentWnd - Parent of the control. + // nID - Identifier of the toolbox control. + // dwFlag - Specifies the style flags for the control. See CXTOutBarCtrl::ModifyFlag + // for a list of available styles. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to create the toolbox control. + virtual BOOL CreateEx(DWORD dwExStyle,DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID,const DWORD dwFlag = OBS_XT_DEFAULT); + + // Input: iFolder - Index of the folder where the item is located. + // iIndex - Index of the item. + // rect - Address of a CRect object that will receive the icon size. + // Summary: Call this member function to retrieve the size of the icon for the + // specified item. + virtual void GetIconRect(const int iFolder,const int iIndex,CRect& rect); + + // Input: iFolder - Index of the folder where the item is located. + // iIndex - Index of the item. + // rect - Address of a CRect object that will receive the item size. + // Summary: Call this member function to retrieve the size of the specified item. + // The size includes the area occupied by the item's label and icon. + virtual void GetItemRect(const int iFolder,const int iIndex,CRect& rect); + + // Input: iIndex - Index of the new selected folder. + // Summary: This member function will set the selected folder for the toolbox. + virtual void SetSelFolder(const int iIndex); + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTToolBox) + //}}AFX_VIRTUAL + + virtual void DrawIcon(CDC* pDC, int iIcon, int iFolder, bool bHilight); + virtual void DrawItem(CDC* pDC, const int iFolder, CRect rc, const int iIndex, const BOOL bOnlyImage); + virtual void DrawFolder(CDC* pDC, const int iIndex, CRect rect, const FOLDER_HILIGHT eHilight); + virtual void DrawScrollButton(CDC* pDC, CRect rect, UINT uType, UINT uState); + + // Ignore: + //{{AFX_MSG(CXTToolBox) + + afx_msg void OnPaint(); + afx_msg void OnRButtonUp(UINT nFlags, CPoint point); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTOUTBARCTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTOutlookBar.h b/Editor/XT/Include/XTOutlookBar.h new file mode 100644 index 0000000..6368f7c --- /dev/null +++ b/Editor/XT/Include/XTOutlookBar.h @@ -0,0 +1,161 @@ +// XTOutlookBar.h interface for the CXTContentItems class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTOUTLOOKBAR_H__) +#define __XTOUTLOOKBAR_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: XT_CONTENT_ITEM is a stand alone helper structure class. It is used +// by CXTOutlookBar. +struct XT_CONTENT_ITEM +{ + int m_nIndex; // Zero-based index for the menu item. + CString m_strText; // Text label for the menu item. + CXTIconHandle m_hIcon; // Icon handle for the menu item. +}; + +// Summary: CList definition for XT_CONTENT_ITEM structure list. +typedef CList CXTContentItemList; + +////////////////////////////////////////////////////////////////////// +// Summary: CCXTOutlookBar is a CListBox derived class. It is used to implement +// an Outlook bar style control. It can only be used with the LBS_OWNERDRAWVARIABLE +// style bit set. This is a simpler version of CXTOutBarCtrl and does not +// allow for shortcut folders. +class _XT_EXT_CLASS CXTOutlookBar : public CListBox +{ + DECLARE_DYNAMIC(CXTOutlookBar) + +public: + + // Summary: Constructs a CXTOutlookBar object. + CXTOutlookBar(); + + // Summary: Destroys a CXTOutlookBar object, handles cleanup and de-allocation. + virtual ~CXTOutlookBar(); + +protected: + + int m_cxIcon; // Width of the menu icon. + int m_cyIcon; // Height of the menu icon. + int m_nIndex; // Currently selected menu index. + bool m_bHilight; // true when the menu item is selected. + bool m_bUserColors; // true when the user has defined custom colors for the Outlook bar. + CPoint m_point; // Holds the cursor position. + COLORREF m_clrBack; // RGB value representing the background color. + COLORREF m_clrText; // RGB value representing the text color. + CXTContentItemList m_arContentItems; // Array of XT_CONTENT_ITEM structs that represent each item in the Outlook bar. + +public: + + // Input: dwStyle - Window style. + // rect - The size and position of the window, in client coordinates of + // 'pParentWnd'. + // pParentWnd - The parent window. + // nID - The ID of the child window. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function creates an Outlook Bar control. + virtual BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID); + + // Input: clrText - RGB value representing the text color. + // clrBack - RGB value representing the background color. + // Summary: Call this member function to set the text and background colors for + // the Outlook bar. + void SetColors(COLORREF clrText,COLORREF clrBack); + + // Returns: An RGB value that represents the background color. + // Summary: This member function gets an RGB value that represents the control's + // background color. + COLORREF GetBackColor(); + + // Returns: An RGB value that represents the text color. + // Summary: This member function gets an RGB value that represents the control's + // text color. + COLORREF GetTextColor(); + + // Input: iIndex - Specifies the zero-based index of the position to insert the + // menu item. If this parameter is -1, the menu item is added to the + // end of the list. + // nIconID - Resource ID of the icon associated with this menu item. + // lpszText - Points to the null-terminated string for the menu item + // Returns: The zero-based index of the position at which the menu item was inserted. + // The return value is LB_ERR if an error occurs. The return value is LB_ERRSPACE + // if insufficient space is available to store the new menu item. + // Summary: This member function inserts a menu item into the Outlook bar. Unlike + // the AddMenuItem member function, InsertMenuItem does not cause an Outlook + // bar with the LBS_SORT style to be sorted. + int InsertMenuItem(int iIndex,UINT nIconID,LPCTSTR lpszText); + + // Input: nIconID - Resource ID of the icon associated with this menu item. + // lpszText - Points to the null-terminated string for the menu item. + // Returns: The zero-based index to the menu item in the Outlook bar. The return + // value is LB_ERR if an error occurs. The return value is LB_ERRSPACE + // if insufficient space is available to store the new menu item. + // Summary: Call this member function to add a menu item to an Outlook bar. If + // the Outlook bar was not created with the LBS_SORT style, the menu item + // is added to the end of the Outlook bar. Otherwise, the menu item is + // inserted into the Outlook bar, and the Outlook bar is sorted. If the + // Outlook bar was created with the LBS_SORT style but not the LBS_HASSTRINGS + // style, the framework sorts the Outlook bar by one or more calls to + // the CompareItem member function. Use InsertMenuItem to insert a menu + // item into a specific location within the Outlook bar. + int AddMenuItem(UINT nIconID,LPCTSTR lpszText); + + // Input: iItem - Specifies the zero-based index of the menu item to retrieve. + // Returns: An XT_CONTENT_ITEM pointer. + // Summary: Call this member function to return an XT_CONTENT_ITEM object that + // represents the menu item specified by 'iItem'. + XT_CONTENT_ITEM* GetMenuItem(int iItem); + + // Ignore: + //{{AFX_VIRTUAL(CXTOutlookBar) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); + //}}AFX_VIRTUAL + +protected: + + // Input: pDC - Points to the current device context. + // Summary: This member function is called by the control for flicker free drawing. + void OnNoFlickerPaint(CDC* pDC); + + // Ignore: + //{{AFX_MSG(CXTOutlookBar) + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTOutlookBar::SetColors(COLORREF clrText, COLORREF clrBack) { + m_clrBack = clrBack; m_clrText = clrText; m_bUserColors = true; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTOUTLOOKBAR_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTPagerCtrl.h b/Editor/XT/Include/XTPagerCtrl.h new file mode 100644 index 0000000..b9a5090 --- /dev/null +++ b/Editor/XT/Include/XTPagerCtrl.h @@ -0,0 +1,208 @@ +// XTPagerCtrl.h interface for the CXTPagerCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTPAGERCTRL_H__) +#define __XTPAGERCTRL_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTPagerCtrl is a CWnd derived class. It is used to contain and scroll +// another window, and wraps the windows pager API. +class _XT_EXT_CLASS CXTPagerCtrl : public CWnd +{ + DECLARE_DYNAMIC(CXTPagerCtrl) + +public: + + // Summary: Constructs a CXTPagerCtrl object. + CXTPagerCtrl(); + + // Summary: Destroys a CXTPagerCtrl object, handles cleanup and de-allocation. + virtual ~CXTPagerCtrl(); + +protected: + +public: + + // Input: dwStyle - Specifies the window style attributes. The following styles are + // also used when creating pager controls, and can be combined by using + // the or (|) operator: + // [ul] + // [li]PGS_AUTOSCROLL The pager control will scroll when the + // user hovers the mouse over one of the scroll buttons.[/li] + // [li]PGS_DRAGNDROP The contained window can be a drag-and-drop + // target. The pager control will automatically scroll if an item + // is dragged from outside the pager over one of the scroll buttons.[/li] + // [li]PGS_HORZ Creates a pager control that can be scrolled + // horizontally. This style and the PGS_VERT style are mutually + // exclusive and cannot be combined.[/li] + // [li]PGS_VERT Creates a pager control that can be scrolled + // vertically. This is the default direction no direction style + // is specified. This style and the PGS_HORZ style are mutually + // exclusive and cannot be combined.[/li] + // [/ul] + // rect - The size and position of the window, in client coordinates of + // 'pParentWnd'. + // pParentWnd - The parent window. + // nID - The ID of the child window. + // Summary: This member function creates a pager child window and attaches it to + // this CWnd object. Returns nonzero if successful, otherwise returns zero. + virtual BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID); + + // Input: hwndChild - Handle to the window to be contained. + // Summary: This member function sets the contained window for the pager control. + // This command will not change the parent of the contained window. It + // only assigns a window handle to the pager control for scrolling. In + // most cases, the contained window will be a child window. If this is + // the case, the contained window should be a child of the pager control. + void SetChild(HWND hwndChild); + + // Summary: This member function forces the pager control to recalculate the + // size of the contained window. Using this command will result in a + // PGN_CALCSIZE notification being sent. + void RecalcSize(); + + // Input: bForward - BOOL value that determines if mouse forwarding is enabled or + // disabled. If this value is nonzero, mouse forwarding is enabled. + // If this value is zero, mouse forwarding is disabled. + // Summary: This member function enables or disables mouse forwarding for the + // pager control. When mouse forwarding is enabled, the pager control + // forwards WM_MOUSEMOVE messages to the contained window. + void ForwardMouse(BOOL bForward); + + // Input: clr - COLORREF value that contains the new background color of the + // pager control. + // Returns: A COLORREF value that contains the previous background color. + // Summary: This member function sets the current background color for the pager + // control. + COLORREF SetBkColor(COLORREF clr); + + // Returns: A COLORREF value that contains the current background color. + // Summary: This member function retrieves the current background color for + // the pager control. + COLORREF GetBkColor(); + + // Input: iBorder - New size of the border, in pixels. This value should not be + // larger than the pager button or less than zero. If 'iBorder' + // is too large, the border will be drawn the same size as the + // button. If 'iBorder' is negative, the border size will be set + // to zero. + // Returns: An integer value that contains the previous border size, in pixels. + // Summary: This member function sets the current border size for the pager + // control. + int SetBorder(int iBorder); + + // Returns: An integer value that contains the current border size, in pixels. + // Summary: This member function retrieves the current border size for the pager + // control. + int GetBorder(); + + // Input: iPos - Integer value that contains the new scroll position, in pixels. + // Summary: This member function sets the scroll position for the pager control. + void SetPos(int iPos); + + // Returns: An integer value that contains the current scroll position, in pixels. + // Summary: This member function retrieves the current scroll position of the + // pager control. + int GetPos(); + + // Input: iSize - Integer value that contains the new button size, in pixels. + // Returns: An integer value that contains the previous button size, in pixels. + // Summary: This member function sets the current button size for the pager + // control. + int SetButtonSize(int iSize); + + // Returns: An integer value that contains the current button size, in pixels. + // Summary: This member function retrieves the current button size for the pager + // control. + int GetButtonSize(); + + // Input: iButton - Indicates which button to retrieve the state for. See the description + // for 'iButton' in PGM_GETBUTTONSTATE for a list of possible values. + // Returns: The state of the button specified in 'iButton'. See the return value + // description in PGM_GETBUTTONSTATE for a list of possible values. + // Summary: This member function retrieves the state of the specified button + // in a pager control. + DWORD GetButtonState(int iButton); + + // Input: ppdt - Address of an IDropTarget pointer that receives the interface + // pointer. It is the caller's responsibility to call Release on this + // pointer when it is no longer needed. + // Summary: This member function retrieves a pager control's IDropTarget interface + // pointer. + void GetDropTarget(IDropTarget **ppdt); + + // Ignore: + //{{AFX_VIRTUAL(CXTPagerCtrl) + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTPagerCtrl) + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTPagerCtrl::SetChild(HWND hwndChild) { + ASSERT(::IsWindow(m_hWnd)); Pager_SetChild(m_hWnd, hwndChild); +} +AFX_INLINE void CXTPagerCtrl::RecalcSize() { + ASSERT(::IsWindow(m_hWnd)); Pager_RecalcSize(m_hWnd); +} +AFX_INLINE void CXTPagerCtrl::ForwardMouse(BOOL bForward) { + ASSERT(::IsWindow(m_hWnd)); Pager_ForwardMouse(m_hWnd, bForward); +} +AFX_INLINE COLORREF CXTPagerCtrl::SetBkColor(COLORREF clr) { + ASSERT(::IsWindow(m_hWnd)); return Pager_SetBkColor(m_hWnd, clr); +} +AFX_INLINE COLORREF CXTPagerCtrl::GetBkColor() { + ASSERT(::IsWindow(m_hWnd)); return Pager_GetBkColor(m_hWnd); +} +AFX_INLINE int CXTPagerCtrl::SetBorder(int iBorder) { + ASSERT(::IsWindow(m_hWnd)); return Pager_SetBorder(m_hWnd, iBorder); +} +AFX_INLINE int CXTPagerCtrl::GetBorder() { + ASSERT(::IsWindow(m_hWnd)); return Pager_GetBorder(m_hWnd); +} +AFX_INLINE void CXTPagerCtrl::SetPos(int iPos) { + ASSERT(::IsWindow(m_hWnd)); Pager_SetPos(m_hWnd, iPos); +} +AFX_INLINE int CXTPagerCtrl::GetPos() { + ASSERT(::IsWindow(m_hWnd)); return Pager_GetPos(m_hWnd); +} +AFX_INLINE int CXTPagerCtrl::SetButtonSize(int iSize) { + ASSERT(::IsWindow(m_hWnd)); return Pager_SetButtonSize(m_hWnd, iSize); +} +AFX_INLINE int CXTPagerCtrl::GetButtonSize() { + ASSERT(::IsWindow(m_hWnd)); return Pager_GetButtonSize(m_hWnd); +} +AFX_INLINE DWORD CXTPagerCtrl::GetButtonState(int iButton) { + ASSERT(::IsWindow(m_hWnd)); return Pager_GetButtonState(m_hWnd, iButton); +} +AFX_INLINE void CXTPagerCtrl::GetDropTarget(IDropTarget **ppdt) { + ASSERT(::IsWindow(m_hWnd)); Pager_GetDropTarget(m_hWnd, ppdt); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTPAGERCTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTPopupTearOffWnd.h b/Editor/XT/Include/XTPopupTearOffWnd.h new file mode 100644 index 0000000..562400b --- /dev/null +++ b/Editor/XT/Include/XTPopupTearOffWnd.h @@ -0,0 +1,163 @@ +// XTPopupTearOffWnd.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTPOPUPTEAROFFWND_H__) +#define __XTPOPUPTEAROFFWND_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CXTToolBar; +class CXTWndHook; +class CXTToolbarTearOff; + +///////////////////////////////////////////////////////////////////////////// +// Summary: CXTPopupTearOffWnd is a CWnd derived class window . It is used to display a +// "tear-off" popup window to be activated when the user presses the down arrow on +// a toolbar +class _XT_EXT_CLASS CXTPopupTearOffWnd : public CWnd +{ +public: + + // Input: iCmdID - Command ID that is currently active for the popup window. + // Summary: Constructs a CXTPopupTearOffWnd object. + CXTPopupTearOffWnd(int iCmdID); + + // Summary: Destroys a CXTPopupTearOffWnd object, handles cleanup and de-allocation. + virtual ~CXTPopupTearOffWnd(); + +// Attributes +protected: + + int m_iCmdID; // Command ID of the button that created this window. + BOOL m_bTearOff; // If window is tear-off + CWnd* m_pChild; // Child window + CRect m_rcExclude; // Exclusion rectangle for drawing adjacent borders. + CXTToolBar* m_pWndParent; // Pointer to the parent toolbar. + CXTWndHook* m_pHook; // Message hook. + +private: + + BOOL m_bPressed; + BOOL m_bHighlighted; + CXTControlBar* m_pControlBar; + +// Operations +public: + + // Input: pParent - Points to a valid parent toolbar. + // pControlBar - Points to a valid child controlbar. + // Summary: Call this member function to create a CXTToolBarPopupWnd object. + virtual BOOL Create(CXTToolBar* pParent,CXTControlBar* pControlBar); + + // Ignore: + //{{AFX_VIRTUAL(CXTPopupTearOffWnd) + protected: + virtual void PostNcDestroy(); + //}}AFX_VIRTUAL + +protected: + BOOL PtInTearOffRect(CPoint point); + virtual void OnHookedCommand(WPARAM wParam, LPARAM lParam); + virtual void OnStartDrag(CPoint point); + BOOL _Create(CXTToolBar* pParent, CWnd* pChild, CXTControlBar* pControlBar); + virtual CWnd* CloneChild(CXTControlBar* pControlBar) = 0; + +protected: + + // Ignore: + //{{AFX_MSG(CXTPopupTearOffWnd) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); + afx_msg void OnNcPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) ; + afx_msg void OnDestroy(); + afx_msg void OnPaint(); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnCaptureChanged(CWnd *pWnd); + //}}AFX_MSG + + class CXTPopupTearOffWndWndHook; + friend class CXTPopupTearOffWndWndHook; + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// Summary: CXTPopupColorTearOff is a CXTPopupTearOffWnd derived class window . It is used to display a +// "tear-off" popup window with Color Selector as a child +class _XT_EXT_CLASS CXTPopupColorTearOff : public CXTPopupTearOffWnd +{ +public: + + // Input: iCmdID - Command ID that is currently active for the popup window. + // Summary: Constructs a CXTPopupToolbarTearOff object. + CXTPopupColorTearOff(int iCmdID); + +protected: + + CWnd* CloneChild(CXTControlBar* pControlBar); + + // Ignore: + //{{AFX_MSG(CXTPopupColorTearOff) + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + afx_msg LRESULT OnSelEndOK(WPARAM wParam, LPARAM lParam); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// Summary: CXTPopupToolbarTearOff is a CXTPopupTearOffWnd derived class window . It is used to +// display a "tear-off" popup window with Toolbar as a child +class _XT_EXT_CLASS CXTPopupToolbarTearOff : public CXTPopupTearOffWnd +{ +public: + + // Input: iCmdID - Command ID that is currently active for the popup window. + // Summary: Constructs a CXTPopupToolbarTearOff object. + CXTPopupToolbarTearOff(int& iCmdID); + + // Input: pParent - Points to a valid parent toolbar. + // pControlBar - Points to a valid child toolbar. + // iNumCols - Number of columns to display when the toolbar is displayed. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to create a CXTPopupToolbarTearOff object. + virtual BOOL Create(CXTToolBar* pParent,CXTToolBar* pControlBar,int iNumCols=5); + +private: + int& m_iCmd; + void OnHookedCommand(WPARAM wParam, LPARAM lParam); + CWnd* CloneChild(CXTControlBar* pControlBar); + +protected: + + // Ignore: + //{{AFX_MSG(CXTPopupToolbarTearOff) + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif //__XTPOPUPTEAROFFWND_H__ \ No newline at end of file diff --git a/Editor/XT/Include/XTPreviewView.h b/Editor/XT/Include/XTPreviewView.h new file mode 100644 index 0000000..472e451 --- /dev/null +++ b/Editor/XT/Include/XTPreviewView.h @@ -0,0 +1,76 @@ +// XTPreviewView.h interface for the CXTPreviewView class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTPREVIEWVIEW_H__) +#define __XTPREVIEWVIEW_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTPreviewView is a CPreviewView derived class. CXTPreviewView is used +// to create an office style print preview window. To use the CXTPreviewView +// class add the following code to your CView derived class: +// +//
void CPrintPreviewView::OnFilePrintPreview() 
+//			{
+//			    // show print preview.
+//			    _xtAfxShowPrintPreview( this );
+//			}
+class _XT_EXT_CLASS CXTPreviewView : public CPreviewView +{ + DECLARE_DYNCREATE(CXTPreviewView) + +protected: + + // Summary: Constructs a CXTPreviewView object. + CXTPreviewView(); + + // Summary: Destroys a CXTPreviewView object, handles cleanup and de-allocation. + virtual ~CXTPreviewView(); + +public: + + // Ignore: + //{{AFX_VIRTUAL(CXTPreviewView) + //}}AFX_VIRTUAL + + // Summary: This member function is called by the print preview view + // to update the toolbar button icon to represent the current + // view display state, either 1 or 2 pages. + virtual void UpdateNumPageIcon(); + +protected: + + int m_i1PageIndex; // Icon index of the single page toolbar button + int m_i2PageIndex; // Icon index of the dual page toolbar button + CXTToolBar m_wndToolBar; // Toolbar used by print preview. + + // Ignore: + //{{AFX_MSG(CXTPreviewView) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + afx_msg void OnUpdateNumPageChange(CCmdUI* pCmdUI); + afx_msg void OnSize(UINT nType, int cx, int cy); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTPREVIEWVIEW_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTReBar.h b/Editor/XT/Include/XTReBar.h new file mode 100644 index 0000000..1c6aeac --- /dev/null +++ b/Editor/XT/Include/XTReBar.h @@ -0,0 +1,224 @@ +// XTReBar.h interface for the CXTReBar class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTREBAR_H__) +#define __XTREBAR_H__ + +// import base class + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// class forwards + +class CXTReBarCtrl; +class CXTNewCustomBarRequest; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTReBar is a CXTControlBar derived class. It is used to create a CXTReBar +// object. A CXTReBar object is a control bar that provides layout, persistence, +// and state information for rebar controls. +// +// A rebar object can contain a variety of child windows, usually other +// controls, including edit boxes, toolbars, and list boxes. A rebar object +// can display its child windows over a specified bitmap. Your application +// can automatically resize the rebar, or the user can manually resize +// the rebar by clicking or dragging its gripper bar. +// +// Rebar Control +// +// A rebar object behaves similarly to a toolbar object. A rebar uses +// the click-and-drag mechanism to resize its bands. A rebar control can +// contain one or more bands, with each band having any combination of +// a gripper bar, a bitmap, a text label, and a child window. However, +// bands cannot contain more than one child window. +// +// CXTReBar uses the CXTReBarCtrl class to provide its implementation. +// You can access the rebar control through GetReBarCtrl to take advantage +// of the control's customization options. For more information about +// rebar controls, see CXTReBarCtrl. For more information about using +// rebar controls, see Using CXTReBarCtrl in the XTreme Toolkit online +// help. +// +// Warning Rebar and rebar control objects do not support MFC +// control bar docking. If CRebar::EnableDocking is called, your application +// will assert. +class _XT_EXT_CLASS CXTReBar : public CXTControlBar +{ + DECLARE_DYNAMIC(CXTReBar) + +public: + + // Summary: Constructs a CXTReBar object. + CXTReBar(); + + // Input: pParentWnd - Pointer to the CWnd object whose Windows window is the parent of the + // status bar. This is normally your frame window. + // dwCtrlStyle - The rebar control style. By default, RBS_BANDBORDERS, which displays + // narrow lines to separate adjacent bands within the rebar control. + // See Rebar Control Styles in the Platform SDK for a list of styles. + // dwStyle - The rebar window styles. + // nID - The rebar's child-window ID. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to create a rebar. + BOOL Create(CWnd* pParentWnd,DWORD dwCtrlStyle = RBS_BANDBORDERS,DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_TOP,UINT nID = AFX_IDW_REBAR); + + // Returns: A reference to a CXTReBarCtrl object. + // Example:
CXTReBarCtrl& refReBarCtrl = m_wndReBar.GetReBarCtrl();
+ // + //
+	//			UINT nBandCount = refReBarCtrl.GetBandCount();
+	//			CString msg;
+	//			msg.Format("Band Count is: %u", nBandCount);
+	//			AfxMessageBox(msg);
+ // Summary: This member function allows direct access to the underlying common + // control. Call this member function to take advantage of the functionality + // of the Windows rebar common control in customizing your rebar. When + // you call GetReBarCtrl, it returns a reference object to the CXTReBarCtrl + // object so you can use either set of member functions. + // + // For more information about using CXTReBarCtrl to customize your rebar, + // see Using CXTReBarCtrl in the XTreme Toolkit online help. + CXTReBarCtrl& GetReBarCtrl() const; + + // Input: pBar - A pointer to a CWnd object that is the child window to be inserted + // into the rebar. The referenced object must have a WS_CHILD. + // pszText - A pointer to a string containing the text to appear on the rebar. + // NULL by default. The text contained in 'pszText' is not part of the + // child window. It is on the rebar itself. + // pbmp - A pointer to a CBitmap object to be displayed on the rebar background. + // NULL by default. + // dwStyle - A DWORD containing the style to apply to the rebar. See the 'fStyle' + // function description in the Win32 structure REBARBANDINFO for a complete + // list of band styles. + // Example:
+	//			// Define a pointer to a CRebar in your class definition,
+	//			// such as: CReBar* m_pReBar; More often, however, you
+	//			// would probably specify an instance in your class
+	//			// definition, such as: CReBar m_ReBar;
+	//			m_pReBar = new CReBar();
+	//			m_pReBar->Create(this);
+	//			m_wndDlgBar.Create(this, IDR_MAINFRAME, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR);
+	//			m_pReBar->AddBar(&m_wndDlgBar);
+ // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to add a band to the rebar. + BOOL AddBar(CWnd* pBar,LPCTSTR pszText = NULL,CBitmap* pbmp = NULL,DWORD dwStyle = RBBS_GRIPPERALWAYS | RBBS_FIXEDBMP); + + // Input: pBar - A pointer to a CWnd object that is the child window to be inserted + // into the rebar. The referenced object must have a WS_CHILD. + // clrFore - An RGB value that represents the foreground color of the rebar. + // clrBack - An RGB value that represents the background color of the rebar. + // pszText - A pointer to a string containing the text to appear on the rebar. + // NULL by default. The text contained in 'pszText' is not part of the + // child window. It is on the rebar itself. + // dwStyle - A DWORD containing the style to apply to the rebar. See the 'fStyle' + // function description in the Win32 structure REBARBANDINFO for a complete + // list of band styles. + // Example:
+	//			// Define a pointer to a CRebar in your class definition,
+	//			// such as: CReBar* m_pReBar; More often, however, you
+	//			// would probably specify an instance in your class
+	//			// definition, such as: CReBar m_ReBar;
+	//			m_pReBar = new CReBar();
+	//			m_pReBar->Create(this);
+	//			m_wndDlgBar.Create(this, IDR_MAINFRAME, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR);
+	//			m_pReBar->AddBar(&m_wndDlgBar);
+ // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to add a band to the rebar. + BOOL AddBar(CWnd* pBar,COLORREF clrFore,COLORREF clrBack,LPCTSTR pszText = NULL,DWORD dwStyle = RBBS_GRIPPERALWAYS); + + // Input: pBar - A pointer to a CWnd object that is the child window to be inserted + // into the rebar. The referenced object must have a WS_CHILD. + // pRBBI - Points to a REBARBANDINFO struct that contains information about + // the band added to a rebar control. + // Example:
+	//			// Define a pointer to a CRebar in your class definition,
+	//			// such as: CReBar* m_pReBar; More often, however, you
+	//			// would probably specify an instance in your class
+	//			// definition, such as: CReBar m_ReBar;
+	//			m_pReBar = new CReBar();
+	//			m_pReBar->Create(this);
+	//			m_wndDlgBar.Create(this, IDR_MAINFRAME, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR);
+	//			m_pReBar->AddBar(&m_wndDlgBar);
+ // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to add a band to the rebar. + BOOL AddBar(CWnd* pBar,REBARBANDINFO* pRBBI); + + // Input: lpszSection - Name of a section in the initialization file or a key in the Windows + // registry where state information is stored. + // Summary: Call this function to store information about the rebar owned by the + // frame window. This information can be read from the initialization + // file using LoadState. Information stored includes visibility, + // horizontal and vertical orientation, band size, and control bar position. + void SaveState(LPCTSTR lpszSection); + + // Input: lpszSection - Name of a section in the initialization file or a key in the Windows + // registry where state information is stored. + // Summary: Call this function to restore the settings of the rebar owned by the + // frame window. This information is written to the initialization file + // using SaveState. Information restored includes visibility, + // horizontal and vertical orientation, band size, and control bar position. + void LoadState(LPCTSTR lpszSection); + + // Ignore: + //{{AFX_VIRTUAL(CXTReBar) + public: + virtual void OnUpdateCmdUI(CFrameWnd* pTarget,BOOL bDisableIfNoHndler); + virtual INT_PTR OnToolHitTest(CPoint point,TOOLINFO* pTI) const; + virtual CSize CalcFixedLayout(BOOL bStretch,BOOL bHorz); + virtual CSize CalcDynamicLayout(int nLength,DWORD nMode); + protected: + virtual LRESULT WindowProc(UINT message,WPARAM wParam,LPARAM lParam); + //}}AFX_VIRTUAL + + int m_iBandCount; + // Ignore: + //{{AFX_MSG(CXTReBar) + afx_msg BOOL OnNcCreate(LPCREATESTRUCT); + afx_msg void OnPaint(); + afx_msg void OnHeightChange(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnNcPaint(); + afx_msg void OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS*); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg LRESULT OnShowBand(WPARAM wParam, LPARAM lParam); + afx_msg void OnRecalcParent(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + afx_msg void OnChildSize(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg LRESULT OnIdealSizeChanged(WPARAM wParam, LPARAM lParam); + + void OnBarDestroyed(CControlBar* pBar); + void SaveCustomBars(LPCTSTR pszSection); + void LoadCustomBars(LPCTSTR pszSection); + void CreateBar(CXTNewCustomBarRequest* pRequest); +public: + void PlaceNewBar(CFrameWnd* pFrame, CControlBar* pBar); +protected: + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTReBarCtrl& CXTReBar::GetReBarCtrl() const { + return *(CXTReBarCtrl*)this; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTREBAR_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTReBarCtrl.h b/Editor/XT/Include/XTReBarCtrl.h new file mode 100644 index 0000000..734c1bf --- /dev/null +++ b/Editor/XT/Include/XTReBarCtrl.h @@ -0,0 +1,573 @@ +// XTReBarCtrl.h interface for the CXTReBarCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTREBARCTRL_H__) +#define __XTREBARCTRL_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// BULLETED LIST: + +////////////////////////////////////////////////////////////////////// +// Summary: CXTReBarCtrl is a CWnd derived class. The CXTReBarCtrl class encapsulates +// the functionality of a rebar control, which is a container for a child +// window. The application in which the rebar control resides assigns +// the child window contained by the rebar control to the rebar band. +// The child window is usually another common control. +// +// Rebar controls contain one or more bands. Each band can contain a combination +// of a gripper bar, a bitmap, a text label, and a child window. The band +// can contain only one of each of these items. +// +// The rebar control can display the child window over a specified background +// bitmap. All rebar control bands can be resized, except those that use +// the RBBS_FIXEDSIZE style. As you reposition or resize a rebar control +// band, the rebar control manages the size and position of the child window +// assigned to that band. To resize or change the order of bands within +// the control, click and drag a band's gripper bar. A rebar control has +// three bands: +// [ul] +// [li]A flat, transparent toolbar control.[/li] +// [li]Both transparent standard and transparent dropdown buttons.[/li] +// [li]A combo box and four standard buttons.[/li] +// [/ul] +// Rebar control +// +// Rebar controls support: +// [ul] +// [li]Image lists.[/li] +// [li]Message-handling.[/li] +// [li]Custom draw functionality.[/li] +// [li]A variety of control styles in addition to standard window styles. For +// a list of these styles, see Rebar Control Styles in the Platform SDK.[/li] +// [/ul] +// See Also: CXTReBarCtrl +class _XT_EXT_CLASS CXTReBarCtrl : public CWnd +{ + DECLARE_DYNAMIC(CXTReBarCtrl) + +public: + + // Summary: Constructs a CXTReBarCtrl object. + CXTReBarCtrl(); + + // NUMBERED LIST: + + // Input: dwStyle - Specifies the combination of rebar control styles applied to the control. + // See Rebar Control Styles in the Platform SDK for a list of supported + // styles. + // rect - A reference to a CRect object or RECT structure, which is the position + // and size of the rebar control. + // pParentWnd - A pointer to a CWnd object that is the parent window of the rebar + // control. It must not be NULL. + // nID - Specifies the rebar control's control ID. + // Example:
+	//			CXTReBarCtrl* pReBarCtrl = new CXTReBarCtrl();
+	//			CRect rect;
+	//			GetWindowRect(rect);
+	//			pReBarCtrl->Create(RBS_BANDBORDERS, rect, this, AFX_IDW_REBAR);
+ // + // Use ReBar Control. + // ... + //
delete pReBarCtrl;
+ // Returns: Nonzero if the object was created successfully, otherwise returns zero. + // Summary: Call this member function to create a rebar control. Create a rebar + // control in two steps: + // [ol] + // [li]Call CXTReBarCtrl to construct a CXTReBarCtrl object.[/li] + // [li]Call this member function, which creates the Windows rebar control + // and attaches it to the CXTReBarCtrl object.[/li] + // [/ol] + // When you call Create, the common controls are initialized. + BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID); + + // Returns: The number of bands assigned to the control. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETBANDCOUNT, as described in the Platform SDK. + UINT GetBandCount() const; + + // Input: uBand - Zero-based index of the band for which the information will be retrieved. + // prbbi - A pointer to a REBARBANDINFO structure to receive the band information. + // You must set the 'cbSize' member of this structure to sizeof(REBARBANDINFO) + // and set the 'fMask' member to the items you want to retrieve before + // sending this message. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETBANDINFO as described in the Platform SDK. + BOOL GetBandInfo(UINT uBand,REBARBANDINFO* prbbi) const; + + // Returns: A value that represents the height, in pixels, of the control. + // Summary: Call this member function to retrieve the height of the rebar bar. + UINT GetBarHeight() const; + + // Input: prbi - A pointer to a REBARINFO structure that will receive the rebar control + // information. You must set the 'cbSize' member of this structure to + // sizeof(REBARINFO) before sending this message. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETBARINFO, as described in the Platform SDK. + BOOL GetBarInfo(REBARINFO* prbi) const; + + // Returns: A COLORREF value that represent the current default background color. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETBKCOLOR, as described in the Platform SDK. + COLORREF GetBkColor() const; + + // Returns: A pointer to an IDropTarget interface. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETDROPTARGET, as described in the Platform SDK. + IDropTarget* GetDropTarget() const; + + // Input: uBand - Zero-based index of a band in the rebar control. + // prc - A pointer to a RECT structure that will receive the bounds of the + // rebar band. + // Example:
+	//			CRect rc;
+	//			m_wndReBar.GetReBarCtrl().GetRect(0, &rc);
+	//			
+	//			CString msg;
+	//			msg.Format("rect.left = %d, rect.top = %d, rect.right = %d, rect.bottom = %d",
+	//			    rc.left, rc.top, rc.right, rc.bottom);
+	//			
+	//			AfxMessageBox(msg);
+ // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETRECT, as described in the Platform SDK. + BOOL GetRect(UINT uBand,LPRECT prc) const; + + // Example:
+	//			UINT nRowCount = m_wndReBar.GetReBarCtrl().GetRowCount();
+	//
+	//			CString msg;
+	//			msg.Format("Row Count is %d", nRowCount);
+	//			
+	//			AfxMessageBox(msg);
+ // Returns: A UINT value that represents the number of band rows in the control. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETROWCOUNT, as described in the Platform SDK. + UINT GetRowCount() const; + + // Input: uRow - Zero-based index of the band that will have its height retrieved. + // Example:
int nCount = m_wndReBar.GetReBarCtrl().GetRowCount();
+	//			int i;
+	//			for (i=0; i < nCount; i++)
+	//			{
+    //			    UINT nHeight = m_wndReBar.GetReBarCtrl().GetRowHeight(i);
+	//			    CString msg;
+	//			    msg.Format("Height of row %d is %u", i, nHeight);
+	//			    AfxMessageBox(msg);
+	//			}
+ // Returns: A UINT value that represents the row height, in pixels. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETROWHEIGHT, as described in the Platform SDK. + UINT GetRowHeight(UINT uRow) const; + + // Returns: A COLORREF value that represents the current default text color. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETTEXTCOLOR, as described in the Platform SDK. + COLORREF GetTextColor() const; + + // Returns: A pointer to a CToolTipCtrl object. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETTOOLTIPS, as described in the Platform SDK. Note that the MFC + // implementation of GetToolTips returns a pointer to a CToolTipCtrl, + // rather than an HWND. + CToolTipCtrl* GetToolTips() const; + + // Input: uBandID - The application-defined identifier of the specified band, passed in + // the 'wID' member of the REBARBANDINFO structure when the band is inserted. + // Returns: The zero-based band index if successful, or -1 otherwise. If duplicate + // band indices exist, the first one is returned. + // Summary: This member function implements the behavior of the Win32 message + // RB_IDTOINDEX, as described in the Platform SDK. + int IDToIndex(UINT uBandID) const; + + // Input: uBand - Zero-based index of the band to receive the new settings. + // prbbi - Pointer to a REBARBANDINFO structure that defines the band to be inserted. + // You must set the 'cbSize' member of this structure to sizeof(REBARBANDINFO) + // before sending this message. + // Example:
+	//			int nCount = m_wndReBar.GetReBarCtrl().GetBandCount();
+	//			CString strText = "Band #:";
+	//			
+	//			int i;
+	//			for (i=0; icbSize = sizeof(REBARBANDINFO);
+	//			
+	//			    CString strText;
+	//			    strText.Format("Band #: %d", i);
+	//			
+	//			    LPTSTR lpszText = strText.GetBuffer(strText.GetLength());
+	//			    prbbi->lpText = lpszText;
+	//			    prbbi->cch = strlen(lpszText) + 1;
+	//			    prbbi->fMask = RBBIM_TEXT;
+	//			
+	//			    m_wndReBar.GetReBarCtrl().SetBandInfo(i, prbbi);
+	//			
+	//			    strText.ReleaseBuffer();
+	//			}
+ // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // RB_SETBANDINFO, as described in the Platform SDK. + BOOL SetBandInfo(UINT uBand,REBARBANDINFO* prbbi); + + // Input: prbi - A pointer to a REBARINFO structure that contains the information to + // be set. You must set the cbSize member of this structure to + // sizeof(REBARINFO) before sending this message + // Example:
LPREBARINFO prbi = 0;
+	//			prbi = (LPREBARINFO)alloca(sizeof(REBARINFO));
+	//			if (!prbi)
+	//			{
+	//			    AfxMessageBox("Couldn't allocate memory for REBARINFO structure!");
+	//			    return;
+	//			}
+	//			
+	//			prbi->cbSize = sizeof(REBARINFO);
+	//			prbi->fMask = 0;
+	//			prbi->himl = 0;
+	//			m_wndReBar.GetReBarCtrl().SetBarInfo(prbi);
+ // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // RB_SETBARINFO, as described in the Platform SDK. + BOOL SetBarInfo(REBARINFO* prbi); + + // Input: clr - The COLORREF value that represents the new default background color. + // Returns: A COLORREF value that represents the previous default background color. + // Summary: This member function implements the behavior of the Win32 message + // RB_SETBKCOLOR, as described in the Platform SDK. See this topic for + // more information about when to set the background color, and how to + // set the default. + COLORREF SetBkColor(COLORREF clr); + + // Input: pWnd - A pointer to a CWnd object to set as the owner of the rebar control. + // Returns: A pointer to a CWnd object that is the current owner of the + // rebar control. + // Summary: This member function implements the behavior of the Win32 message + // RB_SETPARENT, as described in the Platform SDK. + // + // Note that this member function uses pointers to CWnd objects for both + // the current and selected owner of the rebar control, rather than handles + // to windows. + // + // Note This member function does not change the actual parent + // that was set when the control was created. Rather, it sends notification + // messages to the window you specify. + CWnd* SetOwner(CWnd* pWnd); + + // Input: clr - A COLORREF value that represents the new text color in the CXTReBarCtrl + // object. + // Returns: The COLORREF value representing the previous text color associated with + // the CXTReBarCtrl object. + // Summary: This member function implements the behavior of the Win32 message + // RB_SETTEXTCOLOR, as described in the Platform SDK. It is provided + // to support text color flexibility in a rebar control. + COLORREF SetTextColor(COLORREF clr); + + // Input: pToolTip - A pointer to a CToolTipCtrl object. + // Summary: Call this member function to associate a tooltip control with a rebar + // control. You must destroy the CToolTipCtrl object when you are done + // with it. + void SetToolTips(CToolTipCtrl* pToolTip); + + // Returns: A pointer to a CImageList object. Returns NULL if no image + // list is set for the control. + // Summary: Call this member function to get the CImageList object associated with + // a rebar control. This member function uses size and mask information + // stored in the REBARINFO structure, as described in the Platform SDK. + CImageList* GetImageList() const; + + // Input: pImageList - A pointer to a CImageList object containing the image list to be assigned + // to the rebar control. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to assign an image list to a rebar control. + BOOL SetImageList(CImageList* pImageList); + + // Input: uBand - Zero-based index of the band for which the borders will be retrieved. + // prc - A pointer to a RECT structure that will receive the band borders. + // If the rebar control has the RBS_BANDBORDERS style, each member of + // this structure will receive the number of pixels, on the corresponding + // side of the band, that constitute the border. If the rebar control + // does not have the RBS_BANDBORDERS style, only the left member of this + // structure receives valid information. For a description of rebar + // control styles, see Rebar Control Styles in the Platform SDK. + // Summary: This member function implements the behavior of the Win32 message + // RB_GETBANDBORDERS, as described in the Platform SDK. + void GetBandBorders(UINT uBand,LPRECT prc) const; + + // Example:
+	//			CPalette* pPalette = m_wndReBar.GetReBarCtrl().GetPalette();
+	//			if (pPalette)
+	//			{
+	//			    int nEntries = pPalette->GetEntryCount();
+	//			
+	//			    CString msg;
+	//			    msg.Format("Number of palette entries: %d", nEntries);
+	//			    AfxMessageBox(msg);
+	//			}
+	//			else
+	//			    AfxMessageBox("No palette!");
+ // Returns: A pointer to a CPalette object specifying the rebar control's + // current palette. + // Summary: Call this member function to retrieve the rebar control's current palette. + // Note that this member function uses a CPalette object as its return value, + // rather than an HPALETTE. + CPalette* GetPalette() const; + + // Input: hPal - An HPALETTE that specifies the new palette that the rebar control + // will use. + // Returns: A CPalette object. + // Summary: This member function implements the behavior of the Win32 message + // RB_SETPALETTE, as described in the Platform SDK. Note that this member + // function uses a CPalette object as its return value, rather than an + // HPALETTE. + CPalette* SetPalette(HPALETTE hPal); + + // Input: lpcs - A pointer to a valid tagCOLORSCHEME structure. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is used to retrieve the current color scheme for + // the rebar control. + BOOL GetColorScheme(COLORSCHEME* lpcs); + + // Input: lpcs - A pointer to a valid tagCOLORSCHEME structure. + // Summary: This member function is used to set the current color scheme for the + // rebar control. + void SetColorScheme(const COLORSCHEME* lpcs); + + // Input: uBand - Zero-based index of the band which the drag-and-drop operation will + // affect. + // dwPos - A DWORD value that contains the starting mouse coordinates. The horizontal + // coordinate is contained in the LOWORD and the vertical coordinate + // is contained in the HIWORD. If you pass (DWORD)-1, the rebar control + // will use the position of the mouse the last time the control's thread + // called ::GetMessage or ::PeekMessage. + // Summary: This member function implements the behavior of the Win32 message + // RB_BEGINDRAG, as described in the Platform SDK. + void BeginDrag(UINT uBand,DWORD dwPos = (DWORD)-1); + + // Input: uBand - Zero-based index of the band to be deleted. + // Example:
+	//			UINT nCount = m_wndReBar.GetReBarCtrl().GetBandCount();
+	//		
+	//		    if (nCount > 0)
+	//		       m_wndReBar.GetReBarCtrl().DeleteBand(nCount - 1);
+ // Returns: Nonzero if the band was deleted successfully, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // RB_DELETEBAND, as described in the Platform SDK. + BOOL DeleteBand(UINT uBand); + + // Input: dwPos - A DWORD value that contains the new mouse coordinates. The horizontal + // coordinate is contained in the LOWORD and the vertical coordinate + // is contained in the HIWORD. If you pass (DWORD)-1, the rebar control + // will use the position of the mouse the last time the control's thread + // called ::GetMessage or ::PeekMessage. + // Summary: This member function implements the behavior of the Win32 message RB_DRAGMOVE, + // as described in the Platform SDK. + void DragMove(DWORD dwPos = (DWORD)-1); + + // Summary: This member function implements the behavior of the Win32 message RB_ENDDRAG, + // as described in the Platform SDK. + void EndDrag(); + + // Input: prbht - A pointer to a RBHITTESTINFO structure. Before sending the message, + // the 'pt' member of this structure must be initialized, in client coordinates, + // to the point that will be tested. + // Returns: The zero-based index of the band at the given point, or -1 if no rebar band + // was at the point. + // Summary: This member function implements the behavior of the Win32 message RB_HITTEST, + // as described in the Platform SDK. + int HitTest(RBHITTESTINFO* prbht); + + // Input: uIndex - Zero-based index of the location where the band will be inserted. + // If you set this parameter to -1, the control will add the new band + // at the last location. + // prbbi - A pointer to a REBARBANDINFO structure that defines the band to be + // inserted. You must set the 'cbSize' member of this structure to + // sizeof(REBARBANDINFO) before calling this function. + // Example:
+	//			LPREBARBANDINFO prbbi = (LPREBARBANDINFO)alloca(sizeof(REBARBANDINFO));
+	//			prbbi->cbSize = sizeof(REBARBANDINFO);
+	//			
+	//			LPTSTR lpszText = (LPTSTR)alloca(80);
+	//			prbbi->lpText = lpszText;
+	//			prbbi->cch = 80;
+	//			
+	//			prbbi->fMask = RBBIM_BACKGROUND | RBBIM_CHILD |
+	//			    RBBIM_CHILDSIZE | RBBIM_COLORS | RBBIM_HEADERSIZE |
+	//			    RBBIM_IDEALSIZE | RBBIM_ID | RBBIM_IMAGE |
+	//			    RBBIM_LPARAM | RBBIM_SIZE | RBBIM_STYLE | RBBIM_TEXT;
+	//			
+	//			m_wndReBar.GetReBarCtrl().GetBandInfo(1, prbbi);
+	//			
+	//			m_wndReBar.GetReBarCtrl().InsertBand(2, prbbi);
+ // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message RB_INSERTBAND, + // as described in the Platform SDK. + BOOL InsertBand(UINT uIndex,REBARBANDINFO* prbbi); + + // Input: uBand - Zero-based index of the band to be maximized. + // Example:
+	//			UINT nCount = m_pReBarCtrl->GetBandCount();
+	//
+	//			UINT i;
+	//			for (i=0; iMaximizeBand(i);
+ // Summary: This member function implements the behavior of the Win32 message + // RB_MAXIMIZEBAND, as described in the Platform SDK. + void MaximizeBand(UINT uBand); + + // Input: uBand - Zero-based index of the band to be minimized. + // Example:
+	//			UINT nCount = m_pReBarCtrl->GetBandCount();
+	//
+	//			UINT i;
+	//			for (i=0; iMinimizeBand(i);
+ // Summary: This member function implements the behavior of the Win32 message + // RB_MINIMIZEBAND, as described in the Platform SDK. + void MinimizeBand(UINT uBand); + + // Input: uBand - Zero-based index of a band in the rebar control. + // fShow - Indicates if the band should be shown or hidden. If this value is + // TRUE, the band will be shown. Otherwise, the band will be hidden. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // RB_SHOWBAND, as described in the Platform SDK. + BOOL ShowBand(UINT uBand,BOOL fShow = TRUE); + + // Input: rect - A reference to a CRect object that specifies the rectangle that the + // rebar control should be sized to. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // RB_SIZETORECT, as described in the Platform SDK. Note that this member + // function uses a CRect object as a parameter, rather than a RECT structure. + BOOL SizeToRect(CRect& rect); + + // Input: uFrom - Zero-based index of the band to be moved. + // uTo - Zero-based index of the new band position. This parameter value must + // never be greater than the number of bands minus one. To obtain the + // number of bands, call GetBandCount. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // RB_MOVEBAND, as described in the Platform SDK. + BOOL MoveBand(UINT uFrom,UINT uTo); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE UINT CXTReBarCtrl::GetBandCount() const { + ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETBANDCOUNT, 0, 0L); +} +AFX_INLINE BOOL CXTReBarCtrl::GetBandInfo(UINT uBand, REBARBANDINFO* prbbi) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETBANDINFO, uBand, (LPARAM)prbbi); +} +AFX_INLINE UINT CXTReBarCtrl::GetBarHeight() const { + ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETBARHEIGHT, 0, 0L); +} +AFX_INLINE BOOL CXTReBarCtrl::GetBarInfo(REBARINFO* prbi) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETBARINFO, 0, (LPARAM)prbi); +} +AFX_INLINE COLORREF CXTReBarCtrl::GetBkColor() const { + ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_GETBKCOLOR, 0, 0L); +} +AFX_INLINE IDropTarget* CXTReBarCtrl::GetDropTarget() const { + ASSERT(::IsWindow(m_hWnd)); IDropTarget* pdt; ::SendMessage(m_hWnd, RB_GETDROPTARGET, 0, (LPARAM)&pdt); return pdt; +} +AFX_INLINE BOOL CXTReBarCtrl::GetRect(UINT uBand, LPRECT prc) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETRECT, uBand, (LPARAM)prc); +} +AFX_INLINE UINT CXTReBarCtrl::GetRowCount() const { + ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETROWCOUNT, 0, 0L); +} +AFX_INLINE UINT CXTReBarCtrl::GetRowHeight(UINT uRow) const { + ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETROWHEIGHT, uRow, 0L); +} +AFX_INLINE COLORREF CXTReBarCtrl::GetTextColor() const { + ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_GETTEXTCOLOR, 0, 0L); +} +AFX_INLINE CToolTipCtrl* CXTReBarCtrl::GetToolTips() const { + ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, RB_GETTOOLTIPS, 0, 0L)); +} +AFX_INLINE int CXTReBarCtrl::IDToIndex(UINT uBandID) const { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, RB_IDTOINDEX, uBandID, 0L); +} +AFX_INLINE BOOL CXTReBarCtrl::SetBandInfo(UINT uBand, REBARBANDINFO* prbbi) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SETBANDINFO, uBand, (LPARAM)prbbi); +} +AFX_INLINE BOOL CXTReBarCtrl::SetBarInfo(REBARINFO* prbi) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SETBARINFO, 0, (LPARAM)prbi); +} +AFX_INLINE COLORREF CXTReBarCtrl::SetBkColor(COLORREF clr) { + ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_SETBKCOLOR, 0, (LPARAM)clr); +} +AFX_INLINE CWnd* CXTReBarCtrl::SetOwner(CWnd* pWnd) { + ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND)::SendMessage(m_hWnd, RB_SETPARENT, (WPARAM)pWnd->m_hWnd, 0L)); +} +AFX_INLINE COLORREF CXTReBarCtrl::SetTextColor(COLORREF clr) { + ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_SETTEXTCOLOR, 0, (LPARAM)clr); +} +AFX_INLINE void CXTReBarCtrl::SetToolTips(CToolTipCtrl* pToolTip) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_SETTOOLTIPS, (WPARAM)pToolTip->m_hWnd, 0L); +} +AFX_INLINE void CXTReBarCtrl::GetBandBorders(UINT uBand, LPRECT prc) const { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_GETBANDBORDERS, uBand, (LPARAM)prc); +} +AFX_INLINE CPalette* CXTReBarCtrl::GetPalette() const { + ASSERT(::IsWindow(m_hWnd)); return CPalette::FromHandle((HPALETTE)::SendMessage(m_hWnd, RB_GETPALETTE, 0, 0L)); +} +AFX_INLINE CPalette* CXTReBarCtrl::SetPalette(HPALETTE hPal) { + ASSERT(::IsWindow(m_hWnd)); return CPalette::FromHandle((HPALETTE)::SendMessage(m_hWnd, RB_SETPALETTE, 0, (LPARAM)hPal)); +} +AFX_INLINE void CXTReBarCtrl::BeginDrag(UINT uBand, DWORD dwPos) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_BEGINDRAG, uBand, dwPos); +} +AFX_INLINE BOOL CXTReBarCtrl::DeleteBand(UINT uBand) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_DELETEBAND, uBand, 0L); +} +AFX_INLINE void CXTReBarCtrl::DragMove(DWORD dwPos) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_DRAGMOVE, 0, dwPos); +} +AFX_INLINE void CXTReBarCtrl::EndDrag() { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_ENDDRAG, 0, 0L); +} +AFX_INLINE int CXTReBarCtrl::HitTest(RBHITTESTINFO* prbht) { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, RB_HITTEST, 0, (LPARAM)prbht); +} +AFX_INLINE BOOL CXTReBarCtrl::InsertBand(UINT uIndex, REBARBANDINFO* prbbi) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_INSERTBAND, uIndex, (LPARAM)prbbi); +} +AFX_INLINE void CXTReBarCtrl::MaximizeBand(UINT uBand) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_MAXIMIZEBAND, uBand, 0L); +} +AFX_INLINE void CXTReBarCtrl::MinimizeBand(UINT uBand) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_MINIMIZEBAND, uBand, 0L); +} +AFX_INLINE BOOL CXTReBarCtrl::ShowBand(UINT uBand, BOOL fShow) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SHOWBAND, uBand, fShow); +} +AFX_INLINE BOOL CXTReBarCtrl::SizeToRect(CRect& rect) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SIZETORECT, 0, (LPARAM)&rect); +} +AFX_INLINE BOOL CXTReBarCtrl::MoveBand(UINT uFrom, UINT uTo) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_MOVEBAND, uFrom, uTo); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTREBARCTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTRegistryManager.h b/Editor/XT/Include/XTRegistryManager.h new file mode 100644 index 0000000..c2f9ae1 --- /dev/null +++ b/Editor/XT/Include/XTRegistryManager.h @@ -0,0 +1,437 @@ +// XTRegistryManager.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#ifndef __XTREGISTRYMANAGER_H__ +#define __XTREGISTRYMANAGER_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTRegistryManager is a stand alone registry management class. You +// can use it to read and write values from your system's registry or an +// .INI file. Use CXTRegistryManager to read and write string, integer, +// and binary data to and from the registry. You can also specify an .INI +// file name, and have these values stored there instead. +class _XT_EXT_CLASS CXTRegistryManager +{ +public: + + // Input: hKeyBase - Current key to be used in the registry. + // Summary: Constructs a CXTRegistryManager object. + CXTRegistryManager(HKEY hKeyBase = HKEY_CURRENT_USER); + + // Summary: Destroys a CXTRegistryManager object, handles cleanup and de-allocation. + virtual ~CXTRegistryManager(); + +protected: + + HKEY m_hKeyBase; // Handle to the registry key to use. The default is HKEY_CURRENT_USER. + CString m_strINIFileName; // Name of an .INI file for registry settings. + CWinApp* m_pWinApp; // Points to an application's CWinApp object. + +public: + + // Input: strINIFileName - Full path to the .INI file. + // Summary: This member function will set the .INI file name for the registry + // manager to use instead of the system registry. + void SetINIFileName(CString strINIFileName); + + // Returns: A CString object. + // Summary: This member function will return the file name of the .INI file + // used by the registry manager. + CString GetINIFileName(); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. If the section does not exist, it is created. + // The name of the section is case independent. The string may be any + // combination of uppercase and lowercase letters. + // section - Points to a null-terminated string that contains the entry into + // which the value is to be written. If the entry does not exist in + // the specified section, it is created. + // nValue - Contains the value to be written. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to write the specified INT value into + // the specified section of the application’s registry or .INI file. + BOOL WriteProfileInt(LPCTSTR lpszSection,LPCTSTR lpszEntry,int nValue); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. If the section does not exist, it is created. + // The name of the section is case independent. The string may be any + // combination of uppercase and lowercase letters. + // lpszEntry - Points to a null-terminated string that contains the entry into + // which the value is to be written. If the entry does not exist in + // the specified section, it is created. + // pData - Contains the value to be written. + // nBytes - Contains the size of the value to be written. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to write the specified binary value into + // the specified section of the application’s registry or .INI file. + BOOL WriteProfileBinary(LPCTSTR lpszSection,LPCTSTR lpszEntry,LPBYTE pData,UINT nBytes); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. If the section does not exist, it is created. + // The name of the section is case independent. The string may be any + // combination of uppercase and lowercase letters. + // lpszEntry - Points to a null-terminated string that contains the entry into + // which the value is to be written. If the entry does not exist in + // the specified section, it is created. + // lpszValue - Contains the value to be written. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to write the specified string value into + // the specified section of the application’s registry or .INI file. + BOOL WriteProfileString(LPCTSTR lpszSection,LPCTSTR lpszEntry,LPCTSTR lpszValue); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. If the section does not exist, it is created. + // The name of the section is case independent. The string may be any + // combination of uppercase and lowercase letters. + // lpszEntry - Points to a null-terminated string that contains the entry into + // which the value is to be written. If the entry does not exist in + // the specified section, it is created. + // pValue - Contains the value to be written. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to write the specified CPoint value into + // the specified section of the application’s registry or .INI file. + BOOL WriteProfilePoint(LPCTSTR lpszSection,LPCTSTR lpszEntry,CPoint * pValue); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. If the section does not exist, it is created. + // The name of the section is case independent. The string may be any + // combination of uppercase and lowercase letters. + // lpszEntry - Points to a null-terminated string that contains the entry into + // which the value is to be written. If the entry does not exist in + // the specified section, it is created. + // pValue - Contains the value to be written. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to write the specified CRect value into + // the specified section of the application’s registry or .INI file. + BOOL WriteProfileRect(LPCTSTR lpszSection,LPCTSTR lpszEntry,CRect * pValue); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. If the section does not exist, it is created. + // The name of the section is case independent. The string may be any + // combination of uppercase and lowercase letters. + // lpszEntry - Points to a null-terminated string that contains the entry into + // which the value is to be written. If the entry does not exist in + // the specified section, it is created. + // pValue - Contains the value to be written. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to write the specified CSize value into + // the specified section of the application’s registry or .INI file. + BOOL WriteProfileSize(LPCTSTR lpszSection,LPCTSTR lpszEntry,CSize * pValue); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. If the section does not exist, it is created. + // The name of the section is case independent. The string may be any + // combination of uppercase and lowercase letters. + // lpszEntry - Points to a null-terminated string that contains the entry into + // which the value is to be written. If the entry does not exist in + // the specified section, it is created. + // pValue - Contains the value to be written. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to write the specified double/float value + // into the specified section of the application’s registry or .INI file. + BOOL WriteProfileDouble(LPCTSTR lpszSection,LPCTSTR ,double * pValue); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. If the section does not exist, it is created. + // The name of the section is case independent. The string may be any + // combination of uppercase and lowercase letters. + // lpszEntry - Points to a null-terminated string that contains the entry into + // which the value is to be written. If the entry does not exist in + // the specified section, it is created. + // pValue - Contains the value to be written. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to write the specified DWORD value into + // the specified section of the application’s registry or .INI file. + // + // Note that as COLORREF is a typedef for a DWORD, WriteProfileColor calls + // this function. + BOOL WriteProfileDword(LPCTSTR lpszSection,LPCTSTR lpszEntry,DWORD * pValue); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. If the section does not exist, it is created. + // The name of the section is case independent. The string may be any + // combination of uppercase and lowercase letters. + // lpszEntry - Points to a null-terminated string that contains the entry into + // which the value is to be written. If the entry does not exist in + // the specified section, it is created. + // pValue - Contains the value to be written. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to write the specified COLORREF value + // into the specified section of the application’s registry or .INI file. + // + // Note that as COLORREF is a typedef for a DWORD, this function just + // calls WriteProfileDword. + BOOL WriteProfileColor(LPCTSTR lpszSection,LPCTSTR lpszEntry,COLORREF * pValue); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszEntry - Points to a null-terminated string that contains the entry whose + // value is to be retrieved. + // nDefault - Specifies the default value to return if the framework cannot + // find the entry. This value can be an unsigned value in the range 0 + // through 65,535 or a signed value in the range –32,768 through 32,767. + // Returns: The integer value of the string that follows the + // specified entry if the function is successful. The return value is + // the value of the 'nDefault' parameter if the function does not find the + // entry. The return value is zero if the value that corresponds to the + // specified entry is not an integer. + // Summary: Call this member function to retrieve the value of an integer from + // an entry within a specified section of the application’s registry or + // .INI file. + // + // This member function supports hexadecimal notation for the value + // in the .INI file. When you retrieve a signed integer, you should cast + // the value into an int. + UINT GetProfileInt(LPCTSTR lpszSection,LPCTSTR lpszEntry,int nDefault); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszEntry - Points to a null-terminated string that contains the entry whose + // value is to be retrieved. + // ppData - Address of a LPBYTE data member to receive the value. It is the + // caller's responsibility to free the memory allocated for 'ppData'. + // An example of this would be: + // + //
+	//			void CXTDockWindow::LoadBarSize(CString strSection)
+    //			{
+    //			    XT_MANAGE_STATE;  // Switch to toolkit resources/module state
+    //			
+    //			    // restore the previous bar style.
+    //			    if(::IsWindow(m_hWnd))
+    //			    {
+    //			        UINT nSize = 0;
+    //			        LPBYTE pbtData = 0;
+    //			        CString string;
+    //			        string.LoadString(XT_IDS_REG_BARPOS);
+    //			
+    //			        CXTRegistryManager regManager;
+    //			        if (regManager.GetProfileBinary( strSection,
+    //			            string, &pbtData, &nSize))
+    //			        {
+    //			            XT_BARPLACEMENT* pBP = 
+    //			                reinterpret_cast(pbtData);
+    //			
+    //			            SetBarPlacement(pBP);
+    //			            delete [] pbtData;
+    //			        }
+    //			    }
+    //			}
+ // pBytes - Address of a UINT to receive the size of 'ppData'. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to retrieve the binary value from an entry + // within a specified section of the application’s registry or .INI file. + BOOL GetProfileBinary(LPCTSTR lpszSection,LPCTSTR lpszEntry,BYTE** ppData,UINT* pBytes); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszEntry - Points to a null-terminated string that contains the entry whose + // value is to be retrieved. + // lpszDefault - Points to the default string value for the given entry if the + // entry cannot be found in the initialization file. + // Returns: The string associated with an entry within the specified section in the + // application’s registry or .INI file. The return value is the string from the + // application’s .INI file or 'lpszDefault' if the string cannot be found. + // Summary: Call this member function to retrieve the string associated with + // an entry within the specified section in the application’s registry + // or .INI file. The return value is the string from the application’s + // .INI file or 'lpszDefault' if the string cannot be found. The maximum + // string length supported by the framework is _MAX_PATH. If 'lpszDefault' + // is NULL, the return value is an empty string. + CString GetProfileString(LPCTSTR lpszSection,LPCTSTR lpszEntry,LPCTSTR lpszDefault); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszEntry - Points to a null-terminated string that contains the entry whose + // value is to be retrieved. + // ptResult - Points to the variable to be filled from the registry. + // Returns: TRUE if the function succeeds, and FALSE otherwise. + // Summary: Call this member function to retrieve the value of a CPoint from + // an entry within a specified section of the application’s registry or + // .INI file. Retrieves the CPoint value that follows the specified entry + // if the function is successful. + BOOL GetProfilePoint(LPCTSTR lpszSection,LPCTSTR lpszEntry,CPoint * ptResult); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszEntry - Points to a null-terminated string that contains the entry whose + // value is to be retrieved. + // rcResult - Points to the variable to be filled from the registry. + // Returns: TRUE if the function succeeds, and FALSE otherwise. + // Summary: Call this member function to retrieve the value of a CRect from + // an entry within a specified section of the application’s registry or + // .INI file. Retrieves the CRect value that follows the specified entry + // if the function is successful. + BOOL GetProfileRect(LPCTSTR lpszSection,LPCTSTR lpszEntry,CRect * rcResult); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszEntry - Points to a null-terminated string that contains the entry whose + // value is to be retrieved. + // rcResult - Points to the variable to be filled from the registry. + // Returns: TRUE if the function succeeds, and FALSE otherwise. + // Summary: Call this member function to retrieve the value of a CSize from + // an entry within a specified section of the application’s registry or + // .INI file. Retrieves the CSize value that follows the specified entry + // if the function is successful. + BOOL GetProfileSize(LPCTSTR lpszSection,LPCTSTR lpszEntry,CSize * rcResult); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszEntry - Points to a null-terminated string that contains the entry whose + // value is to be retrieved. + // rcResult - Points to the variable to be filled from the registry. + // Returns: TRUE if the function succeeds, and FALSE otherwise. + // Summary: Call this member function to retrieve the value of a double from + // an entry within a specified section of the application’s registry or + // .INI file. Retrieves the value that follows the specified entry if the + // function is successful. + BOOL GetProfileDouble(LPCTSTR lpszSection,LPCTSTR lpszEntry,double * rcResult); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszEntry - Points to a null-terminated string that contains the entry whose + // value is to be retrieved. + // rcResult - Points to the variable to be filled from the registry. + // Returns: TRUE if the function succeeds, and FALSE otherwise. + // Summary: Call this member function to retrieve the value of a DWORD from + // an entry within a specified section of the application’s registry or + // .INI file. Retrieves the value that follows the specified entry if the + // function is successful. + // + // Note that as COLORREF is a typedef for a DWORD, GetProfileColor calls + // this function. + BOOL GetProfileDword(LPCTSTR lpszSection,LPCTSTR lpszEntry,DWORD * rcResult); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszEntry - Points to a null-terminated string that contains the entry whose + // value is to be retrieved. + // rcResult - Points to the variable to be filled from the registry. + // Returns: TRUE if the function succeeds, and FALSE otherwise. + // Summary: Call this member function to retrieve the value of a COLORREF from + // an entry within a specified section of the application’s registry or + // .INI file. Retrieves the value that follows the specified entry if the + // function is successful. + // + // Note that as COLORREF is a typedef for a DWORD, this function just + // calls GetProfileDword. + BOOL GetProfileColor(LPCTSTR lpszSection,LPCTSTR lpszEntry,COLORREF * rcResult); + + // BULLETED LIST: + + // Input: lpszSection - Points to a null-terminated string that specifies the section containing + // the entry. + // mapItems - A reference to a CMap, which will contain + // the items in the registry under this section. Can be NULL. + // Does not include subsection names. + // arrayNames - A reference to a CStringArray which, if not NULL, will contain an array + // of names in the order they were read from the registry. + // Returns: Zero if section is empty, otherwise it returns the number of values + // present. + // Summary: Call this function to fill a CMap (CString to DWORD) with the names + // and value types under a specific registry section. The DWORD values + // returned are as follows: + // [ul] + // [li]REG_BINARY Binary data in any form.[/li] + // [li]REG_DWORD A 32-bit number.[/li] + // [li]REG_DWORD_LITTLE_ENDIAN A 32-bit number in little-endian format. + // This is equivalent to REG_DWORD. In little-endian format, a + // multi-byte value is stored in memory from the lowest byte (the + // "little end") to the highest byte. For example, the value 0x12345678 + // is stored as (0x78 0x56 0x34 0x12) in little-endian format. + // Windows NT/Windows 2000, Windows 95, and Windows 98 are designed + // to run on little-endian computer architectures. A user may + // connect to computers that have big-endian architectures, such + // as some UNIX systems.[/li] + // [li]REG_DWORD_BIG_ENDIAN A 32-bit number in big-endian format. + // In big-endian format, a multi-byte value is stored in memory + // from the highest byte (the "big end") to the lowest byte. For + // example, the value 0x12345678 is stored as (0x12 0x34 0x56 0x78) + // in big-endian format.[/li] + // [li]REG_EXPAND_SZ A null-terminated string that contains unexpanded + // references to environment variables (for example, "%PATH%"). + // It will be a Unicode or ANSI string depending on whether you + // use the Unicode or ANSI functions. To expand the environment + // variable references, use the ExpandEnvironmentStrings function.[/li] + // [li]REG_LINK A Unicode symbolic link. Used internally. Applications + // should not use this type.[/li] + // [li]REG_MULTI_SZ An array of null-terminated strings, terminated + // by two null characters.[/li] + // [li]REG_NONE No defined value type.[/li] + // [li]REG_QWORD A 64-bit number.[/li] + // [li]REG_QWORD_LITTLE_ENDIAN A 64-bit number in little-endian + // format. This is equivalent to REG_QWORD.[/li] + // [li]REG_RESOURCE_LIST A device-driver resource list.[/li] + // [li]REG_SZ A null-terminated string. It will be a Unicode + // or ANSI string, depending on whether you use the Unicode or + // ANSI functions.[/li] + // [/ul] + // The function also takes a pointer to a CStringArray, because CMap is + // a sorted container, and therefore it is not possible to get the items + // in the order they appeared from it. + // + // Pass NULL for the CStringArray* if you don't want to use it, and NULL + // into the CMap if you only require a list of the item names. + int EnumValues(LPCTSTR lpszSection,CMap * mapItems,CStringArray * arrayNames); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // arrayKeys - A reference to a CStringArray, which will contain the keys in the + // registry under the above key. + // Summary: Call this function to fill a CStringArray with the names of keys below + // the key specified. The return value indicates the number of keys found + // by the function, which can be used to check if any were found. + // CStringArray::GetSize will give the same result if needed, assuming + // the array is zeroed when it goes in. The function does not zero it, + // leaving the possibility of getting a list of subkeys of more than one + // key, for whatever reason. + int EnumKeys(LPCTSTR lpszSection,CStringArray & arrayKeys); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszKey - Points to a null-terminated string that specifies the subkey to delete. + // Returns: true if successful, otherwise returns false. + // Summary: Call this function to delete a registry key, and all its contents. + bool DeleteKey(LPCTSTR lpszSection,LPCTSTR lpszKey); + + // Input: lpszSection - Points to a null-terminated string that specifies the section + // containing the entry. + // lpszKey - Points to a null-terminated string that specifies the value to delete. + // Returns: true if successful, otherwise returns false. + // Summary: Call this function to delete a registry value. + bool DeleteValue(LPCTSTR lpszSection,LPCTSTR lpszKey); + +protected: + + virtual HKEY GetAppRegistryKey(); + virtual HKEY GetSectionKey(LPCTSTR lpszSection); + +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTRegistryManager::SetINIFileName(CString strINIFileName) { + m_strINIFileName = strINIFileName; +} +AFX_INLINE CString CXTRegistryManager::GetINIFileName() { + return m_strINIFileName; +} + +////////////////////////////////////////////////////////////////////// + +#endif // __XTREGISTRYMANAGER_H__ \ No newline at end of file diff --git a/Editor/XT/Include/XTResize.h b/Editor/XT/Include/XTResize.h new file mode 100644 index 0000000..e3394ee --- /dev/null +++ b/Editor/XT/Include/XTResize.h @@ -0,0 +1,359 @@ +// XTResize.h: interface for the CXTResize class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +//-------------------------------------------------------------------- +// Based on the resizable classes created by Torben B. Haagh. Used by permission. +// http://www.codeguru.com/dialog/torbenResizeDialog.shtml +//-------------------------------------------------------------------- +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTRESIZE_H__) +#define __XTRESIZE_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: The XT_SIZING structure is a stand alone helper structure class. It +// is used by the CXTResize class to maintain size and ID for a particular +// window being sized. +struct XT_SIZING +{ + UINT id; // Control identifier of the window sized. + XT_RESIZERECT rrc; // Size of the window sized. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: The CXTSizeIcon class is a CStatic derived helper class. It is used +// by CXTResize to display the sizing grip in the lower right corner of +// a sizing window. +class _XT_EXT_CLASS CXTSizeIcon : public CStatic +{ +public: + + // Summary: Constructs a CXTSizeIcon object. + CXTSizeIcon(); + +protected: + + HCURSOR m_hCursor; // Handle to the cursor displayed for the size icon. + CBitmap m_bmSizeIcon; // Size icon bitmap + + // Ignore: + //{{AFX_MSG(CXTSizeIcon) + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTItem is a stand alone helper class. It is used by CXTResize to +// maintain information about each item to be sized or moved. +class _XT_EXT_CLASS CXTItem +{ +public: + + // Input: pwnd - Pointer to the window to be sized or moved. + // rrcSizing - Reference to a CXTResizeRect object. + // rcWindow - Reference to a CRect object. + // bDeleteWnd - TRUE if the window is to be deleted. + // Summary: Constructs a CXTItem object. + CXTItem(CWnd* pwnd,const CXTResizeRect& rrcSizing,CRect& rcWindow,BOOL bDeleteWnd); + + // Summary: Destroys a CXTItem object, handles cleanup and de-allocation. + virtual ~CXTItem(); + + BOOL m_bDeleteWnd; // TRUE if the window is to be deleted + BOOL m_bInitialSize; // Initial size/move has been completed. + CWnd* m_pwnd; // A pointer to the window to be sized or moved. + CXTResizeRect m_rrcSizing; // Sizing option. + CXTResizeRect m_rrcWindow; // Last control size. + CXTResizeRect m_rrcInitWindow; // Initial control size. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTResize is a base class. It is used by resizing dialogs, property +// sheets, and form views. It acts as a manager to maintain size and location +// of the dialog and dialog items. +class _XT_EXT_CLASS CXTResize +{ +public: + + // BULLETED LIST: + + // Input: object - Points to the parent or owner window object, of type CWnd, to which the + // resizing object belongs. + // nFlags - Flags that are to be passed to CXTResize that specify the attributes + // of the resizing property page. They can be one or more of the following, + // and can be combined using the or (|) operator: + // [ul] + // [li]SZ_NOSIZEICON Do not add size icon.[/li] + // [li]SZ_NOHORISONTAL No horizontal resizing.[/li] + // [li]SZ_NOVERTICAL No vertical resizing.[/li] + // [li]SZ_NOMINSIZE Do not require a minimum size.[/li] + // [li]SZ_NOCLIPCHILDREN Do not set clip children style.[/li] + // [li]SZ_NOTRANSPARENTGROUP Do not set transparent style + // for group boxes.[/li] + // [/ul] + // Summary: Constructs a CXTResize object. + CXTResize(CWnd* pwnd,const UINT nFlags = 0); + + // Summary: Destroys a CXTResize object, handles cleanup and de-allocation. + virtual ~CXTResize(); + + // Input: nID - Specifies the control's ID. + // left - How much the left side will move when the dialog is resized. + // top - How much the top side will move when the dialog is resized. + // right - How much the right side will move when the dialog is resized. + // bottom - How much the bottom side will move when the dialog is resized. + // Summary: The SetResize function specifies how much each side of a control will + // move when the dialog is resized. If a control should be repositioned + // (e.g. an OK button) then all four sides should move by the same amount + // of pixels, as the dialog is resized. If a control should be resized + // just as much as the dialog (e.g. the list control in the file dialog), + // then the left and top sides shouldn't move, and the right and bottom + // sides should move by the same amount of pixels as the dialog. + void SetResize(const UINT nID,XT_RESIZE left,XT_RESIZE top,XT_RESIZE right,XT_RESIZE bottom); + + // Input: nID - Specifies the control's ID. + // rrcSizing - How much the left, top, right and bottom sides will move when + // the dialog is resized. + // Summary: The SetResize function specifies how much each side of a control will + // move when the dialog is resized. If a control should be repositioned + // (e.g. an OK button) then all four sides should move by the same amount + // of pixels, as the dialog is resized. If a control should be resized + // just as much as the dialog (e.g. the list control in the file dialog), + // then the left and top sides shouldn't move, and the right and bottom + // sides should move by the same amount of pixels as the dialog. + void SetResize(const UINT nID,const XT_RESIZERECT& rrcSizing); + + // Input: nID - Specifies the control's ID. + // hWnd - HWND of the dialog item to be sized. + // rrcSizing - How much the left, top, right and bottom sides will move when + // the dialog is resized. + // Summary: The SetResize function specifies how much each side of a control will + // move when the dialog is resized. If a control should be repositioned + // (e.g. an OK button) then all four sides should move by the same amount + // of pixels, as the dialog is resized. If a control should be resized + // just as much as the dialog (e.g. the list control in the file dialog), + // then the left and top sides shouldn't move, and the right and bottom + // sides should move by the same amount of pixels as the dialog. + void SetResize(const UINT nID,const HWND hWnd,const XT_RESIZERECT& rrcSizing); + + // Input: nID - Specifies the control's ID. + // hWnd - HWND of the dialog item to be sized. + // rpTopLeft - How much the top and left sides will move when the dialog is resized. + // rpBottomRight - How much the bottom and right sides will move when the dialog is resized. + // Summary: The SetResize function specifies how much each side of a control will + // move when the dialog is resized. If a control should be repositioned + // (e.g. an OK button) then all four sides should move by the same amount + // of pixels, as the dialog is resized. If a control should be resized + // just as much as the dialog (e.g. the list control in the file dialog), + // then the left and top sides shouldn't move, and the right and bottom + // sides should move by the same amount of pixels as the dialog. + void SetResize(const UINT nID,const HWND hWnd,const XT_RESIZEPOINT& rpTopLeft,const XT_RESIZEPOINT& rpBottomRight); + + // Input: nID - Specifies the control's ID. + // rpTopLeft - How much the top and left sides will move when the dialog is resized. + // rpBottomRight - How much the bottom and right sides will move when the dialog is resized. + // Summary: The SetResize function specifies how much each side of a control will + // move when the dialog is resized. If a control should be repositioned + // (e.g. an OK button) then all four sides should move by the same amount + // of pixels, as the dialog is resized. If a control should be resized + // just as much as the dialog (e.g. the list control in the file dialog), + // then the left and top sides shouldn't move, and the right and bottom + // sides should move by the same amount of pixels as the dialog. + void SetResize(const UINT nID,const XT_RESIZEPOINT& rpTopLeft,const XT_RESIZEPOINT& rpBottomRight); + + // Input: arr[] - Array of XT_SIZING structures that specify how much the left, top, + // right and bottom sides of the dialog item will move when the dialog + // is resized. + // Summary: The SetResize function specifies how much each side of a control will + // move when the dialog is resized. If a control should be repositioned + // (e.g. an OK button) then all four sides should move by the same amount + // of pixels, as the dialog is resized. If a control should be resized + // just as much as the dialog (e.g. the list control in the file dialog), + // then the left and top sides shouldn't move, and the right and bottom + // sides should move by the same amount of pixels as the dialog. + void SetResize(XT_SIZING arr[]); + + // Input: sz - Specifies the minimum width and height the dialog can be sized to. + // Summary: This member function sets the minimum size explicitly. Initial size + // is the default. + void SetMinSize(CSize& sz); + + // Input: sz - Specifies the maximum width and height the dialog can be sized to. + // Summary: This member function sets the maximum size. No maximum is the default. + void SetMaxSize(CSize& sz); + + // Input: pszSection - Name of a section in the initialization file or a key in the Windows + // registry where placement information is stored. + // Summary: This member function saves the window placement to the registry. + void SavePlacement(LPCTSTR pszSection); + + // Input: pszSection - Name of a section in the initialization file or a key in the Windows + // registry where placement information is stored. + // Summary: This member function loads saved window placement information from + // the registry. + void LoadPlacement(LPCTSTR pszSection); + + // Input: pszSection - Name of a section in the initialization file or a key in the Windows + // registry where placement information is stored. + // Summary: This member function loads saved window placement information from + // the registry. This version is the same as LoadPlacement, but there + // is no need for calling SavePlacement when the window is destroyed, + // this will be called automatically. + void AutoLoadPlacement(LPCTSTR pszSection); + +protected: + + // Input: pwnd - Points to the dialog item to be resized. + // rrcSizing - How much the left, top, right, and bottom sides will move when the + // dialog is resized. + // rcWindow - Initial size of the dialog item. + // Summary: This member function is used by the resize manager to add a dialog + // item to the list of items to be resized. + void SetResize(CWnd* pwnd,const CXTResizeRect& rrcSizing,CRect rcWindow); + + // Input: nID - Specifies the control's ID. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is called to remove the specified dialog item + // from the list of items to be resized. + BOOL RemoveResize(const UINT nID); + + // Summary: This member function is called to purge the list that contains dialog + // items to be sized. + void RemoveAllControls(); + + // Summary: This member function is called from OnInitDialog or OnInitialUpdate + // to initialize the resize manager. + void Init(); + + // Summary: This member function is called from OnSize to move and resize the dialog + // items that are managed. + void Size(); + + // Summary: This member function is called, when a property sheet in wizard mode + // has changed pages, to alert the resize manager that the property sheet + // (common control) has moved the page back to its original size/position + // on the sheet. + void Reset(); + + // Input: pMMI - Points to a MINMAXINFO structure that contains information about a + // window’s maximized size and position, and its minimum and maximum + // tracking size. For more information about this structure, see the + // MINMAXINFO structure. + // Summary: This member function is called from OnGetMinMaxInfo to get the + // maximized position or dimensions, or the minimum or maximum tracking + // size. The maximized size is the size of the window when its borders + // are fully extended. The maximum tracking size of the window is the + // largest window size that can be achieved by using the borders to size + // the window. The minimum tracking size of the window is the smallest + // window size that can be achieved by using the borders to size the window. + void GetMinMaxInfo(MINMAXINFO* pMMI); + +protected: // flags + + // Summary: Style attributes for the resizing dialog, property sheet, or form view. + enum EFlags + { + SZ_NOSIZEICON = 0x01, // Do not add size icon. + SZ_NOHORISONTAL = 0x02, // No horizontal resizing. + SZ_NOVERTICAL = 0x04, // No vertical resizing. + SZ_NOMINSIZE = 0x08, // Do not require a minimum size. + SZ_NOCLIPCHILDREN = 0x10, // Do not set clip children style. + SZ_NOTRANSPARENTGROUP = 0x20, // Do not set transparent style for group boxes. + }; + + // BULLETED LIST: + + // Input: eFlag - Flag to check. It can be one of the following: + // [ul] + // [li]SZ_NOSIZEICON Do not add size icon.[/li] + // [li]SZ_NOHORISONTAL No horizontal resizing.[/li] + // [li]SZ_NOVERTICAL No vertical resizing.[/li] + // [li]SZ_NOMINSIZE Do not require a minimum size.[/li] + // [li]SZ_NOCLIPCHILDREN Do not set clip children style.[/li] + // [li]SZ_NOTRANSPARENTGROUP Do not set transparent style + // for group boxes.[/li] + // [/ul] + // Returns: TRUE if the specified flag has been set, otherwise returns FALSE. + // Summary: This member function is called to determine if the specified flag + // has been set for the resize manager. + BOOL HasFlag(EFlags eFlag); + + // BULLETED LIST: + + // Input: eFlag - Flag to set. It can be one of the following: + // [ul] + // [li]SZ_NOSIZEICON Do not add size icon.[/li] + // [li]SZ_NOHORISONTAL No horizontal resizing.[/li] + // [li]SZ_NOVERTICAL No vertical resizing.[/li] + // [li]SZ_NOMINSIZE Do not require a minimum size.[/li] + // [li]SZ_NOCLIPCHILDREN Do not set clip children style.[/li] + // [li]SZ_NOTRANSPARENTGROUP Do not set transparent style + // for group boxes.[/li] + // [/ul] + // Summary: This member function is called to set a specific flag for the resize + // manager. + void SetFlag(EFlags eFlag); + +protected: // helper methods + + BOOL Defer(HDWP&, CXTItem*, int dx, int dy); + +protected: // helper data + + typedef CArray CXTItemArray; + + UINT m_nFlagsXX; // flags passed from constructor + CWnd* m_pwnd; // the associative relation to the window to be resized + CRect m_rcWindow; // last dialog size + CRect m_rcInitWindow; // Initial dialog size + CSize m_szMin; // smallest size allowed + CSize m_szMax; // largest size allowed + CString m_strSection; // section in registry where window placement information is saved. + CXTSizeIcon m_scSizeIcon; // size icon window + CXTItemArray m_arrItems; // array of controls + +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTResize::SetMinSize(CSize& sz) { + m_szMin = sz; +} +AFX_INLINE void CXTResize::SetMaxSize(CSize& sz) { + m_szMax = sz; +} +AFX_INLINE BOOL CXTResize::HasFlag(EFlags eFlag) { + return (m_nFlagsXX & eFlag) != 0; +} +AFX_INLINE void CXTResize::SetResize(const UINT nID, const HWND hWnd, const XT_RESIZEPOINT& rpTopLeft, const XT_RESIZEPOINT& rpBottomRight) { + SetResize(nID, hWnd, CXTResizeRect(rpTopLeft.x, rpTopLeft.y, rpBottomRight.x, rpBottomRight.y)); +} +AFX_INLINE void CXTResize::SetResize(const UINT nID, const XT_RESIZERECT& rrcSizing) { + SetResize(nID,NULL,rrcSizing); +} +AFX_INLINE void CXTResize::SetResize(const UINT nID, const XT_RESIZEPOINT& rpTopLeft, const XT_RESIZEPOINT& rpBottomRight) { + SetResize(nID, CXTResizeRect(rpTopLeft.x, rpTopLeft.y, rpBottomRight.x, rpBottomRight.y)); +} +AFX_INLINE void CXTResize::SetResize(const UINT nID, XT_RESIZE left, XT_RESIZE top, XT_RESIZE right, XT_RESIZE bottom) { + SetResize(nID, CXTResizeRect(left, top, right, bottom)); +} + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTRESIZE_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTResizeDialog.h b/Editor/XT/Include/XTResizeDialog.h new file mode 100644 index 0000000..f3c46cb --- /dev/null +++ b/Editor/XT/Include/XTResizeDialog.h @@ -0,0 +1,73 @@ +// XTResizeDialog.h: interface for the CXTResizeDialog class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +//-------------------------------------------------------------------- +// Based on the resizable classes created by Torben B. Haagh. Used by permission. +// http://www.codeguru.com/dialog/torbenResizeDialog.shtml +//-------------------------------------------------------------------- +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTRESIZEDIALOG_H__) +#define __XTRESIZEDIALOG_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTResizeDialog is a multiple inheritance class derived from CDialog +// and CXTResize. CXTResizeDialog is used to create a resizable CDialog +// type object that allows its dialog items to be resized or moved dynamically. +class _XT_EXT_CLASS CXTResizeDialog : public CDialog, public CXTResize +{ + DECLARE_DYNCREATE(CXTResizeDialog); + +public: + + // Summary: Constructs a CXTResizeDialog object. + CXTResizeDialog(); + + // Input: nID - Contains the ID number of a dialog box template resource. + // pParent - Points to the parent or owner window object, of type CWnd, to which + // the dialog object belongs. If it is NULL, the dialog object’s parent + // window is set to the main application window. + // nFlags - Flags that are to be passed to CXTResize that specify the attributes + // of the resizing property page. They can be one or more of the following, + // and can be combined using the or (|) operator: + // [ul] + // [li]SZ_NOSIZEICON Do not add size icon.[/li] + // [li]SZ_NOHORISONTAL No horizontal resizing.[/li] + // [li]SZ_NOVERTICAL No vertical resizing.[/li] + // [li]SZ_NOMINSIZE Do not require a minimum size.[/li] + // [li]SZ_NOCLIPCHILDREN Do not set clip children style.[/li] + // [li]SZ_NOTRANSPARENTGROUP Do not set transparent style + // for group boxes.[/li] + // [/ul] + // Summary: Constructs a CXTResizeDialog object. + CXTResizeDialog(const UINT nID,CWnd* pParent = 0,const UINT nFlags = 0); + +protected: + + UINT m_nDialogID; // Contains the ID number of a dialog box template resource. + + // Ignore: + //{{AFX_MSG(CXTResizeDialog) + virtual BOOL OnInitDialog(); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI); + afx_msg void OnDestroy(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTRESIZEDIALOG_H__) diff --git a/Editor/XT/Include/XTResizeFormView.h b/Editor/XT/Include/XTResizeFormView.h new file mode 100644 index 0000000..09f0972 --- /dev/null +++ b/Editor/XT/Include/XTResizeFormView.h @@ -0,0 +1,71 @@ +// XTResizeFormView.h: interface for the CXTResizeFormView class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +//-------------------------------------------------------------------- +// Based on the resizable classes created by Torben B. Haagh. Used by permission. +// http://www.codeguru.com/dialog/torbenResizeDialog.shtml +//-------------------------------------------------------------------- +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTRESIZEFORMVIEW_H__) +#define __XTRESIZEFORMVIEW_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTResizeFormView is a multiple inheritance class derived from CFormView +// and CXTResize. CXTResizeFormView is used to create a resizable CFormView +// type object that allows its form items to be resized or moved dynamically. +class _XT_EXT_CLASS CXTResizeFormView : public CFormView, public CXTResize +{ + DECLARE_DYNCREATE(CXTResizeFormView) + +public: + + // Input: nID - Contains the ID number of a dialog template resource. + // nFlags - Flags that are to be passed to CXTResize that specify the attributes + // of the resizing property page. They can be one or more of the following, + // and can be combined using the or (|) operator: + // [ul] + // [li]SZ_NOSIZEICON Do not add size icon.[/li] + // [li]SZ_NOHORISONTAL No horizontal resizing.[/li] + // [li]SZ_NOVERTICAL No vertical resizing.[/li] + // [li]SZ_NOMINSIZE Do not require a minimum size.[/li] + // [li]SZ_NOCLIPCHILDREN Do not set clip children style.[/li] + // [li]SZ_NOTRANSPARENTGROUP Do not set transparent style + // for group boxes.[/li] + // [/ul] + // Summary: Constructs a CXTResizeFormView object. + CXTResizeFormView(const UINT nID = 0,const UINT nFlags = 0); + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTResizeFormView) + protected: + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + virtual BOOL OnInitDialog(); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTResizeFormView) + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI); + afx_msg void OnDestroy(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTRESIZEFORMVIEW_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTResizePoint.h b/Editor/XT/Include/XTResizePoint.h new file mode 100644 index 0000000..265bfe7 --- /dev/null +++ b/Editor/XT/Include/XTResizePoint.h @@ -0,0 +1,67 @@ +// XTResizePoint.h: interface for the CXTResizePoint class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +//-------------------------------------------------------------------- +// Based on the resizable classes created by Torben B. Haagh. Used by permission. +// http://www.codeguru.com/dialog/torbenResizeDialog.shtml +//-------------------------------------------------------------------- +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTRESIZEPOINT_H__) +#define __XTRESIZEPOINT_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: XT_RESIZEPOINT structure is a stand alone structure class. It defines +// the x- and y-coordinates of a point. +struct XT_RESIZEPOINT +{ + XT_RESIZE x; // Specifies the x-coordinate of a point. + XT_RESIZE y; // Specifies the y-coordinate of a point. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTResizePoint is an XT_RESIZEPOINT structure derived class. The +// CXTResizePoint class is similar to the XT_RESIZEPOINT structure. +// It also includes member functions to manipulate CXTResizePoint and +// XT_RESIZEPOINT structures. A CXTResizePoint object can be used wherever +// an XT_RESIZEPOINT structure is used. +class _XT_EXT_CLASS CXTResizePoint : public XT_RESIZEPOINT +{ +public: + + // Summary: Constructs a CXTResizePoint object. + CXTResizePoint(); + + // Input: cx - Specifies the x-coordinate of a point. + // cy - Specifies the y-coordinate of a point. + // Summary: Constructs a CXTResizePoint object. + CXTResizePoint(XT_RESIZE cx,XT_RESIZE cy); +}; +//:Associate with "CXTResize" + +///////////////////////////////////////////////////////////////////////////// + +#define SZ_TOP_LEFT CXTResizePoint( 0, 0) // Specifies a top left position. +#define SZ_TOP_CENTER CXTResizePoint(.5, 0) // Specifies a top center position. +#define SZ_TOP_RIGHT CXTResizePoint( 1, 0) // Specifies a top right position. +#define SZ_MIDDLE_LEFT CXTResizePoint( 0,.5) // Specifies a middle left position. +#define SZ_MIDDLE_CENTER CXTResizePoint(.5,.5) // Specifies a middle center position. +#define SZ_MIDDLE_RIGHT CXTResizePoint( 1,.5) // Specifies a middle right position. +#define SZ_BOTTOM_LEFT CXTResizePoint( 0, 1) // Specifies a bottom left position. +#define SZ_BOTTOM_CENTER CXTResizePoint(.5, 1) // Specifies a bottom center position. +#define SZ_BOTTOM_RIGHT CXTResizePoint( 1, 1) // Specifies a bottom right position. + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTRESIZEPOINT_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTResizePropertyPage.h b/Editor/XT/Include/XTResizePropertyPage.h new file mode 100644 index 0000000..1e78890 --- /dev/null +++ b/Editor/XT/Include/XTResizePropertyPage.h @@ -0,0 +1,69 @@ +// XTResizePropertyPage.h: interface for the CXTResizePropertyPage class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +//-------------------------------------------------------------------- +// Based on the resizable classes created by Torben B. Haagh. Used by permission. +// http://www.codeguru.com/dialog/torbenResizeDialog.shtml +//-------------------------------------------------------------------- +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTRESIZEPROPERTYPAGE_H__) +#define __XTRESIZEPROPERTYPAGE_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTResizePropertyPage is a multiple inheritance class derived from +// CPropertyPage and CXTResize. CXTResizePropertyPage is used to create +// a resizable CPropertyPage type object that allows its dialog items to +// be resized or moved dynamically. +class _XT_EXT_CLASS CXTResizePropertyPage : public CPropertyPage, public CXTResize +{ + DECLARE_DYNCREATE(CXTResizePropertyPage) + +public: + + // Input: nTemplate - ID of the template used for this page. + // nCaption - ID of the name to be placed in the tab for this page. If 0, the name + // will be taken from the dialog template for this page. + // nFlags - Flags that are to be passed to CXTResize that specify the attributes + // of the resizing property page. They can be one or more of the following, + // and can be combined using the or (|) operator: + // [ul] + // [li]SZ_NOSIZEICON Do not add size icon.[/li] + // [li]SZ_NOHORISONTAL No horizontal resizing.[/li] + // [li]SZ_NOVERTICAL No vertical resizing.[/li] + // [li]SZ_NOMINSIZE Do not require a minimum size.[/li] + // [li]SZ_NOCLIPCHILDREN Do not set clip children style.[/li] + // [li]SZ_NOTRANSPARENTGROUP Do not set transparent style + // for group boxes.[/li] + // [/ul] + // Summary: Constructs a CXTResizePropertyPage object. + CXTResizePropertyPage(const UINT nTemplate = 0,const UINT nCaption = 0,const UINT nFlags = 0); + + DWORD m_nDialogID; // ID of the template used for this page. + +protected: + + // Ignore: + //{{AFX_MSG(CXTResizePropertyPage) + virtual BOOL OnInitDialog(); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI); + afx_msg void OnDestroy(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTRESIZEPROPERTYPAGE_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTResizePropertySheet.h b/Editor/XT/Include/XTResizePropertySheet.h new file mode 100644 index 0000000..f57a64a --- /dev/null +++ b/Editor/XT/Include/XTResizePropertySheet.h @@ -0,0 +1,110 @@ +// XTResizePropertySheet.h: interface for the CXTResizePropertySheet class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +//-------------------------------------------------------------------- +// Based on the resizable classes created by Torben B. Haagh. Used by permission. +// http://www.codeguru.com/dialog/torbenResizeDialog.shtml +//-------------------------------------------------------------------- +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTRESIZEPROPERTYSHEET_H__) +#define __XTRESIZEPROPERTYSHEET_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTResizePropertySheet is a multiple inheritance class derived from +// CPropertySheet and CXTResize. CXTResizePropertySheet is used to create +// a resizable CPropertySheet type object that allows its dialog items +// to be resized or moved dynamically. +class _XT_EXT_CLASS CXTResizePropertySheet : public CPropertySheet, public CXTResize +{ + DECLARE_DYNCREATE(CXTResizePropertySheet); + +public: + + // BULLETED LIST: + + // Input: nCaption - ID of the caption to be used for the property sheet. + // pParent - Points to the parent window of the property sheet. If NULL, the parent + // window will be the main window of the application. + // nSelectPage - The index of the page that will initially be on top. Default is the + // first page added to the sheet. + // nFlags - Flags that are to be passed to CXTResize that specify the attributes + // of the resizing property page. They can be one or more of the following, + // and can be combined using the or (|) operator: + // [ul] + // [li]SZ_NOSIZEICON Do not add size icon.[/li] + // [li]SZ_NOHORISONTAL No horizontal resizing.[/li] + // [li]SZ_NOVERTICAL No vertical resizing.[/li] + // [li]SZ_NOMINSIZE Do not require a minimum size.[/li] + // [li]SZ_NOCLIPCHILDREN Do not set clip children style.[/li] + // [li]SZ_NOTRANSPARENTGROUP Do not set transparent style + // for group boxes.[/li] + // [/ul] + // Summary: Constructs a CXTResizePropertySheet object. + CXTResizePropertySheet(const UINT nCaption = 0,CWnd* pParent = 0,const UINT nSelectPage = 0,const UINT nFlags = 0); + + // BULLETED LIST: + + // Input: pszCaption - Points to a string containing the caption to be used for the property + // sheet. It cannot be NULL. + // pParent - Points to the parent window of the property sheet. If NULL, the parent + // window will be the main window of the application. + // nSelectPage - The index of the page that will initially be on top. The default is the + // first page added to the sheet. + // nFlags - Flags that are to be passed to CXTResize that specify the attributes + // of the resizing property page. They can be one or more of the following, + // and can be combined using the or (|) operator: + // [ul] + // [li]SZ_NOSIZEICON Do not add size icon.[/li] + // [li]SZ_NOHORISONTAL No horizontal resizing.[/li] + // [li]SZ_NOVERTICAL No vertical resizing.[/li] + // [li]SZ_NOMINSIZE Do not require a minimum size.[/li] + // [li]SZ_NOCLIPCHILDREN Do not set clip children style.[/li] + // [li]SZ_NOTRANSPARENTGROUP Do not set transparent style + // for group boxes.[/li] + // [/ul] + // Summary: Constructs a CXTResizePropertySheet object. + CXTResizePropertySheet(LPCTSTR pszCaption,CWnd* pParent = 0,const UINT nSelectPage = 0,const UINT nFlags = 0); + + CXTNoFlickerWnd m_tabCtrl; + +protected: + + // Returns: TRUE if the property sheet is a wizard, otherwise returns FALSE. + // Summary: This member function determines if the property sheet is in wizard mode. + BOOL IsWizard(); + + // Ignore: + //{{AFX_MSG(CXTResizePropertySheet) + virtual BOOL OnInitDialog(); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI); + afx_msg void OnDestroy(); + //}}AFX_MSG + + afx_msg BOOL OnPageChanging(NMHDR* pNotifyStruct, LRESULT* pResult); + DECLARE_MESSAGE_MAP() + + friend CXTResizePropertyPage; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE BOOL CXTResizePropertySheet::IsWizard() { + return (m_psh.dwFlags & PSH_WIZARD); +} + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTRESIZEPROPERTYSHEET_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTResizeRect.h b/Editor/XT/Include/XTResizeRect.h new file mode 100644 index 0000000..c93fd07 --- /dev/null +++ b/Editor/XT/Include/XTResizeRect.h @@ -0,0 +1,172 @@ +// XTResizeRect.h: interface for the CXTResizeRect class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +//-------------------------------------------------------------------- +// Based on the resizable classes created by Torben B. Haagh. Used by permission. +// http://www.codeguru.com/dialog/torbenResizeDialog.shtml +//-------------------------------------------------------------------- +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTRESIZERECT_H__) +#define __XTRESIZERECT_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: Float data type used by resizing windows. +typedef float XT_RESIZE; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_RESIZERECT structure is a stand alone structure class. It defines +// the coordinates of the upper-left and lower-right corners of a rectangle. +struct XT_RESIZERECT +{ + XT_RESIZE left; // Specifies the x-coordinate of the upper-left corner of a rectangle. + XT_RESIZE top; // Specifies the y-coordinate of the upper-left corner of a rectangle. + XT_RESIZE right; // Specifies the x-coordinate of the lower-right corner of a rectangle. + XT_RESIZE bottom; // Specifies the y-coordinate of the lower-right corner of a rectangle. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTResizeRect is an XT_RESIZERECT structure derived class. The +// CXTResizeRect class is similar to an XT_RESIZERECT structure. CXTResizeRect +// also includes member functions to manipulate CXTResizeRect objects and +// XT_RESIZERECT structures. +class _XT_EXT_CLASS CXTResizeRect: public XT_RESIZERECT +{ +public: + + // Summary: Constructs a CXTResizeRect object. + CXTResizeRect(); + + // Input: rc - Refers to the RECT structure with the coordinates for CXTResizeRect. + // Summary: Constructs a CXTResizeRect object. + CXTResizeRect(const RECT& rc); + + // Input: rrc - Refers to the XT_RESIZERECT structure with the coordinates for + // CXTResizeRect. + // Summary: Constructs a CXTResizeRect object. + CXTResizeRect(const XT_RESIZERECT& rrc); + + // Input: l - Specifies the left position of CXTResizeRect. + // t - Specifies the top of CXTResizeRect. + // r - Specifies the right position of CXTResizeRect. + // b - Specifies the bottom of CXTResizeRect. + // Summary: Constructs a CXTResizeRect object. + CXTResizeRect(XT_RESIZE l,XT_RESIZE t,XT_RESIZE r,XT_RESIZE b); + + // Input: rc - Refers to a source rectangle. It can be a RECT or CRect. + // Returns: A reference to a CXTResizeRect object. + // Summary: This operator copies the dimensions of a rectangle to CXTResizeRect. + CXTResizeRect& operator = (const RECT& rc); + + // Input: rrc - Refers to a source rectangle. It can be a XT_RESIZERECT or CXTResizeRect. + // Returns: A reference to a CXTResizeRect object. + // Summary: This operator copies the dimensions of a rectangle to CXTResizeRect. + CXTResizeRect& operator = (const XT_RESIZERECT& rrc); + + // Input: rrc - Points to an XT_RESIZERECT structure or a CXTResizeRect object that + // contains the number of units to inflate each side of CXTResizeRect. + // Returns: A reference to a CXTResizeRect object. + // Summary: This operator adds the specified offsets to CXTResizeRect or inflates + // CXTResizeRect. + CXTResizeRect& operator += (const XT_RESIZERECT& rrc); + + // Input: rrc - Points to an XT_RESIZERECT structure or a CXTResizeRect object that + // contains the number of units to inflate each side of the return value. + // Returns: The resulting CXTResizeRect object. + // Summary: This operator adds the given offsets to CRect or inflates CRect. + CXTResizeRect operator + (const XT_RESIZERECT& rrc); + + // Input: rrc - Contains an XT_RESIZERECT or a CXTResizeRect. + // Returns: A CXTResizeRect that is the intersection of CXTResizeRect and 'rrc'. The + // intersection is the largest rectangle that is contained in both rectangles. + // Summary: This operator creates the intersection of CXTResizeRect and a rectangle, + // and returns the resulting CXTResizeRect. + CXTResizeRect operator & (const XT_RESIZERECT& rrc); + + // Input: rrc - Refers to a source rectangle. It can be an XT_RESIZERECT or a CXTResizeRect. + // Returns: true if equal, otherwise returns false. + // Summary: This operator determines whether CXTResizeRect is equal to a rectangle. + bool operator == (const XT_RESIZERECT& rrc); + + // Input: rrc - Refers to a source rectangle. It can be an XT_RESIZERECT or a CXTResizeRect. + // Returns: false if equal, otherwise returns true. + // Summary: This operator determines whether CXTResizeRect is not equal to a rectangle. + bool operator != (const XT_RESIZERECT& rrc); + + // Summary: This operator converts a CXTResizeRect to a CRect. When you use this + // function, you do not need the address-of (&) operator. This operator + // will be automatically used when you pass a CXTResizeRect object to + // a function that expects a CRect. + operator CRect(); + + // Returns: true if normalized, otherwise returns false. + // Summary: This member function determines if CXTResizeRect is normalized. + bool IsNormalized(); + + // Returns: The width of a CXTResizeRect. + // Summary: This member function calculates the width of a CXTResizeRect by subtracting + // the left value from the right value. The resulting value can be negative. + XT_RESIZE Width(); + + // Returns: The height of a CXTResizeRect. + // Summary: This member function calculates the height of a CXTResizeRect by subtracting + // the top value from the bottom value. The resulting value can be negative. + XT_RESIZE Height(); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTResizeRect::CXTResizeRect(const RECT& rc) { + (operator =)(rc); +} +AFX_INLINE CXTResizeRect::CXTResizeRect(const XT_RESIZERECT& rrc) { + (operator =)(rrc); +} +AFX_INLINE CXTResizeRect CXTResizeRect::operator + (const XT_RESIZERECT& rrc) { + return CXTResizeRect(left + rrc.left, top + rrc.top, right + rrc.right, bottom += rrc.bottom); +} +AFX_INLINE bool CXTResizeRect::IsNormalized() { + return ((left <= right) && (top <= bottom)); +} +AFX_INLINE bool CXTResizeRect::operator == (const XT_RESIZERECT& rrc) { + return left==rrc.left && top==rrc.top && right==rrc.right && bottom==rrc.bottom; +} +AFX_INLINE bool CXTResizeRect::operator != (const XT_RESIZERECT& rrc) { + return !operator==(rrc); +} +AFX_INLINE CXTResizeRect::operator CRect() { + return CRect((int) left, (int) top, (int) right, (int) bottom); +} +AFX_INLINE XT_RESIZE CXTResizeRect::Width() { + return right-left; +} +AFX_INLINE XT_RESIZE CXTResizeRect::Height() { + return bottom-top; +} + +////////////////////////////////////////////////////////////////////// + +//:Associate with "CXTResizeRect" + +////////////////////////////////////////////////////////////////////// +#define SZ_RESIZE(x) CXTResizeRect(0,0,x,x) // Resize. +#define SZ_REPOS(x) CXTResizeRect(x,x,x,x) // Reposition. +#define SZ_HORRESIZE(x) CXTResizeRect(0,0,x,0) // Horizontal resize. +#define SZ_HORREPOS(x) CXTResizeRect(x,0,x,0) // Horizontal reposition. +#define SZ_VERRESIZE(x) CXTResizeRect(0,0,0,x) // Vertical resize. +#define SZ_VERREPOS(x) CXTResizeRect(0,x,0,x) // Vertical reposition. + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTRESIZERECT_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTResource.h b/Editor/XT/Include/XTResource.h new file mode 100644 index 0000000..d12cf37 --- /dev/null +++ b/Editor/XT/Include/XTResource.h @@ -0,0 +1,295 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by XTResource.rc + +#define XT_IDB_BTN_BAR 4500 +#define XT_IDB_SCROLL_ARW 4501 +#define XT_IDB_FONTTYPE 4502 +#define XT_IDB_BTN_OUT 4503 +#define XT_IDB_LIGHTBULB 4504 +#define XT_IDB_LISTEDIT 4505 +#define XT_IDB_BTN_PRINT 4506 +#define XT_IDB_CHECKLISTBOX 4507 +#define XT_IDI_XTREME 4508 +#define XT_IDC_DRAGCOPY 4509 +#define XT_IDC_DRAGMOVE 4510 +#define XT_IDC_HAND 4511 +#define XT_IDC_HSPLITBAR 4512 +#define XT_IDC_DRAGNONE 4513 +#define XT_IDC_VSPLITBAR 4514 +#define XT_IDC_HANDNONE 4515 +#define XT_IDD_WINDOWLIST 4516 +#define XT_IDD_CUSTPAGE4 4517 +#define XT_IDD_CUSTPAGE5 4518 +#define XT_IDM_POPUP 4519 +#define XT_IDR_TBAR_HDR 4520 +#define XT_IDR_TBAR_OUT 4521 +#define XT_IDR_TBAR_BLANK 4523 +#define XT_IDR_TBAR_HEXEDIT 4524 +#define XT_IDD_PREVIEW_TOOLBAR 4525 +#define XT_IDD_TIPOFTHEDAY 4526 +#define XT_IDD_CUSTPAGE1 4527 +#define XT_IDD_CUSTPAGE2 4528 +#define XT_IDD_CUSTPAGE3 4529 +#define XT_IDD_NEWTOOLBAR 4530 +#define XT_IDD_COLORSTANDARD 4531 +#define XT_IDD_COLORCUSTOM 4532 +#define XT_IDS_REG_KEY 4533 +#define XT_IDS_REG_WINPOS 4534 +#define XT_IDS_REG_BARID 4535 +#define XT_IDS_REG_SETTINGS 4536 +#define XT_IDS_REG_BARPOS 4537 +#define XT_IDS_REG_WNDPOS 4538 +#define XT_IDS_REG_RECENTLIST 4539 +#define XT_IDS_REG_ITEMID 4540 +#define XT_IDS_REG_CBARID 4541 +#define XT_IDS_REG_COLINFO 4542 +#define XT_IDS_NAME 4543 +#define XT_IDS_SIZE 4544 +#define XT_IDS_CONTRACT 4545 +#define XT_IDS_TYPE 4546 +#define XT_IDS_MODIFIED 4547 +#define XT_IDS_INVALID_VER 4548 +#define XT_IDS_COLOR_AUTO 4549 +#define XT_IDS_COLOR_CUST 4550 +#define XT_IDS_ENTRY 4552 +#define XT_IDS_SELDIR 4555 +#define XT_IDS_DOCKWND 4556 +#define XT_IDS_RES_ASSERT 4557 +#define XT_IDS_TOOLBAR 4558 +#define XT_IDS_ERROR_BLANK 4559 +#define XT_IDS_STATUSBAR 4560 +#define XT_IDS_ERROR_EXISTS 4561 +#define XT_IDS_ERROR_LIMIT 4562 +#define XT_IDS_CUSTOM_BAR 4563 +#define XT_IDS_CUSTOM_CONFIRM 4564 +#define XT_IDS_DOT 4565 +#define XT_IDS_NOHELPTOPIC 4566 +#define XT_IDS_DEFEXT 4567 +#define XT_IDS_DEFFILT 4568 +#define XT_IDS_DEFTITLE 4569 +#define XT_IDS_CLICKKEEPOPEN 4570 +#define XT_IDS_SE_0 4571 +#define XT_IDS_SE_ERR_FNF 4572 +#define XT_IDS_SE_ERR_PNF 4573 +#define XT_IDS_SE_ERR_ACCESSDENIED 4574 +#define XT_IDS_SE_ERR_OOM 4575 +#define XT_IDS_SE_ERR_BAD_FORMAT 4576 +#define XT_IDS_SE_ERR_SHARE 4577 +#define XT_IDS_SE_ERR_ASSOCINCOMPLETE 4578 +#define XT_IDS_SE_ERR_DDETIMEOUT 4579 +#define XT_IDS_SE_ERR_DDEFAIL 4580 +#define XT_IDS_SE_ERR_DDEBUSY 4581 +#define XT_IDS_SE_ERR_NOASSOC 4582 +#define XT_IDS_SE_ERR_DLLNOTFOUND 4583 +#define XT_IDS_SE_ERR_UNKOWN 4584 +#define XT_IDS_CLOSE 4585 +#define XT_IDS_CLR_BLACK 4586 +#define XT_IDS_CLR_BROWN 4587 +#define XT_IDS_CLR_OLIVE_GREEN 4588 +#define XT_IDS_CLR_DARK_GREEN 4589 +#define XT_IDS_CLR_DARK_TEAL 4590 +#define XT_IDS_CLR_DARK_BLUE 4591 +#define XT_IDS_CLR_INDIGO 4592 +#define XT_IDS_CLR_GRAY80 4593 +#define XT_IDS_CLR_DARK_RED 4594 +#define XT_IDS_CLR_ORANGE 4595 +#define XT_IDS_CLR_DARK_YELLOW 4596 +#define XT_IDS_CLR_GREEN 4597 +#define XT_IDS_CLR_TEAL 4598 +#define XT_IDS_CLR_BLUE 4599 +#define XT_IDS_CLR_BLUEGRAY 4600 +#define XT_IDS_CLR_GRAY50 4601 +#define XT_IDS_CLR_RED 4602 +#define XT_IDS_CLR_LIGHTORANGE 4603 +#define XT_IDS_CLR_LIME 4604 +#define XT_IDS_CLR_SEA_GREEN 4605 +#define XT_IDS_CLR_AQUA 4606 +#define XT_IDS_CLR_LIGHT_BLUE 4607 +#define XT_IDS_CLR_VIOLET 4608 +#define XT_IDS_CLR_GRAY40 4609 +#define XT_IDS_CLR_PINK 4610 +#define XT_IDS_CLR_GOLD 4611 +#define XT_IDS_CLR_YELLOW 4612 +#define XT_IDS_CLR_BRIGHT_GREEN 4613 +#define XT_IDS_CLR_TURQUOISE 4614 +#define XT_IDS_CLR_SKY_BLUE 4615 +#define XT_IDS_CLR_PLUM 4616 +#define XT_IDS_CLR_GRAY25 4617 +#define XT_IDS_CLR_ROSE 4618 +#define XT_IDS_CLR_TAN 4619 +#define XT_IDS_CLR_LIGHT_YELLOW 4620 +#define XT_IDS_CLR_LIGHT_GREEN 4621 +#define XT_IDS_CLR_LIGHT_TURQUOISE 4622 +#define XT_IDS_CLR_PALE_BLUE 4623 +#define XT_IDS_CLR_LAVENDER 4624 +#define XT_IDS_CLR_WHITE 4625 +#define XT_IDS_CLR_GRAY 4626 +#define XT_IDS_CLR_MAROON 4627 +#define XT_IDS_CLR_OLIVE 4628 +#define XT_IDS_CLR_NAVY 4629 +#define XT_IDS_CLR_PURPLE 4630 +#define XT_IDS_CLR_SILVER 4631 +#define XT_IDS_CLR_FUCHSIA 4632 +#define XT_IDS_CLR_NOFILL 4633 +#define XT_IDS_CLR_NOFILL_TIP 4634 +#define XT_IDS_AUTOMATIC 4635 +#define XT_IDS_AUTOMATIC_TIP 4636 +#define XT_IDS_MORE_COLORS 4637 +#define XT_IDS_MORE_COLORS_TIP 4638 +#define XT_IDS_STD_COLORS 4639 +#define XT_IDS_TIPTEXT 4640 +#define XT_IDS_DIDYOUKNOW 4641 +#define XT_IDS_FILE_ABSENT 4642 +#define XT_IDS_FILE_CORRUPT 4643 +#define XT_IDS_MENUBAR 4644 +#define XT_IDS_CONTROLBAR 4645 +#define XT_IDS_CUSTOMIZE 4646 +#define XT_IDS_COLOR_CAPTION 4647 +#define XT_IDS_NEW 4648 +#define XT_IDS_CURRENT 4649 +#define XT_IDS_DIRECTORIES 4650 +#define XT_IDS_FILES 4651 +#define XT_IDS_RESTORE 4652 +#define XT_IDS_WINDOWS 4653 +#define XT_IDS_MANAGEKEYBRD 4654 +#define XT_IDS_COMMAND 4655 +#define XT_IDS_KEYS 4656 +#define XT_IDB_BTN_FRAME 4656 +#define XT_IDS_DESCRIPTION 4657 +#define XT_IDS_ALLCOMMANDS 4658 +#define XT_IDS_REASSIGN 4659 +#define XT_IDS_WIND_MINIMIZE 4660 +#define XT_IDS_WIND_RESTORE 4661 +#define XT_IDS_WIND_CLOSE 4662 +#define XT_IDS_TOOLBAR_OPTS 4663 +#define XT_IDC_LBOX_TOOLSLIST 4664 +#define XT_IDS_TOOLS 4664 +#define XT_IDC_EDIT_TOOLSCMD 4665 +#define XT_IDS_PATH_INVALID 4665 +#define XT_IDC_EDIT_TOOLSARG 4666 +#define XT_IDS_AREYOUSURE 4666 +#define XT_IDC_EDIT_TOOLSDIR 4667 +#define XT_IDS_AREYOUSURE_2 4667 +#define XT_IDC_TXT_TOOLSCMD 4668 +#define XT_IDS_BROWSE 4668 +#define XT_IDC_TXT_TOOLSARG 4669 +#define XT_IDS_BROWSE_FILTER 4669 +#define XT_IDC_TXT_TOOLSDIR 4670 +#define XT_IDS_MENU_CONTENTS 4670 +#define XT_IDB_CHECKLISTBOX_3D 4672 +#define XT_IDS_ANIM_SYSDEF 4672 +#define XT_IDS_ANIM_RANDOM 4673 +#define XT_IDS_ANIM_UNFOLD 4674 +#define XT_IDS_ANIM_SLIDE 4675 +#define XT_IDS_ANIM_FADE 4676 +#define XT_IDR_PREVIEW_TOOLBAR 4677 +#define XT_IDC_GROUP_EDIT 5501 +#define XT_IDC_EDIT_TOOLBAR 5502 +#define XT_IDC_LBOX_EDIT 5503 +#define XT_IDC_LBOX_CHECK 5504 +#define XT_IDC_LBOX_CATEGORIES 5505 +#define XT_IDC_LBOX_COMMANDS 5506 +#define XT_IDC_TXT_TOOLBARS 5507 +#define XT_IDC_TXT_CATEGORIES 5508 +#define XT_IDC_TXT_COMMANDS 5509 +#define XT_IDC_TXT_SELECTED 5510 +#define XT_IDC_BTN_CLOSE 5511 +#define XT_IDC_BTN_EXPAND 5512 +#define XT_IDC_BTN_LEFT 5513 +#define XT_IDC_BTN_RIGHT 5514 +#define XT_IDC_BTN_HOME 5515 +#define XT_IDC_BTN_END 5516 +#define XT_IDC_BTN_NEW 5517 +#define XT_IDC_BTN_DELETE 5518 +#define XT_IDC_BTN_UP 5519 +#define XT_IDC_BTN_DOWN 5520 +#define XT_IDC_BTN_BROWSE 5521 +#define XT_IDC_BTN_DAYTIP_BORDER 5522 +#define XT_IDC_CHK_DAYTIP_SHOW 5523 +#define XT_IDC_BTN_DAYTIP_NEXT 5524 +#define XT_IDC_BTN_RENAME 5525 +#define XT_IDC_BTN_RESET 5526 +#define XT_IDC_BTN_DESCRIPTION 5527 +#define XT_IDC_CHK_STANDARD 5528 +#define XT_IDC_CHK_MENUSHADOWS 5528 +#define XT_IDC_CHK_RECENTMENU 5529 +#define XT_IDC_CHK_SHOWFULL 5530 +#define XT_IDC_EDIT_RED 5531 +#define XT_IDC_CHK_SCREENTIPS 5531 +#define XT_IDC_TXT_COLORS 5532 +#define XT_IDC_CHK_SHOWSHORTCUTKEYS 5532 +#define XT_IDC_EDIT_GREEN 5533 +#define XT_IDC_SPIN_HUE 5534 +#define XT_IDC_EDIT_LUM 5535 +#define XT_IDC_EDIT_SAT 5536 +#define XT_IDC_EDIT_HUE 5537 +#define XT_IDC_SPIN_SAT 5538 +#define XT_IDC_SPIN_LUM 5539 +#define XT_IDC_EDIT_BLUE 5540 +#define XT_IDC_SPIN_RED 5541 +#define XT_IDC_SPIN_GREEN 5542 +#define XT_IDC_SPIN_BLUE 5543 +#define XT_IDC_TXT_HUE 5544 +#define XT_IDC_TXT_SAT 5545 +#define XT_IDC_TXT_LUM 5546 +#define XT_IDC_TXT_RED 5547 +#define XT_IDC_TXT_GREEN 5548 +#define XT_IDC_TXT_BLUE 5549 +#define XT_IDC_CLR_WND 5550 +#define XT_IDC_CLR_LUM 5551 +#define XT_IDC_CLR_HEX 5552 +#define XT_IDC_LBOX_WINDOWS 5553 +#define XT_IDC_BTN_CASCADE 5554 +#define XT_IDC_BTN_MINIMIZE 5555 +#define XT_IDC_BTN_CLOSEWINDOWS 5556 +#define XT_IDC_BTN_SAVE 5557 +#define XT_IDC_BTN_TILEHORZ 5558 +#define XT_IDC_BTN_TILEVERT 5559 +#define XT_IDC_BTN_ACTIVATE 5560 +#define XT_IDC_LBOX_ACCEL_COMMANDS 5561 +#define XT_IDC_LBOX_KEYS 5562 +#define XT_IDC_EDIT_SHORTCUTKEY 5564 +#define XT_IDC_COMBO_CATEGORY 5565 +#define XT_IDC_BTN_ASSIGN 5566 +#define XT_IDC_BTN_ACCEL_RESET 5567 +#define XT_IDC_BTN_REMOVE 5568 +#define XT_IDC_TXT_NEWKEY 5570 +#define XT_IDC_TXT_ASSIGNMENTS 5571 +#define XT_IDC_TXT_FRAMETITLE 5572 +#define XT_IDC_TXT_DESC_OVERVIEW 5573 +#define XT_IDC_TXT_DESC_TITLE 5574 +#define XT_IDC_CHK_VISUALIZE 5575 +#define XT_IDC_TXT_PERSONALIZED 5576 +#define XT_IDC_TXT_OTHER 5577 +#define XT_IDC_SEP_PERSONALIZED 5578 +#define XT_IDC_SEP_OTHER 5579 +#define XT_IDC_COMBO_ANIMATION 5582 +#define XT_IDC_SORTASC 53773 +#define XT_IDC_SORTDSC 53774 +#define XT_IDC_ALIGNLEFT 53775 +#define XT_IDC_ALIGNCENTER 53776 +#define XT_IDC_ALIGNRIGHT 53777 +#define XT_IDC_LARGEICON 53778 +#define XT_IDC_SMALLICON 53779 +#define XT_IDC_REMOVEITEM 53780 +#define XT_IDC_RENAMEITEM 53781 +#define XT_IDC_CUSTOMIZE 53782 +#define XT_IDC_CHEVRON 53783 +#define XT_IDC_REMOVEGROUP 53784 +#define XT_IDC_RENAMEGROUP 53785 +#define XT_IDC_BLANK 53786 +#define XT_IDC_SORT_CATEGORIZED 53787 +#define XT_IDC_SORT_ALPHABETIC 53788 +#define XT_IDC_TAB_CLOSE 53789 + +// Next default values for new objects + +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 4673 +#define _APS_NEXT_COMMAND_VALUE 52790 +#define _APS_NEXT_CONTROL_VALUE 5583 +#define _APS_NEXT_SYMED_VALUE 4652 +#endif +#endif diff --git a/Editor/XT/Include/XTResource.rc b/Editor/XT/Include/XTResource.rc new file mode 100644 index 0000000..13afbb8 --- /dev/null +++ b/Editor/XT/Include/XTResource.rc @@ -0,0 +1,783 @@ +//Microsoft Developer Studio generated resource script. +// +#include "XTResource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Neutral resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Cursor +// + +XT_IDC_DRAGMOVE CURSOR DISCARDABLE "res\\dragmove.cur" +XT_IDC_HAND CURSOR DISCARDABLE "res\\hand.cur" +XT_IDC_HSPLITBAR CURSOR DISCARDABLE "res\\splith.cur" +XT_IDC_DRAGNONE CURSOR DISCARDABLE "res\\dragnone.cur" +XT_IDC_HANDNONE CURSOR DISCARDABLE "res\\handnone.cur" +XT_IDC_VSPLITBAR CURSOR DISCARDABLE "res\\splitv.cur" +XT_IDC_DRAGCOPY CURSOR DISCARDABLE "res\\dragcopy.cur" + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +XT_IDB_BTN_BAR BITMAP DISCARDABLE "res\\btn_bar.bmp" +XT_IDB_BTN_OUT BITMAP DISCARDABLE "res\\btn_out.bmp" +XT_IDB_LIGHTBULB BITMAP FIXED IMPURE "res\\lightbulb.bmp" +XT_IDB_LISTEDIT BITMAP DISCARDABLE "res\\btn_listedit.bmp" +XT_IDB_FONTTYPE BITMAP DISCARDABLE "res\\font.bmp" +XT_IDB_SCROLL_ARW BITMAP DISCARDABLE "res\\scroll.bmp" +XT_IDB_BTN_PRINT BITMAP DISCARDABLE "res\\btn_print.bmp" +XT_IDB_CHECKLISTBOX BITMAP FIXED IMPURE "res\\checklist.bmp" +XT_IDB_BTN_FRAME BITMAP DISCARDABLE "res\\btn_frame.bmp" +XT_IDB_CHECKLISTBOX_3D BITMAP FIXED IMPURE "res\\checklist_3d.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +XT_IDI_XTREME ICON DISCARDABLE "res\\xtreme.ico" +#endif // Neutral resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +XT_IDR_TBAR_HDR BITMAP DISCARDABLE "res\\tbar_hdr.bmp" +XT_IDR_TBAR_OUT BITMAP MOVEABLE PURE "res\\tbar_out.bmp" +XT_IDR_TBAR_BLANK BITMAP DISCARDABLE "res\\tbar_blank.bmp" +XT_IDR_TBAR_HEXEDIT BITMAP DISCARDABLE "res\\tbar_hex.bmp" +XT_IDR_PREVIEW_TOOLBAR BITMAP DISCARDABLE "res\\tbar_preview.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Toolbar +// + +XT_IDR_TBAR_HDR TOOLBAR DISCARDABLE 16, 15 +BEGIN + BUTTON XT_IDC_SORTASC + BUTTON XT_IDC_SORTDSC + SEPARATOR + BUTTON XT_IDC_ALIGNLEFT + BUTTON XT_IDC_ALIGNCENTER + BUTTON XT_IDC_ALIGNRIGHT +END + +XT_IDR_TBAR_OUT TOOLBAR DISCARDABLE 16, 15 +BEGIN + BUTTON XT_IDC_LARGEICON + BUTTON XT_IDC_SMALLICON +END + +XT_IDR_TBAR_BLANK TOOLBAR DISCARDABLE 16, 15 +BEGIN + BUTTON XT_IDC_BLANK +END + +XT_IDR_TBAR_HEXEDIT TOOLBAR DISCARDABLE 16, 15 +BEGIN + BUTTON ID_EDIT_UNDO + SEPARATOR + BUTTON ID_EDIT_CUT + BUTTON ID_EDIT_COPY + BUTTON ID_EDIT_PASTE + SEPARATOR + BUTTON ID_EDIT_CLEAR +END + +XT_IDR_PREVIEW_TOOLBAR TOOLBAR DISCARDABLE 16, 15 +BEGIN + BUTTON AFX_ID_PREVIEW_PRINT + BUTTON AFX_ID_PREVIEW_NEXT + BUTTON AFX_ID_PREVIEW_PREV + BUTTON AFX_ID_PREVIEW_NUMPAGE + BUTTON AFX_ID_PREVIEW_ZOOMIN + BUTTON AFX_ID_PREVIEW_ZOOMOUT + BUTTON AFX_ID_PREVIEW_CLOSE + BUTTON XT_IDC_BLANK +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +XT_IDD_TIPOFTHEDAY DIALOGEX 0, 0, 279, 157 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Tip of the Day" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "&Close",IDOK,221,136,50,14 + CONTROL "&Show tips at startup",XT_IDC_CHK_DAYTIP_SHOW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,140,78,10 + PUSHBUTTON "&Next Tip",XT_IDC_BTN_DAYTIP_NEXT,162,136,50,14 + CONTROL "",XT_IDC_BTN_DAYTIP_BORDER,"Static",SS_GRAYFRAME | NOT + WS_VISIBLE,8,7,263,123 +END + +XT_IDD_NEWTOOLBAR DIALOG DISCARDABLE 0, 0, 186, 60 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "New Toolbar" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,73,39,50,14 + PUSHBUTTON "Cancel",IDCANCEL,129,39,50,14 + EDITTEXT XT_IDC_EDIT_TOOLBAR,7,18,172,14,ES_AUTOHSCROLL + LTEXT "&Toolbar Name:",IDC_STATIC,7,7,48,8 +END + +XT_IDD_CUSTPAGE1 DIALOG DISCARDABLE 0, 0, 230, 150 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Tool&bars" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Toolb&ars:",XT_IDC_TXT_TOOLBARS,4,5,30,8 + LISTBOX XT_IDC_LBOX_CHECK,4,15,150,131,LBS_SORT | + LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "&New...",XT_IDC_BTN_NEW,158,15,70,14,BS_CENTER | + BS_VCENTER + PUSHBUTTON "Rename...",XT_IDC_BTN_RENAME,158,33,70,14,BS_CENTER | + BS_VCENTER | WS_DISABLED + PUSHBUTTON "Delete",XT_IDC_BTN_DELETE,158,51,70,14,BS_CENTER | + BS_VCENTER | WS_DISABLED + PUSHBUTTON "&Reset...",XT_IDC_BTN_RESET,158,69,70,14,BS_CENTER | + BS_VCENTER +END + +XT_IDD_CUSTPAGE2 DIALOG DISCARDABLE 0, 0, 230, 150 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "&Commands" +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX XT_IDC_LBOX_CATEGORIES,2,14,81,84,LBS_OWNERDRAWFIXED | + LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP + LISTBOX XT_IDC_LBOX_COMMANDS,88,14,140,84,LBS_OWNERDRAWVARIABLE | + LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP + LTEXT "Cate&gories:",XT_IDC_TXT_CATEGORIES,3,5,38,8 + LTEXT "Comman&ds:",XT_IDC_TXT_COMMANDS,89,5,38,8,WS_TABSTOP + LTEXT "Selected Command:",XT_IDC_TXT_SELECTED,3,103,64,8 + PUSHBUTTON "Description",XT_IDC_BTN_DESCRIPTION,11,115,81,14, + BS_CENTER | BS_VCENTER +END + +XT_IDD_CUSTPAGE5 DIALOG DISCARDABLE 0, 0, 230, 150 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "&Options" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Personalized Menus and Toolbars ", + XT_IDC_TXT_PERSONALIZED,7,5,110,8 + CONTROL "",XT_IDC_SEP_PERSONALIZED,"Static",SS_ETCHEDHORZ,122,9, + 101,1 + CONTROL "Menus have shadows.",XT_IDC_CHK_MENUSHADOWS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,20,87,10 + CONTROL "Me&nus show recently used commands first.", + XT_IDC_CHK_RECENTMENU,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,32,151,10 + CONTROL "Show f&ull menus after a short delay.", + XT_IDC_CHK_SHOWFULL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,25,44,127,10 + PUSHBUTTON "&Reset my usage data",XT_IDC_BTN_RESET,7,61,80,14, + BS_CENTER | BS_VCENTER + LTEXT "Other",XT_IDC_TXT_OTHER,7,81,20,8 + CONTROL "",XT_IDC_SEP_OTHER,"Static",SS_ETCHEDHORZ,30,85,193,1 + CONTROL "Show toolbar contents while dragging.", + XT_IDC_CHK_VISUALIZE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,95,136,10 + CONTROL "Show Screen&Tips on toolbars.",XT_IDC_CHK_SCREENTIPS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,107,111,10 + CONTROL "Show s&hortcut keys in ScreenTips.", + XT_IDC_CHK_SHOWSHORTCUTKEYS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,25,119,125,10 + LTEXT "&Menu Animation",IDC_STATIC,7,134,52,8 + COMBOBOX XT_IDC_COMBO_ANIMATION,65,131,79,65,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP +END + +XT_IDD_PREVIEW_TOOLBAR DIALOG DISCARDABLE 0, 0, 61, 20 +STYLE WS_CHILD +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "&Print...",AFX_ID_PREVIEW_PRINT,"Button",BS_OWNERDRAW | + NOT WS_VISIBLE | WS_TABSTOP,3,3,55,14 +END + +XT_IDD_COLORCUSTOM DIALOG DISCARDABLE 0, 0, 147, 161 +STYLE WS_CHILD | WS_DISABLED | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | + WS_CAPTION +CAPTION "Custom" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "&Colors:",XT_IDC_TXT_COLORS,2,4,43,10 + CONTROL "",XT_IDC_CLR_WND,"Static",SS_BLACKFRAME | WS_TABSTOP,3, + 15,119,86 + CONTROL "",XT_IDC_CLR_LUM,"Static",SS_BLACKFRAME | WS_TABSTOP, + 126,15,20,86 + LTEXT "&Hue:",XT_IDC_TXT_HUE,7,108,18,8 + EDITTEXT XT_IDC_EDIT_HUE,25,106,33,13,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Spin1",XT_IDC_SPIN_HUE,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,49,105, + 10,14 + LTEXT "&Sat:",XT_IDC_TXT_SAT,7,125,18,8 + EDITTEXT XT_IDC_EDIT_SAT,25,122,33,13,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Spin2",XT_IDC_SPIN_SAT,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,49,122, + 10,14 + LTEXT "&Lum:",XT_IDC_TXT_LUM,7,140,18,8 + EDITTEXT XT_IDC_EDIT_LUM,25,138,33,13,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Spin3",XT_IDC_SPIN_LUM,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,49,137, + 10,14 + LTEXT "&Red:",XT_IDC_TXT_RED,65,108,23,8 + EDITTEXT XT_IDC_EDIT_RED,89,106,33,13,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Spin1",XT_IDC_SPIN_RED,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,113,105, + 11,14 + LTEXT "&Green:",XT_IDC_TXT_GREEN,65,125,23,8 + EDITTEXT XT_IDC_EDIT_GREEN,89,122,33,13,ES_AUTOHSCROLL | + ES_NUMBER + CONTROL "Spin2",XT_IDC_SPIN_GREEN,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,113,122, + 11,14 + LTEXT "&Blue:",XT_IDC_TXT_BLUE,65,140,23,8 + EDITTEXT XT_IDC_EDIT_BLUE,89,138,33,13,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Spin3",XT_IDC_SPIN_BLUE,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,113,137, + 11,14 +END + +XT_IDD_COLORSTANDARD DIALOG DISCARDABLE 0, 0, 147, 161 +STYLE WS_CHILD | WS_DISABLED | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | + WS_CAPTION +CAPTION "Standard" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "&Colors:",XT_IDC_TXT_COLORS,2,4,43,10 + CONTROL "",XT_IDC_CLR_HEX,"Static",SS_BLACKFRAME | WS_TABSTOP,0, + 15,147,145 +END + +XT_IDD_WINDOWLIST DIALOG DISCARDABLE 0, 0, 301, 164 +STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Windows" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Select &window:",IDC_STATIC,7,7,147,8 + LISTBOX XT_IDC_LBOX_WINDOWS,7,17,216,140,LBS_SORT | + LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | + LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | + WS_HSCROLL | WS_TABSTOP + PUSHBUTTON "&Activate",XT_IDC_BTN_ACTIVATE,233,7,62,14 + PUSHBUTTON "&OK",IDOK,233,24,62,14 + PUSHBUTTON "&Save",XT_IDC_BTN_SAVE,233,41,62,14 + PUSHBUTTON "&Close Window(s)",XT_IDC_BTN_CLOSEWINDOWS,233,58,62,14 + PUSHBUTTON "Casca&de",XT_IDC_BTN_CASCADE,233,75,62,14 + PUSHBUTTON "Tile &Horizontally",XT_IDC_BTN_TILEHORZ,233,92,62,14 + PUSHBUTTON "Tile &Vertically",XT_IDC_BTN_TILEVERT,233,109,62,14 + PUSHBUTTON "Minimi&ze",XT_IDC_BTN_MINIMIZE,233,126,62,14 +END + +XT_IDD_CUSTPAGE3 DIALOGEX 0, 0, 230, 150 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Keyboard" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + LTEXT "Commands:",XT_IDC_TXT_COMMANDS,2,28,38,8 + LISTBOX XT_IDC_LBOX_ACCEL_COMMANDS,2,39,93,74,LBS_OWNERDRAWFIXED | + LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP + LTEXT "Current Assignments:",XT_IDC_TXT_ASSIGNMENTS,100,28,67, + 8 + LISTBOX XT_IDC_LBOX_KEYS,100,38,75,49,LBS_SORT | + LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "Press new shortcut key:",XT_IDC_TXT_NEWKEY,100,91,76,8 + EDITTEXT XT_IDC_EDIT_SHORTCUTKEY,100,101,75,12,ES_AUTOHSCROLL + PUSHBUTTON "&Assign",XT_IDC_BTN_ASSIGN,179,39,49,14 + PUSHBUTTON "&Remove",XT_IDC_BTN_REMOVE,179,56,49,14 + PUSHBUTTON "Re&set All",XT_IDC_BTN_ACCEL_RESET,179,73,49,14 + LTEXT "Description:",XT_IDC_TXT_DESC_TITLE,2,119,38,8 + LTEXT "",XT_IDC_TXT_DESC_OVERVIEW,2,129,173,19,0, + WS_EX_STATICEDGE + LTEXT "Category:",IDC_STATIC,2,5,31,8 + COMBOBOX XT_IDC_COMBO_CATEGORY,2,15,93,147,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "",XT_IDC_TXT_FRAMETITLE,100,15,128,12 +END + +XT_IDD_CUSTPAGE4 DIALOG DISCARDABLE 0, 0, 230, 150 +STYLE WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Tools" +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX XT_IDC_LBOX_TOOLSLIST,2,5,226,93,LBS_OWNERDRAWVARIABLE | + LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP + RTEXT "&Command:",XT_IDC_TXT_TOOLSCMD,2,104,60,8 + RTEXT "&Arguments:",XT_IDC_TXT_TOOLSARG,2,119,60,8 + RTEXT "&Initial Directory:",XT_IDC_TXT_TOOLSDIR,2,134,60,8 + EDITTEXT XT_IDC_EDIT_TOOLSCMD,73,101,155,14,ES_AUTOHSCROLL + EDITTEXT XT_IDC_EDIT_TOOLSARG,73,116,155,14,ES_AUTOHSCROLL + EDITTEXT XT_IDC_EDIT_TOOLSDIR,73,131,155,14,ES_AUTOHSCROLL +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +XT_IDM_POPUP MENU DISCARDABLE +BEGIN + POPUP "RClickOutlookBar" + BEGIN + MENUITEM "S&mall Icons", XT_IDC_SMALLICON + MENUITEM "Lar&ge Icons", XT_IDC_LARGEICON + END + POPUP "RClickHexEdit" + BEGIN + MENUITEM "&Undo", ID_EDIT_UNDO + MENUITEM SEPARATOR + MENUITEM "Cu&t", ID_EDIT_CUT + MENUITEM "&Copy", ID_EDIT_COPY + MENUITEM "&Paste", ID_EDIT_PASTE + MENUITEM "&Delete", ID_EDIT_CLEAR + MENUITEM SEPARATOR + MENUITEM "Select &All", ID_EDIT_SELECT_ALL + END + POPUP "RClickHeader" + BEGIN + MENUITEM "Sort Ascending", XT_IDC_SORTASC + MENUITEM "Sort Descending", XT_IDC_SORTDSC + MENUITEM SEPARATOR + POPUP "Alignment" + BEGIN + MENUITEM "Align Left", XT_IDC_ALIGNLEFT + MENUITEM "Align Center", XT_IDC_ALIGNCENTER + MENUITEM "Align Right", XT_IDC_ALIGNRIGHT + END + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + XT_IDD_NEWTOOLBAR, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 53 + END + + XT_IDD_CUSTPAGE1, DIALOG + BEGIN + TOPMARGIN, 5 + END + + XT_IDD_CUSTPAGE2, DIALOG + BEGIN + RIGHTMARGIN, 228 + VERTGUIDE, 2 + TOPMARGIN, 5 + BOTTOMMARGIN, 142 + END + + XT_IDD_CUSTPAGE5, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 223 + VERTGUIDE, 25 + TOPMARGIN, 5 + BOTTOMMARGIN, 142 + HORZGUIDE, 25 + HORZGUIDE, 37 + HORZGUIDE, 49 + HORZGUIDE, 100 + HORZGUIDE, 112 + HORZGUIDE, 124 + END + + XT_IDD_PREVIEW_TOOLBAR, DIALOG + BEGIN + LEFTMARGIN, 3 + RIGHTMARGIN, 58 + TOPMARGIN, 3 + BOTTOMMARGIN, 17 + END + + XT_IDD_COLORCUSTOM, DIALOG + BEGIN + VERTGUIDE, 25 + VERTGUIDE, 58 + VERTGUIDE, 65 + VERTGUIDE, 89 + VERTGUIDE, 122 + VERTGUIDE, 127 + END + + XT_IDD_WINDOWLIST, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 295 + VERTGUIDE, 223 + VERTGUIDE, 233 + TOPMARGIN, 7 + BOTTOMMARGIN, 157 + HORZGUIDE, 82 + HORZGUIDE, 99 + HORZGUIDE, 116 + HORZGUIDE, 133 + END + + XT_IDD_CUSTPAGE3, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 228 + VERTGUIDE, 85 + VERTGUIDE, 95 + VERTGUIDE, 100 + VERTGUIDE, 175 + VERTGUIDE, 179 + TOPMARGIN, 5 + BOTTOMMARGIN, 148 + HORZGUIDE, 39 + HORZGUIDE, 87 + HORZGUIDE, 113 + END + + XT_IDD_CUSTPAGE4, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 228 + VERTGUIDE, 73 + TOPMARGIN, 5 + BOTTOMMARGIN, 145 + HORZGUIDE, 98 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "XTResource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDC_BTN_CLOSE "Hide docked window" + XT_IDC_BTN_EXPAND "Expand docked window" + XT_IDC_BTN_NEW "New (Insert)" + XT_IDC_BTN_DELETE "Delete (Delete)" + XT_IDC_BTN_UP "Move Item Up (Alt+Up Arrow)" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDS_REG_KEY "Software\\%s\\%s\\Settings" + XT_IDS_REG_WINPOS "%u,%u,%d,%d,%d,%d,%d,%d,%d,%d" + XT_IDS_REG_BARID "BarID" + XT_IDS_REG_SETTINGS "Settings" + XT_IDS_REG_BARPOS "Bar Position" + XT_IDS_REG_WNDPOS "Window Position" + XT_IDS_REG_RECENTLIST "Recent Item List" + XT_IDS_REG_ITEMID "Item%d" + XT_IDS_REG_CBARID "%s-Bar%d" + XT_IDS_REG_COLINFO "Column Info" + XT_IDS_NAME "Name" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDS_SIZE "Size" + XT_IDS_CONTRACT "Contract docked window" + XT_IDS_TYPE "Type" + XT_IDS_MODIFIED "Modified" + XT_IDS_INVALID_VER "Warning: This program requires comctl32.dll version 4.71 or greater." + XT_IDS_COLOR_AUTO "Automatic" + XT_IDS_COLOR_CUST "Customize..." + XT_IDS_SELDIR "Select Directory:" + XT_IDS_DOCKWND "Dock Window" + XT_IDS_RES_ASSERT "ERROR: Not all of the resources needed by Xtreme Toolkit have been correctly initialized.\n\nIf your project is a CDialog based application, or your CMainFrame class was not derived from CXTFrameWnd or CXTMDIFrameWnd you will need to call ""xtAfxData.InitResources();"" to initialize these resources and eliminate the assertion that follows this error.\n\nYou can place ""xtAfxData.InitResources();"" in the constructor of your CMainFrame or CDialog class." + XT_IDS_TOOLBAR "Toolbar" + XT_IDS_ERROR_BLANK "The toolbar name cannot be blank. Type a name." +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDS_STATUSBAR "Status Bar" + XT_IDS_ERROR_EXISTS "A toolbar named '%s' already exists. Type another name." + XT_IDS_ERROR_LIMIT "Sorry you have reached your limit." + XT_IDS_CUSTOM_BAR "Custom %d" + XT_IDS_CUSTOM_CONFIRM "Are you sure you want to delete the '%s' toolbar?" + XT_IDS_DOT "..." + XT_IDS_NOHELPTOPIC "No help topic is associated with this item.\nCommand ID %d" + XT_IDS_DEFEXT "*.*" + XT_IDS_DEFFILT "All Files (*.*)|*.*||" + XT_IDS_DEFTITLE "Choose Directory Name:" + XT_IDS_CLICKKEEPOPEN "Click push pin to keep open" + XT_IDS_SE_0 "The operating system is out of memory or resources." + XT_IDS_SE_ERR_FNF "The specified file was not found." + XT_IDS_SE_ERR_PNF "The specified path was not found." + XT_IDS_SE_ERR_ACCESSDENIED + "The operating system denied access to the specified file." + XT_IDS_SE_ERR_OOM "There was not enough memory to complete the operation." +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDS_SE_ERR_BAD_FORMAT + "The .exe file is invalid (non-Win32® .exe or error in .exe image)." + XT_IDS_SE_ERR_SHARE "A sharing violation occurred." + XT_IDS_SE_ERR_ASSOCINCOMPLETE + "The file name association is incomplete or invalid." + XT_IDS_SE_ERR_DDETIMEOUT + "The DDE transaction could not be completed because the request timed out." + XT_IDS_SE_ERR_DDEFAIL "The DDE transaction failed." + XT_IDS_SE_ERR_DDEBUSY "The DDE transaction could not be completed because other DDE transactions were being processed." + XT_IDS_SE_ERR_NOASSOC "There is no application associated with the given file name extension." + XT_IDS_SE_ERR_DLLNOTFOUND + "The specified dynamic-link library was not found." + XT_IDS_SE_ERR_UNKOWN "An unknown error number %d occured." + XT_IDS_CLOSE "Close" + XT_IDS_CLR_BLACK "Black" + XT_IDS_CLR_BROWN "Brown" + XT_IDS_CLR_OLIVE_GREEN "Olive Green" + XT_IDS_CLR_DARK_GREEN "Dark Green" + XT_IDS_CLR_DARK_TEAL "Dark Teal" + XT_IDS_CLR_DARK_BLUE "Dark Blue" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDC_SORTASC "Sorts the selected column in ascending order\nSort Ascending" + XT_IDC_SORTDSC "Sorts the selected column in descending order\nSort Descending" + XT_IDC_ALIGNLEFT "Left alligns the contents of the selected column\nAlign Left" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDC_ALIGNCENTER "Center alligns the contents of the selected column\nAlign Center" + XT_IDC_ALIGNRIGHT "Right alligns the contents of the selected column\nAlign Right" + XT_IDC_LARGEICON "Display large icons\nLarge Icons" + XT_IDC_SMALLICON "Display small icons\nSmall Icons" + XT_IDC_REMOVEITEM "Remove from Outlook Bar" + XT_IDC_RENAMEITEM "Rename Shortcut" + XT_IDC_CUSTOMIZE "Allows for customization of the toolbar\nCustomize toolbar" + XT_IDC_CHEVRON "Display full menus" + XT_IDC_REMOVEGROUP "Remove Group" + XT_IDC_RENAMEGROUP "Rename Group" + XT_IDC_SORT_CATEGORIZED "Categorized\nCategorized" + XT_IDC_SORT_ALPHABETIC "Alphabetic\nAlphabetic" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDS_TIPTEXT "Tip Text" + XT_IDS_DIDYOUKNOW "Did you know..." + XT_IDS_FILE_ABSENT "Tips file does not exist in the prescribed directory" + XT_IDS_FILE_CORRUPT "Trouble reading the tips file" + XT_IDS_MENUBAR "Menu Bar" + XT_IDS_CONTROLBAR "Control Bar" + XT_IDS_CUSTOMIZE "Customize" + XT_IDS_COLOR_CAPTION "Colors" + XT_IDS_NEW "New" + XT_IDS_CURRENT "Current" + XT_IDS_DIRECTORIES " Directories:" + XT_IDS_FILES " Files:" + XT_IDS_RESTORE "This will restore the toolbar to it's original state, do you wish to continue?" + XT_IDS_WINDOWS "More Windows..." + XT_IDS_MANAGEKEYBRD "Manage Keyboard Shortcuts" + XT_IDS_COMMAND "Command" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDS_CLR_INDIGO "Indigo" + XT_IDS_CLR_GRAY80 "Gray-80%" + XT_IDS_CLR_DARK_RED "Dark Red" + XT_IDS_CLR_ORANGE "Orange" + XT_IDS_CLR_DARK_YELLOW "Dark Yellow" + XT_IDS_CLR_GREEN "Green" + XT_IDS_CLR_TEAL "Teal" + XT_IDS_CLR_BLUE "Blue" + XT_IDS_CLR_BLUEGRAY "Blue Gray" + XT_IDS_CLR_GRAY50 "Gray-50%" + XT_IDS_CLR_RED "Red" + XT_IDS_CLR_LIGHTORANGE "Light Orange" + XT_IDS_CLR_LIME "Lime" + XT_IDS_CLR_SEA_GREEN "Sea Green" + XT_IDS_CLR_AQUA "Aqua" + XT_IDS_CLR_LIGHT_BLUE "Light Blue" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDS_CLR_VIOLET "Violet" + XT_IDS_CLR_GRAY40 "Gray-40%" + XT_IDS_CLR_PINK "Pink" + XT_IDS_CLR_GOLD "Gold" + XT_IDS_CLR_YELLOW "Yellow" + XT_IDS_CLR_BRIGHT_GREEN "Bright Green" + XT_IDS_CLR_TURQUOISE "Turquiose" + XT_IDS_CLR_SKY_BLUE "Sky Blue" + XT_IDS_CLR_PLUM "Plum" + XT_IDS_CLR_GRAY25 "Gray-25%" + XT_IDS_CLR_ROSE "Rose" + XT_IDS_CLR_TAN "Tan" + XT_IDS_CLR_LIGHT_YELLOW "Light Yellow" + XT_IDS_CLR_LIGHT_GREEN "Light Green" + XT_IDS_CLR_LIGHT_TURQUOISE "Light Turquoise" + XT_IDS_CLR_PALE_BLUE "Pale Blue" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDS_CLR_LAVENDER "Lavender" + XT_IDS_CLR_WHITE "White" + XT_IDS_CLR_GRAY "Gray" + XT_IDS_CLR_MAROON "Maroon" + XT_IDS_CLR_OLIVE "Olive" + XT_IDS_CLR_NAVY "Navy" + XT_IDS_CLR_PURPLE "Purple" + XT_IDS_CLR_SILVER "Silver" + XT_IDS_CLR_FUCHSIA "Fuchsia" + XT_IDS_CLR_NOFILL "No Fill" + XT_IDS_CLR_NOFILL_TIP "No Color" + XT_IDS_AUTOMATIC "Automatic" + XT_IDS_AUTOMATIC_TIP "Automatic Color" + XT_IDS_MORE_COLORS "More Colors..." + XT_IDS_MORE_COLORS_TIP "More Colors" + XT_IDS_STD_COLORS "Standard Colors" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDC_BTN_DOWN "Move Item Down (Alt+Down Arrow)" +END + +STRINGTABLE DISCARDABLE +BEGIN + AFX_ID_PREVIEW_CLOSE "Close the preview\nClose Preview" + AFX_ID_PREVIEW_NUMPAGE "Display single page or double page view\n1 Page / 2 Page" + AFX_ID_PREVIEW_NEXT "Go to the next page\nNext Page" + AFX_ID_PREVIEW_PREV "Go to the previous page\nPrevious Page" + AFX_ID_PREVIEW_PRINT "Print the previewed item\nPrint" + AFX_ID_PREVIEW_ZOOMIN "Increase magnification of preview page\nZoom In" + AFX_ID_PREVIEW_ZOOMOUT "Decrease magnification of preview page\nZoom Out" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDS_KEYS "Keys" + XT_IDS_DESCRIPTION "Description" + XT_IDS_ALLCOMMANDS "[All Commands]" + XT_IDS_REASSIGN "This shortcut is currently assigned to the command: %s\n\nDo you want to re-assign this shortcut?" + XT_IDS_WIND_MINIMIZE "Minimize Window" + XT_IDS_WIND_RESTORE "Restore Window" + XT_IDS_WIND_CLOSE "Close Window" + XT_IDS_TOOLBAR_OPTS "Toolbar Options" + XT_IDS_TOOLS "&Tools" + XT_IDS_PATH_INVALID "The path is invalid." + XT_IDS_AREYOUSURE "Are you sure you want to reset the key assignments? This action will remove all custom key assignments at the text level." + XT_IDS_AREYOUSURE_2 "This will delete the record of the commands you've used in this application and restore the default set of visible commands to the menus and toolbars. It will not undo any explicit customizations. Are you sure you want to do this?" + XT_IDS_BROWSE "Browse" + XT_IDS_BROWSE_FILTER "Executable (*.exe)|*.exe|Command (*.com)|*.com|Information (*.pif)|*.pif|Batch (*.bat;*.cmd)|*.bat; *.cmd|All Files (*.*)|*.*||" + XT_IDS_MENU_CONTENTS " &Menu contents:" +END + +STRINGTABLE DISCARDABLE +BEGIN + XT_IDS_ANIM_SYSDEF "(System default)" + XT_IDS_ANIM_RANDOM "Random" + XT_IDS_ANIM_UNFOLD "Unfold" + XT_IDS_ANIM_SLIDE "Slide" + XT_IDS_ANIM_FADE "Fade" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Editor/XT/Include/XTSearchOptionsCtrl.h b/Editor/XT/Include/XTSearchOptionsCtrl.h new file mode 100644 index 0000000..2a8252e --- /dev/null +++ b/Editor/XT/Include/XTSearchOptionsCtrl.h @@ -0,0 +1,216 @@ +// XTSearchOptionsCtrl.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTSEARCHOPTIONSCTRL_H__) +#define __XTSEARCHOPTIONSCTRL_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTSearchOptionsCtrl is a CStatic derived class. CXTSearchOptionsCtrl +// is used to create a control similar to the Search Options item found +// in the search pane of Windows Explorer as is seen in Windows 2000 and +// later. This class allows you to associate a group of controls to be +// hidden or shown when the item is expanded and contracted, and a set +// of controls that need to move depending on the CXTSearchOptionsCtrl state. +// +// Use with CXTSearchOptionsView form view class to create a pane similar +// to the Windows Explorer search pane. To use the control, define a set +// of controls that are to be hidden and moved depending on the +// CXTSearchOptionsCtrl state. +// +// Example:
+//			void CExpandTestView::OnInitialUpdate()
+//			{
+//			   CXTSearchOptionsView::OnInitialUpdate();
+//
+//			   m_expand.AddControl(&m_check1);
+//			   m_expand.AddControl(&m_check2);
+//			   m_expand.AddControl(&m_edit1);
+//			   m_expand.AddControl(&m_edit2);
+//
+//			   m_expand.MoveControl(&m_button1);
+//			   m_expand.MoveControl(&m_button2);
+//			   m_expand.MoveControl(&m_combo1);
+//  
+//			   m_expand.SetLabelText(
+//			       _T("Search Options <<"), _T("Search Options >>"));
+//			}
+// +// See the "SearchOptions" demo for a complete example. +class _XT_EXT_CLASS CXTSearchOptionsCtrl : public CStatic +{ + DECLARE_DYNAMIC(CXTSearchOptionsCtrl) + +public: + + // Summary: Constructs a CXTSearchOptionsCtrl object. + CXTSearchOptionsCtrl(); + + // Summary: Destroys a CXTSearchOptionsCtrl object, handles cleanup and de-allocation. + virtual ~CXTSearchOptionsCtrl(); + +protected: + + int m_iMinSize; // Height of the control when contracted. + int m_iMaxSize; // Height of the control when expanded. + bool m_bExpanded; // true when the control is expanded. + CRect m_rcLabel; // Size of the label that is displayed. + DWORD m_dwInitSignature; // used for one-time initialization. + CString m_strExpandLabel; // Label to display when the control is expanded. + CString m_strContractLabel; // Label to display when the control is contracted. + CPtrArray m_arHideCtrls; // List of controls to show or hide. + CPtrArray m_arMoveCtrls; // List of controls to move when expanded or contracted. + + + +public: + + // Input: pWndCtrl - Points to a valid CWnd object to hide. + // Summary: Call this member function to add a control to the list of controls + // that are displayed when the hide item control is expanded. + void AddControl(CWnd* pWndCtrl); + + // Input: pWndCtrl - Points to a valid CWnd object to move. + // Summary: Call this member function to add a control to the list of controls + // that are moved when the hide item control is expanded or contracted. + void MoveControl(CWnd* pWndCtrl); + + // Input: lpszExpand - NULL terminated string that represents the text displayed when + // the control is expanded. + // lpszContract - NULL terminated string that represents the text displayed when + // the control is contracted. + // Summary: Call this member function to set the text that is displayed when the + // hide item control is expanded or contracted. + void SetLabelText(LPCTSTR lpszExpand,LPCTSTR lpszContract); + + // Summary: Call this member function to expand the hide item control and display + // CWnd objects contained in the hide item list. Called by the control + // whenever the user clicks on the expand label. + void Expand(); + + // Summary: Call this member function to contract the hide item control and hide + // CWnd objects contained in the hide item list. Called by the control + // whenever the user clicks on the contract label. + void Contract(); + + // Returns: An integer value that represents the height of the + // control when it is contracted. + // Summary: Call this member function to return the minimum height of the hide + // item control. + int GetMinSize(); + + // Returns: An integer value that represents the height of the + // control when it is expanded. + // Summary: Call this member function to return the maximum height of the hide + // item control. + int GetMaxSize(); + + // Returns: An integer value that represents the distance that controls will be moved. + // Summary: Call this member function to return the offset size for the + // CXTSearchOptionsCtrl object. This is the distance that controls will + // be moved to accommodate for the expansion and contraction of the control. + // Also used by CXTSearchOptionsView for adjusting scroll sizes. + int GetOffsetSize(); + +protected: + + // Summary: defers control initialization + void DeferInitialUpdate(); + + // Ignore: + //{{AFX_VIRTUAL(CXTSearchOptionsCtrl) + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTSearchOptionsCtrl) + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + //}}AFX_MSG + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE int CXTSearchOptionsCtrl::GetMinSize() { + return m_iMinSize; +} +AFX_INLINE int CXTSearchOptionsCtrl::GetMaxSize() { + return m_iMaxSize; +} +AFX_INLINE int CXTSearchOptionsCtrl::GetOffsetSize() { + return GetMaxSize()-GetMinSize(); +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTSearchOptionsView is a CXTResizeFormView derived helper class. It +// is to be used with a CXTSearchOptionsCtrl object. It is used to paint +// the background and control background color white. +class _XT_EXT_CLASS CXTSearchOptionsView : public CXTResizeFormView +{ + DECLARE_DYNAMIC(CXTSearchOptionsView) + +protected: + + // Input: nID - Contains the ID number of a dialog template resource. + // nFlags - Flags that are to be passed to CXTResize that specify the attributes + // of the resizing property page. They can be one or more of the following, + // and can be combined using the or (|) operator: + // [ul] + // [li]SZ_NOSIZEICON Do not add size icon.[/li] + // [li]SZ_NOHORISONTAL No horizontal resizing.[/li] + // [li]SZ_NOVERTICAL No vertical resizing.[/li] + // [li]SZ_NOMINSIZE Do not require a minimum size.[/li] + // [li]SZ_NOCLIPCHILDREN Do not set clip children style.[/li] + // [li]SZ_NOTRANSPARENTGROUP Do not set transparent style + // for group boxes.[/li] + // [/ul] + // Summary: Constructs a CXTSearchOptionsView object, same as if you were constructing + // a CXTResizeFormView object. + CXTSearchOptionsView(const UINT nID = 0,const UINT nFlags = 0); + + // Summary: Destroys a CXTSearchOptionsView object, handles cleanup and de-allocation. + virtual ~CXTSearchOptionsView(); + + HBRUSH m_hBrush; // Handle to the current background brush. + + // Ignore: + //{{AFX_VIRTUAL(CXTSearchOptionsView) + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTSearchOptionsView) + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTSEARCHOPTIONSCTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTShellListCtrl.h b/Editor/XT/Include/XTShellListCtrl.h new file mode 100644 index 0000000..773507d --- /dev/null +++ b/Editor/XT/Include/XTShellListCtrl.h @@ -0,0 +1,245 @@ +// XTShellListCtrl.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTSHELLLISTCTRL_H__) +#define __XTSHELLLISTCTRL_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTShellListCtrl is a multiple inheritance class derived from CXTListCtrl +// and CXTShellPidl. It is used to create a CXTShellListCtrl window. +class _XT_EXT_CLASS CXTShellListCtrl : public CXTListCtrl, public CXTShellPidl +{ + +public: + + // Summary: Constructs a CXTShellListCtrl object. + CXTShellListCtrl(); + + // Summary: Destroys a CXTShellListCtrl object, handles cleanup and de-allocation. + virtual ~CXTShellListCtrl(); + +protected: + + UINT m_uFlags; // Flags indicating which items to include in the enumeration. + BOOL m_bContextMenu; // TRUE to display the shell context menu on right item click. + CWnd* m_pTreeCtrl; // Window that receives update notification, usually a CXTShellTreeCtrl. + LPITEMIDLIST m_pidlINet; // Points to the CSIDL_INTERNET folder location. + CXTShellSettings m_shSettings; // Contains SHELLFLAGSTATE info. + + // Input: lptvid - Pointer to tree view item data. + // lpsf - Pointer to the parent shell folder. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds items to the list view. + virtual BOOL InitListViewItems(XT_TVITEMDATA* lptvid,LPSHELLFOLDER lpsf); + + // Input: lpifq - Fully qualified item ID list for the current item. + // lptvitem - Pointer to a tree view item about to be added to the tree. + // Summary: This member function gets the index for the normal and selected icons + // of the current item. + virtual void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTV_ITEM lptvitem); + +public: + + // Input: bEnable - TRUE to display a context menu. + // Summary: Call this member function to enable or disable the display of the shell + // context menu on the right click of an item. + virtual void EnableContextMenu(BOOL bEnable); + + // Input: uFlags - Determines the type of items included in an enumeration, and can + // be one or more of the following: + // [ul] + // [li]SHCONTF_FOLDERS Include items that are folders in + // the enumeration.[/li] + // [li]SHCONTF_NONFOLDERS Include items that are not folders + // in the enumeration.[/li] + // [li]SHCONTF_INCLUDEHIDDEN Include hidden items in the + // enumeration.[/li] + // [li]SHCONTF_INIT_ON_FIRST_NEXT IShellFolder::EnumObjects + // can return without validating the enumeration object. Validation + // can be postponed until the first call to IEnumIDList::Next. + // This flag is intended to be used when a user interface may be + // displayed prior to the first IEnumIDList::Next call. For a + // user interface to be presented, 'hwndOwner' must be set to a valid + // window handle.[/li] + // [li]SHCONTF_NETPRINTERSRCH The caller is looking for + // printer objects.[/li] + // [/ul] + // Summary: Call this member function to determine the type of items included + // in the shell enumeration. Default is SHCONTF_FOLDERS | SHCONTF_NONFOLDERS. + virtual void SetEnumFlags(UINT uFlags); + + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function associates the system image list with the list + // control. + virtual BOOL InitSystemImageLists(); + + // Input: lptvid - Pointer to TreeView item data + // lpsf - Pointer to the parent shell folder. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function populates the list view control. + virtual BOOL PopulateListView(XT_TVITEMDATA* lptvid,LPSHELLFOLDER lpsf); + + // Returns: The index of the item that was double clicked, or -1, if the item was + // not found. + // Summary: This member function returns the index of the list view item that + // was double clicked on. + virtual int GetDoubleClickedItem(); + + // Returns: The index of the item selected, or -1, if the item was not found. + // Summary: This member function displays the system popup menu for the selected + // item or folder. + virtual int GetContextMenu(); + + // Input: iItem - Index of the list view item clicked on. + // Returns: true if successful, otherwise returns false. + // Summary: This member function executes, via the Shell, the item clicked on + // in the list control. + virtual bool ShellOpenItem(int iItem); + + // Input: lplvid - Pointer to the list view item data. + // Returns: true if successful, otherwise returns false. + // Summary: This member function executes, via the Shell, the item clicked on + // in the list control. + virtual bool ShellOpenItem(XT_LVITEMDATA* lplvid); + + // Input: iItem - Index of the list view item to get the path of. + // strItemPath - Reference to a CString object that receives the path string. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function retrieves the path of the specified list view item. + virtual BOOL GetItemPath(int iItem,CString &strItemPath); + + // This member function creates default columns for the list view. + virtual void BuildDefaultColumns(); + + // Input: nCol - Passed in from the control. The index of the column clicked. + // bAscending - Passed in from the control, true if the sort order should + // be ascending. + // Returns: true if successful, otherwise returns false. + // Summary: Override this member function in your derived class to perform custom + // sort routines. + virtual bool SortList(int nCol,bool bAscending ); + + // Input: pWnd - Points to the tree control that is associated with the list. + // Summary: Call this member function to associate the tree control with the list. + virtual void AssociateTree(CWnd* pWnd); + + // Call this member function to initialize the shell list control. + virtual void InitializeControl(); + + // Ignore: + //{{AFX_VIRTUAL(CXTShellListCtrl) + protected: + //}}AFX_VIRTUAL + + virtual void OnDragDrop(NM_LISTVIEW* pNMListView); + virtual TCHAR* InsertCommas(LONGLONG value, TCHAR* szBufferOut, UINT nSize); + +protected: + + // Input: iItem - Index of the item to set the attributes for. + // dwAttributes - Flags retrieved from SHELLFOLDER::GetAttributesOf. + // Summary: This member function sets the shell attribute flags for the specified + // list item. + virtual void SetAttributes(int iItem,DWORD dwAttributes); + + // Ignore: + //{{AFX_MSG(CXTShellListCtrl) + afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginRDrag(NMHDR* pNMHDR, LRESULT* pResult); + //}}AFX_MSG + afx_msg LRESULT OnUpdateShell(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +#define CXTShellList CXTShellListCtrl + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTShellListCtrl::SetEnumFlags(UINT uFlags) { + m_uFlags = uFlags; +} +AFX_INLINE void CXTShellListCtrl::AssociateTree(CWnd* pWnd) { + ASSERT_VALID(pWnd); m_pTreeCtrl = pWnd; +} +AFX_INLINE void CXTShellListCtrl::EnableContextMenu(BOOL bEnable) { + m_bContextMenu = bEnable; +} + +///////////////////////////////////////////////////////////////////////////// +// Summary: CXTShellListCtrlEx is a CXTShellListCtrl derived class. It is used to create +// a stand-alone shell list control that is not dependant on a CXTShellTreeCtrl +// for initialization. It is used to create a CXTShellListCtrlEx window for +// displaying the contents of file folders. +class _XT_EXT_CLASS CXTShellListCtrlEx : public CXTShellListCtrl +{ + +public: + + // Summary: Constructs a CXTShellListCtrlEx object. + CXTShellListCtrlEx(); + + // Summary: Destroys a CXTShellListCtrlEx object, handles cleanup and de-allocation. + virtual ~CXTShellListCtrlEx(); + +protected: + + CWnd* m_pSyncWnd; // Points to the window to synchronize with the shell list control. + CString m_strItemPath; // A NULL terminated string that represents the currently selected folder. + +public: + + // Input: lpszPath - A NULL terminated string that represents the folder to select. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to browse to a particular file folder. + bool BrowseToFolder(LPCTSTR lpszPath); + + // Input: pSyncWnd - Points to a valid CWnd object. + // Summary: This member function will associate a CWnd object with the shell list control. This + // window is usually a CEdit control, but can be any CWnd object. This window will have + // its window text updated whenever the selected folder is changed. + void SetSyncWnd(CWnd* pSyncWnd); + + // Ignore: + //{{AFX_VIRTUAL(CXTShellListCtrlEx) + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTShellListCtrlEx) + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTShellListCtrlEx::SetSyncWnd(CWnd* pSyncWnd) { + m_pSyncWnd = pSyncWnd; +} + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTSHELLLISTCTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTShellListView.h b/Editor/XT/Include/XTShellListView.h new file mode 100644 index 0000000..510d1c3 --- /dev/null +++ b/Editor/XT/Include/XTShellListView.h @@ -0,0 +1,184 @@ +// XTShellListView.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#ifndef __XTSHELLLISTVIEW_H__ +#define __XTSHELLLISTVIEW_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTShellListView is a multiple inheritance class derived from CXTListView +// and CXTShellPidl. It is used to create a CXTShellListView class object. +class _XT_EXT_CLASS CXTShellListView : public CXTListView, public CXTShellPidl +{ + DECLARE_DYNCREATE(CXTShellListView) + +public: + + // Summary: Constructs a CXTShellListView object. + CXTShellListView(); + + // Summary: Destroys a CXTShellListView object, handles cleanup and de-allocation. + virtual ~CXTShellListView(); + +protected: + + UINT m_uFlags; // Flags indicating which items to include in the enumeration. + BOOL m_bUninitOLE; // TRUE if OleUninitialize has to be called. + BOOL m_bContextMenu; // TRUE to display the shell context menu on right item click. + LPITEMIDLIST m_pidlINet; // Points to the CSIDL_INTERNET folder location. + CXTShellSettings m_shSettings; // Contains SHELLFLAGSTATE info. + + // Input: lptvid - Pointer to tree view item data. + // lpsf - Pointer to the parent shell folder. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function adds items to the list view. + virtual BOOL InitListViewItems(XT_TVITEMDATA* lptvid,LPSHELLFOLDER lpsf); + + // Input: lpifq - Fully qualified item ID list for the current item. + // lptvitem - Pointer to the tree view item about to be added to the tree. + // Summary: This member function gets the index for the normal and selected + // icons of the current item. + virtual void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTV_ITEM lptvitem); + +public: + + // Input: bEnable - TRUE to display a context menu. + // Summary: Call this member function to enable or disable the display of the + // shell context menu on the right click of the item. + virtual void EnableContextMenu(BOOL bEnable); + + // BULLETED LIST: + + // Input: uFlags - Determines the type of items included in an enumeration, and can + // be one or more of the following: + // [ul] + // [li]SHCONTF_FOLDERS Include items that are folders in + // the enumeration.[/li] + // [li]SHCONTF_NONFOLDERS Include items that are not folders + // in the enumeration.[/li] + // [li]SHCONTF_INCLUDEHIDDEN Include hidden items in the + // enumeration.[/li] + // [li]SHCONTF_INIT_ON_FIRST_NEXT IShellFolder::EnumObjects + // can return without validating the enumeration object. Validation + // can be postponed until the first call to IEnumIDList::Next. + // This flag is intended to be used when a user interface may be + // displayed prior to the first IEnumIDList::Next call. For a + // user interface to be presented, 'hwndOwner' must be set to a valid + // window handle.[/li] + // [li]SHCONTF_NETPRINTERSRCH The caller is looking for + // printer objects.[/li] + // [/ul] + // Summary: Call this member function to determine the type of items included + // in the shell enumeration. The default is SHCONTF_FOLDERS | SHCONTF_NONFOLDERS. + virtual void SetEnumFlags(UINT uFlags); + + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function associates the system image list with the list + // control. + virtual BOOL InitSystemImageLists(); + + // Input: lptvid - Pointer to TreeView item data. + // lpsf - Pointer to the parent shell folder. + // Returns: TRUE if successful, otherwise return FALSE. + // Summary: This member function populates the list view control. + virtual BOOL PopulateListView(XT_TVITEMDATA* lptvid,LPSHELLFOLDER lpsf); + + // Returns: The index of the item that was double clicked, or -1, if the item + // was not found. + // Summary: This member function returns the index of the list view item that + // was double clicked on. + virtual int GetDoubleClickedItem(); + + // Returns: The index of the item selected, or -1, if the item was not found. + // Summary: This member function displays the system popup menu for the selected + // item or folder. + virtual int GetContextMenu(); + + // Input: iItem - Index of the list view item clicked on. + // Returns: true if successful, otherwise returns false. + // Summary: This member function executes, via the Shell, the item clicked on + // in the list control. + virtual bool ShellOpenItem(int iItem); + + // Input: lplvid - Pointer to the list view item data. + // Returns: true if successful, otherwise returns false. + // Summary: This member function executes, via the Shell, the item clicked on + // in the list control. + virtual bool ShellOpenItem(XT_LVITEMDATA* lplvid); + + // Input: iItem - Index of the list view item to get the path of. + // strItemPath - Reference to a CString object that receives the path string. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function retrieves the path for the specified list view + // item. + virtual BOOL GetItemPath(int iItem,CString &strItemPath); + + // Summary: This member function creates default columns for the list view. + virtual void BuildDefaultColumns(); + + // Input: nCol - Passed in from the control. The index of the column clicked. + // bAscending - Passed in from the control. true if the sort order should be ascending. + // Returns: true if successful, otherwise returns false. + // Summary: Override this member function in your derived class to perform custom + // sort routines. + virtual bool SortList(int nCol,bool bAscending ); + + // Ignore: + //{{AFX_VIRTUAL(CXTShellListView) + public: + virtual void OnInitialUpdate(); + protected: + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); + //}}AFX_VIRTUAL + + virtual void OnDragDrop(NM_LISTVIEW* pNMListView); + virtual TCHAR* InsertCommas(LONGLONG value, TCHAR* szBufferOut, UINT nSize); + +protected: + + // Input: iItem - Index of the item to set the attributes for. + // dwAttributes - Flags retrieved from SHELLFOLDER::GetAttributesOf. + // Summary: This member function sets the shell attribute flags for the specified + // list item. + virtual void SetAttributes(int iItem,DWORD dwAttributes); + + // Ignore: + //{{AFX_MSG(CXTShellListView) + afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginRDrag(NMHDR* pNMHDR, LRESULT* pResult); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTShellListView::SetEnumFlags(UINT uFlags) { + m_uFlags = uFlags; +} +AFX_INLINE void CXTShellListView::EnableContextMenu(BOOL bEnable) { + m_bContextMenu = bEnable; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // __XTSHELLLISTVIEW_H__ \ No newline at end of file diff --git a/Editor/XT/Include/XTShellPidl.h b/Editor/XT/Include/XTShellPidl.h new file mode 100644 index 0000000..94863b1 --- /dev/null +++ b/Editor/XT/Include/XTShellPidl.h @@ -0,0 +1,162 @@ +// XTShellPidl.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#ifndef __XTSHELLPIDL_H__ +#define __XTSHELLPIDL_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +LRESULT CALLBACK HookWndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp); + +////////////////////////////////////////////////////////////////////// +// Summary: CXTShellPidl is a stand alone base class. This class is used by the +// shell tree and list controls to handle PIDL creation and management. +class _XT_EXT_CLASS CXTShellPidl +{ +public: + + // Summary: Constructs a CXTShellPidl object. + CXTShellPidl(); + + // Summary: Destroys a CXTShellPidl object, handles cleanup and de-allocation. + virtual ~CXTShellPidl(); + +public: + + // Input: path - File system path string. + // Returns: A pointer to an item ID list. Returns NULL if it fails. + // Summary: This member function gets the fully qualified PIDL for the path string. + LPITEMIDLIST IDLFromPath(CString path); + + // Input: pidlPath - Fully qualified PIDL. + // Returns: A fully qualified parent PIDL. + // Summary: This member function performs the OneUp or back function. + LPITEMIDLIST OneUpPIDL(LPITEMIDLIST pidlPath); + + // Input: path - Path string. + // Returns: A path string to the parent. + // Summary: This member function gets the parent folder using PIDLs. + CString OneUpPATH(CString path); + + // Input: pidl - PIDL list. + // Returns: A pointer to the last IDL in the list. + // Summary: This member function walks an ITEMIDLIST and points to the last one. + LPITEMIDLIST GetLastITEM(LPITEMIDLIST pidl); + + // Input: pidl - Pointer to an ITEMIDLIST. + // Returns: A new pointer to a copy of the PIDL. + // Summary: This member function copies a whole ITEMIDLIST. Remember to Free() + // the old one if it is no longer needed. + LPITEMIDLIST CopyIDList(LPITEMIDLIST pidl); + + // Input: pidl1 - Pointer to an item ID list. + // pidl2 - Pointer to an item ID list. + // Returns: A pointer to an item ID list. + // Summary: This member function concatenates two PIDLs. + LPITEMIDLIST ConcatPidls(LPCITEMIDLIST pidl1,LPCITEMIDLIST pidl2); + + // Input: lpsf - Pointer to the parent shell folder. + // lpi - Pointer to the item ID that is relative to 'lpsf'. + // Returns: A pointer to an item ID list. + // Summary: This member function gets the fully qualified PIDLs for the specified + // folder. + LPITEMIDLIST GetFullyQualPidl(LPSHELLFOLDER lpsf,LPITEMIDLIST lpi); + + // Input: lpMalloc - Points to the shell’s IMalloc interface. + // lpi - Pointer to item ID that is to be copied. + // Returns: A pointer to an item ID list. + // Summary: This member function copies the ITEMID. + LPITEMIDLIST DuplicateItem(LPMALLOC lpMalloc,LPITEMIDLIST lpi); + + // Input: lpsf - Pointer to the parent shell folder. + // lpi - Pointer to the item ID that is relative to 'lpsf'. + // dwFlags - Flags to determine which value to return. See SHGNO for more details. + // lpFriendlyName - Buffer to receive the friendly name of the folder. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function gets the friendly name for the folder or file. + BOOL GetName(LPSHELLFOLDER lpsf,LPITEMIDLIST lpi,DWORD dwFlags,TCHAR* lpFriendlyName); + + // Input: cbSize - Initial size of the PIDL. + // Returns: A pointer to an item ID list. + // Summary: This member function allocates a PIDL. + LPITEMIDLIST CreatePidl(UINT cbSize); + + // Input: pidl - Pointer to an item ID list. + // Returns: The number of item IDs in the list. + // Summary: This member function computes the number of item IDs in an item ID + // list. + UINT GetPidlItemCount(LPCITEMIDLIST pidl); + + // Input: pidl - Pointer to an item ID list. + // Returns: A pointer to the next PIDL item in the list. + // Summary: This member function gets the next PIDL in the list. + LPITEMIDLIST GetNextPidlItem(LPCITEMIDLIST pidl); + + // Input: hwnd - Context menu owner. + // lpsfParent - Pointer to the parent shell folder. + // lpi - Pointer to the item ID that is relative to 'lpsfParent'. + // nCount - Number of PIDLs. + // lppt - Screen location of where to popup the menu. + // Returns: TRUE on success, or FALSE on failure. + // Summary: This member function displays a popup context menu, given a parent + // shell folder, relative item ID, and screen location. + BOOL ShowContextMenu(HWND hwnd,LPSHELLFOLDER lpsfParent,LPCITEMIDLIST *lpi,int nCount,LPPOINT lppt); + + // Input: hwnd - Context menu owner. + // lpsfParent - Pointer to the parent shell folder. + // lpi - Pointer to the item ID that is relative to 'lpsfParent'. + // lppt - Screen location of where to popup the menu. + // Returns: TRUE on success, or FALSE on failure. + // Summary: This member function displays a popup context menu, given a parent + // shell folder, relative item ID, and screen location. + BOOL ShowContextMenu(HWND hwnd,LPSHELLFOLDER lpsfParent,LPITEMIDLIST lpi,LPPOINT lppt); + + // Input: lpi - Fully qualified item ID list for the current item. + // uFlags - Flags for SHGetFileInfo(). + // Returns: An icon index for the current item. + // Summary: This member function gets the index for the current icon. Index is + // the index into the system image list. + int GetItemIcon(LPITEMIDLIST lpi,UINT uFlags); + + // Input: psfFolder - A pointer to a valid IShellFolder data type. + // localPidl - A pointer to a valid _ITEMIDLIST structure. + // nCount - Number of items in the context menu. + // ppCM - Long pointer to a CONTEXTMENU struct. + // pcmType - A pointer to a valid int data type that represents the version number + // of the context menu. + // Returns: An HRESULT value. + // Summary: This member function gets the IContextMenu, IContextMenu2 or IContextMenu3 + // interface. + HRESULT GetSHContextMenu(LPSHELLFOLDER psfFolder,LPCITEMIDLIST *localPidl,int nCount,void** ppCM,int* pcmType); + +protected: + virtual void OnShowContextMenu(int idCmd, CMINVOKECOMMANDINFO& cmi); + +private: + + static WNDPROC m_pOldWndProc; // regular window proc + static LPCONTEXTMENU2 m_pIContext2; // active shell context menu + + static LRESULT CALLBACK HookWndProc( + HWND hWnd, + UINT msg, + WPARAM wp, + LPARAM lp); + +}; + +////////////////////////////////////////////////////////////////////// + +#endif // __XTSHELLPIDL_H__ diff --git a/Editor/XT/Include/XTShellSettings.h b/Editor/XT/Include/XTShellSettings.h new file mode 100644 index 0000000..481735d --- /dev/null +++ b/Editor/XT/Include/XTShellSettings.h @@ -0,0 +1,139 @@ +// XTShellSettings.h: interface for the CXTShellSettings class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTSHELLSETTINGS_H__) +#define __XTSHELLSETTINGS_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTShellSettings is a SHELLFLAGSTATE struct derived class. CXTShellSettings +// extends the SHELLFLAGSTATE struct for easy access to the shell flag +// state settings. +class _XT_EXT_CLASS CXTShellSettings : public SHELLFLAGSTATE +{ +public: + + // Summary: Constructs a CXTShellSettings object. + CXTShellSettings(); + + // Summary: Destroys a CXTShellSettings object, handles cleanup and de-allocation. + virtual ~CXTShellSettings(); + +public: + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Show All Files option is + // enabled. + bool ShowAllFiles(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Hide File Extensions for + // Known File Types option is disabled. + bool ShowExtensions(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Display Delete Confirmation + // Dialog box in the Recycle Bin is enabled. + bool NoConfirmRecycle(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Do Not Show Hidden Files + // option is selected. + bool ShowSysFiles(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Display Compressed Files + // and Folders with Alternate Color option is enabled. + bool ShowCompColor(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Double-Click to Open an + // Item option is enabled. + bool DoubleClickOpen(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Active Desktop – View as + // Web Page option is enabled. + bool HTMLDesktop(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Classic Style option is + // enabled. + bool Win95Classic(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Allow All Uppercase Names + // option is enabled. + bool AllowUpperCase(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Show File Attributes in + // Detail View option is enabled. + bool ShowAttributes(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Show Map Network Drive + // Button in Toolbar option is enabled. + bool ShowMapNetworkDrive(); + + // Returns: true if enabled, otherwise returns false. + // Summary: This member function checks to see if the Show Info Tips for Items + // in Folders & Desktop option is enabled. + bool ShowInfoTips(); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE bool CXTShellSettings::ShowAllFiles() { + return fShowAllObjects != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::ShowExtensions() { + return fShowExtensions != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::NoConfirmRecycle() { + return fNoConfirmRecycle != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::ShowSysFiles() { + return fShowSysFiles != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::ShowCompColor() { + return fShowCompColor != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::DoubleClickOpen() { + return fDoubleClickInWebView != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::HTMLDesktop() { + return fDesktopHTML != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::Win95Classic() { + return fWin95Classic != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::AllowUpperCase() { + return fDontPrettyPath != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::ShowAttributes() { + return fShowAttribCol != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::ShowMapNetworkDrive() { + return fMapNetDrvBtn != 0 ? true : false; +} +AFX_INLINE bool CXTShellSettings::ShowInfoTips() { + return fShowInfoTip != 0 ? true : false; +} + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTSHELLSETTINGS_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTShellTreeCtrl.h b/Editor/XT/Include/XTShellTreeCtrl.h new file mode 100644 index 0000000..34f05b3 --- /dev/null +++ b/Editor/XT/Include/XTShellTreeCtrl.h @@ -0,0 +1,250 @@ +// XTShellTreeCtrl.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTSHELLTREECTRL_H__) +#define __XTSHELLTREECTRL_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTShellTreeCtrl is a multiple inheritance class derived from CXTTreeCtrl +// and CXTShellPidl. CXTShellTreeCtrl is used to create a tree control +// that displays an explorer style tree, and can be associated with a combo box +// and list control. +class _XT_EXT_CLASS CXTShellTreeCtrl : public CXTTreeCtrl, public CXTShellPidl +{ + +public: + + // Summary: Constructs a CXTShellTreeCtrl object. + CXTShellTreeCtrl(); + + // Summary: Destroys a CXTShellTreeCtrl object, handles cleanup and de-allocation. + virtual ~CXTShellTreeCtrl(); + +protected: + + UINT m_uFlags; // Flags indicating which items to include in the enumeration. + BOOL m_bContextMenu; // TRUE to display the shell context menu on right item click. + BOOL m_bAutoInit; // TRUE if the tree control is to initialize when created. + BOOL m_bContentInitPending; // TRUE if content initialization is pending. + BOOL m_bTunnelPath; // TRUE if tunnel initialization is pending. + bool m_bTunneling; // true if tree is currently traversing. + CWnd* m_pListCtrl; // Window that receives the update notification, usually a CXTShellListCtrl. + CWnd* m_pComboBox; // CComboBox that is associated with this control. See AssociateCombo(...) + CString m_strTunnelPath; // Current path to tunnel if tree initialization is still pending. Valid if 'm_bTunnelPath' is TRUE. + CXTShellSettings m_shSettings; // Contains SHELLFLAGSTATE info. + + // Summary: Enumeration that holds the type of object, folder or drive. + enum FindAttribs + { + type_drive, // The object type is a drive. + type_folder // The object type is a folder. + }; + + // Input: lpsf - Pointer to the parent shell folder. + // lpifq - Fully qualified item ID list to the item having items enumerated. + // This is the PIDL to the item identified by the 'lpsf' parameter. + // hParent - Parent tree node. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function fills a branch of the TreeView control. Given + // the shell folder, it enumerates the subitems of this folder, and adds + // the appropriate items to the tree. + virtual BOOL InitTreeViewItems(LPSHELLFOLDER lpsf,LPITEMIDLIST lpifq,HTREEITEM hParent); + + // Input: lpifq - Fully qualified item ID list for the current item. + // lptvitem - Pointer to the tree view item being added to the tree. + // Summary: This member function gets the index for the normal and selected + // icons for the current item. + virtual void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTV_ITEM lptvitem); + +public: + + // Input: bEnable - TRUE if the tree initializes upon creation. + // Summary: Call this member function to enable or disable auto-initialization + // of the shell tree control. + void EnableAutoInit(BOOL bEnable); + + // Input: bEnable - TRUE to display a context menu. + // Summary: Call this member function to enable or disable the display of the + // shell context menu on right item click. + void EnableContextMenu(BOOL bEnable); + + // BULLETED LIST: + + // Input: uFlags - Determines the type of items included in an enumeration. It can + // be one or more of the following: + // [ul] + // [li]SHCONTF_FOLDERS Include items that are folders in + // the enumeration.[/li] + // [li]SHCONTF_NONFOLDERS Include items that are not folders + // in the enumeration.[/li] + // [li]SHCONTF_INCLUDEHIDDEN Include hidden items in the + // enumeration.[/li] + // [li]SHCONTF_INIT_ON_FIRST_NEXT IShellFolder::EnumObjects + // can return without validating the enumeration object. Validation + // can be postponed until the first call to IEnumIDList::Next. + // This flag is intended to be used when a user interface may be + // displayed prior to the first IEnumIDList::Next call. For a + // user interface to be presented, 'hwndOwner' must be set to a valid + // window handle.[/li] + // [li]SHCONTF_NETPRINTERSRCH The caller is looking for + // printer objects.[/li] + // [/ul] + // Summary: Call this member function to determine the type of items included + // in the shell enumeration. The default is SHCONTF_FOLDERS | SHCONTF_NONFOLDERS. + void SetEnumFlags(UINT uFlags); + + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function obtains a handle to the system image list and + // attaches it to the tree control. + virtual BOOL InitSystemImageLists(); + + // Summary: This member function adds items to the tree view. + virtual void PopulateTreeView(); + + // Input: pNMTreeView - Address of an NM_TREEVIEW struct. + // Summary: This member function responds to a TVN_ITEMEXPANDING message in + // order to fill up subdirectories. + virtual void OnFolderExpanding(NM_TREEVIEW* pNMTreeView); + + // Returns: A handle to the currently selected HTREEITEM. + // Summary: This member function displays the system popup menu for the selected + // item or folder. + virtual HTREEITEM GetContextMenu(); + + // Input: pNMTreeView - Address of an NM_TREEVIEW struct. + // strFolderPath - Address of a CString object to receive the file system path. + // Returns: TRUE if the folder path was found, otherwise returns FALSE. + // Summary: This member function responds to a TVN_SELCHANGED message to retrieve + // the specified folder path. + virtual BOOL OnFolderSelected(NM_TREEVIEW* pNMTreeView,CString &strFolderPath); + + // Input: strFolderPath - Address of a CString object to receive the file system path. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function retrieves the path of the currently selected + // tree item. + virtual BOOL GetSelectedFolderPath(CString &strFolderPath); + + // Input: hItem - Handle to the tree item to search from. + // lplvid - Pointer to the list view item data. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function recursively searches the tree control, beginning + // at 'hItem', to find the item specified by 'lplvid'. This is typically used when + // the user double clicks an item in the list view. + virtual BOOL FindTreeItem(HTREEITEM hItem,XT_LVITEMDATA* lplvid); + + // Input: pWnd - Points to the list control that is associated with the tree. + // Summary: Call this member function to associate the list control with the tree. + virtual void AssociateList(CWnd* pWnd); + + // Input: pWnd - Points to the combo box that is associated with the tree. + // Summary: This member function is used to associate a CComboBox object with + // the control. Whenever the path changes, the combo is updated. + virtual void AssociateCombo(CWnd* pWnd); + + // Input: hItem - Handle to a tree node. + // lptvid - Pointer to the list view item data. + // Summary: This member function is called to initialize a branch of the shell + // tree. + virtual void InitTreeNode(HTREEITEM hItem,XT_TVITEMDATA* lptvid); + + // Input: hItem - Tree item to begin the search from. + // strSearchName - String to search for. + // attr - Looking for folder or drive. + // bFindRoot - TRUE to look for the drive letter only. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function searches the tree for a specified folder. + virtual BOOL SearchTree(HTREEITEM hItem,CString strSearchName,FindAttribs attr,BOOL bFindRoot=FALSE); + + // Input: strFindPath - Path to find. + // Summary: This member function will "tunnel" the tree to find the specified + // path. This will only work when the PopulateTreeView() method is used + // to populate the tree. + virtual void TunnelTree(CString strFindPath); + + // Input: hItem - Tree item to get path for. + // strFolderPath - Reference to a CString object to contain the folder path. + // Returns: TRUE if the path is not in the file system(e.g. + // MyComputer), or if none is selected, it returns FALSE. + // Summary: This member function retrieves the path of a folder item, which + // does not have to be selected. Pass a CString object that will hold + // the folder path. + virtual BOOL GetFolderItemPath(HTREEITEM hItem,CString &strFolderPath); + + // Input: lpszPath - Path to populate. + // Summary: This member function populates a tree based upon a path. + virtual void PopulateTree(LPCTSTR lpszPath); + + // Ignore: + //{{AFX_VIRTUAL(CXTShellTreeCtrl) + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + + virtual void OnDragDrop(NM_TREEVIEW* pNMTreeView); + +protected: + + // Input: hItem - Handle to HTREEITEM node. + // dwAttributes - Flags retrieved from SHELLFOLDER::GetAttributesOf. + // Summary: This member function sets the shell attribute flags for the specified + // tree item. + void SetAttributes(HTREEITEM hItem,DWORD dwAttributes); + + virtual void DelayContentInit(); + virtual void ProcessContentInit(); + virtual HTREEITEM InsertDesktopItem(); + + // Ignore: + //{{AFX_MSG(CXTShellTreeCtrl) + afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginRDrag(NMHDR* pNMHDR, LRESULT* pResult); + //}}AFX_MSG + + afx_msg LRESULT OnUpdateShell(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +#define CXTShellTree CXTShellTreeCtrl + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTShellTreeCtrl::SetEnumFlags(UINT uFlags) { + m_uFlags = uFlags; +} +AFX_INLINE void CXTShellTreeCtrl::EnableContextMenu(BOOL bEnable) { + m_bContextMenu = bEnable; +} +AFX_INLINE void CXTShellTreeCtrl::EnableAutoInit(BOOL bEnable) { + m_bAutoInit = bEnable; +} +AFX_INLINE void CXTShellTreeCtrl::AssociateList(CWnd* pWnd) { + ASSERT_VALID(pWnd); m_pListCtrl = pWnd; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTSHELLTREECTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTShellTreeView.h b/Editor/XT/Include/XTShellTreeView.h new file mode 100644 index 0000000..4db2386 --- /dev/null +++ b/Editor/XT/Include/XTShellTreeView.h @@ -0,0 +1,225 @@ +// XTShellTreeView.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#ifndef __XTSHELLTREEVIEW_H__ +#define __XTSHELLTREEVIEW_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTShellTreeView is a multiple inheritance class derived from CXTTreeView +// and CXTShellPidl. It is used to create a CXTShellTreeView class object. +class _XT_EXT_CLASS CXTShellTreeView : public CXTTreeView, public CXTShellPidl +{ + DECLARE_DYNCREATE(CXTShellTreeView) + +public: + + // Summary: Constructs a CXTShellTreeView object. + CXTShellTreeView(); + + // Summary: Destroys a CXTShellTreeView object, handles cleanup and de-allocation. + virtual ~CXTShellTreeView(); + +protected: + + UINT m_uFlags; // Flags indicating which items to include in the enumeration. + bool m_bTunneling; // true if tree is currently traversing. + BOOL m_bContextMenu; // TRUE to display the shell context menu on right item click. + CWnd* m_pComboBox; // CComboBox that is associated with this control. See AssociateCombo(...) + CXTShellSettings m_shSettings; // Contains SHELLFLAGSTATE info. + + // Summary: Enumeration that holds the type of object, folder or drive. + enum FindAttribs + { + type_drive, // The object type is a drive. + type_folder // The object type is a folder. + }; + + // Input: lpsf - Pointer to the parent shell folder. + // lpifq - Fully qualified item ID list to the item having items enumerated. + // This is the PIDL to the item identified by the 'lpsf' parameter. + // hParent - Parent tree node. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function fills a branch of the TreeView control. Given + // the shell folder, it enumerates the subitems of this folder, and adds + // the appropriate items to the tree. + virtual BOOL InitTreeViewItems(LPSHELLFOLDER lpsf,LPITEMIDLIST lpifq,HTREEITEM hParent); + + // Input: lpifq - Fully qualified item ID list for the current item. + // lptvitem - Pointer to the tree view item being added to the tree. + // Summary: This member function gets the index for the normal and selected + // icons for the current item. + virtual void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTV_ITEM lptvitem); + +public: + + // Input: bEnable - TRUE to display a context menu. + // Summary: Call this member function to enable or disable the display of the + // shell context menu on right item click. + void EnableContextMenu(BOOL bEnable); + + // BULLETED LIST: + + // Input: uFlags - Determines the type of items included in an enumeration. It + // can be one or more of the following: + // [ul] + // [li]SHCONTF_FOLDERS Include items that are folders in + // the enumeration.[/li] + // [li]SHCONTF_NONFOLDERS Include items that are not folders + // in the enumeration.[/li] + // [li]SHCONTF_INCLUDEHIDDEN Include hidden items in the + // enumeration.[/li] + // [li]SHCONTF_INIT_ON_FIRST_NEXT IShellFolder::EnumObjects + // can return without validating the enumeration object. Validation + // can be postponed until the first call to IEnumIDList::Next. + // This flag is intended to be used when a user interface may be + // displayed prior to the first IEnumIDList::Next call. For a + // user interface to be presented, 'hwndOwner' must be set to a valid + // window handle.[/li] + // [li]SHCONTF_NETPRINTERSRCH The caller is looking for + // printer objects.[/li] + // [/ul] + // Summary: Call this member function to determine the type of items included + // in the shell enumeration. The default is SHCONTF_FOLDERS | SHCONTF_NONFOLDERS. + void SetEnumFlags(UINT uFlags); + + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function obtains a handle to the system image list and + // attaches it to the tree control. + virtual BOOL InitSystemImageLists(); + + // Summary: This member function adds items to the tree view. + virtual void PopulateTreeView(); + + // Input: pNMTreeView - Address of an NM_TREEVIEW struct. + // Summary: This member function responds to a TVN_ITEMEXPANDING message in + // order to fill up subdirectories. + virtual void OnFolderExpanding(NM_TREEVIEW* pNMTreeView); + + // Returns: A handle to the currently selected HTREEITEM. + // Summary: This member function displays the system popup menu for the selected + // item or folder. + virtual HTREEITEM GetContextMenu(); + + // Input: pNMTreeView - Address of an NM_TREEVIEW struct. + // strFolderPath - Address of a CString object to receive the file system path. + // Returns: TRUE if the folder path was found, otherwise returns FALSE. + // Summary: This member function responds to a TVN_SELCHANGED message to retrieve + // the specified folder path. + virtual BOOL OnFolderSelected(NM_TREEVIEW* pNMTreeView,CString &strFolderPath); + + // Input: strFolderPath - Address of a CString object to receive the file system path. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function retrieves the path of the currently selected + // tree item. + virtual BOOL GetSelectedFolderPath(CString &strFolderPath); + + // Input: hItem - Handle to the tree item to search from. + // lplvid - Pointer to the list view item data. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function recursively searches the tree control, beginning + // at 'hItem', to find the item specified by 'lplvid'. This is typically used when + // the user double clicks an item in the list view. + virtual BOOL FindTreeItem(HTREEITEM hItem,XT_LVITEMDATA* lplvid); + + // Input: pWnd - Points to the combo box that is associated with the tree. + // Summary: This member function is used to associate a CComboBox object with + // the control. Whenever the path changes, the combo is updated. + virtual void AssociateCombo(CWnd* pWnd); + + // Input: hItem - Handle to a tree node. + // lptvid - Pointer to the list view item data. + // Summary: This member function is called to initialize a branch of the shell + // tree. + virtual void InitTreeNode(HTREEITEM hItem,XT_TVITEMDATA* lptvid); + + // Input: hItem - Tree item to begin the search from. + // strSearchName - String to search for. + // attr - Looking for folder or drive. + // bFindRoot - TRUE to look for a drive letter only. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function searches the tree for a specified folder. + virtual BOOL SearchTree(HTREEITEM hItem,CString strSearchName,FindAttribs attr,BOOL bFindRoot=FALSE); + + // Input: strFindPath - Path to find. + // Summary: This member function will "tunnel" the tree to find the specified + // path. This will only work when the PopulateTreeView() method is used + // to populate the tree. + virtual void TunnelTree(CString strFindPath); + + // Input: hItem - Tree item to get the path for. + // strFolderPath - Reference to a CString object to contain the folder path. + // Returns: TRUE if the path is not in the file system(e.g. + // MyComputer), or if none is selected, it returns FALSE. + // Summary: This member function retrieves the path of a folder item, which + // does not have to be selected. Pass a CString object that will hold + // the folder path. + virtual BOOL GetFolderItemPath(HTREEITEM hItem,CString &strFolderPath); + + // Input: lpszPath - Path to populate. + // Summary: This member function populates a tree based upon a path. + virtual void PopulateTree(LPCTSTR lpszPath); + + // Ignore: + //{{AFX_VIRTUAL(CXTShellTreeView) + public: + virtual void OnInitialUpdate(); + protected: + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); + //}}AFX_VIRTUAL + + virtual void OnDragDrop(NM_TREEVIEW* pNMTreeView); + virtual HTREEITEM InsertDesktopItem(); + +protected: + + // Input: hItem - Handle to HTREEITEM node. + // dwAttributes - Flags retrieved from SHELLFOLDER::GetAttributesOf. + // Summary: This member function sets the shell attribute flags for the specified + // tree item. + void SetAttributes(HTREEITEM hItem,DWORD dwAttributes); + + // Ignore: + //{{AFX_MSG(CXTShellTreeView) + afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + //}}AFX_MSG + + afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginRDrag(NMHDR* pNMHDR, LRESULT* pResult); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTShellTreeView::SetEnumFlags(UINT uFlags) { + m_uFlags = uFlags; +} +AFX_INLINE void CXTShellTreeView::EnableContextMenu(BOOL bEnable) { + m_bContextMenu = bEnable; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // __XTSHELLTREEVIEW_H__ \ No newline at end of file diff --git a/Editor/XT/Include/XTSkins.h b/Editor/XT/Include/XTSkins.h new file mode 100644 index 0000000..77b3dcb --- /dev/null +++ b/Editor/XT/Include/XTSkins.h @@ -0,0 +1,152 @@ +// XTSkins.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTSKINS_H__) +#define __XTSKINS_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// forwards + +class CXTToolBar; +class CXTFlatEdit; +class CXTFlatComboBox; +class CXTCommandsListBox; + +////////////////////////////////////////////////////////////////////// +// Summary: IXTFlatComboProxy is a stand alone interface class. It is an API for +// skin related operations for a flat combo. +interface IXTFlatComboProxy +{ + // Input: pCombo - CXTFlatComboBox pointer to the combo to draw. + // pDC - CDC pointer to the device context to render on. + // bHilight - Flag that tells if the combo must be highlighted. + // Summary: This member function renders the appearance of the combo box. + virtual void DrawCombo(CXTFlatComboBox* pCombo,CDC* pDC,BOOL bHilight) = 0; +}; + +////////////////////////////////////////////////////////////////////// +// Summary: IXTFlatEditProxy is a stand alone interface class. It is an API for +// skin related operations for a flat edit. +interface IXTFlatEditProxy +{ + + // Input: pCombo - CXTFlatEdit pointer to the combo to draw. + // pDC - CDC pointer to the device context to render on. + // bHilight - Flag that tells if the combo must be highlighted. + // Summary: This member function renders the appearance of the combo box. + virtual void DrawEdit(CXTFlatEdit* pCombo,CDC* pDC,BOOL bHilight) = 0; +}; + +////////////////////////////////////////////////////////////////////// +// Summary: IXTToolbarProxy is a stand alone interface class. It is used to create +// an API for skin related operations for a toolbar item. +interface IXTToolbarProxy +{ + + // Input: pDC - CDC pointer to the device context to draw on. + // pOwner - CXTToolBar pointer to a toolbar whose item is being drawn. + // nIndex - Index of the item (a button) to draw. + // Summary: This member function fills in a rectangle allocated to a toolbar control. + virtual void FillControlRect(CDC* pDC,CXTToolBar* pOwner,UINT nIndex) = 0; + + // Input: pDC - CDC pointer to the device context to draw on. + // pOwner - CXTToolBar pointer to a toolbar whose item is being drawn. + // nIndex - Index of the item (a button) to draw. + // Returns: TRUE if the item has been drawn, or returns FALSE otherwise. + // Summary: This member function draws a toolbar item. + virtual BOOL DrawButton(CDC* pDC,CXTToolBar* pOwner,UINT nIndex) = 0; + + // Input: pDC - CDC pointer to the device context to draw on. + // pOwner - CXTToolBar pointer to a toolbar whose item is being drawn. + // nIndex - Index of the item (separator) to draw. + // Summary: This member function draws a toolbar separator. + virtual void DrawSeparator(CDC* pDC,CXTToolBar* pOwner,UINT nIndex) = 0; + + // Input: pDC - CDC pointer to the device context to draw on. + // pOwner - CXTToolBar pointer to a toolbar whose item is being drawn. + // nIndex - Index of the item (button) to draw. + // Summary: This member function draws special effects for a dropped item (shadow). + virtual void DrawDroppedEffects(CDC* pDC,CXTToolBar* pOwner,UINT nIndex) = 0; + + // Input: pOwner - CXTToolBar pointer to a toolbar that needs to be refreshed. + // nIndex - Index of the item (button) to refresh. + // Summary: This member function removes special effects around a selected item. + virtual void RemoveDroppedEffects(CXTToolBar* pOwner,UINT nIndex) = 0; + +}; + +////////////////////////////////////////////////////////////////////// +// Summary: IXTCommandsListBoxProxy is a stand alone interface class. It is used to create +// an API for skin related operations for the commands list box. +interface IXTCommandsListBoxProxy +{ + + // Input: lpDIS - LPDRAWITEMSTRUCT pointer that contains information about the + // item being drawn. + // pOwner - CXTCommandsListBox pointer to the commands list box whose item + // is being drawn. + // Summary: This member function draws each item in the commands list box. + virtual void OnDrawItem(LPDRAWITEMSTRUCT lpDIS,CXTCommandsListBox* pOwner) = 0; + + // Input: pOwner - CXTCommandsListBox pointer to the commands list box that needs + // to be refreshed. + // Summary: This member function paints the background and handles default + // drawing for the commands list box. + virtual void OnPaint(CXTCommandsListBox* pOwner) = 0; +}; + +////////////////////////////////////////////////////////////////////// +// Summary: IXTSkin is a stand alone interface class. It is used to create a skin +// for rendering UI elements. +interface IXTSkin +{ + + // Returns: A proxy for drawing a flat edit control. + // Summary: This member function is used to get a proxy for drawing a flat edit + // control. Implementation can return NULL to indicate default control + // behavior shall be used. + virtual IXTFlatEditProxy* GetFlatEditProxy() = 0; + + // Returns: A proxy for drawing a flat combo box. + // Summary: This member function is used to get a proxy for drawing a flat combo + // box. Implementation can return NULL to indicate default control behavior + // shall be used. + virtual IXTFlatComboProxy* GetFlatComboProxy() = 0; + + // Returns: A proxy for drawing a toolbar button. + // Summary: This member function is used to get a proxy for drawing a toolbar + // button. Implementation can return NULL to indicate default control + // behaviour shall be used. + virtual IXTToolbarProxy* GetToolbarProxy() = 0; + + // Returns: A proxy for drawing a commands list box. + // Summary: This member function is used to get a proxy for drawing a commands list box + // control. Implementation can return NULL to indicate default control + // behavior shall be used. + virtual IXTCommandsListBoxProxy* GetCommandsListBoxProxy() = 0; + + // Input: bTracking - Flag designating current operation state. TRUE if tracking + // toolbar is pending, or FALSE otherwise. + // Summary: This member function notifies that a toolbar is currently being + // dragged or resized. + virtual void NotifyToolbarTracking(BOOL bTracking) = 0; + + // Returns: An IXTSkin pointer. + // Summary: This member function is a singleton type instantiation. + static _XT_EXT_CLASS IXTSkin* GetInstance(); +}; + +#endif // !defined(__XTSKINS_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTSortClass.h b/Editor/XT/Include/XTSortClass.h new file mode 100644 index 0000000..d079aef --- /dev/null +++ b/Editor/XT/Include/XTSortClass.h @@ -0,0 +1,96 @@ +// XTSortClass.h interface for the CXTSortClass class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTSORTCLASS_H__) +#define __XTSORTCLASS_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: XT_DATA_TYPE - Enumeration used by CXTSortClass for specifying what +// type of sorting to perform. +typedef enum XT_DATA_TYPE +{ + DT_INT = 1, // Sort type int. + DT_STRING, // Sort type string. + DT_DATETIME, // Sort type date / time. + DT_DEC // Sort type decimal. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTSortClass is a stand alone class. This class will sort a list control +// by a column of text, integer, float or date/time type. It could be +// easily extended for other data types. To use this class, instantiate +// a CXTSortClass object, passing in a pointer to the list control as +// the first argument and the column index as the second argument. +// +// Example:
CXTSortClass sortClass(pListCtrl, 0);
+// +// Then call the sort method setting ascending as the first argument either +// TRUE or FALSE, and the type of sort to perform in the second argument. +// +// Example:
sortClass.Sort(TRUE, DT_STRING);
+class _XT_EXT_CLASS CXTSortClass +{ + +public: + + // Input: pListCtrl - Pointer to a CListCtrl object. + // nCol - Index of the column to be sorted. + // Summary: Constructs a CXTSortClass object. + CXTSortClass(CListCtrl* pListCtrl,const int nCol); + + // Summary: Destroys a CXTSortClass object, handles cleanup and de-allocation. + virtual ~CXTSortClass(); + +protected: + + CListCtrl* m_pListCtrl; // Pointer to the CListCtrl object to perform the sort on. + +public: + + // BULLETED LIST: + + // Input: bAsc - true to sort ascending. + // eType - The type of sort to perform can be one of the following: + // [ul] + // [li]DT_INT Sort type int.[/li] + // [li]DT_STRING Sort type string.[/li] + // [li]DT_DATETIME Sort type date / time.[/li] + // [li]DT_DEC Sort type decimal.[/li] + // [/ul] + // Summary: This member function is called to perform the actual sort procedure. + virtual void Sort(bool bAsc,XT_DATA_TYPE eType); + +protected: + + // Input: lParam1 - Specify the item data for the two items being compared. + // lParam2 - Specify the item data for the two items being compared. + // lParamSort - Specifies the application defined value that is passed to the + // comparison function. + // Summary: This callback member function is called to compare two data items during + // sorting operations. The comparison function must return a negative + // value if the first item should precede the second, and a positive value + // if the first item should follow the second, or zero if the two items + // are equivalent. + static int CALLBACK Compare(LPARAM lParam1,LPARAM lParam2,LPARAM lParamSort); +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTSORTCLASS_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTSplitterDock.h b/Editor/XT/Include/XTSplitterDock.h new file mode 100644 index 0000000..4bb1ffd --- /dev/null +++ b/Editor/XT/Include/XTSplitterDock.h @@ -0,0 +1,163 @@ +// XTSplitterDock.h interface for the CXTSplitterRowDock class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTSPLITTERDOCK_H__) +#define __XTSPLITTERDOCK_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// class forwards. + +class CXTDockBar; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTSplitterDock is a stand alone base class. It is used to create a +// CXTSplitterDock class object. +class _XT_EXT_CLASS CXTSplitterDock +{ +public: + + // Input: pBar - A pointer to a valid CXTDockBar object. + // rcCurrent - A reference to a valid CRect object. + // bar - Type of splitter bar, either XT_SPLITTER_VERT or XT_SPLITTER_HORZ. + // nPos - Index into a control bar array. + // Summary: Constructs a CXTSplitterDock object. + CXTSplitterDock(CXTDockBar *pBar,const CRect &rcCurrent,const int nType,const int nPos); + + // Summary: Destroys a CXTSplitterDock object, handles clean up and de-allocation. + virtual ~CXTSplitterDock(); + + ///////////////////////////////////////////////////////////////////////// + // Current Size and Position + ///////////////////////////////////////////////////////////////////////// + + CRect m_rcCurrent; // Current size of the splitter rect. + CRect m_rcTrack; // Current size of the tracking rect. + CPoint m_ptCurrent; // Represents the current cursor position. + + ///////////////////////////////////////////////////////////////////////// + // Width of the Row + ///////////////////////////////////////////////////////////////////////// + + int m_nStartHeight; // Original height of the splitter. + int m_nCurrentHeight; // Current height of the splitter. + int m_nMaxHeight; // Maximum height for the splitter. + int m_nMinHeight; // Minimum height for the splitter. + + ///////////////////////////////////////////////////////////////////////// + // Vertical or Horizontal + ///////////////////////////////////////////////////////////////////////// + + int m_nType; // Type of splitter bar either, XT_SPLITTER_VERT or XT_SPLITTER_HORZ. + int m_nControlBar; // Index into a control bar array. + CXTDockBar* m_pDockBar; // Pointer to the dockbar. + + // Input: point - Represents the current cursor position. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to move the splitter during tracking + // operations. + virtual bool Move(CPoint point); + + // Input: point - Represents the current cursor position. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called during tracking operations. + virtual bool StartTrack(CPoint point); + + // Input: point - Represents the current cursor position. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to terminate the tracking operation. + virtual bool EndTrack(CPoint point); + + // Returns: TRUE if the splitter is horizontal, otherwise returns FALSE. + // Summary: This member function is called to determine if the splitter is horizontal. + BOOL IsHorz(); + + // Input: point - A reference to a valid CPoint object. + // Returns: TRUE if the cursor position specified by 'point' falls inside of the splitter + // area, otherwise returns FALSE. + // Summary: This member function is called to determine if the cursor position + // is inside of the splitter area. + BOOL HitTest(const CPoint &point); + + // Input: nLength - New size for the splitter. + // Summary: This member function is called to set the length for the splitter. + void SetLength(int nLength); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to display the tracking rect when the + // splitter is moved. + bool OnInvertTracker(); + + // Input: pDC - A CDC pointer to a valid device context. + // Summary: This member function is called to draw the splitter during paint operations. + void Draw(CDC *pDC); + +protected: + + // Summary: This member function is called internally to set the new height for + // the splitter bar based on the current control bar size. + virtual void SetNewHeight(); + + // Summary: This member function is called internally to calculate the new height + // for the splitter bar based on the current control bar size. + virtual void CalcMaxMinHeight(); +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTSplitterRowDock is a CXTSplitterDock derived class. It is used to +// create a CXTSplitterRowDock class object. +class _XT_EXT_CLASS CXTSplitterRowDock : public CXTSplitterDock +{ +public: + + // Input: pBar - A pointer to a valid CXTDockBar object. + // rcCurrent - A reference to a valid CRect object. + // nType - Type of splitter bar, either XT_SPLITTER_VERT or XT_SPLITTER_HORZ. + // nPos - Index into a control bar array. + // Summary: Constructs a CXTSplitterRowDock object. + CXTSplitterRowDock(CXTDockBar *pBar,const CRect &rcCurrent,const int nType,const int nPos); + + // Input: point - Represents the current cursor position. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to move the splitter during tracking + // operations. + virtual bool Move(CPoint point); + +protected: + + // Summary: This member function is called internally to set the new height for + // the splitter bar based on the current control bar size. + virtual void SetNewHeight(); + + // Summary: This member function is called internally to calculate the new height + // for the splitter bar based on the current control bar size. + virtual void CalcMaxMinHeight(); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE BOOL CXTSplitterDock::IsHorz() { + return (m_nType == XT_SPLITTER_HORZ); +} +AFX_INLINE BOOL CXTSplitterDock::HitTest(const CPoint &point) { + return m_rcCurrent.PtInRect(point); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTSPLITTERDOCK_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTSplitterWnd.h b/Editor/XT/Include/XTSplitterWnd.h new file mode 100644 index 0000000..828c4bd --- /dev/null +++ b/Editor/XT/Include/XTSplitterWnd.h @@ -0,0 +1,221 @@ +// XTSplitterWnd.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTSPLITTERWND_H__) +#define __XTSPLITTERWND_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTSplitterWnd is a CSplitterWnd derived class. It adds the ability +// to hide and show splitter panes, based upon its index. +class _XT_EXT_CLASS CXTSplitterWnd : public CSplitterWnd +{ + DECLARE_DYNAMIC(CXTSplitterWnd) + +public: + + // Summary: Constructs a CXTSplitterWnd object. + CXTSplitterWnd(); + + // Summary: Destroys a CXTSplitterWnd object, handles cleanup and de-allocation. + virtual ~CXTSplitterWnd(); + +protected: + + int m_nHiddenCol; // Index of the hidden column. + int m_nHiddenRow; // Index of the hidden row. + BOOL m_bFullDrag; // TRUE if full window dragging is enabled. + BOOL m_bFlatSplit; // TRUE if the flat splitter style is used. + DWORD m_dwxStyle; // The style of the splitter window. See SetSplitterStyle(...). + CPoint m_point; // Previous cursor position. + +public: + + // Summary: This member function is called to show the column that was previously + // hidden. + virtual void ShowColumn(); + + // Input: nColHide - Index of the column to hide. + // Summary: This member function will hide a column based upon its index. + virtual void HideColumn(int nColHide); + + // Summary: This member function is called to show the row that was previously + // hidden. + virtual void ShowRow(); + + // Input: nRowHide - Index of the row to hide. + // Summary: This member function will hide a row based upon its index. + virtual void HideRow(int nRowHide); + + // Input: nRow - Specifies a row. + // nCol - Specifies a column. + // pNewView - Specifies the view to switch the specified pane with. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is called to switch, or swap, a splitter view + // with another. + virtual BOOL SwitchView(int nRow,int nCol,CView *pNewView); + + // Input: nRow - Specifies a row. + // nCol - Specifies a column. + // pViewClass - Specifies the runtime class to replace the specified pane with. + // Returns: A CView pointer to the view that was replaced, otherwise returns NULL. + // Summary: This member function is called to replace an existing splitter view + // with another. + virtual CView* ReplaceView(int nRow,int nCol,CRuntimeClass *pViewClass); + + // Input: nRow - Specifies a row. + // nCol - Specifies a column. + // pNewView - Points to an already existing view. + // Returns: A CView pointer to the view that was replaced, otherwise returns NULL. + // Summary: This member function is called to replace an existing splitter view + // with another. + virtual CView* ReplaceView(int nRow,int nCol,CView* pNewView); + + // BULLETED LIST: + + // Input: dwxStyle - Specifies XT_SPLIT_ styles to be added during style modification. + // The desired styles for the control bar can be one or more of the + // following: + // [ul] + // [li]XT_SPLIT_DOTTRACKER The splitter window will use a + // dotted tracker rather than the splitter default.[/li] + // [li]XT_SPLIT_NOFULLDRAG Disable the "Show window contents while + // dragging" option, even if it is set in Windows.[/li] + // [li]XT_SPLIT_NOBORDER The splitter window will not draw a + // border around the pane.[/li] + // [li]XT_SPLIT_NOSIZE Do not allow splitter window panes to + // be resized.[/li] + // [/ul] + // Summary: Call this member function to modify a splitter window's style. Styles + // to be added or removed can be combined by using the bitwise OR (|) + // operator. + virtual void SetSplitterStyle(DWORD dwxStyle); + + // Returns: The current style of the splitter window. + // Summary: Call this member function to return the current style for the splitter + // window. + // See Also: SetSplitterStyle() + virtual DWORD GetSplitterStyle(); + + // Input: bFlatSplitter - TRUE to enable flat splitters. + // Summary: Call this member function to enable or disable flat splitters. + virtual void EnableFlatLook(BOOL bFlatSplitter); + + // Returns: The index of the hidden column or -1 if no columns are hidden. + // Summary: Call this member function to return the index of the column that is + // currently hidden. + int GetHiddenColIndex(); + + // Returns: The index of the hidden row or -1 if no rows are hidden. + // Summary: Call this member function to return the index of the row that is + // currently hidden. + int GetHiddenRowIndex(); + + // Ignore: + //{{AFX_VIRTUAL(CXTSplitterWnd) + protected: + virtual void SetSplitCursor(int ht); + virtual void OnInvertTracker(const CRect& rect); + virtual void StartTracking(int ht); + virtual void StopTracking(BOOL bAccept); + virtual void DrawTracker(const CRect& rect, CBrush* pBrush); + virtual void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTSplitterWnd) + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE DWORD CXTSplitterWnd::GetSplitterStyle() { + return m_dwxStyle; +} +AFX_INLINE int CXTSplitterWnd::GetHiddenColIndex() { + return m_nHiddenCol; +} +AFX_INLINE int CXTSplitterWnd::GetHiddenRowIndex() { + return m_nHiddenRow; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTSplitterWndEx is a CXTSplitterWnd derived class. It can be used +// with the CXTOutBarCtrl to display a gap between the top of the splitter +// and the toolbar area. +class _XT_EXT_CLASS CXTSplitterWndEx : public CXTSplitterWnd +{ + DECLARE_DYNAMIC(CXTSplitterWndEx) + +public: + + // Summary: Constructs a CXTSplitterWndEx object. + CXTSplitterWndEx(); + + // Summary: Destroys a CXTSplitterWndEx object, handles cleanup and de-allocation. + virtual ~CXTSplitterWndEx(); + +protected: + + int m_cyTopBorderGap; // Size, in pixels, of the top border. + bool m_bShowTopBorder; // true to draw a top border line. + +public: + + // Input: bShowTopBorder - If TRUE, a white edge will be drawn along the top. + // cyTopBorderGap - Amount, in pixels, to offset the splitter edge. + // Summary: Call this member function to show a top border for the splitter + // window, similar to Outlook. Enabled by default. + virtual void ShowTopBorder(bool bShowTopBorder=true,int cyTopBorderGap=7); + + // Ignore: + //{{AFX_VIRTUAL(CXTSplitterWndEx) + //}}AFX_VIRTUAL + protected: + virtual void GetInsideRect(CRect& rect) const; + public: + virtual void RecalcLayout(); + virtual void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg); + + // Ignore: + //{{AFX_MSG(CXTSplitterWndEx) + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTSplitterWndEx::ShowTopBorder(bool bShowTopBorder, int cyTopBorderGap) { + m_bShowTopBorder = bShowTopBorder; m_cyTopBorderGap = cyTopBorderGap; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTSPLITTERWND_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTStatusBar.h b/Editor/XT/Include/XTStatusBar.h new file mode 100644 index 0000000..1d6179c --- /dev/null +++ b/Editor/XT/Include/XTStatusBar.h @@ -0,0 +1,151 @@ +// XTStatusBar.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#ifndef __XTSTATUSBAR_H__ +#define __XTSTATUSBAR_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: XT_STATUSPANE is a stand alone structure class. It is used to create +// an XT_STATUSPANE structure. +struct XT_STATUSPANE +{ + UINT nID; // IDC of indicator: 0 => normal text area. + int cxText; // Width of the string area, in pixels. On both sides there is a 3 pixel gap and a 1 pixel border, making a pane 6 pixels wider. + UINT nStyle; // Style flags (SBPS_*). + UINT nFlags; // State flags (SBPF_*). + CString strText; // Text in the pane. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_STATUSPANE_CTRL is a stand alone helper structure class. It is used +// by the CXTStatusBar class. +struct XT_STATUSPANE_CTRL +{ + CWnd* pWnd; // A pointer to a valid CWnd object. + UINT nID; // ID of the indicator pane. + BOOL bAutoDelete; // TRUE if the control is to be deleted when destroyed. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTStatusBar is a CStatusBar derived class. It allows you to easily +// insert controls into your status bar, and remove controls from your +// status bar. +class _XT_EXT_CLASS CXTStatusBar : public CStatusBar +{ + DECLARE_DYNAMIC(CXTStatusBar) + +public: + + // Summary: Constructs a CXTStatusBar object. + CXTStatusBar(); + + // Summary: Destroys a CXTStatusBar object, handles cleanup and de-allocation. + virtual ~CXTStatusBar(); + +// Attributes +protected: + + CArray m_arControls; // Array of pane controls. + +// Operations +public: + + // Summary: This member function is called by the status bar to reposition pane + // item controls. + void PositionControls(); + + // Input: nID - ID of the indicator pane. + // Returns: A pointer to an XT_STATUSPANE_CTRL struct. + // Summary: Call this member function to retrieve information for the specified + // indicator pane. + XT_STATUSPANE_CTRL* GetPaneControl(UINT nID); + + // Input: pWnd - Points to a control window. + // nID - ID of the indicator pane. + // bAutoDelete - TRUE if the control is to be deleted when destroyed. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to add a control to an indicator pane. + BOOL AddControl(CWnd* pWnd,UINT nID,BOOL bAutoDelete=TRUE); + + // Input: nIndex - Index of the indicator pane. + // cxText - New width for the indicator pane. + // Summary: Call this member function to set the width for an indicator pane. + void SetPaneWidth(int nIndex,int cxText); + + // Input: nID - ID of the indicator pane. + // nIndex - Index of the indicator pane. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to add an indicator pane to the status bar. + BOOL AddIndicator(UINT nID,int nIndex); + + // Input: nID - ID of the indicator pane. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to remove an indicator pane from the status bar. + BOOL RemoveIndicator(UINT nID); + + // Input: nIndex - Index of the indicator pane. + // pSBP - Address of an XT_STATUSPANE struct. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to retrieve information for an indicator pane. + BOOL GetPaneInfoEx(int nIndex,XT_STATUSPANE* pSBP); + + // Input: nIndex - Index of the indicator pane. + // pSBP - Address of an XT_STATUSPANE struct. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to set the information for an indicator pane. + BOOL SetPaneInfoEx(int nIndex,XT_STATUSPANE* pSBP); + + // Input: nIndex - Index of the indicator pane. + // Returns: A pointer to an XT_STATUSPANE struct. + // Summary: Call this member function to get the pane information for the given index. + XT_STATUSPANE* GetPanePtr(int nIndex) const; + + // Returns: An integer value that represents the number of panes for the status bar. + // Summary: Call this member function to return the number of panes that are created + // for the status bar. + int GetPaneCount() const; + + // Ignore: + //{{AFX_VIRTUAL(CXTStatusBar) + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTStatusBar) + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg LRESULT OnIdleUpdateCmdUI (WPARAM wParam, LPARAM lParam); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE int CXTStatusBar::GetPaneCount() const { + return m_nCount; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // __XTSTATUSBAR_H__ \ No newline at end of file diff --git a/Editor/XT/Include/XTTabCtrl.h b/Editor/XT/Include/XTTabCtrl.h new file mode 100644 index 0000000..96dd831 --- /dev/null +++ b/Editor/XT/Include/XTTabCtrl.h @@ -0,0 +1,562 @@ +// XTTabCtrl.h interface for the CXTTabCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTABCTRL_H__) +#define __XTTABCTRL_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#define MESSAGE_MAP_ENTRIES_CXTTabCtrlBase \ + ON_WM_PAINT() \ + ON_WM_ERASEBKGND() \ + ON_WM_SETTINGCHANGE() \ + ON_WM_SYSCOLORCHANGE() + +#define MESSAGE_MAP_ENTRIES_CXTTabCtrlBaseEx \ + MESSAGE_MAP_ENTRIES_CXTTabCtrlBase \ + ON_WM_RBUTTONDOWN() \ + ON_WM_CREATE() \ + ON_WM_DESTROY() \ + ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnSelchange) \ + ON_NOTIFY_REFLECT(TCN_SELCHANGING, OnSelchanging) \ + ON_WM_WINDOWPOSCHANGED() \ + ON_MESSAGE(XTWM_INITIAL_UPDATE, OnInitialize) \ + ON_MESSAGE_VOID(WM_INITIALUPDATE, OnInitialUpdate) + +class CXTTabCtrlButtons; + +// Summary: XT_NAVBTNFLAGS is an enumeration used by CXTTabCtrl to determine navigation button style. +enum XT_NAVBTNFLAGS +{ + XT_SHOW_ARROWS = 1, // To show arrow buttons. + XT_SHOW_CLOSE = 2, // To show close button. + XT_SHOW_ALL = 3 // To show arrow and close buttons. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTabCtrlBase is a stand alone base class. It is used to draw an XP +// style tab control. +class _XT_EXT_CLASS CXTTabCtrlBase +{ +public: + + // Summary: Constructs a CXTTabCtrlBase object. + CXTTabCtrlBase(); + + // Summary: Destroys a CXTTabCtrlBase object, handles cleanup and de-allocation. + virtual ~CXTTabCtrlBase(); + +protected: + + int m_iEdge; // System metrics for SM_CYEDGE (XP only). + CPen m_penBlack; // Black pen (XP only). + CPen m_penWhite; // White pen (XP only). + CPen m_penFace; // 3D face pen (XP only). + CPen m_penText; // Non-selected text pen (XP only). + CTabCtrl* m_pTabCtrl; // Pointer to the tab control associated with this object. + + // Input: pTabCtrl - Points to a valid tab control object. + // Summary: Call this member function to associate the tab control with this object. + void ImplAttach(CTabCtrl *pTabCtrl); + +public: + + bool m_bBoldFont; // true to set the selected tab font to bold. + bool m_bXPBorder; // true to draw an XP border around the tab child window. + bool m_bDisableXPMode; // true to override system defaults and disable XP look for this control. + BOOL m_bAutoCondensing; // TRUE for auto-condensing tabs. + +public: + + // Input: rcChild - A reference to a CRect object to receive the client coordinates. + // Summary: This member function copies the child coordinates of the CTabCtrl client + // area into the object referenced by 'rcChild'. The client coordinates + // specify the upper-left and lower-right corners of the client area. + virtual void GetChildRect(CRect& rcChild) const; + + // BULLETED LIST: + + // Input: dwFlags - The value can be one or more of the following: + // [ul] + // [li]XT_SHOW_ARROWS To show arrow buttons.[/li] + // [li]XT_SHOW_CLOSE To show close button.[/li] + // [li]XT_SHOW_ALL To show arrow and close buttons.[/li] + // [/ul] + // Summary: Call this member function to set visibility of the navigation buttons. These + // buttons are used inplace of the default forward and back buttons that are + // displayed when the tab control is not wide enough to display all tabs. You can + // also define a close button to be used to close the active tab. This will give + // the tab control a VS.NET style tabbed interface. + void ShowNavButtons(DWORD dwFlags); + +protected: + + // Input: pDC - Points to the client device context. + // rcClient - Size of the client area to paint. + // rcItem - Size of the selected tab item. + // Summary: This member function is called by the tab control to draw top aligned + // XP style tabs. + virtual void OnDrawTop(CDC* pDC,CRect rcClient,CRect rcItem); + + // Input: pDC - Points to the client device context. + // rcClient - Size of the client area to paint. + // rcItem - Size of the selected tab item. + // Summary: This member function is called by the tab control to draw bottom aligned + // XP style tabs. + virtual void OnDrawBottom(CDC* pDC,CRect rcClient,CRect rcItem); + + // Input: pDC - Points to the client device context. + // rcClient - Size of the client area to paint. + // rcItem - Size of the selected tab item. + // Summary: This member function is called by the tab control to draw left aligned + // XP style tabs. + virtual void OnDrawLeft(CDC* pDC,CRect rcClient,CRect rcItem); + + // Input: pDC - Points to the client device context. + // rcClient - Size of the client area to paint. + // rcItem - Size of the selected tab item. + // Summary: This member function is called by the tab control to draw right aligned + // XP style tabs. + virtual void OnDrawRight(CDC* pDC,CRect rcClient,CRect rcItem); + + // Input: strLabelText - Tab label to add padding to. + // Summary: This member function is called by the tab control to add padding to a + // tab label for use with XP style tabs. + virtual void OnAddPadding(CXTString& strLabelText); + + BOOL OnEraseBkgndImpl(CDC* pDC); + void OnPaintImpl(); + void OnSettingChangeImpl_Post(UINT uFlags, LPCTSTR lpszSection); + void OnSysColorChangeImpl_Post(); + void PaintButtons(); + CXTTabCtrlButtons* m_pNavBtns; +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTabCtrlBaseEx is a CXTTabCtrlBase derived class. It is used to create +// a CXTTabCtrlBaseEx class object. +class _XT_EXT_CLASS CXTTabCtrlBaseEx : public CXTTabCtrlBase +{ +protected: + + int m_nPos; // Index of the popup menu contained in the menu. + UINT m_popupMenuID; // Popup menu resource ID. + BOOL m_bInitialUpdate; // TRUE to send initial update to views when created. + CWnd* m_pParentWnd; // Points to the parent and will equal 'm_pParentFrame' in non-dialog applications. + CView* m_pLastActiveView; // Points to the last active view that belongs to the main frame window. + CFrameWnd* m_pParentFrame; // Points to the parent frame. + + +private: + + int m_nOldIndex; + BOOL m_bInitialUpdatePending; + DWORD m_dwInitSignature; + +public: + + CList m_tcbItems; // Template list containing tab information. + + // Summary: Constructs a CXTTabCtrlBase object. + CXTTabCtrlBaseEx(); + + // Summary: Destroys a CXTTabCtrlBase object, handles cleanup and de-allocation. + virtual ~CXTTabCtrlBaseEx(); + + // Summary: This member function is called to initialize the font for the tab control + // associated with this view. + virtual void InitializeFont(); + + // Returns: The handle of the tooltip control if successful, otherwise returns NULL. + // Summary: This member function retrieves the handle of the tooltip control associated + // with the tab control. The tab control creates a tooltip control if + // it has the TCS_TOOLTIPS style. You can also assign a tooltip control + // to a tab control by using the SetToolTips member function. + virtual CToolTipCtrl* GetTips(); + + // Input: pWndTip - Pointer to a tooltip control. + // Summary: Call this function to assign a tooltip control to the tab control. + // You can associate the tooltip control with a tab control by making + // a call to GetToolTips. + virtual void SetTips(CToolTipCtrl* pWndTip); + + // Input: nIDTab - Index of the tab. + // lpszText - Pointer to the text for the tool. + // Summary: Call this function to register a tab with the tooltip control, so + // that the information stored in the tooltip is displayed when the cursor + // is on the tab. + virtual void AddToolTip(UINT nIDTab,LPCTSTR lpszText); + + // Input: nIDTab - Index of the tab. + // lpszText - Pointer to the text for the tool. + // Summary: Call this function to update the tooltip text for the specified tab. + virtual void UpdateToolTip(int nIDTab,LPCTSTR lpszText); + + // Input: pViewClass - CRuntimeClass associated with the tab. + // lpszText - Pointer to the text for the tool. + // Summary: Call this function to update the tooltip text for the specified tab. + virtual void UpdateToolTip(CRuntimeClass *pViewClass,LPCTSTR lpszText); + + // Summary: This member function is called to reset the values for the tooltip + // control based upon the information stored for each tab. + virtual void ResetToolTips(); + + // Input: bEnable - TRUE to enable tooltip usage. + // Returns: TRUE if the tooltip control was found and updated, otherwise returns + // FALSE. + // Summary: Call this member function to enable or disable tooltip usage. + virtual BOOL EnableToolTipsImpl(BOOL bEnable); + + // Input: lpszLabel - Pointer to the text for the tab associated with the view. + // pViewClass - CView runtime class associated with the tab. + // pDoc - CDocument associated with the view. + // pContext - Create context for the view. + // iIndex - -1 to add to the end. + // iIconIndex - Icon index for the tab. If -1, 'iIndex' is used to determine the index. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to add a view to the tab control associated + // with this view. + virtual BOOL AddView(LPCTSTR lpszLabel,CRuntimeClass *pViewClass,CDocument* pDoc=NULL,CCreateContext* pContext=NULL,int iIndex=-1,int iIconIndex=-1); + + // Input: lpszLabel - Pointer to the text for the tab associated with the view. + // pView - An existing view to be added to the tab control. + // iIndex - -1 to add to the end. + // iIconIndex - Icon index for the tab. If -1, nIndex is used to determine the index. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to add a view to the tab control associated + // with this view. + virtual BOOL AddView(LPCTSTR lpszLabel,CView* pView,int iIndex=-1,int iIconIndex=-1); + + // Input: lpszLabel - Pointer to the text for the tab associated with the view. + // pWnd - CWnd object associated with the tab. + // iIndex - Tab index of where to insert the new view. Default is -1 to add to + // the end. + // iIconIndex - Icon index for the tab. If -1, 'iIndex' is used to determine the index. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is called to add a control to the tab control + // associated with this view. + virtual BOOL AddControl(LPCTSTR lpszLabel,CWnd* pWnd,int iIndex=-1,int iIconIndex=-1); + + // Input: pViewClass - CView runtime class associated with the tab. + // Returns: A pointer to a CView object, otherwise returns NULL. + // Summary: This member function returns a pointer to a view from the specified + // runtime class. + virtual CWnd* GetView(CRuntimeClass *pViewClass); + + // Input: nView - Tab index. + // Returns: A pointer to a CView object, otherwise returns NULL. + // Summary: This member function returns a pointer to a view from the specified + // runtime class. + virtual CWnd* GetView(int nView); + + // Returns: A pointer to the active view, otherwise returns NULL. + // Summary: This member function returns a pointer to the active view associated + // with the selected tab. + virtual CWnd* GetActiveView(); + + // Input: pTabView - CWnd object to make active. + // Summary: This member function is called to activate the specified view and deactivate + // all remaining views. + virtual void ActivateView(CWnd* pTabView); + + // Input: pViewClass - CView runtime class associated with the tab. + // Summary: This member function will set a view active based on the specified + // runtime class. + virtual void SetActiveView(CRuntimeClass *pViewClass); + + // Input: pTabView - CWnd object to make active. + // Summary: This member function will set a view active based on the specified + // runtime class. + virtual void SetActiveView(CWnd* pTabView); + + // Input: nActiveTab - Tab index. + // Summary: This member function will set a view active based on the specified + // tab index. + virtual void SetActiveView(int nActiveTab); + + // Input: nView - Tab index of the view. + // bDestroyWnd - TRUE to destroy the list item. + // Summary: This member function will remove a view based on the specified + // tab index. + virtual void DeleteView(int nView,BOOL bDestroyWnd=TRUE); + + // Input: pView - Points to the CWnd object associated with the tab. + // bDestroyWnd - TRUE to destroy the list item. + // Summary: This member function will remove a view based on the specified CWnd + // pointer associated with the tab. + virtual void DeleteView(CWnd* pView,BOOL bDestroyWnd=TRUE); + + // Input: pViewClass - CView runtime class associated with the tab. + // bDestroyWnd - TRUE to destroy the list item. + // Summary: This member function will remove a view based on the specified CView + // runtime class associated with the tab. + virtual void DeleteView(CRuntimeClass *pViewClass,BOOL bDestroyWnd=TRUE); + + // Input: nView - Tab index of the view. + // Returns: A NULL terminated string that represents the tab item text. + // Summary: This member function will return the name for a view based on the tab + // index. + virtual LPCTSTR GetViewName(int nView); + + // Input: pViewClass - CView runtime class associated with the tab. + // Returns: A NULL terminated string that represents the tab item text. + // Summary: This member function will return the name for a view based on the tab + // index. + virtual LPCTSTR GetViewName(CRuntimeClass *pViewClass); + + // Input: pView - A pointer to a CWnd object to be resized. + // Summary: Call this member function to resize the tab view specified by 'pView'. + virtual void ResizeTabView(CWnd* pView); + + // Input: pos - The POSITION value of the item to be removed. + // bDestroyWnd - TRUE to destroy the list item. + // Summary: This member function is used by the tab control bar to remove an item + // from the tab view list. + virtual void RemoveListItem(POSITION pos,BOOL bDestroyWnd=TRUE); + + // Input: bDestroyWnd - TRUE to destroy the window associated with the tab item. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to remove all the tabs, including all associated + // views. + virtual BOOL RemoveAllTabs(BOOL bDestroyWnd=TRUE); + + // Input: point - Pointer to a CPoint object that contains the cursor screen coordinates. + // Use default for current cursor position. + // Returns: An integer based index of the tab, or –1, if no tab is at the specified 'point'. + // Summary: Call this member function to retrieve the tab index from the current cursor + // position. + virtual int GetTabFromPoint(CPoint point); + + // Input: pView - A pointer to a CWnd object. + // Returns: TRUE if the specified CWnd object is a child of the tab control, otherwise + // returns FALSE. + // Summary: Call this member function to see if the specified CWnd object is a + // child of the tab control. + virtual BOOL IsChildView(CWnd* pView); + + // Input: nTab - Index of the tab. + // lpszLabel - New text for the tab label. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to set the text for the specified tab. + BOOL SetTabText(int nTab,LPCTSTR lpszLabel); + + // Input: pView - CWnd object associated with the tab. + // lpszLabel - New text for the tab label. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to set the text for the specified tab. + BOOL SetTabText(CWnd* pView,LPCTSTR lpszLabel); + + // Input: pViewClass - CRuntimeClass of the CWnd associated with the tab. + // lpszLabel - New text for the tab label. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to set the text for the specified tab. + BOOL SetTabText(CRuntimeClass *pViewClass,LPCTSTR lpszLabel); + + // Returns: A CWnd pointer to the newly activated view. + // Summary: This member function is called to activate the next view in the tab + // control. + CWnd* NextView(); + + // Returns: A CWnd pointer to the newly activated view. + // Summary: This member function is called to activate the previous view in the + // tab control. + CWnd* PrevView(); + + // Input: bEnable - TRUE to enable auto-condense mode. + // Summary: Call this member function to enable or disable the tab auto-condensing + // mode. Auto-condensing mode affects the tab control's behavior when + // there is not enough room to fit all tabs. Without auto-condensation, + // the CXTTabCtrl control behaves like a standard tab control (i.e. it + // will display a slider control that allows the user to pan between tabs). + // With the auto-condensing mode enabled, CXTTabCtrl attempts to fit all + // tabs in the available space by trimming the tab label text. This behavior + // is similar to the behavior displayed by Visual C++'s Workspace View. + // For instance, you can see the FileView tab shrink if you shrink the + // Workspace View. + void SetAutoCondense(BOOL bEnable); + + // Returns: TRUE if auto-condense is enabled, or FALSE if it is disabled. + // Summary: This member function returns the state of the tab control's auto-condense + // mode. See SetAutoCondense() for a full explanation of this mode. + BOOL GetAutoCondense(); + + // Input: dwRemove - Specifies window styles to be removed during style modification. + // dwAdd - Specifies window styles to be added during style modification. + // nFlags - Flags to be passed to SetWindowPos, or zero if SetWindowPos should + // not be called. The default is zero. See CWnd::ModifyStyle for more + // details. + // Returns: Nonzero if the style was successfully modified, otherwise returns zero. + // Summary: This member function will modify the style for the tab control associated + // with this view and set the appropriate font depending on the tab's + // orientation. + virtual BOOL ModifyTabStyle(DWORD dwRemove,DWORD dwAdd,UINT nFlags=0); + + // Returns: A CView pointer to the last known view. + // Summary: This member function is used to get the last known view that belongs + // to the frame. + CView* GetLastKnownChildView(); + + // Input: popupMenuID - ID for the tab control popup menu. + // nPos - Index position in the menu resource. + // Summary: This member function is used to set the resource ID for the popup menu + // used by the tab control. + virtual void SetMenuID(UINT popupMenuID,int nPos=0); + + // Returns: The resource ID of the menu associated with the tab control. + // Summary: This member function returns the menu resource associated with the + // tab control. + virtual UINT GetMenuID(); + + // Input: bInitialUpdate - TRUE to send initial update message. + // Summary: Call this member function to allow WM_INITIALUPATE message to be sent + // to views after creation. + virtual void SendInitialUpdate(BOOL bInitialUpdate); + +protected: + + // Summary: This member function is a virtual method that is called to handle a + // TCN_SELCHANGING event. Override in your derived class to add additional + // functionality. + virtual void OnSelChanging(); + + // Summary: This member function is a virtual method that is called to handle a + // TCN_SELCHANGE event. Override in your derived class to add additional + // functionality. + virtual void OnSelChange(); + + // Input: nTab - Index of the tab. + // pMember - Address of an XT_TCB_ITEM struct associated with the tab. + // lpszLabel - NULL terminated string that represents the new tab label. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is called to set the tooltip and tab text for + // the specified tab. + BOOL UpdateTabLabel(int nTab,XT_TCB_ITEM* pMember,LPCTSTR lpszLabel); + + // Input: pViewClass - CView runtime class to be created. + // pDocument - CDocument associated with view. + // pContext - Create context for the view. + // Returns: A pointer to the newly created CWnd object, otherwise returns NULL. + // Summary: This member function creates the CWnd object that is associated + // with a tab control item. + virtual CWnd* CreateTabView(CRuntimeClass *pViewClass,CDocument *pDocument,CCreateContext *pContext); + + // Input: pDC - Points to the current device context. + // sLabel - Represents the tab label text. + // bHasIcon - Set to true if the tab item has an icon. + // Returns: An integer value that represents the width of a tab. + // Summary: This member function is used internally by the tab control to calculate + // the width of a tab based on its label text. + int CalculateTabWidth(CDC *pDC,CString& sLabel,bool bHasIcon); + + // Summary: This member function is used internally by the tab control to shrink, + // or unshrink, tabs based on the control's width and the state of the + // auto-condensation mode. See SetAutoCondense() for more information. + void Condense(); + + void OnRButtonDownImpl(UINT nFlags, CPoint point); + int OnCreateImpl_Post(LPCREATESTRUCT lpCreateStruct); + void OnDestroyImpl_Pre(); + void OnSelchangeImpl(NMHDR* pNMHDR, LRESULT* pResult); + void OnSelchangingImpl(NMHDR* pNMHDR, LRESULT* pResult); + void OnWindowPosChangedImpl_Pre(WINDOWPOS FAR* lpwndpos); + void OnWindowPosChangedImpl_Post(WINDOWPOS FAR* lpwndpos); + BOOL PreTranslateMessageImpl(MSG* pMsg); + void PreSubclassWindowImpl_Post(); + BOOL OnCmdMsgImpl_Pre(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); + LRESULT OnInitializeImpl(WPARAM, LPARAM); + void OnInitialUpdateImpl(); +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTabCtrl is a multiple inheritance class derived from CTabCtrl and +// CXTTabCtrlBaseEx. It is used to create a CXTTabCtrl class object. See +// CXTTabCtrlBaseEx for additional functionality. +class _XT_EXT_CLASS CXTTabCtrl : public CTabCtrl, public CXTTabCtrlBaseEx +{ + DECLARE_DYNAMIC(CXTTabCtrl) + + friend class CXTTabCtrlBase; + friend class CXTTabCtrlBaseEx; + +public: + + // Summary: Constructs a CXTTabCtrl object. + CXTTabCtrl(); + + // Summary: Destroys a CXTTabCtrl object, handles cleanup and de-allocation. + virtual ~CXTTabCtrl(); + +protected: + +public: + + // Input: bEnable - TRUE to enable tooltip usage. + // Returns: TRUE if the tooltip control was found and updated, otherwise returns FALSE. + // Summary: Call this member function to enable or disable tooltip usage. + virtual BOOL EnableToolTips(BOOL bEnable); + + // Ignore: + //{{AFX_VIRTUAL(CXTTabCtrl) + public: + virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual void PreSubclassWindow(); + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTTabCtrl) + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnDestroy(); + afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + afx_msg void OnPaint(); + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + afx_msg void OnSysColorChange(); + //}}AFX_MSG + + afx_msg LRESULT OnInitialize(WPARAM wp, LPARAM lp) { return OnInitializeImpl(wp, lp); }; + afx_msg void OnInitialUpdate() {OnInitialUpdateImpl(); } + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE UINT CXTTabCtrlBaseEx::GetMenuID() { + ASSERT(::IsWindow(m_pTabCtrl->GetSafeHwnd())); return m_popupMenuID; +} +AFX_INLINE CWnd* CXTTabCtrlBaseEx::GetActiveView() { + return GetView(m_pTabCtrl->GetCurSel()); +} +AFX_INLINE void CXTTabCtrlBaseEx::SetMenuID(UINT popupMenuID, int nPos) { + m_popupMenuID = popupMenuID; m_nPos = nPos; +} +AFX_INLINE void CXTTabCtrlBaseEx::SendInitialUpdate(BOOL bInitialUpdate) { + m_bInitialUpdate = bInitialUpdate; +} +AFX_INLINE CView* CXTTabCtrlBaseEx::GetLastKnownChildView() { + return m_pLastActiveView; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTTABCTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTTabCtrlBar.h b/Editor/XT/Include/XTTabCtrlBar.h new file mode 100644 index 0000000..11798f3 --- /dev/null +++ b/Editor/XT/Include/XTTabCtrlBar.h @@ -0,0 +1,388 @@ +// XTTabCtrlBar.h interface for the CXTTabCtrlBar class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTABCTRLBAR_H__) +#define __XTTABCTRLBAR_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTabCtrlBar is a CXTDockWindow derived class. It is used to implement +// a tabbed window similar to Visual Studio's workspace window. +class _XT_EXT_CLASS CXTTabCtrlBar : public CXTDockWindow +{ + DECLARE_DYNAMIC(CXTTabCtrlBar) + +public: + + // Summary: Constructs a CXTTabCtrlBar object. + CXTTabCtrlBar(); + + // Summary: Destroys a CXTTabCtrlBar object, handles cleanup and de-allocation. + virtual ~CXTTabCtrlBar(); + +protected: + + CXTTabCtrl m_tabCtrl; // The tab control. + +public: + + // Returns: A reference to the CXTTabCtrl object associated with this view. + // Summary: Call this member function to return a reference pointer to the CXTTabCtrl + // object associated with this view. + virtual CXTTabCtrl& GetTabCtrl () const; + + // Input: pImageList - Pointer to the image list to be assigned to the tab control. + // Returns: A pointer to the previous image list, or NULL, if there is no previous + // image list. + // Summary: Call this member function to assign an image list to the tab control + // associated with this view. + virtual CImageList* SetTabImageList(CImageList *pImageList); + + // Input: popupMenuID - ID for the tab control popup menu. + // nPos - Index position in the menu resource. + // Summary: This member function is used to set the resource ID for the popup menu + // used by the tab control. + virtual void SetTabMenuID(UINT popupMenuID,int nPos=0); + + // Returns: The resource ID of the menu associated with the tab control. + // Summary: This member function returns the menu resource associated with the + // tab control. + virtual UINT GetTabMenuID(); + + // Input: rcChild - A reference to a CRect object to receive the client coordinates. + // Summary: This member function copies the child coordinates of the CTabCtrl client + // area into the object referenced by 'rcChild'. The client coordinates + // specify the upper-left and lower-right corners of the client area. + virtual void GetChildRect(CRect& rcChild) const; + + // Input: pView - A pointer to a CWnd object to be resized. + // Summary: Call this member function to resize the tab view specified by 'pView'. + virtual void ResizeTabView(CWnd* pView); + + // Summary: This member function is called to initialize the font for the tab control + // associated with this view. + virtual void InitializeFont(); + + // Input: dwRemove - Specifies window styles to be removed during style modification. + // dwAdd - Specifies window styles to be added during style modification. + // nFlags - Flags to be passed to SetWindowPos, or zero if SetWindowPos + // should not be called. The default is zero. See CWnd::ModifyStyle + // for more details. + // Returns: Nonzero if style was successfully modified, otherwise returns zero. + // Summary: This member function will modify the style for the tab control associated + // with this view and set the appropriate font depending on the tab's + // orientation. + virtual BOOL ModifyTabStyle(DWORD dwRemove,DWORD dwAdd,UINT nFlags=0); + + // Returns: The handle of the tooltip control if successful, otherwise returns NULL. + // Summary: This member function retrieves the handle of the tooltip control associated + // with the tab control. The tab control creates a tooltip control if + // it has the TCS_TOOLTIPS style. You can also assign a tooltip control + // to a tab control by using the SetToolTips member function. + virtual CToolTipCtrl* GetTips(); + + // Input: pWndTip - Handle of the tooltip control. + // Summary: Call this function to assign a tooltip control to the tab control. + // You can associate the tooltip control with a tab control by making + // a call to GetToolTips. + virtual void SetTips(CToolTipCtrl* pWndTip); + + // Input: nIDTab - Index of the tab. + // lpszText - Pointer to the text for the tool. + // Summary: Call this function to register a tab with the tooltip control, so + // that the information stored in the tooltip is displayed when the cursor + // is on the tab. + virtual void AddToolTip(UINT nIDTab,LPCTSTR lpszText); + + // Input: nIDTab - Index of the tab. + // lpszText - Pointer to the text for the tool. + // Summary: Call this function to update the tooltip text for the specified tab. + virtual void UpdateToolTip(int nIDTab,LPCTSTR lpszText); + + // Input: pViewClass - CRuntimeClass associated with the tab. + // lpszText - Pointer to the text for the tool. + // Summary: Call this function to update the tooltip text for the tab specified + // by 'pViewClass'. + virtual void UpdateToolTip(CRuntimeClass *pViewClass,LPCTSTR lpszText); + + // Summary: This member function is called to reset the values for the tooltip + // control based upon the information stored for each tab. + virtual void ResetToolTips(); + + // Input: bEnable - TRUE to enable tooltip usage. + // Returns: TRUE if the tooltip control was found and updated, otherwise returns + // FALSE. + // Summary: Call this member function to enable or disable tooltip usage. + virtual BOOL EnableToolTips(BOOL bEnable); + + // Input: lpszLabel - Pointer to the text for the tab associated with the view. + // pViewClass - CView runtime class associated with the tab. + // pDoc - CDocument associated with the view. + // pContext - Create context for the view. + // iIndex - Tab index of where to insert the new view. The default is -1 to + // insert the new view at the end. + // iIconIndex - Icon index for the tab. If -1, 'iIndex' is used to determine + // the index. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to add a view to the tab control associated + // with this view. + virtual BOOL AddView(LPCTSTR lpszLabel,CRuntimeClass *pViewClass,CDocument* pDoc=NULL,CCreateContext* pContext=NULL,int iIndex=-1,int iIconIndex=-1); + + // Input: lpszLabel - Pointer to the text for the tab associated with the view. + // pView - An existing view to be added to the tab control. + // iIndex - Tab index of where to insert the new view. The default is -1 to + // insert the new view at the end. + // iIconIndex - Icon index for the tab. If -1, 'iIndex' is used to determine + // the index. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to add a view to the tab control associated + // with this view. + virtual BOOL AddView(LPCTSTR lpszLabel,CView* pView,int iIndex=-1,int iIconIndex=-1); + + // Input: lpszLabel - Pointer to the text for the tab associated with the view. + // pView - CWnd object associated with the tab. + // iIndex - Tab index of where to insert the new view. The default is -1 to + // add the new view to the end. + // iIconIndex - Icon index for the tab. If -1, 'iIndex' is used to determine + // the index. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is called to add a control to the tab control + // associated with this view. + virtual BOOL AddControl(LPCTSTR lpszLabel,CWnd* pView,int iIndex=-1,int iIconIndex=-1); + + // Input: pViewClass - CView runtime class associated with the tab. + // Returns: A pointer to a CView object, otherwise returns NULL. + // Summary: This member function returns a pointer to a view from the specified + // runtime class. + virtual CWnd* GetView(CRuntimeClass *pViewClass); + + // Input: nView - Tab index. + // Returns: A pointer to a CView object, otherwise returns NULL. + // Summary: This member function returns a pointer to a view from the specified + // tab index. + virtual CWnd* GetView(int nView); + + // Returns: A pointer to the active view, otherwise returns NULL. + // Summary: This member function returns a pointer to the active view associated + // with the selected tab. + virtual CWnd* GetActiveView(); + + // Input: pViewClass - CView runtime class associated with the tab. + // Summary: This member function will set a view active based on the specified + // runtime class. + virtual void SetActiveView(CRuntimeClass *pViewClass); + + // Input: pTabView - CWnd object to make active. + // Summary: This member function will set a view active based on the specified + // runtime class. + virtual void SetActiveView(CWnd* pTabView); + + // Input: nActiveTab - Tab index. + // Summary: This member function will set a view active based on the specified + // tab index. + virtual void SetActiveView(int nActiveTab); + + // Input: nView - Tab index of the view. + // bDestroyWnd - TRUE to destroy the list item. + // Summary: This member function will remove a view based on the specified + // tab index. + virtual void DeleteView(int nView,BOOL bDestroyWnd=TRUE); + + // Input: pView - Points to the CWnd object associated with the tab. + // bDestroyWnd - TRUE to destroy the list item. + // Summary: This member function will remove the view specified by 'pView' from + // the tab control. + virtual void DeleteView(CWnd* pView,BOOL bDestroyWnd=TRUE); + + // Input: pViewClass - CView runtime class associated with the tab. + // bDestroyWnd - TRUE to destroy the list item. + // Summary: This member function will remove the view specified by 'pViewClass' from + // the tab control. + virtual void DeleteView(CRuntimeClass *pViewClass,BOOL bDestroyWnd=TRUE); + + // Input: nView - Tab index of the view. + // Returns: A NULL terminated string that represents the tab item text. + // Summary: This member function will return the name for a view based on the tab index. + virtual LPCTSTR GetViewName(int nView); + + // Input: pViewClass - CView runtime class associated with the tab. + // Returns: A NULL terminated string that represents the tab item text. + // Summary: This member function will retrieve the name for a view based upon a CWnd object. + virtual LPCTSTR GetViewName(CRuntimeClass* pViewClass); + + // Input: bDestroyWnd - TRUE to destroy the window associated with the tab item. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to remove all the tabs including all associated views. + virtual BOOL RemoveAllTabs(BOOL bDestroyWnd=TRUE); + + // Input: point - Pointer to a CPoint object that contains the cursor screen coordinates. + // Use default for the current cursor position. + // Returns: The zero-based index of the tab, or –1, if no tab is at the specified point. + // Summary: Call this member function to retrieve the tab index from the current + // cursor position. + virtual int GetTabFromPoint(CPoint point); + + // Input: pView - A pointer to a CWnd object. + // Returns: TRUE if the specified CWnd object is a child of the tab control, otherwise + // returns FALSE. + // Summary: Call this member function to see if the specified CWnd object is a + // child of the tab control. + virtual BOOL IsChildView(CWnd* pView); + + // Input: bEnable - TRUE to enable auto-condense mode. + // Summary: Call this member function to enable or disable the tab auto-condensing + // mode. Auto-condensing mode affects the tab control's behavior when + // there is not enough room to fit all tabs. Without auto-condensation, + // the CXTTabCtrl control behaves like a standard tab control (i.e. it + // will display a slider control that allows the user to pan between tabs). + // With the auto-condensing mode enabled, CXTTabCtrl attempts to fit all + // tabs in the available space by trimming the tab label text. This behavior + // is similar to the behavior displayed by Visual C++'s Workspace View. + // For instance, you can see the FileView tab shrink if you shrink the + // Workspace View. + void SetAutoCondense(BOOL bEnable); + + // Returns: TRUE if auto-condense is enabled, otherwise returns FALSE. + // Summary: This member function returns the state of the tab control's auto-condense + // mode. See SetAutoCondense() for a full explanation of this mode. + BOOL GetAutoCondense(); + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTTabCtrlBar) + virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); + //}}AFX_VIRTUAL + + virtual void OnTabSelChange(int nIDCtrl, CXTTabCtrl* pTabCtrl); + virtual void OnTabSelChanging(int nIDCtrl, CXTTabCtrl* pTabCtrl); + + // Ignore: + //{{AFX_MSG(CXTTabCtrlBar) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + afx_msg LRESULT OnTabSelChange(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnTabSelChanging(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTTabCtrl& CXTTabCtrlBar::GetTabCtrl() const { + ASSERT_VALID(this); return (CXTTabCtrl&)m_tabCtrl; +} +AFX_INLINE CImageList* CXTTabCtrlBar::SetTabImageList(CImageList *pImageList) { + ASSERT_VALID(this); return GetTabCtrl().SetImageList(pImageList); +} +AFX_INLINE void CXTTabCtrlBar::SetTabMenuID(UINT popupMenuID, int nPos) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().SetMenuID(popupMenuID, nPos); +} +AFX_INLINE UINT CXTTabCtrlBar::GetTabMenuID() { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetMenuID(); +} +AFX_INLINE void CXTTabCtrlBar::GetChildRect(CRect& rcChild) const { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().GetChildRect(rcChild); +} +AFX_INLINE void CXTTabCtrlBar::ResizeTabView(CWnd* pView) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().ResizeTabView(pView); +} +AFX_INLINE void CXTTabCtrlBar::InitializeFont() { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().InitializeFont(); +} +AFX_INLINE BOOL CXTTabCtrlBar::ModifyTabStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().ModifyTabStyle(dwRemove, dwAdd, nFlags); +} +AFX_INLINE CToolTipCtrl* CXTTabCtrlBar::GetTips() { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetTips(); +} +AFX_INLINE void CXTTabCtrlBar::SetTips(CToolTipCtrl* pWndTip) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().SetTips(pWndTip); +} +AFX_INLINE void CXTTabCtrlBar::AddToolTip(UINT nIDTab, LPCTSTR lpszText) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().AddToolTip(nIDTab, lpszText); +} +AFX_INLINE void CXTTabCtrlBar::UpdateToolTip(int nIDTab, LPCTSTR lpszText) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().UpdateToolTip(nIDTab, lpszText); +} +AFX_INLINE void CXTTabCtrlBar::UpdateToolTip(CRuntimeClass *pViewClass, LPCTSTR lpszText) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().UpdateToolTip(pViewClass, lpszText); +} +AFX_INLINE void CXTTabCtrlBar::ResetToolTips() { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().ResetToolTips(); +} +AFX_INLINE BOOL CXTTabCtrlBar::EnableToolTips(BOOL bEnable) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().EnableToolTips(bEnable); +} +AFX_INLINE BOOL CXTTabCtrlBar::AddControl(LPCTSTR lpszLabel, CWnd* pView, int iIndex, int iIconIndex) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().AddControl(lpszLabel, pView, iIndex, iIconIndex); +} +AFX_INLINE CWnd* CXTTabCtrlBar::GetView(CRuntimeClass *pViewClass) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetView(pViewClass); +} +AFX_INLINE CWnd* CXTTabCtrlBar::GetView(int nView) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetView(nView); +} +AFX_INLINE CWnd* CXTTabCtrlBar::GetActiveView() { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetActiveView(); +} +AFX_INLINE void CXTTabCtrlBar::SetActiveView(CRuntimeClass *pViewClass) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().SetActiveView(pViewClass); +} +AFX_INLINE void CXTTabCtrlBar::SetActiveView(CWnd* pTabView) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().SetActiveView(pTabView); +} +AFX_INLINE void CXTTabCtrlBar::SetActiveView(int nActiveTab) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().SetActiveView(nActiveTab); +} +AFX_INLINE void CXTTabCtrlBar::DeleteView(int nView, BOOL bDestroyWnd/*=TRUE*/) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().DeleteView(nView, bDestroyWnd); +} +AFX_INLINE void CXTTabCtrlBar::DeleteView(CWnd* pView, BOOL bDestroyWnd/*=TRUE*/) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().DeleteView(pView, bDestroyWnd); +} +AFX_INLINE void CXTTabCtrlBar::DeleteView(CRuntimeClass *pViewClass, BOOL bDestroyWnd/*=TRUE*/) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().DeleteView(pViewClass, bDestroyWnd); +} +AFX_INLINE LPCTSTR CXTTabCtrlBar::GetViewName(int nView) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetViewName(nView); +} +AFX_INLINE LPCTSTR CXTTabCtrlBar::GetViewName(CRuntimeClass *pViewClass) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetViewName(pViewClass); +} +AFX_INLINE BOOL CXTTabCtrlBar::RemoveAllTabs(BOOL bDestroyWnd/*=TRUE*/) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().RemoveAllTabs(bDestroyWnd); +} +AFX_INLINE int CXTTabCtrlBar::GetTabFromPoint(CPoint point) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetTabFromPoint(point); +} +AFX_INLINE BOOL CXTTabCtrlBar::IsChildView(CWnd* pView) { + ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().IsChildView(pView); +} +AFX_INLINE void CXTTabCtrlBar::SetAutoCondense(BOOL bEnable) { + GetTabCtrl().SetAutoCondense(bEnable); +} +AFX_INLINE BOOL CXTTabCtrlBar::GetAutoCondense() { + return GetTabCtrl().GetAutoCondense(); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTTABCTRLBAR_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTTabView.h b/Editor/XT/Include/XTTabView.h new file mode 100644 index 0000000..69f0582 --- /dev/null +++ b/Editor/XT/Include/XTTabView.h @@ -0,0 +1,129 @@ +// XTTabView.h interface for the CXTTabView class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTABVIEW_H__) +#define __XTTABVIEW_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTabView is a multiple inheritance class derived from CCtrlView and +// CXTTabCtrlBaseEx. CXTTabView can be used to create a view that contains +// nested views displayed in a tab control. See CXTTabCtrlBaseEx for additional +// functionality. +class _XT_EXT_CLASS CXTTabView : public CCtrlView, public CXTTabCtrlBaseEx +{ + DECLARE_DYNCREATE(CXTTabView) + + friend class CXTTabCtrlBase; + friend class CXTTabCtrlBaseEx; + +public: + + // Summary: Constructs a CXTTabView object. + CXTTabView(); + + // Summary: Destroys a CXTTabView object, handles cleanup and de-allocation. + virtual ~CXTTabView(); + +protected: + +public: + + // Returns: A CTabCtrl reference to the object associated with this view. + // Summary: Call this member function to retrieve a reference pointer to the CTabCtrl + // object associated with this view. + virtual CTabCtrl& GetTabCtrl () const; + + // Input: pImageList - Pointer to the image list to be assigned to the tab control. + // Returns: A pointer to the previous image list, or NULL, if there is no previous image list. + // Summary: Call this function to assign an image list to the tab control associated + // with this view. + virtual CImageList* SetTabImageList(CImageList *pImageList); + + // Returns: The handle of the tooltip control if successful, otherwise returns NULL. + // Summary: This member function retrieves the handle of the tooltip control associated + // with the tab control. The tab control creates a tooltip control if + // it has the TCS_TOOLTIPS style. You can also assign a tooltip control + // to a tab control by using the SetToolTips member function. + virtual CToolTipCtrl* GetToolTips(); + + // Input: pWndTip - Pointer to a tooltip control. + // Summary: Call this function to assign a tooltip control to the tab control. + // You can associate the tooltip control with a tab control by making + // a call to GetToolTips. + virtual void SetToolTips(CToolTipCtrl* pWndTip); + + // Input: bEnable - TRUE to enable tooltip usage. + // Returns: TRUE if the tooltip control was found and updated, otherwise returns FALSE. + // Summary: Call this member function to enable or disable tooltip usage. + virtual BOOL EnableToolTips(BOOL bEnable); + + // Summary: Call this member function to update the document name with the tab + // label. + void UpdateDocTitle(); + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTTabView) + public: + virtual void OnInitialUpdate(); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); + virtual BOOL PreTranslateMessage(MSG* pMsg); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTTabView) + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + afx_msg void OnDestroy(); + afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message); + afx_msg void OnPaint(); + //}}AFX_MSG + + afx_msg LRESULT OnInitialize(WPARAM wp, LPARAM lp) { return OnInitializeImpl(wp, lp); }; + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CTabCtrl& CXTTabView::GetTabCtrl() const { + ASSERT_VALID(this); return (CTabCtrl&)*this; +} +AFX_INLINE CImageList* CXTTabView::SetTabImageList(CImageList *pImageList) { + ASSERT_VALID(this); return GetTabCtrl().SetImageList(pImageList); +} +AFX_INLINE CToolTipCtrl* CXTTabView::GetToolTips() { + return GetTips(); +} +AFX_INLINE void CXTTabView::SetToolTips(CToolTipCtrl* pWndTip) { + SetTips(pWndTip); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTTABVIEW_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTTipOfTheDay.h b/Editor/XT/Include/XTTipOfTheDay.h new file mode 100644 index 0000000..42fb017 --- /dev/null +++ b/Editor/XT/Include/XTTipOfTheDay.h @@ -0,0 +1,126 @@ +// XTTipOfTheDay.h interface for the CXTTipOfTheDay class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTIPOFTHEDAY_H__) +#define __XTTIPOFTHEDAY_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTipOfTheDay is a multiple inheritance class derived from CXTDialogState +// and CDialog. CXTTipOfTheDay is used to create a Visual Studio™ style +// Tip Of The Day dialog. To use, place a file called "tips.txt" in the +// same directory as your application exe. Place each tip on its own line. +class _XT_EXT_CLASS CXTTipOfTheDay : CXTDialogState, public CDialog +{ + DECLARE_DYNAMIC(CXTTipOfTheDay) + +public: + + // Input: lpszTipFile - A NULL terminated string that represents the path and file name + // of where the tips text file is located. By default, the file name + // is set to "tips.txt". + // pParent - Points to the parent window for the Tip Of The Day Dialog. + // Summary: Constructs a CXTTipOfTheDay object. + CXTTipOfTheDay(LPCTSTR lpszTipFile=NULL,CWnd* pParent = NULL); + + // Summary: Destroys a CXTTipOfTheDay object, handles cleanup and de-allocation. + virtual ~CXTTipOfTheDay(); + +protected: + + FILE* m_pStream; // A pointer to the open file stream. + CRect m_rcBorder; // Size of the total display area. + CRect m_rcShadow; // Size of the shadowed rect displayed to the left of the tip. + CRect m_rcHilite; // Size of the background area the tips are displayed on. + CRect m_rcTipText; // Size of the display area for tip text. + CFont m_fontTitle; // Default font used for "Did you know..." text. + CFont m_fontTip; // Default font used for tips. + CFont* m_pFontTitle; // User defined font for "Did you know..." text. + CFont* m_pFontTip; // User defined font for tips. + CString m_strTipTitle; // Represents the "Did you know" text. + CString m_strTipText; // Represents the Tip Of The Day text. + CString m_strTipFile; // Represents the file name and path for the tips file. + +public: + + // Input: pFontTitle - Points to a CFont object that represents the new + // font to be used for the "Did you know..." text. + // pFontTip - Points to a CFont object that represents the new + // font to be used for the Tip Of The Day text. + // Summary: This member function will set the fonts to be used by the "Did you + // know..." and the Tip Of The Day text. + virtual void SetDefaultFonts(CFont* pFontTitle,CFont* pFontTip); + + // Input: strNext - A CString reference that represents the next + // Tip Of The Day text that is to be displayed. + // Summary: This member function will retrieve the next string to be displayed + // as the Tip Of The Day. + virtual void GetNextTipString(CString& strNext); + + // Input: lpszTitle - Represents a NULL terminated string that is + // the string to be displayed in place of the + // "Did you know..." text. + // Summary: This member function will set the text that is to be displayed + // in place of the "Did you know..." string. + virtual void SetDefaultTitle(LPCTSTR lpszTitle); + + // Input: lpszTipFile - A NULL terminated string that represents the full + // path to where the tips text file is located. + // Summary: This member function will set the path to where the tips file is + // located. + virtual void SetTipsFilePath(LPCTSTR lpszTipFile); + + //{{AFX_DATA(CXTTipOfTheDay) + + enum { IDD = XT_IDD_TIPOFTHEDAY }; + CButton m_ok; + CButton m_showTips; + CButton m_btnNextTip; + CStatic m_staticBorder; + BOOL m_bStartup; + //}}AFX_DATA + + // Ignore: + //{{AFX_VIRTUAL(CXTTipOfTheDay) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTTipOfTheDay) + afx_msg void OnPaint(); + virtual BOOL OnInitDialog(); + virtual void OnOK(); + afx_msg void OnDaytipNext(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTTipOfTheDay::SetDefaultTitle(LPCTSTR lpszTitle) { + m_strTipTitle = lpszTitle; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTTIPOFTHEDAY_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTTipWindow.h b/Editor/XT/Include/XTTipWindow.h new file mode 100644 index 0000000..f217a9b --- /dev/null +++ b/Editor/XT/Include/XTTipWindow.h @@ -0,0 +1,159 @@ +// XTTipWindow.h interface for the CXTTipWindow class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTIPWINDOW_H__) +#define __XTTIPWINDOW_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTipWindow is a CWnd derived class. It is used to create a CXTTipWindow +// object. CXTTipWindow objects are tooltip style popup windows that can +// display useful information to the end user. Possible options include +// shadows, borders, and background color settings. +class _XT_EXT_CLASS CXTTipWindow : public CWnd +{ +public: + + // Summary: Constructs a CXTTipWindow object. + CXTTipWindow(); + + // Summary: Destroys a CXTTipWindow object, handles cleanup and de-allocation. + virtual ~CXTTipWindow(); + +protected: + + int m_nLineSpace; // Amount, in pixels, to space the title and description text. + UINT m_nElapse; // Time-out value. + UINT m_nEventID; // Timer event ID. + CWnd* m_pParentWnd; // Parent window. + DWORD m_dwTipStyle; // Initial style for the tip window. See ShowTipWindow(..). + CSize m_sizeMargin; // Amount, in pixels, of the tip and side margins of where the tip text is displayed. + CRect m_rcWindow; // Initial size of the tip window. + CRect m_rcShadow; // Initial size of the tip window shadow. + CString m_strTitle; // Title text for the tip window. + CString m_strDescrip; // Description text for the tip window. + COLORREF m_crBackColor; // Background color for the tip window. + COLORREF m_crTextColor; // Text color for the tip window. + CStringArray m_arStrings; // Stores strings if the tip is multiline. + +public: + + // Input: nElapse - Specifies the time-out value, in milliseconds, of when the + // tip window should close. + // Summary: This member function will set the initial time-out value for when + // to close the tip window. + void SetTimeout(UINT nElapse); + + // Input: lpszTitle - A NULL terminated string that is to be displayed as + // the title for the tip window. + // lpszDescrip - A NULL terminated string that is to be displayed as + // the description text for the tip window. + // bRedraw - If TRUE, the tip window will be redrawn. + // Summary: This member function will set the text for the title and description + // values that are displayed in the tip window. + void SetTipText(LPCTSTR lpszTitle,LPCTSTR lpszDescrip,BOOL bRedraw=FALSE); + + // Input: crBackColor - The RGB color value for the background of the tip window. + // crTextColor - The RGB color value for the text of the tip window. + // bRedraw - If TRUE, the tip window will be redrawn. + // Summary: This member function will set the text and background colors for + // the tip window display. + void SetTipColors(COLORREF crBackColor,COLORREF crTextColor,BOOL bRedraw=FALSE); + + // BULLETED LIST: + + // Input: point - The initial x and y coordinates of where the tip window is + // to be displayed. + // pParentWnd - Points to the parent window of the tip window. + // dwTipStyle - Initial style for the tip window. The desired styles + // for the tip window can be one or more of the following: + // [ul] + // [li]TWS_XT_THICKBORDER This style will cause the tip + // window to display a thick border around its edges.[/li] + // [li]TWS_XT_DROPSHADOW This style will cause the tip + // window to cast a shadow on the parent window.[/li] + // [li]TWS_XT_ALPHASHADOW Used with TWS_XT_DROPSHADOW to display + // an alpha style shadow. By default, mono shadowing is enabled.[/li] + // [/ul] + // nElapse - Specifies the time-out value, in milliseconds, of when + // the tip window should close. + // bCenterHorz - Set this parameter to true to center the window horizontally on + // the point passed in. + // Returns: TRUE if the tip window was successfully created, otherwise returns FALSE. + // Summary: This member function will display a tip window to display a title + // and description text. + virtual BOOL ShowTipWindow(const CPoint& point,CWnd* pParentWnd,DWORD dwTipStyle=TWS_XT_DROPSHADOW,UINT nElapse=5000,bool bCenterHorz = false); + + // Input: size - Initial size for the horizontal and vertical text margins. + // Summary: This member function will set the text margins for the tip window. + void SetMargins(CSize size); + + // Input: nLineSpace - Initial size for text line spacing. + // Summary: This member function will set the line spacing for the tip window. + void SetLineSpace(int nLineSpace); + +protected: + + // Input: pDC - Device context of the window to cast the shadow on. + // rect - Initial size of the shadow. + // Summary: This member function will draw a shadow rect to the device context + // specified by 'pDC'. + void DrawShadowRect(CDC* pDC,const CRect& rect); + + // Input: point - The x and y coordinates of where the tip window is to be displayed. + // Summary: This member function will set the sizes for the tip window. + void InitializeSize(const CPoint& point); + + // Ignore: + //{{AFX_VIRTUAL(CXTTipWindow) + //}}AFX_VIRTUAL + + // Ignore: + //{{AFX_MSG(CXTTipWindow) + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg void OnPaint(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE void CXTTipWindow::SetTipText(LPCTSTR lpszTitle, LPCTSTR lpszDescrip, BOOL bRedraw) { + m_strTitle = lpszTitle; m_strDescrip = lpszDescrip; if (bRedraw) { InvalidateRect(NULL); } +} +AFX_INLINE void CXTTipWindow::SetTipColors(COLORREF crBackColor, COLORREF crTextColor, BOOL bRedraw) { + m_crBackColor = crBackColor; m_crTextColor = crTextColor; if (bRedraw) { InvalidateRect(NULL); } +} +AFX_INLINE void CXTTipWindow::SetMargins(CSize size) { + m_sizeMargin.cx = __max(3, size.cx); m_sizeMargin.cy = __max(3, size.cy); +} +AFX_INLINE void CXTTipWindow::SetLineSpace(int nLineSpace) { + m_nLineSpace = __max(2, nLineSpace); +} +AFX_INLINE void CXTTipWindow::SetTimeout(UINT nElapse) { + m_nElapse = nElapse; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTTIPWINDOW_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTToolBar.h b/Editor/XT/Include/XTToolBar.h new file mode 100644 index 0000000..9369d52 --- /dev/null +++ b/Editor/XT/Include/XTToolBar.h @@ -0,0 +1,1698 @@ +// XTToolBar.h interface for the CXTToolBar class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTOOLBAR_H__) +#define __XTTOOLBAR_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// forwards + +class CXTColorPopup; +class CXTMenu; +class CXTFrameWnd; +class CXTToolBarCtrl; +class CXTExpButton; +class CXTExpMenuWnd; +class CXTCustTbHandler; +class CXTCustomControlBarInfo; +class CXTCustomGroupItemInfo; +class CXTCustomGroups; +class CXTExpButton; +typedef CTypedPtrArray XT_CUSTOMITEMS; +class CXTIconMap; +struct XT_DROPDOWNBUTTON; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_HIDDENBUTTON is a stand alone helper structure class. It is used +// to define dynamically hidden button info. +struct XT_HIDDENBUTTON +{ + int nWidth; // Width of the hidden button. +}; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_TBBUTTON is a TBBUTTON helper structure class. It is used to create +// an XT_TBBUTTON structure object. +struct XT_TBBUTTON : public TBBUTTON +{ + // Summary: Constructs an XT_TBBUTTON object. + XT_TBBUTTON(); + + // Summary: Destroys an XT_TBBUTTON object, handles cleanup and de-allocation. + ~XT_TBBUTTON(); + + bool bOwnsButton; // true if this button is the owner of the control or dropdown. + bool bBoldFont; // true if a bold font is to be set. + bool bHidden; // true if the button is hidden. + CWnd* pWndCtrl; // Points to a CWnd object that represents the control associated with this button. + XT_DROPDOWNBUTTON* pDDButton; // Points to an XT_DROPDOWNBUTTON object that holds information about the dropdown button. +}; + +////////////////////////////////////////////////////////////////////// +AFX_INLINE XT_TBBUTTON::XT_TBBUTTON() { + bBoldFont = false; bHidden = false; bOwnsButton = true; pWndCtrl = NULL; pDDButton = NULL; +} +AFX_INLINE XT_TBBUTTON::~XT_TBBUTTON() { + if (bOwnsButton) { SAFE_DELETE( pDDButton ); } +} + +// Summary: CArray definition for popup dropped array. +typedef CArray CXTPopupDroppedArray; + +// Summary: CList definition for XT_TBBUTTON structure list. +typedef CList CXTTBButtonsList; + +// Summary: CMap definition for mapping button text to command ids. +typedef CMap CXTBtnTextCmdMap; + +// Summary: CMap definition for mapping XT_HIDDENBUTTON structures. +typedef CMap CXTHiddenButtonsMap; + +// NUMBERED LIST: + +////////////////////////////////////////////////////////////////////// +// Summary: CXTToolBar is a CXTControlBar derived class. Objects of the class CXTToolBar +// are control bars that have a row of bitmapped buttons and optional separators. +// The buttons can act like pushbuttons, check-box buttons, or radio buttons. +// CXTToolBar objects are usually embedded members of frame-window objects +// derived from the class CFrameWnd or CMDIFrameWnd. +// +// CXTToolBar::GetToolBarCtrl allows you to take advantage of the Windows +// common control's support for toolbar customization and additional functionality. +// CXTToolBar member functions give you most of the functionality of the +// Windows common controls. However, when you call GetToolBarCtrl, you +// can give your toolbars even more of the characteristics of Windows 95 +// toolbars. When you call GetToolBarCtrl, it will return a reference to +// a CXTToolBarCtrl object. See CXTToolBarCtrl for more information about +// designing toolbars using Windows common controls. For more general +// information about common controls, see Common Controls in the Windows +// 95 SDK Programmer’s Reference. +// +// Visual C++ provides you with two methods to create a toolbar. To create +// a toolbar resource using the Resource Editor, follow these steps: +// [ol] +// [li]Create a toolbar resource.[/li] +// [li]Construct the CXTToolBar object.[/li] +// [li]Call the Create, or CreateEx, function to create the Windows toolbar +// and attach it to the CXTToolBar object.[/li] +// [li]Call LoadToolBar to load the toolbar resource.[/li] +// [/ol] +// Otherwise, follow these steps: +// [ol] +// [li]Construct the CXTToolBar object.[/li] +// [li]Call the Create, or CreateEx, function to create the Windows toolbar +// and attach it to the CXTToolBar object.[/li] +// [li]Call LoadBitmap to load the bitmap that contains the toolbar button +// images.[/li] +// [li]Call SetButtons to set the button style and associate each button +// with an image in the bitmap.[/li] +// [/ol] +// All the button images in the toolbar are taken from one bitmap, which +// must contain one image for each button. All images must be the same +// size. The default is 16 pixels wide and 15 pixels high. Images must +// be side by side in the bitmap. +// +// The SetButtons function takes a pointer to an array of control IDs and +// an integer that specifies the number of elements in the array. The +// function sets each button’s ID to the value of the corresponding element +// of the array, and assigns each button an image index, which specifies +// the position of the button’s image in the bitmap. If an array element +// has the value ID_SEPARATOR, no image index is assigned. +// +// The order of the images in the bitmap is typically the order in which +// they are drawn on the screen, but you can use the SetButtonInfo function +// to change the relationship between image order and drawing order. +// +// All buttons in a toolbar are the same size. The default is 24 x 22 +// pixels, in accordance with Windows Interface Guidelines for Software +// Design. Any additional space between the image and button dimensions +// is used to form a border around the image. +// +// Each button has one image. The various button states and styles (pressed, +// up, down, disabled, disabled down, and indeterminate) are generated +// from that one image. Although bitmaps can be any color, you can achieve +// the best results with images in black and shades of gray. +// +// Toolbar buttons imitate pushbuttons by default. However, toolbar buttons +// can also imitate check-box buttons or radio buttons. Check-box buttons +// have three states: checked, cleared, and indeterminate. Radio buttons +// have only two states: checked and cleared. +// +// To set an individual button or separator style without pointing to an +// array, call GetButtonStyle to retrieve the style, and then call SetButtonStyle +// instead of SetButtons. SetButtonStyle is most useful when you want +// to change a button’s style at run time. +// +// To assign text to appear on a button, call GetButtonText to retrieve +// the text to appear on the button, and then call SetButtonText to set +// the text. +// +// To create a check-box button, assign it the style TBBS_CHECKBOX or use +// a CCmdUI object’s SetCheck member function in an ON_UPDATE_COMMAND_UI +// handler. Calling SetCheck turns a pushbutton into a check-box button. +// Pass SetCheck an argument of 0 for unchecked, 1 for checked, or 2 for +// indeterminate. +// +// To create a radio button, call a CCmdUI object’s SetRadio member function +// from an ON_UPDATE_COMMAND_UI handler. Pass SetRadio an argument of +// zero for unchecked or nonzero for checked. In order to provide a radio +// group’s mutually exclusive behavior, you must have ON_UPDATE_COMMAND_UI +// handlers for all of the buttons in the group. +class _XT_EXT_CLASS CXTToolBar : public CXTControlBar +{ + + DECLARE_DYNAMIC(CXTToolBar) + +public: + + // Summary: Constructs a CXTToolBar object. + CXTToolBar(); + + // Summary: Destroys a CXTToolBar object, handles cleanup and de-allocation. + virtual ~CXTToolBar(); + +protected: + + BOOL m_bNoEntry; // Used with a rebar for window updates. + BOOL m_bDisabledColor; // TRUE to draw a disabled button in color. + BOOL m_bDelayedButtonLayout; // Used to manage when the button layout should be done. + UINT m_uiLastCmd; // Last command ID used. + DWORD m_dwDrawTextMask; // DrawText custom flags mask. + DWORD m_dwDrawTextFlags; // DrawText custom flags. + HRSRC m_hRsrcImageWell; // Handle to the loaded resource for the image well. + CSize m_sizeImage; // Current image size. + CSize m_sizeButton; // Current button size. + CString m_strSubKey; // Registry name for the subkey. + CString m_strValueName; // Registry name for the value. + HBITMAP m_hbmImageWell; // Contains color mapped button images. + HINSTANCE m_hInstImageWell; // Instance handle to load the image well from. + CXTColorPopup* m_pColorPopup; // Pointer to a color popup window. + CMapStringToPtr* m_pStringMap; // Used as CMapStringToUInt. + CXTPopupDroppedArray m_arrPopupDropped; // array of popup item indices that currently have its popup dropped + CXTTBButtonsList m_listTBButtons; // Contains the toolbar button array. + CXTBtnTextCmdMap m_mapBtnTextCmd; // Toolbar button text to command map. + CXTHiddenButtonsMap m_mapHiddenButtons; // Dynamically hidden buttons. + +private: + bool m_bInvalidateOnMouseUp; + bool m_bOwnsDropDowns; + bool m_bCustomize; // TRUE to enable toolbar customization. + bool m_bAdjusting; // Tells if toolbar customization is currently on + bool m_bRestoringState; + bool m_bFirstDrawPass; + bool m_bForcedListStyle; + bool m_bDropCommandText; // true to create text for commands drooped on this toolbar during toolbar customization + bool m_bIdealSizeChanged; + DWORD m_dwSignatureFreshenAfter; + DWORD m_dwRestoreSignature; + DWORD m_dwInitialCRC; + DWORD m_cbOriginalState; + LPVOID m_pvOriginalState; + CXTExpButton* m_pExpButton; + CXTCustTbHandler* m_pCustomHandler; + +public: + + // Input: iDroppedItem - Command ID of the button pressed. + // bDropped - tells if this item is currently dropped down + // Summary: This member function is used to set the command ID for the dropped menu + // item. This is the command ID of the toolbar button that was pressed to + // display the popup window. + void SetDroppedItem(int iDroppedItem, bool bDropped); + + // BULLETED LIST: + + // Input: pParentWnd - Pointer to the window that is the toolbar’s parent. + // dwStyle - The toolbar style. Additional toolbar styles supported are: + // [ul] + // [li]CBRS_TOP Control bar is at the top of the frame window.[/li] + // [li]CBRS_BOTTOM Control bar is at the bottom of the frame + // window.[/li] + // [li]CBRS_NOALIGN Control bar is not repositioned when the parent is + // resized.[/li] + // [li]CBRS_TOOLTIPS Control bar displays tool tips.[/li] + // [li]CBRS_SIZE_DYNAMIC Control bar is dynamic.[/li] + // [li]CBRS_SIZE_FIXED Control bar is fixed.[/li] + // [li]CBRS_FLOATING Control bar is floating.[/li] + // [li]CBRS_FLYBY Status bar displays information about the button.[/li] + // [li]CBRS_HIDE_INPLACE Control bar is not displayed to the user.[/li] + // [/ul] + // nID - The toolbar’s child-window ID. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function creates a Windows toolbar, a child window, + // and associates it with the CXTToolBar object. It also sets the toolbar + // height to a default value. + virtual BOOL Create(CWnd* pParentWnd,DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP,UINT nID = AFX_IDW_TOOLBAR); + + // Input: pParentWnd - Pointer to the window that is the toolbar’s parent. + // dwCtrlStyle - Additional styles for the creation of the embedded CXTToolBarCtrl + // object. By default, this value is set to TBSTYLE_FLAT. For a complete + // list of toolbar styles, see 'dwStyle'. + // dwStyle - The toolbar style. See Toolbar Control and Button Styles in the Platform + // SDK for a list of appropriate styles. + // rcBorders - A CRect object that defines the widths of the toolbar window borders. + // These borders are set to (0,0,0,0) by default, resulting in a toolbar + // window with no borders. + // nID - The toolbar’s child-window ID. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to create a Windows toolbar, a child window, + // and associate it with the CXTToolBar object. It also sets the toolbar + // height to a default value. + // + // Use CreateEx, instead of Create, when certain styles need to be + // present during the creation of the embedded toolbar control. For + // example, set 'dwCtrlStyle' to TBSTYLE_FLAT | TBSTYLE_TRANSPARENT to create + // a toolbar that resembles the Internet Explorer 4 toolbars. + virtual BOOL CreateEx(CWnd* pParentWnd,DWORD dwCtrlStyle = TBSTYLE_FLAT,DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP,CRect rcBorders = CRect(0, 0, 0, 0),UINT nID = AFX_IDW_TOOLBAR); + + // Input: sizeButton - The size, in pixels, of each button. + // sizeImage - The size, in pixels, of each image. + // Summary: Call this member function to set the toolbar's buttons to the size, + // in pixels, specified in 'sizeButton'. The 'sizeImage' parameter must contain + // the size, in pixels, of the images in the toolbar's bitmap. The dimensions + // in 'sizeButton' must be sufficient to hold the image plus 7 pixels extra + // in width and 6 pixels extra in height. This function also sets the + // toolbar height to fit the buttons. + // + // Only call this member function for toolbars that do not follow Windows + // Interface Guidelines for Software Design recommendations for button + // and image sizes. + void SetSizes(SIZE sizeButton,SIZE sizeImage); + + // Input: sizeButton - The size, in pixels, of each button. + // sizeImage - The size, in pixels, of each image. + // Summary: This member function retrieves the current image size and button size. + void GetSizes(SIZE& sizeButton,SIZE& sizeImage); + + // Input: cyHeight - The height, in pixels, of the toolbar. + // Summary: This member function sets the toolbar's height to the value, in + // pixels, specified in 'cyHeight'. + // + // After calling SetSizes, use this member function to override the + // standard toolbar height. If the height is too small, the buttons will + // be clipped at the bottom. + // + // If this function is not called, the framework uses the size of the + // button to determine the toolbar height. + void SetHeight(int cyHeight); + + // Input: lpszResourceName - Pointer to the resource name of the toolbar to be loaded. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to load the toolbar specified by 'lpszResourceName'. + // See toolbar editor in the MSDN Visual C++ User’s Guide for more information + // about creating a toolbar resource. + BOOL LoadToolBar(LPCTSTR lpszResourceName); + + // Input: nIDResource - Resource ID of the toolbar to be loaded. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to load the toolbar specified by 'nIDResource'. + // See toolbar editor in the MSDN Visual C++ User’s Guide for more information + // about creating a toolbar resource. + BOOL LoadToolBar(UINT nIDResource); + + // Input: lpszResourceName - Pointer to the resource name of the bitmap to be loaded. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to load the bitmap specified by 'lpszResourceName'. + // The bitmap should contain one image for each toolbar button. If the + // images are not of the standard size (16 pixels wide and 15 pixels high), + // call SetSizes to set the button sizes and their images. + BOOL LoadBitmap(LPCTSTR lpszResourceName); + + // Input: nIDResource - Resource ID of the bitmap to be loaded. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to load the bitmap specified by 'nIDResource'. + // The bitmap should contain one image for each toolbar button. If the + // images are not of the standard size (16 pixels wide and 15 pixels high), + // call SetSizes to set the button sizes and their images. + BOOL LoadBitmap(UINT nIDResource); + + // Input: hbmImageWell - Handle of a bitmap image that is associated with a toolbar. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to set the bitmap image for the toolbar. + // For example, call SetBitmap to change the bitmapped image after the + // user takes an action on a document that changes the action of a button. + BOOL SetBitmap(HBITMAP hbmImageWell); + + // Input: lpIDArray - Pointer to an array of command IDs. It can be NULL to allocate empty + // buttons. + // nIDCount - Number of elements in the array pointed to by 'lpIDArray'. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function sets each toolbar button's command ID to the + // value specified by the corresponding element of the array 'lpIDArray'. + // If an element of the array has the value ID_SEPARATOR, a separator + // is created in the corresponding position of the toolbar. This function + // also sets each button's style to TBBS_BUTTON and each separator's style + // to TBBS_SEPARATOR, and assigns an image index to each button. The + // image index specifies the position of the button’s image within the + // bitmap. + // + // You do not need to account for separators in the bitmap because + // this function does not assign image indexes for separators. If your + // toolbar has buttons at positions 0, 1, and 3 and a separator at position + // 2, the images at positions 0, 1, and 2 in your bitmap are assigned + // to the buttons at positions 0, 1, and 3, respectively. + // + // If 'lpIDArray' is NULL, this function allocates space for the number + // of items specified by 'nIDCount'. Use SetButtonInfo to set each item’s + // attributes. + BOOL SetButtons(const UINT* lpIDArray,int nIDCount); + + // Input: nIDFind - Command ID of a toolbar button. + // Returns: The index of the button, or –1, if no button has the given command ID. + // Summary: This member function returns the index of the first toolbar button, + // starting at position 0, whose command ID matches 'nIDFind'. + int CommandToIndex(UINT nIDFind) const; + + // Input: nIndex - Index of the item whose ID is to be retrieved. + // Returns: The command ID of the button or separator specified by 'nIndex'. + // Summary: This member function retrieves the command ID of the button or separator + // specified by 'nIndex'. Separators return ID_SEPARATOR. + UINT GetItemID(int nIndex) const; + + // Input: nIndex - Index of the item (button or separator) whose rectangle coordinates + // are to be retrieved. + // lpRect - Address of the RECT structure that will contain the item’s coordinates. + // Summary: This member function fills the RECT structure whose address is contained + // in 'lpRect' with the coordinates of the button or separator specified + // by 'nIndex'. Coordinates are in pixels relative to the upper-left corner + // of the toolbar. + // + // Use GetItemRect to get the coordinates of a separator you want to + // replace with a combo box or other control. + virtual void GetItemRect(int nIndex,LPRECT lpRect) const; + + // Input: nIndex - The index of the toolbar button or separator style to be retrieved. + // Returns: The style of the button or separator specified by 'nIndex'. + // Summary: Call this member function to retrieve the style of a button or separator + // on the toolbar. A button’s style determines how the button appears + // and how it responds to user input. See SetButtonStyle for examples + // of button styles. + UINT GetButtonStyle(int nIndex) const; + + // BULLETED LIST: + + // Input: nIndex - Index of the button or separator whose information is to be set. + // nStyle - The button style. The following button styles are supported: + // [ul] + // [li]TBBS_BUTTON Standard pushbutton (default).[/li] + // [li]TBBS_SEPARATOR Separator.[/li] + // [li]TBBS_CHECKBOX Auto check-box button.[/li] + // [li]TBBS_GROUP Marks the start of a group of buttons.[/li] + // [li]TBBS_CHECKGROUP Marks the start of a group of check-box + // buttons.[/li] + // [/ul] + // Summary: Call this member function to set the style of a button or separator, + // or to group buttons. A button's style determines how the button appears + // and how it responds to user input. + // + // Before calling SetButtonStyle, call the GetButtonStyle member function + // to retrieve the button or separator style. + void SetButtonStyle(int nIndex,UINT nStyle); + + // Input: nIndex - Index of the toolbar button or separator whose information is to be + // retrieved. + // nID - Reference to a UINT that is set to the command ID of the button. + // nStyle - Reference to a UINT that is set to the style of the button. + // iImage - Reference to an integer that is set to the index of the button’s image + // within the bitmap. + // Summary: This member function retrieves the control ID, style, and image + // index of the toolbar button or separator at the location specified + // by 'nIndex'. Those values are assigned to the variables referenced by + // 'nID', 'nStyle', and 'iImage'. The image index is the position of the image + // within the bitmap that contains images for all the toolbar buttons. + // The first image is at position zero. + // + // If 'nIndex' specifies a separator, 'iImage' is set to the separator + // width, in pixels. + void GetButtonInfo(int nIndex,UINT& nID,UINT& nStyle,int& iImage) const; + + // BULLETED LIST: + + // Input: nIndex - Index of the button or separator whose information is to be set. + // nID - The value to which the button’s command ID is set. + // nStyle - The new button style. The following button styles are supported: + // [ul] + // [li]TBBS_BUTTON Standard pushbutton (default).[/li] + // [li]TBBS_SEPARATOR Separator.[/li] + // [li]TBBS_CHECKBOX Auto check-box button.[/li] + // [li]TBBS_GROUP Marks the start of a group of buttons.[/li] + // [li]TBBS_CHECKGROUP Marks the start of a group of check-box + // buttons.[/li] + // [/ul] + // iImage - New index for the button’s image within the bitmap. + // Summary: Call this member function to set the button's command ID, style, + // and image number. For separators, which have the style TBBS_SEPARATOR, + // this function sets the separator's width, in pixels, to the value stored + // in 'iImage'. + // See Also: CXTToolBar, CXTToolBar::LoadBitmap. + void SetButtonInfo(int nIndex,UINT nID,UINT nStyle,int iImage); + + // Input: nIndex - Index of the text to be retrieved. + // Returns: A CString object containing the button text. + // Summary: Call this member function to retrieve the text that appears on a + // button. + CString GetButtonText(int nIndex) const; + + // Input: nIndex - Index of the text to be retrieved. + // rString - A reference to a CString object that will contain the text to be retrieved. + // Summary: Call this member function to retrieve the text that appears on a + // button and fill the CString object with the string text. + void GetButtonText(int nIndex,CString& rString) const; + + // Input: nIndex - Index of the button whose text is to be set. + // lpszText - Points to the text to be set on a button. + // Returns: Nonzero if successful, otherwise return zero. + // Summary: Call this function to set the text on a button. + BOOL SetButtonText(int nIndex,LPCTSTR lpszText); + + // Returns: A reference to a CXTToolBarCtrl object. + // Summary: This member function allows direct access to the underlying common control. + // + // Use GetToolBarCtrl to take advantage of the functionality of the + // Windows toolbar common control, and to take advantage of the support + // CXTToolBarCtrl provides for toolbar customization. + // + // For more information about using common controls, see the article, + // "Control Topics" in MSDN Visual C++ Programmer’s Guide and "Common + // Controls" in the Windows 95 SDK Programmer’s Reference. + CXTToolBarCtrl& GetToolBarCtrl() const; + + // Input: nID - Command identifier of the button in the toolbar. + // Returns: Nonzero if the button is enabled, otherwise returns zero. + // Summary: Call this function to determine whether the specified button, in + // a toolbar control, is enabled. Consider calling GetState if you want + // to retrieve more than one button state. + BOOL IsButtonEnabled(int nID) const; + + // Input: nID - Command identifier of the button in the toolbar. + // Returns: Nonzero if the button is checked, otherwise returns zero. + // Summary: Call this function to determine whether the specified button, in + // a toolbar control, is checked. Consider calling GetState if you want + // to retrieve more than one button state. + BOOL IsButtonChecked(int nID) const; + + // Input: nID - Command identifier of the button in the toolbar. + // Returns: Nonzero if the button is pressed, otherwise returns zero. + // Summary: Call this function to determine whether the specified button, in + // a toolbar control, is pressed. Consider calling GetState if you want + // to retrieve more than one button state. + BOOL IsButtonPressed(int nID) const; + + // Input: nID - Command identifier of the button in the toolbar. + // Returns: Nonzero if the button is hidden, otherwise returns zero. + // Summary: Call this function to determine whether the specified button, in + // a toolbar control, is hidden. Consider calling GetState if you want + // to retrieve more than one button state. + BOOL IsButtonHidden(int nID) const; + + // Input: nID - Command identifier of the button in the toolbar. + // Returns: Nonzero if the button is indeterminate, otherwise returns zero. + // Summary: Call this function to determine whether the specified button, in + // a toolbar control, is indeterminate. Indeterminate buttons are displayed + // grayed, such as the way the bold button on the toolbar of a word processor + // would look when the text selected contains both bold and regular characters. + // + // Consider calling GetState if you want to retrieve more than one + // button state. + BOOL IsButtonIndeterminate(int nID) const; + + // Input: nID - Command identifier of the button in the toolbar. + // nState - State flags. It can be a combination of the values listed for button + // states in CXTToolBar::AddButtons. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to set the state for the specified button in + // a toolbar control. + // + // This function is especially handy if you want to set more than one + // of the button states. To just set one state, use one of the following + // member functions: EnableButton, CheckButton, HideButton, Indeterminate, + // or PressButton. + BOOL SetState(int nID,UINT nState); + + // Input: nID - Command identifier of the button in the toolbar. + // Returns: The button state information if successful, or returns –1, otherwise. + // The button state information can be a combination of the values listed + // in CXTToolBar::AddButtons. + // Summary: Call this function to retrieve information about the state of the + // specified button in a toolbar control, such as whether it is enabled, + // pressed, or checked. + // + // This function is especially handy if you want to retrieve more than + // one of the button states. To just retrieve one state, use one of the + // following member functions: IsButtonEnabled, IsButtonChecked, IsButtonPressed, + // IsButtonHidden, or IsButtonIndeterminate. However, the GetState member + // function is the only way to detect the TBSTATE_WRAP button state. + int GetState(int nID) const; + + // Input: nIndex - Zero-based index of the button for which to retrieve information. + // pButton - Address of the TBBUTTON structure that is to receive a copy of the + // button information. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to retrieve information about the specified button + // in a toolbar control. + // See Also: CXTToolBar::AddButtons for information about the TBBUTTON structure. + BOOL GetButton(int nIndex,TBBUTTON* pButton) const; + + // Returns: An integer value that represents the count of the toolbar control buttons. + // Summary: Call this function to retrieve a count of the buttons currently + // in the toolbar control. + int GetButtonCount() const; + + // Input: nIdButton - Button identifier. + // rc - Address of a RECT structure that will receive the bounding rectangle + // information. + // Returns: Nonzero if successful, or zero otherwise. + // Summary: This member function retrieves the bounding rectangle for a specified + // toolbar button. + BOOL GetRect(UINT nIdButton,RECT& rc) const; + + // Input: nSize - Size, in bytes, of the TBBUTTON structure. + // Summary: Call this function to specify the size of the TBBUTTON structure. + // If you wanted to store extra data in the TBBUTTON structure, you could + // either derive a new structure from TBBUTTON, adding the members you + // needed, or create a new structure that contains a TBBUTTON structure + // as its first member. You would then call this function to tell the + // toolbar control the size of the new structure. + // + // See Also: CXTToolBar::AddButtons for more information on the TBBUTTON + // structure. + void SetButtonStructSize(int nSize); + + // Input: pData - Address of the TBBUTTON structure that is to receive a copy of the + // button information. + // iButton - Zero-based index of the button for which to retrieve information. + // Returns: A CSize value that contains the width and height values. + // Summary: Call this member function to get the size of a toolbar button. + virtual CSize GetButtonSize(TBBUTTON* pData,int iButton); + + // Input: size - Width and height, in pixels, of the buttons. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to set the size of the buttons in the toolbar + // control. The button size must always be at least as large as the bitmap + // size it encloses. + // + // This function must be called only before adding any bitmaps to the + // toolbar. If the application does not explicitly set the button size, + // it defaults to 24 by 22 pixels. + BOOL SetButtonSize(CSize size); + + // Input: size - Width and height, in pixels, of the bitmapped images. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to set the size of the actual bitmapped images + // to be added to a toolbar control. + // + // This function must be called only before adding any bitmaps to the + // toolbar. If the application does not explicitly set the bitmap size, + // it defaults to 16 by 15 pixels. + BOOL SetBitmapSize(CSize size); + + // Returns: A pointer to the CToolTipCtrl object associated with this toolbar, or NULL, + // if the toolbar has no associated tooltip control. + // Summary: Call this function to retrieve the handle of the tooltip control, + // if any, associated with the toolbar control. Since the toolbar control + // normally creates and maintains its own tooltip control, most programs + // do not need to call this function. + CToolTipCtrl* GetToolTips() const; + + // Input: pTip - Pointer to the CToolTipCtrl object. + // Summary: Call this function to associate a tooltip control with a toolbar + // control. + void SetToolTips(CToolTipCtrl* pTip); + + // Input: pOwnerWnd - Pointer to the CWnd or CWnd-derived object that will be the new owner + // window for the toolbar control. + // Summary: Call this function to set the owner window for the toolbar control. + // The owner window is the window that receives notifications from the + // toolbar. + virtual void SetOwner(CWnd* pOwnerWnd); + + // Input: nRows - Requested number of rows. + // bLarger - Tells whether to use more rows (TRUE) or fewer rows (FALSE) if the + // toolbar cannot be resized to the requested number of rows. + // lpRect - Points to the CRect object or RECT structure that will receive the + // new bounding rectangle of the toolbar. + // Summary: Call this function to ask the toolbar control to resize itself to + // the requested number of rows. + // + // If the toolbar cannot resize itself to the requested number or rows, + // it will resize itself to either the next larger or next smaller valid + // size, depending on the value of 'bLarger'. If 'bLarger' is TRUE, the new + // number of rows will be larger than the number requested. If 'bLarger' + // is FALSE, the new number of rows will be smaller than the number requested. + // + // A given number of rows is valid for the toolbar, if the buttons + // can be arranged such that all of the rows have the same number of buttons, + // except perhaps the last row. For example, a toolbar that contains + // four buttons could not be sized to three rows because the last two + // rows would have to be shorter. If you attempted to size it to three + // rows, you would get four rows if 'bLarger' was TRUE and two rows if 'bLarger' + // was FALSE. + // + // If there are separators in the toolbar, the rules for when a given + // number of rows is valid are more complicated. The layout is computed + // such that button groups, buttons with a separator before the first + // and the last button in the group, are never broken up on several rows + // unless the group cannot fit on one row. + // + // If a group does not fit on one row, the next group will start on + // the next row even if it would fit on the row where the large group + // ended. The purpose of this rule is to make the separation between + // large groups more noticeable. The resulting vertical separators are + // counted as rows. + // + // Note, also, that the SetRows member function will always choose the + // layout that results in the smallest toolbar size. Creating a toolbar + // with the TBSTYLE_WRAPABLE style and then resizing the control will + // simply apply the method outlined above given the width of the control. + // + // This function can only be called for toolbars that were created + // with the TBSTYLE_WRAPABLE style. + void SetRows(int nRows,BOOL bLarger,LPRECT lpRect); + + // Returns: The number of rows of buttons currently displayed on the toolbar. + // Summary: Call this function to retrieve the number of rows of buttons currently + // displayed by the toolbar control. Note that the number of rows will + // always be one, unless the toolbar was created with the TBSTYLE_WRAPABLE + // style. + int GetRows() const; + + // Input: nIndex - The zero-based index of the button whose command ID is to be set. + // nID - The command ID to set the selected button to. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to set the command identifier which will be sent + // to the owner window when the specified button is pressed. + BOOL SetCmdID(int nIndex,UINT nID); + + // Returns: A UINT that has the TBBF_LARGE flag set if the display can support + // large toolbar bitmaps, clear otherwise. + // Summary: Call this function to retrieve the bitmap flags from the toolbar. + // You should call it after creating the toolbar but before adding bitmaps + // to the toolbar. + // + // The return value indicates whether the display supports large bitmaps + // or not. If the display supports large bitmaps, and if you choose to + // use them, call SetBitmapSize and SetButtonSize before adding your large + // bitmap using AddBitmap. + UINT GetBitmapFlags() const; + + // Returns: A pointer to a CImageList object, or NULL if no disabled image list is set. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETIMAGELIST, as described in the Platform SDK. + HIMAGELIST GetImageList() const; + + // Returns: A DWORD containing a combination of toolbar control styles, as described + // in the Platform SDK. + // Summary: Call this member function to get the styles currently applied to + // a toolbar control. + DWORD GetToolbarStyle() const; + + // Input: hImgList - A handle to an HIMAGELIST object containing the images to be used + // by the toolbar control to display button images in their default state. + // bEnabled - FALSE if image list is set for disabled icons + // Returns: A pointer to an HIMAGELIST handle that was + // previously used by the toolbar control to display button images in + // their default state. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETIMAGELIST, as described in the Platform SDK. + // + // The MFC implementation of SetImageList uses a CImageList object + // containing the toolbar control's button images, rather than a handle + // to an image list. + HIMAGELIST SetImageList(HIMAGELIST hImgList,BOOL bEnabled = TRUE); + + // Input: indent - The value specifying the indentation, in pixels. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to set the indentation for the first button + // in a toolbar control. + BOOL SetIndent(int indent); + + // Input: dwStyle - A DWORD containing a combination of toolbar control styles, as described + // in the Platform SDK. + // Summary: Call this member function to set the styles for a toolbar control. + void SetToolbarStyle(DWORD dwStyle); + + // Returns: The zero-based index of the hot item in a toolbar. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETHOTITEM, as described in the Platform SDK. + int GetHotItem() const; + + // Input: nIndex - The zero-based index of the button whose command ID is to be set. + // Returns: true if the index matches an item that has its popup dropped down, or + // false, if the item does not. + // Summary: This member checks to see if the item at given position has its + // popup dropped down. + bool IsDroppedItem(int nIndex) const; + + // Returns: true if at least one item has its popup dropped down or false otherwise. + // Summary: This member checks to see if there is at least one item that has its + // popup dropped down. + bool IsDroppedItem() const; + + // Input: iHot - The zero-based index number of the item that will be made hot. If + // this value is -1, none of the items will be hot. + // Returns: The index of the previous hot item, or -1 if there was no hot item. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETHOTITEM, as described in the Platform SDK. + int SetHotItem(int iHot); + + // Returns: A DWORD that represents the extended styles currently in use for the toolbar + // control. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETEXTENDEDSTYLE, as described in the Platform SDK. For a list of styles, + // see Toolbar Extended Styles, in the Platform SDK. + DWORD GetExtendedStyle() const; + + // Input: dwStyle - A value specifying the new extended styles. This parameter can be + // a combination of the toolbar extended styles. + // Returns: A DWORD that represents the previous extended styles. For a list of styles, + // see Toolbar Extended Styles, in the Platform SDK. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETEXTENDEDSTYLE, as described in the Platform SDK. + DWORD SetExtendedStyle(DWORD dwStyle); + + // Input: ch - Accelerator character to be mapped. This character is the same + // character that is underlined in the button's text. + // nID - A reference to a UINT that receives the command identifier of + // the button that corresponds to the accelerator specified in 'ch'. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // TB_MAPACCELERATOR, as described in the Platform SDK. + BOOL MapAccelerator(TCHAR ch,UINT& nID) const; + + // Input: p - A CPoint object that contains the x-coordinate of the hit test in + // the x member and the y-coordinate of the hit test in the y member. + // The coordinates are relative to the toolbar's client area. + // Returns: An integer value indicating the location of a point on a toolbar. + // If the value is zero or a positive value, this return value is the + // zero-based index of the non-separator item in which the point lies. + // If the return value is negative, the point does not lie within a button. + // The absolute value of the return value is the index of a separator item + // or the nearest non-separator item. + // Summary: This member function implements the behavior of the Win32 message + // TB_HITTEST, as described in the Platform SDK. + int HitTest(CPoint p) const; + + // Input: nID - Command identifier of the button to enable or disable. + // bEnable - TRUE to enable the button, or FALSE to disable the button. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to enable or disable the specified button in + // a toolbar control. When a button has been enabled, it can be pressed + // and checked. If you want to change more than one button state, consider + // calling SetState instead. + BOOL EnableButton(int nID,BOOL bEnable); + + // Input: nID - Command identifier of the button to check or clear. + // bCheck - TRUE to check the button, or FALSE to clear it. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to check or clear a given button in a toolbar + // control. When a button has been checked, it appears to have been pressed. + // If you want to change more than one button state, consider calling + // SetState instead. + BOOL CheckButton(int nID,BOOL bCheck); + + // Input: nID - Command identifier of the button to press or release. + // bPress - TRUE to press the specified button, or FALSE to release the specified + // button. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to press or release the specified button in a + // toolbar control. If you want to change more than one button state, + // consider calling SetState instead. + BOOL PressButton(int nID,BOOL bPress); + + // Input: nID - Command identifier of the button to hide or show. + // bHide - TRUE to hide the button, or FALSE to show it. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to hide or show the specified button in a toolbar + // control. If you want to change more than one button state, consider + // calling SetState instead. + BOOL HideButton(int nID,BOOL bHide); + + // Input: nID - Command identifier of the button whose indeterminate state is to be + // set or cleared. + // bIndeterminate - TRUE to set the indeterminate state for the specified button, or FALSE + // to clear it. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to set or clear the indeterminate state of the + // specified button in a toolbar control. Indeterminate buttons are displayed + // grayed, such as the way the bold button on the toolbar of a word processor + // would look when the text selected contains both bold and regular characters. + // + // If you want to change more than one button state, consider calling + // SetState instead. + BOOL Indeterminate(int nID,BOOL bIndeterminate); + + // BULLETED LIST: + + // Input: nNumButtons - Number of buttons to add. + // lpButtons - Address of an array of TBBUTTON structures that contain information + // about the buttons to add. There must be the same number of elements + // in the array as buttons specified by 'nNumButtons'. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to add one or more buttons to a toolbar control. + // + // The 'lpButtons' pointer points to an array of TBBUTTON structures. + // Each TBBUTTON structure associates the button being added with the + // button’s style, image and/or string, command ID, state, and user-defined + // data: + // + //
+	//			 typedef struct _TBBUTTON {
+    //			     int iBitmap;    // Zero-based index of the button image
+    //			     int idCommand;  // Command to be sent when the button is pressed
+    //			     BYTE fsState;   // Button state--see below
+    //			     BYTE fsStyle;   // Button style--see below
+    //			     DWORD dwData;   // Application-defined value
+    //			     int iString;    // Zero-based index of the button label string
+    //			 } TBBUTTON;
+ // + // The members are as follows: + // [ul] + // [li]iBitmap Zero-based index of the button image. NULL if there is no + // image for this button.[/li] + // [li]idCommand Command identifier associated with the button. + // This identifier is sent in a WM_COMMAND message when the button + // is chosen. If the 'fsStyle' member has the TBSTYLE_SEP value, + // this member must be zero.[/li] + // [li]fsState Button state flags. It can be a combination + // of the values listed below: + // [ul] + // [li]TBSTATE_CHECKED The button has the TBSTYLE_CHECKED + // style and is being pressed.[/li] + // [li]TBSTATE_ENABLED The button accepts user input. A + // button that does not have this state does not accept user + // input and is grayed.[/li] + // [li]TBSTATE_HIDDEN The button is not visible and cannot + // receive user input.[/li] + // [li]TBSTATE_INDETERMINATE The button is grayed.[/li] + // [li]TBSTATE_PRESSED The button is being pressed.[/li] + // [li]TBSTATE_WRAP A line break follows the button. The + // button must also have the TBSTATE_ENABLED state.[/li] + // [/ul][/li] + // [li]fsStyle Button style. It can be a combination of the + // values listed below: + // [ul] + // [li]TBSTYLE_BUTTON Creates a standard push button.[/li] + // [li]TBSTYLE_CHECK Creates a button that toggles between + // the pressed and unpressed states each time the user clicks + // it. The button has a different background color when it is + // in the pressed state.[/li] + // [li]TBSTYLE_CHECKGROUP Creates a check button that stays + // pressed until another button in the group is pressed.[/li] + // [li]TBSTYLE_GROUP Creates a button that stays pressed + // until another button in the group is pressed.[/li] + // [li]TBSTYLE_SEP Creates a separator, providing a small + // gap between button groups. A button that has this style does + // not receive user input.[/li] + // [/ul][/li] + // [li]dwData User-defined data.[/li] + // [li]iString Zero-based index of the string to use as the + // button’s label. NULL if there is no string for this button.[/li] + // [/ul] + // The image and/or string whose index you provide must have previously + // been added to the toolbar control’s list using AddBitmap, AddString, + // and/or AddStrings. + // See Also: CXTToolBar::GetButton, CXTToolBar::SetButtonStructSize, + // CXTToolBar::InsertButton + BOOL AddButtons(int nNumButtons,LPTBBUTTON lpButtons); + + // Input: nIndex - Zero-based index of a button. This function inserts the new button + // to the left of this button. + // lpButton - Address of a TBBUTTON structure containing information about the button + // to insert. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to insert a button in a toolbar control. + // + // The image and/or string whose index you provide must have previously + // been added to the toolbar control’s list using AddBitmap, AddString, + // and/or AddStrings. + // See Also: CXTToolBar::AddButtons for a description of the TBBUTTON structure. + BOOL InsertButton(int nIndex,LPTBBUTTON lpButton); + + // Input: nIndex - Zero-based index of the button to delete. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this function to delete a button from the toolbar control. + BOOL DeleteButton(int nIndex); + + // Summary: Call this function to restore the state of the toolbar control from + // the location in the registry. + void RestoreState(); + + // Summary: Call this function to save the state of the toolbar control to the + // location in the registry. + void SaveState(); + + // Summary: Call this function to display the Customize Toolbar dialog box. + // This dialog box allows the user to customize the toolbar by adding + // and deleting buttons. + void Customize(); + + // Input: lpszStrings - Address of a buffer that contains one or more null-terminated + // strings to add to the toolbar’s string list. The last string must + // be terminated with two null characters. + // Returns: The zero-based index of the first new string added if successful, otherwise + // returns –1. + // Summary: Call this function to add a new string or strings to the list of + // strings available for a toolbar control. Strings in the buffer must + // be separated by a null character. + // + // You must ensure that the last string has two null terminators. + // To properly format a constant string, you might write it as: + // + //
+	//			// one null added automatically
+    //			lpszStrings = "Only one string to add\0";
+ // + // or: + // + //
+	//			// adds three strings with one call
+    //			lpszStrings = "String 1\0String 2\0String 3\0";
+ // + // You should not pass a CString object to this function since it is + // not possible to have more than one null character in a CString. + int AddStrings(LPCTSTR lpszStrings); + + // Summary: Call this function to resize the entire toolbar control. You should + // call this function when the size of the parent window changes, or when + // the size of the toolbar changes, such as when you set the button or + // bitmap size, or add strings. + void AutoSize(); + + //Operations +public: + + // Returns: true to indicate success, or false to indicate failure. + // Summary: Call this function to save all toolbars in the same list as + // CMainFrame::m_wndToolBar. This function will also write the XT library + // version number into the root key of the toolbar subsection, for future + // compatibility reasons. + bool SaveToolbars(); + + // Input: tbMaster - A pointer to a valid CXTToolBar object. + // menuMaster - A pointer to a valid CXTMenu object. + // Returns: The number of toolbars loaded successfully. + // Summary: Call this function to load toolbars and their button layouts. This + // function returns the number of toolbars successfully loaded. It is + // called after the standard toolbar loading code and before + // LoadBarState. First, the standard toolbars are loaded, so that their + // variables, in CMainFrame, are properly initialized. Then, this function + // adds any missing toolbars and resets the buttons of the standard toolbars + // to what they were saved as. Finally, LoadBarState restores the positions + // and so on. + // + // The two parameters passed in are the master menu and toolbar, from + // which all icons and strings come. Both have the resource ID, IDR_XTMASTER, + // in the main application resources. + int LoadToolbars(CXTToolBar * tbMaster, CXTMenu * menuMaster); + + // Returns: A pointer to a CXTToolbar object. + // Summary: This function allows you to gain access to the toolbar list when you + // do not have a toolbar instance available. This is the reason it is static. + // The reason for having a CXTToolbar list inside the toolbars is to allow + // stepping only through toolbars, without having to step through the + // control bar list and check each to see if it is a toolbar. + // CXTFrameWnd::m_listControlBars is in fact where the pointer comes from. + static CXTToolBar * GetTBListHead(); + + // Returns: true if it is being customized, otherwise returns false. + // Summary: This member function tells if this toolbar is currently being customized. + bool IsAdjustingToolbar() const; + + // Returns: TRUE to display the chevron button, otherwise returns FALSE. + // Summary: This member function tells if this toolbar shall render an 'expansion + // available' chevron button when the bar is only partially visible. + // Default is to display the button. + virtual BOOL IsExpansionButton(); + + // Returns: true if expansion button contains a 'Customize' + // toolbar command, otherwise returns false. + // Summary: This member function tells if expansion button contains a 'Customize' + // toolbar command. + bool IsExpansionCustomizes(); + + // Returns: TRUE if the expansion button will display a chevron, + // otherwise returns FALSE. + // Summary: This member function tells if the expansion button will display + // a chevron showing more buttons available. Valid if IsExpansionButton() returns + // TRUE. + virtual BOOL IsExpansionChevron(); + + // Returns: true if the expansion chevron points horizontally, otherwise returns false. + // Summary: This member function tells if the expansion chevron points horizontally. + // Applicable if IsExpansionChevron() returns TRUE. + virtual bool IsChevronHorizontal(); + + // Input: dimesionCurrent - Current total size of the buttons hidden. + // dimensionMin - Current visible toolbar size. + // bHorz - true if the toolbar is horizontally oriented. + // Returns: An integer value that represents the current compaction of the buttons. + // Summary: This member function is called by the toolbar to auto-hide toolbar + // buttons when the framework is sizing. + int CompactButtons(int dimesionCurrent,int dimensionMin,bool bHorz); + + // Input: currentDimension - Current total size of the buttons hidden. + // dimesion - Current visible toolbar size. + // bHorz - true if the toolbar is horizontally oriented. + // Returns: An integer value that represents the current compaction of the buttons. + // Summary: This member function is called by the toolbar to auto-display toolbar + // buttons when the framework is sizing. + int ExpandButtons(int currentDimension,int dimesion,bool bHorz); + + // Returns: A CSize object. + // Summary: This member function calculates the minimum extent for this toolbar + // (at least one button visible). + CSize GetMinExtent(); + + // Input: dwFlags - Default DrawText() flags. + // Returns: A DWORD value containing the adjusted flags. + // Summary: This member function adjusts DrawText() flags, as specified with + // SetDrawTextFlags(). + // See also: TB_SETDRAWTEXTFLAGS. + DWORD GetDrawTextFlags(DWORD dwFlags) const; + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides of + // its parent window to which the control bar can be docked, if supported. + // It can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control bar will not + // dock. + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDocking(DWORD dwDockStyle); + + // BULLETED LIST: + + // Input: dwDockStyle - Specifies whether the control bar supports docking and the sides of + // its parent window to which the control bar can be docked, if supported. + // It can be one or more of the following: + // [ul] + // [li]CBRS_ALIGN_TOP Allows docking at the top of the + // client area.[/li] + // [li]CBRS_ALIGN_BOTTOM Allows docking at the bottom of + // the client area.[/li] + // [li]CBRS_ALIGN_LEFT Allows docking on the left side + // of the client area.[/li] + // [li]CBRS_ALIGN_RIGHT Allows docking on the right side + // of the client area.[/li] + // [li]CBRS_ALIGN_ANY Allows docking on any side of the + // client area.[/li] + // [li]CBRS_FLOAT_MULTI Allows multiple control bars to + // be floated in a single mini-frame window.[/li] + // [/ul] + // If 0 (that is, indicating no flags), the control bar will not + // dock. + // dwFlatStyle - Specifies the look of the splitters that are inside dockbars. + // It can be one of the following: + // [ul] + // [li]CBRS_XT_NONFLAT Thick devstudio like non-flat splitters.[/li] + // [li]CBRS_XT_SEMIFLAT Thin 3D non-flat splitters.[/li] + // [li]CBRS_XT_FLAT Flat splitters.[/li] + // [/ul] + // Summary: Call this function to enable a control bar to be docked. The sides + // specified must match one of the sides enabled for docking in the destination + // frame window, or the control bar cannot be docked to that frame window. + void EnableDockingEx(DWORD dwDockStyle,DWORD dwFlatStyle); + + // Input: hbmImageWell - An HBITMAP structure that contains the information for the new bitmap. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function replaces an existing bitmap with a new bitmap. + BOOL AddReplaceBitmap(HBITMAP hbmImageWell); + + // Input: nIndex - The index at which to set the button. + // pButton - Points to a valid TBBUTTON struct. + // Summary: This member function replaces the button at the specified index. + void SetButton(int nIndex,TBBUTTON* pButton); + + // Input: nIDButton - Command ID for the toolbar button. + // nIDMenu - Resource ID of the popup menu to display. If none is specified, you + // can use the CBRN_XT_DROPDOWN message that is sent from the toolbar + // to its owner to handle the dropdown event. + // bArrow - TRUE if an arrow is to be displayed. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to add a dropdown arrow to a toolbar. + // A dropdown arrow can be used to display a popup menu or popup window. + BOOL AddDropDownButton(UINT nIDButton,UINT nIDMenu=0,BOOL bArrow=TRUE); + + // BULLETED LIST: + + // Input: nIDButton - Command ID for the toolbar button. + // clrColor - An RGB value that represents the current color for the color picker. + // clrDefault - An RGB value that represents the default color for the color picker. + // dwPopup - Color picker style. Styles to be added can be combined by using the + // bitwise OR (|) operator and can be one or more of the following: + // [ul] + // [li]CPS_XT_NOFILL The color picker will display a No Fill + // button rather than the default Automatic Color button.[/li] + // [li]CPS_XT_EXTENDED The color picker will display 40 extended + // colors rather than the default 16 colors.[/li] + // [li]CPS_XT_MORECOLORS The color picker will display a More + // Colors button which will display a CXTColorDialog.[/li] + // [li]CPS_XT_SHOW3DSELECTION Displays the color selection box + // with a 3D raised border in CXTColorDialog.[/li] + // [li]CPS_XT_SHOWHEXVALUE Displays the hex equivalent of the + // selected color.[/li] + // [/ul] + // bShowColor - TRUE to display the color on the toolbar button. + // bArrow - TRUE if an arrow is to be displayed. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to add a dropdown arrow to a toolbar + // that contains a color picker. A dropdown arrow can be used to display + // a popup menu or popup window as well. + BOOL AddDropDownButton(UINT nIDButton,COLORREF clrColor,COLORREF clrDefault=CLR_DEFAULT,DWORD dwPopup=CPS_XT_EXTENDED|CPS_XT_MORECOLORS,BOOL bShowColor=TRUE,BOOL bArrow=TRUE); + + // Input: nID - Command ID of the toolbar button. + // Returns: A pointer to a valid XT_DROPDOWNBUTTON structure. + // Summary: This member function is called to retrieve a pointer to the XT_DROPDOWNBUTTON + // for the toolbar button specified by 'nID'. + XT_DROPDOWNBUTTON* FindDropDownButton(UINT nID); + + // Input: bStretch - Indicates whether the bar should be stretched to the size of the frame. + // The 'bStretch' parameter is nonzero when the bar is not a docking bar + // (not available for docking) and is zero when it is docked or floating + // (available for docking). + // bHorz - Indicates that the bar is horizontally or vertically oriented. The + // 'bHorz' parameter is nonzero if the bar is horizontally oriented, and + // is zero if it is vertically oriented. + // Returns: The control bar size, in pixels, of a CSize object. + // Summary: Call this member function to calculate the horizontal size of a + // control bar. Control bars, such as toolbars, can stretch horizontally + // or vertically to accommodate the buttons contained in the control bar. + virtual CSize CalcFixedLayout(BOOL bStretch,BOOL bHorz); + + // BULLETED LIST: + + // Input: nLength - The requested dimension of the control bar, either horizontal or vertical, + // depending on 'nMode'. + // nMode - The following predefined flags are used to determine the height and + // width of the dynamic control bar. Use the bitwise-OR (|) operator to + // combine the flags. + // [ul] + // [li]LM_STRETCH Indicates whether the control bar should be + // stretched to the size of the frame. Set if the bar is not a + // docking bar (not available for docking). Not set when the bar + // is docked or floating (available for docking). If set, LM_STRETCH + // ignores 'nLength' and returns dimensions based on the LM_HORZ + // state. LM_STRETCH works similarly to the 'bStretch' parameter + // used in CalcFixedLayout. See that member function for more information + // about the relationship between stretching and orientation.[/li] + // [li]LM_HORZ Indicates that the bar is horizontally or vertically + // oriented. Set if the bar is horizontally oriented, and if it + // is vertically oriented, it is not set. LM_HORZ works similarly + // to the 'bHorz' parameter used in CalcFixedLayout. See that member function + // for more information about the relationship between stretching + // and orientation.[/li] + // [li]LM_MRUWIDTH Most Recently Used Dynamic Width. Ignores the + // 'nLength' parameter and uses the remembered most recently used + // width.[/li] + // [li]LM_HORZDOCK Horizontal Docked Dimensions. Ignores the 'nLength' + // parameter and returns the dynamic size with the largest width.[/li] + // [li]LM_VERTDOCK Vertical Docked Dimensions. Ignores the 'nLength' + // parameter and returns the dynamic size with the largest height.[/li] + // [li]LM_LENGTHY Set if 'nLength' indicates height (Y-direction) + // instead of width.[/li] + // [li]LM_COMMIT Resets LM_MRUWIDTH to the current width of the floating + // control bar.[/li] + // [/ul] + // Returns: A CSize object that represents the control bar size, in pixels. + // Summary: The framework calls this member function to calculate the dimensions + // of a dynamic toolbar. Override this member function to provide your + // own dynamic layout in classes you derive from CControlBar. MFC classes + // derived from CControlBar, such as CToolbar, override this member function + // and provide their own implementation. + virtual CSize CalcDynamicLayout(int nLength,DWORD nMode); + + // BULLETED LIST: + + // Input: point - Specifies the x- and y-coordinate of the cursor. These coordinates + // are always relative to the upper-left corner of the window. + // pTI - A pointer to a TOOLINFO structure. The following structure values + // are set by default: + // [ul] + // [li]hwnd = m_hWnd Handle to a window.[/li] + // [li]uId = (UINT)hWndChild Handle to a child window.[/li] + // [li]uFlags |= TTF_IDISHWND Handle of the tool.[/li] + // [li]lpszText = LPSTR_TEXTCALLBACK Pointer to the string that + // is to be displayed in the specified window.[/li] + // [/ul] + // Returns: 1, if the tooltip control was found, or -1, if the tooltip control was not found. + // Summary: The framework calls this member function to determine whether a point + // is in the bounding rectangle of the specified tool. If the point is + // in the rectangle, it retrieves information about the tool. If the area + // with which the tooltip is associated is not a button, OnToolHitTest + // sets the structure flags to TTF_NOTBUTTON and TTF_CENTERTIP. Override + // OnToolHitTest to provide different information than the default provides. + // See TOOLINFO, in the Win32 SDK Programmer’s Reference, for more information + // about the structure. + virtual INT_PTR OnToolHitTest(CPoint point,TOOLINFO* pTI) const; + + // Input: pTarget - A pointer to the main frame window of the application. This pointer + // is used for routing update messages. + // bDisableIfNoHndler - Flag that indicates whether a control that has no update handler should + // be automatically displayed as disabled. + // Summary: This member function is called by the framework to update the status + // of the toolbar or status bar. To update an individual button or pane, + // use the ON_UPDATE_COMMAND_UI macro in your message map to set an update + // handler appropriately. See ON_UPDATE_COMMAND_UI for more information + // about using this macro. OnUpdateCmdUI is called by the framework when + // the application is idle. The frame window to be updated must be a child + // window, at least indirectly, of a visible frame window. OnUpdateCmdUI + // is an advanced overridable. + virtual void OnUpdateCmdUI(CFrameWnd* pTarget,BOOL bDisableIfNoHndler); + + // Input: pWnd - A pointer to a valid CWnd object. + // bBoldFont - true if the newly inserted control should have a bold font. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is called to insert a control into a toolbar. + // You can add a control to your toolbar by adding a place holder button + // to your toolbar. This button will represent where in the toolbar you + // want your control to be placed. Once you have done this, you can create + // your control using the command ID for the toolbar button you just created. + virtual BOOL InsertControl(CWnd* pWnd,bool bBoldFont=false); + + // Input: bEnable - TRUE to enable customization. + // Summary: Call this member function to enable or disable customization for + // the toolbar. If enabled you can right click on the toolbar or choose + // the expansion button at the end of the toolbar to display the customize + // button. + void EnableCustomization(bool bEnable=true); + + // Returns: true if customization has been enabled, otherwise returns false. + // Summary: Call this member function to determine if customization is enabled + // for the toolbar. + bool IsCustomizable() const; + + // obsolete + + void SetCustomBar(bool bCustomBar=true); + bool GetCustomBar() const; + + // Input: bDisabledColor - TRUE to display disabled toolbar buttons in color. + // Summary: Call this member function to display disabled toolbar icons colorized. + void ColorizeDisabledItems(BOOL bDisabledColor=TRUE); + + // Input: nIdButton - Command ID of a toolbar button. + // Returns: An integer value index from the toolbar's image list for the specified button. + // Summary: Call this member function to retrieve the index into the toolbar's + // image list for the button specified by 'nIdButton'. + int GetBitmap(UINT nIdButton) const; + + // Returns: A CSize object. + // Summary: This member function retrieves the amount of horizontal and vertical + // space (padding) around the text and image displayed on the buttons + // for this toolbar. + CSize GetPadding() const; + + // Input: size - A CSize object. + // Returns: A CSize object. + // Summary: This member function sets the amount of horizontal and vertical + // space (padding) around the text and image displayed on the buttons + // for this toolbar. + CSize SetPadding(CSize size); + + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to auto-size the toolbar. This will adjust + // the toolbar to the correct size whenever a control or text has been + // added. + BOOL AutoSizeToolbar(); + + // Input: bWithText - Buttons shall be created with text and icons if true, or with an + // icon only if false. + // Summary: This member function sets a flag telling that command buttons dropped + // during toolbar customization on this toolbar shall be created with + // text and icon or with icon only. + void SetDropCommandWithText(bool bWithText); + + // Returns: An RGB color value. + // Summary: This member function is used to determine the correct background fill + // color to be used during paint operations. + virtual COLORREF GetBackgroundColor() const; + + // Input: pPopup - Points to a valid CXTMenu object. + // rect - Size and location of the popup menu. + // Summary: This member function is used to display a popup menu associated with a + // toolbar button drop arrow. + void TrackMenuPopup(CXTMenu* pPopup,const CRect& rect); + + // Input: rcExclude - Area that the popup should not overlap. + // szPopup - Size of the popup. + // Returns: A CPoint object that represents the tracking point for the popup associated + // with the drop down toolbar button. + // Summary: This member function is called to determine the popup tracing point for a + // toolbar button that has a popup window. + CPoint ComputePopupTrackPoint(CRect rcExclude,CSize szPopup); + +protected: + + // Input: pDropButton - A pointer to a valid XT_DROPDOWNBUTTON structure. + // rect - A CRect object. + // Returns: A pointer to the color picker popup window just created. + // Summary: This member function creates and initializes a color picker popup window. + virtual CXTColorPopup* CreateNewColorPopup(XT_DROPDOWNBUTTON* pDropButton,CRect rect); + + // Input: pRBBI - Pointer to a rebar bar descriptor to use to fill in the sizing information. + // bHorz - true if this toolbar must be oriented horizontally. + // Returns: true if successful, otherwise returns false. + // Summary: This notification is called whenever this toolbar is added to a CXTReBar + // object. + virtual bool OnAddedToRebar(REBARBANDINFO* pRBBI,bool bHorz); + + // Input: pInfo - Descriptor of the band. + // bHorz - true if the toolbar is horizontally oriented. + // Summary: This member function is called whenever this toolbar is embedded in + // a CXTReBar control that has just resized the band in which this toolbar + // resides. + virtual void OnRebarBandResized(XT_REBARSIZECHILDINFO* pInfo,bool bHorz); + + // Returns: true to enable full window drag, or false to use the wire frame. + // Summary: This member function tells if this toolbar will be visualized when + // dragging or the system will render it with a wire frame. Default implementation + // uses full window drag. + virtual bool IsFullWindowDrag(); + + // Input: bMode - true to enable toolbar customization, or false to disable it. + // Summary: This member function is called to turn on or off toolbar customization mode. + virtual void SetCustMode(bool bMode); + + // Input: pInfo - Pointer to a valid CXTCustomControlBarInfo object. + // Summary: This member function fills in supported customizable features. + virtual void GetCustomBarInfo(CXTCustomControlBarInfo* pInfo); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTToolBar) + public: + virtual void OnPaint(); + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + //}}AFX_VIRTUAL + + virtual void PositionControl(CWnd* pWnd); + virtual void PositionControls(); + virtual bool IsFillToolBarClientRect(); + virtual void DrawSeparators(CDC* pDC); + virtual BOOL DrawItem(CDC* pDC, LPNMCUSTOMDRAW lpNMCD); + virtual void EraseWrappedSeparators(CDC* pDC); + virtual void OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle); + virtual void OnDropDownButton(NMTOOLBAR* pNMTB, UINT nID, CRect rect); + virtual bool HasCmdHandlers(CWnd* pWnd); + + // Ignore: + //{{AFX_MSG(CXTToolBar) + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); + afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos); + afx_msg void OnSysColorChange(); + afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnDestroy(); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + afx_msg LRESULT OnSetDrawTextFlags(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSetButtonSize(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSetBitmapSize(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnPreserveZeroBorderHelper(WPARAM wParam, LPARAM lParam); + afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnToolBarBtnDropDown(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnToolBarBeginAdjust(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnToolBarCustomHelp(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnToolBarEndAdjust(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnToolBarGetButtonInfo(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnToolBarQueryDelete(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnToolBarQueryInsert(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnToolBarReset(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnToolBarChange(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnToolBarHotItemChange(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg LRESULT OnSelEndOK(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnCloseUp(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnFreshenAfter(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() + + friend CXTExpButton; + friend CXTExpMenuWnd; + friend CXTCustTbHandler; + + // Input: nIndex - Index of the toolbar button being queried + // Returns: A CXTCustomGroupItemInfo object. + // Summary: Create new custom group item descriptor. + // Used during toolbar customization, override to pass your custom data + virtual CXTCustomGroupItemInfo* GetCustomItemInfo(int nIndex); + + // Input: pInfo - data being dragged + // nIndex - position at which the button must be created + // Summary: Do data drop, implementation must create a toolbar button + // out of data provided at a given position + virtual void DropCustomItemInfo(CXTCustomGroupItemInfo* pInfo, int nIndex); + + // Input: lpszText - A NULL terminated strig. + // idCommand - Command ID. + // Returns: Returns an index into the string table. + // Summary: Caches a string as a text assigned to button with given command ID + // result retruned is suitable to be assigned to TBBUTTON.iString member + int CacheString(LPCTSTR lpszText, UINT idCommand); + + // Input: button - Pointer to a TBBUTTON structure. + // strLabel - NULL terminated string representing the button text. + // Summary: Default implementation of how to add some text to a button created during + // toolbar customization + virtual void AddCustomButtonText(TBBUTTON* button, const CString& strLabel); + + int WrapToolBar(TBBUTTON* pData, int nCount, int nWidth); + CSize CalcLayout(DWORD nMode, int nLength = -1); + CSize CalcSize(TBBUTTON* pData, int nCount); + void MoveExpButton(int nDimension, bool bHorz); + void ResetHiddenButtons(); + void CopyHiddenButtons(CXTToolBar* other, int preferredWidth); + void SizeToolBar(TBBUTTON* pData, int nCount, int nLength, BOOL bVert = FALSE); + void Layout(); + void LoadButtonInfo(); + LRESULT OnSetSizeHelper(CSize& size, LPARAM lParam); + XT_DROPDOWNBUTTON* InitDropDownButton(UINT nIDButton, BOOL bArrow); + void ResetCustomizations(); + void DoRestoreState(); + void DeferFreshenAfter(); + void ResetFreshenAfter(); + + void TrackMenuBarPopup(DWORD dwMenuBarPopupID, const CRect& rect); + void SaveToolBarState(LPCTSTR pszSubKey, LPCTSTR pszValueName); + bool LoadToolBarState(LPCTSTR pszSubKey, LPCTSTR pszValueName); + void GetCurrentBarState(LPVOID* ppvState, DWORD* pcbState); + bool SetCurrentBarState(LPVOID pvData, DWORD cbData); + void GetIcons(CXTIconMap* pMap); + void RegisterCustomizeAPI(bool bRegister); + bool StartCustomDrag(CPoint point); + void DoCustomDrag(CPoint point); + void SetListStyleIfNoText(); + void ResolveCommandIcons(); + bool ReportOriginalCustomGroups(XT_CUSTOMITEMS& items); + CXTCustomGroupItemInfo* GetCustomItemInfo(const TBBUTTON& button); + CXTCustomGroupItemInfo* GetCustomButtonInfo(const TBBUTTON& button); + CXTCustomGroupItemInfo* GetCustomControlInfo(const TBBUTTON& button); + void NoteIdealSizeChanged(); + virtual void ReportCustomGroups(CXTCustomGroups& groups); + bool IsSeparator(int nIndex) const; + static bool IsSeparator(const TBBUTTON& button); + static bool IsControl(const TBBUTTON& button); + int LocateHit(const CPoint& point); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE bool CXTToolBar::IsCustomizable() const { + return m_bCustomize; +} +AFX_INLINE void CXTToolBar::SetCustomBar(bool bCustomBar/*=true*/) { + EnableCustomization(bCustomBar); +} +AFX_INLINE bool CXTToolBar::GetCustomBar() const { + return IsCustomizable(); +} +AFX_INLINE void CXTToolBar::ColorizeDisabledItems(BOOL bDisabledColor) { + ASSERT(::IsWindow(m_hWnd)); m_bDisabledColor = bDisabledColor; +} +AFX_INLINE BOOL CXTToolBar::LoadToolBar(UINT nIDResource) { + ASSERT(::IsWindow(m_hWnd)); return LoadToolBar(MAKEINTRESOURCE(nIDResource)); +} +AFX_INLINE BOOL CXTToolBar::LoadBitmap(UINT nIDResource) { + ASSERT(::IsWindow(m_hWnd)); return LoadBitmap(MAKEINTRESOURCE(nIDResource)); +} +AFX_INLINE CXTToolBarCtrl& CXTToolBar::GetToolBarCtrl() const { + ASSERT(::IsWindow(m_hWnd)); return *(CXTToolBarCtrl*)this; +} +AFX_INLINE BOOL CXTToolBar::EnableButton(int nID, BOOL bEnable) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ENABLEBUTTON, nID, MAKELPARAM(bEnable, 0)); +} +AFX_INLINE BOOL CXTToolBar::CheckButton(int nID, BOOL bCheck) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_CHECKBUTTON, nID, MAKELPARAM(bCheck, 0)); +} +AFX_INLINE BOOL CXTToolBar::PressButton(int nID, BOOL bPress) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_PRESSBUTTON, nID, MAKELPARAM(bPress, 0)); +} +AFX_INLINE BOOL CXTToolBar::HideButton(int nID, BOOL bHide) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_HIDEBUTTON, nID, MAKELPARAM(bHide, 0)); +} +AFX_INLINE BOOL CXTToolBar::Indeterminate(int nID, BOOL bIndeterminate) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_INDETERMINATE, nID, MAKELPARAM(bIndeterminate, 0)); +} +AFX_INLINE BOOL CXTToolBar::IsButtonEnabled(int nID) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONENABLED, nID, 0); +} +AFX_INLINE BOOL CXTToolBar::IsButtonChecked(int nID) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONCHECKED, nID, 0); +} +AFX_INLINE BOOL CXTToolBar::IsButtonPressed(int nID) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONPRESSED, nID, 0); +} +AFX_INLINE BOOL CXTToolBar::IsButtonHidden(int nID) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONHIDDEN, nID, 0); +} +AFX_INLINE BOOL CXTToolBar::IsButtonIndeterminate(int nID) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONINDETERMINATE, nID, 0); +} +AFX_INLINE BOOL CXTToolBar::SetState(int nID, UINT nState) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETSTATE, nID, MAKELPARAM(nState, 0)); +} +AFX_INLINE int CXTToolBar::GetState(int nID) const { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETSTATE, nID, 0L); +} +AFX_INLINE BOOL CXTToolBar::AddButtons(int nNumButtons, LPTBBUTTON lpButtons) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ADDBUTTONS, nNumButtons, (LPARAM)lpButtons); +} +AFX_INLINE BOOL CXTToolBar::InsertButton(int nIndex, LPTBBUTTON lpButton) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)lpButton); +} +AFX_INLINE BOOL CXTToolBar::DeleteButton(int nIndex) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_DELETEBUTTON, nIndex, 0); +} +AFX_INLINE int CXTToolBar::GetButtonCount() const { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_BUTTONCOUNT, 0, 0L); +} +AFX_INLINE int CXTToolBar::AddStrings(LPCTSTR lpszStrings) { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_ADDSTRING, 0, (LPARAM)lpszStrings); +} +AFX_INLINE void CXTToolBar::SetButtonStructSize(int nSize) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_BUTTONSTRUCTSIZE, nSize, 0L); +} +AFX_INLINE BOOL CXTToolBar::SetButtonSize(CSize size) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(size.cx, size.cy)); +} +AFX_INLINE BOOL CXTToolBar::SetBitmapSize(CSize size) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(size.cx, size.cy)); +} +AFX_INLINE void CXTToolBar::AutoSize() { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_AUTOSIZE, 0, 0L); +} +AFX_INLINE CToolTipCtrl* CXTToolBar::GetToolTips() const { + ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TB_GETTOOLTIPS, 0, 0L)); +} +AFX_INLINE void CXTToolBar::SetToolTips(CToolTipCtrl* pTip) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETTOOLTIPS, (WPARAM)pTip->GetSafeHwnd(), 0L); +} +AFX_INLINE void CXTToolBar::SetRows(int nRows, BOOL bLarger, LPRECT lpRect) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETROWS, MAKELPARAM(nRows, bLarger), (LPARAM)lpRect); +} +AFX_INLINE int CXTToolBar::GetRows() const { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETROWS, 0, 0L); +} +AFX_INLINE BOOL CXTToolBar::SetCmdID(int nIndex, UINT nID) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETCMDID, nIndex, nID); +} +AFX_INLINE UINT CXTToolBar::GetBitmapFlags() const { + ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, TB_GETBITMAPFLAGS, 0, 0L); +} +AFX_INLINE BOOL CXTToolBar::SetIndent(int indent) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETINDENT, indent, 0L); +} +AFX_INLINE HIMAGELIST CXTToolBar::GetImageList() const { + ASSERT(::IsWindow(m_hWnd)); return (HIMAGELIST) ::SendMessage(m_hWnd, TB_GETIMAGELIST, 0, 0L); +} +AFX_INLINE int CXTToolBar::GetBitmap(UINT nIdButton) const { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETBITMAP, nIdButton, 0L); +} +AFX_INLINE DWORD CXTToolBar::GetExtendedStyle() const { + ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETEXTENDEDSTYLE, 0, 0L); +} +AFX_INLINE DWORD CXTToolBar::SetExtendedStyle(DWORD dwStyle) { + ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_SETEXTENDEDSTYLE, 0, dwStyle); +} +AFX_INLINE BOOL CXTToolBar::GetRect(UINT nIdButton, RECT& rc) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETRECT, nIdButton, (LPARAM)&rc); +} +AFX_INLINE DWORD CXTToolBar::GetToolbarStyle() const { + ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETSTYLE, 0, 0L); +} +AFX_INLINE void CXTToolBar::SetToolbarStyle(DWORD dwStyle) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETSTYLE, 0, dwStyle); +} +AFX_INLINE int CXTToolBar::HitTest(CPoint p) const { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_HITTEST, 0, (LPARAM)&p); +} +AFX_INLINE int CXTToolBar::GetHotItem() const { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETHOTITEM, 0, 0L); +} +AFX_INLINE int CXTToolBar::SetHotItem(int iHot) { + ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TB_SETHOTITEM, iHot, 0L); +} +AFX_INLINE BOOL CXTToolBar::MapAccelerator(TCHAR ch, UINT& nID) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_MAPACCELERATOR, (WPARAM)ch, (LPARAM)&nID); +} +AFX_INLINE CSize CXTToolBar::GetPadding() const { + ASSERT(::IsWindow(m_hWnd)); return (CSize)(DWORD)::SendMessage(m_hWnd, TB_GETPADDING, 0, 0L); +} +AFX_INLINE CSize CXTToolBar::SetPadding(CSize size) { + ASSERT(::IsWindow(m_hWnd)); return (CSize)(DWORD)::SendMessage(m_hWnd, TB_SETPADDING, 0, MAKELPARAM(size.cx,size.cy)); +} +AFX_INLINE void CXTToolBar::GetSizes(SIZE& sizeButton, SIZE& sizeImage) { + sizeImage = m_sizeImage, sizeButton = m_sizeButton; +} +AFX_INLINE bool CXTToolBar::IsAdjustingToolbar() const { + return m_bAdjusting; +} +AFX_INLINE void CXTToolBar::SetDropCommandWithText(bool bWithText) { + m_bDropCommandText = bWithText; +} +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTTOOLBAR_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTToolBarCtrl.h b/Editor/XT/Include/XTToolBarCtrl.h new file mode 100644 index 0000000..09a30c0 --- /dev/null +++ b/Editor/XT/Include/XTToolBarCtrl.h @@ -0,0 +1,555 @@ +// XTToolBarCtrl.h interface for the CXTToolBarCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTOOLBARCTRL_H__) +#define __XTTOOLBARCTRL_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// NUMBERED LIST: + +////////////////////////////////////////////////////////////////////// +// Summary: CXTToolBarCtrl is a CToolBarCtrl derived class. The CXTToolBarCtrl +// class provides the functionality of the Windows toolbar common control. +// This control (and therefore the CXTToolBarCtrl class) is available +// only to programs running under Windows 95 and Windows NT version 3.51 +// and later. +// +// A Windows toolbar common control is a rectangular child window that +// contains one or more buttons. These buttons can display a bitmap image, +// a string, or both. When the user chooses a button, it sends a command +// message to the toolbar’s owner window. Typically, the buttons in a +// toolbar correspond to items in the application’s menu. They provide +// a more direct way for the user to access an application’s commands. +// +// CXTToolBarCtrl objects contain several important internal data structures: +// a list of button image bitmaps or an image list, a list of button label +// stings, and a list of TBBUTTON structures which associate an image and/or +// string with the position, style, state, and command ID of the button. +// Each of the elements of these data structures is referred to by a zero-based +// index. Before you can use a CXTToolBarCtrl object, you must set up +// these data structures. The list of strings can only be used for button +// labels. You cannot retrieve strings from the toolbar. +// +// To use a CXTToolBarCtrl object, you will typically follow these steps: +// [ol] +// [li]Construct the CXTToolBarCtrl object.[/li] +// [li]Call Create to create the Windows toolbar common control and attach +// it to the CXTToolBarCtrl object. Indicate the style of toolbar by using +// styles, such as TBSTYLE_TRANSPARENT for a transparent toolbar, or +// TBSTYLE_DROPDOWN for a toolbar that supports dropdown style buttons.[/li] +// [li]Identify how you want the buttons on the toolbar displayed: +// [ul] +// [li]To use bitmap images for buttons, add the button bitmaps to the +// toolbar by calling AddBitmap.[/li] +// [li]To use images displayed from an image list for buttons, specify +// the image list by calling SetImageList, SetHotImageList, or +// SetDisabledImageList.[/li] +// [li]To use string labels for buttons, add the strings to the toolbar +// by calling AddString and/or AddStrings.[/li] +// [/ul][/li] +// [li]Add button structures to the toolbar by calling AddButtons.[/li] +// [li]If you want tool tips for a toolbar button, in an owner window, +// that is not a CFrameWnd, you need to handle the TTN_NEEDTEXT messages +// in the toolbar’s owner window as described in CXTToolBarCtrl: Handling +// Tool Tip Notifications. If the parent window of the toolbar is derived +// from CFrameWnd, tool tips are displayed without any extra effort from +// you because CFrameWnd provides a default handler.[/li] +// [li]If you want your user to be able to customize the toolbar, make +// a call to CXTToolBar::EnableCustomization(bool bEnable).[/li] +// [/ol] +// You can use SaveState to save the current state of a toolbar control +// in the registry and RestoreState to restore the state based on information +// previously stored in the registry. In addition to saving the toolbar +// state between uses of the application, applications typically store +// the state before the user begins customizing the toolbar in case the +// user later wants to restore the toolbar to its original state. +// +// Support for Internet Explorer Version 4.0 and Later +// +// To support functionality introduced in Internet Explorer, version 4.0 +// and later, MFC provides image list support and transparent and flat +// styles for toolbar controls. +// +// A transparent toolbar allows the client under the toolbar to show through. +// To create a transparent toolbar, use both TBSTYLE_FLAT and TBSTYLE_TRANSPARENT +// styles. Transparent toolbars feature hot tracking; that is, when the +// mouse pointer moves over a hot button on the toolbar, the button's appearance +// changes. Toolbars created with just the TBSTYLE_FLAT style will contain +// buttons that are not transparent. +// +// Image list support allows a control greater flexibility for default +// behavior, hot images, and disabled images. Use GetImageList, GetHotImageList, +// and GetDisabledImageList with the transparent toolbar to manipulate +// the image according to its state. +class _XT_EXT_CLASS CXTToolBarCtrl : public CToolBarCtrl +{ + DECLARE_DYNAMIC(CXTToolBarCtrl) + +public: + + // Summary: Constructs a CXTToolBarCtrl object. + CXTToolBarCtrl(); + + // Summary: Destroys a CXTToolBarCtrl object, handles cleanup and de-allocation. + virtual ~CXTToolBarCtrl(); + + // BULLETED LIST: + + // Input: dwStyle - Specifies the toolbar control’s style. Toolbars must always + // have the WS_CHILD style. In addition, you can specify any combination + // of toolbar styles and window styles. + // rect - Optionally specifies the toolbar control’s size and position. + // It can be either a CRect object or a RECT structure. + // pParentWnd - Specifies the toolbar control’s parent window. It must not be NULL. + // nID - Specifies the toolbar control’s ID. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function is used to create a CXTToolBarCtrl. You construct + // a CXTToolBarCtrl in two steps. First, call the constructor. Then, + // call Create, which creates the toolbar control and attaches it to the + // CXTToolBarCtrl object. + // + // The toolbar control automatically sets the size and position of + // the toolbar window. The height is based on the height of the buttons + // in the toolbar. The width is the same as the width of the parent window’s + // client area. The CCS_TOP and CCS_BOTTOM styles determine whether the + // toolbar is positioned along the top or bottom of the client area. + // By default, a toolbar has the CCS_TOP style. + // + // Apply the following window styles to a toolbar control. + // [ul] + // [li]WS_CHILD Always[/li] + // [li]WS_VISIBLE Usually[/li] + // [li]WS_DISABLED Rarely[/li] + // [/ul] + // Next, you may want to apply one or more of the common control styles: + // [ul] + // [li]CCS_ADJUSTABLE Allows toolbars to be customized by the + // user. If this style is used, the toolbar’s owner window must + // handle the customization notification messages sent by the toolbar, + // as described in CXTToolBarCtrl: Handling Customization Notifications.[/li] + // [li]CCS_BOTTOM Causes the control to position itself at + // the bottom of the parent window’s client area and sets the width + // to be the same as the parent window’s width.[/li] + // [li]CCS_NODIVIDER Prevents a two-pixel highlight from being + // drawn at the top of the control.[/li] + // [li]CCS_NOHILITE Prevents a one-pixel highlight from being + // drawn at the top of the control.[/li] + // [li]CCS_NOMOVEY Causes the control to resize and move itself + // horizontally, but not vertically, in response to a WM_SIZE message. + // If the CCS_NORESIZE style is used, this style does not apply.[/li] + // [li]CCS_NOPARENTALIGN Prevents the control from automatically + // moving to the top or bottom of the parent window. Instead, the + // control keeps its position within the parent window despite + // changes to the size of the parent window. If the CCS_TOP or + // CCS_BOTTOM style is also used, the height is adjusted to the + // default, but the position and width remain unchanged.[/li] + // [li]CCS_NORESIZE Prevents the control from using the default + // width and height when setting its initial size or a new size. + // Instead, the control uses the width height specified in the request + // for creation or sizing.[/li] + // [li]CCS_TOP Causes the control to position itself at the + // top of the parent window’client area and sets the width to be + // the same as the parent window’s width. Toolbars have this style + // by default.[/li] + // [/ul] + // Finally, apply a combination of toolbar styles to either the control + // or the buttons themselves. The styles are described in the topic "Toolbar + // Control and Button Styles" in the Platform SDK. + virtual BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID); + + // Returns: A DWORD value that contains the width and height values in the LOWORD + // and HIWORD, respectively. + // Summary: Call this member function to get the size of a toolbar button. + DWORD GetButtonSize() const; + + // Returns: A pointer to a CImageList object, or NULL, if no disabled image list is set. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETDISABLEDIMAGELIST, as described in the Platform SDK. + // + // The MFC implementation of GetDisabledImageList uses a CImageList + // object containing the toolbar control's button images, rather than + // a handle to an image list. + CImageList* GetDisabledImageList() const; + + // Returns: A pointer to a CImageList object, or NULL, if no disabled + // image list is set. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETHOTIMAGELIST, as described in the Platform SDK. + // + // A hot button appears highlighted when the mouse pointer is above it. + CImageList* GetHotImageList() const; + + // Returns: A pointer to a CImageList object, or NULL if no disabled image list is set. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETIMAGELIST, as described in the Platform SDK. + CImageList* GetImageList() const; + + // Returns: A DWORD containing a combination of toolbar control styles as described + // in the Platform SDK. + // Summary: Call this member function to get the styles currently applied to + // a toolbar control. + DWORD GetStyle() const; + + // Returns: The maximum number of text rows displayed. + // Summary: Call this member function to retrieve the maximum number of text + // rows displayed on a toolbar button. + int GetMaxTextRows() const; + + // Input: nID - The command ID for the toolbar button. + // Returns: Nonzero if the button is highlighted, otherwise returns zero. + // Summary: Call this member function to check the highlight state of a toolbar + // button. + BOOL IsButtonHighlighted(int nID) const; + + // Input: cxMin - Minimum button width, in pixels. Toolbar buttons will never + // be narrower than this value. + // cxMax - Maximum button width, in pixels. If button text is too wide, + // the control displays it with ellipsis points. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETBUTTONWIDTH, as described in the Platform SDK. + BOOL SetButtonWidth(int cxMin,int cxMax); + + // Input: pImageList - A pointer to a CImageList object containing the images to be + // used by the toolbar control to display disabled button images. + // Returns: A pointer to a CImageList object that was previously used by the toolbar + // control to display disabled button images. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETDISABLEDIMAGELIST, as described in the Platform SDK. + // + // The MFC implementation of SetDisabledImageList uses a CImageList + // object containing the toolbar control's disabled button images, rather + // than a handle to an image list. + CImageList* SetDisabledImageList(CImageList* pImageList); + + // Input: pImageList - A pointer to a CImageList object containing the images to be + // used by the toolbar control to display hot button images. + // Returns: A pointer to a CImageList object that was previously used by the toolbar + // control to display hot button images. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETHOTIMAGELIST, as described in the Platform SDK. + // + // The MFC implementation of SetHotImageList uses a CImageList object + // containing the toolbar control's hot button images, rather than a handle + // to an image list. + // + // A hot button appears highlighted when the pointer is above it. + CImageList* SetHotImageList(CImageList* pImageList); + + // Input: pImageList - A pointer to a CImageList object containing the images to be + // used by the toolbar control to display button images in their default + // state. + // Returns: A pointer to a CImageList object that was previously used by the toolbar + // control to display button images in their default state. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETIMAGELIST, as described in the Platform SDK. + // + // The MFC implementation of SetImageList uses a CImageList object + // containing the toolbar control's button images, rather than a handle + // to an image list. + CImageList* SetImageList(CImageList* pImageList); + + // Input: ppDropTarget - A pointer to an IDropTarget interface pointer. If an error + // occurs, a NULL pointer is placed in this address. + // Returns: An HRESULT value indicating success or failure of the operation. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETOBJECT, as described in the Platform SDK. + HRESULT GetDropTarget(IDropTarget** ppDropTarget) const; + + // Input: iIndent - The value specifying the indentation, in pixels. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to set the indentation for the first button + // in a toolbar control. + BOOL SetIndent(int iIndent); + + // Input: iMaxRows - Maximum number of rows to be set. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: Call this member function to set the maximum number of text rows + // displayed on a toolbar button. + BOOL SetMaxTextRows(int iMaxRows); + + // Input: dwStyle - A DWORD containing a combination of toolbar control styles, + // as described in the Platform SDK. + // Summary: Call this member function to set the styles for a toolbar control. + void SetStyle(DWORD dwStyle); + + // Input: nID - The button identifier. + // ptbbi - A pointer to a TBBUTTONINFO structure that receives the button + // information. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETBUTTONINFO, as described in the Platform SDK. + BOOL GetButtonInfo(int nID,TBBUTTONINFO* ptbbi) const; + + // Input: nID - The button identifier. + // ptbbi - A pointer to a TBBUTTONINFO structure that receives the button + // information. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: The member function implements the behavior of the Win32 message + // TB_SETBUTTONINFO, as described in the Platform SDK. + BOOL SetButtonInfo(int nID,TBBUTTONINFO* ptbbi); + + // Input: dwMask - A combination of one or more of the DT_ flags, specified in + // the Win32 function, DrawText, that indicates which bits in 'dwDTFlags' + // will be used when drawing the text. + // dwDTFlags - A combination of one or more of the DT_ flags, specified in + // the Win32 function, DrawText, that indicate how the button text will + // be drawn. This value is passed to DrawText when the button text is + // drawn. + // Returns: A DWORD value containing the previous text drawing flags. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETDRAWTEXTFLAGS, as described in the Platform SDK. + // + // This member function sets the flags in the Win32 function DrawText, + // which draws text in the specified rectangle, formatted according to + // how the flags are set. + DWORD SetDrawTextFlags(DWORD dwMask,DWORD dwDTFlags); + + // Returns: Nonzero, if anchor highlighting is enabled. If zero, anchor highlighting is + // disabled. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETANCHORHIGHLIGHT, as described in the Platform SDK. + BOOL GetAnchorHighlight() const; + + // Input: fAnchor - Specifies if anchor highlighting is enabled or disabled. If + // this value is nonzero, anchor highlighting will be enabled. If this + // value is zero, anchor highlighting will be disabled. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETANCHORHIGHLIGHT, as described in the Platform SDK. + BOOL SetAnchorHighlight(BOOL fAnchor = TRUE); + + // Returns: The zero-based index of the hot item in a toolbar. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETHOTITEM, as described in the Platform SDK. + int GetHotItem() const; + + // Input: nHot - The zero-based index number of the item that will be made hot. + // If this value is -1, none of the items will be hot. + // Returns: The index of the previous hot item, or -1, if there was no hot item. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETHOTITEM, as described in the Platform SDK. + int SetHotItem(int nHot); + + // Input: ptbim - A pointer to a TBINSERTMARK structure that receives the insertion mark. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETINSERTMARK, as described in the Platform SDK. + void GetInsertMark(TBINSERTMARK* ptbim) const; + + // Input: ptbim - A pointer to the TBINSERTMARK structure that contains the insertion + // mark. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETINSERTMARK, as described in the Platform SDK. + void SetInsertMark(TBINSERTMARK* ptbim); + + // Input: pSize - A pointer to a SIZE structure that receives the size of the items. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETMAXSIZE, as described in the Platform SDK. + BOOL GetMaxSize(LPSIZE pSize) const; + + // Input: ppt - A pointer to a POINT structure that contains the hit test coordinates, + // relative to the client area of the toolbar. + // ptbim - A pointer to a TBINSERTMARK structure that receives the insertion + // mark information. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // TB_INSERTMARKHITTEST, as described in the Platform SDK. + BOOL InsertMarkHitTest(LPPOINT ppt,LPTBINSERTMARK ptbim) const; + + // Returns: A DWORD that represents the extended styles currently in use for the toolbar + // control. For a list of styles, see "Toolbar Extended Styles," in the + // Platform SDK. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETEXTENDEDSTYLE, as described in the Platform SDK. + DWORD GetExtendedStyle() const; + + // Input: dwExStyle - A value specifying the new extended styles. This parameter + // can be a combination of the toolbar extended styles. + // Returns: A DWORD value that represents the previous extended styles. For a list of styles, + // see "Toolbar Extended Styles," in the Platform SDK. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETEXTENDEDSTYLE, as described in the Platform SDK. + DWORD SetExtendedStyle(DWORD dwExStyle); + + // Returns: A COLORREF value that contains the current insertion mark color. + // Summary: This member function implements the behavior of the Win32 message + // TB_GETINSERTMARKCOLOR, as described in the Platform SDK. + COLORREF GetInsertMarkColor() const; + + // Input: clrNew - A COLORREF value that contains the new insertion mark color. + // Returns: A COLORREF value that contains the previous insertion mark color. + // Summary: This member function implements the behavior of the Win32 message + // TB_SETINSERTMARKCOLOR, as described in the Platform SDK. + COLORREF SetInsertMarkColor(COLORREF clrNew); + + // Input: chAccel - Accelerator character to be mapped. This character is the same + // character that is underlined in the button's text. + // pIDBtn - A pointer to a UINT that receives the command identifier of + // the button that corresponds to the accelerator specified in 'chAccel + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // TB_MAPACCELERATOR, as described in the Platform SDK. + BOOL MapAccelerator(TCHAR chAccel,UINT* pIDBtn); + + // Input: nID - The button identifier. + // bHighlight - Specifies the highlight state to be set. By default, TRUE. + // If set to FALSE, the button is set to its default state. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // TB_MARKBUTTON, as described in the Platform SDK. + BOOL MarkButton(int nID,BOOL bHighlight = TRUE); + + // Input: nOldPos - The zero-based index of the button to be moved. + // nNewPos - The zero-based index of the button's destination. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function implements the behavior of the Win32 message + // TB_MOVEBUTTON, as described in the Platform SDK. + BOOL MoveButton(UINT nOldPos,UINT nNewPos); + + // Input: ppt - A pointer to a POINT structure that contains the x-coordinate + // of the hit test in the x member and the y-coordinate of the hit test + // in the y member. The coordinates are relative to the toolbar's client + // area. + // Returns: An integer value indicating the location of a point on a toolbar. If the + // value is zero or a positive value, this return value is the zero-based index + // of the non-separator item in which the point lies. If the return value is + // negative, the point does not lie within a button. The absolute value + // of the return value is the index of a separator item or the nearest + // non-separator item. + // Summary: This member function implements the behavior of the Win32 message + // TB_HITTEST, as described in the Platform SDK. + int HitTest(LPPOINT ppt) const; + + // Ignore: + //{{AFX_VIRTUAL(CXTToolBarCtrl) + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTToolBarCtrl) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE DWORD CXTToolBarCtrl::GetButtonSize() const { + ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETBUTTONSIZE, 0, 0L); +} +AFX_INLINE CImageList* CXTToolBarCtrl::GetDisabledImageList() const { + ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_GETDISABLEDIMAGELIST, 0, 0)); +} +AFX_INLINE CImageList* CXTToolBarCtrl::GetHotImageList() const { + ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_GETHOTIMAGELIST, 0, 0)); +} +AFX_INLINE CImageList* CXTToolBarCtrl::GetImageList() const { + ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_GETIMAGELIST, 0, 0)); +} +AFX_INLINE DWORD CXTToolBarCtrl::GetStyle() const { + ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETSTYLE, 0, 0L); +} +AFX_INLINE int CXTToolBarCtrl::GetMaxTextRows() const { + ASSERT(::IsWindow(m_hWnd)); return (INT) ::SendMessage(m_hWnd, TB_GETTEXTROWS, 0, 0L); +} +AFX_INLINE BOOL CXTToolBarCtrl::IsButtonHighlighted(int nID) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONHIGHLIGHTED, nID, 0); +} +AFX_INLINE BOOL CXTToolBarCtrl::SetButtonWidth(int cxMin, int cxMax) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBUTTONWIDTH, 0, MAKELPARAM(cxMin, cxMax)); +} +AFX_INLINE CImageList* CXTToolBarCtrl::SetHotImageList(CImageList* pImageList) { + ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_SETHOTIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); +} +AFX_INLINE CImageList* CXTToolBarCtrl::SetImageList(CImageList* pImageList) { + ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, TB_SETIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); +} +AFX_INLINE BOOL CXTToolBarCtrl::SetIndent(int iIndent) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETINDENT, iIndent, 0L); +} +AFX_INLINE BOOL CXTToolBarCtrl::SetMaxTextRows(int iMaxRows) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETMAXTEXTROWS, iMaxRows, 0L); +} +AFX_INLINE void CXTToolBarCtrl::SetStyle(DWORD dwStyle) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETSTYLE, 0, dwStyle); +} +AFX_INLINE BOOL CXTToolBarCtrl::GetButtonInfo(int nID, TBBUTTONINFO* ptbbi) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETBUTTONINFO, nID, (LPARAM)ptbbi); +} +AFX_INLINE BOOL CXTToolBarCtrl::SetButtonInfo(int nID, TBBUTTONINFO* ptbbi) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBUTTONINFO, nID, (LPARAM)ptbbi); +} +AFX_INLINE DWORD CXTToolBarCtrl::SetDrawTextFlags(DWORD dwMask, DWORD dwDTFlags) { + ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_SETDRAWTEXTFLAGS, dwMask, dwDTFlags); +} +AFX_INLINE BOOL CXTToolBarCtrl::GetAnchorHighlight() const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETANCHORHIGHLIGHT, 0, 0); +} +AFX_INLINE BOOL CXTToolBarCtrl::SetAnchorHighlight(BOOL fAnchor) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETANCHORHIGHLIGHT, fAnchor, 0); +} +AFX_INLINE int CXTToolBarCtrl::GetHotItem() const { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETHOTITEM, 0, 0); +} +AFX_INLINE int CXTToolBarCtrl::SetHotItem(int nHot) { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_SETHOTITEM, nHot, 0); +} +AFX_INLINE void CXTToolBarCtrl::GetInsertMark(TBINSERTMARK* ptbim) const { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_GETINSERTMARK, 0, (LPARAM)ptbim); +} +AFX_INLINE void CXTToolBarCtrl::SetInsertMark(TBINSERTMARK* ptbim) { + ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETINSERTMARK, 0, (LPARAM)ptbim); +} +AFX_INLINE BOOL CXTToolBarCtrl::GetMaxSize(LPSIZE pSize) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETMAXSIZE, 0, (LPARAM)pSize); +} +AFX_INLINE BOOL CXTToolBarCtrl::InsertMarkHitTest(LPPOINT ppt, LPTBINSERTMARK ptbim) const { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_INSERTMARKHITTEST, (WPARAM)ppt, (LPARAM)ptbim); +} +AFX_INLINE DWORD CXTToolBarCtrl::GetExtendedStyle() const { + ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETEXTENDEDSTYLE, 0, 0L); +} +AFX_INLINE DWORD CXTToolBarCtrl::SetExtendedStyle(DWORD dwExStyle) { + ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_SETEXTENDEDSTYLE, 0, dwExStyle); +} +AFX_INLINE COLORREF CXTToolBarCtrl::GetInsertMarkColor() const { + ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TB_GETINSERTMARKCOLOR, 0, 0); +} +AFX_INLINE COLORREF CXTToolBarCtrl::SetInsertMarkColor(COLORREF clrNew) { + ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TB_SETINSERTMARKCOLOR, 0, (LPARAM) clrNew); +} +AFX_INLINE BOOL CXTToolBarCtrl::MapAccelerator(TCHAR chAccel, UINT* pIDBtn) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_MAPACCELERATOR, (WPARAM)chAccel, (LPARAM)pIDBtn); +} +AFX_INLINE BOOL CXTToolBarCtrl::MarkButton(int nID, BOOL bHighlight) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_MARKBUTTON, nID, MAKELPARAM(bHighlight, 0)); +} +AFX_INLINE BOOL CXTToolBarCtrl::MoveButton(UINT nOldPos, UINT nNewPos) { + ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_MOVEBUTTON, nOldPos, nNewPos); +} +AFX_INLINE int CXTToolBarCtrl::HitTest(LPPOINT ppt) const { + ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_HITTEST, 0, (LPARAM)ppt); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTTOOLBARCTRL_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTToolBarPopupWnd.h b/Editor/XT/Include/XTToolBarPopupWnd.h new file mode 100644 index 0000000..a61dc3e --- /dev/null +++ b/Editor/XT/Include/XTToolBarPopupWnd.h @@ -0,0 +1,224 @@ +// XTToolBarPopupWnd.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__POPUPWND_H__) +#define __POPUPWND_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// forwards + +class CXTToolBarPopupWnd; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTPopupWndToolbar is a CXTToolBar derived class. It is a toolbar +// custom tailored for usage in a toolbar popup window. +class _XT_EXT_CLASS CXTPopupWndToolbar : public CXTToolBar +{ + DECLARE_DYNAMIC(CXTPopupWndToolbar) + + CXTToolBarPopupWnd* m_pPopup; // Back reference to the toolbar expansion popup. + +public: + + // Summary: Constructs a CXTPopupWndToolbar object. + CXTPopupWndToolbar(); + + // Returns: An RGB value. + // Summary: This member function defines the background color as that used in popup + // windows. + virtual COLORREF GetBackgroundColor() const; + + // Returns: true if successful, otherwise returns false. + // Summary: This member function tells the base class to always fill the background + // of this toolbar with a predefined popup window background color. + virtual bool IsFillToolBarClientRect(); + + friend CXTToolBarPopupWnd; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTPopupWndToolbar::CXTPopupWndToolbar() { + m_pPopup = 0; +} + +////////////////////////////////////////////////////////////////////// +// Summary: CXTToolBarPopupWndHook is a CXTWndHook derived class. It is used to +// hook a toolbar owner frame, and to figure out when to close the popup. +// Its WindowProc() filters out the commands the owner frame receives +// and, if applicable, sends a request for the toolbar expansion popup +// to close. +class _XT_EXT_CLASS CXTToolBarPopupWndHook : public CXTWndHook +{ + DECLARE_DYNAMIC(CXTToolBarPopupWndHook) + + bool m_bCreated; // true if parent popup completed creation + CXTToolBarPopupWnd* m_pPopup; // Back reference to the toolbar expansion popup. + +public: + + // Summary: Constructs a CXTToolBarPopupWndHook object. + CXTToolBarPopupWndHook(); + + // Input: message - Specifies the Windows message to be processed. + // wParam - Provides additional information used in processing the message. + // The parameter value depends on the message. + // lParam - Provides additional information used in processing the message. + // The parameter value depends on the message. + // Summary: This member function filters messages, as required, to synch up the + // hidden toolbar popup. + virtual LRESULT WindowProc(UINT message,WPARAM wParam,LPARAM lParam); + + friend CXTToolBarPopupWnd; +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTToolBarPopupWnd is a CWnd derived class. It is used to display a +// popup window to be activated when the user presses the down arrow on +// a toolbar. The popup window contains a separate toolbar that will swap +// out the image with the newly selected command. Works similar to MS Word's +// border dropdown button. +class _XT_EXT_CLASS CXTToolBarPopupWnd : public CWnd +{ + DECLARE_DYNAMIC(CXTToolBarPopupWnd) + +public: + + // Input: iCmdID - Command ID that is currently active for the popup window. + // Summary: Constructs a CXTToolBarPopupWnd object. + CXTToolBarPopupWnd(int& iCmdID); + + // Summary: Destroys a CXTToolBarPopupWnd object, handles cleanup and de-allocation. + virtual ~CXTToolBarPopupWnd(); + +protected: + + int& m_iCmdID; // Command ID of the button that created this window. + UINT m_uToolbarID; // Resource ID of the parent toolbar. + CRect m_rcExclude; // Exclusion rectangle for drawing adjacent borders. + CXTToolBar* m_pWndParent; // Pointer to the parent toolbar. + CXTPopupWndToolbar m_wndToolBar; // Nested toolbar that is displayed when this window is created. + CXTToolBarPopupWndHook m_hook; // Message hook that properly closes this window. + +public: + + // Input: pParent - Points to a valid parent toolbar. + // uToolbarID - Resource ID of the toolbar to display as a popup. + // iNumCols - Number of columns to display when the toolbar is displayed. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: Call this member function to create a CXTToolBarPopupWnd object. This + // can be done from a CBRN_XT_DROPDOWN after a dropdown arrow has been + // added to your toolbar. To do so, add a dropdown button to your toolbar. + // The button image should represent one of the images contained in the + // toolbar popup window, for example: + // + //
m_wndToolBar.AddDropDownButton(ID_BDR_OUTSIDE);
+ // + // Once you have done this you can add a CBRN_XT_DROPDOWN message handler + // to determine when the toolbar button has been dropped, for example: + // + //
BEGIN_MESSAGE_MAP(CMainFrame, CXTFrameWnd)
+	//			    {{AFX_MSG_MAP(CMainFrame)
+	//			    ON_MESSAGE(CBRN_XT_DROPDOWN, OnToolbarDropDown)
+	//			    //}}AFX_MSG_MAP
+	//			END_MESSAGE_MAP()
+ // + //
LRESULT CMainFrame::OnToolbarDropDown(WPARAM wParam, LPARAM lParam)
+	//			{
+	//			    NMTOOLBAR* pNMTB = ( NMTOOLBAR* )wParam;
+	//			    CRect* pRect = ( CRect* )lParam;
+	//			
+	//			    if ( pNMTB->iItem == m_uCmdID )
+	//			    {
+	//			        CXTToolBarPopupWnd* pwndPopup = new CXTToolBarPopupWnd( m_uCmdID );
+	//			        pwndPopup->Create( &m_wndToolBar, IDR_BORDERS, 5 );
+	//			        return 1;
+	//			    }
+	//			
+	//			    return 0;
+	//			}
+ // + // The toolbar command range should be sequential so you can add a command + // range handler for your popup toolbar, for example: + // + //
BEGIN_MESSAGE_MAP(CMainFrame, CXTFrameWnd)
+	//			    {{AFX_MSG_MAP(CMainFrame)
+	//			    ON_COMMAND_EX_RANGE(ID_BDR_OUTSIDE, ID_BDR_INSIDE_VERT, OnBorderCommand)
+	//			    //}}AFX_MSG_MAP
+	//			END_MESSAGE_MAP()
+ // + //
BOOL CMainFrame::OnBorderCommand(UINT nID)
+    //			{
+    //			    // TODO: Add your command handler code here
+    //			    switch (nID)
+    //			    {
+    //			    case ID_BDR_OUTSIDE:
+    //			        break;
+    //			    case ID_BDR_ALL:
+    //			        break;
+    //			    case ID_BDR_TOP:
+    //			        break;
+    //			    case ID_BDR_LEFT:
+    //			        break;
+    //			    }
+    //			
+    //			    return TRUE;
+    //			}
+ // + // See the FontCombo sample application for an example use of this class. + virtual BOOL Create(CXTToolBar* pParent,UINT uToolbarID,int iNumCols=5); + + // Input: uCmdID - Command ID of the toolbar button to set active. + // Summary: This member function is called to update the currently selected icon + // for the parent toolbar. This icon will represent the selection the + // user made when the popup was open. + virtual void UpdateToolbarIcon(UINT uCmdID); + + // Input: uCmdID - Command ID of the toolbar button. + // Returns: A CXTIconHandle object that is used to update the parent toolbar's image list. + // Summary: This member function retrieves the currently selected icon. + virtual CXTIconHandle GetSelectedIcon(UINT uCmdID); + + // Ignore: + //{{AFX_VIRTUAL(CXTToolBarPopupWnd) + protected: + virtual void PostNcDestroy(); + //}}AFX_VIRTUAL + +protected: + + // Ignore: + //{{AFX_MSG(CXTToolBarPopupWnd) + afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); + afx_msg void OnNcPaint(); + afx_msg void OnDestroy(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() + + friend class CXTToolBarPopupWndHook; +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__POPUPWND_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTToolkit.h b/Editor/XT/Include/XTToolkit.h new file mode 100644 index 0000000..fa248f5 --- /dev/null +++ b/Editor/XT/Include/XTToolkit.h @@ -0,0 +1,113 @@ +// XTToolkit.h : header file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTOOLKIT_H__) +#define __XTTOOLKIT_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#ifndef __XTINCLUDES_H__ +#include "XTIncludes.h" +#endif // __XTINCLUDES_H__ + +//------------------------------------------------------ +// Xtreme link to the appropriate dll or static library: +//------------------------------------------------------ + +#if defined( _AFXDLL ) && defined( _XT_STATICLINK ) + #if defined( _DEBUG ) + #if defined( _UNICODE ) + #define _XTLIB_FILE_SUFFIX "LibDynStaticud" + #else + #define _XTLIB_FILE_SUFFIX "LibDynStaticd" + #endif // _UNICODE + #else + #if defined( _UNICODE ) + #define _XTLIB_FILE_SUFFIX "LibDynStaticu" + #else + #define _XTLIB_FILE_SUFFIX "LibDynStatic" + #endif // _UNICODE + #endif // _DEBUG + #define _XTLIB_LINK_TYPE "lib" + #define _XTLIB_LINK_IS_DLL 0 +#elif !defined( _AFXDLL ) + #if defined( _DEBUG ) + #if defined( _UNICODE ) + #define _XTLIB_FILE_SUFFIX "LibStaticud" + #else + #define _XTLIB_FILE_SUFFIX "LibStaticd" + #endif // _UNICODE + #else + #if defined( _UNICODE ) + #define _XTLIB_FILE_SUFFIX "LibStaticu" + #else + #define _XTLIB_FILE_SUFFIX "LibStatic" + #endif // _UNICODE + #endif // _DEBUG + #define _XTLIB_LINK_TYPE "lib" + #define _XTLIB_LINK_IS_DLL 0 +#else + #if defined( _DEBUG ) + #if defined( _UNICODE ) + #define _XTLIB_FILE_SUFFIX "Libud" + #else + #define _XTLIB_FILE_SUFFIX "Libd" + #endif // _UNICODE + #else + #if defined( _UNICODE ) + #define _XTLIB_FILE_SUFFIX "Libu" + #else + #define _XTLIB_FILE_SUFFIX "Lib" + #endif // _UNICODE + #endif // _DEBUG + #define _XTLIB_LINK_TYPE "dll" + #define _XTLIB_LINK_IS_DLL 1 +#endif // !defined( _AFXDLL ) || defined( _XT_STATICLINK ) + +#if (_XTLIB_LINK_IS_DLL == 0) && defined(_XT_DEMOMODE) + #pragma message(" ") + #pragma message("----------------------------------------------------------------------------------------------") + #pragma message(" The evaluation version of the toolkit only supports DLL configurations.") + #pragma message(" To purchase the full version (with static link support) please visit http://www.codejock.com") + #pragma message("----------------------------------------------------------------------------------------------") + #pragma message(" ") + #error This build configuration is not supported by the evaluation library +#endif + +#if defined(_XT_DEMOMODE) + #define _XTLIB_FILE_PREFIX_FULL _XTLIB_FILE_PREFIX "Eval" +#else + #define _XTLIB_FILE_PREFIX_FULL _XTLIB_FILE_PREFIX +#endif + +#ifndef _XTLIB_NOAUTOLINK +#if defined( _XTLIB_LINK_TYPE ) && defined ( _XTLIB_FILE_SUFFIX ) + +#ifdef WIN64 + #pragma comment(lib, _XTLIB_FILE_PREFIX_FULL _XTLIB_FILE_SUFFIX "64.lib") +#else +#if _MFC_VER == 0x0710 // MFC7.1 + #pragma comment(lib, _XTLIB_FILE_PREFIX_FULL _XTLIB_FILE_SUFFIX "_2003.lib") +#else + #pragma comment(lib, _XTLIB_FILE_PREFIX_FULL _XTLIB_FILE_SUFFIX ".lib") +#endif // MFC7.1 +#endif + //#pragma message("Automatically linking with " _XTLIB_FILE_PREFIX_FULL _XTLIB_FILE_SUFFIX "." _XTLIB_LINK_TYPE) +#endif //_XTLIB_LINK_TYPE && _XTLIB_FILE_SUFFIX +#endif //_XTLIB_NOAUTOLINK + +///////////////////////////////////////////////////////////////////////////// + +#endif // #if !defined(__XTTOOLKIT_H__) diff --git a/Editor/XT/Include/XTToolsManager.h b/Editor/XT/Include/XTToolsManager.h new file mode 100644 index 0000000..04e8ae6 --- /dev/null +++ b/Editor/XT/Include/XTToolsManager.h @@ -0,0 +1,299 @@ +// XTToolsManager.h: interface for the CXTToolsManager class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTOOLSMANAGER_H__) +#define __XTTOOLSMANAGER_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// forwards + +class CXTMenuBar; +class CXTCoolMenu; +class CXTEditListBox; + +////////////////////////////////////////////////////////////////////// +// Summary: XT_TOOL is a stand alone structure class. It is used by CXTToolsManager +// to manage tool data settings. +struct XT_TOOL +{ + UINT uCmdID; // Command ID to be associated with this tool. + TCHAR szTitle[128]; // A NULL terminated string that represents the command title. + TCHAR szArg[128]; // A NULL terminated string that represents the argument passed to the executable. + TCHAR szCmd[_MAX_PATH]; // A NULL terminated string that represents the executable associated with this command. + TCHAR szDir[_MAX_PATH]; // A NULL terminated string that represents the default directory. +}; + +typedef CMap CXTToolsMap; +typedef CMap CXTToolsMenuMap; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTColorRef is a stand alone class. It is used to manage the tools +// configuration page in the Customize dialog. +class _XT_EXT_CLASS CXTToolsManager +{ +private: + + // Summary: Constructs a CXTToolsManager object. + CXTToolsManager(); + +public: + + // Summary: Destroys a CXTToolsManager object, handles cleanup and de-allocation. + virtual ~CXTToolsManager(); + +protected: + + ////////////////////////////////////////////////////////////////////// + // Frame window binding information + ////////////////////////////////////////////////////////////////////// + + CFrameWnd* m_pFrameWnd; // Frame window the accelerators are connected to. + + ////////////////////////////////////////////////////////////////////// + // Our tools buffer + ////////////////////////////////////////////////////////////////////// + + int m_iHTMLIcon; // Index of the HTML icon in the shell image list. + int m_iArgPopup; // Resource ID of the popup menu to be displayed for the arguments browse edit box. + int m_iDirPopup; // Resource ID of the popup menu to be displayed for the directory browse edit box. + int m_iNormalIndex; // Index where the 'Tools' menu should be inserted into the standard menu. + int m_iWindowIndex; // Index where the 'Tools' menu should be inserted into the MDI window menu. + int m_nToolsCount; // The count of tools pointed to by 'm_pToolsArray'. + bool m_bChanged; // true if the contents of 'm_pToolsArray' has been changed. + bool m_bAutoSave; // true if the tool's data is automatically saved when this class is destroyed. + bool m_bInitialized; // true if the tool's data has been initialized. + bool m_bRemoveAll; // true if all tool's have been removed. + HMENU m_hToolsMenu; // Handle to the tools menu inserted into the applications menu. + CString m_strToolsTitle; // User defined title of the 'Tools' pulldown menu. + XT_TOOL* m_pToolsArray; // Array of tool commands. + CXTIconMap m_mapIconCmd; // Hash table to map tool commands with corresponding menu icons. + HIMAGELIST m_hImageList; // Handle to the system image list. + CXTMenuBar* m_pMenuBar; // Points to the menubar for the application. + CXTToolsMap m_mapTools; // Hash table of XT_TOOL structures mapped to user defined commands. + CXTCoolMenu* m_pCoolMenu; // Points to the application's cool menu hook. + CXTToolsMenuMap m_mapToolsMenu; // Hash table of application menus mapped to existing tools menus. + +public: + + // Example:
CXTOptionsManager::Get().Init( this, GetMenuBar(), GetCoolMenu() );
+ // Returns: A reference to the one and only CXTToolsManager object. + // Summary: This static member function will retrieve a reference to the one + // and only CXTToolsManager object. You can use this function to access + // data members for the CXTToolsManager class. + static CXTToolsManager& Get(); + + // Input: iArgPopup - Resource ID of the popup menu to be displayed. + // Summary: This member function is called to set the popup menu used by the argument browse + // edit control in the toolbar customize dialogs tools page. + void SetArgPopupMenu(int iArgPopup); + + // Returns: An integer value that represents the resource ID. + // Summary: This member function retrieves the resource ID of the argument menu + // associated with the argument browse edit control in the toolbar customize + // dialog tools page. + int GetArgPopupMenu() const; + + // Input: iDirPopup - Resource ID of the popup menu to be displayed. + // Summary: This member function is called to set the popup menu used by the directory browse + // edit control in the toolbar customize dialogs tools page. + void SetDirPopupMenu(int iDirPopup); + + // Returns: An integer value that represents the resource ID. + // Summary: This member function retrieves the resource ID of the directory + // menu associated with the argument browse edit control in the toolbar + // customize dialog tools page. + int GetDirPopupMenu() const; + + // Input: bNormal - true for normal index, false to return the MDI window index. + // Returns: An integer value that represents the zero-based index where the tools + // menu is inserted. + // Summary: This member function is called to retrieve the location where the + // tools menu is currently inserted into the framework's main menu. + int GetMenuIndex(bool bNormal); + + // Returns: A handle to the tools menu. + // Summary: This member function is called to retrieve a handle to the tools + // menu that is inserted into the framework's main menu. + HMENU GetToolsMenu() const; + + // Returns: A reference to the CXTToolMap object. + // Summary: This member function is called to retrieve a reference to the CXTToolMap + // object that represents the array of user commands defined for the tools + // menu. + CXTToolsMap& GetToolsMap(); + + // Returns: true if the accelerator data has been initialized, otherwise it returns false. + // Summary: This member function will check to see if the accelerator data has + // been initialized. + bool IsInitialized(); + + // Summary: This member function is called to remove all of the custom user + // defined tools. + void RemoveAllTools(); + + // Input: pTool - A pointer to a valid XT_TOOL structure. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to remove the user tool specified by + // 'pTool'. + bool RemoveTool(XT_TOOL* pTool); + + // Input: pTool - A pointer to a valid XT_TOOL structure. + // Summary: This member function is called to add a user defined tool to the Tools + // manager command array. + void AddTool(XT_TOOL* pTool); + + // Input: bUnInitialize - true if the object is to be un-initialized. + // Returns: true if successful, otherwise returns false. + // Summary: This member function saves the current tool information. + bool Save(bool bUnInitialize=false); + + // Returns: true if successful, otherwise returns false. + // Summary: This member function loads saved tool information. + bool Load(); + + // Input: pFrameWnd - A pointer to a valid CFrameWnd object. + // pMenuBar - A pointer to a valid CXTMenuBar object. + // m_pCoolMenu - A pointer to a valid CXTCoolMenu object. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called to initialize the Tools manager. This + // function is called by the framework, usually from an overridden LoadFrame + // handler. + bool Init(CFrameWnd* pFrameWnd,CXTMenuBar* pMenuBar,CXTCoolMenu* m_pCoolMenu); + + // Input: editListBox - A reference to a valid CXTEditListBox object. + // Summary: This member function is called to initialize the tools list that + // is displayed in the customize toolbar tools page. + void GetToolsList(CXTEditListBox& editListBox); + + // Input: bEnable - true to enable autosave. + // Summary: Call this member function to enable or disable the autosave feature. + // Autosave will automatically save the tool's information when this object + // is destroyed. + void EnableAutoSave(bool bEnable); + + // Input: bChanged - true if the tools data has changed. + // Summary: This member function is called to set the changed flag for the tools manager. + void HasChanged(bool bChanged); + + // Input: bDeleteAll - TRUE to remove all menus including items not belonging to us. + // Summary: This member function is called to rebuild the tools menu that is + // displayed in the framework's main menu. + void BuildToolsMenu(BOOL bDeleteAll); + + // Returns: A zero-based index value. + // Summary: This member function is called to retrieve the index of the HTML + // icon stored in the system's image list. + int GetHTMLIcon(); + + // Input: iNormalIndex - Index where the 'Tools' menu should be inserted into the standard menu. + // iWindowIndex - Index where the 'Tools' menu should be inserted into the MDI window menu. + // Summary: This member function is called to set the index location of where + // the Tools manager will insert the tools menu in the framework's main menu. + void SetMenuIndex(int iNormalIndex,int iWindowIndex); + + // Returns: A UINT value that represents the next available command id. + // Summary: This member function is called to retrieve the next available command + // ID to be used when creating a user defined tool. + UINT GetNextCmdID(); + + // Input: strToolsText - NULL terminated string that represents the new tools title. + // Summary: This member function will set the title for the 'Tools' pulldown menu. You can + // use this function to set the name to something other than the default 'Tools'. If + // you set the title to an existing pulldown menu then the existing menu will be + // appended to include the user defined items normally seen in the 'Tools' menu. + void SetMenuTitle(CString strToolsText); + + // Returns: A CString object that represents the current text for the 'Tools' pulldown + // menu item. + // Summary: This member function returns the current title for the 'Tools' pulldown menu. + CString GetMenuTitle() const; + + // Input: hMenu - Handle to the menu to search. + // iMenuItem - Index of the sub menu found, or -1 if no menu was found. + // Returns: The handle of the existing tools menu if found, otherwise returns NULL. + // Summary: This member function searches the menu specified by 'hMenu' for a submenu that + // is titled 'Tools'. + HMENU ToolsMenuExists(HMENU hMenu,int& iMenuItem); + + // Input: hNewMenu - Handle of the menu to modify. + // iIndex - Zero based index where to insert the tools submenu. + // Returns: true if successful, otherwise returns false. + // Summary: This member function will insert the tools menu into the menu specified by 'hNewMenu' + // at the index specified by iIndex. + bool InsertToolsMenu(HMENU hNewMenu,int iIndex); + +protected: + + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called by the Tools manager during load + // operations. + virtual bool OnLoad(); + + // Input: pToolsArray - A pointer to a valid XT_TOOL structure. + // nCount - Size of the 'pToolsArray'. + // Returns: true if successful, otherwise returns false. + // Summary: This member function is called by the Tools manager during save + // operations. + virtual bool OnSave(XT_TOOL* pToolsArray,int nCount); + + friend class CXTToolBar; +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE bool CXTToolsManager::IsInitialized() { + return m_bInitialized; +} +AFX_INLINE void CXTToolsManager::EnableAutoSave(bool bEnable) { + m_bAutoSave = bEnable; +} +AFX_INLINE void CXTToolsManager::HasChanged(bool bChanged) { + m_bChanged = bChanged; +} +AFX_INLINE CXTToolsMap& CXTToolsManager::GetToolsMap() { + return m_mapTools; +} +AFX_INLINE HMENU CXTToolsManager::GetToolsMenu() const { + return m_hToolsMenu; +} +AFX_INLINE void CXTToolsManager::SetArgPopupMenu(int iArgPopup) { + m_iArgPopup = iArgPopup; +} +AFX_INLINE int CXTToolsManager::GetArgPopupMenu() const { + return m_iArgPopup; +} +AFX_INLINE void CXTToolsManager::SetDirPopupMenu(int iDirPopup) { + m_iDirPopup = iDirPopup; +} +AFX_INLINE int CXTToolsManager::GetDirPopupMenu() const { + return m_iDirPopup; +} +AFX_INLINE int CXTToolsManager::GetMenuIndex(bool bNormal) { + return bNormal ? m_iNormalIndex : m_iWindowIndex; +} +AFX_INLINE void CXTToolsManager::SetMenuIndex(int iNormalIndex, int iWindowIndex) { + m_iNormalIndex = iNormalIndex; m_iWindowIndex = iWindowIndex; +} +AFX_INLINE void CXTToolsManager::SetMenuTitle(CString strToolsText) { + m_strToolsTitle = strToolsText; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTTOOLSMANAGER_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTTrayIcon.h b/Editor/XT/Include/XTTrayIcon.h new file mode 100644 index 0000000..859ce41 --- /dev/null +++ b/Editor/XT/Include/XTTrayIcon.h @@ -0,0 +1,296 @@ +// XTTrayIcon.h: interface for the CXTTrayIcon class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTRAYICON_H__) +#define __XTTRAYICON_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: XT_TRAYICON is a stand alone helper structure. It is used by CXTTrayIcon +// to maintain an animation icon list. +struct XT_TRAYICON +{ + HICON hIcon; // Handle to the icon displayed. + CString strToolTip; // A NULL terminated string that represents the tooltip displayed for the tray icon. +}; + +// Summary: Animated icon array. +typedef CList CXTTrayIconList; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTrayIcon is a CWnd derived class of the NOTIFYICONDATA structure. +// It is used to display a system tray icon with animation. +class _XT_EXT_CLASS CXTTrayIcon : public CWnd +{ +public: + + // Summary: Constructs a CXTTrayIcon object. + CXTTrayIcon(); + + // Summary: Destroys a CXTTrayIcon object, handles cleanup and de-allocation. + virtual ~CXTTrayIcon(); + +protected: + + UINT m_uFlags; // Style settings for icon restore. + UINT m_nIconID; // Resource ID for the default icon. + UINT m_nIDEvent; // Timer event ID. + UINT m_nCounter; // Holds the current position in the timer loop. + UINT m_uDefMenuItemID; // Default popup menu item ID. + bool m_bDefMenuItemByPos; // Determines if the default menu item is a command or index. + bool m_bHidden; // State of the icon. true to indicate the icon is hidden. + bool m_bRemoved; // true if the icon has been removed from the system tray. + bool m_bShowPending; // true if the icon display is pending. + HWND m_hWndNotify; // Handle to the window that receives command notification. + CWnd m_wndMinimize; // Hidden window used during minimize and restore functions. + size_t m_iMaxTipSize; // Maximum size for tooltip string. + CString m_strToolTip; // Tooltip for the default icon. + CXTIconHandle m_hIcon; // Default icon. + NOTIFYICONDATA m_NIData; // Tray icon structure. + CXTTrayIconList m_arTrayIcons; // Array of icons and text that are displayed during animation. + +public: + + // Input: lpszCaption - Default tooltip text to display for the icon. + // pParentWnd - Pointer to the window that will receive notification messages + // associated with an icon in the taskbar status area. + // nIconID - Resource ID for the default tray icon. + // uMenuID - Popup menu resource identifier. + // uDefMenuItemID - Command ID that represents the default item for the menu. + // bDefMenuItemByPos - true if the default is defined by its position. false if it is + // defined by its command ID. + // Returns: true if successful, otherwise returns false. + // Summary: This member function will create the system tray icon. + virtual bool Create(LPCTSTR lpszCaption,CWnd* pParentWnd,UINT nIconID,UINT uMenuID=0,UINT uDefMenuItemID=0,bool bDefMenuItemByPos=false); + + // BULLETED LIST: + + // Input: lpszInfo - Pointer to a null-terminated string with the text for a balloon + // ToolTip. It can have a maximum of 255 characters. + // lpszInfoTitle - Pointer to a null-terminated string containing a title for a + // balloon ToolTip. This title appears in boldface above the text. + // It can have a maximum of 63 characters. + // dwInfoFlag - Flags that can be set to add an icon to a balloon ToolTip. + // It is placed to the left of the title. If the 'lpszInfoTitle' member + // is zero-length, the icon is not shown, can be any of the following: + // [ul] + // [li]NIIF_ERROR An error icon.[/li] + // [li]NIIF_INFO An information icon.[/li] + // [li]NIIF_NONE No icon.[/li] + // [li]NIIF_WARNING A warning icon.[/li] + // [/ul] + // uTimeout - The timeout value, in milliseconds, for a balloon ToolTip. + // The system enforces minimum and maximum timeout values. 'uTimeout' + // values that are too large are set to the maximum value, and values + // that are too small default to the minimum value. The system minimum + // and maximum timeout values are currently set at 10 seconds and 30 + // seconds, respectively. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to display a balloon tooltip for the system + // tray icon. Must have Windows 2000 or later. + bool ShowBalloonTip(LPCTSTR lpszInfo=NULL,LPCTSTR lpszInfoTitle=NULL, DWORD dwInfoFlags=NIIF_NONE,UINT uTimeout=10); + + // Summary: This member function will stop the tray icon animation timer. + virtual void StopAnimation(); + + // Input: uElapse - Specifies the time-out value, in milliseconds, between frames. + // Summary: This member function will start the tray icon animation timer. + virtual void StartAnimation(UINT uElapse=500); + + // Input: lpIDArray - An array of resource IDs that represent the icons to display + // in the caption area. + // nIDCount - Size of the array 'lpStrTipArray'. + // lpStrTipArray - An array of tooltips that match the icons passed in as 'lpStrTipArray'. + // If NULL, the default tooltip will be used. + // Returns: true if successful, otherwise returns false. + // Summary: This member function will set the icons used for animated system + // tray icons. To use, call SetAnimationIcons, then SetTimer. + virtual bool SetAnimationIcons(const UINT* lpIDArray,int nIDCount,const CString* lpStrTipArray=NULL); + + // Input: lpszTipText - Null terminated string that represents the tooltip text to display + // for the icon. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to set the tooltip text for the tray icon. + bool SetTooltipText(LPCTSTR lpszTipText); + + // Input: nTipText - Windows string resource ID that represents the tooltip text + // to display for the icon. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to set the tooltip text for the tray icon. + bool SetTooltipText(UINT nTipText); + + // Returns: A CString object that represents the tooltip text. + // Summary: Call this member function to retrieve the tooltip text that is displayed + // by the tray icon. + CString GetTooltipText() const; + + // Summary: This member function is called to reset the tray icon control settings + // to their default value. + void SetDefaultValues(); + + // Input: uNewCallbackMessage - Notification message ID. + // Returns: true if successful, otherwise returns false. + // Summary: This member function will set the callback message to be used by the + // tray icon. + bool SetCallbackMessage(UINT uNewCallbackMessage); + + // Returns: An ID to a notification message. + // Summary: This member function will retrieve the notification message ID used + // by the tray icon. + UINT GetCallbackMessage(); + + // Input: uItem - Command identifier or position of the default menu item. + // bByPos - true if 'uItem' is the menu item's index, false if it is the menu + // item's command ID. + // Returns: true if successful, otherwise returns false. + // Summary: This member function will set the default menu item for the tray icon's + // popup menu if the tray icon handles notification messages. + bool SetDefaultMenuItem(UINT uItem,bool bByPos); + + // Input: uItem - Reference to a UINT that is to receive the default menu item ID. + // bByPos - Reference to a bool that is to receive the default menu item position + // flag. + // Summary: Call this member function to retrieve the item ID and position flag + // for the tray icon. + void GetDefaultMenuItem(UINT& uItem,bool& bByPos); + + // Input: pWndNotify - Points to a valid CWnd object. + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to set the window that is to receive notification + // messages from the tray icon. + bool SetNotificationWnd(CWnd* pWndNotify); + + // Returns: A pointer to a valid CWnd object. + // Summary: Call this member function to retrieve a pointer to the window that + // receives notification messages from the tray icon. + CWnd* GetNotificationWnd(); + + // Input: hIcon - Handle to the icon to display. + // Returns: true if the icon was set, otherwise returns false. + // Summary: Call this member function to set the icon that is displayed in the + // system tray. + bool SetIcon(HICON hIcon); + + // Input: lpszIconName - Resource name of the icon to display. + // Returns: true if the icon was set, otherwise returns false. + // Summary: Call this member function to set the icon that is displayed in the + // system tray. + bool SetIcon(LPCTSTR lpszIconName); + + // Input: nIDResource - Resource identifier of the icon to display. + // Returns: true if the icon was set, otherwise returns false. + // Summary: Call this member function to set the icon that is displayed in the + // system tray. + bool SetIcon(UINT nIDResource); + + // Returns: A handle to the icon displayed in the system tray. + // Summary: Call this member function to return a handle to the icon displayed + // in the system tray. + HICON GetIcon() const; + + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to add the icon to the system tray. + bool AddIcon(); + + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to remove the icon from the system tray. + bool RemoveIcon(); + + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to hide the system tray icon, in Windows + // 2000 or greater. + bool HideIcon(); + + // Returns: true if successful, otherwise returns false. + // Summary: Call this member function to show the system tray icon, in Windows + // 2000 or greater. + bool ShowIcon(); + + // Input: pWnd - Window to minimize. + // Summary: Call this member function to minimize the specified window to the system + // tray. If window animation is supported, the window will glide down + // to the system tray. + void MinimizeToTray(CWnd* pWnd); + + // Input: pWnd - Window to maximize. + // Summary: Call this member function to maximize the specified window from the + // system tray. If window animation is supported, the window will glide + // up from the system tray. + void MaximizeFromTray(CWnd* pWnd); + + // Ignore: + //{{AFX_VIRTUAL(CXTTrayIcon) + protected: + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + virtual LRESULT OnTrayNotification(WPARAM wParam, LPARAM lParam); + //}}AFX_VIRTUAL + + virtual void InstallIconPending(); + virtual bool CreateMinimizeWnd(CWnd* pWndApp); + virtual void RemoveAnimationIcons(); + + // Ignore: + //{{AFX_MSG(CXTTrayIcon) + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + //}}AFX_MSG + afx_msg LRESULT OnTaskbarCreated(WPARAM wParam, LPARAM lParam); + + DECLARE_MESSAGE_MAP() + +public: + // OBSOLETE + + virtual bool Create(LPCTSTR lpszCaption, DWORD dwStyle, CWnd* pParentWnd, UINT nIconID); + virtual void SetTooltip(CString strToolTip); + virtual void SetTrayIcon(UINT nIcon, DWORD dwMessage=NIM_ADD); + virtual void SetAnimationIcons(const UINT* lpIDArray,const CString* lpStrTipArray,int nIDCount); + virtual void KillTimer(); + virtual void SetTimer(UINT nIDEvent, UINT uElapse); + // END OBSOLETE + +}; + +////////////////////////////////////////////////////////////////////// + +// OBSOLETE + +AFX_INLINE bool CXTTrayIcon::Create(LPCTSTR lpszCaption, DWORD dwStyle, CWnd* pParentWnd, UINT nIconID) { + UNREFERENCED_PARAMETER(dwStyle); return Create(lpszCaption, pParentWnd, nIconID); +} +AFX_INLINE void CXTTrayIcon::SetTooltip(CString strToolTip) { + SetTooltipText(strToolTip); +} +AFX_INLINE void CXTTrayIcon::SetTrayIcon(UINT nIcon, DWORD dwMessage) { + UNREFERENCED_PARAMETER(dwMessage); SetIcon(nIcon); +} +AFX_INLINE void CXTTrayIcon::SetAnimationIcons(const UINT* lpIDArray,const CString* lpStrTipArray,int nIDCount) { + SetAnimationIcons(lpIDArray, nIDCount, lpStrTipArray); +} +AFX_INLINE void CXTTrayIcon::KillTimer() { + StopAnimation(); +} +AFX_INLINE void CXTTrayIcon::SetTimer(UINT nIDEvent, UINT uElapse) { + m_nIDEvent = nIDEvent; StartAnimation(uElapse); +} +// END OBSOLETE + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__TRAYICON_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTTreeCtrl.h b/Editor/XT/Include/XTTreeCtrl.h new file mode 100644 index 0000000..84a4096 --- /dev/null +++ b/Editor/XT/Include/XTTreeCtrl.h @@ -0,0 +1,326 @@ +// XTTreeCtrl.h interface for the CXTTreeCtrl class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTREECTRL_H__) +#define __XTTREECTRL_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// Summary: CMap definition for mapping XT_CLRFONT structures. +typedef CMap CXTColorFontMap; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTreeCtrl is a CTreeCtrl derived class. It extends the CTreeCtrl +// class to add additional functionality, including tree traversal, searching, +// color, and settings. +class _XT_EXT_CLASS CXTTreeCtrl : public CTreeCtrl +{ + DECLARE_DYNAMIC(CXTTreeCtrl) + +public: + + // Summary: Constructs a CXTTreeCtrl object. + CXTTreeCtrl(); + + // Summary: Destroys a CXTTreeCtrl object, handles cleanup and de-allocation. + virtual ~CXTTreeCtrl(); + +protected: + + BOOL m_bMultiSelect; // TRUE for a multi-selection tree control. + BOOL m_bBandLabel; // TRUE to include the label when selecting tree items. + HTREEITEM m_hSelect; // For shift selection. + CXTColorFontMap m_mapColorFont; // Struct that contains the color and logfont for the tree item. + +private: + + bool m_bActionDone; + bool m_bTreeNotify; + bool m_bOkToEdit; + +public: + + // BULLETED LIST: + + // Input: hItem - Handle of a tree item. + // nCode - A flag indicating the type of relation to 'hItem'. This flag + // can be one of the following values: + // [ul] + // [li]TVGN_CARET Retrieves the currently selected item.[/li] + // [li]TVGN_CHILD Retrieves the first child item. The + // 'hItem' parameter must be NULL.[/li] + // [li]TVGN_DROPHILITE Retrieves the item that is the target + // of a drag-and-drop operation.[/li] + // [li]TVGN_FIRSTVISIBLE Retrieves the first visible item.[/li] + // [li]TVGN_NEXT Retrieves the next sibling item.[/li] + // [li]TVGN_NEXTVISIBLE Retrieves the next visible item + // that follows the specified item.[/li] + // [li]TVGN_PARENT Retrieves the parent of the specified + // item.[/li] + // [li]TVGN_PREVIOUS Retrieves the previous sibling item.[/li] + // [li]TVGN_PREVIOUSVISIBLE Retrieves the first visible + // item that precedes the specified item.[/li] + // [li]TVGN_ROOT Retrieves the first child item of the + // root item of which the specified item is a part.[/li] + // [/ul] + // Returns: The handle of the next item if successful, otherwise returns NULL. + // Summary: This member function will retrieve the tree view item that has the + // specified relationship, indicated by the 'nCode' parameter, to 'hItem'. + virtual HTREEITEM GetNextItem(HTREEITEM hItem,UINT nCode); + + // Input: hItem - Handle of the reference item. + // Returns: The item immediately below the reference item. + // Summary: This member function gets the next item as if the outline was completely + // expanded. + virtual HTREEITEM GetNextItem(HTREEITEM hItem); + + // Input: hItem - Handle of the reference item. + // Returns: The item immediately above the reference item. + // Summary: This member function gets the previous item as if the outline was + // completely expanded. + virtual HTREEITEM GetPrevItem(HTREEITEM hItem); + + // Input: hItem - Node identifying the branch. NULL will return the last item + // in the outline. + // Returns: The handle of the last item. + // Summary: This member function gets the last item in the branch. + virtual HTREEITEM GetLastItem(HTREEITEM hItem); + + // Input: lpszSearch - String to search for. + // bCaseSensitive - TRUE if the search should be case sensitive. + // bDownDir - TRUE for down. + // bWholeWord - TRUE if search should match whole words. + // hItem - Handle of the tree item to start searching from, NULL to use + // the currently selected tree item. + // Returns: The handle to the item, or returns NULL. + // Summary: This member function finds an item that contains the search string. + virtual HTREEITEM FindItem(LPCTSTR lpszSearch,BOOL bCaseSensitive=FALSE,BOOL bDownDir=TRUE,BOOL bWholeWord=FALSE,HTREEITEM hItem=NULL); + + // Input: hItem - Handle of the reference item. + // logfont - New font for the tree item. + // Summary: This member function sets the font for the reference tree item. + virtual void SetItemFont(HTREEITEM hItem,LOGFONT& logfont); + + // Input: hItem - Handle of the reference item. + // plogfont - Pointer to receive LOGFONT information. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function retrieves the current LOGFONT font used by + // the tree item. + virtual BOOL GetItemFont(HTREEITEM hItem,LOGFONT* plogfont); + + // Input: hItem - Handle of the reference item. + // bBold - TRUE for bold font. + // Summary: This member function sets the reference tree item font to bold. + virtual void SetItemBold(HTREEITEM hItem,BOOL bBold=TRUE); + + // Input: hItem - Handle of the reference item. + // Returns: TRUE if the tree item has a bold font, otherwise returns FALSE. + // Summary: This member function checks to see if the tree item has a bold font. + virtual BOOL GetItemBold(HTREEITEM hItem); + + // Input: hItem - Handle of the reference item. + // color - RGB value for the tree item's text. + // Summary: This member function sets the tree item text color. + virtual void SetItemColor(HTREEITEM hItem,COLORREF color); + + // Input: hItem - Handle of the reference item. + // Returns: An RGB value for the referenced tree item, or -1, if color was not set. + // Summary: This member function returns the RGB text value for the referenced + // tree item, or (COLORREF)-1, if color was not set. + virtual COLORREF GetItemColor(HTREEITEM hItem); + + // Input: bMultiSelect - TRUE for multi-selection tree control. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function enables or disables multi-selection for the + // tree control. + virtual BOOL EnableMultiSelect(BOOL bMultiSelect=TRUE); + + // Input: hItem - Handle of the reference item. + // Returns: A handle to the previously selected tree item. + // Summary: This member function returns the previously selected tree item in + // a multi-selection tree control. + virtual HTREEITEM GetPrevSelectedItem(HTREEITEM hItem); + + // Input: hItem - Handle of the reference item. + // Returns: A handle to the next selected tree item. + // Summary: This member function returns the next selected item in a multi-selection + // tree control. + HTREEITEM GetNextSelectedItem(HTREEITEM hItem) const; + + // Returns: A handle to the first selected tree item. + // Summary: This member function retrieves the first selected item in a multi-selection + // tree control. + HTREEITEM GetFirstSelectedItem() const; + + // Returns: A UINT representing the number of tree items selected. + // Summary: This member function retrieves the number of tree items that are + // selected. + UINT GetSelectedCount() const; + + // Input: hItem - Handle of the item whose state is to be set. + // nState - Specifies new states for the item. + // nStateMask - Specifies which states are to be changed. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function is a replacement for the base class function of + // the same name, to handle TVIS_FOCUSED in a multi-select tree control. + // It sets the state of the item specified by 'hItem'. + BOOL SetItemState(HTREEITEM hItem,UINT nState,UINT nStateMask); + + // Input: hItem - Handle of the item whose state is to be retrieved. + // nStateMask - Mask indicating which states are to be retrieved. For more information + // on possible values for 'nStateMask', see the discussion of the 'state' + // and 'stateMask' members of the TVITEM structure in the Platform SDK. + // Returns: The state of the item specified by 'hItem'. + // Summary: This member function is a replacement for the base class function of + // the same name, to handle TVIS_FOCUSED in a multi-select tree control. + UINT GetItemState(HTREEITEM hItem,UINT nStateMask) const; + + // Input: hItem - Handle of a tree item. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function is a replacement for the base class function of + // the same name, to handle TVIS_FOCUSED in a multi-select tree control. + // Call this function to select the given tree view item. If 'hItem' is + // NULL, then this function selects no item. + BOOL SelectItem(HTREEITEM hItem); + + // Returns: The handle of the item that has focus, otherwise returns NULL. + // Summary: This member function returns the handle to the tree item that currently + // has focus. + HTREEITEM GetFocusedItem() const; + + // Input: hItem - Handle of a tree item. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will set the focus for the tree item specified + // by 'hItem'. + BOOL FocusItem(HTREEITEM hItem); + + // Input: bSelect - TRUE to select all items, or FALSE to clear the selection. + // Summary: Call this member function to clear, or select, all of the visible items + // in the tree control. This will not effect the focus of the tree items. + void SelectAll(BOOL bSelect = TRUE); + + // Input: hItemFrom - The item to start selecting from. + // hItemTo - The item to end selection at. + // bOnly - TRUE to only select the specified range, or FALSE to keep existing + // selections. + // Summary: This member function selects items from 'hItemFrom' to 'hItemTo' in + // a multi-selection tree control. It does not select a child item if + // the parent is collapsed. It will remove selection from all other items + // if 'bOnly' is set to TRUE. + void SelectItems(HTREEITEM hItemFrom,HTREEITEM hItemTo,BOOL bOnly = TRUE); + + // Input: hItem - Handle of a tree item. + // Returns: TRUE if the specified item is selected, otherwise returns FALSE. + // Summary: This member function checks to see if the specified item is selected. + BOOL IsSelected(HTREEITEM hItem) const; + + // Input: hParent - Handle of the tree item to begin selection from. + // bSelect - TRUE to only select the child items, or FALSE to keep existing selections. + // bRecurse - TRUE to recurse all siblings, or FALSE to only select children of the + // parent item. + // Returns: TRUE if focus was on a child item, otherwise returns FALSE. + // Summary: This member function will cause all of the children of the specified + // tree item to be selected or deselected. + BOOL SelectChildren(HTREEITEM hParent,BOOL bSelect = TRUE,BOOL bRecurse = TRUE); + + // Input: list - Reference to a CTypedPtrList object. + // Summary: This member function will retrieve a reference to the typed pointer + // array that contains the items selected in the tree control. + void GetSelectedList(CTypedPtrList& list) const; + + // Returns: TRUE if the tree control is a multi-select tree, otherwise returns FALSE. + // Summary: This member function checks to see if the tree control is a multi-select + // tree. + BOOL IsMultiSelect() const; + + // Input: bLabel - TRUE to select items only when banding rect passes over the text label, + // or FALSE to select items when banding rect passes over any part of + // the tree item. + // Returns: The previous banding state. + // Summary: This member function sets the banding mode for a multi-selection tree + // control. If 'bLabel' is TRUE, then items are selected only when the + // banding rect passes over the tree item label. If 'bLabel' is FALSE, + // then passing over any part of the tree item will cause selection to + // be made when the banding rect passes over it. + BOOL SetBandingHit(BOOL bLabel); + + // Returns: true if the tree control sent the WM_NOTIFY message, otherwise, returns false. + // Summary: Call this member function to determine if the WM_NOTIFY message that was + // sent was sent by the tree control or the framework. + bool IsTreeNotify(); + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTTreeCtrl) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult); + //}}AFX_VIRTUAL + + virtual LRESULT SendNotify(LPNMHDR pNMHDR); + virtual void SelectAllIgnore(BOOL bSelect, HTREEITEM hIgnore); + virtual BOOL OnButtonDown(BOOL bLeft, UINT nFlags, CPoint point); + virtual void DoPreSelection(HTREEITEM hItem, BOOL bLeft, UINT nFlags); + virtual void DoAction(HTREEITEM hItem, BOOL bLeft, UINT nFlags, CPoint point); + virtual void DoBanding(UINT nFlags, CPoint point); + virtual void UpdateSelectionForRect(LPCRECT pRect, UINT nFlags, CTypedPtrList& list); + virtual BOOL IsFindValid(HTREEITEM hti); + +protected: + + // Ignore: + //{{AFX_MSG(CXTTreeCtrl) + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg BOOL OnItemExpanding(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE HTREEITEM CXTTreeCtrl::GetNextItem( HTREEITEM hItem, UINT nCode ) { + ASSERT(::IsWindow(m_hWnd)); return CTreeCtrl::GetNextItem( hItem, nCode ); +} +AFX_INLINE HTREEITEM CXTTreeCtrl::GetFocusedItem() const { + ASSERT(m_bMultiSelect); return CTreeCtrl::GetSelectedItem(); +} +AFX_INLINE BOOL CXTTreeCtrl::IsSelected(HTREEITEM hItem) const { + return !!(TVIS_SELECTED & CTreeCtrl::GetItemState(hItem, TVIS_SELECTED)); +} +AFX_INLINE BOOL CXTTreeCtrl::IsMultiSelect() const { + return m_bMultiSelect; +}; +AFX_INLINE BOOL CXTTreeCtrl::SetBandingHit(BOOL bLabel) { + BOOL bReturn = m_bBandLabel; m_bBandLabel = bLabel; return bReturn; +}; +AFX_INLINE bool CXTTreeCtrl::IsTreeNotify() { + return m_bTreeNotify; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_XTTREECTRL_H__E69F83F6_7DC0_4ED8_801D_F24E359A13A9__INCLUDED_) \ No newline at end of file diff --git a/Editor/XT/Include/XTTreeView.h b/Editor/XT/Include/XTTreeView.h new file mode 100644 index 0000000..e4ee902 --- /dev/null +++ b/Editor/XT/Include/XTTreeView.h @@ -0,0 +1,335 @@ +// XTTreeView.h interface for the CXTTreeView class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTTREEVIEW_H__) +#define __XTTREEVIEW_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +// Summary: CMap definition for mapping XT_CLRFONT structures. +typedef CMap CXTColorFontMap; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTTreeView is a CTreeView derived class. It extends the CTreeView +// class to add additional functionality, including tree traversal, searching, +// color, and settings. +class _XT_EXT_CLASS CXTTreeView : public CTreeView +{ + DECLARE_DYNCREATE(CXTTreeView) + +protected: + + // Summary: Protected constructor used by dynamic creation. Constructs a CXTTreeView + // object. + CXTTreeView(); + + // Summary: Destroys a CXTTreeView object, handles cleanup and de-allocation. + virtual ~CXTTreeView(); + +protected: + + BOOL m_bMultiSelect; // TRUE for a multi-selection tree control. + BOOL m_bBandLabel; // TRUE to include the label when selecting tree items. + HTREEITEM m_hSelect; // For shift selection. + CXTColorFontMap m_mapColorFont; // Struct that contains the color and logfont for the tree item. + +private: + + bool m_bActionDone; + bool m_bTreeNotify; + bool m_bOkToEdit; + +public: + + // BULLETED LIST: + + // Input: hItem - Handle of a tree item. + // nCode - A flag indicating the type of relation to 'hItem'. This flag can be + // one of the following values: + // [ul] + // [li]TVGN_CARET Retrieves the currently selected item.[/li] + // [li]TVGN_CHILD Retrieves the first child item. The 'hItem' + // parameter must be NULL.[/li] + // [li]TVGN_DROPHILITE Retrieves the item that is the target + // of a drag-and-drop operation.[/li] + // [li]TVGN_FIRSTVISIBLE Retrieves the first visible item.[/li] + // [li]TVGN_NEXT Retrieves the next sibling item.[/li] + // [li]TVGN_NEXTVISIBLE Retrieves the next visible item + // that follows the specified item.[/li] + // [li]TVGN_PARENT Retrieves the parent of the specified + // item.[/li] + // [li]TVGN_PREVIOUS Retrieves the previous sibling item.[/li] + // [li]TVGN_PREVIOUSVISIBLE Retrieves the first visible + // item that precedes the specified item.[/li] + // [li]TVGN_ROOT Retrieves the first child item of the + // root item of which the specified item is a part.[/li] + // [/ul] + // Returns: The handle of the next item if successful, otherwise returns + // NULL. + // Summary: This member function will retrieve the tree view item that has the + // specified relationship, indicated by the 'nCode' parameter, to 'hItem'. + virtual HTREEITEM GetNextItem(HTREEITEM hItem, UINT nCode); + + // Input: hItem - Handle of the reference item. + // Returns: The handle of the item immediately below the reference item. + // Summary: This member function gets the next item as if the outline was completely + // expanded. + virtual HTREEITEM GetNextItem(HTREEITEM hItem); + + // Input: hItem - Handle of the reference item. + // Returns: The handle of the item immediately above the reference item. + // Summary: This member function gets the previous item as if the outline was + // completely expanded. + virtual HTREEITEM GetPrevItem(HTREEITEM hItem); + + // Input: hItem - Node identifying the branch. NULL will return the last item in the + // outline. + // Returns: The handle of the last item. + // Summary: This member function gets the last item in the branch. + virtual HTREEITEM GetLastItem(HTREEITEM hItem); + + // Input: lpszSearch - String to search for. + // bCaseSensitive - TRUE if the search should be case sensitive. + // bDownDir - TRUE for down. + // bWholeWord - TRUE if search should match whole words. + // hItem - Handle of the tree item to start searching from, NULL to use + // the currently selected tree item. + // Returns: The handle to the item, or NULL. + // Summary: This member function finds an item that contains the search string. + virtual HTREEITEM FindItem(LPCTSTR lpszSearch,BOOL bCaseSensitive=FALSE,BOOL bDownDir=TRUE,BOOL bWholeWord=FALSE,HTREEITEM hItem=NULL); + + // Input: hItem - The reference item. + // logfont - New font for the tree item. + // Summary: This member function sets the reference tree item font. + virtual void SetItemFont(HTREEITEM hItem,LOGFONT& logfont); + + // Input: hItem - Handle of the reference item. + // plogfont - Item's font. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function retrieves the current LOGFONT font used by + // the tree item. + virtual BOOL GetItemFont(HTREEITEM hItem,LOGFONT* plogfont); + + // Input: hItem - Handle of the reference item. + // bBold - TRUE for bold font. + // Summary: This member function sets the reference tree item font to bold. + virtual void SetItemBold(HTREEITEM hItem,BOOL bBold=TRUE); + + // Input: hItem - Handle of the reference item. + // Returns: TRUE if the tree item has a bold font, otherwise returns FALSE. + // Summary: This member function checks to see if the tree item has a bold font. + virtual BOOL GetItemBold(HTREEITEM hItem); + + // Input: hItem - Handle of the reference item. + // color - RGB value for the tree item's text. + // Summary: This member function sets the tree item text color. + // + virtual void SetItemColor(HTREEITEM hItem,COLORREF color); + + // Input: hItem - Handle of the reference item. + // Returns: The RGB text value for the referenced tree item, or (COLORREF)-1, if the + // color was not set. + // Summary: This member function gets the RGB text value for the referenced + // tree item. + virtual COLORREF GetItemColor(HTREEITEM hItem); + + // Input: bMultiSelect - TRUE for a multi-selection tree control. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function enables or disables multi-selection for the + // tree control. + virtual BOOL EnableMultiSelect(BOOL bMultiSelect=TRUE); + + // Input: hItem - Handle of the reference item. + // Returns: A handle to the previously selected tree item. + // Summary: This member function returns the previously selected tree item in + // a multi-selection tree control. + virtual HTREEITEM GetPrevSelectedItem(HTREEITEM hItem); + + // Input: hItem - Handle of the reference item. + // Returns: A handle to the next selected tree item. + // Summary: This member function returns the next selected item in a multi-selection + // tree control. + HTREEITEM GetNextSelectedItem(HTREEITEM hItem) const; + + // Returns: A handle to the first selected tree item. + // Summary: This member function returns the first selected item in a multi-selection + // tree control. + HTREEITEM GetFirstSelectedItem() const; + + // Returns: A UNIT value that represents the number of tree items selected. + // Summary: This member function returns the number of tree items that are selected. + UINT GetSelectedCount() const; + + // Input: hItem - Handle of the item whose state is to be set. + // nState - Specifies the new states for the item. + // nStateMask - Specifies which states are to be changed. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function is a replacement for the base class function of + // the same name, to handle TVIS_FOCUSED in a multi-select tree control. + // It sets the state of the item specified by 'hItem'. + BOOL SetItemState(HTREEITEM hItem,UINT nState,UINT nStateMask); + + // Input: hItem - Handle of the item whose state is to be retrieved. + // nStateMask - Mask indicating which states are to be retrieved. For more information + // on possible values for 'nStateMask', see the discussion of the 'state' + // and 'stateMask' members of the TVITEM structure in the Platform SDK. + // Returns: The state of the item specified by 'hItem'. + // Summary: This member function is a replacement for the base class function of + // the same name, to handle TVIS_FOCUSED in a multi-select tree control. + UINT GetItemState(HTREEITEM hItem,UINT nStateMask) const; + + // Input: hItem - Handle of a tree item. + // Returns: Nonzero if successful, otherwise returns zero. + // Summary: This member function is a replacement for the base class function of + // the same name, to handle TVIS_FOCUSED in a multi-select tree control. + // Call this function to select the given tree view item. If 'hItem' is + // NULL, then this function selects no item. + BOOL SelectItem(HTREEITEM hItem); + + // Returns: The handle of the item that has focus, otherwise returns NULL. + // Summary: This member function returns the handle to the tree item that currently + // has focus. + HTREEITEM GetFocusedItem() const; + + // Input: hItem - Handle of a tree item. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will set the focus for the tree item specified + // by 'hItem'. + BOOL FocusItem(HTREEITEM hItem); + + // Input: bSelect - TRUE to select all the items, or FALSE to clear the selection. + // Summary: Call this member function to clear, or select, all of the visible items + // in the tree control. This will not effect the focus of the tree items. + void SelectAll(BOOL bSelect = TRUE); + + // Input: hItemFrom - Handle of the item to start selecting from. + // hItemTo - Handle of the item to end selection at. + // bOnly - TRUE to only select the specified range, or FALSE to keep existing + // selections. + // Summary: This member function selects items from 'hItemFrom' to 'hItemTo' in + // a multi-selection tree control. It does not select a child item if + // the parent is collapsed. It will remove the selection from all other + // items if 'bOnly' is set to TRUE. + void SelectItems(HTREEITEM hItemFrom,HTREEITEM hItemTo,BOOL bOnly = TRUE); + + // Input: hItem - Handle of a tree item. + // Returns: TRUE if the specified item is selected, otherwise returns FALSE. + // Summary: This member function checks to see if the specified item is selected. + BOOL IsSelected(HTREEITEM hItem) const; + + // Input: hParent - Handle of tree item to begin selection from. + // bSelect - TRUE to only select the child items, or FALSE to keep existing selections. + // bRecurse - TRUE to recurse all siblings, or FALSE to only select children of the + // parent item. + // Returns: TRUE if focus was on a child item, otherwise returns FALSE. + // Summary: This member function will cause all of the children of the specified + // tree item to be selected or deselected. + BOOL SelectChildren(HTREEITEM hParent,BOOL bSelect = TRUE,BOOL bRecurse = TRUE); + + // Input: list - Reference to a CTypedPtrList object. + // Summary: This member function will retrieve a reference to the typed pointer + // array that contains the items selected in the tree control. + void GetSelectedList(CTypedPtrList& list) const; + + // Returns: TRUE if the tree control is a multi-select tree, otherwise returns FALSE. + // Summary: This member function checks to see if the tree control is a multi-select + // tree. + BOOL IsMultiSelect() const; + + // Input: bLabel - TRUE to select items only when banding rect passes over the text label, + // or FALSE to select items when banding rect passes over any part of + // the tree item. + // Returns: The previous banding state. + // Summary: This member function sets the banding mode for a multi-selection tree + // control. If 'bLabel' is TRUE, then items are selected only when the + // banding rect passes over the tree item label. If FALSE, then passing + // over any part of the tree item will cause selection to be made when + // the banding rect passes over it. + BOOL SetBandingHit(BOOL bLabel); + + // Returns: true if the tree control sent the WM_NOTIFY message, otherwise, returns false. + // Summary: Call this member function to determine if the WM_NOTIFY message that was + // sent was sent by the tree control or the framework. + bool IsTreeNotify(); + +protected: + + // Ignore: + //{{AFX_VIRTUAL(CXTTreeView) + public: + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult); + //}}AFX_VIRTUAL + + virtual LRESULT SendNotify(LPNMHDR pNMHDR); + virtual void SelectAllIgnore(BOOL bSelect, HTREEITEM hIgnore); + virtual BOOL OnButtonDown(BOOL bLeft, UINT nFlags, CPoint point); + virtual void DoPreSelection(HTREEITEM hItem, BOOL bLeft, UINT nFlags); + virtual void DoAction(HTREEITEM hItem, BOOL bLeft, UINT nFlags, CPoint point); + virtual void DoBanding(UINT nFlags, CPoint point); + virtual void UpdateSelectionForRect(LPCRECT pRect, UINT nFlags, CTypedPtrList& list); + virtual BOOL IsFindValid(HTREEITEM hti); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + + // Ignore: + //{{AFX_MSG(CXTTreeView) + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg BOOL OnItemExpanding(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE HTREEITEM CXTTreeView::GetNextItem( HTREEITEM hItem, UINT nCode ) { + ASSERT(::IsWindow(m_hWnd)); return GetTreeCtrl().GetNextItem( hItem, nCode ); +} +AFX_INLINE HTREEITEM CXTTreeView::GetFocusedItem() const { + ASSERT(m_bMultiSelect); return GetTreeCtrl().GetSelectedItem(); +} +AFX_INLINE BOOL CXTTreeView::IsSelected(HTREEITEM hItem) const { + return !!(TVIS_SELECTED & GetTreeCtrl().GetItemState(hItem, TVIS_SELECTED)); +} +AFX_INLINE BOOL CXTTreeView::IsMultiSelect() const { + return m_bMultiSelect; +}; +AFX_INLINE BOOL CXTTreeView::SetBandingHit(BOOL bLabel) { + BOOL bReturn = m_bBandLabel; m_bBandLabel = bLabel; return bReturn; +}; +AFX_INLINE bool CXTTreeView::IsTreeNotify() { + return m_bTreeNotify; +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(__XTTREEVIEW_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTVersion.h b/Editor/XT/Include/XTVersion.h new file mode 100644 index 0000000..ee02ff0 --- /dev/null +++ b/Editor/XT/Include/XTVersion.h @@ -0,0 +1,44 @@ +// XTVersion.h Xtreme Toolkit version definitions file +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTVERSION_H__) +#define __XTVERSION_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Xtreme Toolkit version definitions: +////////////////////////////////////////////////////////////////////// + +// Summary: for determining version of XTLIB.DLL +#define _XTLIB_VERSION_ MAKELONG(1,3) +// Summary: Major Version Number +#define _XTLIB_VERSION_MAJOR 3 +// Summary: Minor Version Number +#define _XTLIB_VERSION_MINOR 1 +// Summary: Prefix for dlls/libs +#define _XTLIB_FILE_PREFIX "XT3100" + +////////////////////////////////////////////////////////////////////// +// Evaluation version definitions: +////////////////////////////////////////////////////////////////////// + +//#ifndef _XT_DEMOMODE +//#define _XT_DEMOMODE // defined in the evaluation library +//#endif //_XT_DEMOMODE + +////////////////////////////////////////////////////////////////////// + +#endif // __XTVERSION_H__ diff --git a/Editor/XT/Include/XTWindowPos.h b/Editor/XT/Include/XTWindowPos.h new file mode 100644 index 0000000..9ac622c --- /dev/null +++ b/Editor/XT/Include/XTWindowPos.h @@ -0,0 +1,67 @@ +// XTWindowPos.h interface for the CXTWindowPos class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTWINDOWPLACEMENT_H__) +#define __XTWINDOWPLACEMENT_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTWindowPos is a WINDOWPLACEMENT structure derived class. It extends +// the WINDOWPLACEMENT structure, and is used to save and restore window +// position. +class _XT_EXT_CLASS CXTWindowPos : public WINDOWPLACEMENT +{ +public: + + // Summary: Constructs a CXTWindowPos object. + CXTWindowPos(); + + // Summary: Destroys a CXTWindowPos object, handles cleanup and de-allocation. + virtual ~CXTWindowPos(); + + // Input: lpszWndPos - If NULL, the default entry name will be used. If using this for MDI + // children or other windows, pass in a unique string value here. This + // must match for both LoadWindowPos and SaveWindowPos. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will load the stored window position settings + // without applying them to any window. + BOOL LoadWindowPos(LPCTSTR lpszWndPos=NULL); + + // Input: pWnd - Points to the CWnd* derived window to be restored to its previous state. + // lpszWndPos - If NULL, the default entry name will be used. If using this for MDI + // children or other windows, pass in a unique string value here. This + // must match for both LoadWindowPos and SaveWindowPos. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will load the window specified by 'pWnd' to its + // previous window position. + BOOL LoadWindowPos(CWnd* pWnd,LPCTSTR lpszWndPos=NULL); + + // Input: pWnd - Points to the CWnd* derived windows position to be saved. + // lpszWndPos - If NULL, the default entry name will be used. If using this for MDI + // children or other windows, pass in a unique string value here. This + // must match for both LoadWindowPos and SaveWindowPos. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will save the window specified by 'pWnd' by its + // current window position. + BOOL SaveWindowPos(CWnd* pWnd,LPCTSTR lpszWndPos=NULL); +}; + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTWINDOWPLACEMENT_H__) diff --git a/Editor/XT/Include/XTWndHook.h b/Editor/XT/Include/XTWndHook.h new file mode 100644 index 0000000..8a122b7 --- /dev/null +++ b/Editor/XT/Include/XTWndHook.h @@ -0,0 +1,223 @@ +// XTWndHook.h interface for the CXTWndHook class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTWNDHOOK_H__) +#define __XTWNDHOOK_H__ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +////////////////////////////////////////////////////////////////////// +// Summary: CXTWndHook is a CWnd derived class. It is used to hook a CWnd object +// in order to intercept and act upon window messages that are received. +class _XT_EXT_CLASS CXTWndHook : public CObject +{ + DECLARE_DYNAMIC(CXTWndHook) + +public: + + // Summary: Constructs a CXTWndHook object. + CXTWndHook(); + + // Summary: Destroys a CXTWndHook object, handles cleanup and de-allocation. + virtual ~CXTWndHook(); + +protected: + + HWND m_hWnd; // The window hooked. + WNDPROC m_pOldWndProc; // The original window procedure. + CXTWndHook* m_pNextHook; // Next, in chain of hooks, for this window. + +public: + + // Returns: TRUE if the window has been hooked, otherwise returns FALSE. + // Summary: This member function will check to see if the current window has + // been hooked. + virtual BOOL IsWindowHooked(); + + // Input: pWnd - Points to a CWnd object that represents the window to hook. + // If set to NULL, the window hook is removed. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will hook a window so that its messages are + // intercepted before they are passed on to the specified window. + virtual BOOL HookWindow(CWnd* pWnd); + + // Input: hWnd - A handle to a window that represents the window whose window + // procedure is to be hooked. If set to NULL, the WNDPROC is removed. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will install a new window procedure that directs + // messages to the CXTWndHook. + virtual BOOL HookWindow(HWND hWnd); + + // Input: message - Specifies the Windows message to be processed. + // wParam - Provides additional information used in processing the message. + // The parameter value depends on the message. + // lParam - Provides additional information used in processing the message. + // The parameter value depends on the message. + // Returns: An LRESULT value. The return value depends on the message. + // Summary: This member function provides a Windows procedure (WindowProc) for + // a CXTWndHook object. It dispatches messages through the window's message + // map. + virtual LRESULT WindowProc(UINT message,WPARAM wParam,LPARAM lParam); + + // Returns: An LRESULT value. The return value depends on the message. + // Summary: This member function calls the default window procedure. The default + // window procedure provides default processing for any window message + // that an application does not process. This member function ensures + // that every message is processed. + LRESULT Default(); + + friend class CXTWindowMap; +}; + +// class forwards + +class CXTMenuBar; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMBarWndHook is a CXTWndHook derived class. CXTMBarWndHook is used +// to trap menu related messages sent to the owning frame. The same class +// is also used to trap messages sent to the MDI client window in an MDI +// app. I should really use two classes for this, but it uses less code +// to share the same class. Note, however, that there are two different +// INSTANCES of CXTMBarWndHook in CXTMenuBar: one for the frame, and one +// for the MDI client window. +class _XT_EXT_CLASS CXTMBarWndHook : public CXTWndHook +{ + DECLARE_DYNAMIC(CXTMBarWndHook) + +public: + + // Summary: Constructs a CXTMBarWndHook object. + CXTMBarWndHook(); + + // Summary: Destroys a CXTMBarWndHook object, handles cleanup and de-allocation. + virtual ~CXTMBarWndHook(); + +protected: + + CXTMenuBar* m_pMenuBar; // Points to the owner menu bar. + +public: + + // Input: pMenuBar - Pointer to the owner menu bar. + // hWndToHook - Handle to the frame window. + // Returns: TRUE if successful, otherwise returns FALSE. + // Summary: This member function will install a new window procedure that directs + // messages to the CXTWndHook. + virtual BOOL Install(CXTMenuBar* pMenuBar,HWND hWndToHook); + + // Input: message - Specifies the Windows message to be processed. + // wParam - Provides additional information used in processing the message. + // The parameter value depends on the message. + // lParam - Provides additional information used in processing the message. + // The parameter value depends on the message. + // Returns: An LRESULT value. The return value depends on the message. + // Summary: This member function provides a Windows procedure (WindowProc) for + // a CXTWndHook object. It dispatches messages through the window's message + // map. + virtual LRESULT WindowProc(UINT message,WPARAM wParam,LPARAM lParam); + + friend class CXTMenuBar; +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTMBarMDIWndHook is a CXTMBarWndHook derived class. CXTMBarWndHook +// is used to trap menu related messages sent to the owning frame. The +// same class is also used to trap messages sent to the MDI client window +// in an MDI app. I should really use two classes for this, but it uses +// less code to share the same class. Note, however, that there are two +// different INSTANCES of CXTMBarWndHook in CXTMenuBar; one for the frame, +// and one for the MDI client window. +class _XT_EXT_CLASS CXTMBarMDIWndHook : public CXTMBarWndHook +{ + DECLARE_DYNAMIC(CXTMBarMDIWndHook) + +public: + + // Input: message - Specifies the Windows message to be processed. + // wParam - Provides additional information used in processing the message. + // The parameter value depends on the message. + // lParam - Provides additional information used in processing the message. + // The parameter value depends on the message. + // Returns: An LRESULT value. The return value depends on the message. + // Summary: This member function provides a Windows procedure (WindowProc) for + // a CXTWndHook object. It dispatches messages through the window's message + // map. + virtual LRESULT WindowProc(UINT message,WPARAM wParam,LPARAM lParam); + + friend class CXTMenuBar; +}; + +////////////////////////////////////////////////////////////////////// +// Summary: CXTWindowMap is a CMapPtrToPtr derived class. It is used to create +// a CXTWindowMap class object. +class _XT_EXT_CLASS CXTWindowMap : private CMapPtrToPtr +{ + DECLARE_DYNAMIC(CXTWindowMap) + +public: + + // Summary: Constructs a CXTWindowMap object. + CXTWindowMap(); + + // Summary: Destroys a CXTWindowMap object, handles cleanup and de-allocation. + virtual ~CXTWindowMap(); + + // Input: hWnd - Valid window handle. + // pXTWndHook - A pointer to a CXTWndHook object. + // Summary: This member function adds a hook to the map, that is, it associates + // the hook with the window. + void Add(HWND hWnd,CXTWndHook* pXTWndHook); + + // Input: pXTWndHook - A pointer to a CXTWndHook object. + // Summary: This member function removes a hook from the map. + void Remove(CXTWndHook* pXTWndHook); + + // Input: hWnd - Valid window handle. + // Summary: This member function removes all the hooks for a window. + void RemoveAll(HWND hWnd); + + // Input: hWnd - Valid window handle. + // message - Specifies the Windows message to be processed. + // wParam - Provides additional information used in processing the message. + // The parameter value depends on the message. + // lParam - Provides additional information used in processing the message. + // The parameter value depends on the message. + // Returns: An LRESULT object + // Summary: This member function is a subclassed window procedure for message + // hooks, and replaces AfxWndProc, or whatever else was there before. + static LRESULT CALLBACK HookWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam); + + // Input: hWnd - Valid window handle. + // Returns: A CXTWndHook pointer. + // Summary: This member function finds the first hook associated with the window. + CXTWndHook* Lookup(HWND hWnd); +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE BOOL CXTWndHook::IsWindowHooked() { + return (m_hWnd != NULL); +} +AFX_INLINE BOOL CXTWndHook::HookWindow(CWnd* pWnd) { + return HookWindow(pWnd->GetSafeHwnd()); +} + +////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif // #if !defined(__XTWNDHOOK_H__) \ No newline at end of file diff --git a/Editor/XT/Include/XTWndShadow.h b/Editor/XT/Include/XTWndShadow.h new file mode 100644 index 0000000..5eeed65 --- /dev/null +++ b/Editor/XT/Include/XTWndShadow.h @@ -0,0 +1,148 @@ +// XTWndShadow.h: interface for the CXTWndShadow class. +// +// This file is a part of the Xtreme Toolkit for MFC. +// ©1998-2003 Codejock Software, All Rights Reserved. +// +// This source code can only be used under the terms and conditions +// outlined in the accompanying license agreement. +// +// support@codejock.com +// http://www.codejock.com +// +////////////////////////////////////////////////////////////////////// + +#if !defined(__XTWNDSHADOW_H__) +#define __XTWNDSHADOW_H__ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +typedef BOOL (WINAPI *LayeredProc) +( + HWND hwnd, // handle to layered window + HDC hdcDst, // handle to screen DC + POINT *pptDst, // new screen position + SIZE *psize, // new size of the layered window + HDC hdcSrc, // handle to surface DC + POINT *pptSrc, // layer position + COLORREF crKey, // color key + BLENDFUNCTION *pblend, // blend function + DWORD dwFlags // options +); + +class CXTShadowWnd; + +typedef CList CXTShadowList; + +// Uncomment this line to disable alpha shadow. DEBUG ONLY +// #define NOALPHASHADOW + +////////////////////////////////////////////////////////////////////// +// CXTShadowsManager is a stand alone internal Toolkit class. It is used to +// manage shadows for popup menus. + +class CXTShadowsManager +{ + class CShadowList : public CXTShadowList + { + public: + void AddShadow(CXTShadowWnd* pShadow); + void RemoveShadow(CXTShadowWnd* pShadow); + friend class CXTShadowWnd; + }; + + CXTShadowsManager(void); + +public: + ~CXTShadowsManager(void); + + void SetShadow(HWND hWnd, const CRect& rcExclude = CRect(0, 0, 0, 0)); + void SetShadow(CRect rc, HWND hwndHook); + +private: + + BOOL AlphaShadow() + { + #ifdef NOALPHASHADOW + return FALSE; + #endif + + return (UpdateLayeredWindow != NULL); + } + BOOL PseudoShadow() + { + if (AlphaShadow()) + return FALSE; + + return !xtAfxData.bUseSolidShadows; + } + void DestroyShadow(CXTShadowWnd*); + CXTShadowWnd* CreateShadow(BOOL bHoriz, HWND hWnd, CRect rcExclude); + CXTShadowWnd* CreateShadow(BOOL bHoriz, CRect rc, CRect rcExclude, HWND hwndHook); + +private: + + HMODULE m_hLib; + LayeredProc UpdateLayeredWindow; + CShadowList m_lstShadow; + static CXTShadowsManager s_managerInstance; + CList m_lstPool; + + friend class CXTShadowsManager* XTShadowsManager(); + friend class CXTShadowWnd; + +}; + +////////////////////////////////////////////////////////////////////// + +AFX_INLINE CXTShadowsManager* XTShadowsManager() { + return &CXTShadowsManager::s_managerInstance; +} + +////////////////////////////////////////////////////////////////////// + +class CXTShadowWnd : public CWnd +{ + friend class CXTShadowsManager; + friend class CXTShadowsManager::CShadowList; + friend class CXTShadowHook; + +private: + CXTShadowWnd(); + BOOL Create(BOOL bHoriz, CRect rcWindow); + void LongShadow(CXTShadowsManager::CShadowList* pList); + BOOL ExcludeRect(CRect rcExclude); + + int OnHookMessage(UINT nMessage, WPARAM& wParam, LPARAM& lParam); + + void DrawPseudoShadow(CDC* pDC, CRect& rcClient); + void ComputePseudoShadow(CDC* pDC, CRect& rcShadow); + void CreatePseudoShadow(); + +private: + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg void OnParentPosChanged(); + afx_msg void OnTimer(UINT_PTR nID); + + DECLARE_MESSAGE_MAP(); + +private: + + int m_nWidth; + BOOL m_bAutoPosition; + BOOL m_bHoriz; + BOOL m_bAlphaShadow; + BOOL m_bPseudoShadow; + HWND m_hwndHook; + CRect m_rcExclude; + CXTMemDC* m_pShadowDC; + CXTWndHook* m_pHook; +}; + +////////////////////////////////////////////////////////////////////// + +#endif // !defined(__XTWNDSHADOW_H__) diff --git a/Editor/XT/Include/res/btn_bar.bmp b/Editor/XT/Include/res/btn_bar.bmp new file mode 100644 index 0000000..4763f3b Binary files /dev/null and b/Editor/XT/Include/res/btn_bar.bmp differ diff --git a/Editor/XT/Include/res/btn_frame.bmp b/Editor/XT/Include/res/btn_frame.bmp new file mode 100644 index 0000000..9426849 Binary files /dev/null and b/Editor/XT/Include/res/btn_frame.bmp differ diff --git a/Editor/XT/Include/res/btn_listedit.bmp b/Editor/XT/Include/res/btn_listedit.bmp new file mode 100644 index 0000000..4919d20 Binary files /dev/null and b/Editor/XT/Include/res/btn_listedit.bmp differ diff --git a/Editor/XT/Include/res/btn_out.bmp b/Editor/XT/Include/res/btn_out.bmp new file mode 100644 index 0000000..5f7be43 Binary files /dev/null and b/Editor/XT/Include/res/btn_out.bmp differ diff --git a/Editor/XT/Include/res/btn_print.bmp b/Editor/XT/Include/res/btn_print.bmp new file mode 100644 index 0000000..0fbb343 Binary files /dev/null and b/Editor/XT/Include/res/btn_print.bmp differ diff --git a/Editor/XT/Include/res/checklist.bmp b/Editor/XT/Include/res/checklist.bmp new file mode 100644 index 0000000..b6278ba Binary files /dev/null and b/Editor/XT/Include/res/checklist.bmp differ diff --git a/Editor/XT/Include/res/checklist_3d.bmp b/Editor/XT/Include/res/checklist_3d.bmp new file mode 100644 index 0000000..01363a2 Binary files /dev/null and b/Editor/XT/Include/res/checklist_3d.bmp differ diff --git a/Editor/XT/Include/res/dragcopy.cur b/Editor/XT/Include/res/dragcopy.cur new file mode 100644 index 0000000..fe1eebe Binary files /dev/null and b/Editor/XT/Include/res/dragcopy.cur differ diff --git a/Editor/XT/Include/res/dragmove.cur b/Editor/XT/Include/res/dragmove.cur new file mode 100644 index 0000000..55e5ae7 Binary files /dev/null and b/Editor/XT/Include/res/dragmove.cur differ diff --git a/Editor/XT/Include/res/dragnone.cur b/Editor/XT/Include/res/dragnone.cur new file mode 100644 index 0000000..1862fb2 Binary files /dev/null and b/Editor/XT/Include/res/dragnone.cur differ diff --git a/Editor/XT/Include/res/font.bmp b/Editor/XT/Include/res/font.bmp new file mode 100644 index 0000000..8ba6d97 Binary files /dev/null and b/Editor/XT/Include/res/font.bmp differ diff --git a/Editor/XT/Include/res/hand.cur b/Editor/XT/Include/res/hand.cur new file mode 100644 index 0000000..614403a Binary files /dev/null and b/Editor/XT/Include/res/hand.cur differ diff --git a/Editor/XT/Include/res/handnone.cur b/Editor/XT/Include/res/handnone.cur new file mode 100644 index 0000000..f9d019f Binary files /dev/null and b/Editor/XT/Include/res/handnone.cur differ diff --git a/Editor/XT/Include/res/lightbulb.bmp b/Editor/XT/Include/res/lightbulb.bmp new file mode 100644 index 0000000..3808a6b Binary files /dev/null and b/Editor/XT/Include/res/lightbulb.bmp differ diff --git a/Editor/XT/Include/res/scroll.bmp b/Editor/XT/Include/res/scroll.bmp new file mode 100644 index 0000000..63ff091 Binary files /dev/null and b/Editor/XT/Include/res/scroll.bmp differ diff --git a/Editor/XT/Include/res/splith.cur b/Editor/XT/Include/res/splith.cur new file mode 100644 index 0000000..bb03d77 Binary files /dev/null and b/Editor/XT/Include/res/splith.cur differ diff --git a/Editor/XT/Include/res/splitv.cur b/Editor/XT/Include/res/splitv.cur new file mode 100644 index 0000000..1fd0d55 Binary files /dev/null and b/Editor/XT/Include/res/splitv.cur differ diff --git a/Editor/XT/Include/res/tbar_blank.bmp b/Editor/XT/Include/res/tbar_blank.bmp new file mode 100644 index 0000000..0b00e17 Binary files /dev/null and b/Editor/XT/Include/res/tbar_blank.bmp differ diff --git a/Editor/XT/Include/res/tbar_hdr.bmp b/Editor/XT/Include/res/tbar_hdr.bmp new file mode 100644 index 0000000..582a8d9 Binary files /dev/null and b/Editor/XT/Include/res/tbar_hdr.bmp differ diff --git a/Editor/XT/Include/res/tbar_hex.bmp b/Editor/XT/Include/res/tbar_hex.bmp new file mode 100644 index 0000000..2a746c0 Binary files /dev/null and b/Editor/XT/Include/res/tbar_hex.bmp differ diff --git a/Editor/XT/Include/res/tbar_out.bmp b/Editor/XT/Include/res/tbar_out.bmp new file mode 100644 index 0000000..1e1ba5c Binary files /dev/null and b/Editor/XT/Include/res/tbar_out.bmp differ diff --git a/Editor/XT/Include/res/tbar_preview.bmp b/Editor/XT/Include/res/tbar_preview.bmp new file mode 100644 index 0000000..0d8d568 Binary files /dev/null and b/Editor/XT/Include/res/tbar_preview.bmp differ diff --git a/Editor/XT/Include/res/xtreme.ico b/Editor/XT/Include/res/xtreme.ico new file mode 100644 index 0000000..f85fee8 Binary files /dev/null and b/Editor/XT/Include/res/xtreme.ico differ diff --git a/Editor/XT/lib/XT3100LibDynStatic.lib b/Editor/XT/lib/XT3100LibDynStatic.lib new file mode 100644 index 0000000..42da3da Binary files /dev/null and b/Editor/XT/lib/XT3100LibDynStatic.lib differ diff --git a/Editor/XT/lib/XT3100LibDynStatic64.lib b/Editor/XT/lib/XT3100LibDynStatic64.lib new file mode 100644 index 0000000..663def1 Binary files /dev/null and b/Editor/XT/lib/XT3100LibDynStatic64.lib differ diff --git a/Editor/XT/lib/XT3100LibDynStatic_2003.lib b/Editor/XT/lib/XT3100LibDynStatic_2003.lib new file mode 100644 index 0000000..020c7fd Binary files /dev/null and b/Editor/XT/lib/XT3100LibDynStatic_2003.lib differ diff --git a/Editor/XT/lib/XT3100LibDynStaticd.lib b/Editor/XT/lib/XT3100LibDynStaticd.lib new file mode 100644 index 0000000..1bf0635 Binary files /dev/null and b/Editor/XT/lib/XT3100LibDynStaticd.lib differ diff --git a/Editor/XT/lib/XT3100LibDynStaticd64.lib b/Editor/XT/lib/XT3100LibDynStaticd64.lib new file mode 100644 index 0000000..79c4d4c Binary files /dev/null and b/Editor/XT/lib/XT3100LibDynStaticd64.lib differ diff --git a/Editor/XT/lib/XT3100LibDynStaticd_2003.lib b/Editor/XT/lib/XT3100LibDynStaticd_2003.lib new file mode 100644 index 0000000..9fd1190 Binary files /dev/null and b/Editor/XT/lib/XT3100LibDynStaticd_2003.lib differ diff --git a/FARCRY/FarCry.vcproj.vspscc b/FARCRY/FarCry.vcproj.vspscc index 6cb031b..dcc120f 100644 --- a/FARCRY/FarCry.vcproj.vspscc +++ b/FARCRY/FarCry.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/FARCRY/FarCry.vcxproj b/FARCRY/FarCry.vcxproj new file mode 100644 index 0000000..3521af5 --- /dev/null +++ b/FARCRY/FarCry.vcxproj @@ -0,0 +1,416 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D} + Perforce Project + + . + MSSCCI:Perforce SCM + 10.0 + + + + Application + v143 + false + MultiByte + true + + + Application + v143 + false + MultiByte + + + Application + v143 + false + MultiByte + + + Application + v143 + false + MultiByte + + + Application + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + C:\MasterCD\Bin64\ + Debug64\ + true + + + C:\MasterCD\Bin64\ + Release64\ + false + + + + Full + AnySuitable + true + Size + true + false + .\;..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + + .\Profile/FarCry.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 /fixed:no %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + true + Windows + 0x37000000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/FarCry.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + .\;..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + + stdafx.h + .\Debug/FarCry.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + true + true + Windows + $(IntDir)$(TargetName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/FarCry.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Size + true + false + .\;..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + + .\Release/FarCry.pch + .\Release/ + .\Release/ + .\Release/ + true + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + .\Release/FarCry.pdb + Windows + $(IntDir)$(TargetName).lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/FarCry.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + .\;..\CryCommon;%(AdditionalIncludeDirectories) + WIN64;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + false + + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + Windows + true + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/FarCry.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + .\;..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + false + + stdafx.h + $(IntDir)$(ProjectName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + true + $(OutDir)$(ProjectName).pdb + Windows + true + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/FarCry.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + {7d1fd0b0-a81d-4a7d-b399-37f8b9107d3f} + false + + + {07d7d59a-d2a1-4b62-ae29-f818542d231c} + false + + + {7bb11400-afc9-4439-89b3-a00122b44850} + false + + + {aeb958d4-45ca-478b-ba8e-d0e897ce974b} + false + + + {ed25e8e5-3a18-4236-9fe2-06e706380c5c} + false + + + {0fe76ae2-9814-4738-90e7-d45950952a27} + false + + + {a7ec04a5-d65c-4c45-969c-d842823446ed} + false + + + {bdbc2938-d1d4-4773-9466-4e085586b073} + false + + + {119cc33c-e31e-4a39-a38e-4ae64b8a359f} + false + + + {9a4e4bce-d5b3-474a-874c-6578983cfc7c} + false + + + {9f51a48a-ee94-4a94-aaba-c0c18b7b8774} + false + + + {a52ddb05-9d2b-45f8-a85a-d1463e6ce7f0} + false + + + {fd988d8e-914a-4463-a458-4568120e258c} + false + + + {9f9fb6f5-d971-4887-b0ad-5c368ddad90b} + false + + + {6711b2b2-6829-4314-a491-d01a29365658} + false + + + {43b9f5ef-c4fc-44ff-beb0-70efe792b6c0} + false + + + {2f21d2a8-925b-4a73-a32b-d111580614c3} + false + + + + + + \ No newline at end of file diff --git a/FARCRY/FarCry.vcxproj.filters b/FARCRY/FarCry.vcxproj.filters new file mode 100644 index 0000000..b9f18b3 --- /dev/null +++ b/FARCRY/FarCry.vcxproj.filters @@ -0,0 +1,40 @@ + + + + + {a59914b3-3b74-4d5a-aeb8-f6239cdf4df3} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {b44478ac-8a98-4849-90e5-fcc683b28ffc} + h;hpp;hxx;hm;inl + + + {164ee17f-a16b-4864-acde-7c1dfeed1a0c} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + + + Source Files + + + + + Header Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/FARCRY/FarCry.vcxproj.user b/FARCRY/FarCry.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/FARCRY/FarCry.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/FARCRY/FarCry_XBox.vcproj.vspscc b/FARCRY/FarCry_XBox.vcproj.vspscc index 2cbe8c5..ad374ad 100644 --- a/FARCRY/FarCry_XBox.vcproj.vspscc +++ b/FARCRY/FarCry_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/FARCRY/Main.cpp b/FARCRY/Main.cpp index 53e7e74..5a2f636 100644 --- a/FARCRY/Main.cpp +++ b/FARCRY/Main.cpp @@ -11,6 +11,8 @@ // ////////////////////////////////////////////////////////////////////// +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS + #ifdef WIN32 #include #include diff --git a/FARCRY/Release/FarCry.Build.CppClean.log b/FARCRY/Release/FarCry.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/FARCRY/Release/FarCry.log b/FARCRY/Release/FarCry.log new file mode 100644 index 0000000..e69de29 diff --git a/FARCRY/Release/FarCry.tlog/unsuccessfulbuild b/FARCRY/Release/FarCry.tlog/unsuccessfulbuild new file mode 100644 index 0000000..e69de29 diff --git a/FARCRY/Release/FarCry.vcxproj.FileListAbsolute.txt b/FARCRY/Release/FarCry.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/FarCry_WinSV/FarCry_WinSV.vcproj.vspscc b/FarCry_WinSV/FarCry_WinSV.vcproj.vspscc index 72df22d..0d477aa 100644 --- a/FarCry_WinSV/FarCry_WinSV.vcproj.vspscc +++ b/FarCry_WinSV/FarCry_WinSV.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/FarCry_WinSV/FarCry_WinSV.vcxproj b/FarCry_WinSV/FarCry_WinSV.vcxproj new file mode 100644 index 0000000..7a4c460 --- /dev/null +++ b/FarCry_WinSV/FarCry_WinSV.vcxproj @@ -0,0 +1,272 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF} + Perforce Project + + . + MSSCCI:Perforce SCM + Win32Proj + + + + Application + v143 + MultiByte + true + + + Application + v143 + MultiByte + + + Application + v143 + MultiByte + + + Application + v143 + MultiByte + + + Application + v143 + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Disabled + .\;..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + false + true + Use + Level3 + EditAndContinue + + + true + $(OutDir)FarCry_WinSV.pdb + Windows + MachineX86 + + + + + Full + AnySuitable + true + Size + true + false + .\;..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_RELEASE;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + Level3 + ProgramDatabase + + + true + Windows + true + true + MachineX86 + + + + + Full + AnySuitable + true + Size + true + false + .\;..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + Level3 + ProgramDatabase + + + true + Windows + true + true + 0x37000000 + MachineX86 + + + + + Disabled + .\;..\CryCommon;%(AdditionalIncludeDirectories) + WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + Use + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + ProgramDatabase + + + /MACHINE:AMD64 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + $(OutDir)$(ProjectName).pdb + Windows + true + NotSet + + + copy "$(TargetPath)" c:\MasterCD + + + + + Full + AnySuitable + true + .\;..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + Use + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + ProgramDatabase + + + /MACHINE:AMD64 %(AdditionalOptions) + $(OutDir)$(TargetName)$(TargetExt) + true + $(OutDir)$(ProjectName).pdb + Windows + true + NotSet + + + copy "$(TargetPath)" c:\MasterCD + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + \ No newline at end of file diff --git a/FarCry_WinSV/FarCry_WinSV.vcxproj.filters b/FarCry_WinSV/FarCry_WinSV.vcxproj.filters new file mode 100644 index 0000000..a562da1 --- /dev/null +++ b/FarCry_WinSV/FarCry_WinSV.vcxproj.filters @@ -0,0 +1,58 @@ + + + + + {57d5d8c7-67fa-4117-ad73-60a8959ffe9b} + h;hpp;hxx;hm;inl;inc + + + {7251b7d1-ba58-4328-972f-30a6b6b04489} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + {572bc1bb-714f-49bd-8f23-349cc2991f97} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/FarCry_WinSV/FarCry_WinSV.vcxproj.user b/FarCry_WinSV/FarCry_WinSV.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/FarCry_WinSV/FarCry_WinSV.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/FarCry_WinSV/Release/FarCry_WinSV.Build.CppClean.log b/FarCry_WinSV/Release/FarCry_WinSV.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/FarCry_WinSV/Release/FarCry_WinSV.log b/FarCry_WinSV/Release/FarCry_WinSV.log new file mode 100644 index 0000000..e69de29 diff --git a/FarCry_WinSV/Release/FarCry_WinSV.vcxproj.FileListAbsolute.txt b/FarCry_WinSV/Release/FarCry_WinSV.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/FarCry_WinSV/stdafx.h b/FarCry_WinSV/stdafx.h index 562753c..53d142d 100644 --- a/FarCry_WinSV/stdafx.h +++ b/FarCry_WinSV/stdafx.h @@ -8,6 +8,8 @@ #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS + #if !defined(LINUX) #include #else diff --git a/Game01.sln b/Game01.sln index b42e025..0e8f1ee 100644 --- a/Game01.sln +++ b/Game01.sln @@ -1,541 +1,427 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cry3DEngine", "Cry3DEngine\Cry3DEngine.vcproj", "{BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33627.172 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cry3DEngine", "Cry3DEngine\Cry3DEngine.vcxproj", "{7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryAISystem", "CryAISystem\CryAISystem.vcproj", "{07D7D59A-D2A1-4B62-AE29-F818542D231C}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryAISystem", "CryAISystem\CryAISystem.vcxproj", "{07D7D59A-D2A1-4B62-AE29-F818542D231C}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryCommon", "CryCommon\CryCommon.vcproj", "{CC7E772A-D33D-4CDA-9F83-9281A7C48539}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryCommon", "CryCommon\CryCommon.vcxproj", "{AEB958D4-45CA-478B-BA8E-D0E897CE974B}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryEntitySystem", "CryEntitySystem\CryEntitySystem.vcproj", "{ED25E8E5-3A18-4236-9FE2-06E706380C5C}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryEntitySystem", "CryEntitySystem\CryEntitySystem.vcxproj", "{ED25E8E5-3A18-4236-9FE2-06E706380C5C}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryFont", "CryFont\CryFont.vcproj", "{0FE76AE2-9814-4738-90E7-D45950952A27}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryFont", "CryFont\CryFont.vcxproj", "{0FE76AE2-9814-4738-90E7-D45950952A27}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryGame", "CryGame\CryGame.vcproj", "{75A0E1EE-267F-4D2A-A90D-AE3604E7C733}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryGame", "CryGame\CryGame.vcxproj", "{A7EC04A5-D65C-4C45-969C-D842823446ED}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryInput", "CryInput\CryInput.vcproj", "{6B81BC85-356D-4D09-9C01-BC44A9386259}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryInput", "CryInput\CryInput.vcxproj", "{BDBC2938-D1D4-4773-9466-4E085586B073}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryMovie", "CryMovie\CryMovie.vcproj", "{119CC33C-E31E-4A39-A38E-4AE64B8A359F}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryMovie", "CryMovie\CryMovie.vcxproj", "{119CC33C-E31E-4A39-A38E-4AE64B8A359F}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryNetwork", "CryNetwork\CryNetwork.vcproj", "{4A4EE1C2-855E-48DB-815D-8AE882D3332F}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryNetwork", "CryNetwork\CryNetwork.vcxproj", "{9A4E4BCE-D5B3-474A-874C-6578983CFC7C}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryPhysics", "CryPhysics\CryPhysics.vcproj", "{9F51A48A-EE94-4A94-AABA-C0C18B7B8774}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryPhysics", "CryPhysics\CryPhysics.vcxproj", "{9F51A48A-EE94-4A94-AABA-C0C18B7B8774}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryScriptSystem", "CryScriptSystem\CryScriptSystem.vcproj", "{A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryScriptSystem", "CryScriptSystem\CryScriptSystem.vcxproj", "{A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CrySoundSystem", "CrySoundSystem\CrySoundSystem.vcproj", "{FD988D8E-914A-4463-A458-4568120E258C}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CrySoundSystem", "CrySoundSystem\CrySoundSystem.vcxproj", "{FD988D8E-914A-4463-A458-4568120E258C}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XRenderOGL", "RenderDll\XRenderOGL\XRenderOGL.vcproj", "{41DE4587-989B-4341-9F67-2AE5EA201E5B}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XRenderOGL", "RenderDll\XRenderOGL\XRenderOGL.vcxproj", "{4C5F1B66-2962-439A-AECF-D727FDDBCD48}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Editor", "Editor\Editor.vcproj", "{8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Editor", "Editor\Editor.vcxproj", "{8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryAnimation", "CryAnimation\CryAnimation.vcproj", "{7BB11400-AFC9-4439-89B3-A00122B44850}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryAnimation", "CryAnimation\CryAnimation.vcxproj", "{7BB11400-AFC9-4439-89B3-A00122B44850}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FarCry", "FarCry\FarCry.vcproj", "{371D7BDF-BD06-4CF1-A697-CE7CC57C107D}" - ProjectSection(ProjectDependencies) = postProject - {7BB11400-AFC9-4439-89B3-A00122B44850} = {7BB11400-AFC9-4439-89B3-A00122B44850} - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0} = {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0} - {CC7E772A-D33D-4CDA-9F83-9281A7C48539} = {CC7E772A-D33D-4CDA-9F83-9281A7C48539} - {119CC33C-E31E-4A39-A38E-4AE64B8A359F} = {119CC33C-E31E-4A39-A38E-4AE64B8A359F} - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE} = {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE} - {6B81BC85-356D-4D09-9C01-BC44A9386259} = {6B81BC85-356D-4D09-9C01-BC44A9386259} - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774} = {9F51A48A-EE94-4A94-AABA-C0C18B7B8774} - {FD988D8E-914A-4463-A458-4568120E258C} = {FD988D8E-914A-4463-A458-4568120E258C} - {07D7D59A-D2A1-4B62-AE29-F818542D231C} = {07D7D59A-D2A1-4B62-AE29-F818542D231C} - {2F21D2A8-925B-4A73-A32B-D111580614C3} = {2F21D2A8-925B-4A73-A32B-D111580614C3} - {6711B2B2-6829-4314-A491-D01A29365658} = {6711B2B2-6829-4314-A491-D01A29365658} - {4A4EE1C2-855E-48DB-815D-8AE882D3332F} = {4A4EE1C2-855E-48DB-815D-8AE882D3332F} - {0FE76AE2-9814-4738-90E7-D45950952A27} = {0FE76AE2-9814-4738-90E7-D45950952A27} - {ED25E8E5-3A18-4236-9FE2-06E706380C5C} = {ED25E8E5-3A18-4236-9FE2-06E706380C5C} - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733} = {75A0E1EE-267F-4D2A-A90D-AE3604E7C733} - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0} = {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0} - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B} = {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B} - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FarCry", "FARCRY\FarCry.vcxproj", "{371D7BDF-BD06-4CF1-A697-CE7CC57C107D}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CrySystem", "CrySystem\CrySystem.vcproj", "{9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CrySystem", "CrySystem\CrySystem.vcxproj", "{9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XRenderD3D9", "RenderDll\xrenderd3d9\XRenderD3D9.vcproj", "{6711B2B2-6829-4314-A491-D01A29365658}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XRenderD3D9", "RenderDll\xrenderd3d9\XRenderD3D9.vcxproj", "{6711B2B2-6829-4314-A491-D01A29365658}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XRenderNULL", "RenderDll\xrenderNULL\XRenderNULL.vcproj", "{1EE58697-2D3E-454A-BA80-2455F7EA14A0}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XRenderNULL", "RenderDll\xrenderNULL\XRenderNULL.vcxproj", "{1EE58697-2D3E-454A-BA80-2455F7EA14A0}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResourceCompiler", "ResourceCompiler\ResourceCompiler.vcproj", "{2F21D2A8-925B-4A73-A32B-D111580614C3}" - ProjectSection(ProjectDependencies) = postProject - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0} = {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0} - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResourceCompiler", "ResourceCompiler\ResourceCompiler.vcxproj", "{2F21D2A8-925B-4A73-A32B-D111580614C3}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResourceCompilerPC", "ResourceCompilerPC\ResourceCompilerPC.vcproj", "{43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResourceCompilerPC", "ResourceCompilerPC\ResourceCompilerPC.vcxproj", "{43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FarCry_WinSV", "FarCry_WinSV\FarCry_WinSV.vcproj", "{8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FarCry_WinSV", "FarCry_WinSV\FarCry_WinSV.vcxproj", "{8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}" EndProject Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 23 - SccProjectName0 = Perforce\u0020Project - SccLocalPath0 = . - SccProvider0 = MSSCCI:Perforce\u0020SCM - CanCheckoutShared = true - SolutionUniqueID = {A06ECB99-3504-4046-98DD-CF1A6931A3BF} - SccProjectUniqueName1 = RenderDll\\xrenderd3d9\\XRenderD3D9.vcproj - SccLocalPath1 = RenderDll - CanCheckoutShared = true - SccProjectFilePathRelativizedFromConnection1 = xrenderd3d9\\ - SccProjectUniqueName2 = ResourceCompiler\\ResourceCompiler.vcproj - SccLocalPath2 = . - CanCheckoutShared = true - SccProjectFilePathRelativizedFromConnection2 = ResourceCompiler\\ - SccProjectUniqueName3 = ResourceCompilerPC\\ResourceCompilerPC.vcproj - SccLocalPath3 = ResourceCompilerPC - CanCheckoutShared = true - SccProjectUniqueName4 = CryAISystem\\CryAISystem.vcproj - SccLocalPath4 = CryAISystem - CanCheckoutShared = true - SccProjectUniqueName5 = CryCommon\\CryCommon.vcproj - SccLocalPath5 = CryCommon - CanCheckoutShared = true - SccProjectUniqueName6 = CryEntitySystem\\CryEntitySystem.vcproj - SccLocalPath6 = CryEntitySystem - CanCheckoutShared = true - SccProjectUniqueName7 = CryFont\\CryFont.vcproj - SccLocalPath7 = CryFont - CanCheckoutShared = true - SccProjectUniqueName8 = CryGame\\CryGame.vcproj - SccLocalPath8 = CryGame - CanCheckoutShared = true - SccProjectUniqueName9 = CryInput\\CryInput.vcproj - SccLocalPath9 = CryInput - CanCheckoutShared = true - SccProjectUniqueName10 = CryMovie\\CryMovie.vcproj - SccLocalPath10 = CryMovie - CanCheckoutShared = true - SccProjectUniqueName11 = CryNetwork\\CryNetwork.vcproj - SccLocalPath11 = CryNetwork - CanCheckoutShared = true - SccProjectUniqueName12 = CryPhysics\\CryPhysics.vcproj - SccLocalPath12 = CryPhysics - CanCheckoutShared = true - SccProjectUniqueName13 = CryScriptSystem\\CryScriptSystem.vcproj - SccLocalPath13 = CryScriptSystem - CanCheckoutShared = true - SccProjectUniqueName14 = CrySoundSystem\\CrySoundSystem.vcproj - SccLocalPath14 = CrySoundSystem - CanCheckoutShared = true - SccProjectUniqueName15 = RenderDll\\XRenderOGL\\XRenderOGL.vcproj - SccLocalPath15 = RenderDll - CanCheckoutShared = true - SccProjectFilePathRelativizedFromConnection15 = XRenderOGL\\ - SccProjectUniqueName16 = Editor\\Editor.vcproj - SccLocalPath16 = Editor - CanCheckoutShared = true - SccProjectUniqueName17 = CryAnimation\\CryAnimation.vcproj - SccLocalPath17 = CryAnimation - CanCheckoutShared = true - SccProjectUniqueName18 = FarCry\\FarCry.vcproj - SccLocalPath18 = FarCry - CanCheckoutShared = true - SccProjectUniqueName19 = CrySystem\\CrySystem.vcproj - SccLocalPath19 = CrySystem - CanCheckoutShared = true - SccProjectUniqueName20 = RenderDll\\xrenderNULL\\XRenderNULL.vcproj - SccLocalPath20 = RenderDll - CanCheckoutShared = true - SccProjectFilePathRelativizedFromConnection20 = xrenderNULL\\ - SccProjectUniqueName21 = FarCry_WinSV\\FarCry_WinSV.vcproj - SccLocalPath21 = FarCry_WinSV - CanCheckoutShared = true - SccProjectUniqueName22 = Cry3DEngine\\Cry3DEngine.vcproj - SccLocalPath22 = Cry3DEngine - CanCheckoutShared = true + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Debug64|x86 = Debug64|x86 + Hybrid Debug|x86 = Hybrid Debug|x86 + Hybrid NDebug|x86 = Hybrid NDebug|x86 + Hybrid|x86 = Hybrid|x86 + Hybrid64|x86 = Hybrid64|x86 + Profile|x86 = Profile|x86 + Release|x86 = Release|x86 + Release64|x86 = Release64|x86 EndGlobalSection - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Debug64 = Debug64 - Hybrid = Hybrid - Hybrid Debug = Hybrid Debug - Hybrid NDebug = Hybrid NDebug - Hybrid64 = Hybrid64 - Profile = Profile - Release = Release - Release64 = Release64 + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Debug|x86.ActiveCfg = Debug|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Debug|x86.Build.0 = Debug|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Debug64|x86.ActiveCfg = Debug64|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Debug64|x86.Build.0 = Debug64|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Hybrid Debug|x86.Build.0 = Debug|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Hybrid NDebug|x86.Build.0 = Debug|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Hybrid|x86.ActiveCfg = Debug|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Hybrid|x86.Build.0 = Debug|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Hybrid64|x86.ActiveCfg = Debug|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Hybrid64|x86.Build.0 = Debug|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Profile|x86.ActiveCfg = Profile|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Profile|x86.Build.0 = Profile|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Release|x86.ActiveCfg = Release|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Release|x86.Build.0 = Release|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Release64|x86.ActiveCfg = Release64|Win32 + {7D1FD0B0-A81D-4A7D-B399-37F8B9107D3F}.Release64|x86.Build.0 = Release64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug|x86.ActiveCfg = Debug|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug|x86.Build.0 = Debug|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug64|x86.ActiveCfg = Debug64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug64|x86.Build.0 = Debug64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid|x86.ActiveCfg = Profile|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Profile|x86.ActiveCfg = Profile|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Profile|x86.Build.0 = Profile|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release|x86.ActiveCfg = Release|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release|x86.Build.0 = Release|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release64|x86.ActiveCfg = Release64|Win32 + {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release64|x86.Build.0 = Release64|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Debug|x86.ActiveCfg = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Debug|x86.Build.0 = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Debug64|x86.ActiveCfg = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Debug64|x86.Build.0 = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Hybrid Debug|x86.Build.0 = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Hybrid NDebug|x86.Build.0 = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Hybrid|x86.ActiveCfg = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Hybrid|x86.Build.0 = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Hybrid64|x86.ActiveCfg = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Hybrid64|x86.Build.0 = Debug|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Profile|x86.ActiveCfg = Profile|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Profile|x86.Build.0 = Profile|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Release|x86.ActiveCfg = Release|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Release|x86.Build.0 = Release|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Release64|x86.ActiveCfg = Release|Win32 + {AEB958D4-45CA-478B-BA8E-D0E897CE974B}.Release64|x86.Build.0 = Release|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug|x86.ActiveCfg = Debug|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug|x86.Build.0 = Debug|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug64|x86.ActiveCfg = Debug64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug64|x86.Build.0 = Debug64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid|x86.ActiveCfg = Profile|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Profile|x86.ActiveCfg = Profile|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Profile|x86.Build.0 = Profile|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release|x86.ActiveCfg = Release|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release|x86.Build.0 = Release|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release64|x86.ActiveCfg = Release64|Win32 + {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release64|x86.Build.0 = Release64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug|x86.ActiveCfg = Debug|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug|x86.Build.0 = Debug|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug64|x86.ActiveCfg = Debug64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug64|x86.Build.0 = Debug64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid|x86.ActiveCfg = Profile|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Profile|x86.ActiveCfg = Profile|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Profile|x86.Build.0 = Profile|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Release|x86.ActiveCfg = Release|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Release|x86.Build.0 = Release|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Release64|x86.ActiveCfg = Release64|Win32 + {0FE76AE2-9814-4738-90E7-D45950952A27}.Release64|x86.Build.0 = Release64|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Debug|x86.ActiveCfg = Debug|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Debug|x86.Build.0 = Debug|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Debug64|x86.ActiveCfg = Debug64|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Debug64|x86.Build.0 = Debug64|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Hybrid Debug|x86.Build.0 = Debug|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Hybrid NDebug|x86.Build.0 = Debug|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Hybrid|x86.ActiveCfg = Debug|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Hybrid|x86.Build.0 = Debug|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Hybrid64|x86.ActiveCfg = Debug|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Hybrid64|x86.Build.0 = Debug|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Profile|x86.ActiveCfg = Profile|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Profile|x86.Build.0 = Profile|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Release|x86.ActiveCfg = Release|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Release|x86.Build.0 = Release|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Release64|x86.ActiveCfg = Release64|Win32 + {A7EC04A5-D65C-4C45-969C-D842823446ED}.Release64|x86.Build.0 = Release64|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Debug|x86.ActiveCfg = Debug|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Debug|x86.Build.0 = Debug|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Debug64|x86.ActiveCfg = Debug64|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Debug64|x86.Build.0 = Debug64|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Hybrid Debug|x86.Build.0 = Debug|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Hybrid NDebug|x86.Build.0 = Debug|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Hybrid|x86.ActiveCfg = Debug|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Hybrid|x86.Build.0 = Debug|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Hybrid64|x86.ActiveCfg = Debug|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Hybrid64|x86.Build.0 = Debug|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Profile|x86.ActiveCfg = Profile|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Profile|x86.Build.0 = Profile|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Release|x86.ActiveCfg = Release|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Release|x86.Build.0 = Release|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Release64|x86.ActiveCfg = Release64|Win32 + {BDBC2938-D1D4-4773-9466-4E085586B073}.Release64|x86.Build.0 = Release64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug|x86.ActiveCfg = Debug|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug|x86.Build.0 = Debug|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug64|x86.ActiveCfg = Debug64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug64|x86.Build.0 = Debug64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid|x86.ActiveCfg = Profile|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Profile|x86.ActiveCfg = Profile|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Profile|x86.Build.0 = Profile|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release|x86.ActiveCfg = Release|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release|x86.Build.0 = Release|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release64|x86.ActiveCfg = Release64|Win32 + {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release64|x86.Build.0 = Release64|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Debug|x86.ActiveCfg = Debug|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Debug|x86.Build.0 = Debug|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Debug64|x86.ActiveCfg = Debug64|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Debug64|x86.Build.0 = Debug64|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Hybrid Debug|x86.Build.0 = Debug|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Hybrid NDebug|x86.Build.0 = Debug|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Hybrid|x86.ActiveCfg = Debug|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Hybrid|x86.Build.0 = Debug|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Hybrid64|x86.ActiveCfg = Debug|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Hybrid64|x86.Build.0 = Debug|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Profile|x86.ActiveCfg = Profile|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Profile|x86.Build.0 = Profile|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Release|x86.ActiveCfg = Release|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Release|x86.Build.0 = Release|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Release64|x86.ActiveCfg = Release64|Win32 + {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Release64|x86.Build.0 = Release64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug|x86.ActiveCfg = Debug|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug|x86.Build.0 = Debug|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug64|x86.ActiveCfg = Debug64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug64|x86.Build.0 = Debug64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid|x86.ActiveCfg = Profile|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Profile|x86.ActiveCfg = Profile|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Profile|x86.Build.0 = Profile|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release|x86.ActiveCfg = Release|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release|x86.Build.0 = Release|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release64|x86.ActiveCfg = Release64|Win32 + {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release64|x86.Build.0 = Release64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug|x86.ActiveCfg = Debug|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug|x86.Build.0 = Debug|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug64|x86.ActiveCfg = Debug64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug64|x86.Build.0 = Debug64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid|x86.ActiveCfg = Profile|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Profile|x86.ActiveCfg = Profile|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Profile|x86.Build.0 = Profile|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release|x86.ActiveCfg = Release|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release|x86.Build.0 = Release|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release64|x86.ActiveCfg = Release64|Win32 + {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release64|x86.Build.0 = Release64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Debug|x86.ActiveCfg = Debug|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Debug|x86.Build.0 = Debug|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Debug64|x86.ActiveCfg = Debug64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Debug64|x86.Build.0 = Debug64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid|x86.ActiveCfg = Profile|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid64|x86.ActiveCfg = Release64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid64|x86.Build.0 = Release64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Profile|x86.ActiveCfg = Profile|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Profile|x86.Build.0 = Profile|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Release|x86.ActiveCfg = Release|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Release|x86.Build.0 = Release|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Release64|x86.ActiveCfg = Release64|Win32 + {FD988D8E-914A-4463-A458-4568120E258C}.Release64|x86.Build.0 = Release64|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Debug|x86.ActiveCfg = Debug|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Debug|x86.Build.0 = Debug|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Debug64|x86.ActiveCfg = Debug64|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Debug64|x86.Build.0 = Debug64|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Hybrid Debug|x86.Build.0 = Debug|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Hybrid NDebug|x86.Build.0 = Debug|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Hybrid|x86.ActiveCfg = Debug|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Hybrid|x86.Build.0 = Debug|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Hybrid64|x86.ActiveCfg = Debug|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Hybrid64|x86.Build.0 = Debug|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Profile|x86.ActiveCfg = Profile|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Profile|x86.Build.0 = Profile|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Release|x86.ActiveCfg = Release|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Release|x86.Build.0 = Release|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Release64|x86.ActiveCfg = Release64|Win32 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48}.Release64|x86.Build.0 = Release64|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Debug|x86.ActiveCfg = Debug|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Debug|x86.Build.0 = Debug|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Debug64|x86.ActiveCfg = Debug64|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid|x86.ActiveCfg = Release|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid64|x86.ActiveCfg = Debug64|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid64|x86.Build.0 = Debug64|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Profile|x86.ActiveCfg = Profile|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Profile|x86.Build.0 = Profile|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release|x86.ActiveCfg = Release|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release|x86.Build.0 = Release|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release64|x86.ActiveCfg = Release64|Win32 + {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release64|x86.Build.0 = Release64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug|x86.ActiveCfg = Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug|x86.Build.0 = Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug64|x86.ActiveCfg = Debug64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug64|x86.Build.0 = Debug64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid Debug|x86.ActiveCfg = Hybrid Debug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid NDebug|x86.ActiveCfg = Hybrid NDebug|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid|x86.ActiveCfg = Profile|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile|x86.ActiveCfg = Profile|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile|x86.Build.0 = Profile|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Release|x86.ActiveCfg = Release|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Release|x86.Build.0 = Release|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Release64|x86.ActiveCfg = Release64|Win32 + {7BB11400-AFC9-4439-89B3-A00122B44850}.Release64|x86.Build.0 = Release64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug|x86.ActiveCfg = Debug|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug|x86.Build.0 = Debug|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug64|x86.ActiveCfg = Debug64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug64|x86.Build.0 = Debug64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid|x86.ActiveCfg = Release|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile|x86.ActiveCfg = Profile|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile|x86.Build.0 = Profile|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release|x86.ActiveCfg = Release|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release|x86.Build.0 = Release|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release64|x86.ActiveCfg = Release64|Win32 + {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release64|x86.Build.0 = Release64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug|x86.ActiveCfg = Debug|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug|x86.Build.0 = Debug|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug64|x86.ActiveCfg = Debug64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug64|x86.Build.0 = Debug64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid|x86.ActiveCfg = Profile|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile|x86.ActiveCfg = Profile|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile|x86.Build.0 = Profile|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release|x86.ActiveCfg = Release|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release|x86.Build.0 = Release|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release64|x86.ActiveCfg = Release64|Win32 + {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release64|x86.Build.0 = Release64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Debug|x86.ActiveCfg = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Debug|x86.Build.0 = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Debug64|x86.ActiveCfg = Debug64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid|x86.ActiveCfg = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid|x86.Build.0 = Debug|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Profile|x86.ActiveCfg = Profile|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Profile|x86.Build.0 = Profile|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Release|x86.ActiveCfg = Release|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Release|x86.Build.0 = Release|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Release64|x86.ActiveCfg = Release64|Win32 + {6711B2B2-6829-4314-A491-D01A29365658}.Release64|x86.Build.0 = Release64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Debug|x86.ActiveCfg = Debug|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Debug|x86.Build.0 = Debug|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Debug64|x86.ActiveCfg = Debug64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid|x86.ActiveCfg = Release|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid|x86.Build.0 = Release|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Profile|x86.ActiveCfg = Profile|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Profile|x86.Build.0 = Profile|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release|x86.ActiveCfg = Release|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release|x86.Build.0 = Release|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release64|x86.ActiveCfg = Release64|Win32 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release64|x86.Build.0 = Release64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug|x86.ActiveCfg = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug|x86.Build.0 = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug64|x86.ActiveCfg = Debug64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug64|x86.Build.0 = Debug64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid Debug|x86.Build.0 = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid NDebug|x86.Build.0 = Debug|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid|x86.ActiveCfg = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid|x86.Build.0 = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid64|x86.ActiveCfg = Release64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid64|x86.Build.0 = Release64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Profile|x86.ActiveCfg = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Profile|x86.Build.0 = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release|x86.ActiveCfg = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release|x86.Build.0 = Release|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release64|x86.ActiveCfg = Release64|Win32 + {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release64|x86.Build.0 = Release64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug|x86.ActiveCfg = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug|x86.Build.0 = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug64|x86.ActiveCfg = Debug64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug64|x86.Build.0 = Debug64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid Debug|x86.ActiveCfg = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid Debug|x86.Build.0 = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid NDebug|x86.ActiveCfg = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid NDebug|x86.Build.0 = Debug|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid|x86.ActiveCfg = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid|x86.Build.0 = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid64|x86.ActiveCfg = Release64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid64|x86.Build.0 = Release64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Profile|x86.ActiveCfg = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Profile|x86.Build.0 = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release|x86.ActiveCfg = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release|x86.Build.0 = Release|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release64|x86.ActiveCfg = Release64|Win32 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release64|x86.Build.0 = Release64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug|x86.ActiveCfg = Debug|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug|x86.Build.0 = Debug|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug64|x86.ActiveCfg = Debug64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug64|x86.Build.0 = Debug64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid Debug|x86.ActiveCfg = Hybrid64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid Debug|x86.Build.0 = Hybrid64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid NDebug|x86.ActiveCfg = Hybrid64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid NDebug|x86.Build.0 = Hybrid64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid|x86.ActiveCfg = Hybrid64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid|x86.Build.0 = Hybrid64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid64|x86.ActiveCfg = Hybrid64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid64|x86.Build.0 = Hybrid64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Profile|x86.ActiveCfg = Profile|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Profile|x86.Build.0 = Profile|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release|x86.ActiveCfg = Release|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release|x86.Build.0 = Release|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release64|x86.ActiveCfg = Release64|Win32 + {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release64|x86.Build.0 = Release64|Win32 EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Debug.ActiveCfg = Debug|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Debug.Build.0 = Debug|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Debug64.ActiveCfg = Debug64|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Debug64.Build.0 = Debug64|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid.ActiveCfg = Profile|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid Debug.ActiveCfg = Debug|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Hybrid64.Build.0 = Hybrid64|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Profile.ActiveCfg = Profile|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Profile.Build.0 = Profile|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Release.ActiveCfg = Release|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Release.Build.0 = Release|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Release64.ActiveCfg = Release64|Win32 - {BCE47A67-3614-49D1-BCE7-4FD4DFD453FE}.Release64.Build.0 = Release64|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug.ActiveCfg = Debug|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug.Build.0 = Debug|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug64.ActiveCfg = Debug64|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Debug64.Build.0 = Debug64|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid.ActiveCfg = Profile|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid Debug.ActiveCfg = Debug|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Hybrid64.Build.0 = Hybrid64|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Profile.ActiveCfg = Profile|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Profile.Build.0 = Profile|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release.ActiveCfg = Release|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release.Build.0 = Release|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release64.ActiveCfg = Release64|Win32 - {07D7D59A-D2A1-4B62-AE29-F818542D231C}.Release64.Build.0 = Release64|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug.ActiveCfg = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug.Build.0 = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug64.ActiveCfg = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid.ActiveCfg = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid Debug.ActiveCfg = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid64.ActiveCfg = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid64.Build.0 = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Profile.ActiveCfg = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Profile.Build.0 = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release.ActiveCfg = Release|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release.Build.0 = Release|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release64.ActiveCfg = Release|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug.ActiveCfg = Debug|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug.Build.0 = Debug|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug64.ActiveCfg = Debug64|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Debug64.Build.0 = Debug64|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid.ActiveCfg = Profile|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid Debug.ActiveCfg = Debug|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Hybrid64.Build.0 = Hybrid64|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Profile.ActiveCfg = Profile|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Profile.Build.0 = Profile|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release.ActiveCfg = Release|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release.Build.0 = Release|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release64.ActiveCfg = Release64|Win32 - {ED25E8E5-3A18-4236-9FE2-06E706380C5C}.Release64.Build.0 = Release64|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug.ActiveCfg = Debug|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug.Build.0 = Debug|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug64.ActiveCfg = Debug64|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Debug64.Build.0 = Debug64|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid.ActiveCfg = Profile|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid Debug.ActiveCfg = Debug|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Hybrid64.Build.0 = Hybrid64|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Profile.ActiveCfg = Profile|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Profile.Build.0 = Profile|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Release.ActiveCfg = Release|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Release.Build.0 = Release|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Release64.ActiveCfg = Release64|Win32 - {0FE76AE2-9814-4738-90E7-D45950952A27}.Release64.Build.0 = Release64|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Debug.ActiveCfg = Debug|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Debug.Build.0 = Debug|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Debug64.ActiveCfg = Debug64|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Debug64.Build.0 = Debug64|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Hybrid.ActiveCfg = Profile|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Hybrid Debug.ActiveCfg = Debug|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Hybrid64.ActiveCfg = Release64|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Hybrid64.Build.0 = Release64|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Profile.ActiveCfg = Profile|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Profile.Build.0 = Profile|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Release.ActiveCfg = Release|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Release.Build.0 = Release|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Release64.ActiveCfg = Release64|Win32 - {75A0E1EE-267F-4D2A-A90D-AE3604E7C733}.Release64.Build.0 = Release64|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Debug.ActiveCfg = Debug|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Debug.Build.0 = Debug|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Debug64.ActiveCfg = Debug64|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Debug64.Build.0 = Debug64|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid.ActiveCfg = Profile|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid Debug.ActiveCfg = Debug|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Hybrid64.Build.0 = Hybrid64|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Profile.ActiveCfg = Profile|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Profile.Build.0 = Profile|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Release.ActiveCfg = Release|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Release.Build.0 = Release|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Release64.ActiveCfg = Release64|Win32 - {6B81BC85-356D-4D09-9C01-BC44A9386259}.Release64.Build.0 = Release64|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug.ActiveCfg = Debug|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug.Build.0 = Debug|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug64.ActiveCfg = Debug64|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Debug64.Build.0 = Debug64|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid.ActiveCfg = Profile|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid Debug.ActiveCfg = Debug|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Hybrid64.Build.0 = Hybrid64|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Profile.ActiveCfg = Profile|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Profile.Build.0 = Profile|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release.ActiveCfg = Release|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release.Build.0 = Release|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release64.ActiveCfg = Release64|Win32 - {119CC33C-E31E-4A39-A38E-4AE64B8A359F}.Release64.Build.0 = Release64|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Debug.ActiveCfg = Debug|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Debug.Build.0 = Debug|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Debug64.ActiveCfg = Debug64|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Debug64.Build.0 = Debug64|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid.ActiveCfg = Profile|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid Debug.ActiveCfg = Debug|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Hybrid64.Build.0 = Hybrid64|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Profile.ActiveCfg = Profile|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Profile.Build.0 = Profile|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Release.ActiveCfg = Release|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Release.Build.0 = Release|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Release64.ActiveCfg = Release64|Win32 - {4A4EE1C2-855E-48DB-815D-8AE882D3332F}.Release64.Build.0 = Release64|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug.ActiveCfg = Debug|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug.Build.0 = Debug|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug64.ActiveCfg = Debug64|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Debug64.Build.0 = Debug64|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid.ActiveCfg = Profile|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid Debug.ActiveCfg = Debug|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Hybrid64.Build.0 = Hybrid64|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Profile.ActiveCfg = Profile|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Profile.Build.0 = Profile|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release.ActiveCfg = Release|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release.Build.0 = Release|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release64.ActiveCfg = Release64|Win32 - {9F51A48A-EE94-4A94-AABA-C0C18B7B8774}.Release64.Build.0 = Release64|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug.ActiveCfg = Debug|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug.Build.0 = Debug|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug64.ActiveCfg = Debug64|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Debug64.Build.0 = Debug64|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid.ActiveCfg = Profile|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid Debug.ActiveCfg = Debug|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Hybrid64.Build.0 = Hybrid64|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Profile.ActiveCfg = Profile|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Profile.Build.0 = Profile|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release.ActiveCfg = Release|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release.Build.0 = Release|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release64.ActiveCfg = Release64|Win32 - {A52DDB05-9D2B-45F8-A85A-D1463E6CE7F0}.Release64.Build.0 = Release64|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Debug.ActiveCfg = Debug|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Debug.Build.0 = Debug|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Debug64.ActiveCfg = Debug64|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Debug64.Build.0 = Debug64|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid.ActiveCfg = Profile|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid Debug.ActiveCfg = Debug|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid64.ActiveCfg = Release64|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Hybrid64.Build.0 = Release64|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Profile.ActiveCfg = Profile|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Profile.Build.0 = Profile|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Release.ActiveCfg = Release|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Release.Build.0 = Release|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Release64.ActiveCfg = Release64|Win32 - {FD988D8E-914A-4463-A458-4568120E258C}.Release64.Build.0 = Release64|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Debug.ActiveCfg = Debug|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Debug.Build.0 = Debug|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Debug64.ActiveCfg = Debug64|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Debug64.Build.0 = Debug64|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid.ActiveCfg = Profile|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid Debug.ActiveCfg = Debug|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Hybrid64.Build.0 = Hybrid64|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Profile.ActiveCfg = Profile|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Profile.Build.0 = Profile|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Release.ActiveCfg = Release|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Release64.ActiveCfg = Release64|Win32 - {41DE4587-989B-4341-9F67-2AE5EA201E5B}.Release64.Build.0 = Release64|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Debug.ActiveCfg = Debug|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Debug.Build.0 = Debug|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Debug64.ActiveCfg = Debug64|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid.ActiveCfg = Release|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid Debug.ActiveCfg = Debug|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid64.ActiveCfg = Debug64|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Hybrid64.Build.0 = Debug64|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Profile.ActiveCfg = Profile|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Profile.Build.0 = Profile|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release.ActiveCfg = Release|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release.Build.0 = Release|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release64.ActiveCfg = Release64|Win32 - {8E62D4F9-2AD9-45E3-B911-3D0BE2C60189}.Release64.Build.0 = Release64|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug.ActiveCfg = Debug|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug.Build.0 = Debug|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug64.ActiveCfg = Debug64|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug64.Build.0 = Debug64|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid.ActiveCfg = Profile|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid Debug.ActiveCfg = Hybrid Debug|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid NDebug.ActiveCfg = Hybrid NDebug|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid64.Build.0 = Hybrid64|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile.ActiveCfg = Profile|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile.Build.0 = Profile|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Release.ActiveCfg = Release|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Release.Build.0 = Release|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Release64.ActiveCfg = Release64|Win32 - {7BB11400-AFC9-4439-89B3-A00122B44850}.Release64.Build.0 = Release64|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug.ActiveCfg = Debug|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug.Build.0 = Debug|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug64.ActiveCfg = Debug64|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug64.Build.0 = Debug64|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid.ActiveCfg = Release|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid Debug.ActiveCfg = Debug|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid64.Build.0 = Hybrid64|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile.ActiveCfg = Profile|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile.Build.0 = Profile|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release.ActiveCfg = Release|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release.Build.0 = Release|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release64.ActiveCfg = Release64|Win32 - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release64.Build.0 = Release64|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug.ActiveCfg = Debug|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug.Build.0 = Debug|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug64.ActiveCfg = Debug64|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug64.Build.0 = Debug64|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid.ActiveCfg = Profile|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid Debug.ActiveCfg = Debug|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid64.Build.0 = Hybrid64|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile.ActiveCfg = Profile|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile.Build.0 = Profile|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release.ActiveCfg = Release|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release.Build.0 = Release|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release64.ActiveCfg = Release64|Win32 - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release64.Build.0 = Release64|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Debug.ActiveCfg = Debug|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Debug.Build.0 = Debug|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Debug64.ActiveCfg = Debug64|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid.ActiveCfg = Debug|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid.Build.0 = Debug|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid Debug.ActiveCfg = Debug|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Hybrid64.Build.0 = Hybrid64|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Profile.ActiveCfg = Profile|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Profile.Build.0 = Profile|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Release.ActiveCfg = Release|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Release.Build.0 = Release|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Release64.ActiveCfg = Release64|Win32 - {6711B2B2-6829-4314-A491-D01A29365658}.Release64.Build.0 = Release64|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Debug.ActiveCfg = Debug|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Debug.Build.0 = Debug|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Debug64.ActiveCfg = Debug64|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid.ActiveCfg = Release|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid.Build.0 = Release|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid Debug.ActiveCfg = Debug|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Hybrid64.Build.0 = Hybrid64|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Profile.ActiveCfg = Profile|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Profile.Build.0 = Profile|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release.ActiveCfg = Release|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release.Build.0 = Release|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release64.ActiveCfg = Release64|Win32 - {1EE58697-2D3E-454A-BA80-2455F7EA14A0}.Release64.Build.0 = Release64|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug.ActiveCfg = Debug|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug.Build.0 = Debug|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug64.ActiveCfg = Debug64|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Debug64.Build.0 = Debug64|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid.ActiveCfg = Release|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid.Build.0 = Release|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid Debug.ActiveCfg = Debug|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid Debug.Build.0 = Debug|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid NDebug.Build.0 = Debug|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid64.ActiveCfg = Release64|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Hybrid64.Build.0 = Release64|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Profile.ActiveCfg = Release|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Profile.Build.0 = Release|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release.ActiveCfg = Release|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release.Build.0 = Release|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release64.ActiveCfg = Release64|Win32 - {2F21D2A8-925B-4A73-A32B-D111580614C3}.Release64.Build.0 = Release64|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug.ActiveCfg = Debug|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug.Build.0 = Debug|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug64.ActiveCfg = Debug64|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Debug64.Build.0 = Debug64|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid.ActiveCfg = Release|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid.Build.0 = Release|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid Debug.ActiveCfg = Debug|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid Debug.Build.0 = Debug|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid NDebug.ActiveCfg = Debug|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid NDebug.Build.0 = Debug|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid64.ActiveCfg = Release64|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Hybrid64.Build.0 = Release64|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Profile.ActiveCfg = Release|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Profile.Build.0 = Release|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release.ActiveCfg = Release|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release.Build.0 = Release|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release64.ActiveCfg = Release64|Win32 - {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0}.Release64.Build.0 = Release64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug.ActiveCfg = Debug|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug.Build.0 = Debug|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug64.ActiveCfg = Debug64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Debug64.Build.0 = Debug64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid.ActiveCfg = Hybrid64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid.Build.0 = Hybrid64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid Debug.ActiveCfg = Hybrid64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid Debug.Build.0 = Hybrid64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid NDebug.ActiveCfg = Hybrid64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid NDebug.Build.0 = Hybrid64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid64.ActiveCfg = Hybrid64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Hybrid64.Build.0 = Hybrid64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Profile.ActiveCfg = Profile|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Profile.Build.0 = Profile|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release.ActiveCfg = Release|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release.Build.0 = Release|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release64.ActiveCfg = Release64|Win32 - {8FC8C385-9DDB-4D31-8B6D-7D4246A6EFAF}.Release64.Build.0 = Release64|Win32 + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution DPBuild = 5 - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution + SolutionGuid = {5325466A-9C10-4B07-92FF-E9744D384E84} EndGlobalSection GlobalSection(DevPartner Solution Properties) = postSolution EndGlobalSection diff --git a/Game01.vssscc b/Game01.vssscc deleted file mode 100644 index 6cb031b..0000000 --- a/Game01.vssscc +++ /dev/null @@ -1,10 +0,0 @@ -"" -{ -"FILE_VERSION" = "9237" -"ENLISTMENT_CHOICE" = "NEVER" -"PROJECT_FILE_RELATIVE_PATH" = "" -"NUMBER_OF_EXCLUDED_FILES" = "0" -"ORIGINAL_PROJECT_FILE_PATH" = "" -"NUMBER_OF_NESTED_PROJECTS" = "0" -"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT" -} diff --git a/Game01_XBox.sln b/Game01_XBox.sln deleted file mode 100644 index 9d26af0..0000000 --- a/Game01_XBox.sln +++ /dev/null @@ -1,495 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryCommon", "CryCommon\CryCommon.vcproj", "{CC7E772A-D33D-4CDA-9F83-9281A7C48539}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cry3DEngine_XBox", "Cry3DEngine\Cry3DEngine_XBox.vcproj", "{31FAE924-14B7-45E3-ABEC-DDF33A6C738E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryAISystem_XBox", "CryAISystem\CryAISystem_XBox.vcproj", "{10D1BB45-464E-4B73-8623-B8F1B1543E04}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryAnimation_XBox", "CryAnimation\CryAnimation_XBox.vcproj", "{7BB11400-AFC9-4439-89B3-A00122B44850}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryEntitySystem_XBox", "CryEntitySystem\CryEntitySystem_XBox.vcproj", "{9A635D0D-011B-46AB-B582-CEAC8977775D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryFont_XBox", "CryFont\CryFont_XBox.vcproj", "{B75C56F5-1D23-4F46-B981-E685CC442DBB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryGame_XBox", "CryGame\CryGame_XBox.vcproj", "{A7EC04A5-D65C-4C45-969C-D842823446ED}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryMovie_XBox", "CryMovie\CryMovie_XBox.vcproj", "{DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryNetwork_XBox", "CryNetwork\CryNetwork_XBox.vcproj", "{9A4E4BCE-D5B3-474A-874C-6578983CFC7C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryPhysics_XBox", "CryPhysics\CryPhysics_XBox.vcproj", "{8E23CD25-D0DD-4655-A25E-26DFF7E849D0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryScriptSystem_XBox", "CryScriptSystem\CryScriptSystem_XBox.vcproj", "{80E81C96-6482-40F5-9C8B-DDE831B136CE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CrySoundSystem_XBox", "CrySoundSystem\CrySoundSystem_XBox.vcproj", "{548DB7CA-1D77-4831-9314-31B0F1FB167B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CrySystem_XBox", "CrySystem\CrySystem_XBox.vcproj", "{9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FarCry_XBox", "FARCRY\FarCry_XBox.vcproj", "{371D7BDF-BD06-4CF1-A697-CE7CC57C107D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XRenderD3D8_XBox", "RenderDll\xrenderd3d8\XRenderD3D8_XBox.vcproj", "{E9EC2400-2FAB-460B-8CE4-4F0521D23866}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryInput_XBox", "CryInput\CryInput_XBox.vcproj", "{E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}" -EndProject -Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 17 - SccProjectName0 = \u0022$/Game01\u0022,\u0020GBOAAAAA - SccLocalPath0 = . - SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe - CanCheckoutShared = false - SolutionUniqueID = {A06ECB99-3504-4046-98DD-CF1A6931A3BF} - SccProjectUniqueName1 = CryCommon\\CryCommon.vcproj - SccProjectName1 = \u0022$/Game01/CryCommon\u0022,\u0020VWOAAAAA - SccLocalPath1 = CryCommon - CanCheckoutShared = false - SccProjectUniqueName2 = Cry3DEngine\\Cry3DEngine_XBox.vcproj - SccProjectName2 = \u0022$/Game01/Cry3DEngine\u0022,\u0020HXRAAAAA - SccLocalPath2 = Cry3DEngine - CanCheckoutShared = false - SccProjectUniqueName3 = CryAISystem\\CryAISystem_XBox.vcproj - SccProjectName3 = \u0022$/Game01/CryAISystem\u0022,\u0020IBSAAAAA - SccLocalPath3 = CryAISystem - CanCheckoutShared = false - SccProjectUniqueName4 = CryAnimation\\CryAnimation_XBox.vcproj - SccProjectName4 = \u0022$/Game01/CryAnimation\u0022,\u0020WNFBAAAA - SccLocalPath4 = CryAnimation - CanCheckoutShared = false - SccProjectUniqueName5 = CryEntitySystem\\CryEntitySystem_XBox.vcproj - SccProjectName5 = \u0022$/Game01/CryEntitySystem\u0022,\u0020HFRAAAAA - SccLocalPath5 = CryEntitySystem - CanCheckoutShared = false - SccProjectUniqueName6 = CryFont\\CryFont_XBox.vcproj - SccProjectName6 = \u0022$/Game01/CryFont\u0022,\u0020PBOAAAAA - SccLocalPath6 = CryFont - CanCheckoutShared = false - SccProjectUniqueName7 = CryGame\\CryGame_XBox.vcproj - SccProjectName7 = \u0022$/Game01/CryGame\u0022,\u0020FESAAAAA - SccLocalPath7 = CryGame - CanCheckoutShared = false - SccProjectUniqueName8 = CryMovie\\CryMovie_XBox.vcproj - SccProjectName8 = \u0022$/Game01/CryMovie\u0022,\u0020YREBAAAA - SccLocalPath8 = CryMovie - CanCheckoutShared = false - SccProjectUniqueName9 = CryNetwork\\CryNetwork_XBox.vcproj - SccProjectName9 = \u0022$/Game01/CryNetwork\u0022,\u0020OBOAAAAA - SccLocalPath9 = CryNetwork - CanCheckoutShared = false - SccProjectUniqueName10 = CryPhysics\\CryPhysics_XBox.vcproj - SccProjectName10 = \u0022$/Game01/CryPhysics\u0022,\u0020NEPAAAAA - SccLocalPath10 = CryPhysics - CanCheckoutShared = false - SccProjectUniqueName11 = CryScriptSystem\\CryScriptSystem_XBox.vcproj - SccProjectName11 = \u0022$/Game01/CryScriptSystem\u0022,\u0020MNQAAAAA - SccLocalPath11 = CryScriptSystem - CanCheckoutShared = false - SccProjectUniqueName12 = CrySoundSystem\\CrySoundSystem_XBox.vcproj - SccProjectName12 = \u0022$/Game01/CrySoundSystem\u0022,\u0020VQEBAAAA - SccLocalPath12 = CrySoundSystem - CanCheckoutShared = false - SccProjectUniqueName13 = CrySystem\\CrySystem_XBox.vcproj - SccProjectName13 = \u0022$/Game01/CrySystem\u0022,\u0020JPKBAAAA - SccLocalPath13 = CrySystem - CanCheckoutShared = false - SccProjectUniqueName14 = FARCRY\\FarCry_XBox.vcproj - SccProjectName14 = \u0022$/Game01/FarCry\u0022,\u0020JYQAAAAA - SccLocalPath14 = FARCRY - CanCheckoutShared = false - SccProjectUniqueName15 = RenderDll\\xrenderd3d8\\XRenderD3D8_XBox.vcproj - SccProjectName15 = \u0022$/Game01/RenderDll/XRenderD3D8\u0022,\u0020IFDBAAAA - SccLocalPath15 = RenderDll\\xrenderd3d8 - CanCheckoutShared = false - SccProjectUniqueName16 = CryInput\\CryInput_XBox.vcproj - SccLocalPath16 = . - CanCheckoutShared = false - SccProjectFilePathRelativizedFromConnection16 = CryInput\\ - EndGlobalSection - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Debug Win32 - ConfigName.2 = Debug Xbox - ConfigName.3 = Hybrid - ConfigName.4 = Profile - ConfigName.5 = Profile Win32 - ConfigName.6 = Profile Xbox - ConfigName.7 = Release - ConfigName.8 = Release Win32 - ConfigName.9 = Release Xbox - ConfigName.10 = XBOX Debug - ConfigName.11 = XBOX Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.0 = {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.1 = {E9EC2400-2FAB-460B-8CE4-4F0521D23866} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.2 = {CC7E772A-D33D-4CDA-9F83-9281A7C48539} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.3 = {80E81C96-6482-40F5-9C8B-DDE831B136CE} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.4 = {548DB7CA-1D77-4831-9314-31B0F1FB167B} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.5 = {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.6 = {10D1BB45-464E-4B73-8623-B8F1B1543E04} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.7 = {7BB11400-AFC9-4439-89B3-A00122B44850} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.8 = {9A635D0D-011B-46AB-B582-CEAC8977775D} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.9 = {B75C56F5-1D23-4F46-B981-E685CC442DBB} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.10 = {9A4E4BCE-D5B3-474A-874C-6578983CFC7C} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.11 = {A7EC04A5-D65C-4C45-969C-D842823446ED} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.12 = {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.13 = {8E23CD25-D0DD-4655-A25E-26DFF7E849D0} - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.14 = {31FAE924-14B7-45E3-ABEC-DDF33A6C738E} - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug.ActiveCfg = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug.Build.0 = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug Win32.ActiveCfg = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug Win32.Build.0 = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug Xbox.ActiveCfg = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Debug Xbox.Build.0 = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Hybrid.ActiveCfg = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Profile.ActiveCfg = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Profile Win32.ActiveCfg = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Profile Win32.Build.0 = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Profile Xbox.ActiveCfg = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Profile Xbox.Build.0 = Profile|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release.ActiveCfg = Release|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release Win32.ActiveCfg = Release|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release Win32.Build.0 = Release|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release Xbox.ActiveCfg = Release|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.Release Xbox.Build.0 = Release|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.XBOX Debug.ActiveCfg = Debug|Win32 - {CC7E772A-D33D-4CDA-9F83-9281A7C48539}.XBOX Release.ActiveCfg = Release|Win32 - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Debug.ActiveCfg = Debug|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Debug.Build.0 = Debug|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Debug Win32.ActiveCfg = Debug|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Debug Win32.Build.0 = Debug|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Debug Xbox.ActiveCfg = Debug|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Debug Xbox.Build.0 = Debug|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Hybrid.ActiveCfg = Debug|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Profile.ActiveCfg = Profile|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Profile Win32.ActiveCfg = Profile|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Profile Win32.Build.0 = Profile|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Profile Xbox.ActiveCfg = Profile|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Profile Xbox.Build.0 = Profile|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Release.ActiveCfg = Release|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Release Win32.ActiveCfg = Release|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Release Win32.Build.0 = Release|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Release Xbox.ActiveCfg = Release|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.Release Xbox.Build.0 = Release|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.XBOX Debug.ActiveCfg = Debug|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.XBOX Debug.Build.0 = Debug|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.XBOX Release.ActiveCfg = Release|Xbox - {31FAE924-14B7-45E3-ABEC-DDF33A6C738E}.XBOX Release.Build.0 = Release|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Debug.ActiveCfg = Debug|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Debug.Build.0 = Debug|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Debug Win32.ActiveCfg = Debug|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Debug Win32.Build.0 = Debug|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Debug Xbox.ActiveCfg = Debug|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Debug Xbox.Build.0 = Debug|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Hybrid.ActiveCfg = Debug|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Profile.ActiveCfg = Profile|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Profile Win32.ActiveCfg = Profile|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Profile Win32.Build.0 = Profile|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Profile Xbox.ActiveCfg = Profile|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Profile Xbox.Build.0 = Profile|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Release.ActiveCfg = Release|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Release Win32.ActiveCfg = Release|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Release Win32.Build.0 = Release|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Release Xbox.ActiveCfg = Release|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.Release Xbox.Build.0 = Release|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.XBOX Debug.ActiveCfg = Debug|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.XBOX Debug.Build.0 = Debug|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.XBOX Release.ActiveCfg = Release|Xbox - {10D1BB45-464E-4B73-8623-B8F1B1543E04}.XBOX Release.Build.0 = Release|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug.ActiveCfg = Debug|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug.Build.0 = Debug|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug Win32.ActiveCfg = Debug|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug Win32.Build.0 = Debug|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug Xbox.ActiveCfg = Debug|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Debug Xbox.Build.0 = Debug|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Hybrid.ActiveCfg = Hybrid|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile.ActiveCfg = Profile|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile Win32.ActiveCfg = Profile|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile Win32.Build.0 = Profile|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile Xbox.ActiveCfg = Profile|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Profile Xbox.Build.0 = Profile|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Release.ActiveCfg = Release|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Release Win32.ActiveCfg = Release|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Release Win32.Build.0 = Release|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Release Xbox.ActiveCfg = Release|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.Release Xbox.Build.0 = Release|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.XBOX Debug.ActiveCfg = Debug|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.XBOX Debug.Build.0 = Debug|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.XBOX Release.ActiveCfg = Release|Xbox - {7BB11400-AFC9-4439-89B3-A00122B44850}.XBOX Release.Build.0 = Release|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Debug.ActiveCfg = Debug|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Debug.Build.0 = Debug|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Debug Win32.ActiveCfg = Debug|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Debug Win32.Build.0 = Debug|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Debug Xbox.ActiveCfg = Debug|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Debug Xbox.Build.0 = Debug|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Hybrid.ActiveCfg = Profile|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Profile.ActiveCfg = Profile|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Profile Win32.ActiveCfg = Profile|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Profile Win32.Build.0 = Profile|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Profile Xbox.ActiveCfg = Profile|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Profile Xbox.Build.0 = Profile|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Release.ActiveCfg = Release|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Release Win32.ActiveCfg = Release|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Release Win32.Build.0 = Release|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Release Xbox.ActiveCfg = Release|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.Release Xbox.Build.0 = Release|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.XBOX Debug.ActiveCfg = Debug|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.XBOX Debug.Build.0 = Debug|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.XBOX Release.ActiveCfg = Release|Xbox - {9A635D0D-011B-46AB-B582-CEAC8977775D}.XBOX Release.Build.0 = Release|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Debug.ActiveCfg = Debug|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Debug.Build.0 = Debug|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Debug Win32.ActiveCfg = Debug|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Debug Win32.Build.0 = Debug|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Debug Xbox.ActiveCfg = Debug|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Debug Xbox.Build.0 = Debug|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Hybrid.ActiveCfg = Debug|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Profile.ActiveCfg = Profile|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Profile Win32.ActiveCfg = Profile|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Profile Win32.Build.0 = Profile|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Profile Xbox.ActiveCfg = Profile|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Profile Xbox.Build.0 = Profile|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Release.ActiveCfg = Release|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Release Win32.ActiveCfg = Release|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Release Win32.Build.0 = Release|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Release Xbox.ActiveCfg = Release|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.Release Xbox.Build.0 = Release|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.XBOX Debug.ActiveCfg = Debug|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.XBOX Debug.Build.0 = Debug|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.XBOX Release.ActiveCfg = Release|Xbox - {B75C56F5-1D23-4F46-B981-E685CC442DBB}.XBOX Release.Build.0 = Release|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Debug.ActiveCfg = Debug|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Debug.Build.0 = Debug|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Debug Win32.ActiveCfg = Debug|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Debug Win32.Build.0 = Debug|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Debug Xbox.ActiveCfg = Debug|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Debug Xbox.Build.0 = Debug|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Hybrid.ActiveCfg = Profile|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Profile.ActiveCfg = Profile|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Profile Win32.ActiveCfg = Profile|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Profile Win32.Build.0 = Profile|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Profile Xbox.ActiveCfg = Profile|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Profile Xbox.Build.0 = Profile|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Release.ActiveCfg = Release|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Release Win32.ActiveCfg = Release|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Release Win32.Build.0 = Release|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Release Xbox.ActiveCfg = Release|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.Release Xbox.Build.0 = Release|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.XBOX Debug.ActiveCfg = Debug|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.XBOX Debug.Build.0 = Debug|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.XBOX Release.ActiveCfg = Release|Xbox - {A7EC04A5-D65C-4C45-969C-D842823446ED}.XBOX Release.Build.0 = Release|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Debug.ActiveCfg = Debug|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Debug.Build.0 = Debug|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Debug Win32.ActiveCfg = Debug|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Debug Win32.Build.0 = Debug|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Debug Xbox.ActiveCfg = Debug|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Debug Xbox.Build.0 = Debug|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Hybrid.ActiveCfg = Profile|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Profile.ActiveCfg = Profile|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Profile Win32.ActiveCfg = Profile|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Profile Win32.Build.0 = Profile|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Profile Xbox.ActiveCfg = Profile|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Profile Xbox.Build.0 = Profile|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Release.ActiveCfg = Release|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Release Win32.ActiveCfg = Release|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Release Win32.Build.0 = Release|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Release Xbox.ActiveCfg = Release|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.Release Xbox.Build.0 = Release|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.XBOX Debug.ActiveCfg = Debug|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.XBOX Debug.Build.0 = Debug|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.XBOX Release.ActiveCfg = Release|Xbox - {DFEF73F1-9AC4-44FD-B0E0-6E5B5B59BECB}.XBOX Release.Build.0 = Release|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Debug.ActiveCfg = Debug|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Debug.Build.0 = Debug|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Debug Win32.ActiveCfg = Debug|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Debug Win32.Build.0 = Debug|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Debug Xbox.ActiveCfg = Debug|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Debug Xbox.Build.0 = Debug|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Hybrid.ActiveCfg = Profile|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Profile.ActiveCfg = Profile|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Profile Win32.ActiveCfg = Profile|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Profile Win32.Build.0 = Profile|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Profile Xbox.ActiveCfg = Profile|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Profile Xbox.Build.0 = Profile|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Release.ActiveCfg = Release|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Release Win32.ActiveCfg = Release|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Release Win32.Build.0 = Release|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Release Xbox.ActiveCfg = Release|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.Release Xbox.Build.0 = Release|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.XBOX Debug.ActiveCfg = Debug|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.XBOX Debug.Build.0 = Debug|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.XBOX Release.ActiveCfg = Release|Xbox - {9A4E4BCE-D5B3-474A-874C-6578983CFC7C}.XBOX Release.Build.0 = Release|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Debug.ActiveCfg = Debug|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Debug.Build.0 = Debug|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Debug Win32.ActiveCfg = Debug|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Debug Win32.Build.0 = Debug|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Debug Xbox.ActiveCfg = Debug|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Debug Xbox.Build.0 = Debug|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Hybrid.ActiveCfg = Release|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Profile.ActiveCfg = Profile|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Profile Win32.ActiveCfg = Profile|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Profile Win32.Build.0 = Profile|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Profile Xbox.ActiveCfg = Profile|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Profile Xbox.Build.0 = Profile|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Release.ActiveCfg = Release|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Release Win32.ActiveCfg = Release|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Release Win32.Build.0 = Release|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Release Xbox.ActiveCfg = Release|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.Release Xbox.Build.0 = Release|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.XBOX Debug.ActiveCfg = Debug|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.XBOX Debug.Build.0 = Debug|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.XBOX Release.ActiveCfg = Release|Xbox - {8E23CD25-D0DD-4655-A25E-26DFF7E849D0}.XBOX Release.Build.0 = Release|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Debug.ActiveCfg = Debug|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Debug.Build.0 = Debug|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Debug Win32.ActiveCfg = Debug|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Debug Win32.Build.0 = Debug|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Debug Xbox.ActiveCfg = Debug|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Debug Xbox.Build.0 = Debug|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Hybrid.ActiveCfg = Profile|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Profile.ActiveCfg = Profile|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Profile Win32.ActiveCfg = Profile|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Profile Win32.Build.0 = Profile|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Profile Xbox.ActiveCfg = Profile|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Profile Xbox.Build.0 = Profile|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Release.ActiveCfg = Release|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Release Win32.ActiveCfg = Release|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Release Win32.Build.0 = Release|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Release Xbox.ActiveCfg = Release|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.Release Xbox.Build.0 = Release|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.XBOX Debug.ActiveCfg = Debug|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.XBOX Debug.Build.0 = Debug|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.XBOX Release.ActiveCfg = Release|Xbox - {80E81C96-6482-40F5-9C8B-DDE831B136CE}.XBOX Release.Build.0 = Release|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Debug.ActiveCfg = Debug|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Debug.Build.0 = Debug|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Debug Win32.ActiveCfg = Debug|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Debug Win32.Build.0 = Debug|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Debug Xbox.ActiveCfg = Debug|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Debug Xbox.Build.0 = Debug|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Hybrid.ActiveCfg = Debug|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Profile.ActiveCfg = Profile|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Profile Win32.ActiveCfg = Profile|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Profile Win32.Build.0 = Profile|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Profile Xbox.ActiveCfg = Profile|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Profile Xbox.Build.0 = Profile|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Release.ActiveCfg = Release|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Release Win32.ActiveCfg = Release|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Release Win32.Build.0 = Release|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Release Xbox.ActiveCfg = Release|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.Release Xbox.Build.0 = Release|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.XBOX Debug.ActiveCfg = Debug|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.XBOX Debug.Build.0 = Debug|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.XBOX Release.ActiveCfg = Release|Xbox - {548DB7CA-1D77-4831-9314-31B0F1FB167B}.XBOX Release.Build.0 = Release|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug.ActiveCfg = Debug|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug.Build.0 = Debug|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug Win32.ActiveCfg = Debug|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug Win32.Build.0 = Debug|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug Xbox.ActiveCfg = Debug|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Debug Xbox.Build.0 = Debug|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Hybrid.ActiveCfg = Profile|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile.ActiveCfg = Profile|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile Win32.ActiveCfg = Profile|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile Win32.Build.0 = Profile|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile Xbox.ActiveCfg = Profile|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Profile Xbox.Build.0 = Profile|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release.ActiveCfg = Release|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release Win32.ActiveCfg = Release|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release Win32.Build.0 = Release|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release Xbox.ActiveCfg = Release|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.Release Xbox.Build.0 = Release|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.XBOX Debug.ActiveCfg = Debug|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.XBOX Debug.Build.0 = Debug|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.XBOX Release.ActiveCfg = Release|Xbox - {9F9FB6F5-D971-4887-B0AD-5C368DDAD90B}.XBOX Release.Build.0 = Release|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug.ActiveCfg = Debug|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug.Build.0 = Debug|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug Win32.ActiveCfg = Debug|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug Win32.Build.0 = Debug|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug Xbox.ActiveCfg = Debug|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Debug Xbox.Build.0 = Debug|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Hybrid.ActiveCfg = Release|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile.ActiveCfg = Profile|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile Win32.ActiveCfg = Profile|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile Win32.Build.0 = Profile|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile Xbox.ActiveCfg = Profile|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Profile Xbox.Build.0 = Profile|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release.ActiveCfg = Release|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release Win32.ActiveCfg = Release|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release Win32.Build.0 = Release|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release Xbox.ActiveCfg = Release|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.Release Xbox.Build.0 = Release|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.XBOX Debug.ActiveCfg = Debug|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.XBOX Debug.Build.0 = Debug|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.XBOX Release.ActiveCfg = Release|Xbox - {371D7BDF-BD06-4CF1-A697-CE7CC57C107D}.XBOX Release.Build.0 = Release|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Debug.ActiveCfg = Debug|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Debug.Build.0 = Debug|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Debug Win32.ActiveCfg = Debug|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Debug Win32.Build.0 = Debug|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Debug Xbox.ActiveCfg = Debug|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Debug Xbox.Build.0 = Debug|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Hybrid.ActiveCfg = Debug|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Hybrid.Build.0 = Debug|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Profile.ActiveCfg = Profile|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Profile.Build.0 = Profile|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Profile Win32.ActiveCfg = Profile|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Profile Win32.Build.0 = Profile|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Profile Xbox.ActiveCfg = Profile|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Profile Xbox.Build.0 = Profile|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Release.ActiveCfg = Release|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Release.Build.0 = Release|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Release Win32.ActiveCfg = Release|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Release Win32.Build.0 = Release|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Release Xbox.ActiveCfg = Release|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.Release Xbox.Build.0 = Release|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.XBOX Debug.ActiveCfg = Debug|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.XBOX Debug.Build.0 = Debug|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.XBOX Release.ActiveCfg = Release|Xbox - {E9EC2400-2FAB-460B-8CE4-4F0521D23866}.XBOX Release.Build.0 = Release|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Debug.ActiveCfg = Debug|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Debug.Build.0 = Debug|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Debug Win32.ActiveCfg = Debug|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Debug Win32.Build.0 = Debug|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Debug Xbox.ActiveCfg = Debug|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Debug Xbox.Build.0 = Debug|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Hybrid.ActiveCfg = Profile|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Hybrid.Build.0 = Profile|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Profile.ActiveCfg = Profile|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Profile.Build.0 = Profile|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Profile Win32.ActiveCfg = Profile|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Profile Win32.Build.0 = Profile|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Profile Xbox.ActiveCfg = Profile|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Profile Xbox.Build.0 = Profile|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Release.ActiveCfg = Release|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Release.Build.0 = Release|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Release Win32.ActiveCfg = Release|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Release Win32.Build.0 = Release|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Release Xbox.ActiveCfg = Release|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.Release Xbox.Build.0 = Release|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.XBOX Debug.ActiveCfg = Debug|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.XBOX Debug.Build.0 = Debug|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.XBOX Release.ActiveCfg = Release|Xbox - {E2E8D5F5-B6CF-4FFE-833C-6877C40D41A5}.XBOX Release.Build.0 = Release|Xbox - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - DPBuild = 5 - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection - GlobalSection(DevPartner) = postSolution - EndGlobalSection - GlobalSection(DevPartner) = postSolution - EndGlobalSection - GlobalSection(DevPartner) = postSolution - EndGlobalSection - GlobalSection(DevPartner) = postSolution - EndGlobalSection - GlobalSection(DevPartner) = postSolution - EndGlobalSection -EndGlobal diff --git a/MSSCCPRJ.SCC b/MSSCCPRJ.SCC deleted file mode 100644 index 9b1be53..0000000 --- a/MSSCCPRJ.SCC +++ /dev/null @@ -1,9 +0,0 @@ -SCC = This is a source code control file - -[ResourceCompiler.vcproj] -SCC_Aux_Path = "P4SCC#perforce:1666##marcoc_code##PC018" -SCC_Project_Name = Perforce Project - -[Game01.sln] -SCC_Aux_Path = "P4SCC#perforce:1666##marcoc_code##PC018" -SCC_Project_Name = Perforce Project diff --git a/PunkBuster/pbcl.cpp b/PunkBuster/pbcl.cpp new file mode 100644 index 0000000..34fb050 --- /dev/null +++ b/PunkBuster/pbcl.cpp @@ -0,0 +1,278 @@ +// Copyright (C) 2001-2003 Even Balance, Inc. +// +// +// pbcl.cpp +// +// EVEN BALANCE - T.RAY +// + + + +#define _cplusplus + + + +#include "pbmd5.h" + +#if !defined(NOT_USE_PUNKBUSTER_SDK) + +#define PbSdk_DEFINED +#include "pbsdk.h" + + + +#ifdef __WITH_PB__ + + + +// +// PbClGameCommand +// +extern void PBpakNames ( char *buf ) ; +char * __cdecl PbClGameCommand ( char *Cmd , char *Result ) +{ + char *arg1 = Result ; + while ( *arg1 == ' ' ) ++arg1 ; + while ( *arg1 && *arg1 != ' ' ) ++arg1 ; + while ( *arg1 == ' ' ) ++arg1 ; + + if ( !stricmp ( Cmd , "set_cl_punkbuster" ) ) pbsdk->pb_SetClPunkBuster ( Result ) ; + else if ( !stricmp ( Cmd , "pakNames" ) ) + PBpakNames ( Result ) ;//note: Result must be 1025+ bytes for this one + else if ( !stricmp ( Cmd , "Cvar_Set" ) ) pbsdk->pb_CvarSet ( Result , arg1 ) ; + else if ( !stricmp ( Cmd , "Cmd_Exec" ) ) pbsdk->pb_ExecCmd ( Result ) ; + return NULL ; +} + + + +//extern int PbSearchBindings ( char *subtext , int iStart ) ; //cl_keys.c +// +// PbClGameQuery +// +// assumes Data points to buffer at least as large as PB_Q_MAXRESULTLEN+1 +// +char * __cdecl PbClGameQuery ( int Qtype , char *Data ) +{ + if ( Data == NULL ) return NULL ; + + Data[PB_Q_MAXRESULTLEN] = 0 ; + + char *arg2 = Data , *name , *string , *resetString ; + int i , n , flags ; + + while ( *arg2 && *arg2 != ' ' ) ++arg2 ; + while ( *arg2 == ' ' ) ++arg2 ; + switch ( Qtype ) { + case PB_Q_CVAR: strncpy ( Data , pbsdk->pb_GetCvarValue ( Data ) , PB_Q_MAXRESULTLEN ) ; break ; + case PB_Q_SINFO: strncpy ( Data , pbsdk->pb_GetKeyValue ( pbsdk->pb_GetServerInfo() , Data ) , PB_Q_MAXRESULTLEN ) ; break ; + case PB_Q_SADDR: strncpy ( Data , pbsdk->pb_GetServerAddr() , PB_Q_MAXRESULTLEN ) ; break ; + case PB_Q_SEARCHBINDINGS: + n = pbsdk->pb_GetMaxKeys() ; + for ( i = atoi ( Data ) ; i < n ; i++ ) + if ( stristr ( pbsdk->pb_GetKeyBinding ( i ) , arg2 ) != NULL ) { + itoa ( i , Data , 10 ) ; + return NULL ; + } + itoa ( -1 , Data , 10 ) ; + break ; + case PB_Q_GETBINDING: + strncpy ( Data , pbsdk->pb_GetKeyBinding ( atoi ( Data ) ) , PB_Q_MAXRESULTLEN ) ; break ; + case PB_Q_KEYNAME: + strncpy ( Data , pbsdk->pb_GetKeyName ( atoi ( Data ) ) , PB_Q_MAXRESULTLEN ) ; break ; + case PB_Q_SEARCHCVARS: + if ( ! (*Data) ) break ; + while ( pbsdk->pb_CvarWalk ( &name , &string , &flags , &resetString ) ) { + if ( name == NULL || string == NULL ) continue ; + if ( !(*name) || !(*string) ) continue ; + if ( stristr ( string , Data ) != NULL ) { + strncpy ( Data , name , PB_Q_MAXRESULTLEN ) ; + return NULL ; + } + } + *Data = 0 ; + break ; + case PB_Q_CVARVALID: return pbsdk->pb_CvarValidate ( Data ) ; + case PB_Q_CVARFLAGS: //note: this query type returns NULL when done only, cvar name otherwise + if ( pbsdk->pb_CvarWalk ( &name , &string , &flags , &resetString ) == 0 ) return NULL ; + if ( name == NULL ) name = "" ; + itoa ( flags , Data , 10 ) ; + return name ; + case PB_Q_CVARDEFAULTS: //note: this query type returns NULL when done only, cvar name otherwise + if ( pbsdk->pb_CvarWalk ( &name , &string , &flags , &resetString ) == 0 ) return NULL ; + if ( name == NULL || string == NULL || resetString == NULL ) name = string = resetString = "" ; + if ( !strcmp ( string , resetString ) ) *Data = 0 ; + else { + strncpy ( Data + 1 , resetString , PB_Q_MAXRESULTLEN - 2 ) ; + Data[0] = '"' ; + strcat ( Data , "\"" ) ; + } + return name ; + case PB_Q_EXEINSTANCE: +#ifdef __PBWIN32__ + return (char *) pbsdk->exeInstance ; +#else + strncpy ( Data , (char *) pbsdk->exeInstance , PB_Q_MAXRESULTLEN ) ; + return NULL ; +#endif + case PB_Q_DLLHANDLE: return (char *) pbsdk->pb_DllHandle ( Data ) ; + default: *Data = 0 ; break ; + } + return NULL ; +} + +// +// PbClGameMsg +// +char * __cdecl PbClGameMsg ( char *Msg , int Type ) +{ + if ( !isPBmultiplayerMode() ) return NULL ; + + Type;//reserved + pbsdk->pb_Outf ( "%s: %s\n" , pbsdk->pbcl.m_msgPrefix , Msg ) ; + return NULL ; +} + + + +// +// PbClSendToServer +// +char * __cdecl PbClSendToServer ( int DataLen , char *Data ) +{ + pbsdk->pb_SendClPacket ( DataLen , Data ) ; + return NULL ; +} + + + +// +// PbClSendToAddrPort +// +char * __cdecl PbClSendToAddrPort ( char *addr , unsigned short port , int DataLen , char *Data ) +{ + pbsdk->pb_SendUdpPacket ( addr , port , DataLen , Data , 1 ) ;//1 means coming from client + return NULL ; +} + + + +// +// Function wrappers used to call C++ functions from C +// these are declared in pbcommon.h + +extern "C" { + +void __cdecl PbClAddEvent ( int event , int datalen , char *data ) +{ + if ( pbsdk == NULL ) return ; + pbsdk->pbcl.AddPbEvent ( event , datalen , data , 0 ) ; +} + +int __cdecl PbTrapPreExecCmd ( char *cmdtext )//return 0 if game should continue exec'ing the command, 1 if not +{ + if ( !isPBmultiplayerMode() ) return 0 ; + if ( pbsdk->pbcl.m_TrapPreExecCmd == NULL ) return 0 ; + return pbsdk->pbcl.m_TrapPreExecCmd ( &pbsdk->pbcl , cmdtext ) ; +} + +void __cdecl PbClientTrapConsole ( char *msg , int msglen ) +{ + if ( !isPBmultiplayerMode() ) return ; + if ( pbsdk->pbcl.m_TrapConsole == NULL ) return ; + pbsdk->pbcl.m_TrapConsole ( &pbsdk->pbcl , msg , msglen ) ; +} + +void __cdecl PbClientInitialize ( void *exeInst ) +{ + if ( pbsdk == NULL ) return ; + + pbsdk->exeInstance = exeInst ; + pbsdk->pbcl.pbsvptr = &pbsdk->pbsv ; + pbsdk->pbcl.initialize() ; + + pbsdk->pb_getBasePath ( pbsdk->pbcl.m_basepath , PB_Q_MAXRESULTLEN ) ; + pbsdk->pb_getHomePath ( pbsdk->pbcl.m_homepath , PB_Q_MAXRESULTLEN ) ; + + PbClAddEvent ( PB_EV_CONFIG , 0 , "" ) ; + if ( pbsdk->pbcl.m_ClInstance == NULL ) pbsdk->pb_SetClPunkBuster ( "0" ) ; +} + +void __cdecl PbClientProcessEvents ( void ) +{ + if ( !isPBmultiplayerMode() ) return ; + pbsdk->pbcl.ProcessPbEvents() ; +} + +void __cdecl PbClientForceProcess ( void ) +{ + if ( !isPBmultiplayerMode() ) return ; + pbsdk->pbcl.ProcessPbEvents ( -1 ) ; +} + +//added for Enemy Territory - PB knows max pktlen is 1024 +void __cdecl PbClientConnecting ( int status , char *pkt , int *pktlen ) +{ + if ( !isPBmultiplayerMode() ) return ; + if ( pbsdk->pbcl.m_ClientConnect == NULL ) return ; + pbsdk->pbcl.m_ClientConnect ( &pbsdk->pbcl , status , pkt , pktlen ) ; +} + +void __cdecl PbClientCompleteCommand ( char *buf , int buflen ) +{ + if ( !isPBmultiplayerMode() ) return ; + pbsdk->pbcl.AddPbEvent ( PB_EV_CMDCOMPL , buflen , buf ) ; +} + +void __cdecl md5Digest2text ( MD5_CTX *m , char *textbuf )//assumes textbuf is 33+ chars +{ + sprintf ( textbuf , "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", + (int) m->digest[0] , (int) m->digest[1] , (int) m->digest[2] , (int) m->digest[3] , + (int) m->digest[4] , (int) m->digest[5] , (int) m->digest[6] , (int) m->digest[7] , + (int) m->digest[8] , (int) m->digest[9] , (int) m->digest[10] , (int) m->digest[11] , + (int) m->digest[12] , (int) m->digest[13] , (int) m->digest[14] , (int) m->digest[15] ) ; +} + +char * __cdecl PbSetGuid ( char *nums , int len )//updated for ET +{ + if ( !isPBmultiplayerMode() ) return "" ; + MD5_CTX m ; + MD5Init ( &m , 11961507 ) ; + MD5Update ( &m , (unsigned char *) nums , len ) ; + MD5Final ( &m ) ; + md5Digest2text ( &m , pbsdk->pbcl.m_guid ) ; + MD5Init ( &m , 334422 ) ; + MD5Update ( &m , (unsigned char *) pbsdk->pbcl.m_guid , strlen ( pbsdk->pbcl.m_guid ) ) ; + MD5Final ( &m ) ; + md5Digest2text ( &m , pbsdk->pbcl.m_guid ) ; + return pbsdk->pbcl.m_guid ; +} + +int __cdecl isPbClEnabled ( void ) +{ + if ( !isPBmultiplayerMode() ) return 0 ; + return (int) pbsdk->pbcl.AddPbEvent ( PB_EV_ISENABLED , 0 , NULL ) ; +} + +int __cdecl getPbGuidAge ( void ) +{ + if ( !isPbClEnabled() ) return -2 ; + return (int) pbsdk->pbcl.AddPbEvent ( PB_EV_GUIDAGE , 0 , NULL ) ;//returns -1 if bad/missing cdkey +} + +void __cdecl EnablePbCl ( void ) +{ + if ( !isPBmultiplayerMode() ) return ; + pbsdk->pbcl.AddPbEvent ( PB_EV_ENABLE , 0 , NULL ) ; +} + +void __cdecl DisablePbCl ( void ) +{ + if ( !isPBmultiplayerMode() ) return ; + pbsdk->pbcl.AddPbEvent ( PB_EV_DISABLE , 0 , NULL ) ; +} + +} //extern "C" + +#endif //#ifdef __WITHPB__ +#endif // NOT_USE_PUNKBUSTER_SDK \ No newline at end of file diff --git a/PunkBuster/pbcl.h b/PunkBuster/pbcl.h new file mode 100644 index 0000000..36f5fe6 --- /dev/null +++ b/PunkBuster/pbcl.h @@ -0,0 +1,296 @@ +// Copyright (C) 2001-2003 Even Balance, Inc. +// +// +// pbcl.h +// +// EVEN BALANCE - T.RAY +// +// The only file in the game project that needs to include this file is pbcl.cpp +// + + +#ifndef __PBCL_H__ +#define __PBCL_H__ + + + +#include +#include +#include +#include "pbcommon.h" + + +#if !defined(NOT_USE_PUNKBUSTER_SDK) + +#ifdef __PBWIN32__ +#include +#include +#endif +#ifdef __PBLINUX__ +#include +#include "CryLibrary.h" +#endif +#ifdef __PBMAC__ +#include +#include "../macosx/dlfcn.h" +#endif + + + +#ifdef __WITH_PB__ + + + +#ifdef _cplusplus + + + +#ifndef __PBDLL__ +extern char *ca ( void *cp , int ticklimit ) ; +extern char *cb ( void *cp , int event , int datalen , char *data , int retry ) ; +#endif + + + +// +// Class/Struct Definitions +// +struct stPbCl { + int m_clId ; + void *m_Md5 ; + void *m_ClInstance , *m_AgInstance ; + int m_ReloadClient ; + char m_guid[PB_GUIDLEN+1] , m_msgPrefix[PB_MISCLEN+1] , m_CdKeyNums[17] , + m_basepath[PB_Q_MAXRESULTLEN+4] , m_homepath[PB_Q_MAXRESULTLEN+4] , m_cwd[PB_Q_MAXRESULTLEN+4] ; + + unsigned int rk1 , rk2 , rk3 , rk4 ; + + //func ptrs + tdPbGameCommand m_GameCommand ; + tdPbGameQuery m_GameQuery ; + tdPbGameMsg m_GameMsg ; + tdPbSendToServer m_SendToServer ; + tdPbAddClEvent m_AddPbEvent ; + tdPbProcessPbEvents m_ProcessPbEvents ; + tdPbSendToAddrPort m_SendToAddrPort ; + tdPbGlQuery m_GlQuery ; + tdPbClientConnect m_ClientConnect ; + tdPbTrapPreExecCmd m_TrapPreExecCmd ; + tdPbTrapConsole m_TrapConsole ; + + void *pbsvptr ; + + inline char *getBasePath ( char *path ) { + strncpy ( path , m_basepath , PB_Q_MAXRESULTLEN ) ; + path[PB_Q_MAXRESULTLEN] = 0 ; + if ( !(*path) ) getcwd ( path , PB_Q_MAXRESULTLEN - 4 ) ; + if ( *path && path[strlen(path)-1] != *pbDIRSEP ) strcat ( path , pbDIRSEP ) ; + strcat ( path , "pb" pbDIRSEP ) ; + return path ; + } + + inline char *getHomePath ( char *path ) { + strncpy ( path , m_homepath , PB_Q_MAXRESULTLEN ) ; + path[PB_Q_MAXRESULTLEN] = 0 ; + if ( !(*path) ) getcwd ( path , PB_Q_MAXRESULTLEN - 4 ) ; + if ( *path && path[strlen(path)-1] != *pbDIRSEP ) strcat ( path , pbDIRSEP ) ; + strcat ( path , "pb" pbDIRSEP ) ; + return path ; + } + + inline char *makefn ( char *buf , char *fn ) { //assumes buf is large enough to hold cwd + fn + overhead + if ( !(*m_cwd) ) { + getHomePath ( m_cwd ) ; + } + strcpy ( buf , m_cwd ) ; + strcat ( buf , fn ) ; + return buf ; + } + + inline void UnloadAgentDll ( void ) { + if ( m_AgInstance == NULL ) return ; +#ifdef __PBWIN32__ + FreeLibrary ( (HINSTANCE) m_AgInstance ) ; +#endif +#ifdef __PBLINUX__ + dlclose ( m_AgInstance ) ; +#endif +#ifdef __PBMAC__ + dlclose ( m_AgInstance ) ; +#endif + m_AgInstance = NULL ; + } + + inline void LoadAgentDll ( void ) { + if ( m_AgInstance != NULL ) return ; + UnloadAgentDll() ; + + char fn[PB_Q_MAXRESULTLEN*2+1] ; + +#ifdef __PBWIN32__ + m_AgInstance = LoadLibraryA ( makefn ( fn , "pbag" pbDLLEXT ) ) ; +#endif +#ifdef __PBLINUX__ + m_AgInstance = ::dlopen ( makefn ( fn , "pbag" pbDLLEXT ) , RTLD_LAZY ) ; +#endif +#ifdef __PBMAC__ + m_AgInstance = dlopen ( makefn ( fn , "pbag" pbDLLEXT ) , RTLD_LAZY ) ; +#endif + } + +#ifndef __PBDLL__ //the following functions are not needed by the PB DLLs + + inline void uninitialize ( void ) {//also initializes game-side func ptrs + m_GameCommand = NULL ; + m_GameQuery = NULL ; + m_GameMsg = NULL ; + m_SendToServer = NULL ; + } + + inline void initialize ( void ) { + uninitialize() ; + m_GameCommand = PbClGameCommand ; + m_GameQuery = PbClGameQuery ; + m_GameMsg = PbClGameMsg ; + m_SendToServer = PbClSendToServer ; + m_SendToAddrPort = PbClSendToAddrPort ; +//note: m_GlQuery is set in pbsdk.h + } + + inline void UnloadClientDll ( void ) { + m_ProcessPbEvents = NULL ; + m_AddPbEvent = NULL ; + m_ClientConnect = NULL ; + m_TrapPreExecCmd = NULL ; + m_TrapConsole = NULL ; + if ( m_ClInstance == NULL ) return ; + +#ifdef __PBWIN32__ + FreeLibrary ( (HMODULE) m_ClInstance ) ; +#endif +#ifdef __PBLINUX__ + dlclose ( m_ClInstance ) ; +#endif +#ifdef __PBMAC__ + dlclose ( m_ClInstance ) ; +#endif + m_ClInstance = NULL ; + } + + inline char *LoadClientDll ( void ) { + if ( m_ClInstance != NULL ) return NULL ; + UnloadClientDll() ; + + char fn[PB_Q_MAXRESULTLEN*2+1] , extrafn[PB_Q_MAXRESULTLEN*2+1] ; + + //check for replacement (updated) dll file and rename if necessary + //load PB client dll and retrieve exported function pointers + FILE *f = fopen ( makefn ( fn , "pbclnew" pbDLLEXT ) , "rb" ) ; + if ( f != NULL ) { + fclose ( f ) ; + setRW ( makefn ( fn , "pbclold" pbDLLEXT ) ) ; + remove ( makefn ( fn , "pbclold" pbDLLEXT ) ) ; + rename ( makefn ( fn , "pbcl" pbDLLEXT ) , makefn ( extrafn , "pbclold" pbDLLEXT ) ) ; + setRW ( makefn ( fn , "pbcl" pbDLLEXT ) ) ; + remove ( makefn ( fn , "pbcl" pbDLLEXT ) ) ; + rename ( makefn ( fn , "pbclnew" pbDLLEXT ) , makefn ( extrafn , "pbcl" pbDLLEXT ) ) ; + } +#ifdef __PBWIN32__ + m_ClInstance = LoadLibraryA ( makefn ( fn , "pbcl" pbDLLEXT ) ) ; + if ( m_ClInstance == NULL ) return PbsClDllLoadFail ; + m_ProcessPbEvents = (tdPbProcessPbEvents) GetProcAddress ( (HINSTANCE) m_ClInstance , "ca" ) ; + m_AddPbEvent = (tdPbAddClEvent) GetProcAddress ( (HINSTANCE) m_ClInstance , "cb" ) ; +#endif +#ifdef __PBLINUX__ + m_ClInstance = ::dlopen ( makefn ( fn , "pbcl" pbDLLEXT ) , RTLD_LAZY ) ; + if ( m_ClInstance == NULL ) return PbsClDllLoadFail ; + m_ProcessPbEvents = (tdPbProcessPbEvents) dlsym ( m_ClInstance , "ca" ) ; + m_AddPbEvent = (tdPbAddClEvent) dlsym ( m_ClInstance , "cb" ) ; +#endif +#ifdef __PBMAC__ + m_ClInstance = dlopen ( makefn ( fn , "pbcl" pbDLLEXT ) , RTLD_LAZY ) ; + if ( m_ClInstance == NULL ) return PbsClDllLoadFail ; + m_ProcessPbEvents = (tdPbProcessPbEvents) dlsym ( m_ClInstance , "_ca" ) ; + m_AddPbEvent = (tdPbAddClEvent) dlsym ( m_ClInstance , "_cb" ) ; +#endif + + if ( m_ProcessPbEvents == NULL || m_AddPbEvent == NULL ) { + UnloadClientDll() ; + return PbsClDllProcFail ; + } + + m_ReloadClient = 0 ; + + return NULL ; + } + + inline char *AddPbEvent ( int type , int datalen , char *data , int retry = 0 ) { + if ( m_GameCommand == NULL ) return NULL ;//not considered an error, this signifies that PB is disabled + + if ( m_ReloadClient || m_ClInstance == NULL ) { + if ( m_ClInstance != NULL ) { + UnloadClientDll() ; + return NULL ; + } + char *res = LoadClientDll() ; + if ( res != NULL ) { + if ( type == PB_EV_ISENABLED ) return (char *) 0 ; + return res ; + } + } + + return m_AddPbEvent ( this , type , datalen , data , retry ) ; + } + + inline char *ProcessPbEvents ( int TickLimit = 0 ) { + if ( m_GameCommand == NULL ) return NULL ;//not considered an error, this signifies that PB is disabled + if ( m_ClInstance == NULL ) { + if ( m_ReloadClient ) AddPbEvent ( PB_EV_CONFIG , 0 , "" ) ; + return NULL ;//no events have been successfully added so nothing to process + } + + if ( m_ReloadClient ) { + UnloadClientDll() ; + return NULL ; + } + + return m_ProcessPbEvents ( this , TickLimit ) ; + } + + inline void init ( void ) { + memset ( this , 0 , sizeof ( stPbCl ) ) ; + m_clId = PB_CL_ID ; + strcpy ( m_msgPrefix , "PunkBuster Client" ) ; + m_ClInstance = m_AgInstance = NULL ; + m_ReloadClient = 1 ; + uninitialize() ; + m_Md5 = NULL ; + m_AddPbEvent = NULL ; + m_ProcessPbEvents = NULL ; + m_SendToAddrPort = NULL ; + m_GlQuery = NULL ; + m_ClientConnect = NULL ; + m_TrapPreExecCmd = NULL ; + m_TrapConsole = NULL ; + } + + inline stPbCl() { + init() ; + } + + inline ~stPbCl() { + UnloadClientDll() ; + UnloadAgentDll() ; + } + +#endif //#ifndef __PBDLL__ + +} ; + + + +#endif //#ifdef _cplusplus +#endif //#ifdef __WITHPB__ +#endif //#ifndef __PBCL_H__ + +#endif // NOT_USE_PUNKBUSTER_SDK \ No newline at end of file diff --git a/PunkBuster/pbcommon.h b/PunkBuster/pbcommon.h new file mode 100644 index 0000000..39d5e31 --- /dev/null +++ b/PunkBuster/pbcommon.h @@ -0,0 +1,414 @@ +// Copyright (C) 2001-2003 Even Balance, Inc. +// +// +// pbcommon.h +// +// EVEN BALANCE - T.RAY +// + + + +//NOTE: Comment the following line to completely remove PB from the game source build +#define __WITH_PB__ + + + +#ifdef __WITH_PB__ + + + +#ifndef __PBCOMMON__ +#define __PBCOMMON__ + + + +#include +#include +#include +#include + +extern int isPBmultiplayerMode ( void ) ;//defined in PunkBusterInterface.cpp + +#include "platform.h" + +#if !defined(NOT_USE_PUNKBUSTER_SDK) +// +// Ugly Platform dependency handling +// +#if defined (LINUX) +#define __linux__ +#endif +#if defined (_WIN32) +#define __PBWIN32__ +#elif defined (__linux__) +#define __PBLINUX__ +#else +#define __PBMAC__ +#endif +#ifdef __PBWIN32__ +#include +#include +#include +#include +#include +#ifndef __PBDLL__ +#define pbDLLEXT ".dll" +#define pbDIRSEP "\\" +#else +#define TCHAR char +#endif +#endif //#ifdef __PBWIN32__ +#ifdef __PBLINUX__ +#include +#include +#ifndef __PBDLL__ +#define pbDLLEXT ".so" +#define pbDIRSEP "/" +#define stricmp strcasecmp +#define strnicmp strncasecmp +#endif +#endif //#ifdef __PBLINUX__ +#ifdef __PBMAC__ +#ifndef __PBDLL__ +#define pbDLLEXT ".mac" +#define pbDIRSEP ":" +#define stricmp _stricmp +#define strnicmp _strnicmp +#endif +#endif //#ifdef __PBMAC__ + + + +// +// Forward Function Declarations - PB functions called from inside game engine, defined in pbcl.cpp and pbsv.cpp +// + +extern "C" { + +extern void __cdecl PbClientInitialize ( void *exeInst ) ; +extern void __cdecl PbClAddEvent ( int event , int datalen , char *data ) ; +extern void __cdecl PbClientProcessEvents ( void ) ; +extern int __cdecl PbTrapPreExecCmd ( char *cmdtext ) ; +extern void __cdecl PbClientTrapConsole ( char *msg , int msglen ) ; +extern void __cdecl PbClientForceProcess ( void ) ; +extern void __cdecl PBClientConnecting ( int , char * , int * ) ; +extern void __cdecl PbClientCompleteCommand ( char *buf , int buflen ) ; +extern int __cdecl isPbClEnabled ( void ) ; +extern int __cdecl getPbGuidAge ( void ) ; +extern void __cdecl EnablePbCl ( void ) ; +extern void __cdecl DisablePbCl ( void ) ; +extern char * __cdecl PbSetGuid ( char *nums , int len ) ; + +extern void __cdecl PbServerInitialize ( void ) ; +extern void __cdecl PbSvAddEvent ( int event , int clientIndex , int datalen , char *data ) ; +extern void __cdecl PbPassConnectString ( char *fromAddr , char *connectString ) ; +extern char * __cdecl PbAuthClient ( char *fromAddr , int cl_pb , char *cl_guid ) ; +extern void __cdecl PbServerProcessEvents ( void ) ; +extern void __cdecl PbServerForceProcess ( void ) ; +extern void __cdecl PbServerCompleteCommand ( char *buf , int buflen ) ; +extern int __cdecl isPbSvEnabled ( void ) ; +extern void __cdecl EnablePbSv ( void ) ; +extern void __cdecl DisablePbSv ( void ) ; +extern void __cdecl PbCaptureConsoleOutput ( char *msg , int msglen ) ; + +} //extern "C" + + + +// +// Typedefs +// + +// game-side func typedefs +typedef char *(__cdecl *tdPbGameCommand) ( char * , char * ) ; +typedef char *(__cdecl *tdPbGameQuery) ( int , char * ) ; +typedef char *(__cdecl *tdPbGameMsg) ( char * , int ) ; +typedef char *(__cdecl *tdPbSendToServer) ( int , char * ) ; +typedef char *(__cdecl *tdPbSendToClient) ( int , char * , int ) ; +typedef char *(__cdecl *tdPbSendToAddrPort) ( char * , unsigned short , int , char * ) ; + +// pb-side func typedefs +typedef char *(*tdPbAddClEvent) ( void * , int , int , char * , int ) ; +typedef char *(*tdPbAddSvEvent) ( void * , int , int , int , char * , int ) ; +typedef char *(*tdPbProcessPbEvents) ( void * , int ) ; +typedef char *(*tdPbGlQuery) ( int ) ; +typedef char *(*tdPbClientConnect) ( void * , int , char * , int * ) ; +typedef char *(*tdPbPassConnectString) ( void * , char * , char * ) ; +typedef char *(*tdPbAuthClient) ( void * , char * , int , char * ) ; +typedef int (*tdPbTrapPreExecCmd) ( void * , char * ) ; +typedef void (*tdPbTrapConsole) ( void * , char * , int ) ; + + + +// +// External Functions used by Classes (definitions in pbcl.cpp and pbsv.cpp) +// +extern char * __cdecl PbClGameCommand ( char * , char * ) ; +extern char * __cdecl PbClGameQuery ( int , char * ) ; +extern char * __cdecl PbClGameMsg ( char * , int ) ; +extern char * __cdecl PbClSendToServer ( int , char * ) ; +extern char * __cdecl PbClSendToAddrPort ( char * , unsigned short , int , char * ) ; + +extern char * __cdecl PbSvGameCommand ( char * , char * ) ; +extern char * __cdecl PbSvGameQuery ( int , char * ) ; +extern char * __cdecl PbSvGameMsg ( char * , int ) ; +extern char * __cdecl PbSvSendToClient ( int , char * , int ) ; +extern char * __cdecl PbSvSendToAddrPort ( char * , unsigned short , int , char * ) ; + + + +// +// Defines (Error Messages) +// +#define PbsQueryFail "PB Error: Query Failed" +#define PbsClDllLoadFail "PB Error: Client DLL Load Failure" +#define PbsClDllProcFail "PB Error: Client DLL Get Procedure Failure" +#define PbsSvDllLoadFail "PB Error: Server DLL Load Failure" +#define PbsSvDllProcFail "PB Error: Server DLL Get Procedure Failure" + + + +// +// Defines (Game Query-related) +// +#define PB_Q_MAXRESULTLEN 255 +#define PB_Q_MAXCLIENTS 101 +#define PB_Q_CLIENT 102 +#define PB_Q_CVAR 103 +#define PB_Q_SINFO 104 +#define PB_Q_SADDR 105 +#define PB_Q_SEARCHBINDINGS 106 +#define PB_Q_GETBINDING 107 +#define PB_Q_KEYNAME 108 +#define PB_Q_SEARCHCVARS 109 +#define PB_Q_CVARFLAGS 110 +#define PB_Q_CVARDEFAULTS 111 +#define PB_Q_EXEINSTANCE 112 +#define PB_Q_DLLHANDLE 113 +#define PB_Q_STATS 114 +#define PB_Q_CVARVALID 115 +#define PB_Q_FILEMD5 116 +#define PB_Q_TEXTUREMD5 117 + + + +// +// Defines (Event-related) +// +#define PB_EV_PACKET 13 +#define PB_EV_CMD 14 +#define PB_EV_STAT 15 +#define PB_EV_CONFIG 16 + +#define PB_EV_CMDCOMPL 51 + +// UI subset +#define PB_EV_UISUBSET 113 +#define PB_EV_ISENABLED 113 +#define PB_EV_ENABLE 117 +#define PB_EV_DISABLE 118 +#define PB_EV_GUIDAGE 119 + + + +// +// Defines (Message-related) +// +#define PB_MSG_CONSOLE 1 +#define PB_MSG_SCREEN 2 +#define PB_MSG_LOG 4 + + + +// +// Defines (Misc) +// +#define PB_MISCLEN 31 +#define PB_NAMELEN 32 +#define PB_GUIDLEN 32 +#define PB_MAXPKTLEN 1024 +//The following two ID values are provided by Even Balance and must be matched to the +//values embedded in the Even Balance provided PunkBuster DLLs for the game +#define PB_SV_ID 0x357AFE1B +#define PB_CL_ID 0x264B8BA6 + + + +// +//PB Client OpenGL Query Facility +// +#define PB_GL_READPIXELS 101 +#define PB_GL_WIDTH 102 +#define PB_GL_HEIGHT 103 +#define PB_GL_RGB 104 +#define PB_GL_UB 105 +#define PB_GL_D3DDEV 106 + + + +// +// PB Server Integration Structs +// +typedef struct Pb_Sv_Client_s { + char name[PB_NAMELEN+1] , guid[PB_GUIDLEN+1] , ip[PB_NAMELEN+1] ; + int slotIndex ; +} stPb_Sv_Client ; + + + +// +// Forward (External) Declaration for PBsdk_SetPointers() - must be defined in each game module +// +extern "C" void PBsdk_getPbSdkPointer ( char *fn , unsigned int Flag ) ; +extern "C" void PBsdk_SetPointers ( void *pbinterface ) ; + + + +#ifndef __PBDLL__ +#ifndef __TRSTR__ +// +// stristr +// +// case insensitive variation of strstr() function +// +inline char *stristr ( char *haystack , char *needle ) +{ + char l[2] = "x" , u[2] = "X" , *cp , *lcp = NULL ; + int nsl ; + + if ( haystack == NULL || needle == NULL || !(*needle) ) return haystack ; + nsl = strlen ( needle ) ; + *l = (char) tolower ( *needle ) ; + for ( cp = haystack ; lcp == NULL ; ++cp ) { + cp = strstr ( cp , l ) ; + if ( cp == NULL ) break ; + if ( !strnicmp ( cp , needle , nsl ) ) lcp = cp ; + } + *u = (char) toupper ( *needle ) ; + if ( *l == *u ) return lcp ; + for ( cp = haystack ; ; ++cp ) { + cp = strstr ( cp , u ) ; + if ( cp == NULL ) break ; + if ( !strnicmp ( cp , needle , nsl ) ) { + if ( lcp == NULL ) return cp ; + if ( cp < lcp ) return cp ; + return lcp ; + } + } + return lcp ; +} +#endif +#endif + + + +// +// PbCopyFile +// +// returns 1 if successful, 0 if failed +// +inline int PbCopyFile ( char *sfn , char *tfn , int sizeLimit = 0 ) +{ + FILE *fs = fopen ( sfn , "rb" ) ; + int success = 0 ; + if ( fs != NULL ) { + FILE *ft = fopen ( tfn , "wb" ) ; + if ( ft != NULL ) { + fseek ( fs , 0 , SEEK_END ) ; + int siz = ftell ( fs ) ; + if ( siz > 0 ) { + if ( sizeLimit == 0 || siz < sizeLimit ) { + char *buf = new char [ siz ] ; + if ( buf != NULL ) { + fseek ( fs , 0 , SEEK_SET ) ; + int rb = fread ( buf , 1 , siz , fs ) ; + int wb = fwrite ( buf , 1 , rb , ft ) ; + delete buf ; + if ( wb == siz ) success = 1 ; + } + } + } + fclose ( ft ) ; + } + fclose ( fs ) ; + } + return success ; +} + + + +// +// setRW +// +inline void setRW ( char *fn ) +{ +#ifdef __PBWIN32__ + _chmod ( fn , _S_IREAD | _S_IWRITE ) ; +#endif +#ifdef __PBLINUX__ + chmod ( fn , S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH ) ; +#endif +#ifdef __PBMAC__ + +#endif +} + + +#ifndef __PBDLL__ +// +// TCHARchar +// +// provided to convert from unicode and other wide-byte strings to standard zero-delimted ascii char string arrays used by PB +// +#if defined(LINUX) +#undef TCHAR +inline char * TCHARchar(const unsigned short *t, char *cs, int maxlenminus1) +{ + memset ( cs , 0 , maxlenminus1 + 1 ) ; + int i ; + for ( i = 0 ; t[i] && i < maxlenminus1 ; i++ ) + cs[i] = (char) t[i] ; + return cs ; +} +#define TCHAR wchar_t; +#else +inline char * TCHARchar(const TCHAR *t, char *cs, int maxlenminus1) +{ + memset ( cs , 0 , maxlenminus1 + 1 ) ; + int i ; + for ( i = 0 ; t[i] && i < maxlenminus1 ; i++ ) + cs[i] = (char) t[i] ; + return cs ; +} +#endif +#endif + + + +// +// dbLog +// +inline void dbLog ( char *fn , char *fmtstr , ... ) +{ + FILE *f = fopen ( fn , "abc" ) ; + if ( f == NULL ) return ; + + char buf[4150] ; + va_list va ; + + va_start ( va , fmtstr ) ; + if ( strlen ( fmtstr ) > 2048 ) { + strncpy ( buf , fmtstr , 4096 ) ; + buf[4096] = 0 ; + } else vsprintf ( buf , fmtstr , va ) ; + + fprintf ( f , "%s\r\n" , buf ) ; + fflush ( f ) ; + fclose ( f ) ; +} + + + +#endif //#ifndef __PBCOMMON__ +#endif //#ifdef __WITH_PB__ +#endif // NOT_USE_PUNKBUSTER_SDK \ No newline at end of file diff --git a/PunkBuster/pbmd5.cpp b/PunkBuster/pbmd5.cpp new file mode 100644 index 0000000..485346b --- /dev/null +++ b/PunkBuster/pbmd5.cpp @@ -0,0 +1,257 @@ +// PunkBuster Implementation of MD5 by RSA Data Security, Inc. +// + +// +// md5.cpp +// +// style modified by Tony Ray, January 2001 +// added support for randomizing initialization constants in MD5Init() + +/* + ********************************************************************** + ** md5.c ** + ** RSA Data Security, Inc. MD5 Message Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 1/91 SRD,AJ,BSK,JT Reference C Version ** + ********************************************************************** + */ + +/* + ********************************************************************** + ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** + ** ** + ** License to copy and use this software is granted provided that ** + ** it is identified as the "RSA Data Security, Inc. MD5 Message ** + ** Digest Algorithm" in all material mentioning or referencing this ** + ** software or this function. ** + ** ** + ** License is also granted to make and use derivative works ** + ** provided that such works are identified as "derived from the RSA ** + ** Data Security, Inc. MD5 Message Digest Algorithm" in all ** + ** material mentioning or referencing the derived work. ** + ** ** + ** RSA Data Security, Inc. makes no representations concerning ** + ** either the merchantability of this software or the suitability ** + ** of this software for any particular purpose. It is provided "as ** + ** is" without express or implied warranty of any kind. ** + ** ** + ** These notices must be retained in any copies of any part of this ** + ** documentation and/or software. ** + ********************************************************************** + */ + +#include "pbmd5.h" + +#if !defined(NOT_USE_PUNKBUSTER_SDK) + +static unsigned char PADDING[64] = { + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +/* F, G and H are basic MD5 functions: selection, majority, parity */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | (~z))) + +/* ROTATE_LEFT rotates x left n bits */ +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + +/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */ +/* Rotation is separate from addition to prevent recomputation */ + +#define FF(a, b, c, d, x, s, ac) {(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); } +#define GG(a, b, c, d, x, s, ac) {(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); } +#define HH(a, b, c, d, x, s, ac) {(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); } +#define II(a, b, c, d, x, s, ac) {(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); (a) = ROTATE_LEFT ((a), (s)); (a) += (b); } + + +/* Basic MD5 step. Transform buf based on in. + */ +static void Transform (UINT4 *buf, UINT4 *in) +{ + UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; + + /* Round 1 */ +#define S11 7 +#define S12 12 +#define S13 17 +#define S14 22 + FF ( a, b, c, d, in[ 0], S11, (UINT4) 3614090360u); /* 1 */ + FF ( d, a, b, c, in[ 1], S12, (UINT4) 3905402710u); /* 2 */ + FF ( c, d, a, b, in[ 2], S13, (UINT4) 606105819u); /* 3 */ + FF ( b, c, d, a, in[ 3], S14, (UINT4) 3250441966u); /* 4 */ + FF ( a, b, c, d, in[ 4], S11, (UINT4) 4118548399u); /* 5 */ + FF ( d, a, b, c, in[ 5], S12, (UINT4) 1200080426u); /* 6 */ + FF ( c, d, a, b, in[ 6], S13, (UINT4) 2821735955u); /* 7 */ + FF ( b, c, d, a, in[ 7], S14, (UINT4) 4249261313u); /* 8 */ + FF ( a, b, c, d, in[ 8], S11, (UINT4) 1770035416u); /* 9 */ + FF ( d, a, b, c, in[ 9], S12, (UINT4) 2336552879u); /* 10 */ + FF ( c, d, a, b, in[10], S13, (UINT4) 4294925233u); /* 11 */ + FF ( b, c, d, a, in[11], S14, (UINT4) 2304563134u); /* 12 */ + FF ( a, b, c, d, in[12], S11, (UINT4) 1804603682u); /* 13 */ + FF ( d, a, b, c, in[13], S12, (UINT4) 4254626195u); /* 14 */ + FF ( c, d, a, b, in[14], S13, (UINT4) 2792965006u); /* 15 */ + FF ( b, c, d, a, in[15], S14, (UINT4) 1236535329u); /* 16 */ + + /* Round 2 */ +#define S21 5 +#define S22 9 +#define S23 14 +#define S24 20 + GG ( a, b, c, d, in[ 1], S21, (UINT4) 4129170786u); /* 17 */ + GG ( d, a, b, c, in[ 6], S22, (UINT4) 3225465664u); /* 18 */ + GG ( c, d, a, b, in[11], S23, (UINT4) 643717713u); /* 19 */ + GG ( b, c, d, a, in[ 0], S24, (UINT4) 3921069994u); /* 20 */ + GG ( a, b, c, d, in[ 5], S21, (UINT4) 3593408605u); /* 21 */ + GG ( d, a, b, c, in[10], S22, (UINT4) 38016083u); /* 22 */ + GG ( c, d, a, b, in[15], S23, (UINT4) 3634488961u); /* 23 */ + GG ( b, c, d, a, in[ 4], S24, (UINT4) 3889429448u); /* 24 */ + GG ( a, b, c, d, in[ 9], S21, (UINT4) 568446438u); /* 25 */ + GG ( d, a, b, c, in[14], S22, (UINT4) 3275163606u); /* 26 */ + GG ( c, d, a, b, in[ 3], S23, (UINT4) 4107603335u); /* 27 */ + GG ( b, c, d, a, in[ 8], S24, (UINT4) 1163531501u); /* 28 */ + GG ( a, b, c, d, in[13], S21, (UINT4) 2850285829u); /* 29 */ + GG ( d, a, b, c, in[ 2], S22, (UINT4) 4243563512u); /* 30 */ + GG ( c, d, a, b, in[ 7], S23, (UINT4) 1735328473u); /* 31 */ + GG ( b, c, d, a, in[12], S24, (UINT4) 2368359562u); /* 32 */ + + /* Round 3 */ +#define S31 4 +#define S32 11 +#define S33 16 +#define S34 23 + HH ( a, b, c, d, in[ 5], S31, (UINT4) 4294588738u); /* 33 */ + HH ( d, a, b, c, in[ 8], S32, (UINT4) 2272392833u); /* 34 */ + HH ( c, d, a, b, in[11], S33, (UINT4) 1839030562u); /* 35 */ + HH ( b, c, d, a, in[14], S34, (UINT4) 4259657740u); /* 36 */ + HH ( a, b, c, d, in[ 1], S31, (UINT4) 2763975236u); /* 37 */ + HH ( d, a, b, c, in[ 4], S32, (UINT4) 1272893353u); /* 38 */ + HH ( c, d, a, b, in[ 7], S33, (UINT4) 4139469664u); /* 39 */ + HH ( b, c, d, a, in[10], S34, (UINT4) 3200236656u); /* 40 */ + HH ( a, b, c, d, in[13], S31, (UINT4) 681279174u); /* 41 */ + HH ( d, a, b, c, in[ 0], S32, (UINT4) 3936430074u); /* 42 */ + HH ( c, d, a, b, in[ 3], S33, (UINT4) 3572445317u); /* 43 */ + HH ( b, c, d, a, in[ 6], S34, (UINT4) 76029189u); /* 44 */ + HH ( a, b, c, d, in[ 9], S31, (UINT4) 3654602809u); /* 45 */ + HH ( d, a, b, c, in[12], S32, (UINT4) 3873151461u); /* 46 */ + HH ( c, d, a, b, in[15], S33, (UINT4) 530742520u); /* 47 */ + HH ( b, c, d, a, in[ 2], S34, (UINT4) 3299628645u); /* 48 */ + + /* Round 4 */ +#define S41 6 +#define S42 10 +#define S43 15 +#define S44 21 + II ( a, b, c, d, in[ 0], S41, (UINT4) 4096336452u); /* 49 */ + II ( d, a, b, c, in[ 7], S42, (UINT4) 1126891415u); /* 50 */ + II ( c, d, a, b, in[14], S43, (UINT4) 2878612391u); /* 51 */ + II ( b, c, d, a, in[ 5], S44, (UINT4) 4237533241u); /* 52 */ + II ( a, b, c, d, in[12], S41, (UINT4) 1700485571u); /* 53 */ + II ( d, a, b, c, in[ 3], S42, (UINT4) 2399980690u); /* 54 */ + II ( c, d, a, b, in[10], S43, (UINT4) 4293915773u); /* 55 */ + II ( b, c, d, a, in[ 1], S44, (UINT4) 2240044497u); /* 56 */ + II ( a, b, c, d, in[ 8], S41, (UINT4) 1873313359u); /* 57 */ + II ( d, a, b, c, in[15], S42, (UINT4) 4264355552u); /* 58 */ + II ( c, d, a, b, in[ 6], S43, (UINT4) 2734768916u); /* 59 */ + II ( b, c, d, a, in[13], S44, (UINT4) 1309151649u); /* 60 */ + II ( a, b, c, d, in[ 4], S41, (UINT4) 4149444226u); /* 61 */ + II ( d, a, b, c, in[11], S42, (UINT4) 3174756917u); /* 62 */ + II ( c, d, a, b, in[ 2], S43, (UINT4) 718787259u); /* 63 */ + II ( b, c, d, a, in[ 9], S44, (UINT4) 3951481745u); /* 64 */ + + buf[0] += a; + buf[1] += b; + buf[2] += c; + buf[3] += d; +} + +void MD5Init (MD5_CTX *mdContext, unsigned int pseudoRandomNumber ) +{ + mdContext->i[0] = mdContext->i[1] = (UINT4)0; + + /* Load magic initialization constants. + */ + mdContext->buf[0] = (UINT4)0x67452301 + pseudoRandomNumber * 11 ; + mdContext->buf[1] = (UINT4)0xefcdab89 + pseudoRandomNumber * 71 ; + mdContext->buf[2] = (UINT4)0x98badcfe + pseudoRandomNumber * 37 ; + mdContext->buf[3] = (UINT4)0x10325476 + pseudoRandomNumber * 97 ; +} + +void MD5Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen) +{ + UINT4 in[16]; + int mdi; + unsigned int i, ii; + + /* compute number of bytes mod 64 */ + mdi = (int)((mdContext->i[0] >> 3) & 0x3F); + + /* update number of bits */ + if ((mdContext->i[0] + ((UINT4)inLen << 3)) < mdContext->i[0]) + mdContext->i[1]++; + mdContext->i[0] += ((UINT4)inLen << 3); + mdContext->i[1] += ((UINT4)inLen >> 29); + + while (inLen--) { + /* add new character to buffer, increment mdi */ + mdContext->in[mdi++] = *inBuf++; + + /* transform if necessary */ + if (mdi == 0x40) { + for (i = 0, ii = 0; i < 16; i++, ii += 4) + in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | + (((UINT4)mdContext->in[ii+2]) << 16) | + (((UINT4)mdContext->in[ii+1]) << 8) | + ((UINT4)mdContext->in[ii]); + Transform (mdContext->buf, in); + mdi = 0; + } + } +} + +void MD5Final (MD5_CTX *mdContext) +{ + UINT4 in[16]; + int mdi; + unsigned int i, ii; + unsigned int padLen; + + /* save number of bits */ + in[14] = mdContext->i[0]; + in[15] = mdContext->i[1]; + + /* compute number of bytes mod 64 */ + mdi = (int)((mdContext->i[0] >> 3) & 0x3F); + + /* pad out to 56 mod 64 */ + padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); + MD5Update (mdContext, PADDING, padLen); + + /* append length in bits and transform */ + for (i = 0, ii = 0; i < 14; i++, ii += 4) + in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | + (((UINT4)mdContext->in[ii+2]) << 16) | + (((UINT4)mdContext->in[ii+1]) << 8) | + ((UINT4)mdContext->in[ii]); + Transform (mdContext->buf, in); + + /* store buffer in digest */ + for (i = 0, ii = 0; i < 4; i++, ii += 4) { + mdContext->digest[ii] = (unsigned char)(mdContext->buf[i] & 0xFF); + mdContext->digest[ii+1] = + (unsigned char)((mdContext->buf[i] >> 8) & 0xFF); + mdContext->digest[ii+2] = + (unsigned char)((mdContext->buf[i] >> 16) & 0xFF); + mdContext->digest[ii+3] = + (unsigned char)((mdContext->buf[i] >> 24) & 0xFF); + } +} +#endif // NOT_USE_PUNKBUSTER_SDK \ No newline at end of file diff --git a/PunkBuster/pbmd5.h b/PunkBuster/pbmd5.h new file mode 100644 index 0000000..990a1ce --- /dev/null +++ b/PunkBuster/pbmd5.h @@ -0,0 +1,64 @@ +// +// md5.h +// +// style modified by Tony Ray, January 2001 +// added support for randomizing initialization constants in MD5Init() + +/* + ********************************************************************** + ** md5.h -- Header file for implementation of MD5 ** + ** RSA Data Security, Inc. MD5 Message Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** + ** Revised (for MD5): RLR 4/27/91 ** + ** -- G modified to have y&~z instead of y&z ** + ** -- FF, GG, HH modified to add in last register done ** + ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** + ** -- distinct additive constant for each step ** + ** -- round 4 added, working mod 7 ** + ********************************************************************** + */ + +/* + ********************************************************************** + ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** + ** ** + ** License to copy and use this software is granted provided that ** + ** it is identified as the "RSA Data Security, Inc. MD5 Message ** + ** Digest Algorithm" in all material mentioning or referencing this ** + ** software or this function. ** + ** ** + ** License is also granted to make and use derivative works ** + ** provided that such works are identified as "derived from the RSA ** + ** Data Security, Inc. MD5 Message Digest Algorithm" in all ** + ** material mentioning or referencing the derived work. ** + ** ** + ** RSA Data Security, Inc. makes no representations concerning ** + ** either the merchantability of this software or the suitability ** + ** of this software for any particular purpose. It is provided "as ** + ** is" without express or implied warranty of any kind. ** + ** ** + ** These notices must be retained in any copies of any part of this ** + ** documentation and/or software. ** + ********************************************************************** + */ + +#include + +#if !defined(NOT_USE_PUNKBUSTER_SDK) +/* typedef a 32 bit type */ +typedef unsigned int UINT4; + +/* Data structure for MD5 (Message Digest) computation */ +typedef struct { + UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ + UINT4 buf[4]; /* scratch buffer */ + unsigned char in[64]; /* input buffer */ + unsigned char digest[16]; /* actual digest after MD5Final call */ +} MD5_CTX; + +void MD5Init (MD5_CTX *mdContext, unsigned int pseudoRandomNumber = 0 ) ; +void MD5Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen) ; +void MD5Final (MD5_CTX *mdContext) ; + +#endif // NOT_USE_PUNKBUSTER_SDK \ No newline at end of file diff --git a/PunkBuster/pbsdk.cpp b/PunkBuster/pbsdk.cpp new file mode 100644 index 0000000..dc80fcb --- /dev/null +++ b/PunkBuster/pbsdk.cpp @@ -0,0 +1,517 @@ +// +// pbsdk.cpp +// +// PunkBuster / Game Integration SDK +// +// © Copyright 2003-2004 Even Balance, Inc. All Rights Reserved. +// +// This Software Development Kit (SDK) is proprietary and confidential. It may not be used, +// transferred, displayed or otherwise distributed in any manner except by express written +// consent of Even Balance, Inc. +// +// created MAR 27 2003 by T.Ray @ Even Balance +// last modified MAR 05 2004 by T.Ray @ Even Balance +// + + +#include "../CryNetwork/StdAfx.h" + +#if !defined(NOT_USE_PUNKBUSTER_SDK) +#include "../CryNetwork/PunkBusterInterface.h" + + + +#define DEFINE_PbSdk /* this define is used once in all game modules (usually where the main() function is defined) */ +#include "pbsdk.h" + + + +#ifdef __WITH_PB__ +// +// PBsdk_getBasePath +// +extern "C" char *PBsdk_getBasePath ( char *path , int maxlen ) +{ + if ( *path == 0 ) { //only populate if empty + getcwd ( path , maxlen ) ; + } + + return path ; +} +#endif + + + +#ifdef __WITH_PB__ +extern void PBgetHomePath ( char *path , int maxlen ) ; +// +// PBsdk_getHomePath +// +extern "C" char *PBsdk_getHomePath ( char *path , int maxlen ) +{ + if ( *path == 0 ) { //only populate if empty + PBgetHomePath ( path , maxlen ) ; + if ( *path == 0 ) getcwd ( path , maxlen ) ; + } + + return path ; +} +#endif + + +#ifdef __WITH_PB__ +// +// PBsdk_Out +// +void PBoutgame ( char *text , int hudAlso ) ;//defined in PunkBusterInterface.cpp +extern void Com_Printf( const char *msg, ... ) ; +void Com_Printf( const char *msg, ... ) { } +// +extern "C" void PBsdk_Out ( char *msg ) +{ + if ( pbsdk->pbinterface == NULL ) return ; + + char *cp = msg ; + int hudAlso = 1 ; + if ( !strnicmp ( msg , "[skipnotify]" , 12 ) ) { + hudAlso = 0 ; + cp += 12 ; + } + PBoutgame ( msg , hudAlso ) ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_SendUdpPacket +// +extern void Sys_PBSendUdpPacket ( char *addr , unsigned short port , int datalen , char *data , int isFromClient ) ; +// +extern "C" void PBsdk_SendUdpPacket ( char *addr , unsigned short port , int datalen , char *data , int isFromClient ) +{ + Sys_PBSendUdpPacket ( addr , port , datalen , data , isFromClient ) ; +} +#endif + + + +extern void PBsendPktToServer ( int datalen , char *data ) ; +extern int PBisLocalServer ( void ) ; +#ifdef __WITH_PB__ +// +// PBsdk_SendClPacket +// +extern "C" void PBsdk_SendClPacket ( int datalen , char *data ) +{ + if ( pbsdk == NULL ) return ; + if ( PBisLocalServer () ) { + int i ; + for ( i = 0 ; i < PB_MAX_CLIENTS ; i++ ) if ( !stricmp ( "localhost" , pbsdk->pbsv.m_client[i].pbc.ip ) ) break ; + if ( i < PB_MAX_CLIENTS ) PbSvAddEvent ( PB_EV_PACKET , i , datalen , data ) ; + } else { + PBsendPktToServer ( datalen , data ) ; + } +} +#endif + + + +extern void PBsendPktToClient ( int datalen , char *data , char *addr ) ; +/*SDK-sendsvpacket +*/ +#ifdef __WITH_PB__ +// +// PBsdk_SendSvPacket +// +extern "C" void PBsdk_SendSvPacket ( int datalen , char *data , int index ) +{ + if ( pbsdk == NULL ) return ; + char *addr = pbsdk->pbsv.m_client[index].pbc.ip ; + if ( *addr == 0 ) return ; + if ( !stricmp ( addr , "localhost" ) ) { + PbClAddEvent ( PB_EV_PACKET , datalen , data ) ; + } else { + PBsendPktToClient ( datalen , data , addr ) ; + } +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_CvarSet +// +extern void PBcvar_Set ( const char *cvar , const char *value ) ; //sample forward declaration +// +extern "C" void PBsdk_CvarSet ( const char *varName , const char *value ) +{ + PBcvar_Set ( varName , value ) ; //sample function call +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_SetClPunkBuster +// +extern "C" void PBsdk_SetClPunkBuster ( char *value ) +{ + PBsdk_CvarSet ( "cl_punkbuster" , value ) ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_SetSvPunkBuster +// +// +extern "C" void PBsdk_SetSvPunkBuster ( char *value ) +{ + PBsdk_CvarSet ( "sv_punkbuster" , value ) ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_ExecCmd +// +extern void PBcmd_execString ( const char *text ) ; //sample forward declaration +// +extern "C" void PBsdk_ExecCmd ( const char *cmd ) +{ + PBcmd_execString ( cmd ) ; //sample function call +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_CvarValidate +// +extern char *PbCvarValidate ( char *buf ) ; //sample forward declaration +char *PbCvarValidate ( char *buf ){*buf=0; return buf;} //empty function - remove +// +extern "C" char *PBsdk_CvarValidate ( char *buf ) +{ + return PbCvarValidate ( buf ) ; //sample function call +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_CvarWalk +// +extern int PBcvarWalk ( char **name , char **string , int *flags , char **resetString ) ; //sample forward declaration +// +extern "C" int PBsdk_CvarWalk ( char **name , char **string , int *flags , char **resetString ) +{ + return PBcvarWalk ( name , string , flags , resetString ) ; //sample function call +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_GetKeyName +// +extern int PBbindStuff ( int type , const char **data ) ; +char *Key_KeynumToString( int keynum ) {return "";} +// +extern "C" char *PBsdk_GetKeyName ( int keynum ) +{ + static const char *data ; + char buf[50] ; + itoa ( keynum , buf , 10 ) ; + data = buf ; + PBbindStuff ( 2 , &data ) ; + return (char *) data ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_GetKeyBinding +// +extern "C" char *PBsdk_GetKeyBinding ( int keynum ) +{ + static const char *data ; + char buf[50] ; + itoa ( keynum , buf , 10 ) ; + data = buf ; + PBbindStuff ( 3 , &data ) ; + return (char *) data ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_GetMaxKeys +// +int PbMaxKeys ( void ) {return 0;} +// +extern "C" int PBsdk_GetMaxKeys ( void ) +{ + return PBbindStuff ( 1 , NULL ) ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_GetServerAddr +// +char *PBserverIp ( int bClient = false ) ; +extern "C" char *PBsdk_GetServerAddr ( void ) +{ + return PBserverIp() ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_GetKeyValue +// +const char *PBkeyValue ( char *notused , char *key ) ; +extern "C" char *PBsdk_GetKeyValue ( char *s , char *k ) +{ + return (char *) PBkeyValue ( s , k ) ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_GetServerInfo +// +extern char *PB_Q_Serverinfo ( void ) ; +char *PB_Q_Serverinfo ( void ){ return "" ;} +// +extern "C" char *PBsdk_GetServerInfo ( void ) +{ + return PB_Q_Serverinfo() ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_GetCvarValue +// +extern char *PBcvar_VariableString( const char *var_name ) ; +extern char *PBgameVer ( void ) ; +extern char *PBserverHostname ( void ) ; +// +extern "C" char *PBsdk_GetCvarValue ( char *var_name ) +{ + //special cases + if ( !stricmp ( var_name , "version" ) ) return ( strcpy ( var_name , PBgameVer() ) ) ; + if ( !stricmp ( var_name , "name" ) ) { + char *cp = PBcvar_VariableString ( "p_name" ) ; + if ( *cp == 0 ) cp = "Jack Carver" ; + return cp ; + } + if ( !stricmp ( var_name , "sv_hostname" ) ) { + strcpy ( var_name , "sv_name" ) ; + char *cp = PBcvar_VariableString ( var_name ) ; + if ( *cp == 0 ) cp = PBserverHostname() ; + return cp ; + } + if ( !stricmp ( var_name , "server" ) ) return PBserverIp ( true ) ; + + //redirects + if ( !stricmp ( var_name , "mapname" ) ) strcpy ( var_name , "g_levelName" ) ; + + return PBcvar_VariableString ( var_name ) ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_GlQuery +// +extern char *PBqueryGL ( int type ) ; +extern "C" char *PBsdk_GlQuery ( int queryType ) +{ + return PBqueryGL ( queryType ) ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_DropClient +// +extern void PBdropClient ( int clientIndex , char *reason ) ; +// +extern "C" void PBsdk_DropClient ( int clientIndex , char *reason ) +{ + PBdropClient ( clientIndex , reason ) ; +} +#endif + + + +#ifdef __WITH_PB__ +extern int PBgetClientInfo ( stPb_Sv_Client *c ) ; +// +// PBsdk_GetClientInfo +// +extern "C" int PBsdk_GetClientInfo ( int svsIndex , stPb_Sv_Client *c ) +{ + memset ( c , 0 , sizeof ( *c ) ) ; //clear structure + if ( svsIndex < 0 || svsIndex >= PB_MAX_CLIENTS ) return 0 ; //return on invalid index + if ( *pbsdk->pbsv.m_client[svsIndex].pbc.ip ) { //player in this slot? + strcpy ( c->ip , pbsdk->pbsv.m_client[svsIndex].pbc.ip ) ; //populate ip/guid with prior values + strcpy ( c->guid , pbsdk->pbsv.m_client[svsIndex].pbc.guid ) ; + int gci = PBgetClientInfo ( c ) ; //populate name field + if ( gci ) { + strcpy ( pbsdk->pbsv.m_client[svsIndex].pbc.name , c->name ) ;//name can change so we update our internal array structure each frame + strcpy ( pbsdk->pbsv.m_client[svsIndex].pbc.guid , c->guid ) ;//guid is persistent and stored in pbc.guid + } else *c->ip = 0 ; //player not set up yet (i.e. GetSlotInfo returned false) + } + return 1 ; +} +#endif + + + +#ifdef __WITH_PB__ +// +// PBsdk_GetClientStats +// +extern int PBgetStats ( int svsIndex , char *Data ) ; +// +extern "C" int PBsdk_GetClientStats ( int index , char *data ) +{ + if ( index < 0 || index >= PB_MAX_CLIENTS ) return 0 ; //return on invalid index + if ( *pbsdk->pbsv.m_client[index].pbc.ip == 0 ) return 0 ; //no client at this index + return PBgetStats ( index , data ) ; +} +#endif + + + +// +// PbSvAddClient +// +//NOTE: This function adds the player to PB's internal array used to track reliable slot numbers +int PbSvAddClient ( char *addr , char *name , char *guid ) +{ + if ( pbsdk == NULL || *addr == 0 ) return 0 ; + + int i , j = -1 ; + for ( i = 0 ; i < PB_MAX_CLIENTS ; i++ ) { + if ( !stricmp ( addr , pbsdk->pbsv.m_client[i].pbc.ip ) ) { + char buf[1025] ; + sprintf ( buf , "ERROR: Game is reporting duplicate player IP:Port %s as new connection" , addr ) ; + PBoutgame ( buf , 1 ) ; + return 0 ; + } + if ( *pbsdk->pbsv.m_client[i].pbc.ip == 0 && j < 0 ) j = i ; + } + if ( j < 0 ) return 0 ;//all slots full + + strncpy ( pbsdk->pbsv.m_client[j].pbc.ip , addr , PB_NAMELEN ) ; + pbsdk->pbsv.m_client[j].pbc.ip[PB_NAMELEN] = 0 ; + strncpy ( pbsdk->pbsv.m_client[j].pbc.name , name , PB_NAMELEN ) ; + pbsdk->pbsv.m_client[j].pbc.name[PB_NAMELEN] = 0 ; + strncpy ( pbsdk->pbsv.m_client[j].pbc.guid , guid , PB_GUIDLEN ) ; + pbsdk->pbsv.m_client[j].pbc.guid[PB_GUIDLEN] = 0 ; + return j + 1 ;//return PB slot # (1 to max) +} + + + +// +// PbSvRemoveClient +// +//NOTE: This function removes the player from PB's internal array - see PBsdk_DropClient below for kicks +int PbSvRemoveClient ( char *addr ) +{ + if ( pbsdk == NULL ) return 0 ; + int i ; + for ( i = 0 ; i < PB_MAX_CLIENTS ; i++ ) { + if ( strcmp ( pbsdk->pbsv.m_client[i].pbc.ip , addr ) ) continue ; + memset ( &pbsdk->pbsv.m_client[i].pbc , 0 , sizeof ( pbsdk->pbsv.m_client[i].pbc ) ) ; + return i + 1 ;//return PB slot # (1 to max) + } + return 0 ;//return 0 means client pointer not found in array (should never happen) +} + + + +#ifdef __WITH_PB__ +// +// PBsdk_SetPointers +// +extern "C" void PBsdk_SetPointers ( void *pbinterface ) +{ + static int tries = 0 ; + + if ( pbsdk != NULL ) return ; //already accomplished + + if ( tries >= 3 ) return ; //after 3 tries, give up + + ++tries ; + + if ( pbinterface == NULL ) return ; + + pbsdk = &PbSdkInstance ; +// PBsdk_getPbSdkPointer ( "module_filename_goes_here" , 0 ) ;/*note use non-zero for Flag if desired*/ + + if ( pbsdk == NULL ) return ; //failed to get pointer to struct instance + + pbsdk->pbinterface = pbinterface ; + + //uncomment lines from the following section that are to be defined in "this" game module + pbsdk->m_CvarSet = PBsdk_CvarSet ; +// pbsdk->m_CvarValidate = PBsdk_CvarValidate ; + pbsdk->m_CvarWalk = PBsdk_CvarWalk ; + pbsdk->m_DropClient = PBsdk_DropClient ; + pbsdk->m_ExecCmd = PBsdk_ExecCmd ; + pbsdk->m_getBasePath = PBsdk_getBasePath ; + pbsdk->m_GetClientInfo = PBsdk_GetClientInfo ; + pbsdk->m_GetClientStats = PBsdk_GetClientStats ; + pbsdk->m_GetCvarValue = PBsdk_GetCvarValue ; + pbsdk->m_getHomePath = PBsdk_getHomePath ; + pbsdk->m_GetKeyBinding = PBsdk_GetKeyBinding ; + pbsdk->m_GetKeyName = PBsdk_GetKeyName ; + pbsdk->m_GetKeyValue = PBsdk_GetKeyValue ; +// pbsdk->m_GetMaxClients = PBsdk_GetMaxClients ; + pbsdk->m_GetMaxKeys = PBsdk_GetMaxKeys ; + pbsdk->m_GetServerAddr = PBsdk_GetServerAddr ; +// pbsdk->m_GetServerInfo = PBsdk_GetServerInfo ; + pbsdk->m_GlQuery = PBsdk_GlQuery ; + pbsdk->m_Out = PBsdk_Out ; + pbsdk->m_SendClPacket = PBsdk_SendClPacket ; + pbsdk->m_SendSvPacket = PBsdk_SendSvPacket ; + pbsdk->m_SendUdpPacket = PBsdk_SendUdpPacket ; + pbsdk->m_SetClPunkBuster = PBsdk_SetClPunkBuster ; + pbsdk->m_SetSvPunkBuster = PBsdk_SetSvPunkBuster ; +} +#endif +#endif // NOT_USE_PUNKBUSTER_SDK \ No newline at end of file diff --git a/PunkBuster/pbsdk.h b/PunkBuster/pbsdk.h new file mode 100644 index 0000000..eb45aab --- /dev/null +++ b/PunkBuster/pbsdk.h @@ -0,0 +1,271 @@ +// Copyright (C) 2001-2003 Even Balance, Inc. +// +// +// pbsdk.h +// +// EVEN BALANCE - T.RAY +// + + +#define _cplusplus +#include "pbcl.h" +#include "pbsv.h" + +#if !defined(NOT_USE_PUNKBUSTER_SDK) + +#ifdef __WITH_PB__ + +int PbSvAddClient ( char *addr , char *name , char *guid ) ; +int PbSvRemoveClient ( char *addr ) ; + + +// +// PB Integration Points - Typedefs +// +typedef char *(*PBtd_getBasePath) ( char *path , int maxlen ) ; +typedef char *(*PBtd_getHomePath) ( char *path , int maxlen ) ; +typedef void (*PBtd_CvarSet) ( const char *varName , const char *value ) ; +typedef void (*PBtd_SetClPunkBuster) ( char *value ) ; +typedef void (*PBtd_ExecCmd) ( const char *cmd ) ; +typedef void *(*PBtd_DllHandle) ( const char *modname ) ; +typedef char *(*PBtd_CvarValidate) ( char *buf ) ; +typedef int (*PBtd_CvarWalk) ( char **name , char **string , int *flags , char **resetString ) ; +typedef char *(*PBtd_GetKeyName) ( int keynum ) ; +typedef char *(*PBtd_GetKeyBinding) ( int keynum ) ; +typedef int (*PBtd_GetMaxKeys) ( void ) ; +typedef char *(*PBtd_GetServerAddr) ( void ) ; +typedef char *(*PBtd_GetKeyValue) ( char *s , char *k ) ; +typedef char *(*PBtd_GetServerInfo) ( void ) ; +typedef char *(*PBtd_GetCvarValue) ( char *var_name ) ; +typedef void (*PBtd_Out) ( char *msg ) ; +typedef void (*PBtd_SendClPacket) ( int datalen , char *data ) ; +typedef void (*PBtd_SendUdpPacket) ( char *addr , unsigned short port , int datalen , char *data , int isFromClient ) ; +typedef char *(*PBtd_GlQuery) ( int queryType ) ; +typedef void (*PBtd_SetSvPunkBuster) ( char *val ) ; +typedef void (*PBtd_DropClient) ( int clientIndex , char *reason ) ; +typedef int (*PBtd_GetMaxClients) ( void ) ; +typedef int (*PBtd_GetClientInfo) ( int index , stPb_Sv_Client *c ) ; +typedef int (*PBtd_GetClientStats) ( int index , char *data ) ; +typedef void (*PBtd_SendSvPacket) ( int datalen , char *data , int index ) ; + + + +#define CONST_PBSDKID 0xFF80FF1E +#define PBNULLFUNC "NULL Function Pointer" + + + +struct stPbSdk { + unsigned int PBSDKID ; + stPbCl pbcl ; + stPbSv pbsv ; + unsigned int flags ; + void *exeInstance ; + char *ConsoleCaptureBuf ; + int ConsoleCaptureBufLen ; + void *pbinterface ; + + PBtd_getBasePath m_getBasePath ; + PBtd_getHomePath m_getHomePath ; + PBtd_CvarSet m_CvarSet ; + PBtd_SetClPunkBuster m_SetClPunkBuster ; + PBtd_ExecCmd m_ExecCmd ; + PBtd_DllHandle m_DllHandle ; + PBtd_CvarValidate m_CvarValidate ; + PBtd_CvarWalk m_CvarWalk ; + PBtd_GetKeyName m_GetKeyName ; + PBtd_GetKeyBinding m_GetKeyBinding ; + PBtd_GetMaxKeys m_GetMaxKeys ; + PBtd_GetServerAddr m_GetServerAddr ; + PBtd_GetKeyValue m_GetKeyValue ; + PBtd_GetServerInfo m_GetServerInfo ; + PBtd_GetCvarValue m_GetCvarValue ; + PBtd_Out m_Out ; + PBtd_SendClPacket m_SendClPacket ; + PBtd_SendUdpPacket m_SendUdpPacket ; + PBtd_GlQuery m_GlQuery ; + PBtd_SetSvPunkBuster m_SetSvPunkBuster ; + PBtd_DropClient m_DropClient ; + PBtd_GetMaxClients m_GetMaxClients ; + PBtd_GetClientInfo m_GetClientInfo ; + PBtd_GetClientStats m_GetClientStats ; + PBtd_SendSvPacket m_SendSvPacket ; + + char *pb_getBasePath ( char *path , int maxlen ) { + if ( m_getBasePath == NULL ) { + *path = 0 ; + return PBNULLFUNC ; + } + return m_getBasePath ( path , maxlen ) ; + } + char *pb_getHomePath ( char *path , int maxlen ) { + if ( m_getHomePath == NULL ) { + *path = 0 ; + return PBNULLFUNC ; + } + return m_getHomePath ( path , maxlen ) ; + } + void pb_CvarSet ( const char *varName , const char *value ) { + if ( m_CvarSet == NULL ) return ; + m_CvarSet ( varName , value ) ; + } + void pb_SetClPunkBuster ( char *value ) { + if ( m_SetClPunkBuster == NULL ) return ; + m_SetClPunkBuster ( value ) ; + } + void pb_ExecCmd ( const char *cmd ) { + if ( m_ExecCmd == NULL ) return ; + m_ExecCmd ( cmd ) ; + } + void *pb_DllHandle ( const char *modname ) { + if ( m_DllHandle == NULL ) return NULL ; + return m_DllHandle ( modname ) ; + } + char *pb_CvarValidate ( char *buf ) { + if ( m_CvarValidate == NULL ) { + *buf = 0 ; + return buf ; + } + return m_CvarValidate ( buf ) ; + } + int pb_CvarWalk ( char **name , char **string , int *flags , char **resetString ) { + if ( m_CvarWalk == NULL ) return 0 ; + return m_CvarWalk ( name , string , flags , resetString ) ; + } + char *pb_GetKeyName ( int keynum ) { + if ( m_GetKeyName == NULL ) return "" ; + return m_GetKeyName ( keynum ) ; + } + char *pb_GetKeyBinding ( int keynum ) { + if ( m_GetKeyBinding == NULL ) return "" ; + return m_GetKeyBinding ( keynum ) ; + } + int pb_GetMaxKeys ( void ) { + if ( m_GetMaxKeys == NULL ) return 0 ; + return m_GetMaxKeys() ; + } + char *pb_GetServerAddr ( void ) { + if ( m_GetServerAddr == NULL ) return "" ; + return m_GetServerAddr() ; + } + char *pb_GetKeyValue ( char *s , char *k ) { + if ( m_GetKeyValue == NULL ) return "" ; + return m_GetKeyValue ( s , k ) ; + } + char *pb_GetServerInfo ( void ) { + if ( m_GetServerInfo == NULL ) return "" ; + return m_GetServerInfo() ; + } + char *pb_GetCvarValue ( char *var_name ) { + if ( m_GetCvarValue == NULL ) return "" ; + return m_GetCvarValue ( var_name ) ; + } + void pb_Outf ( char *msg , ... ) { + if ( m_Out == NULL ) return ; + + char buf[4150] ; + va_list va ; + va_start ( va , msg ) ; + if ( strlen ( msg ) > 2048 ) { + strncpy ( buf , msg , 4096 ) ; + buf[4096] = 0 ; + } else _vsnprintf ( buf , 4096 , msg , va ) ; + m_Out ( buf ) ; + } + void pb_SendClPacket ( int datalen , char *data ) { + if ( m_SendClPacket == NULL ) return ; + m_SendClPacket ( datalen , data ) ; + } + void pb_SendUdpPacket ( char *addr , unsigned short port , int datalen , char *data , int isFromClient ) { + if ( m_SendUdpPacket == NULL ) return ; + m_SendUdpPacket ( addr , port , datalen , data , isFromClient ) ; + } + char *pb_GlQuery ( int queryType ) { + if ( m_GlQuery == NULL ) return NULL ; + return m_GlQuery ( queryType ) ; + } + void pb_SetSvPunkBuster ( char *val ) { + if ( m_SetSvPunkBuster == NULL ) return ; + m_SetSvPunkBuster ( val ) ; + } + void pb_DropClient ( int clientIndex , char *reason ) { + if ( m_DropClient == NULL ) return ; + m_DropClient ( clientIndex , reason ) ; + } + int pb_GetMaxClients ( void ) { + if ( m_GetMaxClients == NULL ) return 0 ; + return m_GetMaxClients() ; + } + int pb_GetClientInfo ( int index , stPb_Sv_Client *c ) { + if ( m_GetClientInfo == NULL ) return 0 ; + return m_GetClientInfo ( index , c ) ; + } + int pb_GetClientStats ( int index , char *data ) { + if ( m_GetClientStats == NULL ) return 0 ; + return m_GetClientStats ( index , data ) ; + } + void pb_SendSvPacket ( int datalen , char *data , int index ) { + if ( m_SendSvPacket == NULL ) return ; + m_SendSvPacket ( datalen , data , index ) ; + } + + //constructor + stPbSdk() { + memset ( this , 0 , sizeof ( stPbSdk ) ) ; + PBSDKID = CONST_PBSDKID ; + pbsv.init() ; + pbcl.init() ; + pbcl.m_GlQuery = m_GlQuery ; + } +} ; + + + +extern stPbSdk *pbsdk ; + + + +//One game source module should "#define DEFINE_PbSdk" before including this file so that only one +// instance of the following struct and function are each defined in the game project. +//Usually, the source module containing the main() or WinMain() function will serve in that role. +#ifdef DEFINE_PbSdk + +//single instance of stPbSdk +stPbSdk PbSdkInstance ; +stPbSdk *pbsdk = NULL ;//&PbSdkInstance ; +#define PbSdk_DEFINED + +#if(0)//todotr +/*SDK-pbexport + +This function is provided for games that need PB integration code inside multiple game components (i.e. EXE and/or DLLs) + + It should be removed if not needed. + +*/ +// +// pb_Export +// +extern "C" +#ifdef __PBWIN32__ +__declspec(dllexport) +#endif +char *pb_Export ( void ) +{ + return (char *) pbsdk ; +} +#endif //#ifdef DEFINE_PbSdk +#endif + + +//source modules other than the 'main' one (see above) will have one instance of a pointer to the stPbSdk struct +//this pointer will be populated by a call to PBsdk_getPbSdkPointer() (see below) +#ifndef PbSdk_DEFINED +#define PbSdk_DEFINED +stPbSdk *pbsdk = NULL ; +#endif + + + +#endif //#ifdef __WITH_PB__ +#endif // NOT_USE_PUNKBUSTER_SDK \ No newline at end of file diff --git a/PunkBuster/pbsv.cpp b/PunkBuster/pbsv.cpp new file mode 100644 index 0000000..12e3042 --- /dev/null +++ b/PunkBuster/pbsv.cpp @@ -0,0 +1,225 @@ +// Copyright (C) 2001-2003 Even Balance, Inc. +// +// +// pbsv.cpp +// +// EVEN BALANCE - T.RAY +// + + +#define _cplusplus + + + +#define PbSdk_DEFINED +#include "pbsdk.h" + +#if !defined(NOT_USE_PUNKBUSTER_SDK) + +#ifdef __WITH_PB__ + + + +// +// Functions and wrappers +// these are declared in pbcommon.h + +extern "C" { + +void __cdecl PbSvAddEvent ( int event , int clientIndex , int datalen , char *data ) +{ + if ( pbsdk == NULL ) return ; + pbsdk->pbsv.AddPbEvent ( event , clientIndex , datalen , data , 0 ) ; +} + +void __cdecl PbServerInitialize ( void ) +{ + if ( pbsdk == NULL ) return ; + pbsdk->pbsv.initialize() ; + + pbsdk->pb_getBasePath ( pbsdk->pbsv.m_basepath , PB_Q_MAXRESULTLEN ) ; + pbsdk->pb_getHomePath ( pbsdk->pbsv.m_homepath , PB_Q_MAXRESULTLEN ) ; + + PbSvAddEvent ( PB_EV_CONFIG , -1 , 0 , "" ) ; + if ( pbsdk->pbsv.m_AddPbEvent == NULL ) pbsdk->pb_SetSvPunkBuster ( "0" ) ; +} + +void __cdecl PbServerProcessEvents ( void ) +{ + if ( !isPBmultiplayerMode() ) return ; + pbsdk->pbsv.ProcessPbEvents() ; +} + +void __cdecl PbServerForceProcess ( void ) +{ + if ( !isPBmultiplayerMode() ) return ; + pbsdk->pbsv.ProcessPbEvents ( -1 ) ; +} + +void __cdecl PbServerCompleteCommand ( char *buf , int buflen ) +{ + if ( !isPBmultiplayerMode() ) return ; + pbsdk->pbsv.AddPbEvent ( PB_EV_CMDCOMPL , -1 , buflen , buf ) ; +} + +void __cdecl PbPassConnectString ( char *fromAddr , char *connectString ) +{ + if ( !isPBmultiplayerMode() ) return ; + if ( pbsdk->pbsv.m_PassConnectString == NULL ) return ;//means PB not installed/enabled + pbsdk->pbsv.m_PassConnectString ( &pbsdk->pbsv , fromAddr , connectString ) ; +} + +char * __cdecl PbAuthClient ( char *fromAddr , int cl_pb , char *cl_guid ) +{ + if ( !isPBmultiplayerMode() ) return NULL ; + if ( pbsdk->pbsv.m_AuthClient == NULL ) return NULL ;//means PB not installed/enabled + return pbsdk->pbsv.m_AuthClient ( &pbsdk->pbsv , fromAddr , cl_pb , cl_guid ) ; +} + +int __cdecl isPbSvEnabled ( void ) +{ + if ( !isPBmultiplayerMode() ) return 0 ; + return (int) pbsdk->pbsv.AddPbEvent ( PB_EV_ISENABLED , -1 , 0 , NULL ) ; +} + +void __cdecl EnablePbSv ( void ) +{ + if ( !isPBmultiplayerMode() ) return ; + pbsdk->pbsv.AddPbEvent ( PB_EV_ENABLE , -1 , 0 , NULL ) ; +} + +void __cdecl DisablePbSv ( void ) +{ + if ( !isPBmultiplayerMode() ) return ; + pbsdk->pbsv.AddPbEvent ( PB_EV_DISABLE , -1 , 0 , NULL ) ; +} + +} //extern "C" + +extern void __cdecl PbClientTrapConsole ( char *msg , int msglen ) ;//in pbcl.cpp +void __cdecl PbCaptureConsoleOutput ( char *msg , int msglen ) +{ + if ( !isPBmultiplayerMode() ) return ; + + if ( pbsdk->pbcl.m_ReloadClient == 0 ) PbClientTrapConsole ( msg , msglen ) ; + + if ( pbsdk->pbsv.m_ReloadServer == 0 ) if ( pbsdk->pbsv.m_TrapConsole != NULL ) pbsdk->pbsv.m_TrapConsole ( &pbsdk->pbsv , msg , msglen ) ; + + if ( *msg == '/' || *msg == '\\' ) ++msg , --msglen ; + if ( !strnicmp ( msg , "pb_" , 3 ) ) { + if ( !strnicmp ( msg + 3 , "sv_" , 3 ) ) { + if ( pbsdk->pbsv.m_TrapConsole != NULL ) PbSvAddEvent ( PB_EV_CMD , -1 , msglen , msg ) ; + } else { + if ( pbsdk->pbcl.m_ReloadClient == 0 ) PbClAddEvent ( PB_EV_CMD , msglen , msg ) ; + } + } + + if ( pbsdk->ConsoleCaptureBuf == NULL ) return ; + int sl = strlen ( pbsdk->ConsoleCaptureBuf ) ; + if ( sl + (int) strlen ( msg ) + 1 >= pbsdk->ConsoleCaptureBufLen ) return ; + strcpy ( pbsdk->ConsoleCaptureBuf + sl , msg ) ; + strcat ( pbsdk->ConsoleCaptureBuf , "\n" ) ; +} + + +// +// PbSvGameCommand +// +extern void PBpakNames ( char *buf ) ; +char * __cdecl PbSvGameCommand ( char *Cmd , char *Result ) +{ + if ( !isPBmultiplayerMode() ) return NULL ; + if ( !stricmp ( Cmd , "set_sv_punkbuster" ) ) pbsdk->pb_SetSvPunkBuster ( Result ) ; + else if ( !stricmp ( Cmd , "pakNames" ) ) PBpakNames ( Result ) ;//note: Result must be 1025+ bytes for this one + else if ( !stricmp ( Cmd , "ConCapBufLen" ) ) pbsdk->ConsoleCaptureBufLen = (int) Result ; + else if ( !stricmp ( Cmd , "ConCapBuf" ) ) pbsdk->ConsoleCaptureBuf = Result ; + else if ( !stricmp ( Cmd , "Cmd_Exec" ) ) { + int pb = !strnicmp ( Result , "pb_" , 3 ) ; + pbsdk->pb_ExecCmd ( Result ) ; + if ( pb ) PbServerForceProcess() ; + } else { + char *arg1 = Result ; + while ( *arg1 == ' ' ) ++arg1 ; + while ( *arg1 && *arg1 != ' ' ) ++arg1 ; + char *endResult = arg1 ; + while ( *arg1 == ' ' ) ++arg1 ; + + if ( !stricmp ( Cmd , "DropClient" ) ) pbsdk->pb_DropClient ( atoi ( Result ) , arg1 ) ; + else if ( !stricmp ( Cmd , "Cvar_Set" ) ) { + char hold = *endResult ; + *endResult = 0 ; + pbsdk->pb_CvarSet ( Result , arg1 ) ; + *endResult = hold ; + } + } + + return NULL ; +} + + + +// +// PbSvGameQuery +// +// assumes Data buffer is appropriately size/allocated for Qtype call +char * __cdecl PbSvGameQuery ( int Qtype , char *Data ) +{ + Data[PB_Q_MAXRESULTLEN] = 0 ; + + int i ; + switch ( Qtype ) { + case PB_Q_MAXCLIENTS: itoa ( PB_MAX_CLIENTS , Data , 10 ) ; break ; + case PB_Q_CLIENT: + i = atoi ( Data ) ; + if ( !pbsdk->pb_GetClientInfo ( i , (stPb_Sv_Client *) Data ) ) return PbsQueryFail ; + break ; + case PB_Q_CVAR: strncpy ( Data , pbsdk->pb_GetCvarValue ( Data ) , PB_Q_MAXRESULTLEN ) ; break ; + case PB_Q_STATS: + i = atoi ( Data ) ; + if ( !pbsdk->pb_GetClientStats ( i , Data ) ) return PbsQueryFail ; + break ; + } + return NULL ; +} + + + +// +// PbSvGameMsg +// +char * __cdecl PbSvGameMsg ( char *Msg , int Type ) +{ + if ( !isPBmultiplayerMode() ) return NULL ; + + Type;//reserved + pbsdk->pb_Outf ( "%s: %s\n" , pbsdk->pbsv.m_msgPrefix , Msg ) ; + return NULL ; +} + + + +// +// PbSvSendToClient +// +char * __cdecl PbSvSendToClient ( int DataLen , char *Data , int clientIndex ) +{ + pbsdk->pb_SendSvPacket ( DataLen , Data , clientIndex ) ; + return NULL ; +} + + + +// +// PbSvSendToAddrPort +// +char * __cdecl PbSvSendToAddrPort ( char *addr , unsigned short port , int DataLen , char *Data ) +{ + pbsdk->pb_SendUdpPacket ( addr , port , DataLen , Data , 0 ) ; //convert bits to bytes + return NULL ; +} + + + + +#endif //#ifdef __WITHPB__ +#endif // NOT_USE_PUNKBUSTER_SDK \ No newline at end of file diff --git a/PunkBuster/pbsv.h b/PunkBuster/pbsv.h new file mode 100644 index 0000000..bfd6437 --- /dev/null +++ b/PunkBuster/pbsv.h @@ -0,0 +1,444 @@ +// Copyright (C) 2001-2003 Even Balance, Inc. +// +// +// pbsv.h +// +// EVEN BALANCE - T.RAY +// +// The only file in the game project that needs to include this file is pbsv.cpp +// + + + +#ifndef __PBSV_H__ +#define __PBSV_H__ + + + +#include +#include +#include +#include "pbcommon.h" + +#if !defined(NOT_USE_PUNKBUSTER_SDK) + +#ifdef __PBWIN32__ +#include +#endif +#ifdef __PBLINUX__ +#include +#include +#include +#include +#endif +#ifdef __PBMAC__ +#include "../macosx/dlfcn.h" +#endif + + + +#ifdef __WITH_PB__ + + + +#ifdef _cplusplus + + + +#if !defined(_WIN32) && !defined(__TRMACH__) +#define _cdecl +#define stricmp strcasecmp +#define strnicmp strncasecmp +#ifndef __TRLTOA__ +#define __TRLTOA__ +// +// ltoa +// +// assumes buffer a is large enough to hold ascii representation of i +// +inline char *ltoa ( int i , char *a , int radix ) +{ + if ( a == NULL ) return NULL ; + strcpy ( a , "0" ) ; + if ( i && radix > 1 && radix < 37 ) { + char buf[35] ; + unsigned int u = i , p = 34 ; + buf[p] = 0 ; + if ( i < 0 && radix == 10 ) u = -i ; + while ( u ) { + unsigned int d = u % radix ; + buf[--p] = d < 10 ? '0' + d : 'a' + d - 10 ; + u /= radix ; + } + if ( i < 0 && radix == 10 ) buf[--p] = '-' ; + strcpy ( a , buf + p ) ; + } + return a ; +} +#define itoa ltoa +#endif +#endif //#ifndef _WIN32 + + + +#ifndef __PBDLL__ +extern char *sa ( void *cp , int ticklimit ) ; +extern char *sb ( void *cp , int event , int clientIndex , int datalen , char *data , int retry ) ; +#endif + +#define PB_MAX_CLIENTS 64 + +// +// Class/Struct Definitions +// +struct stPbSvClSlot { + stPb_Sv_Client pbc ; +} ; + +struct stPbSv { + unsigned int m_svId ; + void *m_Md5 ; + void *m_SvInstance , *m_ClInstance , *m_AgInstance ; + char m_msgPrefix[PB_MISCLEN+1] , m_basepath[PB_Q_MAXRESULTLEN+4] , m_homepath[PB_Q_MAXRESULTLEN+4] , m_cwd[PB_Q_MAXRESULTLEN+4] ; + int m_ReloadServer ; + + //func ptrs + tdPbGameCommand m_GameCommand ;//game + tdPbGameQuery m_GameQuery ;//game + tdPbGameMsg m_GameMsg ;//game + tdPbSendToClient m_SendToClient ;//game + tdPbAddSvEvent m_AddPbEvent ;//dll + tdPbProcessPbEvents m_ProcessPbEvents ;//dll + tdPbSendToAddrPort m_SendToAddrPort ;//game + tdPbPassConnectString m_PassConnectString ;//dll + tdPbAuthClient m_AuthClient ;//dll + tdPbTrapConsole m_TrapConsole ;//dll + + void *m_Agent ; + + stPbSvClSlot m_client[PB_MAX_CLIENTS] ; + + inline void copyIfNotExists ( char *fn , char *basepath ) { + char fromFn[PB_Q_MAXRESULTLEN*2+1] , toFn[PB_Q_MAXRESULTLEN*2+1] ; + strcpy ( toFn , m_cwd ) ; + strcat ( toFn , fn ) ; + FILE *f = fopen ( toFn , "rb" ) ; + if ( f != NULL ) fclose ( f ) ; + else { + strcpy ( fromFn , basepath ) ; + strcat ( fromFn , fn ) ; + PbCopyFile ( fromFn , toFn ) ; + } + } + + inline char *getBasePath ( char *path ) { + strncpy ( path , m_basepath , PB_Q_MAXRESULTLEN ) ; + path[PB_Q_MAXRESULTLEN] = 0 ; + if ( !(*path) ) getcwd ( path , PB_Q_MAXRESULTLEN - 4 ) ; + if ( *path && path[strlen(path)-1] != *pbDIRSEP ) strcat ( path , pbDIRSEP ) ; + strcat ( path , "pb" pbDIRSEP ) ; + return path ; + } + + inline char *getHomePath ( void ) { + strncpy ( m_cwd , m_homepath , PB_Q_MAXRESULTLEN ) ; + m_cwd[PB_Q_MAXRESULTLEN] = 0 ; + if ( !(*m_cwd) ) getcwd ( m_cwd , PB_Q_MAXRESULTLEN - 4 ) ; + if ( *m_cwd && m_cwd[strlen(m_cwd)-1] != *pbDIRSEP ) strcat ( m_cwd , pbDIRSEP ) ; + strcat ( m_cwd , "pb" pbDIRSEP ) ; + return m_cwd ; + } + + inline char *makefn ( char *buf , char *fn ) { //assumes buf is large enough to hold cwd + fn + overhead + if ( !(*m_cwd) ) { + getHomePath() ; + + char basepath[PB_Q_MAXRESULTLEN+4] ; + getBasePath ( basepath ) ; + if ( stricmp ( basepath , m_cwd ) && *basepath && *m_cwd ) { +#ifdef __PBWIN32__ + mkdir ( m_cwd ) ; +#endif +#ifdef __PBLINUX__ + mkdir ( m_cwd , 511 ) ; +#endif +#ifdef __PBMAC__ + if ( m_cwd[strlen(m_cwd)-1] == *pbDIRSEP ) m_cwd[strlen(m_cwd)-1] = 0 ; + mkdir ( m_cwd , 511 ) ; + strcat ( m_cwd , pbDIRSEP ) ; +#endif + copyIfNotExists ( "pbsv" pbDLLEXT , basepath ) ; + copyIfNotExists ( "pbcl" pbDLLEXT , basepath ) ; + copyIfNotExists ( "pbag" pbDLLEXT , basepath ) ; + } + } + strcpy ( buf , m_cwd ) ; + strcat ( buf , fn ) ; + return buf ; + } + + inline void UnloadClientDll ( void ) { +#ifdef __PBWIN32__ + if ( m_ClInstance != NULL ) FreeLibrary ( (HMODULE) m_ClInstance ) ; +#endif +#ifdef __PBLINUX__ + if ( m_ClInstance != NULL ) dlclose ( m_ClInstance ) ; +#endif +#ifdef __PBMAC__ + if ( m_ClInstance != NULL ) dlclose ( m_ClInstance ) ; +#endif + m_ClInstance = NULL ; + } + + inline char *LoadClientDll ( void ) { + if ( m_ClInstance != NULL ) return NULL ; + UnloadClientDll() ; + + //check for replacement (updated) dll files and rename if necessary + + char fn[PB_Q_MAXRESULTLEN*2+1] , extrafn[PB_Q_MAXRESULTLEN*2+1] ; + + FILE *f = fopen ( makefn ( fn , "pbclsnew" pbDLLEXT ) , "rb" ) ; + if ( f != NULL ) { + fclose ( f ) ; + setRW ( makefn ( fn , "pbclsold" pbDLLEXT ) ) ; + remove ( makefn ( fn , "pbclsold" pbDLLEXT ) ) ; + rename ( makefn ( fn , "pbcls" pbDLLEXT ) , makefn ( extrafn , "pbclsold" pbDLLEXT ) ) ; + setRW ( makefn ( fn , "pbcls" pbDLLEXT ) ) ; + remove ( makefn ( fn , "pbcls" pbDLLEXT ) ) ; + rename ( makefn ( fn , "pbclsnew" pbDLLEXT ) , makefn ( extrafn , "pbcls" pbDLLEXT ) ) ; + } + makefn ( fn , "pbcls" pbDLLEXT ) ; +#ifdef __PBWIN32__ + m_ClInstance = LoadLibraryA ( fn ) ; +#endif +#ifdef __PBLINUX__ + m_ClInstance = ::dlopen ( fn , RTLD_LAZY ) ; +#endif +#ifdef __PBMAC__ + m_ClInstance = dlopen ( fn , RTLD_LAZY ) ; +#endif + if ( m_ClInstance != NULL ) return NULL ; + return PbsSvDllLoadFail ; + } + + inline void UnloadAgentDll ( void ) { + m_Agent = NULL ; +#ifdef __PBWIN32__ + if ( m_AgInstance != NULL ) FreeLibrary ( (HMODULE) m_AgInstance ) ; +#endif +#ifdef __PBLINUX__ + if ( m_AgInstance != NULL ) dlclose ( m_AgInstance ) ; +#endif +#ifdef __PBMAC__ + if ( m_AgInstance != NULL ) dlclose ( m_AgInstance ) ; +#endif + m_AgInstance = NULL ; + } + + inline char *LoadAgentDll ( void ) { + if ( m_AgInstance != NULL ) return NULL ; + UnloadAgentDll() ; + + //check for replacement (updated) dll files and rename if necessary + + char fn[PB_Q_MAXRESULTLEN*2+1] , extrafn[PB_Q_MAXRESULTLEN*2+1] ; + + FILE *f = fopen ( makefn ( fn , "pbagsnew" pbDLLEXT ) , "rb" ) ; + if ( f != NULL ) { + fclose ( f ) ; + setRW ( makefn ( fn , "pbagsold" pbDLLEXT ) ) ; + remove ( makefn ( fn , "pbagsold" pbDLLEXT ) ) ; + rename ( makefn ( fn , "pbags" pbDLLEXT ) , makefn ( extrafn , "pbagsold" pbDLLEXT ) ) ; + setRW ( makefn ( fn , "pbags" pbDLLEXT ) ) ; + remove ( makefn ( fn , "pbags" pbDLLEXT ) ) ; + rename ( makefn ( fn , "pbagsnew" pbDLLEXT ) , makefn ( extrafn , "pbags" pbDLLEXT ) ) ; + } + makefn ( fn , "pbags" pbDLLEXT ) ; +#ifdef __PBWIN32__ + m_AgInstance = LoadLibraryA ( fn ) ; + if ( m_AgInstance != NULL ) { + m_Agent = GetProcAddress ( (HMODULE) m_AgInstance , "a" ) ; + if ( m_Agent != NULL ) return NULL ; + UnloadAgentDll() ; + } +#endif +#ifdef __PBLINUX__ + m_AgInstance = ::dlopen ( fn , RTLD_LAZY ) ; + if ( m_AgInstance != NULL ) { + m_Agent = dlsym ( m_AgInstance , "a" ) ; + if ( m_Agent != NULL ) return NULL ; + UnloadAgentDll() ; + } +#endif +#ifdef __PBMAC__ + m_AgInstance = dlopen ( fn , RTLD_LAZY ) ; + if ( m_AgInstance != NULL ) { + m_Agent = dlsym ( m_AgInstance , "_a" ) ; + if ( m_Agent != NULL ) return NULL ; + UnloadAgentDll() ; + } +#endif + return PbsSvDllLoadFail ; + } + +#ifndef __PBDLL__ //the following functions are not needed by the PB DLLs + + inline void uninitialize ( void ) {//also initializes game-side func ptrs + m_GameCommand = NULL ; + m_GameQuery = NULL ; + m_GameMsg = NULL ; + m_SendToClient = NULL ; + m_SendToAddrPort = NULL ; + m_PassConnectString = NULL ; + m_AuthClient = NULL ; + m_TrapConsole = NULL ; + m_Md5 = NULL ; + } + + inline void initialize ( void ) { + uninitialize() ; + m_GameCommand = PbSvGameCommand ; + m_GameQuery = PbSvGameQuery ; + m_GameMsg = PbSvGameMsg ; + m_SendToClient = PbSvSendToClient ; + m_SendToAddrPort = PbSvSendToAddrPort ; + } + + inline void UnloadServerDll ( void ) { + m_ProcessPbEvents = NULL ; + m_AddPbEvent = NULL ; + + m_PassConnectString = NULL ; + m_AuthClient = NULL ; + m_TrapConsole = NULL ; + m_Md5 = NULL ; + +#ifdef __PBWIN32__ + if ( m_SvInstance != NULL ) FreeLibrary ( (HMODULE) m_SvInstance ) ; +#endif +#ifdef __PBLINUX__ + if ( m_SvInstance != NULL ) dlclose ( m_SvInstance ) ; +#endif +#ifdef __PBMAC__ + if ( m_SvInstance != NULL ) dlclose ( m_SvInstance ) ; +#endif + m_SvInstance = NULL ; + } + + inline char *LoadServerDll ( void ) { + if ( m_SvInstance != NULL ) return NULL ; + UnloadServerDll() ; + + char fn[PB_Q_MAXRESULTLEN*2+1] , extrafn[PB_Q_MAXRESULTLEN*2+1] ; + + //check for replacement (updated) dll file and rename if necessary + //load PB server dll and retrieve exported function pointers + FILE *f = fopen ( makefn ( fn , "pbsvnew" pbDLLEXT ) , "rb" ) ; + if ( f != NULL ) { + fclose ( f ) ; + setRW ( makefn ( fn , "pbsvold" pbDLLEXT ) ) ; + remove ( makefn ( fn , "pbsvold" pbDLLEXT ) ) ; + rename ( makefn ( fn , "pbsv" pbDLLEXT ) , makefn ( extrafn , "pbsvold" pbDLLEXT ) ) ; + setRW ( makefn ( fn , "pbsv" pbDLLEXT ) ) ; + remove ( makefn ( fn , "pbsv" pbDLLEXT ) ) ; + rename ( makefn ( fn , "pbsvnew" pbDLLEXT ) , makefn ( extrafn , "pbsv" pbDLLEXT ) ) ; + } +#ifdef __PBWIN32__ + m_SvInstance = LoadLibraryA ( makefn ( fn , "pbsv" pbDLLEXT ) ) ; + if ( m_SvInstance == NULL ) return PbsSvDllLoadFail ; + m_ProcessPbEvents = (tdPbProcessPbEvents) GetProcAddress ( (HINSTANCE) m_SvInstance , "sa" ) ; + m_AddPbEvent = (tdPbAddSvEvent) GetProcAddress ( (HINSTANCE) m_SvInstance , "sb" ) ; +#endif +#ifdef __PBLINUX__ + m_SvInstance = ::dlopen ( makefn ( fn , "pbsv" pbDLLEXT ) , RTLD_LAZY ) ; + if ( m_SvInstance == NULL ) return PbsSvDllLoadFail ; + m_ProcessPbEvents = (tdPbProcessPbEvents) dlsym ( m_SvInstance , "sa" ) ; + m_AddPbEvent = (tdPbAddSvEvent) dlsym ( m_SvInstance , "sb" ) ; +#endif +#ifdef __PBMAC__ + m_SvInstance = dlopen ( makefn ( fn , "pbsv" pbDLLEXT ) , RTLD_LAZY ) ; + if ( m_SvInstance == NULL ) return PbsSvDllLoadFail ; + m_ProcessPbEvents = (tdPbProcessPbEvents) dlsym ( m_SvInstance , "_sa" ) ; + m_AddPbEvent = (tdPbAddSvEvent) dlsym ( m_SvInstance , "_sb" ) ; +#endif + + if ( m_ProcessPbEvents == NULL || m_AddPbEvent == NULL ) { + UnloadServerDll() ; + return PbsSvDllProcFail ; + } + + m_ReloadServer = 0 ; + + return NULL ; + } + + inline char *AddPbEvent ( int type , int clientIndex , int datalen , char *data , int retry = 0 ) { + if ( m_GameCommand == NULL ) return NULL ;//not considered an error, this signifies that PB is disabled + + if ( m_ReloadServer || m_SvInstance == NULL ) { + if ( m_SvInstance != NULL ) { + UnloadServerDll() ; + return NULL ; + } + + char *res = LoadServerDll() ; + if ( res != NULL ) { + if ( type == PB_EV_ISENABLED ) return (char *) 0 ; + return res ; + } + } + + return m_AddPbEvent ( this , type , clientIndex , datalen , data , retry ) ; + } + + inline char *ProcessPbEvents ( int TickLimit = 0 ) { + if ( m_GameCommand == NULL ) return NULL ;//not considered an error, this signifies that PB is disabled + if ( m_SvInstance == NULL ) { + if ( m_ReloadServer ) AddPbEvent ( PB_EV_CONFIG , -1 , 0 , "" ) ; + return NULL ;//no events have been successfully added so nothing to process + } + + if ( m_ReloadServer ) { + UnloadServerDll() ; + return NULL ; + } + + char *ret = m_ProcessPbEvents ( this , TickLimit ) ; + + if ( m_ReloadServer ) { + UnloadServerDll() ; + return NULL ; + } + + return ret ; + } + + inline void init ( void ) { + m_svId = PB_SV_ID ; + strcpy ( m_msgPrefix , "PunkBuster Server" ) ; + m_SvInstance = NULL ; + m_ReloadServer = 1 ; + uninitialize() ; + } + + inline stPbSv() { + init() ; + } + + inline ~stPbSv() { + UnloadServerDll() ; + UnloadClientDll() ; + UnloadAgentDll() ; + } + +#endif //#ifndef __PBDLL__ + +} ; + + + +#endif //#ifdef _cplusplus +#endif //#ifdef __WITHPB__ +#endif //#ifndef __PBSV_H__ +#endif // NOT_USE_PUNKBUSTER_SDK diff --git a/RenderDll/Common/LeafBufferCreate.cpp b/RenderDll/Common/LeafBufferCreate.cpp index faf4647..828b924 100644 --- a/RenderDll/Common/LeafBufferCreate.cpp +++ b/RenderDll/Common/LeafBufferCreate.cpp @@ -1826,8 +1826,8 @@ bool CLeafBuffer::CheckUpdate(int VertFormat, int Flags, bool bNeedAddNormals) else if (!lb->m_bOnlyVideoBuffer) { - assert(lb->m_pSecVertBuffer); - if (lb->m_pSecVertBuffer->m_vertexformat != RequestedVertFormat) + //assert(lb->m_pSecVertBuffer); + if (lb->m_pSecVertBuffer && lb->m_pSecVertBuffer->m_vertexformat != RequestedVertFormat) { PROFILE_FRAME(Mesh_CheckUpdateRecreateSystem); lb->ReCreateSystemBuffer(RequestedVertFormat); diff --git a/RenderDll/Common/Renderer.cpp b/RenderDll/Common/Renderer.cpp index 648a661..bbbc79d 100644 --- a/RenderDll/Common/Renderer.cpp +++ b/RenderDll/Common/Renderer.cpp @@ -23,6 +23,13 @@ #include "WinBase.h" #endif +#ifdef USING_CRY_MEMORY_MANAGER +//#if !defined(LINUX) +_ACCESS_POOL +//#endif +#endif + + ////////////////////////////////////////////////////////////////////////// // Globals. ////////////////////////////////////////////////////////////////////////// @@ -32,9 +39,11 @@ int g_CpuFlags; double g_SecondsPerCycle; #ifndef _XBOX -#include +//#include #endif +//HANDLE __crtheap; + // per-frame profilers: collect the infromation for each frame for // displaying statistics at the beginning of each frame //#define PROFILER(ID,NAME) DEFINE_FRAME_PROFILER(ID,NAME) diff --git a/RenderDll/Common/Shaders/Shader.h b/RenderDll/Common/Shaders/Shader.h index aad85a0..d3b25e4 100644 --- a/RenderDll/Common/Shaders/Shader.h +++ b/RenderDll/Common/Shaders/Shader.h @@ -12,6 +12,7 @@ #include #include +#include #include "../Defs.h" @@ -81,7 +82,7 @@ struct SCoord struct SOrient { SCoord m_Coord; - uint m_Flags; + unsigned int m_Flags; }; //=========================================================== @@ -3646,8 +3647,8 @@ struct SShaderPass { TArray m_TUnits; // List of texture units - uint m_RenderState; // Render state flags - uint m_SecondRenderState; // Render state flags for all subsequent passes + unsigned int m_RenderState; // Render state flags + unsigned int m_SecondRenderState; // Render state flags for all subsequent passes SWaveForm *m_WaveEvalRGB; // Wave form definition for RGB evaluation (usually software evaluations) SRGBGenNoise *m_RGBNoise; // Noise parameters definition for RGB evaluation @@ -4101,14 +4102,14 @@ struct SShader : public IShader int m_nRefCounter; float m_fProfileTime; - uint m_Flags; // Different usefull flags EF_ (see IShader.h) - uint m_Flags2; // Different usefull flags EF2_ (see IShader.h) - uint m_Flags3; // Different usefull flags EF3_ (see IShader.h) + unsigned int m_Flags; // Different usefull flags EF_ (see IShader.h) + unsigned int m_Flags2; // Different usefull flags EF2_ (see IShader.h) + unsigned int m_Flags3; // Different usefull flags EF3_ (see IShader.h) ECull m_eCull; // Base shader culling type (Can be overriden by Pass m_eCull value) EF_Sort m_eSort; // Sort category eS_ (see IShader.h) EShClass m_eClass; // Shader class eSH_ (see IShader.h) float m_fUpdateFactor; // Updating time factor for drawing to the texture - uint m_DLDFlags; // Preprocessor shader flags for "DrawLowDetail" function (see I3DEngine.h) + unsigned int m_DLDFlags; // Preprocessor shader flags for "DrawLowDetail" function (see I3DEngine.h) int m_nPreprocess; // Preprocess flags for shader (see IShader.h) SEfTemplates *m_Templates; // List of all templates registered in this shader @@ -4181,7 +4182,7 @@ struct SShader : public IShader virtual SEfTemplates *GetTemplates () { return m_Templates; } virtual int GetTexId (); virtual unsigned int GetUsedTextureTypes (void); - virtual uint GetPreprocessFlags() { return m_nPreprocess; } + virtual unsigned int GetPreprocessFlags() { return m_nPreprocess; } virtual int GetVertexFormat(void) { return m_VertexFormatId; } virtual uint64 GetGenerationMask() { return m_nMaskGen; } virtual SShaderGen* GetGenerationParams() diff --git a/RenderDll/Common/Shaders/ShaderTemplate.cpp b/RenderDll/Common/Shaders/ShaderTemplate.cpp index 5c38b12..92fffbc 100644 --- a/RenderDll/Common/Shaders/ShaderTemplate.cpp +++ b/RenderDll/Common/Shaders/ShaderTemplate.cpp @@ -1034,8 +1034,8 @@ void CShader::mfCheckShaderResTexturesHW(TArray &Dst, SShader *ef nameNorm[0] = 0; if (Res->m_Textures[EFTT_BUMP] && !Res->m_Textures[EFTT_BUMP]->m_Name.empty()) { - char *str; - if (str=strstr(Res->m_Textures[EFTT_BUMP]->m_Name.c_str(), "_ddn")) + const char* str = strstr(Res->m_Textures[EFTT_BUMP]->m_Name.c_str(), "_ddn"); + if (str) { int nSize = str - Res->m_Textures[EFTT_BUMP]->m_Name.c_str(); memcpy(nameBump, Res->m_Textures[EFTT_BUMP]->m_Name.c_str(), nSize); @@ -1052,8 +1052,8 @@ void CShader::mfCheckShaderResTexturesHW(TArray &Dst, SShader *ef } if (Res->m_Textures[EFTT_NORMALMAP] && !Res->m_Textures[EFTT_NORMALMAP]->m_Name.empty()) { - char *str; - if (str=strstr(Res->m_Textures[EFTT_NORMALMAP]->m_Name.c_str(), "_ddn")) + const char *str = strstr(Res->m_Textures[EFTT_NORMALMAP]->m_Name.c_str(), "_ddn"); + if (str) { int nSize = str - Res->m_Textures[EFTT_NORMALMAP]->m_Name.c_str(); memcpy(nameNorm, Res->m_Textures[EFTT_NORMALMAP]->m_Name.c_str(), nSize); diff --git a/RenderDll/Dx9Sdk.7z b/RenderDll/Dx9Sdk.7z new file mode 100644 index 0000000..57168e1 Binary files /dev/null and b/RenderDll/Dx9Sdk.7z differ diff --git a/RenderDll/Dx9Sdk/Include/D2D1.h b/RenderDll/Dx9Sdk/Include/D2D1.h new file mode 100644 index 0000000..e8768df --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D2D1.h @@ -0,0 +1,6996 @@ +//--------------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This file is automatically generated. Please do not edit it directly. +// +// File name: D2D1.h +//--------------------------------------------------------------------------- +#pragma once + + +#ifndef _D2D1_H_ +#define _D2D1_H_ + +#ifndef COM_NO_WINDOWS_H +#include +#endif // #ifndef COM_NO_WINDOWS_H +#include +#include +#include +#include +#include +#ifndef D2D_NO_INCLUDE_D3D10 +#include +#endif // #ifndef D2D_NO_INCLUDE_D3D10 + +#ifndef D2D_USE_C_DEFINITIONS + +// +// We use the 'C' definitions if C++ is not defined +// +#ifndef __cplusplus +#define D2D_USE_C_DEFINITIONS +#endif + +#endif // #ifndef D2D_USE_C_DEFINITIONS + +#ifndef D2D1_DECLARE_INTERFACE +#define D2D1_DECLARE_INTERFACE(X) DECLSPEC_UUID(X) DECLSPEC_NOVTABLE +#endif + +// +// Forward declarations here +// + +typedef interface IDWriteTextFormat IDWriteTextFormat; +typedef interface IDWriteTextLayout IDWriteTextLayout; +typedef interface IDWriteRenderingParams IDWriteRenderingParams; +typedef interface IDXGISurface IDXGISurface; +typedef interface IWICBitmap IWICBitmap; +typedef interface IWICBitmapSource IWICBitmapSource; + +typedef struct DWRITE_GLYPH_RUN DWRITE_GLYPH_RUN; + +#ifndef D2D_USE_C_DEFINITIONS + +interface ID2D1Factory; +interface ID2D1RenderTarget; +interface ID2D1BitmapRenderTarget; +interface ID2D1SimplifiedGeometrySink; +interface ID2D1TessellationSink; +interface ID2D1Geometry; +interface ID2D1Brush; + +#else + +typedef interface ID2D1Factory ID2D1Factory; +typedef interface ID2D1RenderTarget ID2D1RenderTarget; +typedef interface ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget; +typedef interface ID2D1SimplifiedGeometrySink ID2D1SimplifiedGeometrySink;; +typedef interface ID2D1TessellationSink ID2D1TessellationSink; +typedef interface ID2D1Geometry ID2D1Geometry; +typedef interface ID2D1Brush ID2D1Brush; + +#endif + +#define D2D1_INVALID_TAG ULONGLONG_MAX +#define D2D1_DEFAULT_FLATTENING_TOLERANCE (0.25f) + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_ALPHA_MODE +// +// Synopsis: +// Qualifies how alpha is to be treated in a bitmap or render target containing +// alpha. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_ALPHA_MODE +{ + + // + // Alpha mode should be determined implicitly. Some target surfaces do not supply + // or imply this information in which case alpha must be specified. + // + D2D1_ALPHA_MODE_UNKNOWN = 0, + + // + // Treat the alpha as premultipled. + // + D2D1_ALPHA_MODE_PREMULTIPLIED = 1, + + // + // Opacity is in the 'A' component only. + // + D2D1_ALPHA_MODE_STRAIGHT = 2, + + // + // Ignore any alpha channel information. + // + D2D1_ALPHA_MODE_IGNORE = 3, + D2D1_ALPHA_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_ALPHA_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_GAMMA +// +// Synopsis: +// This determines what gamma is used for interpolation/blending. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_GAMMA +{ + + // + // Colors are manipulated in 2.2 gamma color space. + // + D2D1_GAMMA_2_2 = 0, + + // + // Colors are manipulated in 1.0 gamma color space. + // + D2D1_GAMMA_1_0 = 1, + D2D1_GAMMA_FORCE_DWORD = 0xffffffff + +} D2D1_GAMMA; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_OPACITY_MASK_CONTENT +// +// Synopsis: +// Specifies what the contents are of an opacity mask. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_OPACITY_MASK_CONTENT +{ + + // + // The mask contains geometries or bitmaps. + // + D2D1_OPACITY_MASK_CONTENT_GRAPHICS = 0, + + // + // The mask contains text rendered using one of the natural text modes. + // + D2D1_OPACITY_MASK_CONTENT_TEXT_NATURAL = 1, + + // + // The mask contains text rendered using one of the GDI compatible text modes. + // + D2D1_OPACITY_MASK_CONTENT_TEXT_GDI_COMPATIBLE = 2, + D2D1_OPACITY_MASK_CONTENT_FORCE_DWORD = 0xffffffff + +} D2D1_OPACITY_MASK_CONTENT; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_EXTEND_MODE +// +// Synopsis: +// Enum which descibes how to sample from a source outside it's base tile. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_EXTEND_MODE +{ + + // + // Extend the edges of the source out by clamping sample points outside the source + // to the edges. + // + D2D1_EXTEND_MODE_CLAMP = 0, + + // + // The base tile is drawn untransformed and the remainder are filled by repeating + // the base tile. + // + D2D1_EXTEND_MODE_WRAP = 1, + + // + // The same as wrap, but alternate tiles are flipped The base tile is drawn + // untransformed. + // + D2D1_EXTEND_MODE_MIRROR = 2, + D2D1_EXTEND_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_EXTEND_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_ANTIALIAS_MODE +// +// Synopsis: +// Enum which descibes the manner in which we render edges of non-text primitives. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_ANTIALIAS_MODE +{ + + // + // The edges of each primitive are antialiased sequentially. + // + D2D1_ANTIALIAS_MODE_PER_PRIMITIVE = 0, + + // + // Each pixel is rendered if its pixel center is contained by the geometry. + // + D2D1_ANTIALIAS_MODE_ALIASED = 1, + D2D1_ANTIALIAS_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_ANTIALIAS_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_TEXT_ANTIALIAS_MODE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_TEXT_ANTIALIAS_MODE +{ + + // + // Render text using the current system setting. + // + D2D1_TEXT_ANTIALIAS_MODE_DEFAULT = 0, + + // + // Render text using ClearType. + // + D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE = 1, + + // + // Render text using gray-scale. + // + D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE = 2, + + // + // Render text aliased. + // + D2D1_TEXT_ANTIALIAS_MODE_ALIASED = 3, + D2D1_TEXT_ANTIALIAS_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_TEXT_ANTIALIAS_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_BITMAP_INTERPOLATION_MODE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_BITMAP_INTERPOLATION_MODE +{ + + // + // Nearest Neighbor filtering. Also known as nearest pixel or nearest point + // sampling. + // + D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, + + // + // Linear filtering. + // + D2D1_BITMAP_INTERPOLATION_MODE_LINEAR = 1, + D2D1_BITMAP_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_BITMAP_INTERPOLATION_MODE; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_DRAW_TEXT_OPTIONS +// +// Synopsis: +// Modifications made to the draw text call that influence how the text is +// rendered. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_DRAW_TEXT_OPTIONS +{ + + // + // Do not snap the baseline of the text vertically. + // + D2D1_DRAW_TEXT_OPTIONS_NO_SNAP = 0x00000001, + + // + // Clip the text to the content bounds. + // + D2D1_DRAW_TEXT_OPTIONS_CLIP = 0x00000002, + D2D1_DRAW_TEXT_OPTIONS_NONE = 0x00000000, + D2D1_DRAW_TEXT_OPTIONS_FORCE_DWORD = 0xffffffff + +} D2D1_DRAW_TEXT_OPTIONS; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_DRAW_TEXT_OPTIONS); + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_PIXEL_FORMAT +// +//------------------------------------------------------------------------------ +typedef struct D2D1_PIXEL_FORMAT +{ + DXGI_FORMAT format; + D2D1_ALPHA_MODE alphaMode; + +} D2D1_PIXEL_FORMAT; + +typedef D2D_POINT_2U D2D1_POINT_2U; +typedef D2D_POINT_2F D2D1_POINT_2F; +typedef D2D_RECT_F D2D1_RECT_F; +typedef D2D_RECT_U D2D1_RECT_U; +typedef D2D_SIZE_F D2D1_SIZE_F; +typedef D2D_SIZE_U D2D1_SIZE_U; +typedef D2D_COLOR_F D2D1_COLOR_F; +typedef D2D_MATRIX_3X2_F D2D1_MATRIX_3X2_F; +typedef UINT64 D2D1_TAG; + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_BITMAP_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_BITMAP_PROPERTIES +{ + D2D1_PIXEL_FORMAT pixelFormat; + FLOAT dpiX; + FLOAT dpiY; + +} D2D1_BITMAP_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_GRADIENT_STOP +// +//------------------------------------------------------------------------------ +typedef struct D2D1_GRADIENT_STOP +{ + FLOAT position; + D2D1_COLOR_F color; + +} D2D1_GRADIENT_STOP; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_BRUSH_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_BRUSH_PROPERTIES +{ + FLOAT opacity; + D2D1_MATRIX_3X2_F transform; + +} D2D1_BRUSH_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_BITMAP_BRUSH_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_BITMAP_BRUSH_PROPERTIES +{ + D2D1_EXTEND_MODE extendModeX; + D2D1_EXTEND_MODE extendModeY; + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode; + +} D2D1_BITMAP_BRUSH_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES +{ + D2D1_POINT_2F startPoint; + D2D1_POINT_2F endPoint; + +} D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES +{ + D2D1_POINT_2F center; + D2D1_POINT_2F gradientOriginOffset; + FLOAT radiusX; + FLOAT radiusY; + +} D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_ARC_SIZE +// +// Synopsis: +// Differentiates which of the two possible arcs could match the given arc +// parameters. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_ARC_SIZE +{ + D2D1_ARC_SIZE_SMALL = 0, + D2D1_ARC_SIZE_LARGE = 1, + D2D1_ARC_SIZE_FORCE_DWORD = 0xffffffff + +} D2D1_ARC_SIZE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_CAP_STYLE +// +// Synopsis: +// Enum which descibes the drawing of the ends of a line. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_CAP_STYLE +{ + + // + // Flat line cap. + // + D2D1_CAP_STYLE_FLAT = 0, + + // + // Square line cap. + // + D2D1_CAP_STYLE_SQUARE = 1, + + // + // Round line cap. + // + D2D1_CAP_STYLE_ROUND = 2, + + // + // Triangle line cap. + // + D2D1_CAP_STYLE_TRIANGLE = 3, + D2D1_CAP_STYLE_FORCE_DWORD = 0xffffffff + +} D2D1_CAP_STYLE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_DASH_STYLE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_DASH_STYLE +{ + D2D1_DASH_STYLE_SOLID = 0, + D2D1_DASH_STYLE_DASH = 1, + D2D1_DASH_STYLE_DOT = 2, + D2D1_DASH_STYLE_DASH_DOT = 3, + D2D1_DASH_STYLE_DASH_DOT_DOT = 4, + D2D1_DASH_STYLE_CUSTOM = 5, + D2D1_DASH_STYLE_FORCE_DWORD = 0xffffffff + +} D2D1_DASH_STYLE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_LINE_JOIN +// +// Synopsis: +// Enum which descibes the drawing of the corners on the line. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_LINE_JOIN +{ + + // + // Miter join. + // + D2D1_LINE_JOIN_MITER = 0, + + // + // Bevel join. + // + D2D1_LINE_JOIN_BEVEL = 1, + + // + // Round join. + // + D2D1_LINE_JOIN_ROUND = 2, + + // + // Miter/Bevel join. + // + D2D1_LINE_JOIN_MITER_OR_BEVEL = 3, + D2D1_LINE_JOIN_FORCE_DWORD = 0xffffffff + +} D2D1_LINE_JOIN; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_COMBINE_MODE +// +// Synopsis: +// This enumeration describes the type of combine operation to be performed. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_COMBINE_MODE +{ + + // + // Produce a geometry representing the set of points contained in either + // the first or the second geometry. + // + D2D1_COMBINE_MODE_UNION = 0, + + // + // Produce a geometry representing the set of points common to the first + // and the second geometries. + // + D2D1_COMBINE_MODE_INTERSECT = 1, + + // + // Produce a geometry representing the set of points contained in the + // first geometry or the second geometry, but not both. + // + D2D1_COMBINE_MODE_XOR = 2, + + // + // Produce a geometry representing the set of points contained in the + // first geometry but not the second geometry. + // + D2D1_COMBINE_MODE_EXCLUDE = 3, + D2D1_COMBINE_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_COMBINE_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_GEOMETRY_RELATION +// +//------------------------------------------------------------------------------ +typedef enum D2D1_GEOMETRY_RELATION +{ + + // + // The relation between the geometries couldn't be determined. This value is never + // returned by any D2D method. + // + D2D1_GEOMETRY_RELATION_UNKNOWN = 0, + + // + // The two geometries do not intersect at all. + // + D2D1_GEOMETRY_RELATION_DISJOINT = 1, + + // + // The passed in geometry is entirely contained by the object. + // + D2D1_GEOMETRY_RELATION_IS_CONTAINED = 2, + + // + // The object entirely contains the passed in geometry. + // + D2D1_GEOMETRY_RELATION_CONTAINS = 3, + + // + // The two geometries overlap but neither completely contains the other. + // + D2D1_GEOMETRY_RELATION_OVERLAP = 4, + D2D1_GEOMETRY_RELATION_FORCE_DWORD = 0xffffffff + +} D2D1_GEOMETRY_RELATION; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_GEOMETRY_SIMPLIFICATION_OPTION +// +// Synopsis: +// Specifies how simple the output of a simplified geometry sink should be. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_GEOMETRY_SIMPLIFICATION_OPTION +{ + D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES = 0, + D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES = 1, + D2D1_GEOMETRY_SIMPLIFICATION_OPTION_FORCE_DWORD = 0xffffffff + +} D2D1_GEOMETRY_SIMPLIFICATION_OPTION; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_FIGURE_BEGIN +// +// Synopsis: +// Indicates whether the given figure is filled or hollow. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_FIGURE_BEGIN +{ + D2D1_FIGURE_BEGIN_FILLED = 0, + D2D1_FIGURE_BEGIN_HOLLOW = 1, + D2D1_FIGURE_BEGIN_FORCE_DWORD = 0xffffffff + +} D2D1_FIGURE_BEGIN; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_FIGURE_END +// +// Synopsis: +// Indicates whether the figure ir open or closed on its end point. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_FIGURE_END +{ + D2D1_FIGURE_END_OPEN = 0, + D2D1_FIGURE_END_CLOSED = 1, + D2D1_FIGURE_END_FORCE_DWORD = 0xffffffff + +} D2D1_FIGURE_END; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_BEZIER_SEGMENT +// +// Synopsis: +// Describes a cubic bezier in a path. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_BEZIER_SEGMENT +{ + D2D1_POINT_2F point1; + D2D1_POINT_2F point2; + D2D1_POINT_2F point3; + +} D2D1_BEZIER_SEGMENT; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_TRIANGLE +// +// Synopsis: +// Describes a triangle. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_TRIANGLE +{ + D2D1_POINT_2F point1; + D2D1_POINT_2F point2; + D2D1_POINT_2F point3; + +} D2D1_TRIANGLE; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_PATH_SEGMENT +// +// Synopsis: +// Indicates whether the given segment should be stroked, or, if the join between +// this segment and the previous one should be smooth. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_PATH_SEGMENT +{ + D2D1_PATH_SEGMENT_NONE = 0x00000000, + D2D1_PATH_SEGMENT_FORCE_UNSTROKED = 0x00000001, + D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN = 0x00000002, + D2D1_PATH_SEGMENT_FORCE_DWORD = 0xffffffff + +} D2D1_PATH_SEGMENT; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_PATH_SEGMENT); + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_SWEEP_DIRECTION +// +//------------------------------------------------------------------------------ +typedef enum D2D1_SWEEP_DIRECTION +{ + D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE = 0, + D2D1_SWEEP_DIRECTION_CLOCKWISE = 1, + D2D1_SWEEP_DIRECTION_FORCE_DWORD = 0xffffffff + +} D2D1_SWEEP_DIRECTION; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_FILL_MODE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_FILL_MODE +{ + D2D1_FILL_MODE_ALTERNATE = 0, + D2D1_FILL_MODE_WINDING = 1, + D2D1_FILL_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_FILL_MODE; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_ARC_SEGMENT +// +// Synopsis: +// Describes an arc that is defined as part of a path. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_ARC_SEGMENT +{ + D2D1_POINT_2F point; + D2D1_SIZE_F size; + FLOAT rotationAngle; + D2D1_SWEEP_DIRECTION sweepDirection; + D2D1_ARC_SIZE arcSize; + +} D2D1_ARC_SEGMENT; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_QUADRATIC_BEZIER_SEGMENT +// +//------------------------------------------------------------------------------ +typedef struct D2D1_QUADRATIC_BEZIER_SEGMENT +{ + D2D1_POINT_2F point1; + D2D1_POINT_2F point2; + +} D2D1_QUADRATIC_BEZIER_SEGMENT; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_ELLIPSE +// +//------------------------------------------------------------------------------ +typedef struct D2D1_ELLIPSE +{ + D2D1_POINT_2F point; + FLOAT radiusX; + FLOAT radiusY; + +} D2D1_ELLIPSE; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_ROUNDED_RECT +// +//------------------------------------------------------------------------------ +typedef struct D2D1_ROUNDED_RECT +{ + D2D1_RECT_F rect; + FLOAT radiusX; + FLOAT radiusY; + +} D2D1_ROUNDED_RECT; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_STROKE_STYLE_PROPERTIES +// +// Synopsis: +// Properties, aside from the width, that allow geometric penning to be specified. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_STROKE_STYLE_PROPERTIES +{ + D2D1_CAP_STYLE startCap; + D2D1_CAP_STYLE endCap; + D2D1_CAP_STYLE dashCap; + D2D1_LINE_JOIN lineJoin; + FLOAT miterLimit; + D2D1_DASH_STYLE dashStyle; + FLOAT dashOffset; + +} D2D1_STROKE_STYLE_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_LAYER_OPTIONS +// +// Synopsis: +// Specified options that can be applied when a layer resource is applied to create +// a layer. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_LAYER_OPTIONS +{ + D2D1_LAYER_OPTIONS_NONE = 0x00000000, + + // + // The layer will render correctly for ClearType text. If the render target was set + // to ClearType previously, the layer will continue to render ClearType. If the + // render target was set to ClearType and this option is not specified, the render + // target will be set to render gray-scale until the layer is popped. The caller + // can override this default by calling SetTextAntialiasMode while within the + // layer. This flag is slightly slower than the default. + // + D2D1_LAYER_OPTIONS_INITIALIZE_FOR_CLEARTYPE = 0x00000001, + D2D1_LAYER_OPTIONS_FORCE_DWORD = 0xffffffff + +} D2D1_LAYER_OPTIONS; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS); + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_LAYER_PARAMETERS +// +//------------------------------------------------------------------------------ +typedef struct D2D1_LAYER_PARAMETERS +{ + + // + // The rectangular clip that will be applied to the layer. The clip is affected by + // the world transform. Content outside of the content bounds will not render. + // + D2D1_RECT_F contentBounds; + + // + // A general mask that can be optionally applied to the content. Content not inside + // the fill of the mask will not be rendered. + // + __field_ecount_opt(1) ID2D1Geometry *geometricMask; + + // + // Specifies whether the mask should be aliased or antialiased. + // + D2D1_ANTIALIAS_MODE maskAntialiasMode; + + // + // An additional transform that may be applied to the mask in addition to the + // current world transform. + // + D2D1_MATRIX_3X2_F maskTransform; + + // + // The opacity with which all of the content in the layer will be blended back to + // the target when the layer is popped. + // + FLOAT opacity; + + // + // An additional brush that can be applied to the layer. Only the opacity channel + // is sampled from this brush and multiplied both with the layer content and the + // over-all layer opacity. + // + __field_ecount_opt(1) ID2D1Brush *opacityBrush; + + // + // Specifies if ClearType will be rendered into the layer. + // + D2D1_LAYER_OPTIONS layerOptions; + +} D2D1_LAYER_PARAMETERS; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_WINDOW_STATE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_WINDOW_STATE +{ + D2D1_WINDOW_STATE_NONE = 0x0000000, + D2D1_WINDOW_STATE_OCCLUDED = 0x0000001, + D2D1_WINDOW_STATE_FORCE_DWORD = 0xffffffff + +} D2D1_WINDOW_STATE; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_WINDOW_STATE); + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_RENDER_TARGET_TYPE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_RENDER_TARGET_TYPE +{ + + // + // D2D is free to choose the render target type for the caller. + // + D2D1_RENDER_TARGET_TYPE_DEFAULT = 0, + + // + // The render target will render using the CPU. + // + D2D1_RENDER_TARGET_TYPE_SOFTWARE = 1, + + // + // The render target will render using the GPU. + // + D2D1_RENDER_TARGET_TYPE_HARDWARE = 2, + D2D1_RENDER_TARGET_TYPE_FORCE_DWORD = 0xffffffff + +} D2D1_RENDER_TARGET_TYPE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_FEATURE_LEVEL +// +//------------------------------------------------------------------------------ +typedef enum D2D1_FEATURE_LEVEL +{ + + // + // The caller does not require a particular underlying D3D device level. + // + D2D1_FEATURE_LEVEL_DEFAULT = 0, + + // + // The D3D device level is DX9 compatible. + // + D2D1_FEATURE_LEVEL_9 = D3D10_FEATURE_LEVEL_9_1, + + // + // The D3D device level is DX10 compatible. + // + D2D1_FEATURE_LEVEL_10 = D3D10_FEATURE_LEVEL_10_0, + D2D1_FEATURE_LEVEL_FORCE_DWORD = 0xffffffff + +} D2D1_FEATURE_LEVEL; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_RENDER_TARGET_USAGE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_RENDER_TARGET_USAGE +{ + D2D1_RENDER_TARGET_USAGE_NONE = 0x00000000, + + // + // Rendering will occur locally, if a terminal-services session is established, the + // bitmap updates will be sent to the terminal services client. + // + D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING = 0x00000001, + + // + // The render target will allow a call to GetDC on the IGdiInteropRenderTarget + // interface. Rendering will also occur locally. + // + D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE = 0x00000002, + D2D1_RENDER_TARGET_USAGE_FORCE_DWORD = 0xffffffff + +} D2D1_RENDER_TARGET_USAGE; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_RENDER_TARGET_USAGE); + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_PRESENT_OPTIONS +// +// Synopsis: +// Describes how present should behave. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_PRESENT_OPTIONS +{ + D2D1_PRESENT_OPTIONS_NONE = 0x00000000, + + // + // Keep the target contents intact through present. + // + D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS = 0x00000001, + + // + // Do not wait for display refresh to commit changes to display. + // + D2D1_PRESENT_OPTIONS_IMMEDIATELY = 0x00000002, + D2D1_PRESENT_OPTIONS_FORCE_DWORD = 0xffffffff + +} D2D1_PRESENT_OPTIONS; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_PRESENT_OPTIONS); + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_RENDER_TARGET_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_RENDER_TARGET_PROPERTIES +{ + D2D1_RENDER_TARGET_TYPE type; + D2D1_PIXEL_FORMAT pixelFormat; + FLOAT dpiX; + FLOAT dpiY; + D2D1_RENDER_TARGET_USAGE usage; + D2D1_FEATURE_LEVEL minLevel; + +} D2D1_RENDER_TARGET_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_HWND_RENDER_TARGET_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_HWND_RENDER_TARGET_PROPERTIES +{ + HWND hwnd; + D2D1_SIZE_U pixelSize; + D2D1_PRESENT_OPTIONS presentOptions; + +} D2D1_HWND_RENDER_TARGET_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS +// +//------------------------------------------------------------------------------ +typedef enum D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS +{ + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE = 0x00000000, + + // + // The compatible render target will allow a call to GetDC on the + // IGdiInteropRenderTarget interface. This can be specified even if the parent + // render target is not GDI compatible. + // + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE = 0x00000001, + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_FORCE_DWORD = 0xffffffff + +} D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS); + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_DRAWING_STATE_DESCRIPTION +// +// Synopsis: +// Allows the drawing state to be atomically created. This also specifies the +// drawing state that is saved into an IDrawingStateBlock object. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_DRAWING_STATE_DESCRIPTION +{ + D2D1_ANTIALIAS_MODE antialiasMode; + D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode; + D2D1_TAG tag1; + D2D1_TAG tag2; + D2D1_MATRIX_3X2_F transform; + +} D2D1_DRAWING_STATE_DESCRIPTION; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_DC_INITIALIZE_MODE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_DC_INITIALIZE_MODE +{ + + // + // The contents of the D2D render target will be copied to the DC. + // + D2D1_DC_INITIALIZE_MODE_COPY = 0, + + // + // The contents of the DC will be cleared. + // + D2D1_DC_INITIALIZE_MODE_CLEAR = 1, + D2D1_DC_INITIALIZE_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_DC_INITIALIZE_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_DEBUG_LEVEL +// +// Synopsis: +// Indicates the debug level to be outputed by the debug layer. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_DEBUG_LEVEL +{ + D2D1_DEBUG_LEVEL_NONE = 0, + D2D1_DEBUG_LEVEL_ERROR = 1, + D2D1_DEBUG_LEVEL_WARNING = 2, + D2D1_DEBUG_LEVEL_INFORMATION = 3, + D2D1_DEBUG_LEVEL_FORCE_DWORD = 0xffffffff + +} D2D1_DEBUG_LEVEL; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_FACTORY_TYPE +// +// Synopsis: +// Specifies the threading model of the created factory and all of its derived +// resources. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_FACTORY_TYPE +{ + + // + // The resulting factory and derived resources may only be invoked serially. + // Reference counts on resources are interlocked, however, resource and render + // target state is not protected from multi-threaded access. + // + D2D1_FACTORY_TYPE_SINGLE_THREADED = 0, + + // + // The resulting factory may be invoked from multiple threads. Returned resources + // use interlocked reference counting and their state is protected. + // + D2D1_FACTORY_TYPE_MULTI_THREADED = 1, + D2D1_FACTORY_TYPE_FORCE_DWORD = 0xffffffff + +} D2D1_FACTORY_TYPE; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_FACTORY_OPTIONS +// +// Synopsis: +// Allows additional parameters for factory creation. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_FACTORY_OPTIONS +{ + + // + // Requests a certain level of debugging information from the debug layer. This + // parameter is ignored if the debug layer DLL is not present. + // + D2D1_DEBUG_LEVEL debugLevel; + +} D2D1_FACTORY_OPTIONS; + + +#ifndef D2D_USE_C_DEFINITIONS + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Resource +// +// Synopsis: +// The root interface for all resources in D2D. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd90691-12e2-11dc-9fed-001143a055f9") ID2D1Resource : public IUnknown +{ + + + // + // Retrieve the factory associated with this resource. + // + STDMETHOD_(void, GetFactory)( + __deref_out ID2D1Factory **factory + ) CONST PURE; +}; // interface ID2D1Resource + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Bitmap +// +// Synopsis: +// Root bitmap resource, linearly scaled on a draw call. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("a2296057-ea42-4099-983b-539fb6505426") ID2D1Bitmap : public ID2D1Resource +{ + + + // + // Returns the size of the bitmap in resolution independent units. + // + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ) CONST PURE; + + + // + // Returns the size of the bitmap in resolution dependent units, (pixels). + // + STDMETHOD_(D2D1_SIZE_U, GetPixelSize)( + ) CONST PURE; + + + // + // Retrieve the format of the bitmap. + // + STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)( + ) CONST PURE; + + + // + // Return the DPI of the bitmap. + // + STDMETHOD_(void, GetDpi)( + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) CONST PURE; + + STDMETHOD(CopyFromBitmap)( + __in_opt CONST D2D1_POINT_2U *destPoint, + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_RECT_U *srcRect + ) PURE; + + STDMETHOD(CopyFromRenderTarget)( + __in_opt CONST D2D1_POINT_2U *destPoint, + __in ID2D1RenderTarget *renderTarget, + __in_opt CONST D2D1_RECT_U *srcRect + ) PURE; + + STDMETHOD(CopyFromMemory)( + __in_opt CONST D2D1_RECT_U *dstRect, + __in CONST void *srcData, + UINT32 pitch + ) PURE; +}; // interface ID2D1Bitmap + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1GradientStopCollection +// +// Synopsis: +// Represents an collection of gradient stops that can then be the source resource +// for either a linear or radial gradient brush. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a7-12e2-11dc-9fed-001143a055f9") ID2D1GradientStopCollection : public ID2D1Resource +{ + + + // + // Returns the number of stops in the gradient. + // + STDMETHOD_(UINT32, GetGradientStopCount)( + ) CONST PURE; + + + // + // Copies the gradient stops from the collection into the caller's interface. + // + STDMETHOD_(void, GetGradientStops)( + __out_ecount(gradientStopsCount) D2D1_GRADIENT_STOP *gradientStops, + UINT gradientStopsCount + ) CONST PURE; + + + // + // Returns whether the interpolation occurs with 1.0 or 2.2 gamma. + // + STDMETHOD_(D2D1_GAMMA, GetColorInterpolationGamma)( + ) CONST PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendMode)( + ) CONST PURE; +}; // interface ID2D1GradientStopCollection + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Brush +// +// Synopsis: +// The root brush interface. All brushes can be used to fill or pen a geometry. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a8-12e2-11dc-9fed-001143a055f9") ID2D1Brush : public ID2D1Resource +{ + + + // + // Sets the opacity for when the brush is drawn over the entire fill of the brush. + // + STDMETHOD_(void, SetOpacity)( + FLOAT opacity + ) PURE; + + + // + // Sets the transform that applies to everything drawn by the brush. + // + STDMETHOD_(void, SetTransform)( + __in CONST D2D1_MATRIX_3X2_F *transform + ) PURE; + + STDMETHOD_(FLOAT, GetOpacity)( + ) CONST PURE; + + STDMETHOD_(void, GetTransform)( + __out D2D1_MATRIX_3X2_F *transform + ) CONST PURE; + + void + SetTransform( + CONST D2D1_MATRIX_3X2_F &transform + ) + { + SetTransform(&transform); + } +}; // interface ID2D1Brush + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1BitmapBrush +// +// Synopsis: +// A bitmap brush allows a bitmap to be used to fill a geometry. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906aa-12e2-11dc-9fed-001143a055f9") ID2D1BitmapBrush : public ID2D1Brush +{ + + + // + // Sets how the bitmap is to be treated outside of its natural extent on the X + // axis. + // + STDMETHOD_(void, SetExtendModeX)( + D2D1_EXTEND_MODE extendModeX + ) PURE; + + + // + // Sets how the bitmap is to be treated outside of its natural extent on the X + // axis. + // + STDMETHOD_(void, SetExtendModeY)( + D2D1_EXTEND_MODE extendModeY + ) PURE; + + + // + // Sets the interpolation mode used when this brush is used. + // + STDMETHOD_(void, SetInterpolationMode)( + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode + ) PURE; + + + // + // Sets the bitmap associated as the source of this brush. + // + STDMETHOD_(void, SetBitmap)( + __in ID2D1Bitmap *bitmap + ) PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)( + ) CONST PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)( + ) CONST PURE; + + STDMETHOD_(D2D1_BITMAP_INTERPOLATION_MODE, GetInterpolationMode)( + ) CONST PURE; + + STDMETHOD_(void, GetBitmap)( + __deref_out ID2D1Bitmap **bitmap + ) CONST PURE; +}; // interface ID2D1BitmapBrush + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1SolidColorBrush +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a9-12e2-11dc-9fed-001143a055f9") ID2D1SolidColorBrush : public ID2D1Brush +{ + + STDMETHOD_(void, SetColor)( + __in CONST D2D1_COLOR_F *color + ) PURE; + + STDMETHOD_(D2D1_COLOR_F, GetColor)( + ) CONST PURE; + + void + SetColor( + CONST D2D1_COLOR_F &color + ) + { + SetColor(&color); + } +}; // interface ID2D1SolidColorBrush + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1LinearGradientBrush +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906ab-12e2-11dc-9fed-001143a055f9") ID2D1LinearGradientBrush : public ID2D1Brush +{ + + STDMETHOD_(void, SetStartPoint)( + D2D1_POINT_2F startPoint + ) PURE; + + + // + // Sets the end point of the gradient in local coordinate space. This is not + // influenced by the geometry being filled. + // + STDMETHOD_(void, SetEndPoint)( + D2D1_POINT_2F endPoint + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetStartPoint)( + ) CONST PURE; + + STDMETHOD_(D2D1_POINT_2F, GetEndPoint)( + ) CONST PURE; + + STDMETHOD_(void, GetGradientStopCollection)( + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) CONST PURE; +}; // interface ID2D1LinearGradientBrush + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1RadialGradientBrush +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906ac-12e2-11dc-9fed-001143a055f9") ID2D1RadialGradientBrush : public ID2D1Brush +{ + + + // + // Sets the center of the radial gradient. This will be in local coordinates and + // will not depend on the geometry being filled. + // + STDMETHOD_(void, SetCenter)( + D2D1_POINT_2F center + ) PURE; + + + // + // Sets offset of the origin relative to the radial gradient center. + // + STDMETHOD_(void, SetGradientOriginOffset)( + D2D1_POINT_2F gradientOriginOffset + ) PURE; + + STDMETHOD_(void, SetRadiusX)( + FLOAT radiusX + ) PURE; + + STDMETHOD_(void, SetRadiusY)( + FLOAT radiusY + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetCenter)( + ) CONST PURE; + + STDMETHOD_(D2D1_POINT_2F, GetGradientOriginOffset)( + ) CONST PURE; + + STDMETHOD_(FLOAT, GetRadiusX)( + ) CONST PURE; + + STDMETHOD_(FLOAT, GetRadiusY)( + ) CONST PURE; + + STDMETHOD_(void, GetGradientStopCollection)( + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) CONST PURE; +}; // interface ID2D1RadialGradientBrush + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1StrokeStyle +// +// Synopsis: +// Resource interface that holds pen style properties. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd9069d-12e2-11dc-9fed-001143a055f9") ID2D1StrokeStyle : public ID2D1Resource +{ + + STDMETHOD_(D2D1_CAP_STYLE, GetStartCap)( + ) CONST PURE; + + STDMETHOD_(D2D1_CAP_STYLE, GetEndCap)( + ) CONST PURE; + + STDMETHOD_(D2D1_CAP_STYLE, GetDashCap)( + ) CONST PURE; + + STDMETHOD_(FLOAT, GetMiterLimit)( + ) CONST PURE; + + STDMETHOD_(D2D1_LINE_JOIN, GetLineJoin)( + ) CONST PURE; + + STDMETHOD_(FLOAT, GetDashOffset)( + ) CONST PURE; + + STDMETHOD_(D2D1_DASH_STYLE, GetDashStyle)( + ) CONST PURE; + + STDMETHOD_(UINT32, GetDashesCount)( + ) CONST PURE; + + + // + // Returns the dashes from the object into a user allocated array. The user must + // call GetDashesCount to retrieve the required size. + // + STDMETHOD_(void, GetDashes)( + __out_ecount(dashesCount) FLOAT *dashes, + UINT dashesCount + ) CONST PURE; +}; // interface ID2D1StrokeStyle + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Geometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a1-12e2-11dc-9fed-001143a055f9") ID2D1Geometry : public ID2D1Resource +{ + + + // + // Retrieve the bounds of the geometry, with an optional applied transform. + // + STDMETHOD(GetBounds)( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out D2D1_RECT_F *bounds + ) CONST PURE; + + + // + // Get the bounds of the corresponding geometry after it has been widened or have + // an optional pen style applied. + // + STDMETHOD(GetWidenedBounds)( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out D2D1_RECT_F *bounds + ) CONST PURE; + + + // + // Checks to see whether the corresponding penned and widened geometry contains the + // given point. + // + STDMETHOD(StrokeContainsPoint)( + D2D1_POINT_2F point, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) CONST PURE; + + + // + // Test whether the given fill of this geometry would contain this point. + // + STDMETHOD(FillContainsPoint)( + D2D1_POINT_2F point, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) CONST PURE; + + + // + // Compare how one geometry intersects or contains another geometry. + // + STDMETHOD(CompareWithGeometry)( + __in ID2D1Geometry *inputGeometry, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + FLOAT flatteningTolerance, + __out D2D1_GEOMETRY_RELATION *relation + ) CONST PURE; + + + // + // Converts a geometry to a simplified geometry that has arcs and quadratic beziers + // removed. + // + STDMETHOD(Simplify)( + D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST PURE; + + + // + // Tessellates a geometry into triangles. + // + STDMETHOD(Tessellate)( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1TessellationSink *tessellationSink + ) CONST PURE; + + + // + // Performs a combine operation between the two geometries to produce a resulting + // geometry. + // + STDMETHOD(CombineWithGeometry)( + __in ID2D1Geometry *inputGeometry, + D2D1_COMBINE_MODE combineMode, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST PURE; + + + // + // Computes the outline of the geometry. The result is written back into a + // simplified geometry sink. + // + STDMETHOD(Outline)( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST PURE; + + + // + // Computes the area of the geometry. + // + STDMETHOD(ComputeArea)( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *area + ) CONST PURE; + + + // + // Computes the length of the geometry. + // + STDMETHOD(ComputeLength)( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *length + ) CONST PURE; + + + // + // Computes the point and tangent a given distance along the path. + // + STDMETHOD(ComputePointAtLength)( + FLOAT length, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out_opt D2D1_POINT_2F *point, + __out_opt D2D1_POINT_2F *unitTangentVector + ) CONST PURE; + + + // + // Get the geometry and widen it as well as apply an optional pen style. + // + STDMETHOD(Widen)( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST PURE; + + + // + // Retrieve the bounds of the geometry, with an optional applied transform. + // + HRESULT + GetBounds( + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out D2D1_RECT_F *bounds + ) CONST + { + return GetBounds(&worldTransform, bounds); + } + + + // + // Get the bounds of the corresponding geometry after it has been widened or have + // an optional pen style applied. + // + HRESULT + GetWidenedBounds( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out D2D1_RECT_F *bounds + ) CONST + { + return GetWidenedBounds(strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, bounds); + } + + + // + // Get the bounds of the corresponding geometry after it has been widened or have + // an optional pen style applied. + // + HRESULT + GetWidenedBounds( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out D2D1_RECT_F *bounds + ) CONST + { + return GetWidenedBounds(strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, bounds); + } + + + // + // Get the bounds of the corresponding geometry after it has been widened or have + // an optional pen style applied. + // + HRESULT + GetWidenedBounds( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out D2D1_RECT_F *bounds + ) CONST + { + return GetWidenedBounds(strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, bounds); + } + + HRESULT + StrokeContainsPoint( + D2D1_POINT_2F point, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) CONST + { + return StrokeContainsPoint(point, strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, contains); + } + + + // + // Checks to see whether the corresponding penned and widened geometry contains the + // given point. + // + HRESULT + StrokeContainsPoint( + D2D1_POINT_2F point, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out BOOL *contains + ) CONST + { + return StrokeContainsPoint(point, strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains); + } + + HRESULT + StrokeContainsPoint( + D2D1_POINT_2F point, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out BOOL *contains + ) CONST + { + return StrokeContainsPoint(point, strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains); + } + + HRESULT + FillContainsPoint( + D2D1_POINT_2F point, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) CONST + { + return FillContainsPoint(point, &worldTransform, flatteningTolerance, contains); + } + + + // + // Test whether the given fill of this geometry would contain this point. + // + HRESULT + FillContainsPoint( + D2D1_POINT_2F point, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out BOOL *contains + ) CONST + { + return FillContainsPoint(point, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains); + } + + HRESULT + FillContainsPoint( + D2D1_POINT_2F point, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out BOOL *contains + ) CONST + { + return FillContainsPoint(point, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains); + } + + + // + // Compare how one geometry intersects or contains another geometry. + // + HRESULT + CompareWithGeometry( + __in ID2D1Geometry *inputGeometry, + CONST D2D1_MATRIX_3X2_F &inputGeometryTransform, + FLOAT flatteningTolerance, + __out D2D1_GEOMETRY_RELATION *relation + ) CONST + { + return CompareWithGeometry(inputGeometry, &inputGeometryTransform, flatteningTolerance, relation); + } + + + // + // Compare how one geometry intersects or contains another geometry. + // + HRESULT + CompareWithGeometry( + __in ID2D1Geometry *inputGeometry, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + __out D2D1_GEOMETRY_RELATION *relation + ) CONST + { + return CompareWithGeometry(inputGeometry, inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, relation); + } + + + // + // Compare how one geometry intersects or contains another geometry. + // + HRESULT + CompareWithGeometry( + __in ID2D1Geometry *inputGeometry, + CONST D2D1_MATRIX_3X2_F &inputGeometryTransform, + __out D2D1_GEOMETRY_RELATION *relation + ) CONST + { + return CompareWithGeometry(inputGeometry, &inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, relation); + } + + + // + // Converts a geometry to a simplified geometry that has arcs and quadratic beziers + // removed. + // + HRESULT + Simplify( + D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Simplify(simplificationOption, &worldTransform, flatteningTolerance, geometrySink); + } + + + // + // Converts a geometry to a simplified geometry that has arcs and quadratic beziers + // removed. + // + HRESULT + Simplify( + D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Simplify(simplificationOption, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Converts a geometry to a simplified geometry that has arcs and quadratic beziers + // removed. + // + HRESULT + Simplify( + D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Simplify(simplificationOption, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Tessellates a geometry into triangles. + // + HRESULT + Tessellate( + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __in ID2D1TessellationSink *tessellationSink + ) CONST + { + return Tessellate(&worldTransform, flatteningTolerance, tessellationSink); + } + + + // + // Tessellates a geometry into triangles. + // + HRESULT + Tessellate( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __in ID2D1TessellationSink *tessellationSink + ) CONST + { + return Tessellate(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, tessellationSink); + } + + + // + // Tessellates a geometry into triangles. + // + HRESULT + Tessellate( + CONST D2D1_MATRIX_3X2_F &worldTransform, + __in ID2D1TessellationSink *tessellationSink + ) CONST + { + return Tessellate(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, tessellationSink); + } + + + // + // Performs a combine operation between the two geometries to produce a resulting + // geometry. + // + HRESULT + CombineWithGeometry( + __in ID2D1Geometry *inputGeometry, + D2D1_COMBINE_MODE combineMode, + CONST D2D1_MATRIX_3X2_F &inputGeometryTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return CombineWithGeometry(inputGeometry, combineMode, &inputGeometryTransform, flatteningTolerance, geometrySink); + } + + + // + // Performs a combine operation between the two geometries to produce a resulting + // geometry. + // + HRESULT + CombineWithGeometry( + __in ID2D1Geometry *inputGeometry, + D2D1_COMBINE_MODE combineMode, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return CombineWithGeometry(inputGeometry, combineMode, inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Performs a combine operation between the two geometries to produce a resulting + // geometry. + // + HRESULT + CombineWithGeometry( + __in ID2D1Geometry *inputGeometry, + D2D1_COMBINE_MODE combineMode, + CONST D2D1_MATRIX_3X2_F &inputGeometryTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return CombineWithGeometry(inputGeometry, combineMode, &inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Computes the outline of the geometry. The result is written back into a + // simplified geometry sink. + // + HRESULT + Outline( + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Outline(&worldTransform, flatteningTolerance, geometrySink); + } + + + // + // Computes the outline of the geometry. The result is written back into a + // simplified geometry sink. + // + HRESULT + Outline( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Outline(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Computes the outline of the geometry. The result is written back into a + // simplified geometry sink. + // + HRESULT + Outline( + CONST D2D1_MATRIX_3X2_F &worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Outline(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Computes the area of the geometry. + // + HRESULT + ComputeArea( + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *area + ) CONST + { + return ComputeArea(&worldTransform, flatteningTolerance, area); + } + + + // + // Computes the area of the geometry. + // + HRESULT + ComputeArea( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out FLOAT *area + ) CONST + { + return ComputeArea(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, area); + } + + + // + // Computes the area of the geometry. + // + HRESULT + ComputeArea( + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out FLOAT *area + ) CONST + { + return ComputeArea(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, area); + } + + + // + // Computes the length of the geometry. + // + HRESULT + ComputeLength( + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *length + ) CONST + { + return ComputeLength(&worldTransform, flatteningTolerance, length); + } + + + // + // Computes the length of the geometry. + // + HRESULT + ComputeLength( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out FLOAT *length + ) CONST + { + return ComputeLength(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, length); + } + + + // + // Computes the length of the geometry. + // + HRESULT + ComputeLength( + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out FLOAT *length + ) CONST + { + return ComputeLength(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, length); + } + + + // + // Computes the point and tangent a given distance along the path. + // + HRESULT + ComputePointAtLength( + FLOAT length, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out_opt D2D1_POINT_2F *point, + __out_opt D2D1_POINT_2F *unitTangentVector + ) CONST + { + return ComputePointAtLength(length, &worldTransform, flatteningTolerance, point, unitTangentVector); + } + + + // + // Computes the point and tangent a given distance along the path. + // + HRESULT + ComputePointAtLength( + FLOAT length, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out_opt D2D1_POINT_2F *point, + __out_opt D2D1_POINT_2F *unitTangentVector + ) CONST + { + return ComputePointAtLength(length, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, point, unitTangentVector); + } + + + // + // Computes the point and tangent a given distance along the path. + // + HRESULT + ComputePointAtLength( + FLOAT length, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out_opt D2D1_POINT_2F *point, + __out_opt D2D1_POINT_2F *unitTangentVector + ) CONST + { + return ComputePointAtLength(length, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, point, unitTangentVector); + } + + + // + // Get the geometry and widen it as well as apply an optional pen style. + // + HRESULT + Widen( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Widen(strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, geometrySink); + } + + + // + // Get the geometry and widen it as well as apply an optional pen style. + // + HRESULT + Widen( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Widen(strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Get the geometry and widen it as well as apply an optional pen style. + // + HRESULT + Widen( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Widen(strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } +}; // interface ID2D1Geometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1RectangleGeometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a2-12e2-11dc-9fed-001143a055f9") ID2D1RectangleGeometry : public ID2D1Geometry +{ + + STDMETHOD_(void, GetRect)( + __out D2D1_RECT_F *rect + ) CONST PURE; +}; // interface ID2D1RectangleGeometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1RoundedRectangleGeometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a3-12e2-11dc-9fed-001143a055f9") ID2D1RoundedRectangleGeometry : public ID2D1Geometry +{ + + STDMETHOD_(void, GetRoundedRect)( + __out D2D1_ROUNDED_RECT *roundedRect + ) CONST PURE; +}; // interface ID2D1RoundedRectangleGeometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1EllipseGeometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a4-12e2-11dc-9fed-001143a055f9") ID2D1EllipseGeometry : public ID2D1Geometry +{ + + STDMETHOD_(void, GetEllipse)( + __out D2D1_ELLIPSE *ellipse + ) CONST PURE; +}; // interface ID2D1EllipseGeometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1GeometryGroup +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a6-12e2-11dc-9fed-001143a055f9") ID2D1GeometryGroup : public ID2D1Geometry +{ + + STDMETHOD_(D2D1_FILL_MODE, GetFillMode)( + ) CONST PURE; + + STDMETHOD_(UINT32, GetSourceGeometryCount)( + ) CONST PURE; + + STDMETHOD_(void, GetSourceGeometries)( + __out_ecount(geometriesCount) ID2D1Geometry **geometries, + UINT geometriesCount + ) CONST PURE; +}; // interface ID2D1GeometryGroup + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1TransformedGeometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906bb-12e2-11dc-9fed-001143a055f9") ID2D1TransformedGeometry : public ID2D1Geometry +{ + + STDMETHOD_(void, GetSourceGeometry)( + __deref_out ID2D1Geometry **sourceGeometry + ) CONST PURE; + + STDMETHOD_(void, GetTransform)( + __out D2D1_MATRIX_3X2_F *transform + ) CONST PURE; +}; // interface ID2D1TransformedGeometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1SimplifiedGeometrySink +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd9069e-12e2-11dc-9fed-001143a055f9") ID2D1SimplifiedGeometrySink : public IUnknown +{ + + STDMETHOD_(void, SetFillMode)( + D2D1_FILL_MODE fillMode + ) PURE; + + STDMETHOD_(void, SetSegmentFlags)( + D2D1_PATH_SEGMENT vertexFlags + ) PURE; + + STDMETHOD_(void, BeginFigure)( + D2D1_POINT_2F startPoint, + D2D1_FIGURE_BEGIN figureBegin + ) PURE; + + STDMETHOD_(void, AddLines)( + __in_ecount(pointsCount) CONST D2D1_POINT_2F *points, + UINT pointsCount + ) PURE; + + STDMETHOD_(void, AddBeziers)( + __in_ecount(beziersCount) CONST D2D1_BEZIER_SEGMENT *beziers, + UINT beziersCount + ) PURE; + + STDMETHOD_(void, EndFigure)( + D2D1_FIGURE_END figureEnd + ) PURE; + + STDMETHOD(Close)( + ) PURE; +}; // interface ID2D1SimplifiedGeometrySink + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1GeometrySink +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd9069f-12e2-11dc-9fed-001143a055f9") ID2D1GeometrySink : public ID2D1SimplifiedGeometrySink +{ + + STDMETHOD_(void, AddLine)( + D2D1_POINT_2F point + ) PURE; + + STDMETHOD_(void, AddBezier)( + __in CONST D2D1_BEZIER_SEGMENT *bezier + ) PURE; + + STDMETHOD_(void, AddQuadraticBezier)( + __in CONST D2D1_QUADRATIC_BEZIER_SEGMENT *bezier + ) PURE; + + STDMETHOD_(void, AddQuadraticBeziers)( + __in_ecount(beziersCount) CONST D2D1_QUADRATIC_BEZIER_SEGMENT *beziers, + UINT beziersCount + ) PURE; + + STDMETHOD_(void, AddArc)( + __in CONST D2D1_ARC_SEGMENT *arc + ) PURE; + + void + AddBezier( + CONST D2D1_BEZIER_SEGMENT &bezier + ) + { + AddBezier(&bezier); + } + + void + AddQuadraticBezier( + CONST D2D1_QUADRATIC_BEZIER_SEGMENT &bezier + ) + { + AddQuadraticBezier(&bezier); + } + + void + AddArc( + CONST D2D1_ARC_SEGMENT &arc + ) + { + AddArc(&arc); + } +}; // interface ID2D1GeometrySink + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1TessellationSink +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906c1-12e2-11dc-9fed-001143a055f9") ID2D1TessellationSink : public IUnknown +{ + + STDMETHOD_(void, AddTriangles)( + __in_ecount(trianglesCount) CONST D2D1_TRIANGLE *triangles, + UINT trianglesCount + ) PURE; + + STDMETHOD(Close)( + ) PURE; +}; // interface ID2D1TessellationSink + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1PathGeometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a5-12e2-11dc-9fed-001143a055f9") ID2D1PathGeometry : public ID2D1Geometry +{ + + + // + // Opens a geometry sink that will be used to create this path geometry. + // + STDMETHOD(Open)( + __deref_out ID2D1GeometrySink **geometrySink + ) PURE; + + + // + // Retrieve the contents of this geometry. The caller passes an implementation of a + // ID2D1GeometrySink interface to receive the data. + // + STDMETHOD(Stream)( + __in ID2D1GeometrySink *geometrySink + ) CONST PURE; + + STDMETHOD(GetSegmentCount)( + __out UINT32 *count + ) CONST PURE; + + STDMETHOD(GetFigureCount)( + __out UINT32 *count + ) CONST PURE; +}; // interface ID2D1PathGeometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Mesh +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906c2-12e2-11dc-9fed-001143a055f9") ID2D1Mesh : public ID2D1Resource +{ + + + // + // Opens the mesh for population. + // + STDMETHOD(Open)( + __deref_out ID2D1TessellationSink **tessellationSink + ) PURE; +}; // interface ID2D1Mesh + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Layer +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd9069b-12e2-11dc-9fed-001143a055f9") ID2D1Layer : public ID2D1Resource +{ + + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ) CONST PURE; +}; // interface ID2D1Layer + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1DrawingStateBlock +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("28506e39-ebf6-46a1-bb47-fd85565ab957") ID2D1DrawingStateBlock : public ID2D1Resource +{ + + + // + // Retrieves the state currently contained within this state block resource. + // + STDMETHOD_(void, GetDescription)( + __out D2D1_DRAWING_STATE_DESCRIPTION *stateDescription + ) CONST PURE; + + + // + // Sets the state description of this state block resource. + // + STDMETHOD_(void, SetDescription)( + __in CONST D2D1_DRAWING_STATE_DESCRIPTION *stateDescription + ) PURE; + + + // + // Sets the text rendering parameters of this state block resource. + // + STDMETHOD_(void, SetTextRenderingParams)( + __in_opt IDWriteRenderingParams *textRenderingParams = NULL + ) PURE; + + + // + // Retrieves the text rendering parameters contained within this state block + // resource. If a NULL text rendering parameter was specified, NULL will be + // returned. + // + STDMETHOD_(void, GetTextRenderingParams)( + __deref_out_opt IDWriteRenderingParams **textRenderingParams + ) CONST PURE; + + void + SetDescription( + CONST D2D1_DRAWING_STATE_DESCRIPTION &stateDescription + ) + { + SetDescription(&stateDescription); + } +}; // interface ID2D1DrawingStateBlock + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1RenderTarget +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd90694-12e2-11dc-9fed-001143a055f9") ID2D1RenderTarget : public ID2D1Resource +{ + + + // + // Create a D2D bitmap by copying from memory, or create uninitialized. + // + STDMETHOD(CreateBitmap)( + D2D1_SIZE_U size, + __in_opt CONST void *srcData, + UINT32 pitch, + __in CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + + // + // Create a D2D bitmap by copying a WIC bitmap. + // + STDMETHOD(CreateBitmapFromWicBitmap)( + __in IWICBitmapSource *wicBitmapSource, + __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + + // + // Create a D2D bitmap by sharing bits from another resource. The bitmap must be + // compatible with the render target for the call to succeed. + // For example, an IWICBitmap can be shared with a software target, or a DXGI + // surface can be shared with a DXGI render target. + // + STDMETHOD(CreateSharedBitmap)( + __in REFIID riid, + __inout void *data, + __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + + // + // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill + // or pen a geometry. + // + STDMETHOD(CreateBitmapBrush)( + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_BITMAP_BRUSH_PROPERTIES *bitmapBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __deref_out ID2D1BitmapBrush **bitmapBrush + ) PURE; + + STDMETHOD(CreateSolidColorBrush)( + __in CONST D2D1_COLOR_F *color, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __deref_out ID2D1SolidColorBrush **solidColorBrush + ) PURE; + + + // + // A gradient stop collection represents a set of stops in an ideal unit length. + // This is the source resource for a linear gradient and radial gradient brush. + // + STDMETHOD(CreateGradientStopCollection)( + __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops, + __range(>=,1) UINT gradientStopsCount, + + // + // Specifies which space the color interpolation occurs in. + // + D2D1_GAMMA colorInterpolationGamma, + + // + // Specifies how the gradient will be extended outside of the unit length. + // + D2D1_EXTEND_MODE extendMode, + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) PURE; + + STDMETHOD(CreateLinearGradientBrush)( + __in CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *linearGradientBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1LinearGradientBrush **linearGradientBrush + ) PURE; + + STDMETHOD(CreateRadialGradientBrush)( + __in CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *radialGradientBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1RadialGradientBrush **radialGradientBrush + ) PURE; + + + // + // Creates a bitmap render target whose bitmap can be used as a source for + // rendering in the API. + // + STDMETHOD(CreateCompatibleRenderTarget)( + + // + // The requested size of the target in DIPs. If the pixel size is not specified, + // the DPI is inherited from the parent target. However, the render target will + // never contain a fractional number of pixels. + // + __in_opt CONST D2D1_SIZE_F *desiredSize, + + // + // The requested size of the render target in pixels. If the DIP size is also + // specified, the DPI is calculated from these two values. If the desired size is + // not specified, the DPI is inherited from the parent render target. If neither + // value is specified, the compatible render target will be the same size and have + // the same DPI as the parent target. + // + __in_opt CONST D2D1_SIZE_U *desiredPixelSize, + + // + // The desired pixel format. The format must be compatible with the parent render + // target type. If the format is not specified, it will be inherited from the + // parent render target. + // + __in_opt CONST D2D1_PIXEL_FORMAT *desiredFormat, + + // + // Allows the caller to retrieve a GDI compatible render target. + // + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, + + // + // The returned bitmap render target. + // + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) PURE; + + + // + // Creates a layer resource that can be used on any target and which will resize + // under the covers if necessary. + // + STDMETHOD(CreateLayer)( + + // + // The resolution independent minimum size hint for the layer resource. Specify + // this to prevent unwanted reallocation of the layer backing store. The size is in + // DIPs, but, it is unaffected by the current world transform. If the size is + // unspecified, the returned resource is a placeholder and the backing store will + // be allocated to be the minimum size that can hold the content when the layer is + // pushed. + // + __in_opt CONST D2D1_SIZE_F *size, + __deref_out ID2D1Layer **layer + ) PURE; + + + // + // Create a D2D mesh. + // + STDMETHOD(CreateMesh)( + __deref_out ID2D1Mesh **mesh + ) PURE; + + STDMETHOD_(void, DrawLine)( + D2D1_POINT_2F point0, + D2D1_POINT_2F point1, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) PURE; + + STDMETHOD_(void, DrawRectangle)( + __in CONST D2D1_RECT_F *rect, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) PURE; + + STDMETHOD_(void, FillRectangle)( + __in CONST D2D1_RECT_F *rect, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawRoundedRectangle)( + __in CONST D2D1_ROUNDED_RECT *roundedRect, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) PURE; + + STDMETHOD_(void, FillRoundedRectangle)( + __in CONST D2D1_ROUNDED_RECT *roundedRect, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawEllipse)( + __in CONST D2D1_ELLIPSE *ellipse, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) PURE; + + STDMETHOD_(void, FillEllipse)( + __in CONST D2D1_ELLIPSE *ellipse, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawGeometry)( + __in ID2D1Geometry *geometry, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) PURE; + + STDMETHOD_(void, FillGeometry)( + __in ID2D1Geometry *geometry, + __in ID2D1Brush *brush, + + // + // An optionally specified opacity brush. Only the alpha channel of the + // corresponding brush will be sampled and will be applied to the entire fill of + // the geometry. If this brush is specified, the fill brush must be a bitmap brush + // with an extend mode of D2D1_EXTEND_MODE_CLAMP. + // + __in_opt ID2D1Brush *opacityBrush = NULL + ) PURE; + + + // + // Fill a mesh. Since meshes can only render aliased content, the render target + // antialiasing mode must be set to aliased. + // + STDMETHOD_(void, FillMesh)( + __in ID2D1Mesh *mesh, + __in ID2D1Brush *brush + ) PURE; + + + // + // Fill using the opacity channel of the supplied bitmap as a mask. The alpha + // channel of the bitmap is used to represent the coverage of the geometry at each + // pixel, and this is filled appropriately with the brush. The render target + // antialiasing mode must be set to aliased. + // + STDMETHOD_(void, FillOpacityMask)( + __in ID2D1Bitmap *opacityMask, + __in ID2D1Brush *brush, + D2D1_OPACITY_MASK_CONTENT content, + __in_opt CONST D2D1_RECT_F *destinationRectangle = NULL, + __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL + ) PURE; + + STDMETHOD_(void, DrawBitmap)( + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_RECT_F *destinationRectangle = NULL, + FLOAT opacity = 1.0f, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR, + __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL + ) PURE; + + + // + // Draws the text within the given layout rectangle and by default also snaps and + // clips it to the content bounds. + // + STDMETHOD_(void, DrawText)( + __in_ecount(stringLength) CONST WCHAR *string, + UINT stringLength, + __in IDWriteTextFormat *textFormat, + __in CONST D2D1_RECT_F *layoutRect, + __in ID2D1Brush *defaultForegroundBrush, + D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE, + DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL + ) PURE; + + + // + // Draw a snapped text layout object. Since the layout is not subsequently changed, + // this can be more effecient than DrawText when drawing the same layout + // repeatedly. + // + STDMETHOD_(void, DrawTextLayout)( + D2D1_POINT_2F origin, + __in IDWriteTextLayout *textLayout, + __in ID2D1Brush *defaultForegroundBrush, + + // + // The specified text options. NOTE: By default the text is clipped to the layout + // bounds. This is derived from the origin and the layout bounds of the + // corresponding IDWriteTextLayout object. + // + D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE + ) PURE; + + STDMETHOD_(void, DrawGlyphRun)( + D2D1_POINT_2F baselineOrigin, + __in CONST DWRITE_GLYPH_RUN *glyphRun, + __in ID2D1Brush *foregroundBrush, + DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL + ) PURE; + + STDMETHOD_(void, SetTransform)( + __in CONST D2D1_MATRIX_3X2_F *transform + ) PURE; + + STDMETHOD_(void, GetTransform)( + __out D2D1_MATRIX_3X2_F *transform + ) CONST PURE; + + STDMETHOD_(void, SetAntialiasMode)( + D2D1_ANTIALIAS_MODE antialiasMode + ) PURE; + + STDMETHOD_(D2D1_ANTIALIAS_MODE, GetAntialiasMode)( + ) CONST PURE; + + STDMETHOD_(void, SetTextAntialiasMode)( + D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode + ) PURE; + + STDMETHOD_(D2D1_TEXT_ANTIALIAS_MODE, GetTextAntialiasMode)( + ) CONST PURE; + + STDMETHOD_(void, SetTextRenderingParams)( + __in_opt IDWriteRenderingParams *textRenderingParams = NULL + ) PURE; + + + // + // Retrieve the text render parameters. NOTE: If NULL is specified to + // SetTextRenderingParameters, NULL will be returned. + // + STDMETHOD_(void, GetTextRenderingParams)( + __deref_out_opt IDWriteRenderingParams **textRenderingParams + ) CONST PURE; + + + // + // Set a tag to correspond to the succeeding primitives. If an error occurs + // rendering a primtive, the tags can be returned from the Flush or EndDraw call. + // + STDMETHOD_(void, SetTags)( + D2D1_TAG tag1, + D2D1_TAG tag2 + ) PURE; + + + // + // Retrieves the currently set tags. This does not retrieve the tags corresponding + // to any primitive that is in error. + // + STDMETHOD_(void, GetTags)( + __out_opt D2D1_TAG *tag1 = NULL, + __out_opt D2D1_TAG *tag2 = NULL + ) CONST PURE; + + + // + // Start a layer of drawing calls. The way in which the layer must be resolved is + // specified first as well as the logical resource that stores the layer + // parameters. The supplied layer resource might grow if the specified content + // cannot fit inside it. The layer will grow monitonically on each axis. + // + STDMETHOD_(void, PushLayer)( + __in CONST D2D1_LAYER_PARAMETERS *layerParameters, + __in ID2D1Layer *layer + ) PURE; + + + // + // Ends a layer that was defined with particular layer resources. + // + STDMETHOD_(void, PopLayer)( + ) PURE; + + STDMETHOD(Flush)( + __out_opt D2D1_TAG *tag1 = NULL, + __out_opt D2D1_TAG *tag2 = NULL + ) PURE; + + + // + // Gets the current drawing state and saves it into the supplied + // IDrawingStatckBlock. + // + STDMETHOD_(void, SaveDrawingState)( + __inout ID2D1DrawingStateBlock *drawingStateBlock + ) CONST PURE; + + + // + // Copies the state stored in the block interface. + // + STDMETHOD_(void, RestoreDrawingState)( + __in ID2D1DrawingStateBlock *drawingStateBlock + ) PURE; + + + // + // Pushes a clip. The clip can be antialiased. The clip must be axis aligned. If + // the current world transform is not axis preserving, then the bounding box of the + // transformed clip rect will be used. The clip will remain in effect until a + // PopAxisAligned clip call is made. + // + STDMETHOD_(void, PushAxisAlignedClip)( + __in CONST D2D1_RECT_F *clipRect, + D2D1_ANTIALIAS_MODE antialiasMode + ) PURE; + + STDMETHOD_(void, PopAxisAlignedClip)( + ) PURE; + + STDMETHOD_(void, Clear)( + __in_opt CONST D2D1_COLOR_F *clearColor = NULL + ) PURE; + + + // + // Start drawing on this render target. Draw calls can only be issued between a + // BeginDraw and EndDraw call. + // + STDMETHOD_(void, BeginDraw)( + ) PURE; + + + // + // Ends drawing on the render target, error results can be retrieved at this time, + // or when calling flush. + // + STDMETHOD(EndDraw)( + __out_opt D2D1_TAG *tag1 = NULL, + __out_opt D2D1_TAG *tag2 = NULL + ) PURE; + + STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)( + ) CONST PURE; + + + // + // Sets the DPI on the render target. This results in the render target being + // interpretted to a different scale. Neither DPI can be negative. If zero is + // specified for both, the system DPI is chosen. If one is zero and the other + // unspecified, the DPI is not changed. + // + STDMETHOD_(void, SetDpi)( + FLOAT dpiX, + FLOAT dpiY + ) PURE; + + + // + // Return the current DPI from the target. + // + STDMETHOD_(void, GetDpi)( + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) CONST PURE; + + + // + // Returns the size of the render target in DIPs. + // + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ) CONST PURE; + + + // + // Returns the size of the render target in pixels. + // + STDMETHOD_(D2D1_SIZE_U, GetPixelSize)( + ) CONST PURE; + + + // + // Returns the maximum bitmap and render target size that is guaranteed to be + // supported by the render target. + // + STDMETHOD_(UINT32, GetMaximumBitmapSize)( + ) CONST PURE; + + + // + // Returns true if the given properties are supported by this render target. The + // DPI is ignored. NOTE: If the render target type is software, then neither + // D2D1_FEATURE_LEVEL_9 nor D2D1_FEATURE_LEVEL_10 will be considered to be + // supported. + // + STDMETHOD_(BOOL, IsSupported)( + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties + ) CONST PURE; + + HRESULT + CreateBitmap( + D2D1_SIZE_U size, + __in_opt CONST void *srcData, + UINT32 pitch, + CONST D2D1_BITMAP_PROPERTIES &bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) + { + return CreateBitmap(size, srcData, pitch, &bitmapProperties, bitmap); + } + + HRESULT + CreateBitmap( + D2D1_SIZE_U size, + CONST D2D1_BITMAP_PROPERTIES &bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) + { + return CreateBitmap(size, NULL, 0, &bitmapProperties, bitmap); + } + + + // + // Create a D2D bitmap by copying a WIC bitmap. + // + HRESULT + CreateBitmapFromWicBitmap( + __in IWICBitmapSource *wicBitmapSource, + CONST D2D1_BITMAP_PROPERTIES &bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) + { + return CreateBitmapFromWicBitmap(wicBitmapSource, &bitmapProperties, bitmap); + } + + + // + // Create a D2D bitmap by copying a WIC bitmap. + // + HRESULT + CreateBitmapFromWicBitmap( + __in IWICBitmapSource *wicBitmapSource, + __deref_out ID2D1Bitmap **bitmap + ) + { + return CreateBitmapFromWicBitmap(wicBitmapSource, NULL, bitmap); + } + + + // + // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill + // or pen a geometry. + // + HRESULT + CreateBitmapBrush( + __in ID2D1Bitmap *bitmap, + __deref_out ID2D1BitmapBrush **bitmapBrush + ) + { + return CreateBitmapBrush(bitmap, NULL, NULL, bitmapBrush); + } + + + // + // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill + // or pen a geometry. + // + HRESULT + CreateBitmapBrush( + __in ID2D1Bitmap *bitmap, + CONST D2D1_BITMAP_BRUSH_PROPERTIES &bitmapBrushProperties, + __deref_out ID2D1BitmapBrush **bitmapBrush + ) + { + return CreateBitmapBrush(bitmap, &bitmapBrushProperties, NULL, bitmapBrush); + } + + + // + // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill + // or pen a geometry. + // + HRESULT + CreateBitmapBrush( + __in ID2D1Bitmap *bitmap, + CONST D2D1_BITMAP_BRUSH_PROPERTIES &bitmapBrushProperties, + CONST D2D1_BRUSH_PROPERTIES &brushProperties, + __deref_out ID2D1BitmapBrush **bitmapBrush + ) + { + return CreateBitmapBrush(bitmap, &bitmapBrushProperties, &brushProperties, bitmapBrush); + } + + HRESULT + CreateSolidColorBrush( + CONST D2D1_COLOR_F &color, + __deref_out ID2D1SolidColorBrush **solidColorBrush + ) + { + return CreateSolidColorBrush(&color, NULL, solidColorBrush); + } + + HRESULT + CreateSolidColorBrush( + CONST D2D1_COLOR_F &color, + CONST D2D1_BRUSH_PROPERTIES &brushProperties, + __deref_out ID2D1SolidColorBrush **solidColorBrush + ) + { + return CreateSolidColorBrush(&color, &brushProperties, solidColorBrush); + } + + HRESULT + CreateGradientStopCollection( + __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops, + UINT gradientStopsCount, + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) + { + return CreateGradientStopCollection(gradientStops, gradientStopsCount, D2D1_GAMMA_2_2, D2D1_EXTEND_MODE_CLAMP, gradientStopCollection); + } + + HRESULT + CreateLinearGradientBrush( + CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES &linearGradientBrushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1LinearGradientBrush **linearGradientBrush + ) + { + return CreateLinearGradientBrush(&linearGradientBrushProperties, NULL, gradientStopCollection, linearGradientBrush); + } + + HRESULT + CreateLinearGradientBrush( + CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES &linearGradientBrushProperties, + CONST D2D1_BRUSH_PROPERTIES &brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1LinearGradientBrush **linearGradientBrush + ) + { + return CreateLinearGradientBrush(&linearGradientBrushProperties, &brushProperties, gradientStopCollection, linearGradientBrush); + } + + HRESULT + CreateRadialGradientBrush( + CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES &radialGradientBrushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1RadialGradientBrush **radialGradientBrush + ) + { + return CreateRadialGradientBrush(&radialGradientBrushProperties, NULL, gradientStopCollection, radialGradientBrush); + } + + HRESULT + CreateRadialGradientBrush( + CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES &radialGradientBrushProperties, + CONST D2D1_BRUSH_PROPERTIES &brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1RadialGradientBrush **radialGradientBrush + ) + { + return CreateRadialGradientBrush(&radialGradientBrushProperties, &brushProperties, gradientStopCollection, radialGradientBrush); + } + + HRESULT + CreateCompatibleRenderTarget( + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) + { + return CreateCompatibleRenderTarget(NULL, NULL, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget); + } + + HRESULT + CreateCompatibleRenderTarget( + D2D1_SIZE_F desiredSize, + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) + { + return CreateCompatibleRenderTarget(&desiredSize, NULL, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget); + } + + HRESULT + CreateCompatibleRenderTarget( + D2D1_SIZE_F desiredSize, + D2D1_SIZE_U desiredPixelSize, + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) + { + return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget); + } + + HRESULT + CreateCompatibleRenderTarget( + D2D1_SIZE_F desiredSize, + D2D1_SIZE_U desiredPixelSize, + D2D1_PIXEL_FORMAT desiredFormat, + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) + { + return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, &desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget); + } + + HRESULT + CreateCompatibleRenderTarget( + D2D1_SIZE_F desiredSize, + D2D1_SIZE_U desiredPixelSize, + D2D1_PIXEL_FORMAT desiredFormat, + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) + { + return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, &desiredFormat, options, bitmapRenderTarget); + } + + HRESULT + CreateLayer( + D2D1_SIZE_F size, + __deref_out ID2D1Layer **layer + ) + { + return CreateLayer(&size, layer); + } + + HRESULT + CreateLayer( + __deref_out ID2D1Layer **layer + ) + { + return CreateLayer(NULL, layer); + } + + void + DrawRectangle( + CONST D2D1_RECT_F &rect, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) + { + DrawRectangle(&rect, brush, strokeWidth, strokeStyle); + } + + void + FillRectangle( + CONST D2D1_RECT_F &rect, + __in ID2D1Brush *brush + ) + { + FillRectangle(&rect, brush); + } + + void + DrawRoundedRectangle( + CONST D2D1_ROUNDED_RECT &roundedRect, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) + { + DrawRoundedRectangle(&roundedRect, brush, strokeWidth, strokeStyle); + } + + void + FillRoundedRectangle( + CONST D2D1_ROUNDED_RECT &roundedRect, + __in ID2D1Brush *brush + ) + { + FillRoundedRectangle(&roundedRect, brush); + } + + void + DrawEllipse( + CONST D2D1_ELLIPSE &ellipse, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) + { + DrawEllipse(&ellipse, brush, strokeWidth, strokeStyle); + } + + void + FillEllipse( + CONST D2D1_ELLIPSE &ellipse, + __in ID2D1Brush *brush + ) + { + FillEllipse(&ellipse, brush); + } + + void + FillOpacityMask( + __in ID2D1Bitmap *opacityMask, + __in ID2D1Brush *brush, + D2D1_OPACITY_MASK_CONTENT content, + CONST D2D1_RECT_F &destinationRectangle, + CONST D2D1_RECT_F &sourceRectangle + ) + { + FillOpacityMask(opacityMask, brush, content, &destinationRectangle, &sourceRectangle); + } + + void + DrawBitmap( + __in ID2D1Bitmap *bitmap, + CONST D2D1_RECT_F &destinationRectangle, + FLOAT opacity = 1.0f, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR, + __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL + ) + { + DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, sourceRectangle); + } + + void + DrawBitmap( + __in ID2D1Bitmap *bitmap, + CONST D2D1_RECT_F &destinationRectangle, + FLOAT opacity, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode, + CONST D2D1_RECT_F &sourceRectangle + ) + { + DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, &sourceRectangle); + } + + void + SetTransform( + CONST D2D1_MATRIX_3X2_F &transform + ) + { + SetTransform(&transform); + } + + void + PushLayer( + CONST D2D1_LAYER_PARAMETERS &layerParameters, + __in ID2D1Layer *layer + ) + { + PushLayer(&layerParameters, layer); + } + + void + PushAxisAlignedClip( + CONST D2D1_RECT_F &clipRect, + D2D1_ANTIALIAS_MODE antialiasMode + ) + { + return PushAxisAlignedClip(&clipRect, antialiasMode); + } + + void + Clear( + CONST D2D1_COLOR_F &clearColor + ) + { + return Clear(&clearColor); + } + + + // + // Draws the text within the given layout rectangle and by default also snaps and + // clips it. + // + void + DrawText( + __in_ecount(stringLength) CONST WCHAR *string, + UINT stringLength, + __in IDWriteTextFormat *textFormat, + CONST D2D1_RECT_F &layoutRect, + __in ID2D1Brush *defaultForegroundBrush, + D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE, + DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL + ) + { + return DrawText(string, stringLength, textFormat, &layoutRect, defaultForegroundBrush, options, measuringMode); + } + + BOOL + IsSupported( + CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties + ) CONST + { + return IsSupported(&renderTargetProperties); + } +}; // interface ID2D1RenderTarget + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1BitmapRenderTarget +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd90695-12e2-11dc-9fed-001143a055f9") ID2D1BitmapRenderTarget : public ID2D1RenderTarget +{ + + STDMETHOD(GetBitmap)( + __deref_out ID2D1Bitmap **bitmap + ) PURE; +}; // interface ID2D1BitmapRenderTarget + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1HwndRenderTarget +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd90698-12e2-11dc-9fed-001143a055f9") ID2D1HwndRenderTarget : public ID2D1RenderTarget +{ + + STDMETHOD_(D2D1_WINDOW_STATE, CheckWindowState)( + ) PURE; + + + // + // Resize the buffer underlying the render target. This operation might fail if + // there is insufficent video memory or system memory, or if the render target is + // resized beyond the maximum bitmap size. If the method fails, the render target + // will be placed in a zombie state and D2DERR_RECREATE_TARGET will be returned + // from it when EndDraw is called. In addition an appropriate failure result will + // be returned from Resize. + // + STDMETHOD(Resize)( + __in CONST D2D1_SIZE_U *pixelSize + ) PURE; + + STDMETHOD_(HWND, GetHwnd)( + ) CONST PURE; + + HRESULT + Resize( + CONST D2D1_SIZE_U &pixelSize + ) + { + return Resize(&pixelSize); + } +}; // interface ID2D1HwndRenderTarget + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1GdiInteropRenderTarget +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("e0db51c3-6f77-4bae-b3d5-e47509b35838") ID2D1GdiInteropRenderTarget : public IUnknown +{ + + STDMETHOD(GetDC)( + D2D1_DC_INITIALIZE_MODE mode, + __out HDC *hdc + ) PURE; + + STDMETHOD(ReleaseDC)( + __in_opt CONST RECT *update + ) PURE; +}; // interface ID2D1GdiInteropRenderTarget + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1DCRenderTarget +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("1c51bc64-de61-46fd-9899-63a5d8f03950") ID2D1DCRenderTarget : public ID2D1RenderTarget +{ + + STDMETHOD(BindDC)( + __in CONST HDC hDC, + __in CONST RECT *pSubRect + ) PURE; +}; // interface ID2D1DCRenderTarget + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Factory +// +// Synopsis: +// The root factory interface for all of D2D's objects. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("06152247-6f50-465a-9245-118bfd3b6007") ID2D1Factory : public IUnknown +{ + + + // + // Cause the factory to refresh any system metrics that it might have been snapped + // on factory creation. + // + STDMETHOD(ReloadSystemMetrics)( + ) PURE; + + + // + // Retrieves the current desktop DPI. To refresh this, call ReloadSystemMetrics. + // + STDMETHOD_(void, GetDesktopDpi)( + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) PURE; + + STDMETHOD(CreateRectangleGeometry)( + __in CONST D2D1_RECT_F *rectangle, + __deref_out ID2D1RectangleGeometry **rectangleGeometry + ) PURE; + + STDMETHOD(CreateRoundedRectangleGeometry)( + __in CONST D2D1_ROUNDED_RECT *roundedRectangle, + __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry + ) PURE; + + STDMETHOD(CreateEllipseGeometry)( + __in CONST D2D1_ELLIPSE *ellipse, + __deref_out ID2D1EllipseGeometry **ellipseGeometry + ) PURE; + + + // + // Create a geometry which holds other geometries. + // + STDMETHOD(CreateGeometryGroup)( + D2D1_FILL_MODE fillMode, + __in_ecount(geometriesCount) ID2D1Geometry **geometries, + UINT geometriesCount, + __deref_out ID2D1GeometryGroup **geometryGroup + ) PURE; + + STDMETHOD(CreateTransformedGeometry)( + __in ID2D1Geometry *sourceGeometry, + __in CONST D2D1_MATRIX_3X2_F *transform, + __deref_out ID2D1TransformedGeometry **transformedGeometry + ) PURE; + + + // + // Returns an initially empty path geometry interface. A geometry sink is created + // off the interface to populate it. + // + STDMETHOD(CreatePathGeometry)( + __deref_out ID2D1PathGeometry **pathGeometry + ) PURE; + + + // + // Allows a non-default stroke style to be specified for a given geometry at draw + // time. + // + STDMETHOD(CreateStrokeStyle)( + __in CONST D2D1_STROKE_STYLE_PROPERTIES *strokeStyleProperties, + __in_ecount_opt(dashesCount) CONST FLOAT *dashes, + UINT dashesCount, + __deref_out ID2D1StrokeStyle **strokeStyle + ) PURE; + + + // + // Creates a new drawing state block, this can be used in subsequent + // SaveDrawingState and RestoreDrawingState operations on the render target. + // + STDMETHOD(CreateDrawingStateBlock)( + __in_opt CONST D2D1_DRAWING_STATE_DESCRIPTION *drawingStateDescription, + __in_opt IDWriteRenderingParams *textRenderingParams, + __deref_out ID2D1DrawingStateBlock **drawingStateBlock + ) PURE; + + + // + // Creates a render target which is a source of bitmaps. + // + STDMETHOD(CreateWicBitmapRenderTarget)( + __in IWICBitmap *target, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) PURE; + + + // + // Creates a render target that appears on the display. + // + STDMETHOD(CreateHwndRenderTarget)( + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __in CONST D2D1_HWND_RENDER_TARGET_PROPERTIES *hwndRenderTargetProperties, + __deref_out ID2D1HwndRenderTarget **hwndRenderTarget + ) PURE; + + + // + // Creates a render target that draws to a DXGI Surface. The device that owns the + // surface is used for rendering. + // + STDMETHOD(CreateDxgiSurfaceRenderTarget)( + __in IDXGISurface *dxgiSurface, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) PURE; + + + // + // Creates a render target that draws to a GDI device context. + // + STDMETHOD(CreateDCRenderTarget)( + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1DCRenderTarget **dcRenderTarget + ) PURE; + + HRESULT + CreateRectangleGeometry( + CONST D2D1_RECT_F &rectangle, + __deref_out ID2D1RectangleGeometry **rectangleGeometry + ) + { + return CreateRectangleGeometry(&rectangle, rectangleGeometry); + } + + HRESULT + CreateRoundedRectangleGeometry( + CONST D2D1_ROUNDED_RECT &roundedRectangle, + __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry + ) + { + return CreateRoundedRectangleGeometry(&roundedRectangle, roundedRectangleGeometry); + } + + HRESULT + CreateEllipseGeometry( + CONST D2D1_ELLIPSE &ellipse, + __deref_out ID2D1EllipseGeometry **ellipseGeometry + ) + { + return CreateEllipseGeometry(&ellipse, ellipseGeometry); + } + + HRESULT + CreateTransformedGeometry( + __in ID2D1Geometry *sourceGeometry, + CONST D2D1_MATRIX_3X2_F &transform, + __deref_out ID2D1TransformedGeometry **transformedGeometry + ) + { + return CreateTransformedGeometry(sourceGeometry, &transform, transformedGeometry); + } + + HRESULT + CreateStrokeStyle( + CONST D2D1_STROKE_STYLE_PROPERTIES &strokeStyleProperties, + __in_ecount(dashesCount) CONST FLOAT *dashes, + UINT dashesCount, + __deref_out ID2D1StrokeStyle **strokeStyle + ) + { + return CreateStrokeStyle(&strokeStyleProperties, dashes, dashesCount, strokeStyle); + } + + HRESULT + CreateDrawingStateBlock( + CONST D2D1_DRAWING_STATE_DESCRIPTION &drawingStateDescription, + __deref_out ID2D1DrawingStateBlock **drawingStateBlock + ) + { + return CreateDrawingStateBlock(&drawingStateDescription, NULL, drawingStateBlock); + } + + HRESULT + CreateDrawingStateBlock( + __deref_out ID2D1DrawingStateBlock **drawingStateBlock + ) + { + return CreateDrawingStateBlock(NULL, NULL, drawingStateBlock); + } + + HRESULT + CreateWicBitmapRenderTarget( + __in IWICBitmap *target, + CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) + { + return CreateWicBitmapRenderTarget(target, &renderTargetProperties, renderTarget); + } + + HRESULT + CreateHwndRenderTarget( + CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties, + CONST D2D1_HWND_RENDER_TARGET_PROPERTIES &hwndRenderTargetProperties, + __deref_out ID2D1HwndRenderTarget **hwndRenderTarget + ) + { + return CreateHwndRenderTarget(&renderTargetProperties, &hwndRenderTargetProperties, hwndRenderTarget); + } + + HRESULT + CreateDxgiSurfaceRenderTarget( + __in IDXGISurface *dxgiSurface, + CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) + { + return CreateDxgiSurfaceRenderTarget(dxgiSurface, &renderTargetProperties, renderTarget); + } +}; // interface ID2D1Factory + + + +#endif + + +EXTERN_C CONST IID IID_ID2D1Resource; +EXTERN_C CONST IID IID_ID2D1Bitmap; +EXTERN_C CONST IID IID_ID2D1GradientStopCollection; +EXTERN_C CONST IID IID_ID2D1Brush; +EXTERN_C CONST IID IID_ID2D1BitmapBrush; +EXTERN_C CONST IID IID_ID2D1SolidColorBrush; +EXTERN_C CONST IID IID_ID2D1LinearGradientBrush; +EXTERN_C CONST IID IID_ID2D1RadialGradientBrush; +EXTERN_C CONST IID IID_ID2D1StrokeStyle; +EXTERN_C CONST IID IID_ID2D1Geometry; +EXTERN_C CONST IID IID_ID2D1RectangleGeometry; +EXTERN_C CONST IID IID_ID2D1RoundedRectangleGeometry; +EXTERN_C CONST IID IID_ID2D1EllipseGeometry; +EXTERN_C CONST IID IID_ID2D1GeometryGroup; +EXTERN_C CONST IID IID_ID2D1TransformedGeometry; +EXTERN_C CONST IID IID_ID2D1SimplifiedGeometrySink; +EXTERN_C CONST IID IID_ID2D1GeometrySink; +EXTERN_C CONST IID IID_ID2D1TessellationSink; +EXTERN_C CONST IID IID_ID2D1PathGeometry; +EXTERN_C CONST IID IID_ID2D1Mesh; +EXTERN_C CONST IID IID_ID2D1Layer; +EXTERN_C CONST IID IID_ID2D1DrawingStateBlock; +EXTERN_C CONST IID IID_ID2D1RenderTarget; +EXTERN_C CONST IID IID_ID2D1BitmapRenderTarget; +EXTERN_C CONST IID IID_ID2D1HwndRenderTarget; +EXTERN_C CONST IID IID_ID2D1GdiInteropRenderTarget; +EXTERN_C CONST IID IID_ID2D1DCRenderTarget; +EXTERN_C CONST IID IID_ID2D1Factory; + + +#ifdef D2D_USE_C_DEFINITIONS + + +typedef interface ID2D1Resource ID2D1Resource; + +typedef struct ID2D1ResourceVtbl +{ + + IUnknownVtbl Base; + + + STDMETHOD_(void, GetFactory)( + ID2D1Resource *This, + __deref_out ID2D1Factory **factory + ) PURE; +} ID2D1ResourceVtbl; + +interface ID2D1Resource +{ + CONST struct ID2D1ResourceVtbl *lpVtbl; +}; + + +#define ID2D1Resource_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Resource_AddRef(This) \ + ((This)->lpVtbl->Base.AddRef((IUnknown *)This)) + +#define ID2D1Resource_Release(This) \ + ((This)->lpVtbl->Base.Release((IUnknown *)This)) + +#define ID2D1Resource_GetFactory(This, factory) \ + ((This)->lpVtbl->GetFactory(This, factory)) + +typedef interface ID2D1Bitmap ID2D1Bitmap; + +typedef struct ID2D1BitmapVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ID2D1Bitmap *This + ) PURE; + + STDMETHOD_(D2D1_SIZE_U, GetPixelSize)( + ID2D1Bitmap *This + ) PURE; + + STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)( + ID2D1Bitmap *This + ) PURE; + + STDMETHOD_(void, GetDpi)( + ID2D1Bitmap *This, + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) PURE; + + STDMETHOD(CopyFromBitmap)( + ID2D1Bitmap *This, + __in_opt CONST D2D1_POINT_2U *destPoint, + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_RECT_U *srcRect + ) PURE; + + STDMETHOD(CopyFromRenderTarget)( + ID2D1Bitmap *This, + __in_opt CONST D2D1_POINT_2U *destPoint, + __in ID2D1RenderTarget *renderTarget, + __in_opt CONST D2D1_RECT_U *srcRect + ) PURE; + + STDMETHOD(CopyFromMemory)( + ID2D1Bitmap *This, + __in_opt CONST D2D1_RECT_U *dstRect, + __in CONST void *srcData, + UINT32 pitch + ) PURE; +} ID2D1BitmapVtbl; + +interface ID2D1Bitmap +{ + CONST struct ID2D1BitmapVtbl *lpVtbl; +}; + + +#define ID2D1Bitmap_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Bitmap_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1Bitmap_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1Bitmap_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1Bitmap_GetSize(This) \ + ((This)->lpVtbl->GetSize(This)) + +#define ID2D1Bitmap_GetPixelSize(This) \ + ((This)->lpVtbl->GetPixelSize(This)) + +#define ID2D1Bitmap_GetPixelFormat(This) \ + ((This)->lpVtbl->GetPixelFormat(This)) + +#define ID2D1Bitmap_GetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->GetDpi(This, dpiX, dpiY)) + +#define ID2D1Bitmap_CopyFromBitmap(This, destPoint, bitmap, srcRect) \ + ((This)->lpVtbl->CopyFromBitmap(This, destPoint, bitmap, srcRect)) + +#define ID2D1Bitmap_CopyFromRenderTarget(This, destPoint, renderTarget, srcRect) \ + ((This)->lpVtbl->CopyFromRenderTarget(This, destPoint, renderTarget, srcRect)) + +#define ID2D1Bitmap_CopyFromMemory(This, dstRect, srcData, pitch) \ + ((This)->lpVtbl->CopyFromMemory(This, dstRect, srcData, pitch)) + +typedef interface ID2D1GradientStopCollection ID2D1GradientStopCollection; + +typedef struct ID2D1GradientStopCollectionVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(UINT32, GetGradientStopCount)( + ID2D1GradientStopCollection *This + ) PURE; + + STDMETHOD_(void, GetGradientStops)( + ID2D1GradientStopCollection *This, + __out_ecount(gradientStopsCount) D2D1_GRADIENT_STOP *gradientStops, + UINT gradientStopsCount + ) PURE; + + STDMETHOD_(D2D1_GAMMA, GetColorInterpolationGamma)( + ID2D1GradientStopCollection *This + ) PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendMode)( + ID2D1GradientStopCollection *This + ) PURE; +} ID2D1GradientStopCollectionVtbl; + +interface ID2D1GradientStopCollection +{ + CONST struct ID2D1GradientStopCollectionVtbl *lpVtbl; +}; + + +#define ID2D1GradientStopCollection_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1GradientStopCollection_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1GradientStopCollection_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1GradientStopCollection_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1GradientStopCollection_GetGradientStopCount(This) \ + ((This)->lpVtbl->GetGradientStopCount(This)) + +#define ID2D1GradientStopCollection_GetGradientStops(This, gradientStops, gradientStopsCount) \ + ((This)->lpVtbl->GetGradientStops(This, gradientStops, gradientStopsCount)) + +#define ID2D1GradientStopCollection_GetColorInterpolationGamma(This) \ + ((This)->lpVtbl->GetColorInterpolationGamma(This)) + +#define ID2D1GradientStopCollection_GetExtendMode(This) \ + ((This)->lpVtbl->GetExtendMode(This)) + +typedef interface ID2D1Brush ID2D1Brush; + +typedef struct ID2D1BrushVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(void, SetOpacity)( + ID2D1Brush *This, + FLOAT opacity + ) PURE; + + STDMETHOD_(void, SetTransform)( + ID2D1Brush *This, + __in CONST D2D1_MATRIX_3X2_F *transform + ) PURE; + + STDMETHOD_(FLOAT, GetOpacity)( + ID2D1Brush *This + ) PURE; + + STDMETHOD_(void, GetTransform)( + ID2D1Brush *This, + __out D2D1_MATRIX_3X2_F *transform + ) PURE; +} ID2D1BrushVtbl; + +interface ID2D1Brush +{ + CONST struct ID2D1BrushVtbl *lpVtbl; +}; + + +#define ID2D1Brush_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Brush_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1Brush_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1Brush_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1Brush_SetOpacity(This, opacity) \ + ((This)->lpVtbl->SetOpacity(This, opacity)) + +#define ID2D1Brush_SetTransform(This, transform) \ + ((This)->lpVtbl->SetTransform(This, transform)) + +#define ID2D1Brush_GetOpacity(This) \ + ((This)->lpVtbl->GetOpacity(This)) + +#define ID2D1Brush_GetTransform(This, transform) \ + ((This)->lpVtbl->GetTransform(This, transform)) + +typedef interface ID2D1BitmapBrush ID2D1BitmapBrush; + +typedef struct ID2D1BitmapBrushVtbl +{ + + ID2D1BrushVtbl Base; + + + STDMETHOD_(void, SetExtendModeX)( + ID2D1BitmapBrush *This, + D2D1_EXTEND_MODE extendModeX + ) PURE; + + STDMETHOD_(void, SetExtendModeY)( + ID2D1BitmapBrush *This, + D2D1_EXTEND_MODE extendModeY + ) PURE; + + STDMETHOD_(void, SetInterpolationMode)( + ID2D1BitmapBrush *This, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode + ) PURE; + + STDMETHOD_(void, SetBitmap)( + ID2D1BitmapBrush *This, + __in ID2D1Bitmap *bitmap + ) PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)( + ID2D1BitmapBrush *This + ) PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)( + ID2D1BitmapBrush *This + ) PURE; + + STDMETHOD_(D2D1_BITMAP_INTERPOLATION_MODE, GetInterpolationMode)( + ID2D1BitmapBrush *This + ) PURE; + + STDMETHOD_(void, GetBitmap)( + ID2D1BitmapBrush *This, + __deref_out ID2D1Bitmap **bitmap + ) PURE; +} ID2D1BitmapBrushVtbl; + +interface ID2D1BitmapBrush +{ + CONST struct ID2D1BitmapBrushVtbl *lpVtbl; +}; + + +#define ID2D1BitmapBrush_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1BitmapBrush_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1BitmapBrush_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1BitmapBrush_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1BitmapBrush_SetOpacity(This, opacity) \ + ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity)) + +#define ID2D1BitmapBrush_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1BitmapBrush_GetOpacity(This) \ + ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This)) + +#define ID2D1BitmapBrush_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1BitmapBrush_SetExtendModeX(This, extendModeX) \ + ((This)->lpVtbl->SetExtendModeX(This, extendModeX)) + +#define ID2D1BitmapBrush_SetExtendModeY(This, extendModeY) \ + ((This)->lpVtbl->SetExtendModeY(This, extendModeY)) + +#define ID2D1BitmapBrush_SetInterpolationMode(This, interpolationMode) \ + ((This)->lpVtbl->SetInterpolationMode(This, interpolationMode)) + +#define ID2D1BitmapBrush_SetBitmap(This, bitmap) \ + ((This)->lpVtbl->SetBitmap(This, bitmap)) + +#define ID2D1BitmapBrush_GetExtendModeX(This) \ + ((This)->lpVtbl->GetExtendModeX(This)) + +#define ID2D1BitmapBrush_GetExtendModeY(This) \ + ((This)->lpVtbl->GetExtendModeY(This)) + +#define ID2D1BitmapBrush_GetInterpolationMode(This) \ + ((This)->lpVtbl->GetInterpolationMode(This)) + +#define ID2D1BitmapBrush_GetBitmap(This, bitmap) \ + ((This)->lpVtbl->GetBitmap(This, bitmap)) + +typedef interface ID2D1SolidColorBrush ID2D1SolidColorBrush; + +typedef struct ID2D1SolidColorBrushVtbl +{ + + ID2D1BrushVtbl Base; + + + STDMETHOD_(void, SetColor)( + ID2D1SolidColorBrush *This, + __in CONST D2D1_COLOR_F *color + ) PURE; + + STDMETHOD_(D2D1_COLOR_F, GetColor)( + ID2D1SolidColorBrush *This + ) PURE; +} ID2D1SolidColorBrushVtbl; + +interface ID2D1SolidColorBrush +{ + CONST struct ID2D1SolidColorBrushVtbl *lpVtbl; +}; + + +#define ID2D1SolidColorBrush_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1SolidColorBrush_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1SolidColorBrush_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1SolidColorBrush_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1SolidColorBrush_SetOpacity(This, opacity) \ + ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity)) + +#define ID2D1SolidColorBrush_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1SolidColorBrush_GetOpacity(This) \ + ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This)) + +#define ID2D1SolidColorBrush_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1SolidColorBrush_SetColor(This, color) \ + ((This)->lpVtbl->SetColor(This, color)) + +#define ID2D1SolidColorBrush_GetColor(This) \ + ((This)->lpVtbl->GetColor(This)) + +typedef interface ID2D1LinearGradientBrush ID2D1LinearGradientBrush; + +typedef struct ID2D1LinearGradientBrushVtbl +{ + + ID2D1BrushVtbl Base; + + + STDMETHOD_(void, SetStartPoint)( + ID2D1LinearGradientBrush *This, + D2D1_POINT_2F startPoint + ) PURE; + + STDMETHOD_(void, SetEndPoint)( + ID2D1LinearGradientBrush *This, + D2D1_POINT_2F endPoint + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetStartPoint)( + ID2D1LinearGradientBrush *This + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetEndPoint)( + ID2D1LinearGradientBrush *This + ) PURE; + + STDMETHOD_(void, GetGradientStopCollection)( + ID2D1LinearGradientBrush *This, + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) PURE; +} ID2D1LinearGradientBrushVtbl; + +interface ID2D1LinearGradientBrush +{ + CONST struct ID2D1LinearGradientBrushVtbl *lpVtbl; +}; + + +#define ID2D1LinearGradientBrush_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1LinearGradientBrush_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1LinearGradientBrush_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1LinearGradientBrush_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1LinearGradientBrush_SetOpacity(This, opacity) \ + ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity)) + +#define ID2D1LinearGradientBrush_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1LinearGradientBrush_GetOpacity(This) \ + ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This)) + +#define ID2D1LinearGradientBrush_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1LinearGradientBrush_SetStartPoint(This, startPoint) \ + ((This)->lpVtbl->SetStartPoint(This, startPoint)) + +#define ID2D1LinearGradientBrush_SetEndPoint(This, endPoint) \ + ((This)->lpVtbl->SetEndPoint(This, endPoint)) + +#define ID2D1LinearGradientBrush_GetStartPoint(This) \ + ((This)->lpVtbl->GetStartPoint(This)) + +#define ID2D1LinearGradientBrush_GetEndPoint(This) \ + ((This)->lpVtbl->GetEndPoint(This)) + +#define ID2D1LinearGradientBrush_GetGradientStopCollection(This, gradientStopCollection) \ + ((This)->lpVtbl->GetGradientStopCollection(This, gradientStopCollection)) + +typedef interface ID2D1RadialGradientBrush ID2D1RadialGradientBrush; + +typedef struct ID2D1RadialGradientBrushVtbl +{ + + ID2D1BrushVtbl Base; + + + STDMETHOD_(void, SetCenter)( + ID2D1RadialGradientBrush *This, + D2D1_POINT_2F center + ) PURE; + + STDMETHOD_(void, SetGradientOriginOffset)( + ID2D1RadialGradientBrush *This, + D2D1_POINT_2F gradientOriginOffset + ) PURE; + + STDMETHOD_(void, SetRadiusX)( + ID2D1RadialGradientBrush *This, + FLOAT radiusX + ) PURE; + + STDMETHOD_(void, SetRadiusY)( + ID2D1RadialGradientBrush *This, + FLOAT radiusY + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetCenter)( + ID2D1RadialGradientBrush *This + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetGradientOriginOffset)( + ID2D1RadialGradientBrush *This + ) PURE; + + STDMETHOD_(FLOAT, GetRadiusX)( + ID2D1RadialGradientBrush *This + ) PURE; + + STDMETHOD_(FLOAT, GetRadiusY)( + ID2D1RadialGradientBrush *This + ) PURE; + + STDMETHOD_(void, GetGradientStopCollection)( + ID2D1RadialGradientBrush *This, + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) PURE; +} ID2D1RadialGradientBrushVtbl; + +interface ID2D1RadialGradientBrush +{ + CONST struct ID2D1RadialGradientBrushVtbl *lpVtbl; +}; + + +#define ID2D1RadialGradientBrush_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1RadialGradientBrush_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1RadialGradientBrush_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1RadialGradientBrush_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1RadialGradientBrush_SetOpacity(This, opacity) \ + ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity)) + +#define ID2D1RadialGradientBrush_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1RadialGradientBrush_GetOpacity(This) \ + ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This)) + +#define ID2D1RadialGradientBrush_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1RadialGradientBrush_SetCenter(This, center) \ + ((This)->lpVtbl->SetCenter(This, center)) + +#define ID2D1RadialGradientBrush_SetGradientOriginOffset(This, gradientOriginOffset) \ + ((This)->lpVtbl->SetGradientOriginOffset(This, gradientOriginOffset)) + +#define ID2D1RadialGradientBrush_SetRadiusX(This, radiusX) \ + ((This)->lpVtbl->SetRadiusX(This, radiusX)) + +#define ID2D1RadialGradientBrush_SetRadiusY(This, radiusY) \ + ((This)->lpVtbl->SetRadiusY(This, radiusY)) + +#define ID2D1RadialGradientBrush_GetCenter(This) \ + ((This)->lpVtbl->GetCenter(This)) + +#define ID2D1RadialGradientBrush_GetGradientOriginOffset(This) \ + ((This)->lpVtbl->GetGradientOriginOffset(This)) + +#define ID2D1RadialGradientBrush_GetRadiusX(This) \ + ((This)->lpVtbl->GetRadiusX(This)) + +#define ID2D1RadialGradientBrush_GetRadiusY(This) \ + ((This)->lpVtbl->GetRadiusY(This)) + +#define ID2D1RadialGradientBrush_GetGradientStopCollection(This, gradientStopCollection) \ + ((This)->lpVtbl->GetGradientStopCollection(This, gradientStopCollection)) + +typedef interface ID2D1StrokeStyle ID2D1StrokeStyle; + +typedef struct ID2D1StrokeStyleVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(D2D1_CAP_STYLE, GetStartCap)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(D2D1_CAP_STYLE, GetEndCap)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(D2D1_CAP_STYLE, GetDashCap)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(FLOAT, GetMiterLimit)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(D2D1_LINE_JOIN, GetLineJoin)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(FLOAT, GetDashOffset)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(D2D1_DASH_STYLE, GetDashStyle)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(UINT32, GetDashesCount)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(void, GetDashes)( + ID2D1StrokeStyle *This, + __out_ecount(dashesCount) FLOAT *dashes, + UINT dashesCount + ) PURE; +} ID2D1StrokeStyleVtbl; + +interface ID2D1StrokeStyle +{ + CONST struct ID2D1StrokeStyleVtbl *lpVtbl; +}; + + +#define ID2D1StrokeStyle_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1StrokeStyle_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1StrokeStyle_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1StrokeStyle_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1StrokeStyle_GetStartCap(This) \ + ((This)->lpVtbl->GetStartCap(This)) + +#define ID2D1StrokeStyle_GetEndCap(This) \ + ((This)->lpVtbl->GetEndCap(This)) + +#define ID2D1StrokeStyle_GetDashCap(This) \ + ((This)->lpVtbl->GetDashCap(This)) + +#define ID2D1StrokeStyle_GetMiterLimit(This) \ + ((This)->lpVtbl->GetMiterLimit(This)) + +#define ID2D1StrokeStyle_GetLineJoin(This) \ + ((This)->lpVtbl->GetLineJoin(This)) + +#define ID2D1StrokeStyle_GetDashOffset(This) \ + ((This)->lpVtbl->GetDashOffset(This)) + +#define ID2D1StrokeStyle_GetDashStyle(This) \ + ((This)->lpVtbl->GetDashStyle(This)) + +#define ID2D1StrokeStyle_GetDashesCount(This) \ + ((This)->lpVtbl->GetDashesCount(This)) + +#define ID2D1StrokeStyle_GetDashes(This, dashes, dashesCount) \ + ((This)->lpVtbl->GetDashes(This, dashes, dashesCount)) + +typedef interface ID2D1Geometry ID2D1Geometry; + +typedef struct ID2D1GeometryVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD(GetBounds)( + ID2D1Geometry *This, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out D2D1_RECT_F *bounds + ) PURE; + + STDMETHOD(GetWidenedBounds)( + ID2D1Geometry *This, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out D2D1_RECT_F *bounds + ) PURE; + + STDMETHOD(StrokeContainsPoint)( + ID2D1Geometry *This, + D2D1_POINT_2F point, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) PURE; + + STDMETHOD(FillContainsPoint)( + ID2D1Geometry *This, + D2D1_POINT_2F point, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) PURE; + + STDMETHOD(CompareWithGeometry)( + ID2D1Geometry *This, + __in ID2D1Geometry *inputGeometry, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + FLOAT flatteningTolerance, + __out D2D1_GEOMETRY_RELATION *relation + ) PURE; + + STDMETHOD(Simplify)( + ID2D1Geometry *This, + D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) PURE; + + STDMETHOD(Tessellate)( + ID2D1Geometry *This, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1TessellationSink *tessellationSink + ) PURE; + + STDMETHOD(CombineWithGeometry)( + ID2D1Geometry *This, + __in ID2D1Geometry *inputGeometry, + D2D1_COMBINE_MODE combineMode, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) PURE; + + STDMETHOD(Outline)( + ID2D1Geometry *This, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) PURE; + + STDMETHOD(ComputeArea)( + ID2D1Geometry *This, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *area + ) PURE; + + STDMETHOD(ComputeLength)( + ID2D1Geometry *This, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *length + ) PURE; + + STDMETHOD(ComputePointAtLength)( + ID2D1Geometry *This, + FLOAT length, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out_opt D2D1_POINT_2F *point, + __out_opt D2D1_POINT_2F *unitTangentVector + ) PURE; + + STDMETHOD(Widen)( + ID2D1Geometry *This, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) PURE; +} ID2D1GeometryVtbl; + +interface ID2D1Geometry +{ + CONST struct ID2D1GeometryVtbl *lpVtbl; +}; + + +#define ID2D1Geometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Geometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1Geometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1Geometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1Geometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->GetBounds(This, worldTransform, bounds)) + +#define ID2D1Geometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1Geometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1Geometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1Geometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1Geometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1Geometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Tessellate(This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1Geometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1Geometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Outline(This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1Geometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->ComputeArea(This, worldTransform, flatteningTolerance, area)) + +#define ID2D1Geometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->ComputeLength(This, worldTransform, flatteningTolerance, length)) + +#define ID2D1Geometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1Geometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +typedef interface ID2D1RectangleGeometry ID2D1RectangleGeometry; + +typedef struct ID2D1RectangleGeometryVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD_(void, GetRect)( + ID2D1RectangleGeometry *This, + __out D2D1_RECT_F *rect + ) PURE; +} ID2D1RectangleGeometryVtbl; + +interface ID2D1RectangleGeometry +{ + CONST struct ID2D1RectangleGeometryVtbl *lpVtbl; +}; + + +#define ID2D1RectangleGeometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1RectangleGeometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1RectangleGeometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1RectangleGeometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1RectangleGeometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1RectangleGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1RectangleGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1RectangleGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1RectangleGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1RectangleGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RectangleGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1RectangleGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RectangleGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RectangleGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1RectangleGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1RectangleGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1RectangleGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RectangleGeometry_GetRect(This, rect) \ + ((This)->lpVtbl->GetRect(This, rect)) + +typedef interface ID2D1RoundedRectangleGeometry ID2D1RoundedRectangleGeometry; + +typedef struct ID2D1RoundedRectangleGeometryVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD_(void, GetRoundedRect)( + ID2D1RoundedRectangleGeometry *This, + __out D2D1_ROUNDED_RECT *roundedRect + ) PURE; +} ID2D1RoundedRectangleGeometryVtbl; + +interface ID2D1RoundedRectangleGeometry +{ + CONST struct ID2D1RoundedRectangleGeometryVtbl *lpVtbl; +}; + + +#define ID2D1RoundedRectangleGeometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1RoundedRectangleGeometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1RoundedRectangleGeometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1RoundedRectangleGeometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1RoundedRectangleGeometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1RoundedRectangleGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1RoundedRectangleGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1RoundedRectangleGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1RoundedRectangleGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1RoundedRectangleGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RoundedRectangleGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1RoundedRectangleGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RoundedRectangleGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RoundedRectangleGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1RoundedRectangleGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1RoundedRectangleGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1RoundedRectangleGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RoundedRectangleGeometry_GetRoundedRect(This, roundedRect) \ + ((This)->lpVtbl->GetRoundedRect(This, roundedRect)) + +typedef interface ID2D1EllipseGeometry ID2D1EllipseGeometry; + +typedef struct ID2D1EllipseGeometryVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD_(void, GetEllipse)( + ID2D1EllipseGeometry *This, + __out D2D1_ELLIPSE *ellipse + ) PURE; +} ID2D1EllipseGeometryVtbl; + +interface ID2D1EllipseGeometry +{ + CONST struct ID2D1EllipseGeometryVtbl *lpVtbl; +}; + + +#define ID2D1EllipseGeometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1EllipseGeometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1EllipseGeometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1EllipseGeometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1EllipseGeometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1EllipseGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1EllipseGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1EllipseGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1EllipseGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1EllipseGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1EllipseGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1EllipseGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1EllipseGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1EllipseGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1EllipseGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1EllipseGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1EllipseGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1EllipseGeometry_GetEllipse(This, ellipse) \ + ((This)->lpVtbl->GetEllipse(This, ellipse)) + +typedef interface ID2D1GeometryGroup ID2D1GeometryGroup; + +typedef struct ID2D1GeometryGroupVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD_(D2D1_FILL_MODE, GetFillMode)( + ID2D1GeometryGroup *This + ) PURE; + + STDMETHOD_(UINT32, GetSourceGeometryCount)( + ID2D1GeometryGroup *This + ) PURE; + + STDMETHOD_(void, GetSourceGeometries)( + ID2D1GeometryGroup *This, + __out_ecount(geometriesCount) ID2D1Geometry **geometries, + UINT geometriesCount + ) PURE; +} ID2D1GeometryGroupVtbl; + +interface ID2D1GeometryGroup +{ + CONST struct ID2D1GeometryGroupVtbl *lpVtbl; +}; + + +#define ID2D1GeometryGroup_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1GeometryGroup_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1GeometryGroup_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1GeometryGroup_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1GeometryGroup_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1GeometryGroup_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1GeometryGroup_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1GeometryGroup_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1GeometryGroup_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1GeometryGroup_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1GeometryGroup_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1GeometryGroup_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1GeometryGroup_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1GeometryGroup_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1GeometryGroup_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1GeometryGroup_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1GeometryGroup_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1GeometryGroup_GetFillMode(This) \ + ((This)->lpVtbl->GetFillMode(This)) + +#define ID2D1GeometryGroup_GetSourceGeometryCount(This) \ + ((This)->lpVtbl->GetSourceGeometryCount(This)) + +#define ID2D1GeometryGroup_GetSourceGeometries(This, geometries, geometriesCount) \ + ((This)->lpVtbl->GetSourceGeometries(This, geometries, geometriesCount)) + +typedef interface ID2D1TransformedGeometry ID2D1TransformedGeometry; + +typedef struct ID2D1TransformedGeometryVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD_(void, GetSourceGeometry)( + ID2D1TransformedGeometry *This, + __deref_out ID2D1Geometry **sourceGeometry + ) PURE; + + STDMETHOD_(void, GetTransform)( + ID2D1TransformedGeometry *This, + __out D2D1_MATRIX_3X2_F *transform + ) PURE; +} ID2D1TransformedGeometryVtbl; + +interface ID2D1TransformedGeometry +{ + CONST struct ID2D1TransformedGeometryVtbl *lpVtbl; +}; + + +#define ID2D1TransformedGeometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1TransformedGeometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1TransformedGeometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1TransformedGeometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1TransformedGeometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1TransformedGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1TransformedGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1TransformedGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1TransformedGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1TransformedGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1TransformedGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1TransformedGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1TransformedGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1TransformedGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1TransformedGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1TransformedGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1TransformedGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1TransformedGeometry_GetSourceGeometry(This, sourceGeometry) \ + ((This)->lpVtbl->GetSourceGeometry(This, sourceGeometry)) + +#define ID2D1TransformedGeometry_GetTransform(This, transform) \ + ((This)->lpVtbl->GetTransform(This, transform)) + +typedef interface ID2D1SimplifiedGeometrySink ID2D1SimplifiedGeometrySink; + +typedef struct ID2D1SimplifiedGeometrySinkVtbl +{ + + IUnknownVtbl Base; + + + STDMETHOD_(void, SetFillMode)( + ID2D1SimplifiedGeometrySink *This, + D2D1_FILL_MODE fillMode + ) PURE; + + STDMETHOD_(void, SetSegmentFlags)( + ID2D1SimplifiedGeometrySink *This, + D2D1_PATH_SEGMENT vertexFlags + ) PURE; + + STDMETHOD_(void, BeginFigure)( + ID2D1SimplifiedGeometrySink *This, + D2D1_POINT_2F startPoint, + D2D1_FIGURE_BEGIN figureBegin + ) PURE; + + STDMETHOD_(void, AddLines)( + ID2D1SimplifiedGeometrySink *This, + __in_ecount(pointsCount) CONST D2D1_POINT_2F *points, + UINT pointsCount + ) PURE; + + STDMETHOD_(void, AddBeziers)( + ID2D1SimplifiedGeometrySink *This, + __in_ecount(beziersCount) CONST D2D1_BEZIER_SEGMENT *beziers, + UINT beziersCount + ) PURE; + + STDMETHOD_(void, EndFigure)( + ID2D1SimplifiedGeometrySink *This, + D2D1_FIGURE_END figureEnd + ) PURE; + + STDMETHOD(Close)( + ID2D1SimplifiedGeometrySink *This + ) PURE; +} ID2D1SimplifiedGeometrySinkVtbl; + +interface ID2D1SimplifiedGeometrySink +{ + CONST struct ID2D1SimplifiedGeometrySinkVtbl *lpVtbl; +}; + + +#define ID2D1SimplifiedGeometrySink_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1SimplifiedGeometrySink_AddRef(This) \ + ((This)->lpVtbl->Base.AddRef((IUnknown *)This)) + +#define ID2D1SimplifiedGeometrySink_Release(This) \ + ((This)->lpVtbl->Base.Release((IUnknown *)This)) + +#define ID2D1SimplifiedGeometrySink_SetFillMode(This, fillMode) \ + ((This)->lpVtbl->SetFillMode(This, fillMode)) + +#define ID2D1SimplifiedGeometrySink_SetSegmentFlags(This, vertexFlags) \ + ((This)->lpVtbl->SetSegmentFlags(This, vertexFlags)) + +#define ID2D1SimplifiedGeometrySink_BeginFigure(This, startPoint, figureBegin) \ + ((This)->lpVtbl->BeginFigure(This, startPoint, figureBegin)) + +#define ID2D1SimplifiedGeometrySink_AddLines(This, points, pointsCount) \ + ((This)->lpVtbl->AddLines(This, points, pointsCount)) + +#define ID2D1SimplifiedGeometrySink_AddBeziers(This, beziers, beziersCount) \ + ((This)->lpVtbl->AddBeziers(This, beziers, beziersCount)) + +#define ID2D1SimplifiedGeometrySink_EndFigure(This, figureEnd) \ + ((This)->lpVtbl->EndFigure(This, figureEnd)) + +#define ID2D1SimplifiedGeometrySink_Close(This) \ + ((This)->lpVtbl->Close(This)) + +typedef interface ID2D1GeometrySink ID2D1GeometrySink; + +typedef struct ID2D1GeometrySinkVtbl +{ + + ID2D1SimplifiedGeometrySinkVtbl Base; + + + STDMETHOD_(void, AddLine)( + ID2D1GeometrySink *This, + D2D1_POINT_2F point + ) PURE; + + STDMETHOD_(void, AddBezier)( + ID2D1GeometrySink *This, + __in CONST D2D1_BEZIER_SEGMENT *bezier + ) PURE; + + STDMETHOD_(void, AddQuadraticBezier)( + ID2D1GeometrySink *This, + __in CONST D2D1_QUADRATIC_BEZIER_SEGMENT *bezier + ) PURE; + + STDMETHOD_(void, AddQuadraticBeziers)( + ID2D1GeometrySink *This, + __in_ecount(beziersCount) CONST D2D1_QUADRATIC_BEZIER_SEGMENT *beziers, + UINT beziersCount + ) PURE; + + STDMETHOD_(void, AddArc)( + ID2D1GeometrySink *This, + __in CONST D2D1_ARC_SEGMENT *arc + ) PURE; +} ID2D1GeometrySinkVtbl; + +interface ID2D1GeometrySink +{ + CONST struct ID2D1GeometrySinkVtbl *lpVtbl; +}; + + +#define ID2D1GeometrySink_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1GeometrySink_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1GeometrySink_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1GeometrySink_SetFillMode(This, fillMode) \ + ((This)->lpVtbl->Base.SetFillMode((ID2D1SimplifiedGeometrySink *)This, fillMode)) + +#define ID2D1GeometrySink_SetSegmentFlags(This, vertexFlags) \ + ((This)->lpVtbl->Base.SetSegmentFlags((ID2D1SimplifiedGeometrySink *)This, vertexFlags)) + +#define ID2D1GeometrySink_BeginFigure(This, startPoint, figureBegin) \ + ((This)->lpVtbl->Base.BeginFigure((ID2D1SimplifiedGeometrySink *)This, startPoint, figureBegin)) + +#define ID2D1GeometrySink_AddLines(This, points, pointsCount) \ + ((This)->lpVtbl->Base.AddLines((ID2D1SimplifiedGeometrySink *)This, points, pointsCount)) + +#define ID2D1GeometrySink_AddBeziers(This, beziers, beziersCount) \ + ((This)->lpVtbl->Base.AddBeziers((ID2D1SimplifiedGeometrySink *)This, beziers, beziersCount)) + +#define ID2D1GeometrySink_EndFigure(This, figureEnd) \ + ((This)->lpVtbl->Base.EndFigure((ID2D1SimplifiedGeometrySink *)This, figureEnd)) + +#define ID2D1GeometrySink_Close(This) \ + ((This)->lpVtbl->Base.Close((ID2D1SimplifiedGeometrySink *)This)) + +#define ID2D1GeometrySink_AddLine(This, point) \ + ((This)->lpVtbl->AddLine(This, point)) + +#define ID2D1GeometrySink_AddBezier(This, bezier) \ + ((This)->lpVtbl->AddBezier(This, bezier)) + +#define ID2D1GeometrySink_AddQuadraticBezier(This, bezier) \ + ((This)->lpVtbl->AddQuadraticBezier(This, bezier)) + +#define ID2D1GeometrySink_AddQuadraticBeziers(This, beziers, beziersCount) \ + ((This)->lpVtbl->AddQuadraticBeziers(This, beziers, beziersCount)) + +#define ID2D1GeometrySink_AddArc(This, arc) \ + ((This)->lpVtbl->AddArc(This, arc)) + +typedef interface ID2D1TessellationSink ID2D1TessellationSink; + +typedef struct ID2D1TessellationSinkVtbl +{ + + IUnknownVtbl Base; + + + STDMETHOD_(void, AddTriangles)( + ID2D1TessellationSink *This, + __in_ecount(trianglesCount) CONST D2D1_TRIANGLE *triangles, + UINT trianglesCount + ) PURE; + + STDMETHOD(Close)( + ID2D1TessellationSink *This + ) PURE; +} ID2D1TessellationSinkVtbl; + +interface ID2D1TessellationSink +{ + CONST struct ID2D1TessellationSinkVtbl *lpVtbl; +}; + + +#define ID2D1TessellationSink_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1TessellationSink_AddRef(This) \ + ((This)->lpVtbl->Base.AddRef((IUnknown *)This)) + +#define ID2D1TessellationSink_Release(This) \ + ((This)->lpVtbl->Base.Release((IUnknown *)This)) + +#define ID2D1TessellationSink_AddTriangles(This, triangles, trianglesCount) \ + ((This)->lpVtbl->AddTriangles(This, triangles, trianglesCount)) + +#define ID2D1TessellationSink_Close(This) \ + ((This)->lpVtbl->Close(This)) + +typedef interface ID2D1PathGeometry ID2D1PathGeometry; + +typedef struct ID2D1PathGeometryVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD(Open)( + ID2D1PathGeometry *This, + __deref_out ID2D1GeometrySink **geometrySink + ) PURE; + + STDMETHOD(Stream)( + ID2D1PathGeometry *This, + __in ID2D1GeometrySink *geometrySink + ) PURE; + + STDMETHOD(GetSegmentCount)( + ID2D1PathGeometry *This, + __out UINT32 *count + ) PURE; + + STDMETHOD(GetFigureCount)( + ID2D1PathGeometry *This, + __out UINT32 *count + ) PURE; +} ID2D1PathGeometryVtbl; + +interface ID2D1PathGeometry +{ + CONST struct ID2D1PathGeometryVtbl *lpVtbl; +}; + + +#define ID2D1PathGeometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1PathGeometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1PathGeometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1PathGeometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1PathGeometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1PathGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1PathGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1PathGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1PathGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1PathGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1PathGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1PathGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1PathGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1PathGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1PathGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1PathGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1PathGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1PathGeometry_Open(This, geometrySink) \ + ((This)->lpVtbl->Open(This, geometrySink)) + +#define ID2D1PathGeometry_Stream(This, geometrySink) \ + ((This)->lpVtbl->Stream(This, geometrySink)) + +#define ID2D1PathGeometry_GetSegmentCount(This, count) \ + ((This)->lpVtbl->GetSegmentCount(This, count)) + +#define ID2D1PathGeometry_GetFigureCount(This, count) \ + ((This)->lpVtbl->GetFigureCount(This, count)) + +typedef interface ID2D1Mesh ID2D1Mesh; + +typedef struct ID2D1MeshVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD(Open)( + ID2D1Mesh *This, + __deref_out ID2D1TessellationSink **tessellationSink + ) PURE; +} ID2D1MeshVtbl; + +interface ID2D1Mesh +{ + CONST struct ID2D1MeshVtbl *lpVtbl; +}; + + +#define ID2D1Mesh_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Mesh_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1Mesh_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1Mesh_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1Mesh_Open(This, tessellationSink) \ + ((This)->lpVtbl->Open(This, tessellationSink)) + +typedef interface ID2D1Layer ID2D1Layer; + +typedef struct ID2D1LayerVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ID2D1Layer *This + ) PURE; +} ID2D1LayerVtbl; + +interface ID2D1Layer +{ + CONST struct ID2D1LayerVtbl *lpVtbl; +}; + + +#define ID2D1Layer_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Layer_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1Layer_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1Layer_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1Layer_GetSize(This) \ + ((This)->lpVtbl->GetSize(This)) + +typedef interface ID2D1DrawingStateBlock ID2D1DrawingStateBlock; + +typedef struct ID2D1DrawingStateBlockVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(void, GetDescription)( + ID2D1DrawingStateBlock *This, + __out D2D1_DRAWING_STATE_DESCRIPTION *stateDescription + ) PURE; + + STDMETHOD_(void, SetDescription)( + ID2D1DrawingStateBlock *This, + __in CONST D2D1_DRAWING_STATE_DESCRIPTION *stateDescription + ) PURE; + + STDMETHOD_(void, SetTextRenderingParams)( + ID2D1DrawingStateBlock *This, + __in_opt IDWriteRenderingParams *textRenderingParams + ) PURE; + + STDMETHOD_(void, GetTextRenderingParams)( + ID2D1DrawingStateBlock *This, + __deref_out_opt IDWriteRenderingParams **textRenderingParams + ) PURE; +} ID2D1DrawingStateBlockVtbl; + +interface ID2D1DrawingStateBlock +{ + CONST struct ID2D1DrawingStateBlockVtbl *lpVtbl; +}; + + +#define ID2D1DrawingStateBlock_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1DrawingStateBlock_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1DrawingStateBlock_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1DrawingStateBlock_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1DrawingStateBlock_GetDescription(This, stateDescription) \ + ((This)->lpVtbl->GetDescription(This, stateDescription)) + +#define ID2D1DrawingStateBlock_SetDescription(This, stateDescription) \ + ((This)->lpVtbl->SetDescription(This, stateDescription)) + +#define ID2D1DrawingStateBlock_SetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->SetTextRenderingParams(This, textRenderingParams)) + +#define ID2D1DrawingStateBlock_GetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->GetTextRenderingParams(This, textRenderingParams)) + +typedef interface ID2D1RenderTarget ID2D1RenderTarget; + +typedef struct ID2D1RenderTargetVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD(CreateBitmap)( + ID2D1RenderTarget *This, + D2D1_SIZE_U size, + __in_opt CONST void *srcData, + UINT32 pitch, + __in CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + STDMETHOD(CreateBitmapFromWicBitmap)( + ID2D1RenderTarget *This, + __in IWICBitmapSource *wicBitmapSource, + __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + STDMETHOD(CreateSharedBitmap)( + ID2D1RenderTarget *This, + __in REFIID riid, + __inout void *data, + __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + STDMETHOD(CreateBitmapBrush)( + ID2D1RenderTarget *This, + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_BITMAP_BRUSH_PROPERTIES *bitmapBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __deref_out ID2D1BitmapBrush **bitmapBrush + ) PURE; + + STDMETHOD(CreateSolidColorBrush)( + ID2D1RenderTarget *This, + __in CONST D2D1_COLOR_F *color, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __deref_out ID2D1SolidColorBrush **solidColorBrush + ) PURE; + + STDMETHOD(CreateGradientStopCollection)( + ID2D1RenderTarget *This, + __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops, + __range(>=,1) UINT gradientStopsCount, + D2D1_GAMMA colorInterpolationGamma, + D2D1_EXTEND_MODE extendMode, + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) PURE; + + STDMETHOD(CreateLinearGradientBrush)( + ID2D1RenderTarget *This, + __in CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *linearGradientBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1LinearGradientBrush **linearGradientBrush + ) PURE; + + STDMETHOD(CreateRadialGradientBrush)( + ID2D1RenderTarget *This, + __in CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *radialGradientBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1RadialGradientBrush **radialGradientBrush + ) PURE; + + STDMETHOD(CreateCompatibleRenderTarget)( + ID2D1RenderTarget *This, + __in_opt CONST D2D1_SIZE_F *desiredSize, + __in_opt CONST D2D1_SIZE_U *desiredPixelSize, + __in_opt CONST D2D1_PIXEL_FORMAT *desiredFormat, + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) PURE; + + STDMETHOD(CreateLayer)( + ID2D1RenderTarget *This, + __in_opt CONST D2D1_SIZE_F *size, + __deref_out ID2D1Layer **layer + ) PURE; + + STDMETHOD(CreateMesh)( + ID2D1RenderTarget *This, + __deref_out ID2D1Mesh **mesh + ) PURE; + + STDMETHOD_(void, DrawLine)( + ID2D1RenderTarget *This, + D2D1_POINT_2F point0, + D2D1_POINT_2F point1, + __in ID2D1Brush *brush, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle + ) PURE; + + STDMETHOD_(void, DrawRectangle)( + ID2D1RenderTarget *This, + __in CONST D2D1_RECT_F *rect, + __in ID2D1Brush *brush, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle + ) PURE; + + STDMETHOD_(void, FillRectangle)( + ID2D1RenderTarget *This, + __in CONST D2D1_RECT_F *rect, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawRoundedRectangle)( + ID2D1RenderTarget *This, + __in CONST D2D1_ROUNDED_RECT *roundedRect, + __in ID2D1Brush *brush, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle + ) PURE; + + STDMETHOD_(void, FillRoundedRectangle)( + ID2D1RenderTarget *This, + __in CONST D2D1_ROUNDED_RECT *roundedRect, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawEllipse)( + ID2D1RenderTarget *This, + __in CONST D2D1_ELLIPSE *ellipse, + __in ID2D1Brush *brush, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle + ) PURE; + + STDMETHOD_(void, FillEllipse)( + ID2D1RenderTarget *This, + __in CONST D2D1_ELLIPSE *ellipse, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawGeometry)( + ID2D1RenderTarget *This, + __in ID2D1Geometry *geometry, + __in ID2D1Brush *brush, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle + ) PURE; + + STDMETHOD_(void, FillGeometry)( + ID2D1RenderTarget *This, + __in ID2D1Geometry *geometry, + __in ID2D1Brush *brush, + __in_opt ID2D1Brush *opacityBrush + ) PURE; + + STDMETHOD_(void, FillMesh)( + ID2D1RenderTarget *This, + __in ID2D1Mesh *mesh, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, FillOpacityMask)( + ID2D1RenderTarget *This, + __in ID2D1Bitmap *opacityMask, + __in ID2D1Brush *brush, + D2D1_OPACITY_MASK_CONTENT content, + __in_opt CONST D2D1_RECT_F *destinationRectangle, + __in_opt CONST D2D1_RECT_F *sourceRectangle + ) PURE; + + STDMETHOD_(void, DrawBitmap)( + ID2D1RenderTarget *This, + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_RECT_F *destinationRectangle, + FLOAT opacity, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode, + __in_opt CONST D2D1_RECT_F *sourceRectangle + ) PURE; + + STDMETHOD_(void, DrawText)( + ID2D1RenderTarget *This, + __in_ecount(stringLength) CONST WCHAR *string, + UINT stringLength, + __in IDWriteTextFormat *textFormat, + __in CONST D2D1_RECT_F *layoutRect, + __in ID2D1Brush *defaultForegroundBrush, + D2D1_DRAW_TEXT_OPTIONS options, + DWRITE_MEASURING_MODE measuringMode + ) PURE; + + STDMETHOD_(void, DrawTextLayout)( + ID2D1RenderTarget *This, + D2D1_POINT_2F origin, + __in IDWriteTextLayout *textLayout, + __in ID2D1Brush *defaultForegroundBrush, + D2D1_DRAW_TEXT_OPTIONS options + ) PURE; + + STDMETHOD_(void, DrawGlyphRun)( + ID2D1RenderTarget *This, + D2D1_POINT_2F baselineOrigin, + __in CONST DWRITE_GLYPH_RUN *glyphRun, + __in ID2D1Brush *foregroundBrush, + DWRITE_MEASURING_MODE measuringMode + ) PURE; + + STDMETHOD_(void, SetTransform)( + ID2D1RenderTarget *This, + __in CONST D2D1_MATRIX_3X2_F *transform + ) PURE; + + STDMETHOD_(void, GetTransform)( + ID2D1RenderTarget *This, + __out D2D1_MATRIX_3X2_F *transform + ) PURE; + + STDMETHOD_(void, SetAntialiasMode)( + ID2D1RenderTarget *This, + D2D1_ANTIALIAS_MODE antialiasMode + ) PURE; + + STDMETHOD_(D2D1_ANTIALIAS_MODE, GetAntialiasMode)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(void, SetTextAntialiasMode)( + ID2D1RenderTarget *This, + D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode + ) PURE; + + STDMETHOD_(D2D1_TEXT_ANTIALIAS_MODE, GetTextAntialiasMode)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(void, SetTextRenderingParams)( + ID2D1RenderTarget *This, + __in_opt IDWriteRenderingParams *textRenderingParams + ) PURE; + + STDMETHOD_(void, GetTextRenderingParams)( + ID2D1RenderTarget *This, + __deref_out_opt IDWriteRenderingParams **textRenderingParams + ) PURE; + + STDMETHOD_(void, SetTags)( + ID2D1RenderTarget *This, + D2D1_TAG tag1, + D2D1_TAG tag2 + ) PURE; + + STDMETHOD_(void, GetTags)( + ID2D1RenderTarget *This, + __out_opt D2D1_TAG *tag1, + __out_opt D2D1_TAG *tag2 + ) PURE; + + STDMETHOD_(void, PushLayer)( + ID2D1RenderTarget *This, + __in CONST D2D1_LAYER_PARAMETERS *layerParameters, + __in ID2D1Layer *layer + ) PURE; + + STDMETHOD_(void, PopLayer)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD(Flush)( + ID2D1RenderTarget *This, + __out_opt D2D1_TAG *tag1, + __out_opt D2D1_TAG *tag2 + ) PURE; + + STDMETHOD_(void, SaveDrawingState)( + ID2D1RenderTarget *This, + __inout ID2D1DrawingStateBlock *drawingStateBlock + ) PURE; + + STDMETHOD_(void, RestoreDrawingState)( + ID2D1RenderTarget *This, + __in ID2D1DrawingStateBlock *drawingStateBlock + ) PURE; + + STDMETHOD_(void, PushAxisAlignedClip)( + ID2D1RenderTarget *This, + __in CONST D2D1_RECT_F *clipRect, + D2D1_ANTIALIAS_MODE antialiasMode + ) PURE; + + STDMETHOD_(void, PopAxisAlignedClip)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(void, Clear)( + ID2D1RenderTarget *This, + __in_opt CONST D2D1_COLOR_F *clearColor + ) PURE; + + STDMETHOD_(void, BeginDraw)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD(EndDraw)( + ID2D1RenderTarget *This, + __out_opt D2D1_TAG *tag1, + __out_opt D2D1_TAG *tag2 + ) PURE; + + STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(void, SetDpi)( + ID2D1RenderTarget *This, + FLOAT dpiX, + FLOAT dpiY + ) PURE; + + STDMETHOD_(void, GetDpi)( + ID2D1RenderTarget *This, + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) PURE; + + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(D2D1_SIZE_U, GetPixelSize)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(UINT32, GetMaximumBitmapSize)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(BOOL, IsSupported)( + ID2D1RenderTarget *This, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties + ) PURE; +} ID2D1RenderTargetVtbl; + +interface ID2D1RenderTarget +{ + CONST struct ID2D1RenderTargetVtbl *lpVtbl; +}; + + +#define ID2D1RenderTarget_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1RenderTarget_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1RenderTarget_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1RenderTarget_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1RenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \ + ((This)->lpVtbl->CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap)) + +#define ID2D1RenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \ + ((This)->lpVtbl->CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap)) + +#define ID2D1RenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \ + ((This)->lpVtbl->CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap)) + +#define ID2D1RenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \ + ((This)->lpVtbl->CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush)) + +#define ID2D1RenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \ + ((This)->lpVtbl->CreateSolidColorBrush(This, color, brushProperties, solidColorBrush)) + +#define ID2D1RenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \ + ((This)->lpVtbl->CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection)) + +#define ID2D1RenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \ + ((This)->lpVtbl->CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush)) + +#define ID2D1RenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \ + ((This)->lpVtbl->CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush)) + +#define ID2D1RenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \ + ((This)->lpVtbl->CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget)) + +#define ID2D1RenderTarget_CreateLayer(This, size, layer) \ + ((This)->lpVtbl->CreateLayer(This, size, layer)) + +#define ID2D1RenderTarget_CreateMesh(This, mesh) \ + ((This)->lpVtbl->CreateMesh(This, mesh)) + +#define ID2D1RenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle)) + +#define ID2D1RenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->DrawRectangle(This, rect, brush, strokeWidth, strokeStyle)) + +#define ID2D1RenderTarget_FillRectangle(This, rect, brush) \ + ((This)->lpVtbl->FillRectangle(This, rect, brush)) + +#define ID2D1RenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle)) + +#define ID2D1RenderTarget_FillRoundedRectangle(This, roundedRect, brush) \ + ((This)->lpVtbl->FillRoundedRectangle(This, roundedRect, brush)) + +#define ID2D1RenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle)) + +#define ID2D1RenderTarget_FillEllipse(This, ellipse, brush) \ + ((This)->lpVtbl->FillEllipse(This, ellipse, brush)) + +#define ID2D1RenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle)) + +#define ID2D1RenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \ + ((This)->lpVtbl->FillGeometry(This, geometry, brush, opacityBrush)) + +#define ID2D1RenderTarget_FillMesh(This, mesh, brush) \ + ((This)->lpVtbl->FillMesh(This, mesh, brush)) + +#define ID2D1RenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \ + ((This)->lpVtbl->FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle)) + +#define ID2D1RenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \ + ((This)->lpVtbl->DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle)) + +#define ID2D1RenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \ + ((This)->lpVtbl->DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode)) + +#define ID2D1RenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \ + ((This)->lpVtbl->DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options)) + +#define ID2D1RenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \ + ((This)->lpVtbl->DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode)) + +#define ID2D1RenderTarget_SetTransform(This, transform) \ + ((This)->lpVtbl->SetTransform(This, transform)) + +#define ID2D1RenderTarget_GetTransform(This, transform) \ + ((This)->lpVtbl->GetTransform(This, transform)) + +#define ID2D1RenderTarget_SetAntialiasMode(This, antialiasMode) \ + ((This)->lpVtbl->SetAntialiasMode(This, antialiasMode)) + +#define ID2D1RenderTarget_GetAntialiasMode(This) \ + ((This)->lpVtbl->GetAntialiasMode(This)) + +#define ID2D1RenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \ + ((This)->lpVtbl->SetTextAntialiasMode(This, textAntialiasMode)) + +#define ID2D1RenderTarget_GetTextAntialiasMode(This) \ + ((This)->lpVtbl->GetTextAntialiasMode(This)) + +#define ID2D1RenderTarget_SetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->SetTextRenderingParams(This, textRenderingParams)) + +#define ID2D1RenderTarget_GetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->GetTextRenderingParams(This, textRenderingParams)) + +#define ID2D1RenderTarget_SetTags(This, tag1, tag2) \ + ((This)->lpVtbl->SetTags(This, tag1, tag2)) + +#define ID2D1RenderTarget_GetTags(This, tag1, tag2) \ + ((This)->lpVtbl->GetTags(This, tag1, tag2)) + +#define ID2D1RenderTarget_PushLayer(This, layerParameters, layer) \ + ((This)->lpVtbl->PushLayer(This, layerParameters, layer)) + +#define ID2D1RenderTarget_PopLayer(This) \ + ((This)->lpVtbl->PopLayer(This)) + +#define ID2D1RenderTarget_Flush(This, tag1, tag2) \ + ((This)->lpVtbl->Flush(This, tag1, tag2)) + +#define ID2D1RenderTarget_SaveDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->SaveDrawingState(This, drawingStateBlock)) + +#define ID2D1RenderTarget_RestoreDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->RestoreDrawingState(This, drawingStateBlock)) + +#define ID2D1RenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \ + ((This)->lpVtbl->PushAxisAlignedClip(This, clipRect, antialiasMode)) + +#define ID2D1RenderTarget_PopAxisAlignedClip(This) \ + ((This)->lpVtbl->PopAxisAlignedClip(This)) + +#define ID2D1RenderTarget_Clear(This, clearColor) \ + ((This)->lpVtbl->Clear(This, clearColor)) + +#define ID2D1RenderTarget_BeginDraw(This) \ + ((This)->lpVtbl->BeginDraw(This)) + +#define ID2D1RenderTarget_EndDraw(This, tag1, tag2) \ + ((This)->lpVtbl->EndDraw(This, tag1, tag2)) + +#define ID2D1RenderTarget_GetPixelFormat(This) \ + ((This)->lpVtbl->GetPixelFormat(This)) + +#define ID2D1RenderTarget_SetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->SetDpi(This, dpiX, dpiY)) + +#define ID2D1RenderTarget_GetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->GetDpi(This, dpiX, dpiY)) + +#define ID2D1RenderTarget_GetSize(This) \ + ((This)->lpVtbl->GetSize(This)) + +#define ID2D1RenderTarget_GetPixelSize(This) \ + ((This)->lpVtbl->GetPixelSize(This)) + +#define ID2D1RenderTarget_GetMaximumBitmapSize(This) \ + ((This)->lpVtbl->GetMaximumBitmapSize(This)) + +#define ID2D1RenderTarget_IsSupported(This, renderTargetProperties) \ + ((This)->lpVtbl->IsSupported(This, renderTargetProperties)) + +typedef interface ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget; + +typedef struct ID2D1BitmapRenderTargetVtbl +{ + + ID2D1RenderTargetVtbl Base; + + + STDMETHOD(GetBitmap)( + ID2D1BitmapRenderTarget *This, + __deref_out ID2D1Bitmap **bitmap + ) PURE; +} ID2D1BitmapRenderTargetVtbl; + +interface ID2D1BitmapRenderTarget +{ + CONST struct ID2D1BitmapRenderTargetVtbl *lpVtbl; +}; + + +#define ID2D1BitmapRenderTarget_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1BitmapRenderTarget_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1BitmapRenderTarget_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1BitmapRenderTarget_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1BitmapRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap)) + +#define ID2D1BitmapRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap)) + +#define ID2D1BitmapRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap)) + +#define ID2D1BitmapRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \ + ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush)) + +#define ID2D1BitmapRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \ + ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush)) + +#define ID2D1BitmapRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \ + ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection)) + +#define ID2D1BitmapRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \ + ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush)) + +#define ID2D1BitmapRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \ + ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush)) + +#define ID2D1BitmapRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \ + ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget)) + +#define ID2D1BitmapRenderTarget_CreateLayer(This, size, layer) \ + ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer)) + +#define ID2D1BitmapRenderTarget_CreateMesh(This, mesh) \ + ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh)) + +#define ID2D1BitmapRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle)) + +#define ID2D1BitmapRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle)) + +#define ID2D1BitmapRenderTarget_FillRectangle(This, rect, brush) \ + ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush)) + +#define ID2D1BitmapRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle)) + +#define ID2D1BitmapRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \ + ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush)) + +#define ID2D1BitmapRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle)) + +#define ID2D1BitmapRenderTarget_FillEllipse(This, ellipse, brush) \ + ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush)) + +#define ID2D1BitmapRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle)) + +#define ID2D1BitmapRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \ + ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush)) + +#define ID2D1BitmapRenderTarget_FillMesh(This, mesh, brush) \ + ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush)) + +#define ID2D1BitmapRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \ + ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle)) + +#define ID2D1BitmapRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \ + ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle)) + +#define ID2D1BitmapRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \ + ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode)) + +#define ID2D1BitmapRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \ + ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options)) + +#define ID2D1BitmapRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \ + ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode)) + +#define ID2D1BitmapRenderTarget_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1BitmapRenderTarget_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1BitmapRenderTarget_SetAntialiasMode(This, antialiasMode) \ + ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode)) + +#define ID2D1BitmapRenderTarget_GetAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \ + ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode)) + +#define ID2D1BitmapRenderTarget_GetTextAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_SetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1BitmapRenderTarget_GetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1BitmapRenderTarget_SetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1BitmapRenderTarget_GetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1BitmapRenderTarget_PushLayer(This, layerParameters, layer) \ + ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer)) + +#define ID2D1BitmapRenderTarget_PopLayer(This) \ + ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_Flush(This, tag1, tag2) \ + ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1BitmapRenderTarget_SaveDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1BitmapRenderTarget_RestoreDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1BitmapRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \ + ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode)) + +#define ID2D1BitmapRenderTarget_PopAxisAlignedClip(This) \ + ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_Clear(This, clearColor) \ + ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor)) + +#define ID2D1BitmapRenderTarget_BeginDraw(This) \ + ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_EndDraw(This, tag1, tag2) \ + ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1BitmapRenderTarget_GetPixelFormat(This) \ + ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_SetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1BitmapRenderTarget_GetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1BitmapRenderTarget_GetSize(This) \ + ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_GetPixelSize(This) \ + ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_GetMaximumBitmapSize(This) \ + ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_IsSupported(This, renderTargetProperties) \ + ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties)) + +#define ID2D1BitmapRenderTarget_GetBitmap(This, bitmap) \ + ((This)->lpVtbl->GetBitmap(This, bitmap)) + +typedef interface ID2D1HwndRenderTarget ID2D1HwndRenderTarget; + +typedef struct ID2D1HwndRenderTargetVtbl +{ + + ID2D1RenderTargetVtbl Base; + + + STDMETHOD_(D2D1_WINDOW_STATE, CheckWindowState)( + ID2D1HwndRenderTarget *This + ) PURE; + + STDMETHOD(Resize)( + ID2D1HwndRenderTarget *This, + __in CONST D2D1_SIZE_U *pixelSize + ) PURE; + + STDMETHOD_(HWND, GetHwnd)( + ID2D1HwndRenderTarget *This + ) PURE; +} ID2D1HwndRenderTargetVtbl; + +interface ID2D1HwndRenderTarget +{ + CONST struct ID2D1HwndRenderTargetVtbl *lpVtbl; +}; + + +#define ID2D1HwndRenderTarget_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1HwndRenderTarget_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1HwndRenderTarget_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1HwndRenderTarget_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1HwndRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap)) + +#define ID2D1HwndRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap)) + +#define ID2D1HwndRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap)) + +#define ID2D1HwndRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \ + ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush)) + +#define ID2D1HwndRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \ + ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush)) + +#define ID2D1HwndRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \ + ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection)) + +#define ID2D1HwndRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \ + ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush)) + +#define ID2D1HwndRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \ + ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush)) + +#define ID2D1HwndRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \ + ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget)) + +#define ID2D1HwndRenderTarget_CreateLayer(This, size, layer) \ + ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer)) + +#define ID2D1HwndRenderTarget_CreateMesh(This, mesh) \ + ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh)) + +#define ID2D1HwndRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle)) + +#define ID2D1HwndRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle)) + +#define ID2D1HwndRenderTarget_FillRectangle(This, rect, brush) \ + ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush)) + +#define ID2D1HwndRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle)) + +#define ID2D1HwndRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \ + ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush)) + +#define ID2D1HwndRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle)) + +#define ID2D1HwndRenderTarget_FillEllipse(This, ellipse, brush) \ + ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush)) + +#define ID2D1HwndRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle)) + +#define ID2D1HwndRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \ + ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush)) + +#define ID2D1HwndRenderTarget_FillMesh(This, mesh, brush) \ + ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush)) + +#define ID2D1HwndRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \ + ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle)) + +#define ID2D1HwndRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \ + ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle)) + +#define ID2D1HwndRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \ + ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode)) + +#define ID2D1HwndRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \ + ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options)) + +#define ID2D1HwndRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \ + ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode)) + +#define ID2D1HwndRenderTarget_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1HwndRenderTarget_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1HwndRenderTarget_SetAntialiasMode(This, antialiasMode) \ + ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode)) + +#define ID2D1HwndRenderTarget_GetAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \ + ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode)) + +#define ID2D1HwndRenderTarget_GetTextAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_SetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1HwndRenderTarget_GetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1HwndRenderTarget_SetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1HwndRenderTarget_GetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1HwndRenderTarget_PushLayer(This, layerParameters, layer) \ + ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer)) + +#define ID2D1HwndRenderTarget_PopLayer(This) \ + ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_Flush(This, tag1, tag2) \ + ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1HwndRenderTarget_SaveDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1HwndRenderTarget_RestoreDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1HwndRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \ + ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode)) + +#define ID2D1HwndRenderTarget_PopAxisAlignedClip(This) \ + ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_Clear(This, clearColor) \ + ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor)) + +#define ID2D1HwndRenderTarget_BeginDraw(This) \ + ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_EndDraw(This, tag1, tag2) \ + ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1HwndRenderTarget_GetPixelFormat(This) \ + ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_SetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1HwndRenderTarget_GetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1HwndRenderTarget_GetSize(This) \ + ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_GetPixelSize(This) \ + ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_GetMaximumBitmapSize(This) \ + ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_IsSupported(This, renderTargetProperties) \ + ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties)) + +#define ID2D1HwndRenderTarget_CheckWindowState(This) \ + ((This)->lpVtbl->CheckWindowState(This)) + +#define ID2D1HwndRenderTarget_Resize(This, pixelSize) \ + ((This)->lpVtbl->Resize(This, pixelSize)) + +#define ID2D1HwndRenderTarget_GetHwnd(This) \ + ((This)->lpVtbl->GetHwnd(This)) + +typedef interface ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget; + +typedef struct ID2D1GdiInteropRenderTargetVtbl +{ + + IUnknownVtbl Base; + + + STDMETHOD(GetDC)( + ID2D1GdiInteropRenderTarget *This, + D2D1_DC_INITIALIZE_MODE mode, + __out HDC *hdc + ) PURE; + + STDMETHOD(ReleaseDC)( + ID2D1GdiInteropRenderTarget *This, + __in_opt CONST RECT *update + ) PURE; +} ID2D1GdiInteropRenderTargetVtbl; + +interface ID2D1GdiInteropRenderTarget +{ + CONST struct ID2D1GdiInteropRenderTargetVtbl *lpVtbl; +}; + + +#define ID2D1GdiInteropRenderTarget_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1GdiInteropRenderTarget_AddRef(This) \ + ((This)->lpVtbl->Base.AddRef((IUnknown *)This)) + +#define ID2D1GdiInteropRenderTarget_Release(This) \ + ((This)->lpVtbl->Base.Release((IUnknown *)This)) + +#define ID2D1GdiInteropRenderTarget_GetDC(This, mode, hdc) \ + ((This)->lpVtbl->GetDC(This, mode, hdc)) + +#define ID2D1GdiInteropRenderTarget_ReleaseDC(This, update) \ + ((This)->lpVtbl->ReleaseDC(This, update)) + +typedef interface ID2D1DCRenderTarget ID2D1DCRenderTarget; + +typedef struct ID2D1DCRenderTargetVtbl +{ + + ID2D1RenderTargetVtbl Base; + + + STDMETHOD(BindDC)( + ID2D1DCRenderTarget *This, + __in CONST HDC hDC, + __in CONST RECT *pSubRect + ) PURE; +} ID2D1DCRenderTargetVtbl; + +interface ID2D1DCRenderTarget +{ + CONST struct ID2D1DCRenderTargetVtbl *lpVtbl; +}; + + +#define ID2D1DCRenderTarget_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1DCRenderTarget_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1DCRenderTarget_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1DCRenderTarget_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1DCRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap)) + +#define ID2D1DCRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap)) + +#define ID2D1DCRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap)) + +#define ID2D1DCRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \ + ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush)) + +#define ID2D1DCRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \ + ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush)) + +#define ID2D1DCRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \ + ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection)) + +#define ID2D1DCRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \ + ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush)) + +#define ID2D1DCRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \ + ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush)) + +#define ID2D1DCRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \ + ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget)) + +#define ID2D1DCRenderTarget_CreateLayer(This, size, layer) \ + ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer)) + +#define ID2D1DCRenderTarget_CreateMesh(This, mesh) \ + ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh)) + +#define ID2D1DCRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle)) + +#define ID2D1DCRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle)) + +#define ID2D1DCRenderTarget_FillRectangle(This, rect, brush) \ + ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush)) + +#define ID2D1DCRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle)) + +#define ID2D1DCRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \ + ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush)) + +#define ID2D1DCRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle)) + +#define ID2D1DCRenderTarget_FillEllipse(This, ellipse, brush) \ + ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush)) + +#define ID2D1DCRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle)) + +#define ID2D1DCRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \ + ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush)) + +#define ID2D1DCRenderTarget_FillMesh(This, mesh, brush) \ + ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush)) + +#define ID2D1DCRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \ + ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle)) + +#define ID2D1DCRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \ + ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle)) + +#define ID2D1DCRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \ + ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode)) + +#define ID2D1DCRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \ + ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options)) + +#define ID2D1DCRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \ + ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode)) + +#define ID2D1DCRenderTarget_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1DCRenderTarget_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1DCRenderTarget_SetAntialiasMode(This, antialiasMode) \ + ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode)) + +#define ID2D1DCRenderTarget_GetAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \ + ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode)) + +#define ID2D1DCRenderTarget_GetTextAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_SetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1DCRenderTarget_GetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1DCRenderTarget_SetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1DCRenderTarget_GetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1DCRenderTarget_PushLayer(This, layerParameters, layer) \ + ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer)) + +#define ID2D1DCRenderTarget_PopLayer(This) \ + ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_Flush(This, tag1, tag2) \ + ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1DCRenderTarget_SaveDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1DCRenderTarget_RestoreDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1DCRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \ + ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode)) + +#define ID2D1DCRenderTarget_PopAxisAlignedClip(This) \ + ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_Clear(This, clearColor) \ + ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor)) + +#define ID2D1DCRenderTarget_BeginDraw(This) \ + ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_EndDraw(This, tag1, tag2) \ + ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1DCRenderTarget_GetPixelFormat(This) \ + ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_SetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1DCRenderTarget_GetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1DCRenderTarget_GetSize(This) \ + ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_GetPixelSize(This) \ + ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_GetMaximumBitmapSize(This) \ + ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_IsSupported(This, renderTargetProperties) \ + ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties)) + +#define ID2D1DCRenderTarget_BindDC(This, hDC, pSubRect) \ + ((This)->lpVtbl->BindDC(This, hDC, pSubRect)) + +typedef interface ID2D1Factory ID2D1Factory; + +typedef struct ID2D1FactoryVtbl +{ + + IUnknownVtbl Base; + + + STDMETHOD(ReloadSystemMetrics)( + ID2D1Factory *This + ) PURE; + + STDMETHOD_(void, GetDesktopDpi)( + ID2D1Factory *This, + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) PURE; + + STDMETHOD(CreateRectangleGeometry)( + ID2D1Factory *This, + __in CONST D2D1_RECT_F *rectangle, + __deref_out ID2D1RectangleGeometry **rectangleGeometry + ) PURE; + + STDMETHOD(CreateRoundedRectangleGeometry)( + ID2D1Factory *This, + __in CONST D2D1_ROUNDED_RECT *roundedRectangle, + __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry + ) PURE; + + STDMETHOD(CreateEllipseGeometry)( + ID2D1Factory *This, + __in CONST D2D1_ELLIPSE *ellipse, + __deref_out ID2D1EllipseGeometry **ellipseGeometry + ) PURE; + + STDMETHOD(CreateGeometryGroup)( + ID2D1Factory *This, + D2D1_FILL_MODE fillMode, + __in_ecount(geometriesCount) ID2D1Geometry **geometries, + UINT geometriesCount, + __deref_out ID2D1GeometryGroup **geometryGroup + ) PURE; + + STDMETHOD(CreateTransformedGeometry)( + ID2D1Factory *This, + __in ID2D1Geometry *sourceGeometry, + __in CONST D2D1_MATRIX_3X2_F *transform, + __deref_out ID2D1TransformedGeometry **transformedGeometry + ) PURE; + + STDMETHOD(CreatePathGeometry)( + ID2D1Factory *This, + __deref_out ID2D1PathGeometry **pathGeometry + ) PURE; + + STDMETHOD(CreateStrokeStyle)( + ID2D1Factory *This, + __in CONST D2D1_STROKE_STYLE_PROPERTIES *strokeStyleProperties, + __in_ecount_opt(dashesCount) CONST FLOAT *dashes, + UINT dashesCount, + __deref_out ID2D1StrokeStyle **strokeStyle + ) PURE; + + STDMETHOD(CreateDrawingStateBlock)( + ID2D1Factory *This, + __in_opt CONST D2D1_DRAWING_STATE_DESCRIPTION *drawingStateDescription, + __in_opt IDWriteRenderingParams *textRenderingParams, + __deref_out ID2D1DrawingStateBlock **drawingStateBlock + ) PURE; + + STDMETHOD(CreateWicBitmapRenderTarget)( + ID2D1Factory *This, + __in IWICBitmap *target, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) PURE; + + STDMETHOD(CreateHwndRenderTarget)( + ID2D1Factory *This, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __in CONST D2D1_HWND_RENDER_TARGET_PROPERTIES *hwndRenderTargetProperties, + __deref_out ID2D1HwndRenderTarget **hwndRenderTarget + ) PURE; + + STDMETHOD(CreateDxgiSurfaceRenderTarget)( + ID2D1Factory *This, + __in IDXGISurface *dxgiSurface, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) PURE; + + STDMETHOD(CreateDCRenderTarget)( + ID2D1Factory *This, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1DCRenderTarget **dcRenderTarget + ) PURE; +} ID2D1FactoryVtbl; + +interface ID2D1Factory +{ + CONST struct ID2D1FactoryVtbl *lpVtbl; +}; + + +#define ID2D1Factory_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Factory_AddRef(This) \ + ((This)->lpVtbl->Base.AddRef((IUnknown *)This)) + +#define ID2D1Factory_Release(This) \ + ((This)->lpVtbl->Base.Release((IUnknown *)This)) + +#define ID2D1Factory_ReloadSystemMetrics(This) \ + ((This)->lpVtbl->ReloadSystemMetrics(This)) + +#define ID2D1Factory_GetDesktopDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->GetDesktopDpi(This, dpiX, dpiY)) + +#define ID2D1Factory_CreateRectangleGeometry(This, rectangle, rectangleGeometry) \ + ((This)->lpVtbl->CreateRectangleGeometry(This, rectangle, rectangleGeometry)) + +#define ID2D1Factory_CreateRoundedRectangleGeometry(This, roundedRectangle, roundedRectangleGeometry) \ + ((This)->lpVtbl->CreateRoundedRectangleGeometry(This, roundedRectangle, roundedRectangleGeometry)) + +#define ID2D1Factory_CreateEllipseGeometry(This, ellipse, ellipseGeometry) \ + ((This)->lpVtbl->CreateEllipseGeometry(This, ellipse, ellipseGeometry)) + +#define ID2D1Factory_CreateGeometryGroup(This, fillMode, geometries, geometriesCount, geometryGroup) \ + ((This)->lpVtbl->CreateGeometryGroup(This, fillMode, geometries, geometriesCount, geometryGroup)) + +#define ID2D1Factory_CreateTransformedGeometry(This, sourceGeometry, transform, transformedGeometry) \ + ((This)->lpVtbl->CreateTransformedGeometry(This, sourceGeometry, transform, transformedGeometry)) + +#define ID2D1Factory_CreatePathGeometry(This, pathGeometry) \ + ((This)->lpVtbl->CreatePathGeometry(This, pathGeometry)) + +#define ID2D1Factory_CreateStrokeStyle(This, strokeStyleProperties, dashes, dashesCount, strokeStyle) \ + ((This)->lpVtbl->CreateStrokeStyle(This, strokeStyleProperties, dashes, dashesCount, strokeStyle)) + +#define ID2D1Factory_CreateDrawingStateBlock(This, drawingStateDescription, textRenderingParams, drawingStateBlock) \ + ((This)->lpVtbl->CreateDrawingStateBlock(This, drawingStateDescription, textRenderingParams, drawingStateBlock)) + +#define ID2D1Factory_CreateWicBitmapRenderTarget(This, target, renderTargetProperties, renderTarget) \ + ((This)->lpVtbl->CreateWicBitmapRenderTarget(This, target, renderTargetProperties, renderTarget)) + +#define ID2D1Factory_CreateHwndRenderTarget(This, renderTargetProperties, hwndRenderTargetProperties, hwndRenderTarget) \ + ((This)->lpVtbl->CreateHwndRenderTarget(This, renderTargetProperties, hwndRenderTargetProperties, hwndRenderTarget)) + +#define ID2D1Factory_CreateDxgiSurfaceRenderTarget(This, dxgiSurface, renderTargetProperties, renderTarget) \ + ((This)->lpVtbl->CreateDxgiSurfaceRenderTarget(This, dxgiSurface, renderTargetProperties, renderTarget)) + +#define ID2D1Factory_CreateDCRenderTarget(This, renderTargetProperties, dcRenderTarget) \ + ((This)->lpVtbl->CreateDCRenderTarget(This, renderTargetProperties, dcRenderTarget)) + + +#endif + + +#ifdef __cplusplus +extern "C" +{ +#endif + + // + // This export cannot be in a namespace because compiler name mangling isn't consistent + // also, this must be 'C' callable. + // + HRESULT WINAPI + D2D1CreateFactory( + __in D2D1_FACTORY_TYPE factoryType, + __in REFIID riid, + __in_opt CONST D2D1_FACTORY_OPTIONS *pFactoryOptions, + __out void **ppIFactory + ); + + + void WINAPI + D2D1MakeRotateMatrix( + __in FLOAT angle, + __in D2D1_POINT_2F center, + __out D2D1_MATRIX_3X2_F *matrix + ); + + void WINAPI + D2D1MakeSkewMatrix( + __in FLOAT angleX, + __in FLOAT angleY, + __in D2D1_POINT_2F center, + __out D2D1_MATRIX_3X2_F *matrix + ); + + BOOL WINAPI + D2D1IsMatrixInvertible( + __in CONST D2D1_MATRIX_3X2_F *matrix + ); + + BOOL WINAPI + D2D1InvertMatrix( + __inout D2D1_MATRIX_3X2_F *matrix + ); + +#ifdef __cplusplus +} +#endif + +#ifndef D2D1FORCEINLINE +#define D2D1FORCEINLINE FORCEINLINE +#endif // #ifndef D2D1FORCEINLINE + + +#include + + +#ifndef D2D_USE_C_DEFINITIONS + +inline +HRESULT +D2D1CreateFactory( + __in D2D1_FACTORY_TYPE factoryType, + __in REFIID riid, + __out void **factory + ) +{ + return + D2D1CreateFactory( + factoryType, + riid, + NULL, + factory); +} + + +template +HRESULT +D2D1CreateFactory( + __in D2D1_FACTORY_TYPE factoryType, + __out Factory **factory + ) +{ + return + D2D1CreateFactory( + factoryType, + __uuidof(Factory), + reinterpret_cast(factory)); +} + +template +HRESULT +D2D1CreateFactory( + __in D2D1_FACTORY_TYPE factoryType, + __in CONST D2D1_FACTORY_OPTIONS &factoryOptions, + __out Factory **ppFactory + ) +{ + return + D2D1CreateFactory( + factoryType, + __uuidof(Factory), + &factoryOptions, + reinterpret_cast(ppFactory)); +} + +#endif // #ifndef D2D_USE_C_DEFINITIONS +#endif // #ifndef _D2D1_H_ diff --git a/RenderDll/Dx9Sdk/Include/D2D1Helper.h b/RenderDll/Dx9Sdk/Include/D2D1Helper.h new file mode 100644 index 0000000..2f54ea2 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D2D1Helper.h @@ -0,0 +1,948 @@ + +/*=========================================================================*\ + + Copyright (c) Microsoft Corporation. All rights reserved. + + File: D2D1helper.h + + Module Name: D2D + + Description: Helper files over the D2D interfaces and APIs. + +\*=========================================================================*/ +#pragma once + +#ifndef _D2D1_HELPER_H_ +#define _D2D1_HELPER_H_ + +#ifndef _D2D1_H_ +#include +#endif // #ifndef _D2D1_H_ + +#ifndef D2D_USE_C_DEFINITIONS + +namespace D2D1 +{ + // + // Forward declared IdentityMatrix function to allow matrix class to use + // these constructors. + // + D2D1FORCEINLINE + D2D1_MATRIX_3X2_F + IdentityMatrix(); + + // + // The default trait type for objects in D2D is float. + // + template + struct TypeTraits + { + typedef D2D1_POINT_2F Point; + typedef D2D1_SIZE_F Size; + typedef D2D1_RECT_F Rect; + }; + + template<> + struct TypeTraits + { + typedef D2D1_POINT_2U Point; + typedef D2D1_SIZE_U Size; + typedef D2D1_RECT_U Rect; + }; + + static inline + FLOAT FloatMax() + { + #ifdef FLT_MAX + return FLT_MAX; + #else + return 3.402823466e+38F; + #endif + } + + // + // Construction helpers + // + template + D2D1FORCEINLINE + typename TypeTraits::Point + Point2( + Type x, + Type y + ) + { + typename TypeTraits::Point point = { x, y }; + + return point; + } + + D2D1FORCEINLINE + D2D1_POINT_2F + Point2F( + FLOAT x = 0.f, + FLOAT y = 0.f + ) + { + return Point2(x, y); + } + + D2D1FORCEINLINE + D2D1_POINT_2U + Point2U( + UINT32 x = 0, + UINT32 y = 0 + ) + { + return Point2(x, y); + } + + template + D2D1FORCEINLINE + typename TypeTraits::Size + Size( + Type width, + Type height + ) + { + typename TypeTraits::Size size = { width, height }; + + return size; + } + + D2D1FORCEINLINE + D2D1_SIZE_F + SizeF( + FLOAT width = 0.f, + FLOAT height = 0.f + ) + { + return Size(width, height); + } + + D2D1FORCEINLINE + D2D1_SIZE_U + SizeU( + UINT32 width = 0, + UINT32 height = 0 + ) + { + return Size(width, height); + } + + template + D2D1FORCEINLINE + typename TypeTraits::Rect + Rect( + Type left, + Type top, + Type right, + Type bottom + ) + { + typename TypeTraits::Rect rect = { left, top, right, bottom }; + + return rect; + } + + D2D1FORCEINLINE + D2D1_RECT_F + RectF( + FLOAT left = 0.f, + FLOAT top = 0.f, + FLOAT right = 0.f, + FLOAT bottom = 0.f + ) + { + return Rect(left, top, right, bottom); + } + + D2D1FORCEINLINE + D2D1_RECT_U + RectU( + UINT32 left = 0, + UINT32 top = 0, + UINT32 right = 0, + UINT32 bottom = 0 + ) + { + return Rect(left, top, right, bottom); + } + + D2D1FORCEINLINE + D2D1_RECT_F + InfiniteRect() + { + D2D1_RECT_F rect = { -FloatMax(), -FloatMax(), FloatMax(), FloatMax() }; + + return rect; + } + + D2D1FORCEINLINE + D2D1_ARC_SEGMENT + ArcSegment( + __in CONST D2D1_POINT_2F &point, + __in CONST D2D1_SIZE_F &size, + __in FLOAT rotationAngle, + __in D2D1_SWEEP_DIRECTION sweepDirection, + __in D2D1_ARC_SIZE arcSize + ) + { + D2D1_ARC_SEGMENT arcSegment = { point, size, rotationAngle, sweepDirection, arcSize }; + + return arcSegment; + } + + D2D1FORCEINLINE + D2D1_BEZIER_SEGMENT + BezierSegment( + __in CONST D2D1_POINT_2F &point1, + __in CONST D2D1_POINT_2F &point2, + __in CONST D2D1_POINT_2F &point3 + ) + { + D2D1_BEZIER_SEGMENT bezierSegment = { point1, point2, point3 }; + + return bezierSegment; + } + + D2D1FORCEINLINE + D2D1_ELLIPSE + Ellipse( + __in CONST D2D1_POINT_2F ¢er, + FLOAT radiusX, + FLOAT radiusY + ) + { + D2D1_ELLIPSE ellipse; + + ellipse.point = center; + ellipse.radiusX = radiusX; + ellipse.radiusY = radiusY; + + return ellipse; + } + + D2D1FORCEINLINE + D2D1_ROUNDED_RECT + RoundedRect( + __in CONST D2D1_RECT_F &rect, + FLOAT radiusX, + FLOAT radiusY + ) + { + D2D1_ROUNDED_RECT roundedRect; + + roundedRect.rect = rect; + roundedRect.radiusX = radiusX; + roundedRect.radiusY = radiusY; + + return roundedRect; + } + + D2D1FORCEINLINE + D2D1_BRUSH_PROPERTIES + BrushProperties( + __in FLOAT opacity = 1.0, + __in CONST D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix() + ) + { + D2D1_BRUSH_PROPERTIES brushProperties; + + brushProperties.opacity = opacity; + brushProperties.transform = transform; + + return brushProperties; + } + + D2D1FORCEINLINE + D2D1_GRADIENT_STOP + GradientStop( + FLOAT position, + __in CONST D2D1_COLOR_F &color + ) + { + D2D1_GRADIENT_STOP gradientStop = { position, color }; + + return gradientStop; + } + + D2D1FORCEINLINE + D2D1_QUADRATIC_BEZIER_SEGMENT + QuadraticBezierSegment( + __in CONST D2D1_POINT_2F &point1, + __in CONST D2D1_POINT_2F &point2 + ) + { + D2D1_QUADRATIC_BEZIER_SEGMENT quadraticBezier = { point1, point2 }; + + return quadraticBezier; + } + + D2D1FORCEINLINE + D2D1_STROKE_STYLE_PROPERTIES + StrokeStyleProperties( + D2D1_CAP_STYLE startCap = D2D1_CAP_STYLE_FLAT, + D2D1_CAP_STYLE endCap = D2D1_CAP_STYLE_FLAT, + D2D1_CAP_STYLE dashCap = D2D1_CAP_STYLE_FLAT, + D2D1_LINE_JOIN lineJoin = D2D1_LINE_JOIN_MITER, + FLOAT miterLimit = 10.0f, + D2D1_DASH_STYLE dashStyle = D2D1_DASH_STYLE_SOLID, + FLOAT dashOffset = 0.0f + ) + { + D2D1_STROKE_STYLE_PROPERTIES strokeStyleProperties; + + strokeStyleProperties.startCap = startCap; + strokeStyleProperties.endCap = endCap; + strokeStyleProperties.dashCap = dashCap; + strokeStyleProperties.lineJoin = lineJoin; + strokeStyleProperties.miterLimit = miterLimit; + strokeStyleProperties.dashStyle = dashStyle; + strokeStyleProperties.dashOffset = dashOffset; + + return strokeStyleProperties; + } + + D2D1FORCEINLINE + D2D1_BITMAP_BRUSH_PROPERTIES + BitmapBrushProperties( + D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP, + D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR + ) + { + D2D1_BITMAP_BRUSH_PROPERTIES bitmapBrushProperties; + + bitmapBrushProperties.extendModeX = extendModeX; + bitmapBrushProperties.extendModeY = extendModeY; + bitmapBrushProperties.interpolationMode = interpolationMode; + + return bitmapBrushProperties; + } + + D2D1FORCEINLINE + D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES + LinearGradientBrushProperties( + __in CONST D2D1_POINT_2F &startPoint, + __in CONST D2D1_POINT_2F &endPoint + ) + { + D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES linearGradientBrushProperties; + + linearGradientBrushProperties.startPoint = startPoint; + linearGradientBrushProperties.endPoint = endPoint; + + return linearGradientBrushProperties; + } + + D2D1FORCEINLINE + D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES + RadialGradientBrushProperties( + __in CONST D2D1_POINT_2F ¢er, + __in CONST D2D1_POINT_2F &gradientOriginOffset, + FLOAT radiusX, + FLOAT radiusY + ) + { + D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES radialGradientBrushProperties; + + radialGradientBrushProperties.center = center; + radialGradientBrushProperties.gradientOriginOffset = gradientOriginOffset; + radialGradientBrushProperties.radiusX = radiusX; + radialGradientBrushProperties.radiusY = radiusY; + + return radialGradientBrushProperties; + } + + // + // PixelFormat + // + D2D1FORCEINLINE + D2D1_PIXEL_FORMAT + PixelFormat( + __in DXGI_FORMAT dxgiFormat = DXGI_FORMAT_UNKNOWN, + __in D2D1_ALPHA_MODE alphaMode = D2D1_ALPHA_MODE_UNKNOWN + ) + { + D2D1_PIXEL_FORMAT pixelFormat; + + pixelFormat.format = dxgiFormat; + pixelFormat.alphaMode = alphaMode; + + return pixelFormat; + } + + // + // Bitmaps + // + D2D1FORCEINLINE + D2D1_BITMAP_PROPERTIES + BitmapProperties( + CONST D2D1_PIXEL_FORMAT &pixelFormat = D2D1::PixelFormat(), + FLOAT dpiX = 96.0f, + FLOAT dpiY = 96.0f + ) + { + D2D1_BITMAP_PROPERTIES bitmapProperties; + + bitmapProperties.pixelFormat = pixelFormat; + bitmapProperties.dpiX = dpiX; + bitmapProperties.dpiY = dpiY; + + return bitmapProperties; + } + + // + // Render Targets + // + D2D1FORCEINLINE + D2D1_RENDER_TARGET_PROPERTIES + RenderTargetProperties( + D2D1_RENDER_TARGET_TYPE type = D2D1_RENDER_TARGET_TYPE_DEFAULT, + __in CONST D2D1_PIXEL_FORMAT &pixelFormat = D2D1::PixelFormat(), + FLOAT dpiX = 0.0, + FLOAT dpiY = 0.0, + D2D1_RENDER_TARGET_USAGE usage = D2D1_RENDER_TARGET_USAGE_NONE, + D2D1_FEATURE_LEVEL minLevel = D2D1_FEATURE_LEVEL_DEFAULT + ) + { + D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties; + + renderTargetProperties.type = type; + renderTargetProperties.pixelFormat = pixelFormat; + renderTargetProperties.dpiX = dpiX; + renderTargetProperties.dpiY = dpiY; + renderTargetProperties.usage = usage; + renderTargetProperties.minLevel = minLevel; + + return renderTargetProperties; + } + + D2D1FORCEINLINE + D2D1_HWND_RENDER_TARGET_PROPERTIES + HwndRenderTargetProperties( + __in HWND hwnd, + __in D2D1_SIZE_U pixelSize = D2D1::Size(static_cast(0), static_cast(0)), + __in D2D1_PRESENT_OPTIONS presentOptions = D2D1_PRESENT_OPTIONS_NONE + ) + { + D2D1_HWND_RENDER_TARGET_PROPERTIES hwndRenderTargetProperties; + + hwndRenderTargetProperties.hwnd = hwnd; + hwndRenderTargetProperties.pixelSize = pixelSize; + hwndRenderTargetProperties.presentOptions = presentOptions; + + return hwndRenderTargetProperties; + } + + D2D1FORCEINLINE + D2D1_LAYER_PARAMETERS + LayerParameters( + __in CONST D2D1_RECT_F &contentBounds = D2D1::InfiniteRect(), + __in_opt ID2D1Geometry *geometricMask = NULL, + D2D1_ANTIALIAS_MODE maskAntialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, + D2D1_MATRIX_3X2_F maskTransform = D2D1::IdentityMatrix(), + FLOAT opacity = 1.0, + __in_opt ID2D1Brush *opacityBrush = NULL, + D2D1_LAYER_OPTIONS layerOptions = D2D1_LAYER_OPTIONS_NONE + ) + { + D2D1_LAYER_PARAMETERS layerParameters = { 0 }; + + layerParameters.contentBounds = contentBounds; + layerParameters.geometricMask = geometricMask; + layerParameters.maskAntialiasMode = maskAntialiasMode; + layerParameters.maskTransform = maskTransform; + layerParameters.opacity = opacity; + layerParameters.opacityBrush = opacityBrush; + layerParameters.layerOptions = layerOptions; + + return layerParameters; + } + + D2D1FORCEINLINE + D2D1_DRAWING_STATE_DESCRIPTION + DrawingStateDescription( + D2D1_ANTIALIAS_MODE antialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, + D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode = D2D1_TEXT_ANTIALIAS_MODE_DEFAULT, + D2D1_TAG tag1 = 0, + D2D1_TAG tag2 = 0, + __in const D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix() + ) + { + D2D1_DRAWING_STATE_DESCRIPTION drawingStateDescription; + + drawingStateDescription.antialiasMode = antialiasMode; + drawingStateDescription.textAntialiasMode = textAntialiasMode; + drawingStateDescription.tag1 = tag1; + drawingStateDescription.tag2 = tag2; + drawingStateDescription.transform = transform; + + return drawingStateDescription; + } + + // + // Colors, this enum defines a set of predefined colors. + // + class ColorF : public D2D1_COLOR_F + { + public: + + enum Enum + { + AliceBlue = 0xF0F8FF, + AntiqueWhite = 0xFAEBD7, + Aqua = 0x00FFFF, + Aquamarine = 0x7FFFD4, + Azure = 0xF0FFFF, + Beige = 0xF5F5DC, + Bisque = 0xFFE4C4, + Black = 0x000000, + BlanchedAlmond = 0xFFEBCD, + Blue = 0x0000FF, + BlueViolet = 0x8A2BE2, + Brown = 0xA52A2A, + BurlyWood = 0xDEB887, + CadetBlue = 0x5F9EA0, + Chartreuse = 0x7FFF00, + Chocolate = 0xD2691E, + Coral = 0xFF7F50, + CornflowerBlue = 0x6495ED, + Cornsilk = 0xFFF8DC, + Crimson = 0xDC143C, + Cyan = 0x00FFFF, + DarkBlue = 0x00008B, + DarkCyan = 0x008B8B, + DarkGoldenrod = 0xB8860B, + DarkGray = 0xA9A9A9, + DarkGreen = 0x006400, + DarkKhaki = 0xBDB76B, + DarkMagenta = 0x8B008B, + DarkOliveGreen = 0x556B2F, + DarkOrange = 0xFF8C00, + DarkOrchid = 0x9932CC, + DarkRed = 0x8B0000, + DarkSalmon = 0xE9967A, + DarkSeaGreen = 0x8FBC8F, + DarkSlateBlue = 0x483D8B, + DarkSlateGray = 0x2F4F4F, + DarkTurquoise = 0x00CED1, + DarkViolet = 0x9400D3, + DeepPink = 0xFF1493, + DeepSkyBlue = 0x00BFFF, + DimGray = 0x696969, + DodgerBlue = 0x1E90FF, + Firebrick = 0xB22222, + FloralWhite = 0xFFFAF0, + ForestGreen = 0x228B22, + Fuchsia = 0xFF00FF, + Gainsboro = 0xDCDCDC, + GhostWhite = 0xF8F8FF, + Gold = 0xFFD700, + Goldenrod = 0xDAA520, + Gray = 0x808080, + Green = 0x008000, + GreenYellow = 0xADFF2F, + Honeydew = 0xF0FFF0, + HotPink = 0xFF69B4, + IndianRed = 0xCD5C5C, + Indigo = 0x4B0082, + Ivory = 0xFFFFF0, + Khaki = 0xF0E68C, + Lavender = 0xE6E6FA, + LavenderBlush = 0xFFF0F5, + LawnGreen = 0x7CFC00, + LemonChiffon = 0xFFFACD, + LightBlue = 0xADD8E6, + LightCoral = 0xF08080, + LightCyan = 0xE0FFFF, + LightGoldenrodYellow = 0xFAFAD2, + LightGreen = 0x90EE90, + LightGray = 0xD3D3D3, + LightPink = 0xFFB6C1, + LightSalmon = 0xFFA07A, + LightSeaGreen = 0x20B2AA, + LightSkyBlue = 0x87CEFA, + LightSlateGray = 0x778899, + LightSteelBlue = 0xB0C4DE, + LightYellow = 0xFFFFE0, + Lime = 0x00FF00, + LimeGreen = 0x32CD32, + Linen = 0xFAF0E6, + Magenta = 0xFF00FF, + Maroon = 0x800000, + MediumAquamarine = 0x66CDAA, + MediumBlue = 0x0000CD, + MediumOrchid = 0xBA55D3, + MediumPurple = 0x9370DB, + MediumSeaGreen = 0x3CB371, + MediumSlateBlue = 0x7B68EE, + MediumSpringGreen = 0x00FA9A, + MediumTurquoise = 0x48D1CC, + MediumVioletRed = 0xC71585, + MidnightBlue = 0x191970, + MintCream = 0xF5FFFA, + MistyRose = 0xFFE4E1, + Moccasin = 0xFFE4B5, + NavajoWhite = 0xFFDEAD, + Navy = 0x000080, + OldLace = 0xFDF5E6, + Olive = 0x808000, + OliveDrab = 0x6B8E23, + Orange = 0xFFA500, + OrangeRed = 0xFF4500, + Orchid = 0xDA70D6, + PaleGoldenrod = 0xEEE8AA, + PaleGreen = 0x98FB98, + PaleTurquoise = 0xAFEEEE, + PaleVioletRed = 0xDB7093, + PapayaWhip = 0xFFEFD5, + PeachPuff = 0xFFDAB9, + Peru = 0xCD853F, + Pink = 0xFFC0CB, + Plum = 0xDDA0DD, + PowderBlue = 0xB0E0E6, + Purple = 0x800080, + Red = 0xFF0000, + RosyBrown = 0xBC8F8F, + RoyalBlue = 0x4169E1, + SaddleBrown = 0x8B4513, + Salmon = 0xFA8072, + SandyBrown = 0xF4A460, + SeaGreen = 0x2E8B57, + SeaShell = 0xFFF5EE, + Sienna = 0xA0522D, + Silver = 0xC0C0C0, + SkyBlue = 0x87CEEB, + SlateBlue = 0x6A5ACD, + SlateGray = 0x708090, + Snow = 0xFFFAFA, + SpringGreen = 0x00FF7F, + SteelBlue = 0x4682B4, + Tan = 0xD2B48C, + Teal = 0x008080, + Thistle = 0xD8BFD8, + Tomato = 0xFF6347, + Turquoise = 0x40E0D0, + Violet = 0xEE82EE, + Wheat = 0xF5DEB3, + White = 0xFFFFFF, + WhiteSmoke = 0xF5F5F5, + Yellow = 0xFFFF00, + YellowGreen = 0x9ACD32, + }; + + // + // Construct a color, note that the alpha value from the "rgb" component + // is never used. + // + D2D1FORCEINLINE + ColorF( + UINT32 rgb, + FLOAT a = 1.0 + ) + { + Init(rgb, a); + } + + D2D1FORCEINLINE + ColorF( + Enum knownColor, + FLOAT a = 1.0 + ) + { + Init(knownColor, a); + } + + D2D1FORCEINLINE + ColorF( + FLOAT r, + FLOAT g, + FLOAT b, + FLOAT a = 1.0 + ) + { + this->r = r; + this->g = g; + this->b = b; + this->a = a; + } + + private: + + D2D1FORCEINLINE + void + Init( + UINT32 rgb, + FLOAT a + ) + { + this->r = static_cast((rgb & sc_redMask) >> sc_redShift) / 255.f; + this->g = static_cast((rgb & sc_greenMask) >> sc_greenShift) / 255.f; + this->b = static_cast((rgb & sc_blueMask) >> sc_blueShift) / 255.f; + this->a = a; + } + + static const UINT32 sc_redShift = 16; + static const UINT32 sc_greenShift = 8; + static const UINT32 sc_blueShift = 0; + + static const UINT32 sc_redMask = 0xff << sc_redShift; + static const UINT32 sc_greenMask = 0xff << sc_greenShift; + static const UINT32 sc_blueMask = 0xff << sc_blueShift; + }; + + class Matrix3x2F : public D2D1_MATRIX_3X2_F + { + public: + + D2D1FORCEINLINE + Matrix3x2F( + FLOAT _11, + FLOAT _12, + FLOAT _21, + FLOAT _22, + FLOAT _31, + FLOAT _32 + ) + { + this->_11 = _11; + this->_12 = _12; + this->_21 = _21; + this->_22 = _22; + this->_31 = _31; + this->_32 = _32; + } + + // + // Creates an identity matrix + // + D2D1FORCEINLINE + Matrix3x2F( + ) + { + } + + // + // Named quasi-constructors + // + static D2D1FORCEINLINE + Matrix3x2F + Identity() + { + Matrix3x2F identity; + + identity._11 = 1.f; + identity._12 = 0.f; + identity._21 = 0.f; + identity._22 = 1.f; + identity._31 = 0.f; + identity._32 = 0.f; + + return identity; + } + + static D2D1FORCEINLINE + Matrix3x2F + Translation( + D2D1_SIZE_F size + ) + { + Matrix3x2F translation; + + translation._11 = 1.0; translation._12 = 0.0; + translation._21 = 0.0; translation._22 = 1.0; + translation._31 = size.width; translation._32 = size.height; + + return translation; + } + + static D2D1FORCEINLINE + Matrix3x2F + Translation( + FLOAT x, + FLOAT y + ) + { + return Translation(SizeF(x, y)); + } + + + static D2D1FORCEINLINE + Matrix3x2F + Scale( + D2D1_SIZE_F size, + D2D1_POINT_2F center = D2D1::Point2F() + ) + { + Matrix3x2F scale; + + scale._11 = size.width; scale._12 = 0.0; + scale._21 = 0.0; scale._22 = size.height; + scale._31 = center.x - size.width * center.x; + scale._32 = center.y - size.height * center.y; + + return scale; + } + + static D2D1FORCEINLINE + Matrix3x2F + Scale( + FLOAT x, + FLOAT y, + D2D1_POINT_2F center = D2D1::Point2F() + ) + { + return Scale(SizeF(x, y), center); + } + + static D2D1FORCEINLINE + Matrix3x2F + Rotation( + FLOAT angle, + D2D1_POINT_2F center = D2D1::Point2F() + ) + { + Matrix3x2F rotation; + + D2D1MakeRotateMatrix(angle, center, &rotation); + + return rotation; + } + + static D2D1FORCEINLINE + Matrix3x2F + Skew( + FLOAT angleX, + FLOAT angleY, + D2D1_POINT_2F center = D2D1::Point2F() + ) + { + Matrix3x2F skew; + + D2D1MakeSkewMatrix(angleX, angleY, center, &skew); + + return skew; + } + + // + // Functions for convertion from the base D2D1_MATRIX_3X2_F to this type + // without making a copy + // + static inline const Matrix3x2F* ReinterpretBaseType(const D2D1_MATRIX_3X2_F *pMatrix) + { + return static_cast(pMatrix); + } + + static inline Matrix3x2F* ReinterpretBaseType(D2D1_MATRIX_3X2_F *pMatrix) + { + return static_cast(pMatrix); + } + + inline + FLOAT + Determinant() const + { + return (_11 * _22) - (_12 * _21); + } + + inline + bool + IsInvertible() const + { + return !!D2D1IsMatrixInvertible(this); + } + + inline + bool + Invert() + { + return !!D2D1InvertMatrix(this); + } + + inline + bool + IsIdentity() const + { + return _11 == 1.f && _12 == 0.f + && _21 == 0.f && _22 == 1.f + && _31 == 0.f && _32 == 0.f; + } + + inline + void SetProduct( + const Matrix3x2F &a, + const Matrix3x2F &b + ) + { + _11 = a._11 * b._11 + a._12 * b._21; + _12 = a._11 * b._12 + a._12 * b._22; + _21 = a._21 * b._11 + a._22 * b._21; + _22 = a._21 * b._12 + a._22 * b._22; + _31 = a._31 * b._11 + a._32 * b._21 + b._31; + _32 = a._31 * b._12 + a._32 * b._22 + b._32; + } + + D2D1FORCEINLINE + Matrix3x2F + operator*( + const Matrix3x2F &matrix + ) const + { + Matrix3x2F result; + + result.SetProduct(*this, matrix); + + return result; + } + + D2D1FORCEINLINE + D2D1_POINT_2F + TransformPoint( + D2D1_POINT_2F point + ) const + { + D2D1_POINT_2F result = + { + point.x * _11 + point.y * _21 + _31, + point.x * _12 + point.y * _22 + _32 + }; + + return result; + } + }; + + D2D1FORCEINLINE + D2D1_POINT_2F + operator*( + const D2D1_POINT_2F &point, + const D2D1_MATRIX_3X2_F &matrix + ) + { + return Matrix3x2F::ReinterpretBaseType(&matrix)->TransformPoint(point); + } + + D2D1_MATRIX_3X2_F + IdentityMatrix() + { + return Matrix3x2F::Identity(); + } + +} // namespace D2D1 + +D2D1FORCEINLINE +D2D1_MATRIX_3X2_F +operator*( + const D2D1_MATRIX_3X2_F &matrix1, + const D2D1_MATRIX_3X2_F &matrix2 + ) +{ + return + (*D2D1::Matrix3x2F::ReinterpretBaseType(&matrix1)) * + (*D2D1::Matrix3x2F::ReinterpretBaseType(&matrix2)); +} + +#endif // #ifndef D2D_USE_C_DEFINITIONS + +#endif // #ifndef _D2D1_HELPER_H_ + diff --git a/RenderDll/Dx9Sdk/Include/D2DBaseTypes.h b/RenderDll/Dx9Sdk/Include/D2DBaseTypes.h new file mode 100644 index 0000000..c2ff5bb --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D2DBaseTypes.h @@ -0,0 +1,145 @@ +//--------------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This file is automatically generated. Please do not edit it directly. +// +// File name: D2DBaseTypes.h +//--------------------------------------------------------------------------- +#pragma once + + +#ifndef _D2DBASETYPES_INCLUDED +#define _D2DBASETYPES_INCLUDED + +#ifndef COM_NO_WINDOWS_H +#include +#endif // #ifndef COM_NO_WINDOWS_H + +#ifndef D3DCOLORVALUE_DEFINED + +//+----------------------------------------------------------------------------- +// +// Struct: +// D3DCOLORVALUE +// +//------------------------------------------------------------------------------ +typedef struct D3DCOLORVALUE +{ + FLOAT r; + FLOAT g; + FLOAT b; + FLOAT a; + +} D3DCOLORVALUE; + +#define D3DCOLORVALUE_DEFINED +#endif + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_POINT_2U +// +//------------------------------------------------------------------------------ +typedef struct D2D_POINT_2U +{ + UINT32 x; + UINT32 y; + +} D2D_POINT_2U; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_POINT_2F +// +//------------------------------------------------------------------------------ +typedef struct D2D_POINT_2F +{ + FLOAT x; + FLOAT y; + +} D2D_POINT_2F; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_RECT_F +// +//------------------------------------------------------------------------------ +typedef struct D2D_RECT_F +{ + FLOAT left; + FLOAT top; + FLOAT right; + FLOAT bottom; + +} D2D_RECT_F; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_RECT_U +// +//------------------------------------------------------------------------------ +typedef struct D2D_RECT_U +{ + UINT32 left; + UINT32 top; + UINT32 right; + UINT32 bottom; + +} D2D_RECT_U; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_SIZE_F +// +//------------------------------------------------------------------------------ +typedef struct D2D_SIZE_F +{ + FLOAT width; + FLOAT height; + +} D2D_SIZE_F; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_SIZE_U +// +//------------------------------------------------------------------------------ +typedef struct D2D_SIZE_U +{ + UINT32 width; + UINT32 height; + +} D2D_SIZE_U; + +typedef D3DCOLORVALUE D2D_COLOR_F; + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_MATRIX_3X2_F +// +//------------------------------------------------------------------------------ +typedef struct D2D_MATRIX_3X2_F +{ + FLOAT _11; + FLOAT _12; + FLOAT _21; + FLOAT _22; + FLOAT _31; + FLOAT _32; + +} D2D_MATRIX_3X2_F; + +#endif // #ifndef _D2DBASETYPES_INCLUDED diff --git a/RenderDll/Dx9Sdk/Include/D2Derr.h b/RenderDll/Dx9Sdk/Include/D2Derr.h new file mode 100644 index 0000000..afbaa36 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D2Derr.h @@ -0,0 +1,206 @@ +/*=========================================================================*\ + + Copyright (c) Microsoft Corporation. All rights reserved. + +\*=========================================================================*/ + +#pragma once + +/*=========================================================================*\ + D2D Status Codes +\*=========================================================================*/ + +#define FACILITY_D2D 0x899 + +#define MAKE_D2DHR( sev, code )\ + MAKE_HRESULT( sev, FACILITY_D2D, (code) ) + +#define MAKE_D2DHR_ERR( code )\ + MAKE_D2DHR( 1, code ) + + +//+---------------------------------------------------------------------------- +// +// D2D error codes +// +//------------------------------------------------------------------------------ + +// +// Error codes shared with WINCODECS +// + +// +// The pixel format is not supported. +// +#define D2DERR_UNSUPPORTED_PIXEL_FORMAT WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT + +// +// Error codes that were already returned in prior versions and were part of the +// MIL facility. + +// +// Error codes mapped from WIN32 where there isn't already another HRESULT based +// define +// + +// +// The supplied buffer was too small to accomodate the data. +// +#define D2DERR_INSUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) + + +// +// D2D specific codes +// + +// +// The object was not in the correct state to process the method. +// +#define D2DERR_WRONG_STATE MAKE_D2DHR_ERR(0x001) + +// +// The object has not yet been initialized. +// +#define D2DERR_NOT_INITIALIZED MAKE_D2DHR_ERR(0x002) + +// +// The requested opertion is not supported. +// +#define D2DERR_UNSUPPORTED_OPERATION MAKE_D2DHR_ERR(0x003) + +// +// The geomery scanner failed to process the data. +// +#define D2DERR_SCANNER_FAILED MAKE_D2DHR_ERR(0x004) + +// +// D2D could not access the screen. +// +#define D2DERR_SCREEN_ACCESS_DENIED MAKE_D2DHR_ERR(0x005) + +// +// A valid display state could not be determined. +// +#define D2DERR_DISPLAY_STATE_INVALID MAKE_D2DHR_ERR(0x006) + +// +// The supplied vector is vero. +// +#define D2DERR_ZERO_VECTOR MAKE_D2DHR_ERR(0x007) + +// +// An internal error (D2D bug) occurred. On checked builds, we would assert. +// +// The application should close this instance of D2D and should consider +// restarting its process. +// +#define D2DERR_INTERNAL_ERROR MAKE_D2DHR_ERR(0x008) + +// +// The display format we need to render is not supported by the +// hardware device. +// +#define D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED MAKE_D2DHR_ERR(0x009) + +// +// A call to this method is invalid. +// +#define D2DERR_INVALID_CALL MAKE_D2DHR_ERR(0x00A) + +// +// No HW rendering device is available for this operation. +// +#define D2DERR_NO_HARDWARE_DEVICE MAKE_D2DHR_ERR(0x00B) + +// +// There has been a presentation error that may be recoverable. The caller +// needs to recreate, rerender the entire frame, and reattempt present. +// +#define D2DERR_RECREATE_TARGET MAKE_D2DHR_ERR(0x00C) + +// +// Shader construction failed because it was too complex. +// +#define D2DERR_TOO_MANY_SHADER_ELEMENTS MAKE_D2DHR_ERR(0x00D) + +// +// Shader compilation failed. +// +#define D2DERR_SHADER_COMPILE_FAILED MAKE_D2DHR_ERR(0x00E) + +// +// Requested DX surface size exceeded maximum texture size. +// +#define D2DERR_MAX_TEXTURE_SIZE_EXCEEDED MAKE_D2DHR_ERR(0x00F) + +// +// The requested D2D version is not supported. +// +#define D2DERR_UNSUPPORTED_VERSION MAKE_D2DHR_ERR(0x010) + +// +// Invalid number. +// +#define D2DERR_BAD_NUMBER MAKE_D2DHR_ERR(0x0011) + +// +// Objects used together must be created from the same factory instance. +// +#define D2DERR_WRONG_FACTORY MAKE_D2DHR_ERR(0x012) + +// +// A layer resource can only be in use once at any point in time. +// +#define D2DERR_LAYER_ALREADY_IN_USE MAKE_D2DHR_ERR(0x013) + +// +// The pop call did not match the corresponding push call +// +#define D2DERR_POP_CALL_DID_NOT_MATCH_PUSH MAKE_D2DHR_ERR(0x014) + +// +// The resource was realized on the wrong render target +// +#define D2DERR_WRONG_RESOURCE_DOMAIN MAKE_D2DHR_ERR(0x015) + +// +// The push and pop calls were unbalanced +// +#define D2DERR_PUSH_POP_UNBALANCED MAKE_D2DHR_ERR(0x016) + +// +// Attempt to copy from a render target while a layer or clip rect is applied +// +#define D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT MAKE_D2DHR_ERR(0x017) + +// +// The brush types are incompatible for the call. +// +#define D2DERR_INCOMPATIBLE_BRUSH_TYPES MAKE_D2DHR_ERR(0x018) + +// +// An unknown win32 failure occurred. +// +#define D2DERR_WIN32_ERROR MAKE_D2DHR_ERR(0x019) + +// +// The render target is not compatible with GDI +// +#define D2DERR_TARGET_NOT_GDI_COMPATIBLE MAKE_D2DHR_ERR(0x01A) + +// +// A text client drawing effect object is of the wrong type +// +#define D2DERR_TEXT_EFFECT_IS_WRONG_TYPE MAKE_D2DHR_ERR(0x01B) + +// +// The application is holding a reference to the IDWriteTextRenderer interface +// after the corresponding DrawText or DrawTextLayout call has returned. The +// IDWriteTextRenderer instance will be zombied. +// +#define D2DERR_TEXT_RENDERER_NOT_RELEASED MAKE_D2DHR_ERR(0x01C) + +// +// The requested size is larger than the guaranteed supported texture size. +// +#define D2DERR_EXCEEDS_MAX_BITMAP_SIZE MAKE_D2DHR_ERR(0x01D) diff --git a/RenderDll/Dx9Sdk/Include/D3D10.h b/RenderDll/Dx9Sdk/Include/D3D10.h new file mode 100644 index 0000000..248999f --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3D10.h @@ -0,0 +1,6723 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d10_h__ +#define __d3d10_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D10DeviceChild_FWD_DEFINED__ +#define __ID3D10DeviceChild_FWD_DEFINED__ +typedef interface ID3D10DeviceChild ID3D10DeviceChild; +#endif /* __ID3D10DeviceChild_FWD_DEFINED__ */ + + +#ifndef __ID3D10DepthStencilState_FWD_DEFINED__ +#define __ID3D10DepthStencilState_FWD_DEFINED__ +typedef interface ID3D10DepthStencilState ID3D10DepthStencilState; +#endif /* __ID3D10DepthStencilState_FWD_DEFINED__ */ + + +#ifndef __ID3D10BlendState_FWD_DEFINED__ +#define __ID3D10BlendState_FWD_DEFINED__ +typedef interface ID3D10BlendState ID3D10BlendState; +#endif /* __ID3D10BlendState_FWD_DEFINED__ */ + + +#ifndef __ID3D10RasterizerState_FWD_DEFINED__ +#define __ID3D10RasterizerState_FWD_DEFINED__ +typedef interface ID3D10RasterizerState ID3D10RasterizerState; +#endif /* __ID3D10RasterizerState_FWD_DEFINED__ */ + + +#ifndef __ID3D10Resource_FWD_DEFINED__ +#define __ID3D10Resource_FWD_DEFINED__ +typedef interface ID3D10Resource ID3D10Resource; +#endif /* __ID3D10Resource_FWD_DEFINED__ */ + + +#ifndef __ID3D10Buffer_FWD_DEFINED__ +#define __ID3D10Buffer_FWD_DEFINED__ +typedef interface ID3D10Buffer ID3D10Buffer; +#endif /* __ID3D10Buffer_FWD_DEFINED__ */ + + +#ifndef __ID3D10Texture1D_FWD_DEFINED__ +#define __ID3D10Texture1D_FWD_DEFINED__ +typedef interface ID3D10Texture1D ID3D10Texture1D; +#endif /* __ID3D10Texture1D_FWD_DEFINED__ */ + + +#ifndef __ID3D10Texture2D_FWD_DEFINED__ +#define __ID3D10Texture2D_FWD_DEFINED__ +typedef interface ID3D10Texture2D ID3D10Texture2D; +#endif /* __ID3D10Texture2D_FWD_DEFINED__ */ + + +#ifndef __ID3D10Texture3D_FWD_DEFINED__ +#define __ID3D10Texture3D_FWD_DEFINED__ +typedef interface ID3D10Texture3D ID3D10Texture3D; +#endif /* __ID3D10Texture3D_FWD_DEFINED__ */ + + +#ifndef __ID3D10View_FWD_DEFINED__ +#define __ID3D10View_FWD_DEFINED__ +typedef interface ID3D10View ID3D10View; +#endif /* __ID3D10View_FWD_DEFINED__ */ + + +#ifndef __ID3D10ShaderResourceView_FWD_DEFINED__ +#define __ID3D10ShaderResourceView_FWD_DEFINED__ +typedef interface ID3D10ShaderResourceView ID3D10ShaderResourceView; +#endif /* __ID3D10ShaderResourceView_FWD_DEFINED__ */ + + +#ifndef __ID3D10RenderTargetView_FWD_DEFINED__ +#define __ID3D10RenderTargetView_FWD_DEFINED__ +typedef interface ID3D10RenderTargetView ID3D10RenderTargetView; +#endif /* __ID3D10RenderTargetView_FWD_DEFINED__ */ + + +#ifndef __ID3D10DepthStencilView_FWD_DEFINED__ +#define __ID3D10DepthStencilView_FWD_DEFINED__ +typedef interface ID3D10DepthStencilView ID3D10DepthStencilView; +#endif /* __ID3D10DepthStencilView_FWD_DEFINED__ */ + + +#ifndef __ID3D10VertexShader_FWD_DEFINED__ +#define __ID3D10VertexShader_FWD_DEFINED__ +typedef interface ID3D10VertexShader ID3D10VertexShader; +#endif /* __ID3D10VertexShader_FWD_DEFINED__ */ + + +#ifndef __ID3D10GeometryShader_FWD_DEFINED__ +#define __ID3D10GeometryShader_FWD_DEFINED__ +typedef interface ID3D10GeometryShader ID3D10GeometryShader; +#endif /* __ID3D10GeometryShader_FWD_DEFINED__ */ + + +#ifndef __ID3D10PixelShader_FWD_DEFINED__ +#define __ID3D10PixelShader_FWD_DEFINED__ +typedef interface ID3D10PixelShader ID3D10PixelShader; +#endif /* __ID3D10PixelShader_FWD_DEFINED__ */ + + +#ifndef __ID3D10InputLayout_FWD_DEFINED__ +#define __ID3D10InputLayout_FWD_DEFINED__ +typedef interface ID3D10InputLayout ID3D10InputLayout; +#endif /* __ID3D10InputLayout_FWD_DEFINED__ */ + + +#ifndef __ID3D10SamplerState_FWD_DEFINED__ +#define __ID3D10SamplerState_FWD_DEFINED__ +typedef interface ID3D10SamplerState ID3D10SamplerState; +#endif /* __ID3D10SamplerState_FWD_DEFINED__ */ + + +#ifndef __ID3D10Asynchronous_FWD_DEFINED__ +#define __ID3D10Asynchronous_FWD_DEFINED__ +typedef interface ID3D10Asynchronous ID3D10Asynchronous; +#endif /* __ID3D10Asynchronous_FWD_DEFINED__ */ + + +#ifndef __ID3D10Query_FWD_DEFINED__ +#define __ID3D10Query_FWD_DEFINED__ +typedef interface ID3D10Query ID3D10Query; +#endif /* __ID3D10Query_FWD_DEFINED__ */ + + +#ifndef __ID3D10Predicate_FWD_DEFINED__ +#define __ID3D10Predicate_FWD_DEFINED__ +typedef interface ID3D10Predicate ID3D10Predicate; +#endif /* __ID3D10Predicate_FWD_DEFINED__ */ + + +#ifndef __ID3D10Counter_FWD_DEFINED__ +#define __ID3D10Counter_FWD_DEFINED__ +typedef interface ID3D10Counter ID3D10Counter; +#endif /* __ID3D10Counter_FWD_DEFINED__ */ + + +#ifndef __ID3D10Device_FWD_DEFINED__ +#define __ID3D10Device_FWD_DEFINED__ +typedef interface ID3D10Device ID3D10Device; +#endif /* __ID3D10Device_FWD_DEFINED__ */ + + +#ifndef __ID3D10Multithread_FWD_DEFINED__ +#define __ID3D10Multithread_FWD_DEFINED__ +typedef interface ID3D10Multithread ID3D10Multithread; +#endif /* __ID3D10Multithread_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgi.h" +#include "d3dcommon.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d10_0000_0000 */ +/* [local] */ + +#ifndef _D3D10_CONSTANTS +#define _D3D10_CONSTANTS +#define D3D10_16BIT_INDEX_STRIP_CUT_VALUE ( 0xffff ) + +#define D3D10_32BIT_INDEX_STRIP_CUT_VALUE ( 0xffffffff ) + +#define D3D10_8BIT_INDEX_STRIP_CUT_VALUE ( 0xff ) + +#define D3D10_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT ( 9 ) + +#define D3D10_CLIP_OR_CULL_DISTANCE_COUNT ( 8 ) + +#define D3D10_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT ( 2 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT ( 14 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS ( 4 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT ( 15 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT ( 15 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT ( 64 ) + +#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT ( 1 ) + +#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS ( 1 ) + +#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT ( 128 ) + +#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST ( 1 ) + +#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT ( 128 ) + +#define D3D10_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS ( 1 ) + +#define D3D10_COMMONSHADER_SAMPLER_REGISTER_COUNT ( 16 ) + +#define D3D10_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D10_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT ( 16 ) + +#define D3D10_COMMONSHADER_SUBROUTINE_NESTING_LIMIT ( 32 ) + +#define D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_COMMONSHADER_TEMP_REGISTER_COUNT ( 4096 ) + +#define D3D10_COMMONSHADER_TEMP_REGISTER_READS_PER_INST ( 3 ) + +#define D3D10_COMMONSHADER_TEMP_REGISTER_READ_PORTS ( 3 ) + +#define D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX ( 10 ) + +#define D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN ( -10 ) + +#define D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE ( -8 ) + +#define D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE ( 7 ) + +#define D3D10_DEFAULT_BLEND_FACTOR_ALPHA ( 1.0f ) +#define D3D10_DEFAULT_BLEND_FACTOR_BLUE ( 1.0f ) +#define D3D10_DEFAULT_BLEND_FACTOR_GREEN ( 1.0f ) +#define D3D10_DEFAULT_BLEND_FACTOR_RED ( 1.0f ) +#define D3D10_DEFAULT_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D10_DEFAULT_DEPTH_BIAS ( 0 ) + +#define D3D10_DEFAULT_DEPTH_BIAS_CLAMP ( 0.0f ) +#define D3D10_DEFAULT_MAX_ANISOTROPY ( 16.0f ) +#define D3D10_DEFAULT_MIP_LOD_BIAS ( 0.0f ) +#define D3D10_DEFAULT_RENDER_TARGET_ARRAY_INDEX ( 0 ) + +#define D3D10_DEFAULT_SAMPLE_MASK ( 0xffffffff ) + +#define D3D10_DEFAULT_SCISSOR_ENDX ( 0 ) + +#define D3D10_DEFAULT_SCISSOR_ENDY ( 0 ) + +#define D3D10_DEFAULT_SCISSOR_STARTX ( 0 ) + +#define D3D10_DEFAULT_SCISSOR_STARTY ( 0 ) + +#define D3D10_DEFAULT_SLOPE_SCALED_DEPTH_BIAS ( 0.0f ) +#define D3D10_DEFAULT_STENCIL_READ_MASK ( 0xff ) + +#define D3D10_DEFAULT_STENCIL_REFERENCE ( 0 ) + +#define D3D10_DEFAULT_STENCIL_WRITE_MASK ( 0xff ) + +#define D3D10_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX ( 0 ) + +#define D3D10_DEFAULT_VIEWPORT_HEIGHT ( 0 ) + +#define D3D10_DEFAULT_VIEWPORT_MAX_DEPTH ( 0.0f ) +#define D3D10_DEFAULT_VIEWPORT_MIN_DEPTH ( 0.0f ) +#define D3D10_DEFAULT_VIEWPORT_TOPLEFTX ( 0 ) + +#define D3D10_DEFAULT_VIEWPORT_TOPLEFTY ( 0 ) + +#define D3D10_DEFAULT_VIEWPORT_WIDTH ( 0 ) + +#define D3D10_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 ) +#define D3D10_FLOAT32_MAX ( 3.402823466e+38f ) +#define D3D10_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f ) +#define D3D10_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR ( 2.4f ) +#define D3D10_FLOAT_TO_SRGB_EXPONENT_NUMERATOR ( 1.0f ) +#define D3D10_FLOAT_TO_SRGB_OFFSET ( 0.055f ) +#define D3D10_FLOAT_TO_SRGB_SCALE_1 ( 12.92f ) +#define D3D10_FLOAT_TO_SRGB_SCALE_2 ( 1.055f ) +#define D3D10_FLOAT_TO_SRGB_THRESHOLD ( 0.0031308f ) +#define D3D10_FTOI_INSTRUCTION_MAX_INPUT ( 2147483647.999f ) +#define D3D10_FTOI_INSTRUCTION_MIN_INPUT ( -2147483648.999f ) +#define D3D10_FTOU_INSTRUCTION_MAX_INPUT ( 4294967295.999f ) +#define D3D10_FTOU_INSTRUCTION_MIN_INPUT ( 0.0f ) +#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS ( 1 ) + +#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_COUNT ( 1 ) + +#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST ( 2 ) + +#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_GS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_GS_INPUT_REGISTER_COUNT ( 16 ) + +#define D3D10_GS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D10_GS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_GS_INPUT_REGISTER_VERTICES ( 6 ) + +#define D3D10_GS_OUTPUT_ELEMENTS ( 32 ) + +#define D3D10_GS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_GS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D10_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D10_IA_DEFAULT_PRIMITIVE_TOPOLOGY ( 0 ) + +#define D3D10_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D10_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT ( 1 ) + +#define D3D10_IA_INSTANCE_ID_BIT_COUNT ( 32 ) + +#define D3D10_IA_INTEGER_ARITHMETIC_BIT_COUNT ( 32 ) + +#define D3D10_IA_PRIMITIVE_ID_BIT_COUNT ( 32 ) + +#define D3D10_IA_VERTEX_ID_BIT_COUNT ( 32 ) + +#define D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ( 16 ) + +#define D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS ( 64 ) + +#define D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ( 16 ) + +#define D3D10_INTEGER_DIVIDE_BY_ZERO_QUOTIENT ( 0xffffffff ) + +#define D3D10_INTEGER_DIVIDE_BY_ZERO_REMAINDER ( 0xffffffff ) + +#define D3D10_LINEAR_GAMMA ( 1.0f ) +#define D3D10_MAX_BORDER_COLOR_COMPONENT ( 1.0f ) +#define D3D10_MAX_DEPTH ( 1.0f ) +#define D3D10_MAX_MAXANISOTROPY ( 16 ) + +#define D3D10_MAX_MULTISAMPLE_SAMPLE_COUNT ( 32 ) + +#define D3D10_MAX_POSITION_VALUE ( 3.402823466e+34f ) +#define D3D10_MAX_TEXTURE_DIMENSION_2_TO_EXP ( 17 ) + +#define D3D10_MIN_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D10_MIN_DEPTH ( 0.0f ) +#define D3D10_MIN_MAXANISOTROPY ( 0 ) + +#define D3D10_MIP_LOD_BIAS_MAX ( 15.99f ) +#define D3D10_MIP_LOD_BIAS_MIN ( -16.0f ) +#define D3D10_MIP_LOD_FRACTIONAL_BIT_COUNT ( 6 ) + +#define D3D10_MIP_LOD_RANGE_BIT_COUNT ( 8 ) + +#define D3D10_MULTISAMPLE_ANTIALIAS_LINE_WIDTH ( 1.4f ) +#define D3D10_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT ( 0 ) + +#define D3D10_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 13 ) + +#define D3D10_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 15 ) + +#define D3D10_PS_FRONTFACING_DEFAULT_VALUE ( 0xffffffff ) + +#define D3D10_PS_FRONTFACING_FALSE_VALUE ( 0 ) + +#define D3D10_PS_FRONTFACING_TRUE_VALUE ( 0xffffffff ) + +#define D3D10_PS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_PS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D10_PS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D10_PS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.0f ) +#define D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS ( 1 ) + +#define D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_PS_OUTPUT_DEPTH_REGISTER_COUNT ( 1 ) + +#define D3D10_PS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_PS_OUTPUT_REGISTER_COUNT ( 8 ) + +#define D3D10_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.5f ) +#define D3D10_REQ_BLEND_OBJECT_COUNT_PER_CONTEXT ( 4096 ) + +#define D3D10_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP ( 27 ) + +#define D3D10_REQ_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D10_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_CONTEXT ( 4096 ) + +#define D3D10_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D10_REQ_DRAW_VERTEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D10_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION ( 8192 ) + +#define D3D10_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT ( 1024 ) + +#define D3D10_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D10_REQ_MAXANISOTROPY ( 16 ) + +#define D3D10_REQ_MIP_LEVELS ( 14 ) + +#define D3D10_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES ( 2048 ) + +#define D3D10_REQ_RASTERIZER_OBJECT_COUNT_PER_CONTEXT ( 4096 ) + +#define D3D10_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH ( 8192 ) + +#define D3D10_REQ_RESOURCE_SIZE_IN_MEGABYTES ( 128 ) + +#define D3D10_REQ_RESOURCE_VIEW_COUNT_PER_CONTEXT_2_TO_EXP ( 20 ) + +#define D3D10_REQ_SAMPLER_OBJECT_COUNT_PER_CONTEXT ( 4096 ) + +#define D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION ( 512 ) + +#define D3D10_REQ_TEXTURE1D_U_DIMENSION ( 8192 ) + +#define D3D10_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION ( 512 ) + +#define D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION ( 8192 ) + +#define D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION ( 2048 ) + +#define D3D10_REQ_TEXTURECUBE_DIMENSION ( 8192 ) + +#define D3D10_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL ( 0 ) + +#define D3D10_SHADER_MAJOR_VERSION ( 4 ) + +#define D3D10_SHADER_MINOR_VERSION ( 0 ) + +#define D3D10_SHIFT_INSTRUCTION_PAD_VALUE ( 0 ) + +#define D3D10_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT ( 5 ) + +#define D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ( 8 ) + +#define D3D10_SO_BUFFER_MAX_STRIDE_IN_BYTES ( 2048 ) + +#define D3D10_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES ( 256 ) + +#define D3D10_SO_BUFFER_SLOT_COUNT ( 4 ) + +#define D3D10_SO_DDI_REGISTER_INDEX_DENOTING_GAP ( 0xffffffff ) + +#define D3D10_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER ( 1 ) + +#define D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ( 64 ) + +#define D3D10_SRGB_GAMMA ( 2.2f ) +#define D3D10_SRGB_TO_FLOAT_DENOMINATOR_1 ( 12.92f ) +#define D3D10_SRGB_TO_FLOAT_DENOMINATOR_2 ( 1.055f ) +#define D3D10_SRGB_TO_FLOAT_EXPONENT ( 2.4f ) +#define D3D10_SRGB_TO_FLOAT_OFFSET ( 0.055f ) +#define D3D10_SRGB_TO_FLOAT_THRESHOLD ( 0.04045f ) +#define D3D10_SRGB_TO_FLOAT_TOLERANCE_IN_ULP ( 0.5f ) +#define D3D10_STANDARD_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_STANDARD_COMPONENT_BIT_COUNT_DOUBLED ( 64 ) + +#define D3D10_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE ( 4 ) + +#define D3D10_STANDARD_PIXEL_COMPONENT_COUNT ( 128 ) + +#define D3D10_STANDARD_PIXEL_ELEMENT_COUNT ( 32 ) + +#define D3D10_STANDARD_VECTOR_SIZE ( 4 ) + +#define D3D10_STANDARD_VERTEX_ELEMENT_COUNT ( 16 ) + +#define D3D10_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT ( 64 ) + +#define D3D10_SUBPIXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D10_SUBTEXEL_FRACTIONAL_BIT_COUNT ( 6 ) + +#define D3D10_TEXEL_ADDRESS_RANGE_BIT_COUNT ( 18 ) + +#define D3D10_UNBOUND_MEMORY_ACCESS_RESULT ( 0 ) + +#define D3D10_VIEWPORT_AND_SCISSORRECT_MAX_INDEX ( 15 ) + +#define D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE ( 16 ) + +#define D3D10_VIEWPORT_BOUNDS_MAX ( 16383 ) + +#define D3D10_VIEWPORT_BOUNDS_MIN ( -16384 ) + +#define D3D10_VS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_VS_INPUT_REGISTER_COUNT ( 16 ) + +#define D3D10_VS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D10_VS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_VS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_VS_OUTPUT_REGISTER_COUNT ( 16 ) + +#define D3D10_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT ( 10 ) + +#define D3D10_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 25 ) + +#define D3D10_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP ( 25 ) + +#define D3D_MAJOR_VERSION ( 10 ) + +#define D3D_MINOR_VERSION ( 0 ) + +#define D3D_SPEC_DATE_DAY ( 8 ) + +#define D3D_SPEC_DATE_MONTH ( 8 ) + +#define D3D_SPEC_DATE_YEAR ( 2006 ) + +#define D3D_SPEC_VERSION ( 1.050005 ) +#endif +#if !defined( __d3d10_1_h__ ) && !(D3D10_HEADER_MINOR_VERSION >= 1) +#define D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT +#define D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT +#endif +#define _FACD3D10 ( 0x879 ) + +#define _FACD3D10DEBUG ( ( _FACD3D10 + 1 ) ) + +#define MAKE_D3D10_HRESULT( code ) MAKE_HRESULT( 1, _FACD3D10, code ) +#define MAKE_D3D10_STATUS( code ) MAKE_HRESULT( 0, _FACD3D10, code ) +#define D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS MAKE_D3D10_HRESULT(1) +#define D3D10_ERROR_FILE_NOT_FOUND MAKE_D3D10_HRESULT(2) +#if __SAL_H_FULL_VER < 140050727 +#undef __in_range +#undef __in_xcount_opt +#define __in_range(x, y) +#define __in_xcount_opt(x) +#endif +typedef +enum D3D10_INPUT_CLASSIFICATION + { D3D10_INPUT_PER_VERTEX_DATA = 0, + D3D10_INPUT_PER_INSTANCE_DATA = 1 + } D3D10_INPUT_CLASSIFICATION; + +#define D3D10_APPEND_ALIGNED_ELEMENT ( 0xffffffff ) + +typedef struct D3D10_INPUT_ELEMENT_DESC + { + LPCSTR SemanticName; + UINT SemanticIndex; + DXGI_FORMAT Format; + UINT InputSlot; + UINT AlignedByteOffset; + D3D10_INPUT_CLASSIFICATION InputSlotClass; + UINT InstanceDataStepRate; + } D3D10_INPUT_ELEMENT_DESC; + +typedef +enum D3D10_FILL_MODE + { D3D10_FILL_WIREFRAME = 2, + D3D10_FILL_SOLID = 3 + } D3D10_FILL_MODE; + +typedef D3D_PRIMITIVE_TOPOLOGY D3D10_PRIMITIVE_TOPOLOGY; + +typedef D3D_PRIMITIVE D3D10_PRIMITIVE; + +typedef +enum D3D10_CULL_MODE + { D3D10_CULL_NONE = 1, + D3D10_CULL_FRONT = 2, + D3D10_CULL_BACK = 3 + } D3D10_CULL_MODE; + +typedef struct D3D10_SO_DECLARATION_ENTRY + { + LPCSTR SemanticName; + UINT SemanticIndex; + BYTE StartComponent; + BYTE ComponentCount; + BYTE OutputSlot; + } D3D10_SO_DECLARATION_ENTRY; + +typedef struct D3D10_VIEWPORT + { + INT TopLeftX; + INT TopLeftY; + UINT Width; + UINT Height; + FLOAT MinDepth; + FLOAT MaxDepth; + } D3D10_VIEWPORT; + +typedef +enum D3D10_RESOURCE_DIMENSION + { D3D10_RESOURCE_DIMENSION_UNKNOWN = 0, + D3D10_RESOURCE_DIMENSION_BUFFER = 1, + D3D10_RESOURCE_DIMENSION_TEXTURE1D = 2, + D3D10_RESOURCE_DIMENSION_TEXTURE2D = 3, + D3D10_RESOURCE_DIMENSION_TEXTURE3D = 4 + } D3D10_RESOURCE_DIMENSION; + +typedef D3D_SRV_DIMENSION D3D10_SRV_DIMENSION; + +typedef +enum D3D10_DSV_DIMENSION + { D3D10_DSV_DIMENSION_UNKNOWN = 0, + D3D10_DSV_DIMENSION_TEXTURE1D = 1, + D3D10_DSV_DIMENSION_TEXTURE1DARRAY = 2, + D3D10_DSV_DIMENSION_TEXTURE2D = 3, + D3D10_DSV_DIMENSION_TEXTURE2DARRAY = 4, + D3D10_DSV_DIMENSION_TEXTURE2DMS = 5, + D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY = 6 + } D3D10_DSV_DIMENSION; + +typedef +enum D3D10_RTV_DIMENSION + { D3D10_RTV_DIMENSION_UNKNOWN = 0, + D3D10_RTV_DIMENSION_BUFFER = 1, + D3D10_RTV_DIMENSION_TEXTURE1D = 2, + D3D10_RTV_DIMENSION_TEXTURE1DARRAY = 3, + D3D10_RTV_DIMENSION_TEXTURE2D = 4, + D3D10_RTV_DIMENSION_TEXTURE2DARRAY = 5, + D3D10_RTV_DIMENSION_TEXTURE2DMS = 6, + D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D10_RTV_DIMENSION_TEXTURE3D = 8 + } D3D10_RTV_DIMENSION; + +typedef +enum D3D10_USAGE + { D3D10_USAGE_DEFAULT = 0, + D3D10_USAGE_IMMUTABLE = 1, + D3D10_USAGE_DYNAMIC = 2, + D3D10_USAGE_STAGING = 3 + } D3D10_USAGE; + +typedef +enum D3D10_BIND_FLAG + { D3D10_BIND_VERTEX_BUFFER = 0x1L, + D3D10_BIND_INDEX_BUFFER = 0x2L, + D3D10_BIND_CONSTANT_BUFFER = 0x4L, + D3D10_BIND_SHADER_RESOURCE = 0x8L, + D3D10_BIND_STREAM_OUTPUT = 0x10L, + D3D10_BIND_RENDER_TARGET = 0x20L, + D3D10_BIND_DEPTH_STENCIL = 0x40L + } D3D10_BIND_FLAG; + +typedef +enum D3D10_CPU_ACCESS_FLAG + { D3D10_CPU_ACCESS_WRITE = 0x10000L, + D3D10_CPU_ACCESS_READ = 0x20000L + } D3D10_CPU_ACCESS_FLAG; + +typedef +enum D3D10_RESOURCE_MISC_FLAG + { D3D10_RESOURCE_MISC_GENERATE_MIPS = 0x1L, + D3D10_RESOURCE_MISC_SHARED = 0x2L, + D3D10_RESOURCE_MISC_TEXTURECUBE = 0x4L, + D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x10L, + D3D10_RESOURCE_MISC_GDI_COMPATIBLE = 0x20L + } D3D10_RESOURCE_MISC_FLAG; + +typedef +enum D3D10_MAP + { D3D10_MAP_READ = 1, + D3D10_MAP_WRITE = 2, + D3D10_MAP_READ_WRITE = 3, + D3D10_MAP_WRITE_DISCARD = 4, + D3D10_MAP_WRITE_NO_OVERWRITE = 5 + } D3D10_MAP; + +typedef +enum D3D10_MAP_FLAG + { D3D10_MAP_FLAG_DO_NOT_WAIT = 0x100000L + } D3D10_MAP_FLAG; + +typedef +enum D3D10_RAISE_FLAG + { D3D10_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1L + } D3D10_RAISE_FLAG; + +typedef +enum D3D10_CLEAR_FLAG + { D3D10_CLEAR_DEPTH = 0x1L, + D3D10_CLEAR_STENCIL = 0x2L + } D3D10_CLEAR_FLAG; + +typedef RECT D3D10_RECT; + +typedef struct D3D10_BOX + { + UINT left; + UINT top; + UINT front; + UINT right; + UINT bottom; + UINT back; + } D3D10_BOX; + + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D10DeviceChild_INTERFACE_DEFINED__ +#define __ID3D10DeviceChild_INTERFACE_DEFINED__ + +/* interface ID3D10DeviceChild */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10DeviceChild; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C00-342C-4106-A19F-4F2704F689F0") + ID3D10DeviceChild : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE GetDevice( + /* [annotation] */ + __out ID3D10Device **ppDevice) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10DeviceChildVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10DeviceChild * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10DeviceChild * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10DeviceChild * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10DeviceChild * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D10DeviceChildVtbl; + + interface ID3D10DeviceChild + { + CONST_VTBL struct ID3D10DeviceChildVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10DeviceChild_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10DeviceChild_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10DeviceChild_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10DeviceChild_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10DeviceChild_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10DeviceChild_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10DeviceChild_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10DeviceChild_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0001 */ +/* [local] */ + +typedef +enum D3D10_COMPARISON_FUNC + { D3D10_COMPARISON_NEVER = 1, + D3D10_COMPARISON_LESS = 2, + D3D10_COMPARISON_EQUAL = 3, + D3D10_COMPARISON_LESS_EQUAL = 4, + D3D10_COMPARISON_GREATER = 5, + D3D10_COMPARISON_NOT_EQUAL = 6, + D3D10_COMPARISON_GREATER_EQUAL = 7, + D3D10_COMPARISON_ALWAYS = 8 + } D3D10_COMPARISON_FUNC; + +typedef +enum D3D10_DEPTH_WRITE_MASK + { D3D10_DEPTH_WRITE_MASK_ZERO = 0, + D3D10_DEPTH_WRITE_MASK_ALL = 1 + } D3D10_DEPTH_WRITE_MASK; + +typedef +enum D3D10_STENCIL_OP + { D3D10_STENCIL_OP_KEEP = 1, + D3D10_STENCIL_OP_ZERO = 2, + D3D10_STENCIL_OP_REPLACE = 3, + D3D10_STENCIL_OP_INCR_SAT = 4, + D3D10_STENCIL_OP_DECR_SAT = 5, + D3D10_STENCIL_OP_INVERT = 6, + D3D10_STENCIL_OP_INCR = 7, + D3D10_STENCIL_OP_DECR = 8 + } D3D10_STENCIL_OP; + +typedef struct D3D10_DEPTH_STENCILOP_DESC + { + D3D10_STENCIL_OP StencilFailOp; + D3D10_STENCIL_OP StencilDepthFailOp; + D3D10_STENCIL_OP StencilPassOp; + D3D10_COMPARISON_FUNC StencilFunc; + } D3D10_DEPTH_STENCILOP_DESC; + +typedef struct D3D10_DEPTH_STENCIL_DESC + { + BOOL DepthEnable; + D3D10_DEPTH_WRITE_MASK DepthWriteMask; + D3D10_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; + D3D10_DEPTH_STENCILOP_DESC FrontFace; + D3D10_DEPTH_STENCILOP_DESC BackFace; + } D3D10_DEPTH_STENCIL_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3D10DepthStencilState_INTERFACE_DEFINED__ +#define __ID3D10DepthStencilState_INTERFACE_DEFINED__ + +/* interface ID3D10DepthStencilState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10DepthStencilState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2B4B1CC8-A4AD-41f8-8322-CA86FC3EC675") + ID3D10DepthStencilState : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_DEPTH_STENCIL_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10DepthStencilStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10DepthStencilState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10DepthStencilState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10DepthStencilState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10DepthStencilState * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10DepthStencilState * This, + /* [annotation] */ + __out D3D10_DEPTH_STENCIL_DESC *pDesc); + + END_INTERFACE + } ID3D10DepthStencilStateVtbl; + + interface ID3D10DepthStencilState + { + CONST_VTBL struct ID3D10DepthStencilStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10DepthStencilState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10DepthStencilState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10DepthStencilState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10DepthStencilState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10DepthStencilState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10DepthStencilState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10DepthStencilState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10DepthStencilState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10DepthStencilState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0002 */ +/* [local] */ + +typedef +enum D3D10_BLEND + { D3D10_BLEND_ZERO = 1, + D3D10_BLEND_ONE = 2, + D3D10_BLEND_SRC_COLOR = 3, + D3D10_BLEND_INV_SRC_COLOR = 4, + D3D10_BLEND_SRC_ALPHA = 5, + D3D10_BLEND_INV_SRC_ALPHA = 6, + D3D10_BLEND_DEST_ALPHA = 7, + D3D10_BLEND_INV_DEST_ALPHA = 8, + D3D10_BLEND_DEST_COLOR = 9, + D3D10_BLEND_INV_DEST_COLOR = 10, + D3D10_BLEND_SRC_ALPHA_SAT = 11, + D3D10_BLEND_BLEND_FACTOR = 14, + D3D10_BLEND_INV_BLEND_FACTOR = 15, + D3D10_BLEND_SRC1_COLOR = 16, + D3D10_BLEND_INV_SRC1_COLOR = 17, + D3D10_BLEND_SRC1_ALPHA = 18, + D3D10_BLEND_INV_SRC1_ALPHA = 19 + } D3D10_BLEND; + +typedef +enum D3D10_BLEND_OP + { D3D10_BLEND_OP_ADD = 1, + D3D10_BLEND_OP_SUBTRACT = 2, + D3D10_BLEND_OP_REV_SUBTRACT = 3, + D3D10_BLEND_OP_MIN = 4, + D3D10_BLEND_OP_MAX = 5 + } D3D10_BLEND_OP; + +typedef +enum D3D10_COLOR_WRITE_ENABLE + { D3D10_COLOR_WRITE_ENABLE_RED = 1, + D3D10_COLOR_WRITE_ENABLE_GREEN = 2, + D3D10_COLOR_WRITE_ENABLE_BLUE = 4, + D3D10_COLOR_WRITE_ENABLE_ALPHA = 8, + D3D10_COLOR_WRITE_ENABLE_ALL = ( ( ( D3D10_COLOR_WRITE_ENABLE_RED | D3D10_COLOR_WRITE_ENABLE_GREEN ) | D3D10_COLOR_WRITE_ENABLE_BLUE ) | D3D10_COLOR_WRITE_ENABLE_ALPHA ) + } D3D10_COLOR_WRITE_ENABLE; + +typedef struct D3D10_BLEND_DESC + { + BOOL AlphaToCoverageEnable; + BOOL BlendEnable[ 8 ]; + D3D10_BLEND SrcBlend; + D3D10_BLEND DestBlend; + D3D10_BLEND_OP BlendOp; + D3D10_BLEND SrcBlendAlpha; + D3D10_BLEND DestBlendAlpha; + D3D10_BLEND_OP BlendOpAlpha; + UINT8 RenderTargetWriteMask[ 8 ]; + } D3D10_BLEND_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0002_v0_0_s_ifspec; + +#ifndef __ID3D10BlendState_INTERFACE_DEFINED__ +#define __ID3D10BlendState_INTERFACE_DEFINED__ + +/* interface ID3D10BlendState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10BlendState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EDAD8D19-8A35-4d6d-8566-2EA276CDE161") + ID3D10BlendState : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_BLEND_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10BlendStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10BlendState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10BlendState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10BlendState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10BlendState * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10BlendState * This, + /* [annotation] */ + __out D3D10_BLEND_DESC *pDesc); + + END_INTERFACE + } ID3D10BlendStateVtbl; + + interface ID3D10BlendState + { + CONST_VTBL struct ID3D10BlendStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10BlendState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10BlendState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10BlendState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10BlendState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10BlendState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10BlendState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10BlendState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10BlendState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10BlendState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0003 */ +/* [local] */ + +typedef struct D3D10_RASTERIZER_DESC + { + D3D10_FILL_MODE FillMode; + D3D10_CULL_MODE CullMode; + BOOL FrontCounterClockwise; + INT DepthBias; + FLOAT DepthBiasClamp; + FLOAT SlopeScaledDepthBias; + BOOL DepthClipEnable; + BOOL ScissorEnable; + BOOL MultisampleEnable; + BOOL AntialiasedLineEnable; + } D3D10_RASTERIZER_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0003_v0_0_s_ifspec; + +#ifndef __ID3D10RasterizerState_INTERFACE_DEFINED__ +#define __ID3D10RasterizerState_INTERFACE_DEFINED__ + +/* interface ID3D10RasterizerState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10RasterizerState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("A2A07292-89AF-4345-BE2E-C53D9FBB6E9F") + ID3D10RasterizerState : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_RASTERIZER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10RasterizerStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10RasterizerState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10RasterizerState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10RasterizerState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10RasterizerState * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10RasterizerState * This, + /* [annotation] */ + __out D3D10_RASTERIZER_DESC *pDesc); + + END_INTERFACE + } ID3D10RasterizerStateVtbl; + + interface ID3D10RasterizerState + { + CONST_VTBL struct ID3D10RasterizerStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10RasterizerState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10RasterizerState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10RasterizerState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10RasterizerState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10RasterizerState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10RasterizerState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10RasterizerState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10RasterizerState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10RasterizerState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0004 */ +/* [local] */ + +#if !defined( D3D10_NO_HELPERS ) && defined( __cplusplus ) +inline UINT D3D10CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT MipLevels ) +{ return MipSlice + ArraySlice * MipLevels; } +#endif +typedef struct D3D10_SUBRESOURCE_DATA + { + const void *pSysMem; + UINT SysMemPitch; + UINT SysMemSlicePitch; + } D3D10_SUBRESOURCE_DATA; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0004_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0004_v0_0_s_ifspec; + +#ifndef __ID3D10Resource_INTERFACE_DEFINED__ +#define __ID3D10Resource_INTERFACE_DEFINED__ + +/* interface ID3D10Resource */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Resource; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C01-342C-4106-A19F-4F2704F689F0") + ID3D10Resource : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetType( + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType) = 0; + + virtual void STDMETHODCALLTYPE SetEvictionPriority( + /* [annotation] */ + __in UINT EvictionPriority) = 0; + + virtual UINT STDMETHODCALLTYPE GetEvictionPriority( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10ResourceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Resource * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Resource * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Resource * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Resource * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D10Resource * This, + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D10Resource * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D10Resource * This); + + END_INTERFACE + } ID3D10ResourceVtbl; + + interface ID3D10Resource + { + CONST_VTBL struct ID3D10ResourceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Resource_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Resource_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Resource_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Resource_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Resource_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Resource_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Resource_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Resource_GetType(This,rType) \ + ( (This)->lpVtbl -> GetType(This,rType) ) + +#define ID3D10Resource_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D10Resource_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Resource_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0005 */ +/* [local] */ + +typedef struct D3D10_BUFFER_DESC + { + UINT ByteWidth; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D10_BUFFER_DESC; + +#if !defined( D3D10_NO_HELPERS ) && defined( __cplusplus ) +struct CD3D10_BUFFER_DESC : public D3D10_BUFFER_DESC +{ + CD3D10_BUFFER_DESC() + {} + explicit CD3D10_BUFFER_DESC( const D3D10_BUFFER_DESC& o ) : + D3D10_BUFFER_DESC( o ) + {} + explicit CD3D10_BUFFER_DESC( + UINT byteWidth, + UINT bindFlags, + D3D10_USAGE usage = D3D10_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT miscFlags = 0 ) + { + ByteWidth = byteWidth; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags ; + MiscFlags = miscFlags; + } + ~CD3D10_BUFFER_DESC() {} + operator const D3D10_BUFFER_DESC&() const { return *this; } +}; +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0005_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0005_v0_0_s_ifspec; + +#ifndef __ID3D10Buffer_INTERFACE_DEFINED__ +#define __ID3D10Buffer_INTERFACE_DEFINED__ + +/* interface ID3D10Buffer */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Buffer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C02-342C-4106-A19F-4F2704F689F0") + ID3D10Buffer : public ID3D10Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out void **ppData) = 0; + + virtual void STDMETHODCALLTYPE Unmap( void) = 0; + + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_BUFFER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10BufferVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Buffer * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Buffer * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Buffer * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Buffer * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D10Buffer * This, + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D10Buffer * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D10Buffer * This); + + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D10Buffer * This, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out void **ppData); + + void ( STDMETHODCALLTYPE *Unmap )( + ID3D10Buffer * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Buffer * This, + /* [annotation] */ + __out D3D10_BUFFER_DESC *pDesc); + + END_INTERFACE + } ID3D10BufferVtbl; + + interface ID3D10Buffer + { + CONST_VTBL struct ID3D10BufferVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Buffer_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Buffer_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Buffer_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Buffer_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Buffer_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Buffer_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Buffer_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Buffer_GetType(This,rType) \ + ( (This)->lpVtbl -> GetType(This,rType) ) + +#define ID3D10Buffer_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D10Buffer_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D10Buffer_Map(This,MapType,MapFlags,ppData) \ + ( (This)->lpVtbl -> Map(This,MapType,MapFlags,ppData) ) + +#define ID3D10Buffer_Unmap(This) \ + ( (This)->lpVtbl -> Unmap(This) ) + +#define ID3D10Buffer_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Buffer_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0006 */ +/* [local] */ + +typedef struct D3D10_TEXTURE1D_DESC + { + UINT Width; + UINT MipLevels; + UINT ArraySize; + DXGI_FORMAT Format; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D10_TEXTURE1D_DESC; + +#if !defined( D3D10_NO_HELPERS ) && defined( __cplusplus ) +struct CD3D10_TEXTURE1D_DESC : public D3D10_TEXTURE1D_DESC +{ + CD3D10_TEXTURE1D_DESC() + {} + explicit CD3D10_TEXTURE1D_DESC( const D3D10_TEXTURE1D_DESC& o ) : + D3D10_TEXTURE1D_DESC( o ) + {} + explicit CD3D10_TEXTURE1D_DESC( + DXGI_FORMAT format, + UINT width, + UINT arraySize = 1, + UINT mipLevels = 0, + UINT bindFlags = D3D10_BIND_SHADER_RESOURCE, + D3D10_USAGE usage = D3D10_USAGE_DEFAULT, + UINT cpuaccessFlags= 0, + UINT miscFlags = 0 ) + { + Width = width; + MipLevels = mipLevels; + ArraySize = arraySize; + Format = format; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D10_TEXTURE1D_DESC() {} + operator const D3D10_TEXTURE1D_DESC&() const { return *this; } +}; +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0006_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0006_v0_0_s_ifspec; + +#ifndef __ID3D10Texture1D_INTERFACE_DEFINED__ +#define __ID3D10Texture1D_INTERFACE_DEFINED__ + +/* interface ID3D10Texture1D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Texture1D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C03-342C-4106-A19F-4F2704F689F0") + ID3D10Texture1D : public ID3D10Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out void **ppData) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + /* [annotation] */ + __in UINT Subresource) = 0; + + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_TEXTURE1D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10Texture1DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Texture1D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Texture1D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Texture1D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Texture1D * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D10Texture1D * This, + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D10Texture1D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D10Texture1D * This); + + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D10Texture1D * This, + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out void **ppData); + + void ( STDMETHODCALLTYPE *Unmap )( + ID3D10Texture1D * This, + /* [annotation] */ + __in UINT Subresource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Texture1D * This, + /* [annotation] */ + __out D3D10_TEXTURE1D_DESC *pDesc); + + END_INTERFACE + } ID3D10Texture1DVtbl; + + interface ID3D10Texture1D + { + CONST_VTBL struct ID3D10Texture1DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Texture1D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Texture1D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Texture1D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Texture1D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Texture1D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Texture1D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Texture1D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Texture1D_GetType(This,rType) \ + ( (This)->lpVtbl -> GetType(This,rType) ) + +#define ID3D10Texture1D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D10Texture1D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D10Texture1D_Map(This,Subresource,MapType,MapFlags,ppData) \ + ( (This)->lpVtbl -> Map(This,Subresource,MapType,MapFlags,ppData) ) + +#define ID3D10Texture1D_Unmap(This,Subresource) \ + ( (This)->lpVtbl -> Unmap(This,Subresource) ) + +#define ID3D10Texture1D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Texture1D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0007 */ +/* [local] */ + +typedef struct D3D10_TEXTURE2D_DESC + { + UINT Width; + UINT Height; + UINT MipLevels; + UINT ArraySize; + DXGI_FORMAT Format; + DXGI_SAMPLE_DESC SampleDesc; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D10_TEXTURE2D_DESC; + +#if !defined( D3D10_NO_HELPERS ) && defined( __cplusplus ) +struct CD3D10_TEXTURE2D_DESC : public D3D10_TEXTURE2D_DESC +{ + CD3D10_TEXTURE2D_DESC() + {} + explicit CD3D10_TEXTURE2D_DESC( const D3D10_TEXTURE2D_DESC& o ) : + D3D10_TEXTURE2D_DESC( o ) + {} + explicit CD3D10_TEXTURE2D_DESC( + DXGI_FORMAT format, + UINT width, + UINT height, + UINT arraySize = 1, + UINT mipLevels = 0, + UINT bindFlags = D3D10_BIND_SHADER_RESOURCE, + D3D10_USAGE usage = D3D10_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT sampleCount = 1, + UINT sampleQuality = 0, + UINT miscFlags = 0 ) + { + Width = width; + Height = height; + MipLevels = mipLevels; + ArraySize = arraySize; + Format = format; + SampleDesc.Count = sampleCount; + SampleDesc.Quality = sampleQuality; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D10_TEXTURE2D_DESC() {} + operator const D3D10_TEXTURE2D_DESC&() const { return *this; } +}; +#endif +typedef struct D3D10_MAPPED_TEXTURE2D + { + void *pData; + UINT RowPitch; + } D3D10_MAPPED_TEXTURE2D; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0007_v0_0_s_ifspec; + +#ifndef __ID3D10Texture2D_INTERFACE_DEFINED__ +#define __ID3D10Texture2D_INTERFACE_DEFINED__ + +/* interface ID3D10Texture2D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Texture2D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C04-342C-4106-A19F-4F2704F689F0") + ID3D10Texture2D : public ID3D10Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D10_MAPPED_TEXTURE2D *pMappedTex2D) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + /* [annotation] */ + __in UINT Subresource) = 0; + + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_TEXTURE2D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10Texture2DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Texture2D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Texture2D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Texture2D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Texture2D * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D10Texture2D * This, + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D10Texture2D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D10Texture2D * This); + + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D10Texture2D * This, + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D10_MAPPED_TEXTURE2D *pMappedTex2D); + + void ( STDMETHODCALLTYPE *Unmap )( + ID3D10Texture2D * This, + /* [annotation] */ + __in UINT Subresource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Texture2D * This, + /* [annotation] */ + __out D3D10_TEXTURE2D_DESC *pDesc); + + END_INTERFACE + } ID3D10Texture2DVtbl; + + interface ID3D10Texture2D + { + CONST_VTBL struct ID3D10Texture2DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Texture2D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Texture2D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Texture2D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Texture2D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Texture2D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Texture2D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Texture2D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Texture2D_GetType(This,rType) \ + ( (This)->lpVtbl -> GetType(This,rType) ) + +#define ID3D10Texture2D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D10Texture2D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D10Texture2D_Map(This,Subresource,MapType,MapFlags,pMappedTex2D) \ + ( (This)->lpVtbl -> Map(This,Subresource,MapType,MapFlags,pMappedTex2D) ) + +#define ID3D10Texture2D_Unmap(This,Subresource) \ + ( (This)->lpVtbl -> Unmap(This,Subresource) ) + +#define ID3D10Texture2D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Texture2D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0008 */ +/* [local] */ + +typedef struct D3D10_TEXTURE3D_DESC + { + UINT Width; + UINT Height; + UINT Depth; + UINT MipLevels; + DXGI_FORMAT Format; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D10_TEXTURE3D_DESC; + +#if !defined( D3D10_NO_HELPERS ) && defined( __cplusplus ) +struct CD3D10_TEXTURE3D_DESC : public D3D10_TEXTURE3D_DESC +{ + CD3D10_TEXTURE3D_DESC() + {} + explicit CD3D10_TEXTURE3D_DESC( const D3D10_TEXTURE3D_DESC& o ) : + D3D10_TEXTURE3D_DESC( o ) + {} + explicit CD3D10_TEXTURE3D_DESC( + DXGI_FORMAT format, + UINT width, + UINT height, + UINT depth, + UINT mipLevels = 0, + UINT bindFlags = D3D10_BIND_SHADER_RESOURCE, + D3D10_USAGE usage = D3D10_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT miscFlags = 0 ) + { + Width = width; + Height = height; + Depth = depth; + MipLevels = mipLevels; + Format = format; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D10_TEXTURE3D_DESC() {} + operator const D3D10_TEXTURE3D_DESC&() const { return *this; } +}; +#endif +typedef struct D3D10_MAPPED_TEXTURE3D + { + void *pData; + UINT RowPitch; + UINT DepthPitch; + } D3D10_MAPPED_TEXTURE3D; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0008_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0008_v0_0_s_ifspec; + +#ifndef __ID3D10Texture3D_INTERFACE_DEFINED__ +#define __ID3D10Texture3D_INTERFACE_DEFINED__ + +/* interface ID3D10Texture3D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Texture3D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C05-342C-4106-A19F-4F2704F689F0") + ID3D10Texture3D : public ID3D10Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D10_MAPPED_TEXTURE3D *pMappedTex3D) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + /* [annotation] */ + __in UINT Subresource) = 0; + + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_TEXTURE3D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10Texture3DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Texture3D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Texture3D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Texture3D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Texture3D * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D10Texture3D * This, + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D10Texture3D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D10Texture3D * This); + + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D10Texture3D * This, + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D10_MAPPED_TEXTURE3D *pMappedTex3D); + + void ( STDMETHODCALLTYPE *Unmap )( + ID3D10Texture3D * This, + /* [annotation] */ + __in UINT Subresource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Texture3D * This, + /* [annotation] */ + __out D3D10_TEXTURE3D_DESC *pDesc); + + END_INTERFACE + } ID3D10Texture3DVtbl; + + interface ID3D10Texture3D + { + CONST_VTBL struct ID3D10Texture3DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Texture3D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Texture3D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Texture3D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Texture3D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Texture3D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Texture3D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Texture3D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Texture3D_GetType(This,rType) \ + ( (This)->lpVtbl -> GetType(This,rType) ) + +#define ID3D10Texture3D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D10Texture3D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D10Texture3D_Map(This,Subresource,MapType,MapFlags,pMappedTex3D) \ + ( (This)->lpVtbl -> Map(This,Subresource,MapType,MapFlags,pMappedTex3D) ) + +#define ID3D10Texture3D_Unmap(This,Subresource) \ + ( (This)->lpVtbl -> Unmap(This,Subresource) ) + +#define ID3D10Texture3D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Texture3D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0009 */ +/* [local] */ + +typedef +enum D3D10_TEXTURECUBE_FACE + { D3D10_TEXTURECUBE_FACE_POSITIVE_X = 0, + D3D10_TEXTURECUBE_FACE_NEGATIVE_X = 1, + D3D10_TEXTURECUBE_FACE_POSITIVE_Y = 2, + D3D10_TEXTURECUBE_FACE_NEGATIVE_Y = 3, + D3D10_TEXTURECUBE_FACE_POSITIVE_Z = 4, + D3D10_TEXTURECUBE_FACE_NEGATIVE_Z = 5 + } D3D10_TEXTURECUBE_FACE; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0009_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0009_v0_0_s_ifspec; + +#ifndef __ID3D10View_INTERFACE_DEFINED__ +#define __ID3D10View_INTERFACE_DEFINED__ + +/* interface ID3D10View */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10View; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C902B03F-60A7-49BA-9936-2A3AB37A7E33") + ID3D10View : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetResource( + /* [annotation] */ + __out ID3D10Resource **ppResource) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10ViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10View * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10View * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10View * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10View * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D10View * This, + /* [annotation] */ + __out ID3D10Resource **ppResource); + + END_INTERFACE + } ID3D10ViewVtbl; + + interface ID3D10View + { + CONST_VTBL struct ID3D10ViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10View_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10View_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10View_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10View_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10View_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10View_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10View_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10View_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10View_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0010 */ +/* [local] */ + +typedef struct D3D10_BUFFER_SRV + { + union + { + UINT FirstElement; + UINT ElementOffset; + } ; + union + { + UINT NumElements; + UINT ElementWidth; + } ; + } D3D10_BUFFER_SRV; + +typedef struct D3D10_TEX1D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D10_TEX1D_SRV; + +typedef struct D3D10_TEX1D_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX1D_ARRAY_SRV; + +typedef struct D3D10_TEX2D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D10_TEX2D_SRV; + +typedef struct D3D10_TEX2D_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2D_ARRAY_SRV; + +typedef struct D3D10_TEX3D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D10_TEX3D_SRV; + +typedef struct D3D10_TEXCUBE_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D10_TEXCUBE_SRV; + +typedef struct D3D10_TEX2DMS_SRV + { + UINT UnusedField_NothingToDefine; + } D3D10_TEX2DMS_SRV; + +typedef struct D3D10_TEX2DMS_ARRAY_SRV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2DMS_ARRAY_SRV; + +typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC + { + DXGI_FORMAT Format; + D3D10_SRV_DIMENSION ViewDimension; + union + { + D3D10_BUFFER_SRV Buffer; + D3D10_TEX1D_SRV Texture1D; + D3D10_TEX1D_ARRAY_SRV Texture1DArray; + D3D10_TEX2D_SRV Texture2D; + D3D10_TEX2D_ARRAY_SRV Texture2DArray; + D3D10_TEX2DMS_SRV Texture2DMS; + D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray; + D3D10_TEX3D_SRV Texture3D; + D3D10_TEXCUBE_SRV TextureCube; + } ; + } D3D10_SHADER_RESOURCE_VIEW_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0010_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0010_v0_0_s_ifspec; + +#ifndef __ID3D10ShaderResourceView_INTERFACE_DEFINED__ +#define __ID3D10ShaderResourceView_INTERFACE_DEFINED__ + +/* interface ID3D10ShaderResourceView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10ShaderResourceView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C07-342C-4106-A19F-4F2704F689F0") + ID3D10ShaderResourceView : public ID3D10View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10ShaderResourceViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10ShaderResourceView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10ShaderResourceView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10ShaderResourceView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __out ID3D10Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __out D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D10ShaderResourceViewVtbl; + + interface ID3D10ShaderResourceView + { + CONST_VTBL struct ID3D10ShaderResourceViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10ShaderResourceView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10ShaderResourceView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10ShaderResourceView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10ShaderResourceView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10ShaderResourceView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10ShaderResourceView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10ShaderResourceView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10ShaderResourceView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D10ShaderResourceView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10ShaderResourceView_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0011 */ +/* [local] */ + +typedef struct D3D10_BUFFER_RTV + { + union + { + UINT FirstElement; + UINT ElementOffset; + } ; + union + { + UINT NumElements; + UINT ElementWidth; + } ; + } D3D10_BUFFER_RTV; + +typedef struct D3D10_TEX1D_RTV + { + UINT MipSlice; + } D3D10_TEX1D_RTV; + +typedef struct D3D10_TEX1D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX1D_ARRAY_RTV; + +typedef struct D3D10_TEX2D_RTV + { + UINT MipSlice; + } D3D10_TEX2D_RTV; + +typedef struct D3D10_TEX2DMS_RTV + { + UINT UnusedField_NothingToDefine; + } D3D10_TEX2DMS_RTV; + +typedef struct D3D10_TEX2D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2D_ARRAY_RTV; + +typedef struct D3D10_TEX2DMS_ARRAY_RTV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2DMS_ARRAY_RTV; + +typedef struct D3D10_TEX3D_RTV + { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; + } D3D10_TEX3D_RTV; + +typedef struct D3D10_RENDER_TARGET_VIEW_DESC + { + DXGI_FORMAT Format; + D3D10_RTV_DIMENSION ViewDimension; + union + { + D3D10_BUFFER_RTV Buffer; + D3D10_TEX1D_RTV Texture1D; + D3D10_TEX1D_ARRAY_RTV Texture1DArray; + D3D10_TEX2D_RTV Texture2D; + D3D10_TEX2D_ARRAY_RTV Texture2DArray; + D3D10_TEX2DMS_RTV Texture2DMS; + D3D10_TEX2DMS_ARRAY_RTV Texture2DMSArray; + D3D10_TEX3D_RTV Texture3D; + } ; + } D3D10_RENDER_TARGET_VIEW_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0011_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0011_v0_0_s_ifspec; + +#ifndef __ID3D10RenderTargetView_INTERFACE_DEFINED__ +#define __ID3D10RenderTargetView_INTERFACE_DEFINED__ + +/* interface ID3D10RenderTargetView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10RenderTargetView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C08-342C-4106-A19F-4F2704F689F0") + ID3D10RenderTargetView : public ID3D10View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_RENDER_TARGET_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10RenderTargetViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10RenderTargetView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10RenderTargetView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10RenderTargetView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __out ID3D10Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __out D3D10_RENDER_TARGET_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D10RenderTargetViewVtbl; + + interface ID3D10RenderTargetView + { + CONST_VTBL struct ID3D10RenderTargetViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10RenderTargetView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10RenderTargetView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10RenderTargetView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10RenderTargetView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10RenderTargetView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10RenderTargetView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10RenderTargetView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10RenderTargetView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D10RenderTargetView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10RenderTargetView_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0012 */ +/* [local] */ + +typedef struct D3D10_TEX1D_DSV + { + UINT MipSlice; + } D3D10_TEX1D_DSV; + +typedef struct D3D10_TEX1D_ARRAY_DSV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX1D_ARRAY_DSV; + +typedef struct D3D10_TEX2D_DSV + { + UINT MipSlice; + } D3D10_TEX2D_DSV; + +typedef struct D3D10_TEX2D_ARRAY_DSV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2D_ARRAY_DSV; + +typedef struct D3D10_TEX2DMS_DSV + { + UINT UnusedField_NothingToDefine; + } D3D10_TEX2DMS_DSV; + +typedef struct D3D10_TEX2DMS_ARRAY_DSV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2DMS_ARRAY_DSV; + +typedef struct D3D10_DEPTH_STENCIL_VIEW_DESC + { + DXGI_FORMAT Format; + D3D10_DSV_DIMENSION ViewDimension; + union + { + D3D10_TEX1D_DSV Texture1D; + D3D10_TEX1D_ARRAY_DSV Texture1DArray; + D3D10_TEX2D_DSV Texture2D; + D3D10_TEX2D_ARRAY_DSV Texture2DArray; + D3D10_TEX2DMS_DSV Texture2DMS; + D3D10_TEX2DMS_ARRAY_DSV Texture2DMSArray; + } ; + } D3D10_DEPTH_STENCIL_VIEW_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0012_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0012_v0_0_s_ifspec; + +#ifndef __ID3D10DepthStencilView_INTERFACE_DEFINED__ +#define __ID3D10DepthStencilView_INTERFACE_DEFINED__ + +/* interface ID3D10DepthStencilView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10DepthStencilView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C09-342C-4106-A19F-4F2704F689F0") + ID3D10DepthStencilView : public ID3D10View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10DepthStencilViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10DepthStencilView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10DepthStencilView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10DepthStencilView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __out ID3D10Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __out D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D10DepthStencilViewVtbl; + + interface ID3D10DepthStencilView + { + CONST_VTBL struct ID3D10DepthStencilViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10DepthStencilView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10DepthStencilView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10DepthStencilView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10DepthStencilView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10DepthStencilView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10DepthStencilView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10DepthStencilView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10DepthStencilView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D10DepthStencilView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10DepthStencilView_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10VertexShader_INTERFACE_DEFINED__ +#define __ID3D10VertexShader_INTERFACE_DEFINED__ + +/* interface ID3D10VertexShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10VertexShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0A-342C-4106-A19F-4F2704F689F0") + ID3D10VertexShader : public ID3D10DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D10VertexShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10VertexShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10VertexShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10VertexShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10VertexShader * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D10VertexShaderVtbl; + + interface ID3D10VertexShader + { + CONST_VTBL struct ID3D10VertexShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10VertexShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10VertexShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10VertexShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10VertexShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10VertexShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10VertexShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10VertexShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10VertexShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10GeometryShader_INTERFACE_DEFINED__ +#define __ID3D10GeometryShader_INTERFACE_DEFINED__ + +/* interface ID3D10GeometryShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10GeometryShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6316BE88-54CD-4040-AB44-20461BC81F68") + ID3D10GeometryShader : public ID3D10DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D10GeometryShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10GeometryShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10GeometryShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10GeometryShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10GeometryShader * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D10GeometryShaderVtbl; + + interface ID3D10GeometryShader + { + CONST_VTBL struct ID3D10GeometryShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10GeometryShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10GeometryShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10GeometryShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10GeometryShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10GeometryShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10GeometryShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10GeometryShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10GeometryShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10PixelShader_INTERFACE_DEFINED__ +#define __ID3D10PixelShader_INTERFACE_DEFINED__ + +/* interface ID3D10PixelShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10PixelShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4968B601-9D00-4cde-8346-8E7F675819B6") + ID3D10PixelShader : public ID3D10DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D10PixelShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10PixelShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10PixelShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10PixelShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10PixelShader * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D10PixelShaderVtbl; + + interface ID3D10PixelShader + { + CONST_VTBL struct ID3D10PixelShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10PixelShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10PixelShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10PixelShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10PixelShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10PixelShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10PixelShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10PixelShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10PixelShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10InputLayout_INTERFACE_DEFINED__ +#define __ID3D10InputLayout_INTERFACE_DEFINED__ + +/* interface ID3D10InputLayout */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10InputLayout; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0B-342C-4106-A19F-4F2704F689F0") + ID3D10InputLayout : public ID3D10DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D10InputLayoutVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10InputLayout * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10InputLayout * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10InputLayout * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10InputLayout * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D10InputLayoutVtbl; + + interface ID3D10InputLayout + { + CONST_VTBL struct ID3D10InputLayoutVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10InputLayout_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10InputLayout_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10InputLayout_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10InputLayout_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10InputLayout_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10InputLayout_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10InputLayout_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10InputLayout_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0017 */ +/* [local] */ + +typedef +enum D3D10_FILTER + { D3D10_FILTER_MIN_MAG_MIP_POINT = 0, + D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1, + D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4, + D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5, + D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, + D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, + D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, + D3D10_FILTER_MIN_MAG_MIP_LINEAR = 0x15, + D3D10_FILTER_ANISOTROPIC = 0x55, + D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, + D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, + D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84, + D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85, + D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90, + D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91, + D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94, + D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95, + D3D10_FILTER_COMPARISON_ANISOTROPIC = 0xd5, + D3D10_FILTER_TEXT_1BIT = 0x80000000 + } D3D10_FILTER; + +typedef +enum D3D10_FILTER_TYPE + { D3D10_FILTER_TYPE_POINT = 0, + D3D10_FILTER_TYPE_LINEAR = 1 + } D3D10_FILTER_TYPE; + +#define D3D10_FILTER_TYPE_MASK ( 0x3 ) + +#define D3D10_MIN_FILTER_SHIFT ( 4 ) + +#define D3D10_MAG_FILTER_SHIFT ( 2 ) + +#define D3D10_MIP_FILTER_SHIFT ( 0 ) + +#define D3D10_COMPARISON_FILTERING_BIT ( 0x80 ) + +#define D3D10_ANISOTROPIC_FILTERING_BIT ( 0x40 ) + +#define D3D10_TEXT_1BIT_BIT ( 0x80000000 ) + +#define D3D10_ENCODE_BASIC_FILTER( min, mag, mip, bComparison ) \ + ( ( D3D10_FILTER ) ( \ + ( ( bComparison ) ? D3D10_COMPARISON_FILTERING_BIT : 0 ) | \ + ( ( ( min ) & D3D10_FILTER_TYPE_MASK ) << D3D10_MIN_FILTER_SHIFT ) | \ + ( ( ( mag ) & D3D10_FILTER_TYPE_MASK ) << D3D10_MAG_FILTER_SHIFT ) | \ + ( ( ( mip ) & D3D10_FILTER_TYPE_MASK ) << D3D10_MIP_FILTER_SHIFT ) ) ) +#define D3D10_ENCODE_ANISOTROPIC_FILTER( bComparison ) \ + ( ( D3D10_FILTER ) ( \ + D3D10_ANISOTROPIC_FILTERING_BIT | \ + D3D10_ENCODE_BASIC_FILTER( D3D10_FILTER_TYPE_LINEAR, \ + D3D10_FILTER_TYPE_LINEAR, \ + D3D10_FILTER_TYPE_LINEAR, \ + bComparison ) ) ) +#define D3D10_DECODE_MIN_FILTER( d3d10Filter ) \ + ( ( D3D10_FILTER_TYPE ) \ + ( ( ( d3d10Filter ) >> D3D10_MIN_FILTER_SHIFT ) & D3D10_FILTER_TYPE_MASK ) ) +#define D3D10_DECODE_MAG_FILTER( d3d10Filter ) \ + ( ( D3D10_FILTER_TYPE ) \ + ( ( ( d3d10Filter ) >> D3D10_MAG_FILTER_SHIFT ) & D3D10_FILTER_TYPE_MASK ) ) +#define D3D10_DECODE_MIP_FILTER( d3d10Filter ) \ + ( ( D3D10_FILTER_TYPE ) \ + ( ( ( d3d10Filter ) >> D3D10_MIP_FILTER_SHIFT ) & D3D10_FILTER_TYPE_MASK ) ) +#define D3D10_DECODE_IS_COMPARISON_FILTER( d3d10Filter ) \ + ( ( d3d10Filter ) & D3D10_COMPARISON_FILTERING_BIT ) +#define D3D10_DECODE_IS_ANISOTROPIC_FILTER( d3d10Filter ) \ + ( ( ( d3d10Filter ) & D3D10_ANISOTROPIC_FILTERING_BIT ) && \ + ( D3D10_FILTER_TYPE_LINEAR == D3D10_DECODE_MIN_FILTER( d3d10Filter ) ) && \ + ( D3D10_FILTER_TYPE_LINEAR == D3D10_DECODE_MAG_FILTER( d3d10Filter ) ) && \ + ( D3D10_FILTER_TYPE_LINEAR == D3D10_DECODE_MIP_FILTER( d3d10Filter ) ) ) +#define D3D10_DECODE_IS_TEXT_1BIT_FILTER( d3d10Filter ) \ + ( ( d3d10Filter ) == D3D10_TEXT_1BIT_BIT ) +typedef +enum D3D10_TEXTURE_ADDRESS_MODE + { D3D10_TEXTURE_ADDRESS_WRAP = 1, + D3D10_TEXTURE_ADDRESS_MIRROR = 2, + D3D10_TEXTURE_ADDRESS_CLAMP = 3, + D3D10_TEXTURE_ADDRESS_BORDER = 4, + D3D10_TEXTURE_ADDRESS_MIRROR_ONCE = 5 + } D3D10_TEXTURE_ADDRESS_MODE; + +typedef struct D3D10_SAMPLER_DESC + { + D3D10_FILTER Filter; + D3D10_TEXTURE_ADDRESS_MODE AddressU; + D3D10_TEXTURE_ADDRESS_MODE AddressV; + D3D10_TEXTURE_ADDRESS_MODE AddressW; + FLOAT MipLODBias; + UINT MaxAnisotropy; + D3D10_COMPARISON_FUNC ComparisonFunc; + FLOAT BorderColor[ 4 ]; + FLOAT MinLOD; + FLOAT MaxLOD; + } D3D10_SAMPLER_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0017_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0017_v0_0_s_ifspec; + +#ifndef __ID3D10SamplerState_INTERFACE_DEFINED__ +#define __ID3D10SamplerState_INTERFACE_DEFINED__ + +/* interface ID3D10SamplerState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10SamplerState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0C-342C-4106-A19F-4F2704F689F0") + ID3D10SamplerState : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_SAMPLER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10SamplerStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10SamplerState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10SamplerState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10SamplerState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10SamplerState * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10SamplerState * This, + /* [annotation] */ + __out D3D10_SAMPLER_DESC *pDesc); + + END_INTERFACE + } ID3D10SamplerStateVtbl; + + interface ID3D10SamplerState + { + CONST_VTBL struct ID3D10SamplerStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10SamplerState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10SamplerState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10SamplerState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10SamplerState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10SamplerState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10SamplerState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10SamplerState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10SamplerState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10SamplerState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0018 */ +/* [local] */ + +typedef +enum D3D10_FORMAT_SUPPORT + { D3D10_FORMAT_SUPPORT_BUFFER = 0x1, + D3D10_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x2, + D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x4, + D3D10_FORMAT_SUPPORT_SO_BUFFER = 0x8, + D3D10_FORMAT_SUPPORT_TEXTURE1D = 0x10, + D3D10_FORMAT_SUPPORT_TEXTURE2D = 0x20, + D3D10_FORMAT_SUPPORT_TEXTURE3D = 0x40, + D3D10_FORMAT_SUPPORT_TEXTURECUBE = 0x80, + D3D10_FORMAT_SUPPORT_SHADER_LOAD = 0x100, + D3D10_FORMAT_SUPPORT_SHADER_SAMPLE = 0x200, + D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x400, + D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x800, + D3D10_FORMAT_SUPPORT_MIP = 0x1000, + D3D10_FORMAT_SUPPORT_MIP_AUTOGEN = 0x2000, + D3D10_FORMAT_SUPPORT_RENDER_TARGET = 0x4000, + D3D10_FORMAT_SUPPORT_BLENDABLE = 0x8000, + D3D10_FORMAT_SUPPORT_DEPTH_STENCIL = 0x10000, + D3D10_FORMAT_SUPPORT_CPU_LOCKABLE = 0x20000, + D3D10_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x40000, + D3D10_FORMAT_SUPPORT_DISPLAY = 0x80000, + D3D10_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000, + D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000, + D3D10_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000, + D3D10_FORMAT_SUPPORT_SHADER_GATHER = 0x800000, + D3D10_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x1000000 + } D3D10_FORMAT_SUPPORT; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0018_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0018_v0_0_s_ifspec; + +#ifndef __ID3D10Asynchronous_INTERFACE_DEFINED__ +#define __ID3D10Asynchronous_INTERFACE_DEFINED__ + +/* interface ID3D10Asynchronous */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Asynchronous; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0D-342C-4106-A19F-4F2704F689F0") + ID3D10Asynchronous : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE Begin( void) = 0; + + virtual void STDMETHODCALLTYPE End( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetData( + /* [annotation] */ + __out_bcount_opt(DataSize) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags) = 0; + + virtual UINT STDMETHODCALLTYPE GetDataSize( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10AsynchronousVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Asynchronous * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Asynchronous * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Asynchronous * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Asynchronous * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *Begin )( + ID3D10Asynchronous * This); + + void ( STDMETHODCALLTYPE *End )( + ID3D10Asynchronous * This); + + HRESULT ( STDMETHODCALLTYPE *GetData )( + ID3D10Asynchronous * This, + /* [annotation] */ + __out_bcount_opt(DataSize) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D10Asynchronous * This); + + END_INTERFACE + } ID3D10AsynchronousVtbl; + + interface ID3D10Asynchronous + { + CONST_VTBL struct ID3D10AsynchronousVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Asynchronous_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Asynchronous_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Asynchronous_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Asynchronous_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Asynchronous_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Asynchronous_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Asynchronous_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Asynchronous_Begin(This) \ + ( (This)->lpVtbl -> Begin(This) ) + +#define ID3D10Asynchronous_End(This) \ + ( (This)->lpVtbl -> End(This) ) + +#define ID3D10Asynchronous_GetData(This,pData,DataSize,GetDataFlags) \ + ( (This)->lpVtbl -> GetData(This,pData,DataSize,GetDataFlags) ) + +#define ID3D10Asynchronous_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Asynchronous_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0019 */ +/* [local] */ + +typedef +enum D3D10_ASYNC_GETDATA_FLAG + { D3D10_ASYNC_GETDATA_DONOTFLUSH = 0x1 + } D3D10_ASYNC_GETDATA_FLAG; + +typedef +enum D3D10_QUERY + { D3D10_QUERY_EVENT = 0, + D3D10_QUERY_OCCLUSION = ( D3D10_QUERY_EVENT + 1 ) , + D3D10_QUERY_TIMESTAMP = ( D3D10_QUERY_OCCLUSION + 1 ) , + D3D10_QUERY_TIMESTAMP_DISJOINT = ( D3D10_QUERY_TIMESTAMP + 1 ) , + D3D10_QUERY_PIPELINE_STATISTICS = ( D3D10_QUERY_TIMESTAMP_DISJOINT + 1 ) , + D3D10_QUERY_OCCLUSION_PREDICATE = ( D3D10_QUERY_PIPELINE_STATISTICS + 1 ) , + D3D10_QUERY_SO_STATISTICS = ( D3D10_QUERY_OCCLUSION_PREDICATE + 1 ) , + D3D10_QUERY_SO_OVERFLOW_PREDICATE = ( D3D10_QUERY_SO_STATISTICS + 1 ) + } D3D10_QUERY; + +typedef +enum D3D10_QUERY_MISC_FLAG + { D3D10_QUERY_MISC_PREDICATEHINT = 0x1 + } D3D10_QUERY_MISC_FLAG; + +typedef struct D3D10_QUERY_DESC + { + D3D10_QUERY Query; + UINT MiscFlags; + } D3D10_QUERY_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0019_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0019_v0_0_s_ifspec; + +#ifndef __ID3D10Query_INTERFACE_DEFINED__ +#define __ID3D10Query_INTERFACE_DEFINED__ + +/* interface ID3D10Query */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Query; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0E-342C-4106-A19F-4F2704F689F0") + ID3D10Query : public ID3D10Asynchronous + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_QUERY_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10QueryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Query * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Query * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Query * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Query * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *Begin )( + ID3D10Query * This); + + void ( STDMETHODCALLTYPE *End )( + ID3D10Query * This); + + HRESULT ( STDMETHODCALLTYPE *GetData )( + ID3D10Query * This, + /* [annotation] */ + __out_bcount_opt(DataSize) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D10Query * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Query * This, + /* [annotation] */ + __out D3D10_QUERY_DESC *pDesc); + + END_INTERFACE + } ID3D10QueryVtbl; + + interface ID3D10Query + { + CONST_VTBL struct ID3D10QueryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Query_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Query_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Query_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Query_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Query_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Query_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Query_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Query_Begin(This) \ + ( (This)->lpVtbl -> Begin(This) ) + +#define ID3D10Query_End(This) \ + ( (This)->lpVtbl -> End(This) ) + +#define ID3D10Query_GetData(This,pData,DataSize,GetDataFlags) \ + ( (This)->lpVtbl -> GetData(This,pData,DataSize,GetDataFlags) ) + +#define ID3D10Query_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D10Query_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Query_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10Predicate_INTERFACE_DEFINED__ +#define __ID3D10Predicate_INTERFACE_DEFINED__ + +/* interface ID3D10Predicate */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Predicate; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C10-342C-4106-A19F-4F2704F689F0") + ID3D10Predicate : public ID3D10Query + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D10PredicateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Predicate * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Predicate * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Predicate * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Predicate * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *Begin )( + ID3D10Predicate * This); + + void ( STDMETHODCALLTYPE *End )( + ID3D10Predicate * This); + + HRESULT ( STDMETHODCALLTYPE *GetData )( + ID3D10Predicate * This, + /* [annotation] */ + __out_bcount_opt(DataSize) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D10Predicate * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Predicate * This, + /* [annotation] */ + __out D3D10_QUERY_DESC *pDesc); + + END_INTERFACE + } ID3D10PredicateVtbl; + + interface ID3D10Predicate + { + CONST_VTBL struct ID3D10PredicateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Predicate_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Predicate_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Predicate_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Predicate_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Predicate_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Predicate_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Predicate_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Predicate_Begin(This) \ + ( (This)->lpVtbl -> Begin(This) ) + +#define ID3D10Predicate_End(This) \ + ( (This)->lpVtbl -> End(This) ) + +#define ID3D10Predicate_GetData(This,pData,DataSize,GetDataFlags) \ + ( (This)->lpVtbl -> GetData(This,pData,DataSize,GetDataFlags) ) + +#define ID3D10Predicate_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D10Predicate_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Predicate_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0021 */ +/* [local] */ + +typedef struct D3D10_QUERY_DATA_TIMESTAMP_DISJOINT + { + UINT64 Frequency; + BOOL Disjoint; + } D3D10_QUERY_DATA_TIMESTAMP_DISJOINT; + +typedef struct D3D10_QUERY_DATA_PIPELINE_STATISTICS + { + UINT64 IAVertices; + UINT64 IAPrimitives; + UINT64 VSInvocations; + UINT64 GSInvocations; + UINT64 GSPrimitives; + UINT64 CInvocations; + UINT64 CPrimitives; + UINT64 PSInvocations; + } D3D10_QUERY_DATA_PIPELINE_STATISTICS; + +typedef struct D3D10_QUERY_DATA_SO_STATISTICS + { + UINT64 NumPrimitivesWritten; + UINT64 PrimitivesStorageNeeded; + } D3D10_QUERY_DATA_SO_STATISTICS; + +typedef +enum D3D10_COUNTER + { D3D10_COUNTER_GPU_IDLE = 0, + D3D10_COUNTER_VERTEX_PROCESSING = ( D3D10_COUNTER_GPU_IDLE + 1 ) , + D3D10_COUNTER_GEOMETRY_PROCESSING = ( D3D10_COUNTER_VERTEX_PROCESSING + 1 ) , + D3D10_COUNTER_PIXEL_PROCESSING = ( D3D10_COUNTER_GEOMETRY_PROCESSING + 1 ) , + D3D10_COUNTER_OTHER_GPU_PROCESSING = ( D3D10_COUNTER_PIXEL_PROCESSING + 1 ) , + D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION = ( D3D10_COUNTER_OTHER_GPU_PROCESSING + 1 ) , + D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION = ( D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION + 1 ) , + D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION + 1 ) , + D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION + 1 ) , + D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION + 1 ) , + D3D10_COUNTER_VS_MEMORY_LIMITED = ( D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION + 1 ) , + D3D10_COUNTER_VS_COMPUTATION_LIMITED = ( D3D10_COUNTER_VS_MEMORY_LIMITED + 1 ) , + D3D10_COUNTER_GS_MEMORY_LIMITED = ( D3D10_COUNTER_VS_COMPUTATION_LIMITED + 1 ) , + D3D10_COUNTER_GS_COMPUTATION_LIMITED = ( D3D10_COUNTER_GS_MEMORY_LIMITED + 1 ) , + D3D10_COUNTER_PS_MEMORY_LIMITED = ( D3D10_COUNTER_GS_COMPUTATION_LIMITED + 1 ) , + D3D10_COUNTER_PS_COMPUTATION_LIMITED = ( D3D10_COUNTER_PS_MEMORY_LIMITED + 1 ) , + D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE = ( D3D10_COUNTER_PS_COMPUTATION_LIMITED + 1 ) , + D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE = ( D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE + 1 ) , + D3D10_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000 + } D3D10_COUNTER; + +typedef +enum D3D10_COUNTER_TYPE + { D3D10_COUNTER_TYPE_FLOAT32 = 0, + D3D10_COUNTER_TYPE_UINT16 = ( D3D10_COUNTER_TYPE_FLOAT32 + 1 ) , + D3D10_COUNTER_TYPE_UINT32 = ( D3D10_COUNTER_TYPE_UINT16 + 1 ) , + D3D10_COUNTER_TYPE_UINT64 = ( D3D10_COUNTER_TYPE_UINT32 + 1 ) + } D3D10_COUNTER_TYPE; + +typedef struct D3D10_COUNTER_DESC + { + D3D10_COUNTER Counter; + UINT MiscFlags; + } D3D10_COUNTER_DESC; + +typedef struct D3D10_COUNTER_INFO + { + D3D10_COUNTER LastDeviceDependentCounter; + UINT NumSimultaneousCounters; + UINT8 NumDetectableParallelUnits; + } D3D10_COUNTER_INFO; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0021_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0021_v0_0_s_ifspec; + +#ifndef __ID3D10Counter_INTERFACE_DEFINED__ +#define __ID3D10Counter_INTERFACE_DEFINED__ + +/* interface ID3D10Counter */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Counter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C11-342C-4106-A19F-4F2704F689F0") + ID3D10Counter : public ID3D10Asynchronous + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_COUNTER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10CounterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Counter * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Counter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Counter * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Counter * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *Begin )( + ID3D10Counter * This); + + void ( STDMETHODCALLTYPE *End )( + ID3D10Counter * This); + + HRESULT ( STDMETHODCALLTYPE *GetData )( + ID3D10Counter * This, + /* [annotation] */ + __out_bcount_opt(DataSize) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D10Counter * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Counter * This, + /* [annotation] */ + __out D3D10_COUNTER_DESC *pDesc); + + END_INTERFACE + } ID3D10CounterVtbl; + + interface ID3D10Counter + { + CONST_VTBL struct ID3D10CounterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Counter_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Counter_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Counter_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Counter_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Counter_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Counter_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Counter_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Counter_Begin(This) \ + ( (This)->lpVtbl -> Begin(This) ) + +#define ID3D10Counter_End(This) \ + ( (This)->lpVtbl -> End(This) ) + +#define ID3D10Counter_GetData(This,pData,DataSize,GetDataFlags) \ + ( (This)->lpVtbl -> GetData(This,pData,DataSize,GetDataFlags) ) + +#define ID3D10Counter_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D10Counter_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Counter_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10Device_INTERFACE_DEFINED__ +#define __ID3D10Device_INTERFACE_DEFINED__ + +/* interface ID3D10Device */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Device; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0F-342C-4106-A19F-4F2704F689F0") + ID3D10Device : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE VSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE PSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE PSSetShader( + /* [annotation] */ + __in_opt ID3D10PixelShader *pPixelShader) = 0; + + virtual void STDMETHODCALLTYPE PSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE VSSetShader( + /* [annotation] */ + __in_opt ID3D10VertexShader *pVertexShader) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexed( + /* [annotation] */ + __in UINT IndexCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation) = 0; + + virtual void STDMETHODCALLTYPE Draw( + /* [annotation] */ + __in UINT VertexCount, + /* [annotation] */ + __in UINT StartVertexLocation) = 0; + + virtual void STDMETHODCALLTYPE PSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE IASetInputLayout( + /* [annotation] */ + __in_opt ID3D10InputLayout *pInputLayout) = 0; + + virtual void STDMETHODCALLTYPE IASetVertexBuffers( + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppVertexBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pStrides, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE IASetIndexBuffer( + /* [annotation] */ + __in_opt ID3D10Buffer *pIndexBuffer, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT Offset) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexedInstanced( + /* [annotation] */ + __in UINT IndexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE DrawInstanced( + /* [annotation] */ + __in UINT VertexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE GSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE GSSetShader( + /* [annotation] */ + __in_opt ID3D10GeometryShader *pShader) = 0; + + virtual void STDMETHODCALLTYPE IASetPrimitiveTopology( + /* [annotation] */ + __in D3D10_PRIMITIVE_TOPOLOGY Topology) = 0; + + virtual void STDMETHODCALLTYPE VSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE VSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + /* [annotation] */ + __in_opt ID3D10Predicate *pPredicate, + /* [annotation] */ + __in BOOL PredicateValue) = 0; + + virtual void STDMETHODCALLTYPE GSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE GSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE OMSetRenderTargets( + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __in_ecount_opt(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D10DepthStencilView *pDepthStencilView) = 0; + + virtual void STDMETHODCALLTYPE OMSetBlendState( + /* [annotation] */ + __in_opt ID3D10BlendState *pBlendState, + /* [annotation] */ + __in const FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __in UINT SampleMask) = 0; + + virtual void STDMETHODCALLTYPE OMSetDepthStencilState( + /* [annotation] */ + __in_opt ID3D10DepthStencilState *pDepthStencilState, + /* [annotation] */ + __in UINT StencilRef) = 0; + + virtual void STDMETHODCALLTYPE SOSetTargets( + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, + /* [annotation] */ + __in_ecount_opt(NumBuffers) ID3D10Buffer *const *ppSOTargets, + /* [annotation] */ + __in_ecount_opt(NumBuffers) const UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE DrawAuto( void) = 0; + + virtual void STDMETHODCALLTYPE RSSetState( + /* [annotation] */ + __in_opt ID3D10RasterizerState *pRasterizerState) = 0; + + virtual void STDMETHODCALLTYPE RSSetViewports( + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + /* [annotation] */ + __in_ecount_opt(NumViewports) const D3D10_VIEWPORT *pViewports) = 0; + + virtual void STDMETHODCALLTYPE RSSetScissorRects( + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + /* [annotation] */ + __in_ecount_opt(NumRects) const D3D10_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE CopySubresourceRegion( + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in UINT DstX, + /* [annotation] */ + __in UINT DstY, + /* [annotation] */ + __in UINT DstZ, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pSrcBox) = 0; + + virtual void STDMETHODCALLTYPE CopyResource( + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource) = 0; + + virtual void STDMETHODCALLTYPE UpdateSubresource( + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pDstBox, + /* [annotation] */ + __in const void *pSrcData, + /* [annotation] */ + __in UINT SrcRowPitch, + /* [annotation] */ + __in UINT SrcDepthPitch) = 0; + + virtual void STDMETHODCALLTYPE ClearRenderTargetView( + /* [annotation] */ + __in ID3D10RenderTargetView *pRenderTargetView, + /* [annotation] */ + __in const FLOAT ColorRGBA[ 4 ]) = 0; + + virtual void STDMETHODCALLTYPE ClearDepthStencilView( + /* [annotation] */ + __in ID3D10DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in UINT ClearFlags, + /* [annotation] */ + __in FLOAT Depth, + /* [annotation] */ + __in UINT8 Stencil) = 0; + + virtual void STDMETHODCALLTYPE GenerateMips( + /* [annotation] */ + __in ID3D10ShaderResourceView *pShaderResourceView) = 0; + + virtual void STDMETHODCALLTYPE ResolveSubresource( + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in DXGI_FORMAT Format) = 0; + + virtual void STDMETHODCALLTYPE VSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE PSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE PSGetShader( + /* [annotation] */ + __out ID3D10PixelShader **ppPixelShader) = 0; + + virtual void STDMETHODCALLTYPE PSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE VSGetShader( + /* [annotation] */ + __out ID3D10VertexShader **ppVertexShader) = 0; + + virtual void STDMETHODCALLTYPE PSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE IAGetInputLayout( + /* [annotation] */ + __out ID3D10InputLayout **ppInputLayout) = 0; + + virtual void STDMETHODCALLTYPE IAGetVertexBuffers( + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppVertexBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pStrides, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE IAGetIndexBuffer( + /* [annotation] */ + __out_opt ID3D10Buffer **pIndexBuffer, + /* [annotation] */ + __out_opt DXGI_FORMAT *Format, + /* [annotation] */ + __out_opt UINT *Offset) = 0; + + virtual void STDMETHODCALLTYPE GSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE GSGetShader( + /* [annotation] */ + __out ID3D10GeometryShader **ppGeometryShader) = 0; + + virtual void STDMETHODCALLTYPE IAGetPrimitiveTopology( + /* [annotation] */ + __out D3D10_PRIMITIVE_TOPOLOGY *pTopology) = 0; + + virtual void STDMETHODCALLTYPE VSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE VSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE GetPredication( + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate, + /* [annotation] */ + __out_opt BOOL *pPredicateValue) = 0; + + virtual void STDMETHODCALLTYPE GSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE GSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE OMGetRenderTargets( + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __out_ecount_opt(NumViews) ID3D10RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView) = 0; + + virtual void STDMETHODCALLTYPE OMGetBlendState( + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState, + /* [annotation] */ + __out_opt FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __out_opt UINT *pSampleMask) = 0; + + virtual void STDMETHODCALLTYPE OMGetDepthStencilState( + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState, + /* [annotation] */ + __out_opt UINT *pStencilRef) = 0; + + virtual void STDMETHODCALLTYPE SOGetTargets( + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppSOTargets, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE RSGetState( + /* [annotation] */ + __out ID3D10RasterizerState **ppRasterizerState) = 0; + + virtual void STDMETHODCALLTYPE RSGetViewports( + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports, + /* [annotation] */ + __out_ecount_opt(*NumViewports) D3D10_VIEWPORT *pViewports) = 0; + + virtual void STDMETHODCALLTYPE RSGetScissorRects( + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects, + /* [annotation] */ + __out_ecount_opt(*NumRects) D3D10_RECT *pRects) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetExceptionMode( + UINT RaiseFlags) = 0; + + virtual UINT STDMETHODCALLTYPE GetExceptionMode( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData) = 0; + + virtual void STDMETHODCALLTYPE ClearState( void) = 0; + + virtual void STDMETHODCALLTYPE Flush( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateBuffer( + /* [annotation] */ + __in const D3D10_BUFFER_DESC *pDesc, + /* [annotation] */ + __in_opt const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D10Buffer **ppBuffer) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture1D( + /* [annotation] */ + __in const D3D10_TEXTURE1D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture1D **ppTexture1D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture2D( + /* [annotation] */ + __in const D3D10_TEXTURE2D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture2D **ppTexture2D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture3D( + /* [annotation] */ + __in const D3D10_TEXTURE3D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture3D **ppTexture3D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView( + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10ShaderResourceView **ppSRView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRenderTargetView( + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_RENDER_TARGET_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10RenderTargetView **ppRTView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilView( + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateInputLayout( + /* [annotation] */ + __in_ecount(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, + /* [annotation] */ + __in const void *pShaderBytecodeWithInputSignature, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10InputLayout **ppInputLayout) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVertexShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10VertexShader **ppVertexShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGeometryShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGeometryShaderWithStreamOutput( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_ecount_opt(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration, + /* [annotation] */ + __in_range( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries, + /* [annotation] */ + __in UINT OutputStreamStride, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePixelShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10PixelShader **ppPixelShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateBlendState( + /* [annotation] */ + __in const D3D10_BLEND_DESC *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilState( + /* [annotation] */ + __in const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState( + /* [annotation] */ + __in const D3D10_RASTERIZER_DESC *pRasterizerDesc, + /* [annotation] */ + __out_opt ID3D10RasterizerState **ppRasterizerState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSamplerState( + /* [annotation] */ + __in const D3D10_SAMPLER_DESC *pSamplerDesc, + /* [annotation] */ + __out_opt ID3D10SamplerState **ppSamplerState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateQuery( + /* [annotation] */ + __in const D3D10_QUERY_DESC *pQueryDesc, + /* [annotation] */ + __out_opt ID3D10Query **ppQuery) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePredicate( + /* [annotation] */ + __in const D3D10_QUERY_DESC *pPredicateDesc, + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCounter( + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pCounterDesc, + /* [annotation] */ + __out_opt ID3D10Counter **ppCounter) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckFormatSupport( + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __out UINT *pFormatSupport) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckMultisampleQualityLevels( + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT SampleCount, + /* [annotation] */ + __out UINT *pNumQualityLevels) = 0; + + virtual void STDMETHODCALLTYPE CheckCounterInfo( + /* [annotation] */ + __out D3D10_COUNTER_INFO *pCounterInfo) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckCounter( + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pDesc, + /* [annotation] */ + __out D3D10_COUNTER_TYPE *pType, + /* [annotation] */ + __out UINT *pActiveCounters, + /* [annotation] */ + __out_ecount_opt(*pNameLength) LPSTR szName, + /* [annotation] */ + __inout_opt UINT *pNameLength, + /* [annotation] */ + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + /* [annotation] */ + __inout_opt UINT *pUnitsLength, + /* [annotation] */ + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + /* [annotation] */ + __inout_opt UINT *pDescriptionLength) = 0; + + virtual UINT STDMETHODCALLTYPE GetCreationFlags( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenSharedResource( + /* [annotation] */ + __in HANDLE hResource, + /* [annotation] */ + __in REFIID ReturnedInterface, + /* [annotation] */ + __out_opt void **ppResource) = 0; + + virtual void STDMETHODCALLTYPE SetTextFilterSize( + /* [annotation] */ + __in UINT Width, + /* [annotation] */ + __in UINT Height) = 0; + + virtual void STDMETHODCALLTYPE GetTextFilterSize( + /* [annotation] */ + __out_opt UINT *pWidth, + /* [annotation] */ + __out_opt UINT *pHeight) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10DeviceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Device * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Device * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Device * This); + + void ( STDMETHODCALLTYPE *VSSetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSSetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSSetShader )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10PixelShader *pPixelShader); + + void ( STDMETHODCALLTYPE *PSSetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *VSSetShader )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10VertexShader *pVertexShader); + + void ( STDMETHODCALLTYPE *DrawIndexed )( + ID3D10Device * This, + /* [annotation] */ + __in UINT IndexCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation); + + void ( STDMETHODCALLTYPE *Draw )( + ID3D10Device * This, + /* [annotation] */ + __in UINT VertexCount, + /* [annotation] */ + __in UINT StartVertexLocation); + + void ( STDMETHODCALLTYPE *PSSetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IASetInputLayout )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10InputLayout *pInputLayout); + + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppVertexBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pStrides, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10Buffer *pIndexBuffer, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT Offset); + + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D10Device * This, + /* [annotation] */ + __in UINT IndexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D10Device * This, + /* [annotation] */ + __in UINT VertexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *GSSetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSSetShader )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10GeometryShader *pShader); + + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D10Device * This, + /* [annotation] */ + __in D3D10_PRIMITIVE_TOPOLOGY Topology); + + void ( STDMETHODCALLTYPE *VSSetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSSetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10Predicate *pPredicate, + /* [annotation] */ + __in BOOL PredicateValue); + + void ( STDMETHODCALLTYPE *GSSetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSSetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __in_ecount_opt(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D10DepthStencilView *pDepthStencilView); + + void ( STDMETHODCALLTYPE *OMSetBlendState )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10BlendState *pBlendState, + /* [annotation] */ + __in const FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __in UINT SampleMask); + + void ( STDMETHODCALLTYPE *OMSetDepthStencilState )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10DepthStencilState *pDepthStencilState, + /* [annotation] */ + __in UINT StencilRef); + + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, + /* [annotation] */ + __in_ecount_opt(NumBuffers) ID3D10Buffer *const *ppSOTargets, + /* [annotation] */ + __in_ecount_opt(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *DrawAuto )( + ID3D10Device * This); + + void ( STDMETHODCALLTYPE *RSSetState )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10RasterizerState *pRasterizerState); + + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D10Device * This, + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + /* [annotation] */ + __in_ecount_opt(NumViewports) const D3D10_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D10Device * This, + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + /* [annotation] */ + __in_ecount_opt(NumRects) const D3D10_RECT *pRects); + + void ( STDMETHODCALLTYPE *CopySubresourceRegion )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in UINT DstX, + /* [annotation] */ + __in UINT DstY, + /* [annotation] */ + __in UINT DstZ, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pSrcBox); + + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource); + + void ( STDMETHODCALLTYPE *UpdateSubresource )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pDstBox, + /* [annotation] */ + __in const void *pSrcData, + /* [annotation] */ + __in UINT SrcRowPitch, + /* [annotation] */ + __in UINT SrcDepthPitch); + + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10RenderTargetView *pRenderTargetView, + /* [annotation] */ + __in const FLOAT ColorRGBA[ 4 ]); + + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in UINT ClearFlags, + /* [annotation] */ + __in FLOAT Depth, + /* [annotation] */ + __in UINT8 Stencil); + + void ( STDMETHODCALLTYPE *GenerateMips )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10ShaderResourceView *pShaderResourceView); + + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in DXGI_FORMAT Format); + + void ( STDMETHODCALLTYPE *VSGetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSGetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSGetShader )( + ID3D10Device * This, + /* [annotation] */ + __out ID3D10PixelShader **ppPixelShader); + + void ( STDMETHODCALLTYPE *PSGetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *VSGetShader )( + ID3D10Device * This, + /* [annotation] */ + __out ID3D10VertexShader **ppVertexShader); + + void ( STDMETHODCALLTYPE *PSGetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IAGetInputLayout )( + ID3D10Device * This, + /* [annotation] */ + __out ID3D10InputLayout **ppInputLayout); + + void ( STDMETHODCALLTYPE *IAGetVertexBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppVertexBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pStrides, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IAGetIndexBuffer )( + ID3D10Device * This, + /* [annotation] */ + __out_opt ID3D10Buffer **pIndexBuffer, + /* [annotation] */ + __out_opt DXGI_FORMAT *Format, + /* [annotation] */ + __out_opt UINT *Offset); + + void ( STDMETHODCALLTYPE *GSGetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSGetShader )( + ID3D10Device * This, + /* [annotation] */ + __out ID3D10GeometryShader **ppGeometryShader); + + void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )( + ID3D10Device * This, + /* [annotation] */ + __out D3D10_PRIMITIVE_TOPOLOGY *pTopology); + + void ( STDMETHODCALLTYPE *VSGetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSGetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *GetPredication )( + ID3D10Device * This, + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate, + /* [annotation] */ + __out_opt BOOL *pPredicateValue); + + void ( STDMETHODCALLTYPE *GSGetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSGetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *OMGetRenderTargets )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __out_ecount_opt(NumViews) ID3D10RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView); + + void ( STDMETHODCALLTYPE *OMGetBlendState )( + ID3D10Device * This, + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState, + /* [annotation] */ + __out_opt FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __out_opt UINT *pSampleMask); + + void ( STDMETHODCALLTYPE *OMGetDepthStencilState )( + ID3D10Device * This, + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState, + /* [annotation] */ + __out_opt UINT *pStencilRef); + + void ( STDMETHODCALLTYPE *SOGetTargets )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppSOTargets, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets); + + void ( STDMETHODCALLTYPE *RSGetState )( + ID3D10Device * This, + /* [annotation] */ + __out ID3D10RasterizerState **ppRasterizerState); + + void ( STDMETHODCALLTYPE *RSGetViewports )( + ID3D10Device * This, + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports, + /* [annotation] */ + __out_ecount_opt(*NumViewports) D3D10_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSGetScissorRects )( + ID3D10Device * This, + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects, + /* [annotation] */ + __out_ecount_opt(*NumRects) D3D10_RECT *pRects); + + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D10Device * This); + + HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )( + ID3D10Device * This, + UINT RaiseFlags); + + UINT ( STDMETHODCALLTYPE *GetExceptionMode )( + ID3D10Device * This); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *ClearState )( + ID3D10Device * This); + + void ( STDMETHODCALLTYPE *Flush )( + ID3D10Device * This); + + HRESULT ( STDMETHODCALLTYPE *CreateBuffer )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_BUFFER_DESC *pDesc, + /* [annotation] */ + __in_opt const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D10Buffer **ppBuffer); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_TEXTURE1D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture1D **ppTexture1D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_TEXTURE2D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture2D **ppTexture2D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_TEXTURE3D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture3D **ppTexture3D); + + HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10ShaderResourceView **ppSRView); + + HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_RENDER_TARGET_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10RenderTargetView **ppRTView); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView); + + HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )( + ID3D10Device * This, + /* [annotation] */ + __in_ecount(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, + /* [annotation] */ + __in const void *pShaderBytecodeWithInputSignature, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10InputLayout **ppInputLayout); + + HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )( + ID3D10Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10VertexShader **ppVertexShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )( + ID3D10Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )( + ID3D10Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_ecount_opt(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration, + /* [annotation] */ + __in_range( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries, + /* [annotation] */ + __in UINT OutputStreamStride, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )( + ID3D10Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10PixelShader **ppPixelShader); + + HRESULT ( STDMETHODCALLTYPE *CreateBlendState )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_BLEND_DESC *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState); + + HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_RASTERIZER_DESC *pRasterizerDesc, + /* [annotation] */ + __out_opt ID3D10RasterizerState **ppRasterizerState); + + HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_SAMPLER_DESC *pSamplerDesc, + /* [annotation] */ + __out_opt ID3D10SamplerState **ppSamplerState); + + HRESULT ( STDMETHODCALLTYPE *CreateQuery )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_QUERY_DESC *pQueryDesc, + /* [annotation] */ + __out_opt ID3D10Query **ppQuery); + + HRESULT ( STDMETHODCALLTYPE *CreatePredicate )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_QUERY_DESC *pPredicateDesc, + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate); + + HRESULT ( STDMETHODCALLTYPE *CreateCounter )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pCounterDesc, + /* [annotation] */ + __out_opt ID3D10Counter **ppCounter); + + HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )( + ID3D10Device * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __out UINT *pFormatSupport); + + HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )( + ID3D10Device * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT SampleCount, + /* [annotation] */ + __out UINT *pNumQualityLevels); + + void ( STDMETHODCALLTYPE *CheckCounterInfo )( + ID3D10Device * This, + /* [annotation] */ + __out D3D10_COUNTER_INFO *pCounterInfo); + + HRESULT ( STDMETHODCALLTYPE *CheckCounter )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pDesc, + /* [annotation] */ + __out D3D10_COUNTER_TYPE *pType, + /* [annotation] */ + __out UINT *pActiveCounters, + /* [annotation] */ + __out_ecount_opt(*pNameLength) LPSTR szName, + /* [annotation] */ + __inout_opt UINT *pNameLength, + /* [annotation] */ + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + /* [annotation] */ + __inout_opt UINT *pUnitsLength, + /* [annotation] */ + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + /* [annotation] */ + __inout_opt UINT *pDescriptionLength); + + UINT ( STDMETHODCALLTYPE *GetCreationFlags )( + ID3D10Device * This); + + HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )( + ID3D10Device * This, + /* [annotation] */ + __in HANDLE hResource, + /* [annotation] */ + __in REFIID ReturnedInterface, + /* [annotation] */ + __out_opt void **ppResource); + + void ( STDMETHODCALLTYPE *SetTextFilterSize )( + ID3D10Device * This, + /* [annotation] */ + __in UINT Width, + /* [annotation] */ + __in UINT Height); + + void ( STDMETHODCALLTYPE *GetTextFilterSize )( + ID3D10Device * This, + /* [annotation] */ + __out_opt UINT *pWidth, + /* [annotation] */ + __out_opt UINT *pHeight); + + END_INTERFACE + } ID3D10DeviceVtbl; + + interface ID3D10Device + { + CONST_VTBL struct ID3D10DeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Device_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Device_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Device_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Device_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_PSSetShader(This,pPixelShader) \ + ( (This)->lpVtbl -> PSSetShader(This,pPixelShader) ) + +#define ID3D10Device_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_VSSetShader(This,pVertexShader) \ + ( (This)->lpVtbl -> VSSetShader(This,pVertexShader) ) + +#define ID3D10Device_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) \ + ( (This)->lpVtbl -> DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) ) + +#define ID3D10Device_Draw(This,VertexCount,StartVertexLocation) \ + ( (This)->lpVtbl -> Draw(This,VertexCount,StartVertexLocation) ) + +#define ID3D10Device_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_IASetInputLayout(This,pInputLayout) \ + ( (This)->lpVtbl -> IASetInputLayout(This,pInputLayout) ) + +#define ID3D10Device_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D10Device_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D10Device_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D10Device_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D10Device_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_GSSetShader(This,pShader) \ + ( (This)->lpVtbl -> GSSetShader(This,pShader) ) + +#define ID3D10Device_IASetPrimitiveTopology(This,Topology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,Topology) ) + +#define ID3D10Device_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_SetPredication(This,pPredicate,PredicateValue) \ + ( (This)->lpVtbl -> SetPredication(This,pPredicate,PredicateValue) ) + +#define ID3D10Device_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) ) + +#define ID3D10Device_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) \ + ( (This)->lpVtbl -> OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) ) + +#define ID3D10Device_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) \ + ( (This)->lpVtbl -> OMSetDepthStencilState(This,pDepthStencilState,StencilRef) ) + +#define ID3D10Device_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ + ( (This)->lpVtbl -> SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) + +#define ID3D10Device_DrawAuto(This) \ + ( (This)->lpVtbl -> DrawAuto(This) ) + +#define ID3D10Device_RSSetState(This,pRasterizerState) \ + ( (This)->lpVtbl -> RSSetState(This,pRasterizerState) ) + +#define ID3D10Device_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D10Device_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D10Device_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) ) + +#define ID3D10Device_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D10Device_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D10Device_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) ) + +#define ID3D10Device_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) ) + +#define ID3D10Device_GenerateMips(This,pShaderResourceView) \ + ( (This)->lpVtbl -> GenerateMips(This,pShaderResourceView) ) + +#define ID3D10Device_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D10Device_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_PSGetShader(This,ppPixelShader) \ + ( (This)->lpVtbl -> PSGetShader(This,ppPixelShader) ) + +#define ID3D10Device_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_VSGetShader(This,ppVertexShader) \ + ( (This)->lpVtbl -> VSGetShader(This,ppVertexShader) ) + +#define ID3D10Device_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_IAGetInputLayout(This,ppInputLayout) \ + ( (This)->lpVtbl -> IAGetInputLayout(This,ppInputLayout) ) + +#define ID3D10Device_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D10Device_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D10Device_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_GSGetShader(This,ppGeometryShader) \ + ( (This)->lpVtbl -> GSGetShader(This,ppGeometryShader) ) + +#define ID3D10Device_IAGetPrimitiveTopology(This,pTopology) \ + ( (This)->lpVtbl -> IAGetPrimitiveTopology(This,pTopology) ) + +#define ID3D10Device_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_GetPredication(This,ppPredicate,pPredicateValue) \ + ( (This)->lpVtbl -> GetPredication(This,ppPredicate,pPredicateValue) ) + +#define ID3D10Device_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) \ + ( (This)->lpVtbl -> OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) ) + +#define ID3D10Device_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) \ + ( (This)->lpVtbl -> OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) ) + +#define ID3D10Device_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) \ + ( (This)->lpVtbl -> OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) ) + +#define ID3D10Device_SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ + ( (This)->lpVtbl -> SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) + +#define ID3D10Device_RSGetState(This,ppRasterizerState) \ + ( (This)->lpVtbl -> RSGetState(This,ppRasterizerState) ) + +#define ID3D10Device_RSGetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSGetViewports(This,NumViewports,pViewports) ) + +#define ID3D10Device_RSGetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSGetScissorRects(This,NumRects,pRects) ) + +#define ID3D10Device_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D10Device_SetExceptionMode(This,RaiseFlags) \ + ( (This)->lpVtbl -> SetExceptionMode(This,RaiseFlags) ) + +#define ID3D10Device_GetExceptionMode(This) \ + ( (This)->lpVtbl -> GetExceptionMode(This) ) + +#define ID3D10Device_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Device_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Device_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D10Device_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D10Device_Flush(This) \ + ( (This)->lpVtbl -> Flush(This) ) + +#define ID3D10Device_CreateBuffer(This,pDesc,pInitialData,ppBuffer) \ + ( (This)->lpVtbl -> CreateBuffer(This,pDesc,pInitialData,ppBuffer) ) + +#define ID3D10Device_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) \ + ( (This)->lpVtbl -> CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) ) + +#define ID3D10Device_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) \ + ( (This)->lpVtbl -> CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) ) + +#define ID3D10Device_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) \ + ( (This)->lpVtbl -> CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) ) + +#define ID3D10Device_CreateShaderResourceView(This,pResource,pDesc,ppSRView) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,ppSRView) ) + +#define ID3D10Device_CreateRenderTargetView(This,pResource,pDesc,ppRTView) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,ppRTView) ) + +#define ID3D10Device_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) ) + +#define ID3D10Device_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) \ + ( (This)->lpVtbl -> CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) ) + +#define ID3D10Device_CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) \ + ( (This)->lpVtbl -> CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) ) + +#define ID3D10Device_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) ) + +#define ID3D10Device_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) ) + +#define ID3D10Device_CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) \ + ( (This)->lpVtbl -> CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) ) + +#define ID3D10Device_CreateBlendState(This,pBlendStateDesc,ppBlendState) \ + ( (This)->lpVtbl -> CreateBlendState(This,pBlendStateDesc,ppBlendState) ) + +#define ID3D10Device_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) \ + ( (This)->lpVtbl -> CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) ) + +#define ID3D10Device_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) \ + ( (This)->lpVtbl -> CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) ) + +#define ID3D10Device_CreateSamplerState(This,pSamplerDesc,ppSamplerState) \ + ( (This)->lpVtbl -> CreateSamplerState(This,pSamplerDesc,ppSamplerState) ) + +#define ID3D10Device_CreateQuery(This,pQueryDesc,ppQuery) \ + ( (This)->lpVtbl -> CreateQuery(This,pQueryDesc,ppQuery) ) + +#define ID3D10Device_CreatePredicate(This,pPredicateDesc,ppPredicate) \ + ( (This)->lpVtbl -> CreatePredicate(This,pPredicateDesc,ppPredicate) ) + +#define ID3D10Device_CreateCounter(This,pCounterDesc,ppCounter) \ + ( (This)->lpVtbl -> CreateCounter(This,pCounterDesc,ppCounter) ) + +#define ID3D10Device_CheckFormatSupport(This,Format,pFormatSupport) \ + ( (This)->lpVtbl -> CheckFormatSupport(This,Format,pFormatSupport) ) + +#define ID3D10Device_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) \ + ( (This)->lpVtbl -> CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) ) + +#define ID3D10Device_CheckCounterInfo(This,pCounterInfo) \ + ( (This)->lpVtbl -> CheckCounterInfo(This,pCounterInfo) ) + +#define ID3D10Device_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) \ + ( (This)->lpVtbl -> CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) ) + +#define ID3D10Device_GetCreationFlags(This) \ + ( (This)->lpVtbl -> GetCreationFlags(This) ) + +#define ID3D10Device_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) \ + ( (This)->lpVtbl -> OpenSharedResource(This,hResource,ReturnedInterface,ppResource) ) + +#define ID3D10Device_SetTextFilterSize(This,Width,Height) \ + ( (This)->lpVtbl -> SetTextFilterSize(This,Width,Height) ) + +#define ID3D10Device_GetTextFilterSize(This,pWidth,pHeight) \ + ( (This)->lpVtbl -> GetTextFilterSize(This,pWidth,pHeight) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Device_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10Multithread_INTERFACE_DEFINED__ +#define __ID3D10Multithread_INTERFACE_DEFINED__ + +/* interface ID3D10Multithread */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Multithread; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4E00-342C-4106-A19F-4F2704F689F0") + ID3D10Multithread : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE Enter( void) = 0; + + virtual void STDMETHODCALLTYPE Leave( void) = 0; + + virtual BOOL STDMETHODCALLTYPE SetMultithreadProtected( + /* [annotation] */ + __in BOOL bMTProtect) = 0; + + virtual BOOL STDMETHODCALLTYPE GetMultithreadProtected( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10MultithreadVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Multithread * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Multithread * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Multithread * This); + + void ( STDMETHODCALLTYPE *Enter )( + ID3D10Multithread * This); + + void ( STDMETHODCALLTYPE *Leave )( + ID3D10Multithread * This); + + BOOL ( STDMETHODCALLTYPE *SetMultithreadProtected )( + ID3D10Multithread * This, + /* [annotation] */ + __in BOOL bMTProtect); + + BOOL ( STDMETHODCALLTYPE *GetMultithreadProtected )( + ID3D10Multithread * This); + + END_INTERFACE + } ID3D10MultithreadVtbl; + + interface ID3D10Multithread + { + CONST_VTBL struct ID3D10MultithreadVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Multithread_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Multithread_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Multithread_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Multithread_Enter(This) \ + ( (This)->lpVtbl -> Enter(This) ) + +#define ID3D10Multithread_Leave(This) \ + ( (This)->lpVtbl -> Leave(This) ) + +#define ID3D10Multithread_SetMultithreadProtected(This,bMTProtect) \ + ( (This)->lpVtbl -> SetMultithreadProtected(This,bMTProtect) ) + +#define ID3D10Multithread_GetMultithreadProtected(This) \ + ( (This)->lpVtbl -> GetMultithreadProtected(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Multithread_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0024 */ +/* [local] */ + +typedef +enum D3D10_CREATE_DEVICE_FLAG + { D3D10_CREATE_DEVICE_SINGLETHREADED = 0x1, + D3D10_CREATE_DEVICE_DEBUG = 0x2, + D3D10_CREATE_DEVICE_SWITCH_TO_REF = 0x4, + D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8, + D3D10_CREATE_DEVICE_ALLOW_NULL_FROM_MAP = 0x10, + D3D10_CREATE_DEVICE_BGRA_SUPPORT = 0x20, + D3D10_CREATE_DEVICE_STRICT_VALIDATION = 0x200 + } D3D10_CREATE_DEVICE_FLAG; + + +#define D3D10_SDK_VERSION ( 29 ) + +#if !defined( D3D10_IGNORE_SDK_LAYERS ) +#include "d3d10sdklayers.h" +#endif +#include "d3d10misc.h" +#include "d3d10shader.h" +#include "d3d10effect.h" +DEFINE_GUID(IID_ID3D10DeviceChild,0x9B7E4C00,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10DepthStencilState,0x2B4B1CC8,0xA4AD,0x41f8,0x83,0x22,0xCA,0x86,0xFC,0x3E,0xC6,0x75); +DEFINE_GUID(IID_ID3D10BlendState,0xEDAD8D19,0x8A35,0x4d6d,0x85,0x66,0x2E,0xA2,0x76,0xCD,0xE1,0x61); +DEFINE_GUID(IID_ID3D10RasterizerState,0xA2A07292,0x89AF,0x4345,0xBE,0x2E,0xC5,0x3D,0x9F,0xBB,0x6E,0x9F); +DEFINE_GUID(IID_ID3D10Resource,0x9B7E4C01,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Buffer,0x9B7E4C02,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Texture1D,0x9B7E4C03,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Texture2D,0x9B7E4C04,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Texture3D,0x9B7E4C05,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10View,0xC902B03F,0x60A7,0x49BA,0x99,0x36,0x2A,0x3A,0xB3,0x7A,0x7E,0x33); +DEFINE_GUID(IID_ID3D10ShaderResourceView,0x9B7E4C07,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10RenderTargetView,0x9B7E4C08,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10DepthStencilView,0x9B7E4C09,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10VertexShader,0x9B7E4C0A,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10GeometryShader,0x6316BE88,0x54CD,0x4040,0xAB,0x44,0x20,0x46,0x1B,0xC8,0x1F,0x68); +DEFINE_GUID(IID_ID3D10PixelShader,0x4968B601,0x9D00,0x4cde,0x83,0x46,0x8E,0x7F,0x67,0x58,0x19,0xB6); +DEFINE_GUID(IID_ID3D10InputLayout,0x9B7E4C0B,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10SamplerState,0x9B7E4C0C,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Asynchronous,0x9B7E4C0D,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Query,0x9B7E4C0E,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Predicate,0x9B7E4C10,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Counter,0x9B7E4C11,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Device,0x9B7E4C0F,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Multithread,0x9B7E4E00,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0024_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0024_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/RenderDll/Dx9Sdk/Include/D3D10_1.h b/RenderDll/Dx9Sdk/Include/D3D10_1.h new file mode 100644 index 0000000..17a8ec5 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3D10_1.h @@ -0,0 +1,1775 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d10_1_h__ +#define __d3d10_1_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D10BlendState1_FWD_DEFINED__ +#define __ID3D10BlendState1_FWD_DEFINED__ +typedef interface ID3D10BlendState1 ID3D10BlendState1; +#endif /* __ID3D10BlendState1_FWD_DEFINED__ */ + + +#ifndef __ID3D10ShaderResourceView1_FWD_DEFINED__ +#define __ID3D10ShaderResourceView1_FWD_DEFINED__ +typedef interface ID3D10ShaderResourceView1 ID3D10ShaderResourceView1; +#endif /* __ID3D10ShaderResourceView1_FWD_DEFINED__ */ + + +#ifndef __ID3D10Device1_FWD_DEFINED__ +#define __ID3D10Device1_FWD_DEFINED__ +typedef interface ID3D10Device1 ID3D10Device1; +#endif /* __ID3D10Device1_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d10_1_0000_0000 */ +/* [local] */ + +#if defined( __d3d10_h__ ) && !defined( D3D10_ARBITRARY_HEADER_ORDERING ) +#error d3d10.h is included before d3d10_1.h, and it will confuse tools that honor SAL annotations. \ +If possibly targeting d3d10.1, include d3d10_1.h instead of d3d10.h, or ensure d3d10_1.h is included before d3d10.h +#endif +#ifndef _D3D10_1_CONSTANTS +#define _D3D10_1_CONSTANTS +#define D3D10_1_DEFAULT_SAMPLE_MASK ( 0xffffffff ) + +#define D3D10_1_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 ) +#define D3D10_1_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f ) +#define D3D10_1_GS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ( 32 ) + +#define D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS ( 128 ) + +#define D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ( 32 ) + +#define D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENTS ( 1 ) + +#define D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_1_PS_OUTPUT_MASK_REGISTER_COUNT ( 1 ) + +#define D3D10_1_SHADER_MAJOR_VERSION ( 4 ) + +#define D3D10_1_SHADER_MINOR_VERSION ( 1 ) + +#define D3D10_1_SO_BUFFER_MAX_STRIDE_IN_BYTES ( 2048 ) + +#define D3D10_1_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES ( 256 ) + +#define D3D10_1_SO_BUFFER_SLOT_COUNT ( 4 ) + +#define D3D10_1_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER ( 1 ) + +#define D3D10_1_SO_SINGLE_BUFFER_COMPONENT_LIMIT ( 64 ) + +#define D3D10_1_STANDARD_VERTEX_ELEMENT_COUNT ( 32 ) + +#define D3D10_1_SUBPIXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D10_1_VS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D10_1_VS_OUTPUT_REGISTER_COUNT ( 32 ) + +#endif +#include "d3d10.h" // + +typedef +enum D3D10_FEATURE_LEVEL1 + { D3D10_FEATURE_LEVEL_10_0 = 0xa000, + D3D10_FEATURE_LEVEL_10_1 = 0xa100, + D3D10_FEATURE_LEVEL_9_1 = 0x9100, + D3D10_FEATURE_LEVEL_9_2 = 0x9200, + D3D10_FEATURE_LEVEL_9_3 = 0x9300 + } D3D10_FEATURE_LEVEL1; + +typedef struct D3D10_RENDER_TARGET_BLEND_DESC1 + { + BOOL BlendEnable; + D3D10_BLEND SrcBlend; + D3D10_BLEND DestBlend; + D3D10_BLEND_OP BlendOp; + D3D10_BLEND SrcBlendAlpha; + D3D10_BLEND DestBlendAlpha; + D3D10_BLEND_OP BlendOpAlpha; + UINT8 RenderTargetWriteMask; + } D3D10_RENDER_TARGET_BLEND_DESC1; + +typedef struct D3D10_BLEND_DESC1 + { + BOOL AlphaToCoverageEnable; + BOOL IndependentBlendEnable; + D3D10_RENDER_TARGET_BLEND_DESC1 RenderTarget[ 8 ]; + } D3D10_BLEND_DESC1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D10BlendState1_INTERFACE_DEFINED__ +#define __ID3D10BlendState1_INTERFACE_DEFINED__ + +/* interface ID3D10BlendState1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10BlendState1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EDAD8D99-8A35-4d6d-8566-2EA276CDE161") + ID3D10BlendState1 : public ID3D10BlendState + { + public: + virtual void STDMETHODCALLTYPE GetDesc1( + /* [annotation] */ + __out D3D10_BLEND_DESC1 *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10BlendState1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10BlendState1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10BlendState1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10BlendState1 * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10BlendState1 * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10BlendState1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10BlendState1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10BlendState1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10BlendState1 * This, + /* [annotation] */ + __out D3D10_BLEND_DESC *pDesc); + + void ( STDMETHODCALLTYPE *GetDesc1 )( + ID3D10BlendState1 * This, + /* [annotation] */ + __out D3D10_BLEND_DESC1 *pDesc); + + END_INTERFACE + } ID3D10BlendState1Vtbl; + + interface ID3D10BlendState1 + { + CONST_VTBL struct ID3D10BlendState1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10BlendState1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10BlendState1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10BlendState1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10BlendState1_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10BlendState1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10BlendState1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10BlendState1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10BlendState1_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + + +#define ID3D10BlendState1_GetDesc1(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc1(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10BlendState1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_1_0000_0001 */ +/* [local] */ + +typedef struct D3D10_TEXCUBE_ARRAY_SRV1 + { + UINT MostDetailedMip; + UINT MipLevels; + UINT First2DArrayFace; + UINT NumCubes; + } D3D10_TEXCUBE_ARRAY_SRV1; + +typedef D3D_SRV_DIMENSION D3D10_SRV_DIMENSION1; + +typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC1 + { + DXGI_FORMAT Format; + D3D10_SRV_DIMENSION1 ViewDimension; + union + { + D3D10_BUFFER_SRV Buffer; + D3D10_TEX1D_SRV Texture1D; + D3D10_TEX1D_ARRAY_SRV Texture1DArray; + D3D10_TEX2D_SRV Texture2D; + D3D10_TEX2D_ARRAY_SRV Texture2DArray; + D3D10_TEX2DMS_SRV Texture2DMS; + D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray; + D3D10_TEX3D_SRV Texture3D; + D3D10_TEXCUBE_SRV TextureCube; + D3D10_TEXCUBE_ARRAY_SRV1 TextureCubeArray; + } ; + } D3D10_SHADER_RESOURCE_VIEW_DESC1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ +#define __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ + +/* interface ID3D10ShaderResourceView1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10ShaderResourceView1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C87-342C-4106-A19F-4F2704F689F0") + ID3D10ShaderResourceView1 : public ID3D10ShaderResourceView + { + public: + virtual void STDMETHODCALLTYPE GetDesc1( + /* [annotation] */ + __out D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10ShaderResourceView1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10ShaderResourceView1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10ShaderResourceView1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10ShaderResourceView1 * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __out ID3D10Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __out D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc); + + void ( STDMETHODCALLTYPE *GetDesc1 )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __out D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc); + + END_INTERFACE + } ID3D10ShaderResourceView1Vtbl; + + interface ID3D10ShaderResourceView1 + { + CONST_VTBL struct ID3D10ShaderResourceView1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10ShaderResourceView1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10ShaderResourceView1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10ShaderResourceView1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10ShaderResourceView1_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10ShaderResourceView1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10ShaderResourceView1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10ShaderResourceView1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10ShaderResourceView1_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D10ShaderResourceView1_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + + +#define ID3D10ShaderResourceView1_GetDesc1(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc1(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_1_0000_0002 */ +/* [local] */ + +typedef +enum D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS + { D3D10_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff, + D3D10_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe + } D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0002_v0_0_s_ifspec; + +#ifndef __ID3D10Device1_INTERFACE_DEFINED__ +#define __ID3D10Device1_INTERFACE_DEFINED__ + +/* interface ID3D10Device1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Device1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C8F-342C-4106-A19F-4F2704F689F0") + ID3D10Device1 : public ID3D10Device + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView1( + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, + /* [annotation] */ + __out_opt ID3D10ShaderResourceView1 **ppSRView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateBlendState1( + /* [annotation] */ + __in const D3D10_BLEND_DESC1 *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D10BlendState1 **ppBlendState) = 0; + + virtual D3D10_FEATURE_LEVEL1 STDMETHODCALLTYPE GetFeatureLevel( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10Device1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Device1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Device1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Device1 * This); + + void ( STDMETHODCALLTYPE *VSSetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSSetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSSetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10PixelShader *pPixelShader); + + void ( STDMETHODCALLTYPE *PSSetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *VSSetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10VertexShader *pVertexShader); + + void ( STDMETHODCALLTYPE *DrawIndexed )( + ID3D10Device1 * This, + /* [annotation] */ + __in UINT IndexCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation); + + void ( STDMETHODCALLTYPE *Draw )( + ID3D10Device1 * This, + /* [annotation] */ + __in UINT VertexCount, + /* [annotation] */ + __in UINT StartVertexLocation); + + void ( STDMETHODCALLTYPE *PSSetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IASetInputLayout )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10InputLayout *pInputLayout); + + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppVertexBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pStrides, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10Buffer *pIndexBuffer, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT Offset); + + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D10Device1 * This, + /* [annotation] */ + __in UINT IndexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D10Device1 * This, + /* [annotation] */ + __in UINT VertexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *GSSetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSSetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10GeometryShader *pShader); + + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D10Device1 * This, + /* [annotation] */ + __in D3D10_PRIMITIVE_TOPOLOGY Topology); + + void ( STDMETHODCALLTYPE *VSSetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSSetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10Predicate *pPredicate, + /* [annotation] */ + __in BOOL PredicateValue); + + void ( STDMETHODCALLTYPE *GSSetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSSetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __in_ecount_opt(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D10DepthStencilView *pDepthStencilView); + + void ( STDMETHODCALLTYPE *OMSetBlendState )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10BlendState *pBlendState, + /* [annotation] */ + __in const FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __in UINT SampleMask); + + void ( STDMETHODCALLTYPE *OMSetDepthStencilState )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10DepthStencilState *pDepthStencilState, + /* [annotation] */ + __in UINT StencilRef); + + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, + /* [annotation] */ + __in_ecount_opt(NumBuffers) ID3D10Buffer *const *ppSOTargets, + /* [annotation] */ + __in_ecount_opt(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *DrawAuto )( + ID3D10Device1 * This); + + void ( STDMETHODCALLTYPE *RSSetState )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10RasterizerState *pRasterizerState); + + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + /* [annotation] */ + __in_ecount_opt(NumViewports) const D3D10_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + /* [annotation] */ + __in_ecount_opt(NumRects) const D3D10_RECT *pRects); + + void ( STDMETHODCALLTYPE *CopySubresourceRegion )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in UINT DstX, + /* [annotation] */ + __in UINT DstY, + /* [annotation] */ + __in UINT DstZ, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pSrcBox); + + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource); + + void ( STDMETHODCALLTYPE *UpdateSubresource )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pDstBox, + /* [annotation] */ + __in const void *pSrcData, + /* [annotation] */ + __in UINT SrcRowPitch, + /* [annotation] */ + __in UINT SrcDepthPitch); + + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10RenderTargetView *pRenderTargetView, + /* [annotation] */ + __in const FLOAT ColorRGBA[ 4 ]); + + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in UINT ClearFlags, + /* [annotation] */ + __in FLOAT Depth, + /* [annotation] */ + __in UINT8 Stencil); + + void ( STDMETHODCALLTYPE *GenerateMips )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10ShaderResourceView *pShaderResourceView); + + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in DXGI_FORMAT Format); + + void ( STDMETHODCALLTYPE *VSGetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSGetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSGetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __out ID3D10PixelShader **ppPixelShader); + + void ( STDMETHODCALLTYPE *PSGetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *VSGetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __out ID3D10VertexShader **ppVertexShader); + + void ( STDMETHODCALLTYPE *PSGetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IAGetInputLayout )( + ID3D10Device1 * This, + /* [annotation] */ + __out ID3D10InputLayout **ppInputLayout); + + void ( STDMETHODCALLTYPE *IAGetVertexBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppVertexBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pStrides, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IAGetIndexBuffer )( + ID3D10Device1 * This, + /* [annotation] */ + __out_opt ID3D10Buffer **pIndexBuffer, + /* [annotation] */ + __out_opt DXGI_FORMAT *Format, + /* [annotation] */ + __out_opt UINT *Offset); + + void ( STDMETHODCALLTYPE *GSGetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSGetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __out ID3D10GeometryShader **ppGeometryShader); + + void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )( + ID3D10Device1 * This, + /* [annotation] */ + __out D3D10_PRIMITIVE_TOPOLOGY *pTopology); + + void ( STDMETHODCALLTYPE *VSGetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSGetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *GetPredication )( + ID3D10Device1 * This, + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate, + /* [annotation] */ + __out_opt BOOL *pPredicateValue); + + void ( STDMETHODCALLTYPE *GSGetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSGetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *OMGetRenderTargets )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __out_ecount_opt(NumViews) ID3D10RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView); + + void ( STDMETHODCALLTYPE *OMGetBlendState )( + ID3D10Device1 * This, + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState, + /* [annotation] */ + __out_opt FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __out_opt UINT *pSampleMask); + + void ( STDMETHODCALLTYPE *OMGetDepthStencilState )( + ID3D10Device1 * This, + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState, + /* [annotation] */ + __out_opt UINT *pStencilRef); + + void ( STDMETHODCALLTYPE *SOGetTargets )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppSOTargets, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets); + + void ( STDMETHODCALLTYPE *RSGetState )( + ID3D10Device1 * This, + /* [annotation] */ + __out ID3D10RasterizerState **ppRasterizerState); + + void ( STDMETHODCALLTYPE *RSGetViewports )( + ID3D10Device1 * This, + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports, + /* [annotation] */ + __out_ecount_opt(*NumViewports) D3D10_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSGetScissorRects )( + ID3D10Device1 * This, + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects, + /* [annotation] */ + __out_ecount_opt(*NumRects) D3D10_RECT *pRects); + + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D10Device1 * This); + + HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )( + ID3D10Device1 * This, + UINT RaiseFlags); + + UINT ( STDMETHODCALLTYPE *GetExceptionMode )( + ID3D10Device1 * This); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Device1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Device1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Device1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *ClearState )( + ID3D10Device1 * This); + + void ( STDMETHODCALLTYPE *Flush )( + ID3D10Device1 * This); + + HRESULT ( STDMETHODCALLTYPE *CreateBuffer )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_BUFFER_DESC *pDesc, + /* [annotation] */ + __in_opt const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D10Buffer **ppBuffer); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_TEXTURE1D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture1D **ppTexture1D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_TEXTURE2D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture2D **ppTexture2D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_TEXTURE3D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture3D **ppTexture3D); + + HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10ShaderResourceView **ppSRView); + + HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_RENDER_TARGET_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10RenderTargetView **ppRTView); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView); + + HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )( + ID3D10Device1 * This, + /* [annotation] */ + __in_ecount(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, + /* [annotation] */ + __in const void *pShaderBytecodeWithInputSignature, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10InputLayout **ppInputLayout); + + HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10VertexShader **ppVertexShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )( + ID3D10Device1 * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_ecount_opt(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration, + /* [annotation] */ + __in_range( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries, + /* [annotation] */ + __in UINT OutputStreamStride, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10PixelShader **ppPixelShader); + + HRESULT ( STDMETHODCALLTYPE *CreateBlendState )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_BLEND_DESC *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState); + + HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_RASTERIZER_DESC *pRasterizerDesc, + /* [annotation] */ + __out_opt ID3D10RasterizerState **ppRasterizerState); + + HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_SAMPLER_DESC *pSamplerDesc, + /* [annotation] */ + __out_opt ID3D10SamplerState **ppSamplerState); + + HRESULT ( STDMETHODCALLTYPE *CreateQuery )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_QUERY_DESC *pQueryDesc, + /* [annotation] */ + __out_opt ID3D10Query **ppQuery); + + HRESULT ( STDMETHODCALLTYPE *CreatePredicate )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_QUERY_DESC *pPredicateDesc, + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate); + + HRESULT ( STDMETHODCALLTYPE *CreateCounter )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pCounterDesc, + /* [annotation] */ + __out_opt ID3D10Counter **ppCounter); + + HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )( + ID3D10Device1 * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __out UINT *pFormatSupport); + + HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )( + ID3D10Device1 * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT SampleCount, + /* [annotation] */ + __out UINT *pNumQualityLevels); + + void ( STDMETHODCALLTYPE *CheckCounterInfo )( + ID3D10Device1 * This, + /* [annotation] */ + __out D3D10_COUNTER_INFO *pCounterInfo); + + HRESULT ( STDMETHODCALLTYPE *CheckCounter )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pDesc, + /* [annotation] */ + __out D3D10_COUNTER_TYPE *pType, + /* [annotation] */ + __out UINT *pActiveCounters, + /* [annotation] */ + __out_ecount_opt(*pNameLength) LPSTR szName, + /* [annotation] */ + __inout_opt UINT *pNameLength, + /* [annotation] */ + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + /* [annotation] */ + __inout_opt UINT *pUnitsLength, + /* [annotation] */ + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + /* [annotation] */ + __inout_opt UINT *pDescriptionLength); + + UINT ( STDMETHODCALLTYPE *GetCreationFlags )( + ID3D10Device1 * This); + + HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )( + ID3D10Device1 * This, + /* [annotation] */ + __in HANDLE hResource, + /* [annotation] */ + __in REFIID ReturnedInterface, + /* [annotation] */ + __out_opt void **ppResource); + + void ( STDMETHODCALLTYPE *SetTextFilterSize )( + ID3D10Device1 * This, + /* [annotation] */ + __in UINT Width, + /* [annotation] */ + __in UINT Height); + + void ( STDMETHODCALLTYPE *GetTextFilterSize )( + ID3D10Device1 * This, + /* [annotation] */ + __out_opt UINT *pWidth, + /* [annotation] */ + __out_opt UINT *pHeight); + + HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView1 )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, + /* [annotation] */ + __out_opt ID3D10ShaderResourceView1 **ppSRView); + + HRESULT ( STDMETHODCALLTYPE *CreateBlendState1 )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_BLEND_DESC1 *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D10BlendState1 **ppBlendState); + + D3D10_FEATURE_LEVEL1 ( STDMETHODCALLTYPE *GetFeatureLevel )( + ID3D10Device1 * This); + + END_INTERFACE + } ID3D10Device1Vtbl; + + interface ID3D10Device1 + { + CONST_VTBL struct ID3D10Device1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Device1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Device1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Device1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Device1_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_PSSetShader(This,pPixelShader) \ + ( (This)->lpVtbl -> PSSetShader(This,pPixelShader) ) + +#define ID3D10Device1_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_VSSetShader(This,pVertexShader) \ + ( (This)->lpVtbl -> VSSetShader(This,pVertexShader) ) + +#define ID3D10Device1_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) \ + ( (This)->lpVtbl -> DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) ) + +#define ID3D10Device1_Draw(This,VertexCount,StartVertexLocation) \ + ( (This)->lpVtbl -> Draw(This,VertexCount,StartVertexLocation) ) + +#define ID3D10Device1_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_IASetInputLayout(This,pInputLayout) \ + ( (This)->lpVtbl -> IASetInputLayout(This,pInputLayout) ) + +#define ID3D10Device1_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D10Device1_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D10Device1_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D10Device1_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D10Device1_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_GSSetShader(This,pShader) \ + ( (This)->lpVtbl -> GSSetShader(This,pShader) ) + +#define ID3D10Device1_IASetPrimitiveTopology(This,Topology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,Topology) ) + +#define ID3D10Device1_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_SetPredication(This,pPredicate,PredicateValue) \ + ( (This)->lpVtbl -> SetPredication(This,pPredicate,PredicateValue) ) + +#define ID3D10Device1_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) ) + +#define ID3D10Device1_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) \ + ( (This)->lpVtbl -> OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) ) + +#define ID3D10Device1_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) \ + ( (This)->lpVtbl -> OMSetDepthStencilState(This,pDepthStencilState,StencilRef) ) + +#define ID3D10Device1_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ + ( (This)->lpVtbl -> SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) + +#define ID3D10Device1_DrawAuto(This) \ + ( (This)->lpVtbl -> DrawAuto(This) ) + +#define ID3D10Device1_RSSetState(This,pRasterizerState) \ + ( (This)->lpVtbl -> RSSetState(This,pRasterizerState) ) + +#define ID3D10Device1_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D10Device1_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D10Device1_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) ) + +#define ID3D10Device1_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D10Device1_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D10Device1_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) ) + +#define ID3D10Device1_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) ) + +#define ID3D10Device1_GenerateMips(This,pShaderResourceView) \ + ( (This)->lpVtbl -> GenerateMips(This,pShaderResourceView) ) + +#define ID3D10Device1_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D10Device1_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_PSGetShader(This,ppPixelShader) \ + ( (This)->lpVtbl -> PSGetShader(This,ppPixelShader) ) + +#define ID3D10Device1_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_VSGetShader(This,ppVertexShader) \ + ( (This)->lpVtbl -> VSGetShader(This,ppVertexShader) ) + +#define ID3D10Device1_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_IAGetInputLayout(This,ppInputLayout) \ + ( (This)->lpVtbl -> IAGetInputLayout(This,ppInputLayout) ) + +#define ID3D10Device1_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D10Device1_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D10Device1_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_GSGetShader(This,ppGeometryShader) \ + ( (This)->lpVtbl -> GSGetShader(This,ppGeometryShader) ) + +#define ID3D10Device1_IAGetPrimitiveTopology(This,pTopology) \ + ( (This)->lpVtbl -> IAGetPrimitiveTopology(This,pTopology) ) + +#define ID3D10Device1_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_GetPredication(This,ppPredicate,pPredicateValue) \ + ( (This)->lpVtbl -> GetPredication(This,ppPredicate,pPredicateValue) ) + +#define ID3D10Device1_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) \ + ( (This)->lpVtbl -> OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) ) + +#define ID3D10Device1_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) \ + ( (This)->lpVtbl -> OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) ) + +#define ID3D10Device1_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) \ + ( (This)->lpVtbl -> OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) ) + +#define ID3D10Device1_SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ + ( (This)->lpVtbl -> SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) + +#define ID3D10Device1_RSGetState(This,ppRasterizerState) \ + ( (This)->lpVtbl -> RSGetState(This,ppRasterizerState) ) + +#define ID3D10Device1_RSGetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSGetViewports(This,NumViewports,pViewports) ) + +#define ID3D10Device1_RSGetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSGetScissorRects(This,NumRects,pRects) ) + +#define ID3D10Device1_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D10Device1_SetExceptionMode(This,RaiseFlags) \ + ( (This)->lpVtbl -> SetExceptionMode(This,RaiseFlags) ) + +#define ID3D10Device1_GetExceptionMode(This) \ + ( (This)->lpVtbl -> GetExceptionMode(This) ) + +#define ID3D10Device1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Device1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Device1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D10Device1_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D10Device1_Flush(This) \ + ( (This)->lpVtbl -> Flush(This) ) + +#define ID3D10Device1_CreateBuffer(This,pDesc,pInitialData,ppBuffer) \ + ( (This)->lpVtbl -> CreateBuffer(This,pDesc,pInitialData,ppBuffer) ) + +#define ID3D10Device1_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) \ + ( (This)->lpVtbl -> CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) ) + +#define ID3D10Device1_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) \ + ( (This)->lpVtbl -> CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) ) + +#define ID3D10Device1_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) \ + ( (This)->lpVtbl -> CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) ) + +#define ID3D10Device1_CreateShaderResourceView(This,pResource,pDesc,ppSRView) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,ppSRView) ) + +#define ID3D10Device1_CreateRenderTargetView(This,pResource,pDesc,ppRTView) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,ppRTView) ) + +#define ID3D10Device1_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) ) + +#define ID3D10Device1_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) \ + ( (This)->lpVtbl -> CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) ) + +#define ID3D10Device1_CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) \ + ( (This)->lpVtbl -> CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) ) + +#define ID3D10Device1_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) ) + +#define ID3D10Device1_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) ) + +#define ID3D10Device1_CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) \ + ( (This)->lpVtbl -> CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) ) + +#define ID3D10Device1_CreateBlendState(This,pBlendStateDesc,ppBlendState) \ + ( (This)->lpVtbl -> CreateBlendState(This,pBlendStateDesc,ppBlendState) ) + +#define ID3D10Device1_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) \ + ( (This)->lpVtbl -> CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) ) + +#define ID3D10Device1_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) \ + ( (This)->lpVtbl -> CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) ) + +#define ID3D10Device1_CreateSamplerState(This,pSamplerDesc,ppSamplerState) \ + ( (This)->lpVtbl -> CreateSamplerState(This,pSamplerDesc,ppSamplerState) ) + +#define ID3D10Device1_CreateQuery(This,pQueryDesc,ppQuery) \ + ( (This)->lpVtbl -> CreateQuery(This,pQueryDesc,ppQuery) ) + +#define ID3D10Device1_CreatePredicate(This,pPredicateDesc,ppPredicate) \ + ( (This)->lpVtbl -> CreatePredicate(This,pPredicateDesc,ppPredicate) ) + +#define ID3D10Device1_CreateCounter(This,pCounterDesc,ppCounter) \ + ( (This)->lpVtbl -> CreateCounter(This,pCounterDesc,ppCounter) ) + +#define ID3D10Device1_CheckFormatSupport(This,Format,pFormatSupport) \ + ( (This)->lpVtbl -> CheckFormatSupport(This,Format,pFormatSupport) ) + +#define ID3D10Device1_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) \ + ( (This)->lpVtbl -> CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) ) + +#define ID3D10Device1_CheckCounterInfo(This,pCounterInfo) \ + ( (This)->lpVtbl -> CheckCounterInfo(This,pCounterInfo) ) + +#define ID3D10Device1_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) \ + ( (This)->lpVtbl -> CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) ) + +#define ID3D10Device1_GetCreationFlags(This) \ + ( (This)->lpVtbl -> GetCreationFlags(This) ) + +#define ID3D10Device1_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) \ + ( (This)->lpVtbl -> OpenSharedResource(This,hResource,ReturnedInterface,ppResource) ) + +#define ID3D10Device1_SetTextFilterSize(This,Width,Height) \ + ( (This)->lpVtbl -> SetTextFilterSize(This,Width,Height) ) + +#define ID3D10Device1_GetTextFilterSize(This,pWidth,pHeight) \ + ( (This)->lpVtbl -> GetTextFilterSize(This,pWidth,pHeight) ) + + +#define ID3D10Device1_CreateShaderResourceView1(This,pResource,pDesc,ppSRView) \ + ( (This)->lpVtbl -> CreateShaderResourceView1(This,pResource,pDesc,ppSRView) ) + +#define ID3D10Device1_CreateBlendState1(This,pBlendStateDesc,ppBlendState) \ + ( (This)->lpVtbl -> CreateBlendState1(This,pBlendStateDesc,ppBlendState) ) + +#define ID3D10Device1_GetFeatureLevel(This) \ + ( (This)->lpVtbl -> GetFeatureLevel(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Device1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_1_0000_0003 */ +/* [local] */ + +#define D3D10_1_SDK_VERSION ( ( 0 + 0x20 ) ) + +#include "d3d10_1shader.h" + +/////////////////////////////////////////////////////////////////////////// +// D3D10CreateDevice1 +// ------------------ +// +// pAdapter +// If NULL, D3D10CreateDevice1 will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D10CreateDevice1 will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D10CreateDeviceAndSwapChain1. +// HardwareLevel +// Any of those documented for D3D10CreateDeviceAndSwapChain1. +// SDKVersion +// SDK version. Use the D3D10_1_SDK_VERSION macro. +// ppDevice +// Pointer to returned interface. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D10CreateDevice1 +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D10_CREATE_DEVICE1)(IDXGIAdapter *, + D3D10_DRIVER_TYPE, HMODULE, UINT, D3D10_FEATURE_LEVEL1, UINT, ID3D10Device1**); + +HRESULT WINAPI D3D10CreateDevice1( + IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + D3D10_FEATURE_LEVEL1 HardwareLevel, + UINT SDKVersion, + ID3D10Device1 **ppDevice); + +/////////////////////////////////////////////////////////////////////////// +// D3D10CreateDeviceAndSwapChain1 +// ------------------------------ +// +// ppAdapter +// If NULL, D3D10CreateDevice1 will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D10CreateDevice1 will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D10CreateDevice1. +// HardwareLevel +// Any of: +// D3D10_CREATE_LEVEL_10_0 +// D3D10_CREATE_LEVEL_10_1 +// SDKVersion +// SDK version. Use the D3D10_1_SDK_VERSION macro. +// pSwapChainDesc +// Swap chain description, may be NULL. +// ppSwapChain +// Pointer to returned interface. May be NULL. +// ppDevice +// Pointer to returned interface. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D10CreateDevice1 +// IDXGIFactory::CreateSwapChain +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D10_CREATE_DEVICE_AND_SWAP_CHAIN1)(IDXGIAdapter *, + D3D10_DRIVER_TYPE, HMODULE, UINT, D3D10_FEATURE_LEVEL1, UINT, DXGI_SWAP_CHAIN_DESC *, IDXGISwapChain **, ID3D10Device1 **); + +HRESULT WINAPI D3D10CreateDeviceAndSwapChain1( + IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + D3D10_FEATURE_LEVEL1 HardwareLevel, + UINT SDKVersion, + DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, + IDXGISwapChain **ppSwapChain, + ID3D10Device1 **ppDevice); +DEFINE_GUID(IID_ID3D10BlendState1,0xEDAD8D99,0x8A35,0x4d6d,0x85,0x66,0x2E,0xA2,0x76,0xCD,0xE1,0x61); +DEFINE_GUID(IID_ID3D10ShaderResourceView1,0x9B7E4C87,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Device1,0x9B7E4C8F,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0003_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/RenderDll/Dx9Sdk/Include/D3D10_1shader.h b/RenderDll/Dx9Sdk/Include/D3D10_1shader.h new file mode 100644 index 0000000..2726f8f --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3D10_1shader.h @@ -0,0 +1,301 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3D10_1Shader.h +// Content: D3D10.1 Shader Types and APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D10_1SHADER_H__ +#define __D3D10_1SHADER_H__ + +#include "d3d10shader.h" + +//---------------------------------------------------------------------------- +// Shader debugging structures +//---------------------------------------------------------------------------- + +typedef enum _D3D10_SHADER_DEBUG_REGTYPE +{ + D3D10_SHADER_DEBUG_REG_INPUT, + D3D10_SHADER_DEBUG_REG_OUTPUT, + D3D10_SHADER_DEBUG_REG_CBUFFER, + D3D10_SHADER_DEBUG_REG_TBUFFER, + D3D10_SHADER_DEBUG_REG_TEMP, + D3D10_SHADER_DEBUG_REG_TEMPARRAY, + D3D10_SHADER_DEBUG_REG_TEXTURE, + D3D10_SHADER_DEBUG_REG_SAMPLER, + D3D10_SHADER_DEBUG_REG_IMMEDIATECBUFFER, + D3D10_SHADER_DEBUG_REG_LITERAL, + D3D10_SHADER_DEBUG_REG_UNUSED, + D3D11_SHADER_DEBUG_REG_INTERFACE_POINTERS, + D3D11_SHADER_DEBUG_REG_UAV, + D3D10_SHADER_DEBUG_REG_FORCE_DWORD = 0x7fffffff, +} D3D10_SHADER_DEBUG_REGTYPE; + +typedef enum _D3D10_SHADER_DEBUG_SCOPETYPE +{ + D3D10_SHADER_DEBUG_SCOPE_GLOBAL, + D3D10_SHADER_DEBUG_SCOPE_BLOCK, + D3D10_SHADER_DEBUG_SCOPE_FORLOOP, + D3D10_SHADER_DEBUG_SCOPE_STRUCT, + D3D10_SHADER_DEBUG_SCOPE_FUNC_PARAMS, + D3D10_SHADER_DEBUG_SCOPE_STATEBLOCK, + D3D10_SHADER_DEBUG_SCOPE_NAMESPACE, + D3D10_SHADER_DEBUG_SCOPE_ANNOTATION, + D3D10_SHADER_DEBUG_SCOPE_FORCE_DWORD = 0x7fffffff, +} D3D10_SHADER_DEBUG_SCOPETYPE; + +typedef enum _D3D10_SHADER_DEBUG_VARTYPE +{ + D3D10_SHADER_DEBUG_VAR_VARIABLE, + D3D10_SHADER_DEBUG_VAR_FUNCTION, + D3D10_SHADER_DEBUG_VAR_FORCE_DWORD = 0x7fffffff, +} D3D10_SHADER_DEBUG_VARTYPE; + +///////////////////////////////////////////////////////////////////// +// These are the serialized structures that get written to the file +///////////////////////////////////////////////////////////////////// + +typedef struct _D3D10_SHADER_DEBUG_TOKEN_INFO +{ + UINT File; // offset into file list + UINT Line; // line # + UINT Column; // column # + + UINT TokenLength; + UINT TokenId; // offset to LPCSTR of length TokenLength in string datastore +} D3D10_SHADER_DEBUG_TOKEN_INFO; + +// Variable list +typedef struct _D3D10_SHADER_DEBUG_VAR_INFO +{ + // Index into token list for declaring identifier + UINT TokenId; + D3D10_SHADER_VARIABLE_TYPE Type; + // register and component for this variable, only valid/necessary for arrays + UINT Register; + UINT Component; + // gives the original variable that declared this variable + UINT ScopeVar; + // this variable's offset in its ScopeVar + UINT ScopeVarOffset; +} D3D10_SHADER_DEBUG_VAR_INFO; + +typedef struct _D3D10_SHADER_DEBUG_INPUT_INFO +{ + // index into array of variables of variable to initialize + UINT Var; + // input, cbuffer, tbuffer + D3D10_SHADER_DEBUG_REGTYPE InitialRegisterSet; + // set to cbuffer or tbuffer slot, geometry shader input primitive #, + // identifying register for indexable temp, or -1 + UINT InitialBank; + // -1 if temp, otherwise gives register in register set + UINT InitialRegister; + // -1 if temp, otherwise gives component + UINT InitialComponent; + // initial value if literal + UINT InitialValue; +} D3D10_SHADER_DEBUG_INPUT_INFO; + +typedef struct _D3D10_SHADER_DEBUG_SCOPEVAR_INFO +{ + // Index into variable token + UINT TokenId; + + D3D10_SHADER_DEBUG_VARTYPE VarType; // variable or function (different namespaces) + D3D10_SHADER_VARIABLE_CLASS Class; + UINT Rows; // number of rows (matrices) + UINT Columns; // number of columns (vectors and matrices) + + // In an array of structures, one struct member scope is provided, and + // you'll have to add the array stride times the index to the variable + // index you find, then find that variable in this structure's list of + // variables. + + // gives a scope to look up struct members. -1 if not a struct + UINT StructMemberScope; + + // number of array indices + UINT uArrayIndices; // a[3][2][1] has 3 indices + // maximum array index for each index + // offset to UINT[uArrayIndices] in UINT datastore + UINT ArrayElements; // a[3][2][1] has {3, 2, 1} + // how many variables each array index moves + // offset to UINT[uArrayIndices] in UINT datastore + UINT ArrayStrides; // a[3][2][1] has {2, 1, 1} + + UINT uVariables; + // index of the first variable, later variables are offsets from this one + UINT uFirstVariable; +} D3D10_SHADER_DEBUG_SCOPEVAR_INFO; + +// scope data, this maps variable names to debug variables (useful for the watch window) +typedef struct _D3D10_SHADER_DEBUG_SCOPE_INFO +{ + D3D10_SHADER_DEBUG_SCOPETYPE ScopeType; + UINT Name; // offset to name of scope in strings list + UINT uNameLen; // length of name string + UINT uVariables; + UINT VariableData; // Offset to UINT[uVariables] indexing the Scope Variable list +} D3D10_SHADER_DEBUG_SCOPE_INFO; + +// instruction outputs +typedef struct _D3D10_SHADER_DEBUG_OUTPUTVAR +{ + // index variable being written to, if -1 it's not going to a variable + UINT Var; + // range data that the compiler expects to be true + UINT uValueMin, uValueMax; + INT iValueMin, iValueMax; + FLOAT fValueMin, fValueMax; + + BOOL bNaNPossible, bInfPossible; +} D3D10_SHADER_DEBUG_OUTPUTVAR; + +typedef struct _D3D10_SHADER_DEBUG_OUTPUTREG_INFO +{ + // Only temp, indexable temp, and output are valid here + D3D10_SHADER_DEBUG_REGTYPE OutputRegisterSet; + // -1 means no output + UINT OutputReg; + // if a temp array, identifier for which one + UINT TempArrayReg; + // -1 means masked out + UINT OutputComponents[4]; + D3D10_SHADER_DEBUG_OUTPUTVAR OutputVars[4]; + // when indexing the output, get the value of this register, then add + // that to uOutputReg. If uIndexReg is -1, then there is no index. + // find the variable whose register is the sum (by looking in the ScopeVar) + // and component matches, then set it. This should only happen for indexable + // temps and outputs. + UINT IndexReg; + UINT IndexComp; +} D3D10_SHADER_DEBUG_OUTPUTREG_INFO; + +// per instruction data +typedef struct _D3D10_SHADER_DEBUG_INST_INFO +{ + UINT Id; // Which instruction this is in the bytecode + UINT Opcode; // instruction type + + // 0, 1, or 2 + UINT uOutputs; + + // up to two outputs per instruction + D3D10_SHADER_DEBUG_OUTPUTREG_INFO pOutputs[2]; + + // index into the list of tokens for this instruction's token + UINT TokenId; + + // how many function calls deep this instruction is + UINT NestingLevel; + + // list of scopes from outer-most to inner-most + // Number of scopes + UINT Scopes; + UINT ScopeInfo; // Offset to UINT[uScopes] specifying indices of the ScopeInfo Array + + // list of variables accessed by this instruction + // Number of variables + UINT AccessedVars; + UINT AccessedVarsInfo; // Offset to UINT[AccessedVars] specifying indices of the ScopeVariableInfo Array +} D3D10_SHADER_DEBUG_INST_INFO; + +typedef struct _D3D10_SHADER_DEBUG_FILE_INFO +{ + UINT FileName; // Offset to LPCSTR for file name + UINT FileNameLen; // Length of file name + UINT FileData; // Offset to LPCSTR of length FileLen + UINT FileLen; // Length of file +} D3D10_SHADER_DEBUG_FILE_INFO; + +typedef struct _D3D10_SHADER_DEBUG_INFO +{ + UINT Size; // sizeof(D3D10_SHADER_DEBUG_INFO) + UINT Creator; // Offset to LPCSTR for compiler version + UINT EntrypointName; // Offset to LPCSTR for Entry point name + UINT ShaderTarget; // Offset to LPCSTR for shader target + UINT CompileFlags; // flags used to compile + UINT Files; // number of included files + UINT FileInfo; // Offset to D3D10_SHADER_DEBUG_FILE_INFO[Files] + UINT Instructions; // number of instructions + UINT InstructionInfo; // Offset to D3D10_SHADER_DEBUG_INST_INFO[Instructions] + UINT Variables; // number of variables + UINT VariableInfo; // Offset to D3D10_SHADER_DEBUG_VAR_INFO[Variables] + UINT InputVariables; // number of variables to initialize before running + UINT InputVariableInfo; // Offset to D3D10_SHADER_DEBUG_INPUT_INFO[InputVariables] + UINT Tokens; // number of tokens to initialize + UINT TokenInfo; // Offset to D3D10_SHADER_DEBUG_TOKEN_INFO[Tokens] + UINT Scopes; // number of scopes + UINT ScopeInfo; // Offset to D3D10_SHADER_DEBUG_SCOPE_INFO[Scopes] + UINT ScopeVariables; // number of variables declared + UINT ScopeVariableInfo; // Offset to D3D10_SHADER_DEBUG_SCOPEVAR_INFO[Scopes] + UINT UintOffset; // Offset to the UINT datastore, all UINT offsets are from this offset + UINT StringOffset; // Offset to the string datastore, all string offsets are from this offset +} D3D10_SHADER_DEBUG_INFO; + +//---------------------------------------------------------------------------- +// ID3D10ShaderReflection1: +//---------------------------------------------------------------------------- + +// +// Interface definitions +// + +typedef interface ID3D10ShaderReflection1 ID3D10ShaderReflection1; +typedef interface ID3D10ShaderReflection1 *LPD3D10SHADERREFLECTION1; + +// {C3457783-A846-47CE-9520-CEA6F66E7447} +DEFINE_GUID(IID_ID3D10ShaderReflection1, +0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47); + +#undef INTERFACE +#define INTERFACE ID3D10ShaderReflection1 + +DECLARE_INTERFACE_(ID3D10ShaderReflection1, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDescByName)(THIS_ LPCSTR Name, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD(GetMovInstructionCount)(THIS_ UINT* pCount) PURE; + STDMETHOD(GetMovcInstructionCount)(THIS_ UINT* pCount) PURE; + STDMETHOD(GetConversionInstructionCount)(THIS_ UINT* pCount) PURE; + STDMETHOD(GetBitwiseInstructionCount)(THIS_ UINT* pCount) PURE; + + STDMETHOD(GetGSInputPrimitive)(THIS_ D3D10_PRIMITIVE* pPrim) PURE; + STDMETHOD(IsLevel9Shader)(THIS_ BOOL* pbLevel9Shader) PURE; + STDMETHOD(IsSampleFrequencyShader)(THIS_ BOOL* pbSampleFrequency) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D10_1SHADER_H__ + diff --git a/RenderDll/Dx9Sdk/Include/D3D10effect.h b/RenderDll/Dx9Sdk/Include/D3D10effect.h new file mode 100644 index 0000000..7387854 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3D10effect.h @@ -0,0 +1,1455 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3D10Effect.h +// Content: D3D10 Stateblock/Effect Types & APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D10EFFECT_H__ +#define __D3D10EFFECT_H__ + +#include "d3d10.h" + +////////////////////////////////////////////////////////////////////////////// +// File contents: +// +// 1) Stateblock enums, structs, interfaces, flat APIs +// 2) Effect enums, structs, interfaces, flat APIs +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_DEVICE_STATE_TYPES: +// +// Used in ID3D10StateBlockMask function calls +// +//---------------------------------------------------------------------------- + +typedef enum _D3D10_DEVICE_STATE_TYPES +{ + + D3D10_DST_SO_BUFFERS=1, // Single-value state (atomical gets/sets) + D3D10_DST_OM_RENDER_TARGETS, // Single-value state (atomical gets/sets) + D3D10_DST_OM_DEPTH_STENCIL_STATE, // Single-value state + D3D10_DST_OM_BLEND_STATE, // Single-value state + + D3D10_DST_VS, // Single-value state + D3D10_DST_VS_SAMPLERS, // Count: D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT + D3D10_DST_VS_SHADER_RESOURCES, // Count: D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + D3D10_DST_VS_CONSTANT_BUFFERS, // Count: + + D3D10_DST_GS, // Single-value state + D3D10_DST_GS_SAMPLERS, // Count: D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT + D3D10_DST_GS_SHADER_RESOURCES, // Count: D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + D3D10_DST_GS_CONSTANT_BUFFERS, // Count: D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + + D3D10_DST_PS, // Single-value state + D3D10_DST_PS_SAMPLERS, // Count: D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT + D3D10_DST_PS_SHADER_RESOURCES, // Count: D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + D3D10_DST_PS_CONSTANT_BUFFERS, // Count: D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + + D3D10_DST_IA_VERTEX_BUFFERS, // Count: D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT + D3D10_DST_IA_INDEX_BUFFER, // Single-value state + D3D10_DST_IA_INPUT_LAYOUT, // Single-value state + D3D10_DST_IA_PRIMITIVE_TOPOLOGY, // Single-value state + + D3D10_DST_RS_VIEWPORTS, // Single-value state (atomical gets/sets) + D3D10_DST_RS_SCISSOR_RECTS, // Single-value state (atomical gets/sets) + D3D10_DST_RS_RASTERIZER_STATE, // Single-value state + + D3D10_DST_PREDICATION, // Single-value state +} D3D10_DEVICE_STATE_TYPES; + +//---------------------------------------------------------------------------- +// D3D10_DEVICE_STATE_TYPES: +// +// Used in ID3D10StateBlockMask function calls +// +//---------------------------------------------------------------------------- + +#ifndef D3D10_BYTES_FROM_BITS +#define D3D10_BYTES_FROM_BITS(x) (((x) + 7) / 8) +#endif // D3D10_BYTES_FROM_BITS + +typedef struct _D3D10_STATE_BLOCK_MASK +{ + BYTE VS; + BYTE VSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)]; + BYTE VSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; + BYTE VSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; + + BYTE GS; + BYTE GSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)]; + BYTE GSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; + BYTE GSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; + + BYTE PS; + BYTE PSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)]; + BYTE PSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; + BYTE PSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; + + BYTE IAVertexBuffers[D3D10_BYTES_FROM_BITS(D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT)]; + BYTE IAIndexBuffer; + BYTE IAInputLayout; + BYTE IAPrimitiveTopology; + + BYTE OMRenderTargets; + BYTE OMDepthStencilState; + BYTE OMBlendState; + + BYTE RSViewports; + BYTE RSScissorRects; + BYTE RSRasterizerState; + + BYTE SOBuffers; + + BYTE Predication; +} D3D10_STATE_BLOCK_MASK; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10StateBlock ////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10StateBlock ID3D10StateBlock; +typedef interface ID3D10StateBlock *LPD3D10STATEBLOCK; + +// {0803425A-57F5-4dd6-9465-A87570834A08} +DEFINE_GUID(IID_ID3D10StateBlock, +0x803425a, 0x57f5, 0x4dd6, 0x94, 0x65, 0xa8, 0x75, 0x70, 0x83, 0x4a, 0x8); + +#undef INTERFACE +#define INTERFACE ID3D10StateBlock + +DECLARE_INTERFACE_(ID3D10StateBlock, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(Capture)(THIS) PURE; + STDMETHOD(Apply)(THIS) PURE; + STDMETHOD(ReleaseAllDeviceObjects)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ ID3D10Device **ppDevice) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +//---------------------------------------------------------------------------- +// D3D10_STATE_BLOCK_MASK and manipulation functions +// ------------------------------------------------- +// +// These functions exist to facilitate working with the D3D10_STATE_BLOCK_MASK +// structure. +// +// D3D10_STATE_BLOCK_MASK *pResult or *pMask +// The state block mask to operate on +// +// D3D10_STATE_BLOCK_MASK *pA, *pB +// The source state block masks for the binary union/intersect/difference +// operations. +// +// D3D10_DEVICE_STATE_TYPES StateType +// The specific state type to enable/disable/query +// +// UINT RangeStart, RangeLength, Entry +// The specific bit or range of bits for a given state type to operate on. +// Consult the comments for D3D10_DEVICE_STATE_TYPES and +// D3D10_STATE_BLOCK_MASK for information on the valid bit ranges for +// each state. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10StateBlockMaskUnion(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult); +HRESULT WINAPI D3D10StateBlockMaskIntersect(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult); +HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult); +HRESULT WINAPI D3D10StateBlockMaskEnableCapture(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength); +HRESULT WINAPI D3D10StateBlockMaskDisableCapture(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength); +HRESULT WINAPI D3D10StateBlockMaskEnableAll(D3D10_STATE_BLOCK_MASK *pMask); +HRESULT WINAPI D3D10StateBlockMaskDisableAll(D3D10_STATE_BLOCK_MASK *pMask); +BOOL WINAPI D3D10StateBlockMaskGetSetting(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT Entry); + +//---------------------------------------------------------------------------- +// D3D10CreateStateBlock +// --------------------- +// +// Creates a state block object based on the mask settings specified +// in a D3D10_STATE_BLOCK_MASK structure. +// +// ID3D10Device *pDevice +// The device interface to associate with this state block +// +// D3D10_STATE_BLOCK_MASK *pStateBlockMask +// A bit mask whose settings are used to generate a state block +// object. +// +// ID3D10StateBlock **ppStateBlock +// The resulting state block object. This object will save/restore +// only those pieces of state that were set in the state block +// bit mask +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *pDevice, D3D10_STATE_BLOCK_MASK *pStateBlockMask, ID3D10StateBlock **ppStateBlock); + +#ifdef __cplusplus +} +#endif //__cplusplus + +//---------------------------------------------------------------------------- +// D3D10_COMPILE & D3D10_EFFECT flags: +// ------------------------------------- +// +// These flags are passed in when creating an effect, and affect +// either compilation behavior or runtime effect behavior +// +// D3D10_EFFECT_COMPILE_CHILD_EFFECT +// Compile this .fx file to a child effect. Child effects have no initializers +// for any shared values as these are initialied in the master effect (pool). +// +// D3D10_EFFECT_COMPILE_ALLOW_SLOW_OPS +// By default, performance mode is enabled. Performance mode disallows +// mutable state objects by preventing non-literal expressions from appearing in +// state object definitions. Specifying this flag will disable the mode and allow +// for mutable state objects. +// +// D3D10_EFFECT_SINGLE_THREADED +// Do not attempt to synchronize with other threads loading effects into the +// same pool. +// +//---------------------------------------------------------------------------- + +#define D3D10_EFFECT_COMPILE_CHILD_EFFECT (1 << 0) +#define D3D10_EFFECT_COMPILE_ALLOW_SLOW_OPS (1 << 1) +#define D3D10_EFFECT_SINGLE_THREADED (1 << 3) + + +//---------------------------------------------------------------------------- +// D3D10_EFFECT_VARIABLE flags: +// ---------------------------- +// +// These flags describe an effect variable (global or annotation), +// and are returned in D3D10_EFFECT_VARIABLE_DESC::Flags. +// +// D3D10_EFFECT_VARIABLE_POOLED +// Indicates that the this variable or constant buffer resides +// in an effect pool. If this flag is not set, then the variable resides +// in a standalone effect (if ID3D10Effect::GetPool returns NULL) +// or a child effect (if ID3D10Effect::GetPool returns non-NULL) +// +// D3D10_EFFECT_VARIABLE_ANNOTATION +// Indicates that this is an annotation on a technique, pass, or global +// variable. Otherwise, this is a global variable. Annotations cannot +// be shared. +// +// D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT +// Indicates that the variable has been explicitly bound using the +// register keyword. +//---------------------------------------------------------------------------- + +#define D3D10_EFFECT_VARIABLE_POOLED (1 << 0) +#define D3D10_EFFECT_VARIABLE_ANNOTATION (1 << 1) +#define D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT (1 << 2) + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectType ////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_EFFECT_TYPE_DESC: +// +// Retrieved by ID3D10EffectType::GetDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_EFFECT_TYPE_DESC +{ + LPCSTR TypeName; // Name of the type + // (e.g. "float4" or "MyStruct") + + D3D10_SHADER_VARIABLE_CLASS Class; // (e.g. scalar, vector, object, etc.) + D3D10_SHADER_VARIABLE_TYPE Type; // (e.g. float, texture, vertexshader, etc.) + + UINT Elements; // Number of elements in this type + // (0 if not an array) + UINT Members; // Number of members + // (0 if not a structure) + UINT Rows; // Number of rows in this type + // (0 if not a numeric primitive) + UINT Columns; // Number of columns in this type + // (0 if not a numeric primitive) + + UINT PackedSize; // Number of bytes required to represent + // this data type, when tightly packed + UINT UnpackedSize; // Number of bytes occupied by this data + // type, when laid out in a constant buffer + UINT Stride; // Number of bytes to seek between elements, + // when laid out in a constant buffer +} D3D10_EFFECT_TYPE_DESC; + +typedef interface ID3D10EffectType ID3D10EffectType; +typedef interface ID3D10EffectType *LPD3D10EFFECTTYPE; + +// {4E9E1DDC-CD9D-4772-A837-00180B9B88FD} +DEFINE_GUID(IID_ID3D10EffectType, +0x4e9e1ddc, 0xcd9d, 0x4772, 0xa8, 0x37, 0x0, 0x18, 0xb, 0x9b, 0x88, 0xfd); + +#undef INTERFACE +#define INTERFACE ID3D10EffectType + +DECLARE_INTERFACE(ID3D10EffectType) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_TYPE_DESC *pDesc) PURE; + STDMETHOD_(ID3D10EffectType*, GetMemberTypeByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectType*, GetMemberTypeByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectType*, GetMemberTypeBySemantic)(THIS_ LPCSTR Semantic) PURE; + STDMETHOD_(LPCSTR, GetMemberName)(THIS_ UINT Index) PURE; + STDMETHOD_(LPCSTR, GetMemberSemantic)(THIS_ UINT Index) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectVariable ////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_EFFECT_VARIABLE_DESC: +// +// Retrieved by ID3D10EffectVariable::GetDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_EFFECT_VARIABLE_DESC +{ + LPCSTR Name; // Name of this variable, annotation, + // or structure member + LPCSTR Semantic; // Semantic string of this variable + // or structure member (NULL for + // annotations or if not present) + + UINT Flags; // D3D10_EFFECT_VARIABLE_* flags + UINT Annotations; // Number of annotations on this variable + // (always 0 for annotations) + + UINT BufferOffset; // Offset into containing cbuffer or tbuffer + // (always 0 for annotations or variables + // not in constant buffers) + + UINT ExplicitBindPoint; // Used if the variable has been explicitly bound + // using the register keyword. Check Flags for + // D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT; +} D3D10_EFFECT_VARIABLE_DESC; + +typedef interface ID3D10EffectVariable ID3D10EffectVariable; +typedef interface ID3D10EffectVariable *LPD3D10EFFECTVARIABLE; + +// {AE897105-00E6-45bf-BB8E-281DD6DB8E1B} +DEFINE_GUID(IID_ID3D10EffectVariable, +0xae897105, 0xe6, 0x45bf, 0xbb, 0x8e, 0x28, 0x1d, 0xd6, 0xdb, 0x8e, 0x1b); + +#undef INTERFACE +#define INTERFACE ID3D10EffectVariable + +// Forward defines +typedef interface ID3D10EffectScalarVariable ID3D10EffectScalarVariable; +typedef interface ID3D10EffectVectorVariable ID3D10EffectVectorVariable; +typedef interface ID3D10EffectMatrixVariable ID3D10EffectMatrixVariable; +typedef interface ID3D10EffectStringVariable ID3D10EffectStringVariable; +typedef interface ID3D10EffectShaderResourceVariable ID3D10EffectShaderResourceVariable; +typedef interface ID3D10EffectRenderTargetViewVariable ID3D10EffectRenderTargetViewVariable; +typedef interface ID3D10EffectDepthStencilViewVariable ID3D10EffectDepthStencilViewVariable; +typedef interface ID3D10EffectConstantBuffer ID3D10EffectConstantBuffer; +typedef interface ID3D10EffectShaderVariable ID3D10EffectShaderVariable; +typedef interface ID3D10EffectBlendVariable ID3D10EffectBlendVariable; +typedef interface ID3D10EffectDepthStencilVariable ID3D10EffectDepthStencilVariable; +typedef interface ID3D10EffectRasterizerVariable ID3D10EffectRasterizerVariable; +typedef interface ID3D10EffectSamplerVariable ID3D10EffectSamplerVariable; + +DECLARE_INTERFACE(ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectScalarVariable //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectScalarVariable ID3D10EffectScalarVariable; +typedef interface ID3D10EffectScalarVariable *LPD3D10EFFECTSCALARVARIABLE; + +// {00E48F7B-D2C8-49e8-A86C-022DEE53431F} +DEFINE_GUID(IID_ID3D10EffectScalarVariable, +0xe48f7b, 0xd2c8, 0x49e8, 0xa8, 0x6c, 0x2, 0x2d, 0xee, 0x53, 0x43, 0x1f); + +#undef INTERFACE +#define INTERFACE ID3D10EffectScalarVariable + +DECLARE_INTERFACE_(ID3D10EffectScalarVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + + STDMETHOD(SetFloat)(THIS_ float Value) PURE; + STDMETHOD(GetFloat)(THIS_ float *pValue) PURE; + + STDMETHOD(SetFloatArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetFloatArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetInt)(THIS_ int Value) PURE; + STDMETHOD(GetInt)(THIS_ int *pValue) PURE; + + STDMETHOD(SetIntArray)(THIS_ int *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetIntArray)(THIS_ int *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetBool)(THIS_ BOOL Value) PURE; + STDMETHOD(GetBool)(THIS_ BOOL *pValue) PURE; + + STDMETHOD(SetBoolArray)(THIS_ BOOL *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetBoolArray)(THIS_ BOOL *pData, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectVectorVariable //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectVectorVariable ID3D10EffectVectorVariable; +typedef interface ID3D10EffectVectorVariable *LPD3D10EFFECTVECTORVARIABLE; + +// {62B98C44-1F82-4c67-BCD0-72CF8F217E81} +DEFINE_GUID(IID_ID3D10EffectVectorVariable, +0x62b98c44, 0x1f82, 0x4c67, 0xbc, 0xd0, 0x72, 0xcf, 0x8f, 0x21, 0x7e, 0x81); + +#undef INTERFACE +#define INTERFACE ID3D10EffectVectorVariable + +DECLARE_INTERFACE_(ID3D10EffectVectorVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + + STDMETHOD(SetBoolVector) (THIS_ BOOL *pData) PURE; + STDMETHOD(SetIntVector) (THIS_ int *pData) PURE; + STDMETHOD(SetFloatVector)(THIS_ float *pData) PURE; + + STDMETHOD(GetBoolVector) (THIS_ BOOL *pData) PURE; + STDMETHOD(GetIntVector) (THIS_ int *pData) PURE; + STDMETHOD(GetFloatVector)(THIS_ float *pData) PURE; + + STDMETHOD(SetBoolVectorArray) (THIS_ BOOL *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(SetIntVectorArray) (THIS_ int *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(SetFloatVectorArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetBoolVectorArray) (THIS_ BOOL *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetIntVectorArray) (THIS_ int *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetFloatVectorArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectMatrixVariable //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectMatrixVariable ID3D10EffectMatrixVariable; +typedef interface ID3D10EffectMatrixVariable *LPD3D10EFFECTMATRIXVARIABLE; + +// {50666C24-B82F-4eed-A172-5B6E7E8522E0} +DEFINE_GUID(IID_ID3D10EffectMatrixVariable, +0x50666c24, 0xb82f, 0x4eed, 0xa1, 0x72, 0x5b, 0x6e, 0x7e, 0x85, 0x22, 0xe0); + +#undef INTERFACE +#define INTERFACE ID3D10EffectMatrixVariable + +DECLARE_INTERFACE_(ID3D10EffectMatrixVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + + STDMETHOD(SetMatrix)(THIS_ float *pData) PURE; + STDMETHOD(GetMatrix)(THIS_ float *pData) PURE; + + STDMETHOD(SetMatrixArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetMatrixArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetMatrixTranspose)(THIS_ float *pData) PURE; + STDMETHOD(GetMatrixTranspose)(THIS_ float *pData) PURE; + + STDMETHOD(SetMatrixTransposeArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetMatrixTransposeArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectStringVariable //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectStringVariable ID3D10EffectStringVariable; +typedef interface ID3D10EffectStringVariable *LPD3D10EFFECTSTRINGVARIABLE; + +// {71417501-8DF9-4e0a-A78A-255F9756BAFF} +DEFINE_GUID(IID_ID3D10EffectStringVariable, +0x71417501, 0x8df9, 0x4e0a, 0xa7, 0x8a, 0x25, 0x5f, 0x97, 0x56, 0xba, 0xff); + +#undef INTERFACE +#define INTERFACE ID3D10EffectStringVariable + +DECLARE_INTERFACE_(ID3D10EffectStringVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetString)(THIS_ LPCSTR *ppString) PURE; + STDMETHOD(GetStringArray)(THIS_ LPCSTR *ppStrings, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectShaderResourceVariable //////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectShaderResourceVariable ID3D10EffectShaderResourceVariable; +typedef interface ID3D10EffectShaderResourceVariable *LPD3D10EFFECTSHADERRESOURCEVARIABLE; + +// {C0A7157B-D872-4b1d-8073-EFC2ACD4B1FC} +DEFINE_GUID(IID_ID3D10EffectShaderResourceVariable, +0xc0a7157b, 0xd872, 0x4b1d, 0x80, 0x73, 0xef, 0xc2, 0xac, 0xd4, 0xb1, 0xfc); + + +#undef INTERFACE +#define INTERFACE ID3D10EffectShaderResourceVariable + +DECLARE_INTERFACE_(ID3D10EffectShaderResourceVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetResource)(THIS_ ID3D10ShaderResourceView *pResource) PURE; + STDMETHOD(GetResource)(THIS_ ID3D10ShaderResourceView **ppResource) PURE; + + STDMETHOD(SetResourceArray)(THIS_ ID3D10ShaderResourceView **ppResources, UINT Offset, UINT Count) PURE; + STDMETHOD(GetResourceArray)(THIS_ ID3D10ShaderResourceView **ppResources, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectRenderTargetViewVariable ////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectRenderTargetViewVariable ID3D10EffectRenderTargetViewVariable; +typedef interface ID3D10EffectRenderTargetViewVariable *LPD3D10EFFECTRENDERTARGETVIEWVARIABLE; + +// {28CA0CC3-C2C9-40bb-B57F-67B737122B17} +DEFINE_GUID(IID_ID3D10EffectRenderTargetViewVariable, +0x28ca0cc3, 0xc2c9, 0x40bb, 0xb5, 0x7f, 0x67, 0xb7, 0x37, 0x12, 0x2b, 0x17); + +#undef INTERFACE +#define INTERFACE ID3D10EffectRenderTargetViewVariable + +DECLARE_INTERFACE_(ID3D10EffectRenderTargetViewVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetRenderTarget)(THIS_ ID3D10RenderTargetView *pResource) PURE; + STDMETHOD(GetRenderTarget)(THIS_ ID3D10RenderTargetView **ppResource) PURE; + + STDMETHOD(SetRenderTargetArray)(THIS_ ID3D10RenderTargetView **ppResources, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRenderTargetArray)(THIS_ ID3D10RenderTargetView **ppResources, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectDepthStencilViewVariable ////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectDepthStencilViewVariable ID3D10EffectDepthStencilViewVariable; +typedef interface ID3D10EffectDepthStencilViewVariable *LPD3D10EFFECTDEPTHSTENCILVIEWVARIABLE; + +// {3E02C918-CC79-4985-B622-2D92AD701623} +DEFINE_GUID(IID_ID3D10EffectDepthStencilViewVariable, +0x3e02c918, 0xcc79, 0x4985, 0xb6, 0x22, 0x2d, 0x92, 0xad, 0x70, 0x16, 0x23); + +#undef INTERFACE +#define INTERFACE ID3D10EffectDepthStencilViewVariable + +DECLARE_INTERFACE_(ID3D10EffectDepthStencilViewVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetDepthStencil)(THIS_ ID3D10DepthStencilView *pResource) PURE; + STDMETHOD(GetDepthStencil)(THIS_ ID3D10DepthStencilView **ppResource) PURE; + + STDMETHOD(SetDepthStencilArray)(THIS_ ID3D10DepthStencilView **ppResources, UINT Offset, UINT Count) PURE; + STDMETHOD(GetDepthStencilArray)(THIS_ ID3D10DepthStencilView **ppResources, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectConstantBuffer //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectConstantBuffer ID3D10EffectConstantBuffer; +typedef interface ID3D10EffectConstantBuffer *LPD3D10EFFECTCONSTANTBUFFER; + +// {56648F4D-CC8B-4444-A5AD-B5A3D76E91B3} +DEFINE_GUID(IID_ID3D10EffectConstantBuffer, +0x56648f4d, 0xcc8b, 0x4444, 0xa5, 0xad, 0xb5, 0xa3, 0xd7, 0x6e, 0x91, 0xb3); + +#undef INTERFACE +#define INTERFACE ID3D10EffectConstantBuffer + +DECLARE_INTERFACE_(ID3D10EffectConstantBuffer, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetConstantBuffer)(THIS_ ID3D10Buffer *pConstantBuffer) PURE; + STDMETHOD(GetConstantBuffer)(THIS_ ID3D10Buffer **ppConstantBuffer) PURE; + + STDMETHOD(SetTextureBuffer)(THIS_ ID3D10ShaderResourceView *pTextureBuffer) PURE; + STDMETHOD(GetTextureBuffer)(THIS_ ID3D10ShaderResourceView **ppTextureBuffer) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectShaderVariable //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_EFFECT_SHADER_DESC: +// +// Retrieved by ID3D10EffectShaderVariable::GetShaderDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_EFFECT_SHADER_DESC +{ + CONST BYTE *pInputSignature; // Passed into CreateInputLayout, + // valid on VS and GS only + + BOOL IsInline; // Is this an anonymous shader variable + // resulting from an inline shader assignment? + + + // -- The following fields are not valid after Optimize() -- + CONST BYTE *pBytecode; // Shader bytecode + UINT BytecodeLength; + + LPCSTR SODecl; // Stream out declaration string (for GS with SO) + + UINT NumInputSignatureEntries; // Number of entries in the input signature + UINT NumOutputSignatureEntries; // Number of entries in the output signature +} D3D10_EFFECT_SHADER_DESC; + + +typedef interface ID3D10EffectShaderVariable ID3D10EffectShaderVariable; +typedef interface ID3D10EffectShaderVariable *LPD3D10EFFECTSHADERVARIABLE; + +// {80849279-C799-4797-8C33-0407A07D9E06} +DEFINE_GUID(IID_ID3D10EffectShaderVariable, +0x80849279, 0xc799, 0x4797, 0x8c, 0x33, 0x4, 0x7, 0xa0, 0x7d, 0x9e, 0x6); + +#undef INTERFACE +#define INTERFACE ID3D10EffectShaderVariable + +DECLARE_INTERFACE_(ID3D10EffectShaderVariable, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetShaderDesc)(THIS_ UINT ShaderIndex, D3D10_EFFECT_SHADER_DESC *pDesc) PURE; + + STDMETHOD(GetVertexShader)(THIS_ UINT ShaderIndex, ID3D10VertexShader **ppVS) PURE; + STDMETHOD(GetGeometryShader)(THIS_ UINT ShaderIndex, ID3D10GeometryShader **ppGS) PURE; + STDMETHOD(GetPixelShader)(THIS_ UINT ShaderIndex, ID3D10PixelShader **ppPS) PURE; + + STDMETHOD(GetInputSignatureElementDesc)(THIS_ UINT ShaderIndex, UINT Element, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetOutputSignatureElementDesc)(THIS_ UINT ShaderIndex, UINT Element, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectBlendVariable ///////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectBlendVariable ID3D10EffectBlendVariable; +typedef interface ID3D10EffectBlendVariable *LPD3D10EFFECTBLENDVARIABLE; + +// {1FCD2294-DF6D-4eae-86B3-0E9160CFB07B} +DEFINE_GUID(IID_ID3D10EffectBlendVariable, +0x1fcd2294, 0xdf6d, 0x4eae, 0x86, 0xb3, 0xe, 0x91, 0x60, 0xcf, 0xb0, 0x7b); + +#undef INTERFACE +#define INTERFACE ID3D10EffectBlendVariable + +DECLARE_INTERFACE_(ID3D10EffectBlendVariable, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetBlendState)(THIS_ UINT Index, ID3D10BlendState **ppBlendState) PURE; + STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_BLEND_DESC *pBlendDesc) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectDepthStencilVariable ////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectDepthStencilVariable ID3D10EffectDepthStencilVariable; +typedef interface ID3D10EffectDepthStencilVariable *LPD3D10EFFECTDEPTHSTENCILVARIABLE; + +// {AF482368-330A-46a5-9A5C-01C71AF24C8D} +DEFINE_GUID(IID_ID3D10EffectDepthStencilVariable, +0xaf482368, 0x330a, 0x46a5, 0x9a, 0x5c, 0x1, 0xc7, 0x1a, 0xf2, 0x4c, 0x8d); + +#undef INTERFACE +#define INTERFACE ID3D10EffectDepthStencilVariable + +DECLARE_INTERFACE_(ID3D10EffectDepthStencilVariable, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetDepthStencilState)(THIS_ UINT Index, ID3D10DepthStencilState **ppDepthStencilState) PURE; + STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectRasterizerVariable //////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectRasterizerVariable ID3D10EffectRasterizerVariable; +typedef interface ID3D10EffectRasterizerVariable *LPD3D10EFFECTRASTERIZERVARIABLE; + +// {21AF9F0E-4D94-4ea9-9785-2CB76B8C0B34} +DEFINE_GUID(IID_ID3D10EffectRasterizerVariable, +0x21af9f0e, 0x4d94, 0x4ea9, 0x97, 0x85, 0x2c, 0xb7, 0x6b, 0x8c, 0xb, 0x34); + +#undef INTERFACE +#define INTERFACE ID3D10EffectRasterizerVariable + +DECLARE_INTERFACE_(ID3D10EffectRasterizerVariable, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetRasterizerState)(THIS_ UINT Index, ID3D10RasterizerState **ppRasterizerState) PURE; + STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_RASTERIZER_DESC *pRasterizerDesc) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectSamplerVariable /////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectSamplerVariable ID3D10EffectSamplerVariable; +typedef interface ID3D10EffectSamplerVariable *LPD3D10EFFECTSAMPLERVARIABLE; + +// {6530D5C7-07E9-4271-A418-E7CE4BD1E480} +DEFINE_GUID(IID_ID3D10EffectSamplerVariable, +0x6530d5c7, 0x7e9, 0x4271, 0xa4, 0x18, 0xe7, 0xce, 0x4b, 0xd1, 0xe4, 0x80); + +#undef INTERFACE +#define INTERFACE ID3D10EffectSamplerVariable + +DECLARE_INTERFACE_(ID3D10EffectSamplerVariable, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetSampler)(THIS_ UINT Index, ID3D10SamplerState **ppSampler) PURE; + STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_SAMPLER_DESC *pSamplerDesc) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectPass ////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_PASS_DESC: +// +// Retrieved by ID3D10EffectPass::GetDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_PASS_DESC +{ + LPCSTR Name; // Name of this pass (NULL if not anonymous) + UINT Annotations; // Number of annotations on this pass + + BYTE *pIAInputSignature; // Signature from VS or GS (if there is no VS) + // or NULL if neither exists + SIZE_T IAInputSignatureSize; // Singature size in bytes + + UINT StencilRef; // Specified in SetDepthStencilState() + UINT SampleMask; // Specified in SetBlendState() + FLOAT BlendFactor[4]; // Specified in SetBlendState() +} D3D10_PASS_DESC; + +//---------------------------------------------------------------------------- +// D3D10_PASS_SHADER_DESC: +// +// Retrieved by ID3D10EffectPass::Get**ShaderDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_PASS_SHADER_DESC +{ + ID3D10EffectShaderVariable *pShaderVariable; // The variable that this shader came from. + // If this is an inline shader assignment, + // the returned interface will be an + // anonymous shader variable, which is + // not retrievable any other way. It's + // name in the variable description will + // be "$Anonymous". + // If there is no assignment of this type in + // the pass block, pShaderVariable != NULL, + // but pShaderVariable->IsValid() == FALSE. + + UINT ShaderIndex; // The element of pShaderVariable (if an array) + // or 0 if not applicable +} D3D10_PASS_SHADER_DESC; + +typedef interface ID3D10EffectPass ID3D10EffectPass; +typedef interface ID3D10EffectPass *LPD3D10EFFECTPASS; + +// {5CFBEB89-1A06-46e0-B282-E3F9BFA36A54} +DEFINE_GUID(IID_ID3D10EffectPass, +0x5cfbeb89, 0x1a06, 0x46e0, 0xb2, 0x82, 0xe3, 0xf9, 0xbf, 0xa3, 0x6a, 0x54); + +#undef INTERFACE +#define INTERFACE ID3D10EffectPass + +DECLARE_INTERFACE(ID3D10EffectPass) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_PASS_DESC *pDesc) PURE; + + STDMETHOD(GetVertexShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *pDesc) PURE; + STDMETHOD(GetGeometryShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *pDesc) PURE; + STDMETHOD(GetPixelShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(Apply)(THIS_ UINT Flags) PURE; + + STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *pStateBlockMask) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectTechnique ///////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_TECHNIQUE_DESC: +// +// Retrieved by ID3D10EffectTechnique::GetDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_TECHNIQUE_DESC +{ + LPCSTR Name; // Name of this technique (NULL if not anonymous) + UINT Passes; // Number of passes contained within + UINT Annotations; // Number of annotations on this technique +} D3D10_TECHNIQUE_DESC; + +typedef interface ID3D10EffectTechnique ID3D10EffectTechnique; +typedef interface ID3D10EffectTechnique *LPD3D10EFFECTTECHNIQUE; + +// {DB122CE8-D1C9-4292-B237-24ED3DE8B175} +DEFINE_GUID(IID_ID3D10EffectTechnique, +0xdb122ce8, 0xd1c9, 0x4292, 0xb2, 0x37, 0x24, 0xed, 0x3d, 0xe8, 0xb1, 0x75); + +#undef INTERFACE +#define INTERFACE ID3D10EffectTechnique + +DECLARE_INTERFACE(ID3D10EffectTechnique) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_TECHNIQUE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectPass*, GetPassByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectPass*, GetPassByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *pStateBlockMask) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10Effect ////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_EFFECT_DESC: +// +// Retrieved by ID3D10Effect::GetDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_EFFECT_DESC +{ + + BOOL IsChildEffect; // TRUE if this is a child effect, + // FALSE if this is standalone or an effect pool. + + UINT ConstantBuffers; // Number of constant buffers in this effect, + // excluding the effect pool. + UINT SharedConstantBuffers; // Number of constant buffers shared in this + // effect's pool. + + UINT GlobalVariables; // Number of global variables in this effect, + // excluding the effect pool. + UINT SharedGlobalVariables; // Number of global variables shared in this + // effect's pool. + + UINT Techniques; // Number of techniques in this effect, + // excluding the effect pool. +} D3D10_EFFECT_DESC; + +typedef interface ID3D10Effect ID3D10Effect; +typedef interface ID3D10Effect *LPD3D10EFFECT; + +// {51B0CA8B-EC0B-4519-870D-8EE1CB5017C7} +DEFINE_GUID(IID_ID3D10Effect, +0x51b0ca8b, 0xec0b, 0x4519, 0x87, 0xd, 0x8e, 0xe1, 0xcb, 0x50, 0x17, 0xc7); + +#undef INTERFACE +#define INTERFACE ID3D10Effect + +DECLARE_INTERFACE_(ID3D10Effect, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(BOOL, IsPool)(THIS) PURE; + + // Managing D3D Device + STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE; + + // New Reflection APIs + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetVariableByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetVariableBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectTechnique*, GetTechniqueByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectTechnique*, GetTechniqueByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(Optimize)(THIS) PURE; + STDMETHOD_(BOOL, IsOptimized)(THIS) PURE; + +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectPool ////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectPool ID3D10EffectPool; +typedef interface ID3D10EffectPool *LPD3D10EFFECTPOOL; + +// {9537AB04-3250-412e-8213-FCD2F8677933} +DEFINE_GUID(IID_ID3D10EffectPool, +0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33); + +#undef INTERFACE +#define INTERFACE ID3D10EffectPool + +DECLARE_INTERFACE_(ID3D10EffectPool, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD_(ID3D10Effect*, AsEffect)(THIS) PURE; + + // No public methods +}; + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +//---------------------------------------------------------------------------- +// D3D10CreateEffectFromXXXX: +// -------------------------- +// Creates an effect from a binary effect or file +// +// Parameters: +// +// [in] +// +// +// pData +// Blob of effect data, either ASCII (uncompiled, for D3D10CompileEffectFromMemory) or binary (compiled, for D3D10CreateEffect*) +// DataLength +// Length of the data blob +// +// pSrcFileName +// Name of the ASCII Effect file pData was obtained from +// +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// HLSLFlags +// Compilation flags pertaining to shaders and data types, honored by +// the HLSL compiler +// FXFlags +// Compilation flags pertaining to Effect compilation, honored +// by the Effect compiler +// pDevice +// Pointer to the D3D10 device on which to create Effect resources +// pEffectPool +// Pointer to an Effect pool to share variables with or NULL +// +// [out] +// +// ppEffect +// Address of the newly created Effect interface +// ppEffectPool +// Address of the newly created Effect pool interface +// ppErrors +// If non-NULL, address of a buffer with error messages that occurred +// during parsing or compilation +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10CompileEffectFromMemory(void *pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, + ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors); + +HRESULT WINAPI D3D10CreateEffectFromMemory(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3D10Effect **ppEffect); + +HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool **ppEffectPool); + + +//---------------------------------------------------------------------------- +// D3D10DisassembleEffect: +// ----------------------- +// Takes an effect interface, and returns a buffer containing text assembly. +// +// Parameters: +// pEffect +// Pointer to the runtime effect interface. +// EnableColorCode +// Emit HTML tags for color coding the output? +// ppDisassembly +// Returns a buffer containing the disassembled effect. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10DisassembleEffect(ID3D10Effect *pEffect, BOOL EnableColorCode, ID3D10Blob **ppDisassembly); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D10EFFECT_H__ + + diff --git a/RenderDll/Dx9Sdk/Include/D3D10shader.h b/RenderDll/Dx9Sdk/Include/D3D10shader.h new file mode 100644 index 0000000..d5a8a7f --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3D10shader.h @@ -0,0 +1,534 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3D10Shader.h +// Content: D3D10 Shader Types and APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D10SHADER_H__ +#define __D3D10SHADER_H__ + +#include "d3d10.h" + + +//--------------------------------------------------------------------------- +// D3D10_TX_VERSION: +// -------------- +// Version token used to create a procedural texture filler in effects +// Used by D3D10Fill[]TX functions +//--------------------------------------------------------------------------- +#define D3D10_TX_VERSION(_Major,_Minor) (('T' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor)) + + +//---------------------------------------------------------------------------- +// D3D10SHADER flags: +// ----------------- +// D3D10_SHADER_DEBUG +// Insert debug file/line/type/symbol information. +// +// D3D10_SHADER_SKIP_VALIDATION +// Do not validate the generated code against known capabilities and +// constraints. This option is only recommended when compiling shaders +// you KNOW will work. (ie. have compiled before without this option.) +// Shaders are always validated by D3D before they are set to the device. +// +// D3D10_SHADER_SKIP_OPTIMIZATION +// Instructs the compiler to skip optimization steps during code generation. +// Unless you are trying to isolate a problem in your code using this option +// is not recommended. +// +// D3D10_SHADER_PACK_MATRIX_ROW_MAJOR +// Unless explicitly specified, matrices will be packed in row-major order +// on input and output from the shader. +// +// D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR +// Unless explicitly specified, matrices will be packed in column-major +// order on input and output from the shader. This is generally more +// efficient, since it allows vector-matrix multiplication to be performed +// using a series of dot-products. +// +// D3D10_SHADER_PARTIAL_PRECISION +// Force all computations in resulting shader to occur at partial precision. +// This may result in faster evaluation of shaders on some hardware. +// +// D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT +// Force compiler to compile against the next highest available software +// target for vertex shaders. This flag also turns optimizations off, +// and debugging on. +// +// D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT +// Force compiler to compile against the next highest available software +// target for pixel shaders. This flag also turns optimizations off, +// and debugging on. +// +// D3D10_SHADER_NO_PRESHADER +// Disables Preshaders. Using this flag will cause the compiler to not +// pull out static expression for evaluation on the host cpu +// +// D3D10_SHADER_AVOID_FLOW_CONTROL +// Hint compiler to avoid flow-control constructs where possible. +// +// D3D10_SHADER_PREFER_FLOW_CONTROL +// Hint compiler to prefer flow-control constructs where possible. +// +// D3D10_SHADER_ENABLE_STRICTNESS +// By default, the HLSL/Effect compilers are not strict on deprecated syntax. +// Specifying this flag enables the strict mode. Deprecated syntax may be +// removed in a future release, and enabling syntax is a good way to make sure +// your shaders comply to the latest spec. +// +// D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY +// This enables older shaders to compile to 4_0 targets. +// +//---------------------------------------------------------------------------- + +#define D3D10_SHADER_DEBUG (1 << 0) +#define D3D10_SHADER_SKIP_VALIDATION (1 << 1) +#define D3D10_SHADER_SKIP_OPTIMIZATION (1 << 2) +#define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR (1 << 3) +#define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR (1 << 4) +#define D3D10_SHADER_PARTIAL_PRECISION (1 << 5) +#define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT (1 << 6) +#define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT (1 << 7) +#define D3D10_SHADER_NO_PRESHADER (1 << 8) +#define D3D10_SHADER_AVOID_FLOW_CONTROL (1 << 9) +#define D3D10_SHADER_PREFER_FLOW_CONTROL (1 << 10) +#define D3D10_SHADER_ENABLE_STRICTNESS (1 << 11) +#define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12) +#define D3D10_SHADER_IEEE_STRICTNESS (1 << 13) +#define D3D10_SHADER_WARNINGS_ARE_ERRORS (1 << 18) + + +// optimization level flags +#define D3D10_SHADER_OPTIMIZATION_LEVEL0 (1 << 14) +#define D3D10_SHADER_OPTIMIZATION_LEVEL1 0 +#define D3D10_SHADER_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15)) +#define D3D10_SHADER_OPTIMIZATION_LEVEL3 (1 << 15) + + + + +typedef D3D_SHADER_MACRO D3D10_SHADER_MACRO; +typedef D3D10_SHADER_MACRO* LPD3D10_SHADER_MACRO; + + +typedef D3D_SHADER_VARIABLE_CLASS D3D10_SHADER_VARIABLE_CLASS; +typedef D3D10_SHADER_VARIABLE_CLASS* LPD3D10_SHADER_VARIABLE_CLASS; + +typedef D3D_SHADER_VARIABLE_FLAGS D3D10_SHADER_VARIABLE_FLAGS; +typedef D3D10_SHADER_VARIABLE_FLAGS* LPD3D10_SHADER_VARIABLE_FLAGS; + +typedef D3D_SHADER_VARIABLE_TYPE D3D10_SHADER_VARIABLE_TYPE; +typedef D3D10_SHADER_VARIABLE_TYPE* LPD3D10_SHADER_VARIABLE_TYPE; + +typedef D3D_SHADER_INPUT_FLAGS D3D10_SHADER_INPUT_FLAGS; +typedef D3D10_SHADER_INPUT_FLAGS* LPD3D10_SHADER_INPUT_FLAGS; + +typedef D3D_SHADER_INPUT_TYPE D3D10_SHADER_INPUT_TYPE; +typedef D3D10_SHADER_INPUT_TYPE* LPD3D10_SHADER_INPUT_TYPE; + +typedef D3D_SHADER_CBUFFER_FLAGS D3D10_SHADER_CBUFFER_FLAGS; +typedef D3D10_SHADER_CBUFFER_FLAGS* LPD3D10_SHADER_CBUFFER_FLAGS; + +typedef D3D_CBUFFER_TYPE D3D10_CBUFFER_TYPE; +typedef D3D10_CBUFFER_TYPE* LPD3D10_CBUFFER_TYPE; + +typedef D3D_NAME D3D10_NAME; + +typedef D3D_RESOURCE_RETURN_TYPE D3D10_RESOURCE_RETURN_TYPE; + +typedef D3D_REGISTER_COMPONENT_TYPE D3D10_REGISTER_COMPONENT_TYPE; + +typedef D3D_INCLUDE_TYPE D3D10_INCLUDE_TYPE; + +// ID3D10Include has been made version-neutral and moved to d3dcommon.h. +typedef interface ID3DInclude ID3D10Include; +typedef interface ID3DInclude* LPD3D10INCLUDE; +#define IID_ID3D10Include IID_ID3DInclude + + +//---------------------------------------------------------------------------- +// ID3D10ShaderReflection: +//---------------------------------------------------------------------------- + +// +// Structure definitions +// + +typedef struct _D3D10_SHADER_DESC +{ + UINT Version; // Shader version + LPCSTR Creator; // Creator string + UINT Flags; // Shader compilation/parse flags + + UINT ConstantBuffers; // Number of constant buffers + UINT BoundResources; // Number of bound resources + UINT InputParameters; // Number of parameters in the input signature + UINT OutputParameters; // Number of parameters in the output signature + + UINT InstructionCount; // Number of emitted instructions + UINT TempRegisterCount; // Number of temporary registers used + UINT TempArrayCount; // Number of temporary arrays used + UINT DefCount; // Number of constant defines + UINT DclCount; // Number of declarations (input + output) + UINT TextureNormalInstructions; // Number of non-categorized texture instructions + UINT TextureLoadInstructions; // Number of texture load instructions + UINT TextureCompInstructions; // Number of texture comparison instructions + UINT TextureBiasInstructions; // Number of texture bias instructions + UINT TextureGradientInstructions; // Number of texture gradient instructions + UINT FloatInstructionCount; // Number of floating point arithmetic instructions used + UINT IntInstructionCount; // Number of signed integer arithmetic instructions used + UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used + UINT StaticFlowControlCount; // Number of static flow control instructions used + UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used + UINT MacroInstructionCount; // Number of macro instructions used + UINT ArrayInstructionCount; // Number of array instructions used + UINT CutInstructionCount; // Number of cut instructions used + UINT EmitInstructionCount; // Number of emit instructions used + D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology + UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count +} D3D10_SHADER_DESC; + +typedef struct _D3D10_SHADER_BUFFER_DESC +{ + LPCSTR Name; // Name of the constant buffer + D3D10_CBUFFER_TYPE Type; // Indicates that this is a CBuffer or TBuffer + UINT Variables; // Number of member variables + UINT Size; // Size of CB (in bytes) + UINT uFlags; // Buffer description flags +} D3D10_SHADER_BUFFER_DESC; + +typedef struct _D3D10_SHADER_VARIABLE_DESC +{ + LPCSTR Name; // Name of the variable + UINT StartOffset; // Offset in constant buffer's backing store + UINT Size; // Size of variable (in bytes) + UINT uFlags; // Variable flags + LPVOID DefaultValue; // Raw pointer to default value +} D3D10_SHADER_VARIABLE_DESC; + +typedef struct _D3D10_SHADER_TYPE_DESC +{ + D3D10_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.) + D3D10_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.) + UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable) + UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable) + UINT Elements; // Number of elements (0 if not an array) + UINT Members; // Number of members (0 if not a structure) + UINT Offset; // Offset from the start of structure (0 if not a structure member) +} D3D10_SHADER_TYPE_DESC; + +typedef struct _D3D10_SHADER_INPUT_BIND_DESC +{ + LPCSTR Name; // Name of the resource + D3D10_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.) + UINT BindPoint; // Starting bind point + UINT BindCount; // Number of contiguous bind points (for arrays) + + UINT uFlags; // Input binding flags + D3D10_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture) + D3D10_SRV_DIMENSION Dimension; // Dimension (if texture) + UINT NumSamples; // Number of samples (0 if not MS texture) +} D3D10_SHADER_INPUT_BIND_DESC; + +typedef struct _D3D10_SIGNATURE_PARAMETER_DESC +{ + LPCSTR SemanticName; // Name of the semantic + UINT SemanticIndex; // Index of the semantic + UINT Register; // Number of member variables + D3D10_NAME SystemValueType;// A predefined system value, or D3D10_NAME_UNDEFINED if not applicable + D3D10_REGISTER_COMPONENT_TYPE ComponentType;// Scalar type (e.g. uint, float, etc.) + BYTE Mask; // Mask to indicate which components of the register + // are used (combination of D3D10_COMPONENT_MASK values) + BYTE ReadWriteMask; // Mask to indicate whether a given component is + // never written (if this is an output signature) or + // always read (if this is an input signature). + // (combination of D3D10_COMPONENT_MASK values) + +} D3D10_SIGNATURE_PARAMETER_DESC; + + +// +// Interface definitions +// + +typedef interface ID3D10ShaderReflectionType ID3D10ShaderReflectionType; +typedef interface ID3D10ShaderReflectionType *LPD3D10SHADERREFLECTIONTYPE; + +// {C530AD7D-9B16-4395-A979-BA2ECFF83ADD} +DEFINE_GUID(IID_ID3D10ShaderReflectionType, +0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd); + +#undef INTERFACE +#define INTERFACE ID3D10ShaderReflectionType + +DECLARE_INTERFACE(ID3D10ShaderReflectionType) +{ + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_TYPE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10ShaderReflectionType*, GetMemberTypeByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ UINT Index) PURE; +}; + +typedef interface ID3D10ShaderReflectionVariable ID3D10ShaderReflectionVariable; +typedef interface ID3D10ShaderReflectionVariable *LPD3D10SHADERREFLECTIONVARIABLE; + +// {1BF63C95-2650-405d-99C1-3636BD1DA0A1} +DEFINE_GUID(IID_ID3D10ShaderReflectionVariable, +0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1); + +#undef INTERFACE +#define INTERFACE ID3D10ShaderReflectionVariable + +DECLARE_INTERFACE(ID3D10ShaderReflectionVariable) +{ + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionType*, GetType)(THIS) PURE; +}; + +typedef interface ID3D10ShaderReflectionConstantBuffer ID3D10ShaderReflectionConstantBuffer; +typedef interface ID3D10ShaderReflectionConstantBuffer *LPD3D10SHADERREFLECTIONCONSTANTBUFFER; + +// {66C66A94-DDDD-4b62-A66A-F0DA33C2B4D0} +DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer, +0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0); + +#undef INTERFACE +#define INTERFACE ID3D10ShaderReflectionConstantBuffer + +DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer) +{ + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_BUFFER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE; +}; + +typedef interface ID3D10ShaderReflection ID3D10ShaderReflection; +typedef interface ID3D10ShaderReflection *LPD3D10SHADERREFLECTION; + +// {D40E20B6-F8F7-42ad-AB20-4BAF8F15DFAA} +DEFINE_GUID(IID_ID3D10ShaderReflection, +0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa); + +#undef INTERFACE +#define INTERFACE ID3D10ShaderReflection + +DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + +}; + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//---------------------------------------------------------------------------- +// D3D10CompileShader: +// ------------------ +// Compiles a shader. +// +// Parameters: +// pSrcFile +// Source file name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module. +// pSrcData +// Pointer to source code. +// SrcDataLen +// Size of source code, in bytes. +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pFunctionName +// Name of the entrypoint function where execution should begin. +// pProfile +// Instruction set to be used when generating code. The D3D10 entry +// point currently supports only "vs_4_0", "ps_4_0", and "gs_4_0". +// Flags +// See D3D10_SHADER_xxx flags. +// ppShader +// Returns a buffer containing the created shader. This buffer contains +// the compiled shader code, as well as any embedded debug and symbol +// table info. (See D3D10GetShaderConstantTable) +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during the compile. If you are running in a debugger, +// these are the same messages you will see in your debug output. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10CompileShader(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs); + +//---------------------------------------------------------------------------- +// D3D10DisassembleShader: +// ---------------------- +// Takes a binary shader, and returns a buffer containing text assembly. +// +// Parameters: +// pShader +// Pointer to the shader byte code. +// BytecodeLength +// Size of the shader byte code in bytes. +// EnableColorCode +// Emit HTML tags for color coding the output? +// pComments +// Pointer to a comment string to include at the top of the shader. +// ppDisassembly +// Returns a buffer containing the disassembled shader. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10DisassembleShader(CONST void *pShader, SIZE_T BytecodeLength, BOOL EnableColorCode, LPCSTR pComments, ID3D10Blob** ppDisassembly); + + +//---------------------------------------------------------------------------- +// D3D10GetPixelShaderProfile/D3D10GetVertexShaderProfile/D3D10GetGeometryShaderProfile: +// ----------------------------------------------------- +// Returns the name of the HLSL profile best suited to a given device. +// +// Parameters: +// pDevice +// Pointer to the device in question +//---------------------------------------------------------------------------- + +LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *pDevice); + +LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *pDevice); + +LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *pDevice); + +//---------------------------------------------------------------------------- +// D3D10ReflectShader: +// ------------------ +// Creates a shader reflection object that can be used to retrieve information +// about a compiled shader +// +// Parameters: +// pShaderBytecode +// Pointer to a compiled shader (same pointer that is passed into +// ID3D10Device::CreateShader) +// BytecodeLength +// Length of the shader bytecode buffer +// ppReflector +// [out] Returns a ID3D10ShaderReflection object that can be used to +// retrieve shader resource and constant buffer information +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10ReflectShader(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10ShaderReflection **ppReflector); + +//---------------------------------------------------------------------------- +// D3D10PreprocessShader +// --------------------- +// Creates a shader reflection object that can be used to retrieve information +// about a compiled shader +// +// Parameters: +// pSrcData +// Pointer to source code +// SrcDataLen +// Size of source code, in bytes +// pFileName +// Source file name (used for error output) +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when assembling +// from file, and will error when assembling from resource or memory. +// ppShaderText +// Returns a buffer containing a single large string that represents +// the resulting formatted token stream +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during assembly. If you are running in a debugger, +// these are the same messages you will see in your debug output. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10PreprocessShader(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs); + +////////////////////////////////////////////////////////////////////////// +// +// Shader blob manipulation routines +// --------------------------------- +// +// void *pShaderBytecode - a buffer containing the result of an HLSL +// compilation. Typically this opaque buffer contains several +// discrete sections including the shader executable code, the input +// signature, and the output signature. This can typically be retrieved +// by calling ID3D10Blob::GetBufferPointer() on the returned blob +// from HLSL's compile APIs. +// +// UINT BytecodeLength - the length of pShaderBytecode. This can +// typically be retrieved by calling ID3D10Blob::GetBufferSize() +// on the returned blob from HLSL's compile APIs. +// +// ID3D10Blob **ppSignatureBlob(s) - a newly created buffer that +// contains only the signature portions of the original bytecode. +// This is a copy; the original bytecode is not modified. You may +// specify NULL for this parameter to have the bytecode validated +// for the presence of the corresponding signatures without actually +// copying them and creating a new blob. +// +// Returns E_INVALIDARG if any required parameters are NULL +// Returns E_FAIL is the bytecode is corrupt or missing signatures +// Returns S_OK on success +// +////////////////////////////////////////////////////////////////////////// + +HRESULT WINAPI D3D10GetInputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob); +HRESULT WINAPI D3D10GetOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob); +HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob); + +//---------------------------------------------------------------------------- +// D3D10GetShaderDebugInfo: +// ----------------------- +// Gets shader debug info. Debug info is generated by D3D10CompileShader and is +// embedded in the body of the shader. +// +// Parameters: +// pShaderBytecode +// Pointer to the function bytecode +// BytecodeLength +// Length of the shader bytecode buffer +// ppDebugInfo +// Buffer used to return debug info. For information about the layout +// of this buffer, see definition of D3D10_SHADER_DEBUG_INFO above. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10GetShaderDebugInfo(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob** ppDebugInfo); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D10SHADER_H__ + diff --git a/RenderDll/Dx9Sdk/Include/D3D11.h b/RenderDll/Dx9Sdk/Include/D3D11.h new file mode 100644 index 0000000..680cf80 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3D11.h @@ -0,0 +1,10227 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d11_h__ +#define __d3d11_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D11DeviceChild_FWD_DEFINED__ +#define __ID3D11DeviceChild_FWD_DEFINED__ +typedef interface ID3D11DeviceChild ID3D11DeviceChild; +#endif /* __ID3D11DeviceChild_FWD_DEFINED__ */ + + +#ifndef __ID3D11DepthStencilState_FWD_DEFINED__ +#define __ID3D11DepthStencilState_FWD_DEFINED__ +typedef interface ID3D11DepthStencilState ID3D11DepthStencilState; +#endif /* __ID3D11DepthStencilState_FWD_DEFINED__ */ + + +#ifndef __ID3D11BlendState_FWD_DEFINED__ +#define __ID3D11BlendState_FWD_DEFINED__ +typedef interface ID3D11BlendState ID3D11BlendState; +#endif /* __ID3D11BlendState_FWD_DEFINED__ */ + + +#ifndef __ID3D11RasterizerState_FWD_DEFINED__ +#define __ID3D11RasterizerState_FWD_DEFINED__ +typedef interface ID3D11RasterizerState ID3D11RasterizerState; +#endif /* __ID3D11RasterizerState_FWD_DEFINED__ */ + + +#ifndef __ID3D11Resource_FWD_DEFINED__ +#define __ID3D11Resource_FWD_DEFINED__ +typedef interface ID3D11Resource ID3D11Resource; +#endif /* __ID3D11Resource_FWD_DEFINED__ */ + + +#ifndef __ID3D11Buffer_FWD_DEFINED__ +#define __ID3D11Buffer_FWD_DEFINED__ +typedef interface ID3D11Buffer ID3D11Buffer; +#endif /* __ID3D11Buffer_FWD_DEFINED__ */ + + +#ifndef __ID3D11Texture1D_FWD_DEFINED__ +#define __ID3D11Texture1D_FWD_DEFINED__ +typedef interface ID3D11Texture1D ID3D11Texture1D; +#endif /* __ID3D11Texture1D_FWD_DEFINED__ */ + + +#ifndef __ID3D11Texture2D_FWD_DEFINED__ +#define __ID3D11Texture2D_FWD_DEFINED__ +typedef interface ID3D11Texture2D ID3D11Texture2D; +#endif /* __ID3D11Texture2D_FWD_DEFINED__ */ + + +#ifndef __ID3D11Texture3D_FWD_DEFINED__ +#define __ID3D11Texture3D_FWD_DEFINED__ +typedef interface ID3D11Texture3D ID3D11Texture3D; +#endif /* __ID3D11Texture3D_FWD_DEFINED__ */ + + +#ifndef __ID3D11View_FWD_DEFINED__ +#define __ID3D11View_FWD_DEFINED__ +typedef interface ID3D11View ID3D11View; +#endif /* __ID3D11View_FWD_DEFINED__ */ + + +#ifndef __ID3D11ShaderResourceView_FWD_DEFINED__ +#define __ID3D11ShaderResourceView_FWD_DEFINED__ +typedef interface ID3D11ShaderResourceView ID3D11ShaderResourceView; +#endif /* __ID3D11ShaderResourceView_FWD_DEFINED__ */ + + +#ifndef __ID3D11RenderTargetView_FWD_DEFINED__ +#define __ID3D11RenderTargetView_FWD_DEFINED__ +typedef interface ID3D11RenderTargetView ID3D11RenderTargetView; +#endif /* __ID3D11RenderTargetView_FWD_DEFINED__ */ + + +#ifndef __ID3D11DepthStencilView_FWD_DEFINED__ +#define __ID3D11DepthStencilView_FWD_DEFINED__ +typedef interface ID3D11DepthStencilView ID3D11DepthStencilView; +#endif /* __ID3D11DepthStencilView_FWD_DEFINED__ */ + + +#ifndef __ID3D11UnorderedAccessView_FWD_DEFINED__ +#define __ID3D11UnorderedAccessView_FWD_DEFINED__ +typedef interface ID3D11UnorderedAccessView ID3D11UnorderedAccessView; +#endif /* __ID3D11UnorderedAccessView_FWD_DEFINED__ */ + + +#ifndef __ID3D11VertexShader_FWD_DEFINED__ +#define __ID3D11VertexShader_FWD_DEFINED__ +typedef interface ID3D11VertexShader ID3D11VertexShader; +#endif /* __ID3D11VertexShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11HullShader_FWD_DEFINED__ +#define __ID3D11HullShader_FWD_DEFINED__ +typedef interface ID3D11HullShader ID3D11HullShader; +#endif /* __ID3D11HullShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11DomainShader_FWD_DEFINED__ +#define __ID3D11DomainShader_FWD_DEFINED__ +typedef interface ID3D11DomainShader ID3D11DomainShader; +#endif /* __ID3D11DomainShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11GeometryShader_FWD_DEFINED__ +#define __ID3D11GeometryShader_FWD_DEFINED__ +typedef interface ID3D11GeometryShader ID3D11GeometryShader; +#endif /* __ID3D11GeometryShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11PixelShader_FWD_DEFINED__ +#define __ID3D11PixelShader_FWD_DEFINED__ +typedef interface ID3D11PixelShader ID3D11PixelShader; +#endif /* __ID3D11PixelShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11ComputeShader_FWD_DEFINED__ +#define __ID3D11ComputeShader_FWD_DEFINED__ +typedef interface ID3D11ComputeShader ID3D11ComputeShader; +#endif /* __ID3D11ComputeShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11InputLayout_FWD_DEFINED__ +#define __ID3D11InputLayout_FWD_DEFINED__ +typedef interface ID3D11InputLayout ID3D11InputLayout; +#endif /* __ID3D11InputLayout_FWD_DEFINED__ */ + + +#ifndef __ID3D11SamplerState_FWD_DEFINED__ +#define __ID3D11SamplerState_FWD_DEFINED__ +typedef interface ID3D11SamplerState ID3D11SamplerState; +#endif /* __ID3D11SamplerState_FWD_DEFINED__ */ + + +#ifndef __ID3D11Asynchronous_FWD_DEFINED__ +#define __ID3D11Asynchronous_FWD_DEFINED__ +typedef interface ID3D11Asynchronous ID3D11Asynchronous; +#endif /* __ID3D11Asynchronous_FWD_DEFINED__ */ + + +#ifndef __ID3D11Query_FWD_DEFINED__ +#define __ID3D11Query_FWD_DEFINED__ +typedef interface ID3D11Query ID3D11Query; +#endif /* __ID3D11Query_FWD_DEFINED__ */ + + +#ifndef __ID3D11Predicate_FWD_DEFINED__ +#define __ID3D11Predicate_FWD_DEFINED__ +typedef interface ID3D11Predicate ID3D11Predicate; +#endif /* __ID3D11Predicate_FWD_DEFINED__ */ + + +#ifndef __ID3D11Counter_FWD_DEFINED__ +#define __ID3D11Counter_FWD_DEFINED__ +typedef interface ID3D11Counter ID3D11Counter; +#endif /* __ID3D11Counter_FWD_DEFINED__ */ + + +#ifndef __ID3D11ClassInstance_FWD_DEFINED__ +#define __ID3D11ClassInstance_FWD_DEFINED__ +typedef interface ID3D11ClassInstance ID3D11ClassInstance; +#endif /* __ID3D11ClassInstance_FWD_DEFINED__ */ + + +#ifndef __ID3D11ClassLinkage_FWD_DEFINED__ +#define __ID3D11ClassLinkage_FWD_DEFINED__ +typedef interface ID3D11ClassLinkage ID3D11ClassLinkage; +#endif /* __ID3D11ClassLinkage_FWD_DEFINED__ */ + + +#ifndef __ID3D11CommandList_FWD_DEFINED__ +#define __ID3D11CommandList_FWD_DEFINED__ +typedef interface ID3D11CommandList ID3D11CommandList; +#endif /* __ID3D11CommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D11DeviceContext_FWD_DEFINED__ +#define __ID3D11DeviceContext_FWD_DEFINED__ +typedef interface ID3D11DeviceContext ID3D11DeviceContext; +#endif /* __ID3D11DeviceContext_FWD_DEFINED__ */ + + +#ifndef __ID3D11Device_FWD_DEFINED__ +#define __ID3D11Device_FWD_DEFINED__ +typedef interface ID3D11Device ID3D11Device; +#endif /* __ID3D11Device_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgi.h" +#include "d3dcommon.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d11_0000_0000 */ +/* [local] */ + +#ifndef _D3D11_CONSTANTS +#define _D3D11_CONSTANTS +#define D3D11_16BIT_INDEX_STRIP_CUT_VALUE ( 0xffff ) + +#define D3D11_32BIT_INDEX_STRIP_CUT_VALUE ( 0xffffffff ) + +#define D3D11_8BIT_INDEX_STRIP_CUT_VALUE ( 0xff ) + +#define D3D11_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT ( 9 ) + +#define D3D11_CLIP_OR_CULL_DISTANCE_COUNT ( 8 ) + +#define D3D11_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT ( 2 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT ( 14 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS ( 4 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT ( 15 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT ( 15 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT ( 64 ) + +#define D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT ( 1 ) + +#define D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT ( 128 ) + +#define D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT ( 128 ) + +#define D3D11_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_COMMONSHADER_SAMPLER_REGISTER_COUNT ( 16 ) + +#define D3D11_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT ( 16 ) + +#define D3D11_COMMONSHADER_SUBROUTINE_NESTING_LIMIT ( 32 ) + +#define D3D11_COMMONSHADER_TEMP_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_COMMONSHADER_TEMP_REGISTER_COUNT ( 4096 ) + +#define D3D11_COMMONSHADER_TEMP_REGISTER_READS_PER_INST ( 3 ) + +#define D3D11_COMMONSHADER_TEMP_REGISTER_READ_PORTS ( 3 ) + +#define D3D11_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX ( 10 ) + +#define D3D11_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN ( -10 ) + +#define D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE ( -8 ) + +#define D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE ( 7 ) + +#define D3D11_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 256 ) + +#define D3D11_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP ( 64 ) + +#define D3D11_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 240 ) + +#define D3D11_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP ( 68 ) + +#define D3D11_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 224 ) + +#define D3D11_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP ( 72 ) + +#define D3D11_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 208 ) + +#define D3D11_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP ( 76 ) + +#define D3D11_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 192 ) + +#define D3D11_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP ( 84 ) + +#define D3D11_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 176 ) + +#define D3D11_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP ( 92 ) + +#define D3D11_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 160 ) + +#define D3D11_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP ( 100 ) + +#define D3D11_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 144 ) + +#define D3D11_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP ( 112 ) + +#define D3D11_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 128 ) + +#define D3D11_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP ( 128 ) + +#define D3D11_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 112 ) + +#define D3D11_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP ( 144 ) + +#define D3D11_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 96 ) + +#define D3D11_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP ( 168 ) + +#define D3D11_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 80 ) + +#define D3D11_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP ( 204 ) + +#define D3D11_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 64 ) + +#define D3D11_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP ( 256 ) + +#define D3D11_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 48 ) + +#define D3D11_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP ( 340 ) + +#define D3D11_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 32 ) + +#define D3D11_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP ( 512 ) + +#define D3D11_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 16 ) + +#define D3D11_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP ( 768 ) + +#define D3D11_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION ( 1 ) + +#define D3D11_CS_4_X_RAW_UAV_BYTE_ALIGNMENT ( 256 ) + +#define D3D11_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 768 ) + +#define D3D11_CS_4_X_THREAD_GROUP_MAX_X ( 768 ) + +#define D3D11_CS_4_X_THREAD_GROUP_MAX_Y ( 768 ) + +#define D3D11_CS_4_X_UAV_REGISTER_COUNT ( 1 ) + +#define D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION ( 65535 ) + +#define D3D11_CS_TGSM_REGISTER_COUNT ( 8192 ) + +#define D3D11_CS_TGSM_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_CS_TGSM_RESOURCE_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_CS_TGSM_RESOURCE_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 1024 ) + +#define D3D11_CS_THREAD_GROUP_MAX_X ( 1024 ) + +#define D3D11_CS_THREAD_GROUP_MAX_Y ( 1024 ) + +#define D3D11_CS_THREAD_GROUP_MAX_Z ( 64 ) + +#define D3D11_CS_THREAD_GROUP_MIN_X ( 1 ) + +#define D3D11_CS_THREAD_GROUP_MIN_Y ( 1 ) + +#define D3D11_CS_THREAD_GROUP_MIN_Z ( 1 ) + +#define D3D11_CS_THREAD_LOCAL_TEMP_REGISTER_POOL ( 16384 ) + +#define D3D11_DEFAULT_BLEND_FACTOR_ALPHA ( 1.0f ) +#define D3D11_DEFAULT_BLEND_FACTOR_BLUE ( 1.0f ) +#define D3D11_DEFAULT_BLEND_FACTOR_GREEN ( 1.0f ) +#define D3D11_DEFAULT_BLEND_FACTOR_RED ( 1.0f ) +#define D3D11_DEFAULT_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D11_DEFAULT_DEPTH_BIAS ( 0 ) + +#define D3D11_DEFAULT_DEPTH_BIAS_CLAMP ( 0.0f ) +#define D3D11_DEFAULT_MAX_ANISOTROPY ( 16 ) +#define D3D11_DEFAULT_MIP_LOD_BIAS ( 0.0f ) +#define D3D11_DEFAULT_RENDER_TARGET_ARRAY_INDEX ( 0 ) + +#define D3D11_DEFAULT_SAMPLE_MASK ( 0xffffffff ) + +#define D3D11_DEFAULT_SCISSOR_ENDX ( 0 ) + +#define D3D11_DEFAULT_SCISSOR_ENDY ( 0 ) + +#define D3D11_DEFAULT_SCISSOR_STARTX ( 0 ) + +#define D3D11_DEFAULT_SCISSOR_STARTY ( 0 ) + +#define D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS ( 0.0f ) +#define D3D11_DEFAULT_STENCIL_READ_MASK ( 0xff ) + +#define D3D11_DEFAULT_STENCIL_REFERENCE ( 0 ) + +#define D3D11_DEFAULT_STENCIL_WRITE_MASK ( 0xff ) + +#define D3D11_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX ( 0 ) + +#define D3D11_DEFAULT_VIEWPORT_HEIGHT ( 0 ) + +#define D3D11_DEFAULT_VIEWPORT_MAX_DEPTH ( 0.0f ) +#define D3D11_DEFAULT_VIEWPORT_MIN_DEPTH ( 0.0f ) +#define D3D11_DEFAULT_VIEWPORT_TOPLEFTX ( 0 ) + +#define D3D11_DEFAULT_VIEWPORT_TOPLEFTY ( 0 ) + +#define D3D11_DEFAULT_VIEWPORT_WIDTH ( 0 ) + +#define D3D11_DS_INPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 ) + +#define D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COUNT ( 32 ) + +#define D3D11_DS_INPUT_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_DS_INPUT_CONTROL_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENTS ( 3 ) + +#define D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COUNT ( 1 ) + +#define D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 ) + +#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_DS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_DS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 ) +#define D3D11_FLOAT32_MAX ( 3.402823466e+38f ) +#define D3D11_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f ) +#define D3D11_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR ( 2.4f ) +#define D3D11_FLOAT_TO_SRGB_EXPONENT_NUMERATOR ( 1.0f ) +#define D3D11_FLOAT_TO_SRGB_OFFSET ( 0.055f ) +#define D3D11_FLOAT_TO_SRGB_SCALE_1 ( 12.92f ) +#define D3D11_FLOAT_TO_SRGB_SCALE_2 ( 1.055f ) +#define D3D11_FLOAT_TO_SRGB_THRESHOLD ( 0.0031308f ) +#define D3D11_FTOI_INSTRUCTION_MAX_INPUT ( 2147483647.999f ) +#define D3D11_FTOI_INSTRUCTION_MIN_INPUT ( -2147483648.999f ) +#define D3D11_FTOU_INSTRUCTION_MAX_INPUT ( 4294967295.999f ) +#define D3D11_FTOU_INSTRUCTION_MIN_INPUT ( 0.0f ) +#define D3D11_GS_INPUT_INSTANCE_ID_READS_PER_INST ( 2 ) + +#define D3D11_GS_INPUT_INSTANCE_ID_READ_PORTS ( 1 ) + +#define D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D11_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_GS_INPUT_PRIM_CONST_REGISTER_COUNT ( 1 ) + +#define D3D11_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_GS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_GS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_GS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_GS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_GS_INPUT_REGISTER_VERTICES ( 32 ) + +#define D3D11_GS_MAX_INSTANCE_COUNT ( 32 ) + +#define D3D11_GS_MAX_OUTPUT_VERTEX_COUNT_ACROSS_INSTANCES ( 1024 ) + +#define D3D11_GS_OUTPUT_ELEMENTS ( 32 ) + +#define D3D11_GS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_GS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_HS_CONTROL_POINT_PHASE_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_HS_CONTROL_POINT_PHASE_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_HS_CONTROL_POINT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_HS_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_CONTROL_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_HS_FORK_PHASE_INSTANCE_COUNT_UPPER_BOUND ( 0xffffffff ) + +#define D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COUNT ( 1 ) + +#define D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_HS_JOIN_PHASE_INSTANCE_COUNT_UPPER_BOUND ( 0xffffffff ) + +#define D3D11_HS_MAXTESSFACTOR_LOWER_BOUND ( 1.0f ) +#define D3D11_HS_MAXTESSFACTOR_UPPER_BOUND ( 64.0f ) +#define D3D11_HS_OUTPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 ) + +#define D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COUNT ( 1 ) + +#define D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 ) + +#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D11_IA_DEFAULT_PRIMITIVE_TOPOLOGY ( 0 ) + +#define D3D11_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D11_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT ( 1 ) + +#define D3D11_IA_INSTANCE_ID_BIT_COUNT ( 32 ) + +#define D3D11_IA_INTEGER_ARITHMETIC_BIT_COUNT ( 32 ) + +#define D3D11_IA_PATCH_MAX_CONTROL_POINT_COUNT ( 32 ) + +#define D3D11_IA_PRIMITIVE_ID_BIT_COUNT ( 32 ) + +#define D3D11_IA_VERTEX_ID_BIT_COUNT ( 32 ) + +#define D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ( 32 ) + +#define D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS ( 128 ) + +#define D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ( 32 ) + +#define D3D11_INTEGER_DIVIDE_BY_ZERO_QUOTIENT ( 0xffffffff ) + +#define D3D11_INTEGER_DIVIDE_BY_ZERO_REMAINDER ( 0xffffffff ) + +#define D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL ( 0xffffffff ) + +#define D3D11_KEEP_UNORDERED_ACCESS_VIEWS ( 0xffffffff ) + +#define D3D11_LINEAR_GAMMA ( 1.0f ) +#define D3D11_MAJOR_VERSION ( 11 ) + +#define D3D11_MAX_BORDER_COLOR_COMPONENT ( 1.0f ) +#define D3D11_MAX_DEPTH ( 1.0f ) +#define D3D11_MAX_MAXANISOTROPY ( 16 ) + +#define D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT ( 32 ) + +#define D3D11_MAX_POSITION_VALUE ( 3.402823466e+34f ) +#define D3D11_MAX_TEXTURE_DIMENSION_2_TO_EXP ( 17 ) + +#define D3D11_MINOR_VERSION ( 0 ) + +#define D3D11_MIN_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D11_MIN_DEPTH ( 0.0f ) +#define D3D11_MIN_MAXANISOTROPY ( 0 ) + +#define D3D11_MIP_LOD_BIAS_MAX ( 15.99f ) +#define D3D11_MIP_LOD_BIAS_MIN ( -16.0f ) +#define D3D11_MIP_LOD_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D11_MIP_LOD_RANGE_BIT_COUNT ( 8 ) + +#define D3D11_MULTISAMPLE_ANTIALIAS_LINE_WIDTH ( 1.4f ) +#define D3D11_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT ( 0 ) + +#define D3D11_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 15 ) + +#define D3D11_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 16 ) + +#define D3D11_PS_CS_UAV_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_PS_CS_UAV_REGISTER_COUNT ( 8 ) + +#define D3D11_PS_CS_UAV_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_PS_CS_UAV_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_PS_FRONTFACING_DEFAULT_VALUE ( 0xffffffff ) + +#define D3D11_PS_FRONTFACING_FALSE_VALUE ( 0 ) + +#define D3D11_PS_FRONTFACING_TRUE_VALUE ( 0xffffffff ) + +#define D3D11_PS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_PS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_PS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_PS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.0f ) +#define D3D11_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_PS_OUTPUT_DEPTH_REGISTER_COUNT ( 1 ) + +#define D3D11_PS_OUTPUT_MASK_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_PS_OUTPUT_MASK_REGISTER_COUNT ( 1 ) + +#define D3D11_PS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_PS_OUTPUT_REGISTER_COUNT ( 8 ) + +#define D3D11_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.5f ) +#define D3D11_RAW_UAV_SRV_BYTE_ALIGNMENT ( 16 ) + +#define D3D11_REQ_BLEND_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D11_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP ( 27 ) + +#define D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D11_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D11_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D11_REQ_DRAW_VERTEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D11_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION ( 16384 ) + +#define D3D11_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT ( 1024 ) + +#define D3D11_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D11_REQ_MAXANISOTROPY ( 16 ) + +#define D3D11_REQ_MIP_LEVELS ( 15 ) + +#define D3D11_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES ( 2048 ) + +#define D3D11_REQ_RASTERIZER_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D11_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH ( 16384 ) + +#define D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM ( 128 ) + +#define D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM ( 0.25f ) +#define D3D11_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP ( 20 ) + +#define D3D11_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D11_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION ( 2048 ) + +#define D3D11_REQ_TEXTURE1D_U_DIMENSION ( 16384 ) + +#define D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION ( 2048 ) + +#define D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION ( 16384 ) + +#define D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION ( 2048 ) + +#define D3D11_REQ_TEXTURECUBE_DIMENSION ( 16384 ) + +#define D3D11_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL ( 0 ) + +#define D3D11_SHADER_MAJOR_VERSION ( 5 ) + +#define D3D11_SHADER_MAX_INSTANCES ( 65535 ) + +#define D3D11_SHADER_MAX_INTERFACES ( 253 ) + +#define D3D11_SHADER_MAX_INTERFACE_CALL_SITES ( 4096 ) + +#define D3D11_SHADER_MAX_TYPES ( 65535 ) + +#define D3D11_SHADER_MINOR_VERSION ( 0 ) + +#define D3D11_SHIFT_INSTRUCTION_PAD_VALUE ( 0 ) + +#define D3D11_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT ( 5 ) + +#define D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ( 8 ) + +#define D3D11_SO_BUFFER_MAX_STRIDE_IN_BYTES ( 2048 ) + +#define D3D11_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES ( 512 ) + +#define D3D11_SO_BUFFER_SLOT_COUNT ( 4 ) + +#define D3D11_SO_DDI_REGISTER_INDEX_DENOTING_GAP ( 0xffffffff ) + +#define D3D11_SO_NO_RASTERIZED_STREAM ( 0xffffffff ) + +#define D3D11_SO_OUTPUT_COMPONENT_COUNT ( 128 ) + +#define D3D11_SO_STREAM_COUNT ( 4 ) + +#define D3D11_SPEC_DATE_DAY ( 04 ) + +#define D3D11_SPEC_DATE_MONTH ( 06 ) + +#define D3D11_SPEC_DATE_YEAR ( 2009 ) + +#define D3D11_SPEC_VERSION ( 1.0 ) +#define D3D11_SRGB_GAMMA ( 2.2f ) +#define D3D11_SRGB_TO_FLOAT_DENOMINATOR_1 ( 12.92f ) +#define D3D11_SRGB_TO_FLOAT_DENOMINATOR_2 ( 1.055f ) +#define D3D11_SRGB_TO_FLOAT_EXPONENT ( 2.4f ) +#define D3D11_SRGB_TO_FLOAT_OFFSET ( 0.055f ) +#define D3D11_SRGB_TO_FLOAT_THRESHOLD ( 0.04045f ) +#define D3D11_SRGB_TO_FLOAT_TOLERANCE_IN_ULP ( 0.5f ) +#define D3D11_STANDARD_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_STANDARD_COMPONENT_BIT_COUNT_DOUBLED ( 64 ) + +#define D3D11_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE ( 4 ) + +#define D3D11_STANDARD_PIXEL_COMPONENT_COUNT ( 128 ) + +#define D3D11_STANDARD_PIXEL_ELEMENT_COUNT ( 32 ) + +#define D3D11_STANDARD_VECTOR_SIZE ( 4 ) + +#define D3D11_STANDARD_VERTEX_ELEMENT_COUNT ( 32 ) + +#define D3D11_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT ( 64 ) + +#define D3D11_SUBPIXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D11_SUBTEXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D11_TESSELLATOR_MAX_EVEN_TESSELLATION_FACTOR ( 64 ) + +#define D3D11_TESSELLATOR_MAX_ISOLINE_DENSITY_TESSELLATION_FACTOR ( 64 ) + +#define D3D11_TESSELLATOR_MAX_ODD_TESSELLATION_FACTOR ( 63 ) + +#define D3D11_TESSELLATOR_MAX_TESSELLATION_FACTOR ( 64 ) + +#define D3D11_TESSELLATOR_MIN_EVEN_TESSELLATION_FACTOR ( 2 ) + +#define D3D11_TESSELLATOR_MIN_ISOLINE_DENSITY_TESSELLATION_FACTOR ( 1 ) + +#define D3D11_TESSELLATOR_MIN_ODD_TESSELLATION_FACTOR ( 1 ) + +#define D3D11_TEXEL_ADDRESS_RANGE_BIT_COUNT ( 16 ) + +#define D3D11_UNBOUND_MEMORY_ACCESS_RESULT ( 0 ) + +#define D3D11_VIEWPORT_AND_SCISSORRECT_MAX_INDEX ( 15 ) + +#define D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE ( 16 ) + +#define D3D11_VIEWPORT_BOUNDS_MAX ( 32767 ) + +#define D3D11_VIEWPORT_BOUNDS_MIN ( -32768 ) + +#define D3D11_VS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_VS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_VS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_VS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_VS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_VS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT ( 10 ) + +#define D3D11_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 25 ) + +#define D3D11_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP ( 25 ) + +#endif +#define _FACD3D11 ( 0x87c ) + +#define _FACD3D11DEBUG ( ( _FACD3D11 + 1 ) ) + +#define MAKE_D3D11_HRESULT( code ) MAKE_HRESULT( 1, _FACD3D11, code ) +#define MAKE_D3D11_STATUS( code ) MAKE_HRESULT( 0, _FACD3D11, code ) +#define D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS MAKE_D3D11_HRESULT(1) +#define D3D11_ERROR_FILE_NOT_FOUND MAKE_D3D11_HRESULT(2) +#define D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS MAKE_D3D11_HRESULT(3) +#define D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD MAKE_D3D11_HRESULT(4) +#if __SAL_H_FULL_VER < 140050727 +#undef __in_range +#undef __in_xcount_opt +#define __in_range(x, y) +#define __in_xcount_opt(x) +#endif +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_DEFAULT {}; +extern const DECLSPEC_SELECTANY CD3D11_DEFAULT D3D11_DEFAULT; +extern "C"{ +#endif +typedef +enum D3D11_INPUT_CLASSIFICATION + { D3D11_INPUT_PER_VERTEX_DATA = 0, + D3D11_INPUT_PER_INSTANCE_DATA = 1 + } D3D11_INPUT_CLASSIFICATION; + +#define D3D11_APPEND_ALIGNED_ELEMENT ( 0xffffffff ) + +typedef struct D3D11_INPUT_ELEMENT_DESC + { + LPCSTR SemanticName; + UINT SemanticIndex; + DXGI_FORMAT Format; + UINT InputSlot; + UINT AlignedByteOffset; + D3D11_INPUT_CLASSIFICATION InputSlotClass; + UINT InstanceDataStepRate; + } D3D11_INPUT_ELEMENT_DESC; + +typedef +enum D3D11_FILL_MODE + { D3D11_FILL_WIREFRAME = 2, + D3D11_FILL_SOLID = 3 + } D3D11_FILL_MODE; + +typedef D3D_PRIMITIVE_TOPOLOGY D3D11_PRIMITIVE_TOPOLOGY; + +typedef D3D_PRIMITIVE D3D11_PRIMITIVE; + +typedef +enum D3D11_CULL_MODE + { D3D11_CULL_NONE = 1, + D3D11_CULL_FRONT = 2, + D3D11_CULL_BACK = 3 + } D3D11_CULL_MODE; + +typedef struct D3D11_SO_DECLARATION_ENTRY + { + UINT Stream; + LPCSTR SemanticName; + UINT SemanticIndex; + BYTE StartComponent; + BYTE ComponentCount; + BYTE OutputSlot; + } D3D11_SO_DECLARATION_ENTRY; + +typedef struct D3D11_VIEWPORT + { + FLOAT TopLeftX; + FLOAT TopLeftY; + FLOAT Width; + FLOAT Height; + FLOAT MinDepth; + FLOAT MaxDepth; + } D3D11_VIEWPORT; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +inline bool operator==( const D3D11_VIEWPORT& l, const D3D11_VIEWPORT& r ) +{ + return l.TopLeftX == r.TopLeftX && l.TopLeftY == r.TopLeftY && l.Width == r.Width && + l.Height == r.Height && l.MinDepth == r.MinDepth && l.MaxDepth == r.MaxDepth; +} +inline bool operator!=( const D3D11_VIEWPORT& l, const D3D11_VIEWPORT& r ) +{ return !( l == r ); } +extern "C"{ +#endif +typedef +enum D3D11_RESOURCE_DIMENSION + { D3D11_RESOURCE_DIMENSION_UNKNOWN = 0, + D3D11_RESOURCE_DIMENSION_BUFFER = 1, + D3D11_RESOURCE_DIMENSION_TEXTURE1D = 2, + D3D11_RESOURCE_DIMENSION_TEXTURE2D = 3, + D3D11_RESOURCE_DIMENSION_TEXTURE3D = 4 + } D3D11_RESOURCE_DIMENSION; + +typedef D3D_SRV_DIMENSION D3D11_SRV_DIMENSION; + +typedef +enum D3D11_DSV_DIMENSION + { D3D11_DSV_DIMENSION_UNKNOWN = 0, + D3D11_DSV_DIMENSION_TEXTURE1D = 1, + D3D11_DSV_DIMENSION_TEXTURE1DARRAY = 2, + D3D11_DSV_DIMENSION_TEXTURE2D = 3, + D3D11_DSV_DIMENSION_TEXTURE2DARRAY = 4, + D3D11_DSV_DIMENSION_TEXTURE2DMS = 5, + D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY = 6 + } D3D11_DSV_DIMENSION; + +typedef +enum D3D11_RTV_DIMENSION + { D3D11_RTV_DIMENSION_UNKNOWN = 0, + D3D11_RTV_DIMENSION_BUFFER = 1, + D3D11_RTV_DIMENSION_TEXTURE1D = 2, + D3D11_RTV_DIMENSION_TEXTURE1DARRAY = 3, + D3D11_RTV_DIMENSION_TEXTURE2D = 4, + D3D11_RTV_DIMENSION_TEXTURE2DARRAY = 5, + D3D11_RTV_DIMENSION_TEXTURE2DMS = 6, + D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D11_RTV_DIMENSION_TEXTURE3D = 8 + } D3D11_RTV_DIMENSION; + +typedef +enum D3D11_UAV_DIMENSION + { D3D11_UAV_DIMENSION_UNKNOWN = 0, + D3D11_UAV_DIMENSION_BUFFER = 1, + D3D11_UAV_DIMENSION_TEXTURE1D = 2, + D3D11_UAV_DIMENSION_TEXTURE1DARRAY = 3, + D3D11_UAV_DIMENSION_TEXTURE2D = 4, + D3D11_UAV_DIMENSION_TEXTURE2DARRAY = 5, + D3D11_UAV_DIMENSION_TEXTURE3D = 8 + } D3D11_UAV_DIMENSION; + +typedef +enum D3D11_USAGE + { D3D11_USAGE_DEFAULT = 0, + D3D11_USAGE_IMMUTABLE = 1, + D3D11_USAGE_DYNAMIC = 2, + D3D11_USAGE_STAGING = 3 + } D3D11_USAGE; + +typedef +enum D3D11_BIND_FLAG + { D3D11_BIND_VERTEX_BUFFER = 0x1L, + D3D11_BIND_INDEX_BUFFER = 0x2L, + D3D11_BIND_CONSTANT_BUFFER = 0x4L, + D3D11_BIND_SHADER_RESOURCE = 0x8L, + D3D11_BIND_STREAM_OUTPUT = 0x10L, + D3D11_BIND_RENDER_TARGET = 0x20L, + D3D11_BIND_DEPTH_STENCIL = 0x40L, + D3D11_BIND_UNORDERED_ACCESS = 0x80L + } D3D11_BIND_FLAG; + +typedef +enum D3D11_CPU_ACCESS_FLAG + { D3D11_CPU_ACCESS_WRITE = 0x10000L, + D3D11_CPU_ACCESS_READ = 0x20000L + } D3D11_CPU_ACCESS_FLAG; + +typedef +enum D3D11_RESOURCE_MISC_FLAG + { D3D11_RESOURCE_MISC_GENERATE_MIPS = 0x1L, + D3D11_RESOURCE_MISC_SHARED = 0x2L, + D3D11_RESOURCE_MISC_TEXTURECUBE = 0x4L, + D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x10L, + D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x20L, + D3D11_RESOURCE_MISC_BUFFER_STRUCTURED = 0x40L, + D3D11_RESOURCE_MISC_RESOURCE_CLAMP = 0x80L, + D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x100L, + D3D11_RESOURCE_MISC_GDI_COMPATIBLE = 0x200L + } D3D11_RESOURCE_MISC_FLAG; + +typedef +enum D3D11_MAP + { D3D11_MAP_READ = 1, + D3D11_MAP_WRITE = 2, + D3D11_MAP_READ_WRITE = 3, + D3D11_MAP_WRITE_DISCARD = 4, + D3D11_MAP_WRITE_NO_OVERWRITE = 5 + } D3D11_MAP; + +typedef +enum D3D11_MAP_FLAG + { D3D11_MAP_FLAG_DO_NOT_WAIT = 0x100000L + } D3D11_MAP_FLAG; + +typedef +enum D3D11_RAISE_FLAG + { D3D11_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1L + } D3D11_RAISE_FLAG; + +typedef +enum D3D11_CLEAR_FLAG + { D3D11_CLEAR_DEPTH = 0x1L, + D3D11_CLEAR_STENCIL = 0x2L + } D3D11_CLEAR_FLAG; + +typedef RECT D3D11_RECT; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_RECT : public D3D11_RECT +{ + CD3D11_RECT() + {} + explicit CD3D11_RECT( const D3D11_RECT& o ) : + D3D11_RECT( o ) + {} + explicit CD3D11_RECT( + LONG Left, + LONG Top, + LONG Right, + LONG Bottom ) + { + left = Left; + top = Top; + right = Right; + bottom = Bottom; + } + ~CD3D11_RECT() {} + operator const D3D11_RECT&() const { return *this; } +}; +inline bool operator==( const D3D11_RECT& l, const D3D11_RECT& r ) +{ + return l.left == r.left && l.top == r.top && + l.right == r.right && l.bottom == r.bottom; +} +inline bool operator!=( const D3D11_RECT& l, const D3D11_RECT& r ) +{ return !( l == r ); } +extern "C"{ +#endif +typedef struct D3D11_BOX + { + UINT left; + UINT top; + UINT front; + UINT right; + UINT bottom; + UINT back; + } D3D11_BOX; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_BOX : public D3D11_BOX +{ + CD3D11_BOX() + {} + explicit CD3D11_BOX( const D3D11_BOX& o ) : + D3D11_BOX( o ) + {} + explicit CD3D11_BOX( + LONG Left, + LONG Top, + LONG Front, + LONG Right, + LONG Bottom, + LONG Back ) + { + left = Left; + top = Top; + front = Front; + right = Right; + bottom = Bottom; + back = Back; + } + ~CD3D11_BOX() {} + operator const D3D11_BOX&() const { return *this; } +}; +inline bool operator==( const D3D11_BOX& l, const D3D11_BOX& r ) +{ + return l.left == r.left && l.top == r.top && l.front == r.front && + l.right == r.right && l.bottom == r.bottom && l.back == r.back; +} +inline bool operator!=( const D3D11_BOX& l, const D3D11_BOX& r ) +{ return !( l == r ); } +extern "C"{ +#endif + + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D11DeviceChild_INTERFACE_DEFINED__ +#define __ID3D11DeviceChild_INTERFACE_DEFINED__ + +/* interface ID3D11DeviceChild */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11DeviceChild; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1841e5c8-16b0-489b-bcc8-44cfb0d5deae") + ID3D11DeviceChild : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE GetDevice( + /* [annotation] */ + __out ID3D11Device **ppDevice) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DeviceChildVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11DeviceChild * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11DeviceChild * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11DeviceChild * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11DeviceChild * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11DeviceChildVtbl; + + interface ID3D11DeviceChild + { + CONST_VTBL struct ID3D11DeviceChildVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11DeviceChild_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11DeviceChild_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11DeviceChild_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11DeviceChild_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11DeviceChild_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11DeviceChild_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11DeviceChild_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11DeviceChild_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0001 */ +/* [local] */ + +typedef +enum D3D11_COMPARISON_FUNC + { D3D11_COMPARISON_NEVER = 1, + D3D11_COMPARISON_LESS = 2, + D3D11_COMPARISON_EQUAL = 3, + D3D11_COMPARISON_LESS_EQUAL = 4, + D3D11_COMPARISON_GREATER = 5, + D3D11_COMPARISON_NOT_EQUAL = 6, + D3D11_COMPARISON_GREATER_EQUAL = 7, + D3D11_COMPARISON_ALWAYS = 8 + } D3D11_COMPARISON_FUNC; + +typedef +enum D3D11_DEPTH_WRITE_MASK + { D3D11_DEPTH_WRITE_MASK_ZERO = 0, + D3D11_DEPTH_WRITE_MASK_ALL = 1 + } D3D11_DEPTH_WRITE_MASK; + +typedef +enum D3D11_STENCIL_OP + { D3D11_STENCIL_OP_KEEP = 1, + D3D11_STENCIL_OP_ZERO = 2, + D3D11_STENCIL_OP_REPLACE = 3, + D3D11_STENCIL_OP_INCR_SAT = 4, + D3D11_STENCIL_OP_DECR_SAT = 5, + D3D11_STENCIL_OP_INVERT = 6, + D3D11_STENCIL_OP_INCR = 7, + D3D11_STENCIL_OP_DECR = 8 + } D3D11_STENCIL_OP; + +typedef struct D3D11_DEPTH_STENCILOP_DESC + { + D3D11_STENCIL_OP StencilFailOp; + D3D11_STENCIL_OP StencilDepthFailOp; + D3D11_STENCIL_OP StencilPassOp; + D3D11_COMPARISON_FUNC StencilFunc; + } D3D11_DEPTH_STENCILOP_DESC; + +typedef struct D3D11_DEPTH_STENCIL_DESC + { + BOOL DepthEnable; + D3D11_DEPTH_WRITE_MASK DepthWriteMask; + D3D11_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; + D3D11_DEPTH_STENCILOP_DESC FrontFace; + D3D11_DEPTH_STENCILOP_DESC BackFace; + } D3D11_DEPTH_STENCIL_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_DEPTH_STENCIL_DESC : public D3D11_DEPTH_STENCIL_DESC +{ + CD3D11_DEPTH_STENCIL_DESC() + {} + explicit CD3D11_DEPTH_STENCIL_DESC( const D3D11_DEPTH_STENCIL_DESC& o ) : + D3D11_DEPTH_STENCIL_DESC( o ) + {} + explicit CD3D11_DEPTH_STENCIL_DESC( CD3D11_DEFAULT ) + { + DepthEnable = TRUE; + DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D11_COMPARISON_LESS; + StencilEnable = FALSE; + StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; + StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; + const D3D11_DEPTH_STENCILOP_DESC defaultStencilOp = + { D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS }; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + } + explicit CD3D11_DEPTH_STENCIL_DESC( + BOOL depthEnable, + D3D11_DEPTH_WRITE_MASK depthWriteMask, + D3D11_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + UINT8 stencilReadMask, + UINT8 stencilWriteMask, + D3D11_STENCIL_OP frontStencilFailOp, + D3D11_STENCIL_OP frontStencilDepthFailOp, + D3D11_STENCIL_OP frontStencilPassOp, + D3D11_COMPARISON_FUNC frontStencilFunc, + D3D11_STENCIL_OP backStencilFailOp, + D3D11_STENCIL_OP backStencilDepthFailOp, + D3D11_STENCIL_OP backStencilPassOp, + D3D11_COMPARISON_FUNC backStencilFunc ) + { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + StencilReadMask = stencilReadMask; + StencilWriteMask = stencilWriteMask; + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + } + ~CD3D11_DEPTH_STENCIL_DESC() {} + operator const D3D11_DEPTH_STENCIL_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3D11DepthStencilState_INTERFACE_DEFINED__ +#define __ID3D11DepthStencilState_INTERFACE_DEFINED__ + +/* interface ID3D11DepthStencilState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11DepthStencilState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("03823efb-8d8f-4e1c-9aa2-f64bb2cbfdf1") + ID3D11DepthStencilState : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_DEPTH_STENCIL_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DepthStencilStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11DepthStencilState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11DepthStencilState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11DepthStencilState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11DepthStencilState * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11DepthStencilState * This, + /* [annotation] */ + __out D3D11_DEPTH_STENCIL_DESC *pDesc); + + END_INTERFACE + } ID3D11DepthStencilStateVtbl; + + interface ID3D11DepthStencilState + { + CONST_VTBL struct ID3D11DepthStencilStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11DepthStencilState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11DepthStencilState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11DepthStencilState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11DepthStencilState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11DepthStencilState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11DepthStencilState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11DepthStencilState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11DepthStencilState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11DepthStencilState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0002 */ +/* [local] */ + +typedef +enum D3D11_BLEND + { D3D11_BLEND_ZERO = 1, + D3D11_BLEND_ONE = 2, + D3D11_BLEND_SRC_COLOR = 3, + D3D11_BLEND_INV_SRC_COLOR = 4, + D3D11_BLEND_SRC_ALPHA = 5, + D3D11_BLEND_INV_SRC_ALPHA = 6, + D3D11_BLEND_DEST_ALPHA = 7, + D3D11_BLEND_INV_DEST_ALPHA = 8, + D3D11_BLEND_DEST_COLOR = 9, + D3D11_BLEND_INV_DEST_COLOR = 10, + D3D11_BLEND_SRC_ALPHA_SAT = 11, + D3D11_BLEND_BLEND_FACTOR = 14, + D3D11_BLEND_INV_BLEND_FACTOR = 15, + D3D11_BLEND_SRC1_COLOR = 16, + D3D11_BLEND_INV_SRC1_COLOR = 17, + D3D11_BLEND_SRC1_ALPHA = 18, + D3D11_BLEND_INV_SRC1_ALPHA = 19 + } D3D11_BLEND; + +typedef +enum D3D11_BLEND_OP + { D3D11_BLEND_OP_ADD = 1, + D3D11_BLEND_OP_SUBTRACT = 2, + D3D11_BLEND_OP_REV_SUBTRACT = 3, + D3D11_BLEND_OP_MIN = 4, + D3D11_BLEND_OP_MAX = 5 + } D3D11_BLEND_OP; + +typedef +enum D3D11_COLOR_WRITE_ENABLE + { D3D11_COLOR_WRITE_ENABLE_RED = 1, + D3D11_COLOR_WRITE_ENABLE_GREEN = 2, + D3D11_COLOR_WRITE_ENABLE_BLUE = 4, + D3D11_COLOR_WRITE_ENABLE_ALPHA = 8, + D3D11_COLOR_WRITE_ENABLE_ALL = ( ( ( D3D11_COLOR_WRITE_ENABLE_RED | D3D11_COLOR_WRITE_ENABLE_GREEN ) | D3D11_COLOR_WRITE_ENABLE_BLUE ) | D3D11_COLOR_WRITE_ENABLE_ALPHA ) + } D3D11_COLOR_WRITE_ENABLE; + +typedef struct D3D11_RENDER_TARGET_BLEND_DESC + { + BOOL BlendEnable; + D3D11_BLEND SrcBlend; + D3D11_BLEND DestBlend; + D3D11_BLEND_OP BlendOp; + D3D11_BLEND SrcBlendAlpha; + D3D11_BLEND DestBlendAlpha; + D3D11_BLEND_OP BlendOpAlpha; + UINT8 RenderTargetWriteMask; + } D3D11_RENDER_TARGET_BLEND_DESC; + +typedef struct D3D11_BLEND_DESC + { + BOOL AlphaToCoverageEnable; + BOOL IndependentBlendEnable; + D3D11_RENDER_TARGET_BLEND_DESC RenderTarget[ 8 ]; + } D3D11_BLEND_DESC; + +/* Note, the array size for RenderTarget[] above is D3D11_SIMULTANEOUS_RENDERTARGET_COUNT. + IDL processing/generation of this header replaces the define; this comment is merely explaining what happened. */ +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_BLEND_DESC : public D3D11_BLEND_DESC +{ + CD3D11_BLEND_DESC() + {} + explicit CD3D11_BLEND_DESC( const D3D11_BLEND_DESC& o ) : + D3D11_BLEND_DESC( o ) + {} + explicit CD3D11_BLEND_DESC( CD3D11_DEFAULT ) + { + AlphaToCoverageEnable = FALSE; + IndependentBlendEnable = FALSE; + const D3D11_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc = + { + FALSE, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_COLOR_WRITE_ENABLE_ALL, + }; + for (UINT i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + RenderTarget[ i ] = defaultRenderTargetBlendDesc; + } + ~CD3D11_BLEND_DESC() {} + operator const D3D11_BLEND_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0002_v0_0_s_ifspec; + +#ifndef __ID3D11BlendState_INTERFACE_DEFINED__ +#define __ID3D11BlendState_INTERFACE_DEFINED__ + +/* interface ID3D11BlendState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11BlendState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("75b68faa-347d-4159-8f45-a0640f01cd9a") + ID3D11BlendState : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_BLEND_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11BlendStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11BlendState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11BlendState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11BlendState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11BlendState * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11BlendState * This, + /* [annotation] */ + __out D3D11_BLEND_DESC *pDesc); + + END_INTERFACE + } ID3D11BlendStateVtbl; + + interface ID3D11BlendState + { + CONST_VTBL struct ID3D11BlendStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11BlendState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11BlendState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11BlendState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11BlendState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11BlendState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11BlendState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11BlendState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11BlendState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11BlendState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0003 */ +/* [local] */ + +typedef struct D3D11_RASTERIZER_DESC + { + D3D11_FILL_MODE FillMode; + D3D11_CULL_MODE CullMode; + BOOL FrontCounterClockwise; + INT DepthBias; + FLOAT DepthBiasClamp; + FLOAT SlopeScaledDepthBias; + BOOL DepthClipEnable; + BOOL ScissorEnable; + BOOL MultisampleEnable; + BOOL AntialiasedLineEnable; + } D3D11_RASTERIZER_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_RASTERIZER_DESC : public D3D11_RASTERIZER_DESC +{ + CD3D11_RASTERIZER_DESC() + {} + explicit CD3D11_RASTERIZER_DESC( const D3D11_RASTERIZER_DESC& o ) : + D3D11_RASTERIZER_DESC( o ) + {} + explicit CD3D11_RASTERIZER_DESC( CD3D11_DEFAULT ) + { + FillMode = D3D11_FILL_SOLID; + CullMode = D3D11_CULL_BACK; + FrontCounterClockwise = FALSE; + DepthBias = D3D11_DEFAULT_DEPTH_BIAS; + DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP; + SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS; + DepthClipEnable = TRUE; + ScissorEnable = FALSE; + MultisampleEnable = FALSE; + AntialiasedLineEnable = FALSE; + } + explicit CD3D11_RASTERIZER_DESC( + D3D11_FILL_MODE fillMode, + D3D11_CULL_MODE cullMode, + BOOL frontCounterClockwise, + INT depthBias, + FLOAT depthBiasClamp, + FLOAT slopeScaledDepthBias, + BOOL depthClipEnable, + BOOL scissorEnable, + BOOL multisampleEnable, + BOOL antialiasedLineEnable ) + { + FillMode = fillMode; + CullMode = cullMode; + FrontCounterClockwise = frontCounterClockwise; + DepthBias = depthBias; + DepthBiasClamp = depthBiasClamp; + SlopeScaledDepthBias = slopeScaledDepthBias; + DepthClipEnable = depthClipEnable; + ScissorEnable = scissorEnable; + MultisampleEnable = multisampleEnable; + AntialiasedLineEnable = antialiasedLineEnable; + } + ~CD3D11_RASTERIZER_DESC() {} + operator const D3D11_RASTERIZER_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0003_v0_0_s_ifspec; + +#ifndef __ID3D11RasterizerState_INTERFACE_DEFINED__ +#define __ID3D11RasterizerState_INTERFACE_DEFINED__ + +/* interface ID3D11RasterizerState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11RasterizerState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9bb4ab81-ab1a-4d8f-b506-fc04200b6ee7") + ID3D11RasterizerState : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_RASTERIZER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11RasterizerStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11RasterizerState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11RasterizerState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11RasterizerState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11RasterizerState * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11RasterizerState * This, + /* [annotation] */ + __out D3D11_RASTERIZER_DESC *pDesc); + + END_INTERFACE + } ID3D11RasterizerStateVtbl; + + interface ID3D11RasterizerState + { + CONST_VTBL struct ID3D11RasterizerStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11RasterizerState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11RasterizerState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11RasterizerState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11RasterizerState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11RasterizerState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11RasterizerState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11RasterizerState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11RasterizerState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11RasterizerState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0004 */ +/* [local] */ + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +inline UINT D3D11CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT MipLevels ) +{ return MipSlice + ArraySlice * MipLevels; } +extern "C"{ +#endif +typedef struct D3D11_SUBRESOURCE_DATA + { + const void *pSysMem; + UINT SysMemPitch; + UINT SysMemSlicePitch; + } D3D11_SUBRESOURCE_DATA; + +typedef struct D3D11_MAPPED_SUBRESOURCE + { + void *pData; + UINT RowPitch; + UINT DepthPitch; + } D3D11_MAPPED_SUBRESOURCE; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0004_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0004_v0_0_s_ifspec; + +#ifndef __ID3D11Resource_INTERFACE_DEFINED__ +#define __ID3D11Resource_INTERFACE_DEFINED__ + +/* interface ID3D11Resource */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Resource; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("dc8e63f3-d12b-4952-b47b-5e45026a862d") + ID3D11Resource : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetType( + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension) = 0; + + virtual void STDMETHODCALLTYPE SetEvictionPriority( + /* [annotation] */ + __in UINT EvictionPriority) = 0; + + virtual UINT STDMETHODCALLTYPE GetEvictionPriority( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11ResourceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Resource * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Resource * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Resource * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Resource * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D11Resource * This, + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D11Resource * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D11Resource * This); + + END_INTERFACE + } ID3D11ResourceVtbl; + + interface ID3D11Resource + { + CONST_VTBL struct ID3D11ResourceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Resource_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Resource_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Resource_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Resource_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Resource_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Resource_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Resource_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Resource_GetType(This,pResourceDimension) \ + ( (This)->lpVtbl -> GetType(This,pResourceDimension) ) + +#define ID3D11Resource_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D11Resource_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Resource_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0005 */ +/* [local] */ + +typedef struct D3D11_BUFFER_DESC + { + UINT ByteWidth; + D3D11_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + UINT StructureByteStride; + } D3D11_BUFFER_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_BUFFER_DESC : public D3D11_BUFFER_DESC +{ + CD3D11_BUFFER_DESC() + {} + explicit CD3D11_BUFFER_DESC( const D3D11_BUFFER_DESC& o ) : + D3D11_BUFFER_DESC( o ) + {} + explicit CD3D11_BUFFER_DESC( + UINT byteWidth, + UINT bindFlags, + D3D11_USAGE usage = D3D11_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT miscFlags = 0, + UINT structureByteStride = 0 ) + { + ByteWidth = byteWidth; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags ; + MiscFlags = miscFlags; + StructureByteStride = structureByteStride; + } + ~CD3D11_BUFFER_DESC() {} + operator const D3D11_BUFFER_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0005_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0005_v0_0_s_ifspec; + +#ifndef __ID3D11Buffer_INTERFACE_DEFINED__ +#define __ID3D11Buffer_INTERFACE_DEFINED__ + +/* interface ID3D11Buffer */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Buffer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("48570b85-d1ee-4fcd-a250-eb350722b037") + ID3D11Buffer : public ID3D11Resource + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_BUFFER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11BufferVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Buffer * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Buffer * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Buffer * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Buffer * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D11Buffer * This, + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D11Buffer * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D11Buffer * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Buffer * This, + /* [annotation] */ + __out D3D11_BUFFER_DESC *pDesc); + + END_INTERFACE + } ID3D11BufferVtbl; + + interface ID3D11Buffer + { + CONST_VTBL struct ID3D11BufferVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Buffer_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Buffer_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Buffer_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Buffer_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Buffer_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Buffer_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Buffer_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Buffer_GetType(This,pResourceDimension) \ + ( (This)->lpVtbl -> GetType(This,pResourceDimension) ) + +#define ID3D11Buffer_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D11Buffer_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D11Buffer_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Buffer_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0006 */ +/* [local] */ + +typedef struct D3D11_TEXTURE1D_DESC + { + UINT Width; + UINT MipLevels; + UINT ArraySize; + DXGI_FORMAT Format; + D3D11_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D11_TEXTURE1D_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_TEXTURE1D_DESC : public D3D11_TEXTURE1D_DESC +{ + CD3D11_TEXTURE1D_DESC() + {} + explicit CD3D11_TEXTURE1D_DESC( const D3D11_TEXTURE1D_DESC& o ) : + D3D11_TEXTURE1D_DESC( o ) + {} + explicit CD3D11_TEXTURE1D_DESC( + DXGI_FORMAT format, + UINT width, + UINT arraySize = 1, + UINT mipLevels = 0, + UINT bindFlags = D3D11_BIND_SHADER_RESOURCE, + D3D11_USAGE usage = D3D11_USAGE_DEFAULT, + UINT cpuaccessFlags= 0, + UINT miscFlags = 0 ) + { + Width = width; + MipLevels = mipLevels; + ArraySize = arraySize; + Format = format; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D11_TEXTURE1D_DESC() {} + operator const D3D11_TEXTURE1D_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0006_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0006_v0_0_s_ifspec; + +#ifndef __ID3D11Texture1D_INTERFACE_DEFINED__ +#define __ID3D11Texture1D_INTERFACE_DEFINED__ + +/* interface ID3D11Texture1D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Texture1D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("f8fb5c27-c6b3-4f75-a4c8-439af2ef564c") + ID3D11Texture1D : public ID3D11Resource + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_TEXTURE1D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11Texture1DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Texture1D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Texture1D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Texture1D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Texture1D * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D11Texture1D * This, + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D11Texture1D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D11Texture1D * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Texture1D * This, + /* [annotation] */ + __out D3D11_TEXTURE1D_DESC *pDesc); + + END_INTERFACE + } ID3D11Texture1DVtbl; + + interface ID3D11Texture1D + { + CONST_VTBL struct ID3D11Texture1DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Texture1D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Texture1D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Texture1D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Texture1D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Texture1D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Texture1D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Texture1D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Texture1D_GetType(This,pResourceDimension) \ + ( (This)->lpVtbl -> GetType(This,pResourceDimension) ) + +#define ID3D11Texture1D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D11Texture1D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D11Texture1D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Texture1D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0007 */ +/* [local] */ + +typedef struct D3D11_TEXTURE2D_DESC + { + UINT Width; + UINT Height; + UINT MipLevels; + UINT ArraySize; + DXGI_FORMAT Format; + DXGI_SAMPLE_DESC SampleDesc; + D3D11_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D11_TEXTURE2D_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_TEXTURE2D_DESC : public D3D11_TEXTURE2D_DESC +{ + CD3D11_TEXTURE2D_DESC() + {} + explicit CD3D11_TEXTURE2D_DESC( const D3D11_TEXTURE2D_DESC& o ) : + D3D11_TEXTURE2D_DESC( o ) + {} + explicit CD3D11_TEXTURE2D_DESC( + DXGI_FORMAT format, + UINT width, + UINT height, + UINT arraySize = 1, + UINT mipLevels = 0, + UINT bindFlags = D3D11_BIND_SHADER_RESOURCE, + D3D11_USAGE usage = D3D11_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT sampleCount = 1, + UINT sampleQuality = 0, + UINT miscFlags = 0 ) + { + Width = width; + Height = height; + MipLevels = mipLevels; + ArraySize = arraySize; + Format = format; + SampleDesc.Count = sampleCount; + SampleDesc.Quality = sampleQuality; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D11_TEXTURE2D_DESC() {} + operator const D3D11_TEXTURE2D_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0007_v0_0_s_ifspec; + +#ifndef __ID3D11Texture2D_INTERFACE_DEFINED__ +#define __ID3D11Texture2D_INTERFACE_DEFINED__ + +/* interface ID3D11Texture2D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Texture2D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6f15aaf2-d208-4e89-9ab4-489535d34f9c") + ID3D11Texture2D : public ID3D11Resource + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_TEXTURE2D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11Texture2DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Texture2D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Texture2D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Texture2D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Texture2D * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D11Texture2D * This, + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D11Texture2D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D11Texture2D * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Texture2D * This, + /* [annotation] */ + __out D3D11_TEXTURE2D_DESC *pDesc); + + END_INTERFACE + } ID3D11Texture2DVtbl; + + interface ID3D11Texture2D + { + CONST_VTBL struct ID3D11Texture2DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Texture2D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Texture2D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Texture2D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Texture2D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Texture2D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Texture2D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Texture2D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Texture2D_GetType(This,pResourceDimension) \ + ( (This)->lpVtbl -> GetType(This,pResourceDimension) ) + +#define ID3D11Texture2D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D11Texture2D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D11Texture2D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Texture2D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0008 */ +/* [local] */ + +typedef struct D3D11_TEXTURE3D_DESC + { + UINT Width; + UINT Height; + UINT Depth; + UINT MipLevels; + DXGI_FORMAT Format; + D3D11_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D11_TEXTURE3D_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_TEXTURE3D_DESC : public D3D11_TEXTURE3D_DESC +{ + CD3D11_TEXTURE3D_DESC() + {} + explicit CD3D11_TEXTURE3D_DESC( const D3D11_TEXTURE3D_DESC& o ) : + D3D11_TEXTURE3D_DESC( o ) + {} + explicit CD3D11_TEXTURE3D_DESC( + DXGI_FORMAT format, + UINT width, + UINT height, + UINT depth, + UINT mipLevels = 0, + UINT bindFlags = D3D11_BIND_SHADER_RESOURCE, + D3D11_USAGE usage = D3D11_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT miscFlags = 0 ) + { + Width = width; + Height = height; + Depth = depth; + MipLevels = mipLevels; + Format = format; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D11_TEXTURE3D_DESC() {} + operator const D3D11_TEXTURE3D_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0008_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0008_v0_0_s_ifspec; + +#ifndef __ID3D11Texture3D_INTERFACE_DEFINED__ +#define __ID3D11Texture3D_INTERFACE_DEFINED__ + +/* interface ID3D11Texture3D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Texture3D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("037e866e-f56d-4357-a8af-9dabbe6e250e") + ID3D11Texture3D : public ID3D11Resource + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_TEXTURE3D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11Texture3DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Texture3D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Texture3D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Texture3D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Texture3D * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D11Texture3D * This, + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D11Texture3D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D11Texture3D * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Texture3D * This, + /* [annotation] */ + __out D3D11_TEXTURE3D_DESC *pDesc); + + END_INTERFACE + } ID3D11Texture3DVtbl; + + interface ID3D11Texture3D + { + CONST_VTBL struct ID3D11Texture3DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Texture3D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Texture3D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Texture3D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Texture3D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Texture3D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Texture3D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Texture3D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Texture3D_GetType(This,pResourceDimension) \ + ( (This)->lpVtbl -> GetType(This,pResourceDimension) ) + +#define ID3D11Texture3D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D11Texture3D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D11Texture3D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Texture3D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0009 */ +/* [local] */ + +typedef +enum D3D11_TEXTURECUBE_FACE + { D3D11_TEXTURECUBE_FACE_POSITIVE_X = 0, + D3D11_TEXTURECUBE_FACE_NEGATIVE_X = 1, + D3D11_TEXTURECUBE_FACE_POSITIVE_Y = 2, + D3D11_TEXTURECUBE_FACE_NEGATIVE_Y = 3, + D3D11_TEXTURECUBE_FACE_POSITIVE_Z = 4, + D3D11_TEXTURECUBE_FACE_NEGATIVE_Z = 5 + } D3D11_TEXTURECUBE_FACE; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0009_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0009_v0_0_s_ifspec; + +#ifndef __ID3D11View_INTERFACE_DEFINED__ +#define __ID3D11View_INTERFACE_DEFINED__ + +/* interface ID3D11View */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11View; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("839d1216-bb2e-412b-b7f4-a9dbebe08ed1") + ID3D11View : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetResource( + /* [annotation] */ + __out ID3D11Resource **ppResource) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11ViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11View * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11View * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11View * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11View * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D11View * This, + /* [annotation] */ + __out ID3D11Resource **ppResource); + + END_INTERFACE + } ID3D11ViewVtbl; + + interface ID3D11View + { + CONST_VTBL struct ID3D11ViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11View_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11View_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11View_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11View_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11View_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11View_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11View_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11View_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11View_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0010 */ +/* [local] */ + +typedef struct D3D11_BUFFER_SRV + { + union + { + UINT FirstElement; + UINT ElementOffset; + } ; + union + { + UINT NumElements; + UINT ElementWidth; + } ; + } D3D11_BUFFER_SRV; + +typedef +enum D3D11_BUFFEREX_SRV_FLAG + { D3D11_BUFFEREX_SRV_FLAG_RAW = 0x1 + } D3D11_BUFFEREX_SRV_FLAG; + +typedef struct D3D11_BUFFEREX_SRV + { + UINT FirstElement; + UINT NumElements; + UINT Flags; + } D3D11_BUFFEREX_SRV; + +typedef struct D3D11_TEX1D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D11_TEX1D_SRV; + +typedef struct D3D11_TEX1D_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX1D_ARRAY_SRV; + +typedef struct D3D11_TEX2D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D11_TEX2D_SRV; + +typedef struct D3D11_TEX2D_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2D_ARRAY_SRV; + +typedef struct D3D11_TEX3D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D11_TEX3D_SRV; + +typedef struct D3D11_TEXCUBE_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D11_TEXCUBE_SRV; + +typedef struct D3D11_TEXCUBE_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT First2DArrayFace; + UINT NumCubes; + } D3D11_TEXCUBE_ARRAY_SRV; + +typedef struct D3D11_TEX2DMS_SRV + { + UINT UnusedField_NothingToDefine; + } D3D11_TEX2DMS_SRV; + +typedef struct D3D11_TEX2DMS_ARRAY_SRV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2DMS_ARRAY_SRV; + +typedef struct D3D11_SHADER_RESOURCE_VIEW_DESC + { + DXGI_FORMAT Format; + D3D11_SRV_DIMENSION ViewDimension; + union + { + D3D11_BUFFER_SRV Buffer; + D3D11_TEX1D_SRV Texture1D; + D3D11_TEX1D_ARRAY_SRV Texture1DArray; + D3D11_TEX2D_SRV Texture2D; + D3D11_TEX2D_ARRAY_SRV Texture2DArray; + D3D11_TEX2DMS_SRV Texture2DMS; + D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray; + D3D11_TEX3D_SRV Texture3D; + D3D11_TEXCUBE_SRV TextureCube; + D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray; + D3D11_BUFFEREX_SRV BufferEx; + } ; + } D3D11_SHADER_RESOURCE_VIEW_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_SHADER_RESOURCE_VIEW_DESC : public D3D11_SHADER_RESOURCE_VIEW_DESC +{ + CD3D11_SHADER_RESOURCE_VIEW_DESC() + {} + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( const D3D11_SHADER_RESOURCE_VIEW_DESC& o ) : + D3D11_SHADER_RESOURCE_VIEW_DESC( o ) + {} + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( + D3D11_SRV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mostDetailedMip = 0, // FirstElement for BUFFER + UINT mipLevels = -1, // NumElements for BUFFER + UINT firstArraySlice = 0, // First2DArrayFace for TEXTURECUBEARRAY + UINT arraySize = -1, // NumCubes for TEXTURECUBEARRAY + UINT flags = 0 ) // BUFFEREX only + { + Format = format; + ViewDimension = viewDimension; + switch (viewDimension) + { + case D3D11_SRV_DIMENSION_BUFFER: + Buffer.FirstElement = mostDetailedMip; + Buffer.NumElements = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURE1D: + Texture1D.MostDetailedMip = mostDetailedMip; + Texture1D.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MostDetailedMip = mostDetailedMip; + Texture1DArray.MipLevels = mipLevels; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + case D3D11_SRV_DIMENSION_TEXTURE2D: + Texture2D.MostDetailedMip = mostDetailedMip; + Texture2D.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MostDetailedMip = mostDetailedMip; + Texture2DArray.MipLevels = mipLevels; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_SRV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + case D3D11_SRV_DIMENSION_TEXTURE3D: + Texture3D.MostDetailedMip = mostDetailedMip; + Texture3D.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURECUBE: + TextureCube.MostDetailedMip = mostDetailedMip; + TextureCube.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY: + TextureCubeArray.MostDetailedMip = mostDetailedMip; + TextureCubeArray.MipLevels = mipLevels; + TextureCubeArray.First2DArrayFace = firstArraySlice; + TextureCubeArray.NumCubes = arraySize; + break; + case D3D11_SRV_DIMENSION_BUFFEREX: + BufferEx.FirstElement = mostDetailedMip; + BufferEx.NumElements = mipLevels; + BufferEx.Flags = flags; + break; + default: break; + } + } + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( + __in ID3D11Buffer*, + DXGI_FORMAT format, + UINT firstElement, + UINT numElements, + UINT flags = 0 ) + { + Format = format; + ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX; + BufferEx.FirstElement = firstElement; + BufferEx.NumElements = numElements; + BufferEx.Flags = flags; + } + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( + __in ID3D11Texture1D* pTex1D, + D3D11_SRV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mostDetailedMip = 0, + UINT mipLevels = -1, + UINT firstArraySlice = 0, + UINT arraySize = -1 ) + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels || + (-1 == arraySize && D3D11_SRV_DIMENSION_TEXTURE1DARRAY == viewDimension)) + { + D3D11_TEXTURE1D_DESC TexDesc; + pTex1D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_SRV_DIMENSION_TEXTURE1D: + Texture1D.MostDetailedMip = mostDetailedMip; + Texture1D.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MostDetailedMip = mostDetailedMip; + Texture1DArray.MipLevels = mipLevels; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( + __in ID3D11Texture2D* pTex2D, + D3D11_SRV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mostDetailedMip = 0, + UINT mipLevels = -1, + UINT firstArraySlice = 0, // First2DArrayFace for TEXTURECUBEARRAY + UINT arraySize = -1 ) // NumCubes for TEXTURECUBEARRAY + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == mipLevels && + D3D11_SRV_DIMENSION_TEXTURE2DMS != viewDimension && + D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY != viewDimension) || + (-1 == arraySize && + (D3D11_SRV_DIMENSION_TEXTURE2DARRAY == viewDimension || + D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY == viewDimension || + D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension))) + { + D3D11_TEXTURE2D_DESC TexDesc; + pTex2D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip; + if (-1 == arraySize) + { + arraySize = TexDesc.ArraySize - firstArraySlice; + if (D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension) arraySize /= 6; + } + } + Format = format; + switch (viewDimension) + { + case D3D11_SRV_DIMENSION_TEXTURE2D: + Texture2D.MostDetailedMip = mostDetailedMip; + Texture2D.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MostDetailedMip = mostDetailedMip; + Texture2DArray.MipLevels = mipLevels; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_SRV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + case D3D11_SRV_DIMENSION_TEXTURECUBE: + TextureCube.MostDetailedMip = mostDetailedMip; + TextureCube.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY: + TextureCubeArray.MostDetailedMip = mostDetailedMip; + TextureCubeArray.MipLevels = mipLevels; + TextureCubeArray.First2DArrayFace = firstArraySlice; + TextureCubeArray.NumCubes = arraySize; + break; + default: break; + } + } + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( + __in ID3D11Texture3D* pTex3D, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mostDetailedMip = 0, + UINT mipLevels = -1 ) + { + ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D; + if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels) + { + D3D11_TEXTURE3D_DESC TexDesc; + pTex3D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip; + } + Format = format; + Texture3D.MostDetailedMip = mostDetailedMip; + Texture3D.MipLevels = mipLevels; + } + ~CD3D11_SHADER_RESOURCE_VIEW_DESC() {} + operator const D3D11_SHADER_RESOURCE_VIEW_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0010_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0010_v0_0_s_ifspec; + +#ifndef __ID3D11ShaderResourceView_INTERFACE_DEFINED__ +#define __ID3D11ShaderResourceView_INTERFACE_DEFINED__ + +/* interface ID3D11ShaderResourceView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11ShaderResourceView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("b0e06fe0-8192-4e1a-b1ca-36d7414710b2") + ID3D11ShaderResourceView : public ID3D11View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11ShaderResourceViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11ShaderResourceView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11ShaderResourceView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11ShaderResourceView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __out ID3D11Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __out D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D11ShaderResourceViewVtbl; + + interface ID3D11ShaderResourceView + { + CONST_VTBL struct ID3D11ShaderResourceViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11ShaderResourceView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11ShaderResourceView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11ShaderResourceView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11ShaderResourceView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11ShaderResourceView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11ShaderResourceView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11ShaderResourceView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11ShaderResourceView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D11ShaderResourceView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11ShaderResourceView_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0011 */ +/* [local] */ + +typedef struct D3D11_BUFFER_RTV + { + union + { + UINT FirstElement; + UINT ElementOffset; + } ; + union + { + UINT NumElements; + UINT ElementWidth; + } ; + } D3D11_BUFFER_RTV; + +typedef struct D3D11_TEX1D_RTV + { + UINT MipSlice; + } D3D11_TEX1D_RTV; + +typedef struct D3D11_TEX1D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX1D_ARRAY_RTV; + +typedef struct D3D11_TEX2D_RTV + { + UINT MipSlice; + } D3D11_TEX2D_RTV; + +typedef struct D3D11_TEX2DMS_RTV + { + UINT UnusedField_NothingToDefine; + } D3D11_TEX2DMS_RTV; + +typedef struct D3D11_TEX2D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2D_ARRAY_RTV; + +typedef struct D3D11_TEX2DMS_ARRAY_RTV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2DMS_ARRAY_RTV; + +typedef struct D3D11_TEX3D_RTV + { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; + } D3D11_TEX3D_RTV; + +typedef struct D3D11_RENDER_TARGET_VIEW_DESC + { + DXGI_FORMAT Format; + D3D11_RTV_DIMENSION ViewDimension; + union + { + D3D11_BUFFER_RTV Buffer; + D3D11_TEX1D_RTV Texture1D; + D3D11_TEX1D_ARRAY_RTV Texture1DArray; + D3D11_TEX2D_RTV Texture2D; + D3D11_TEX2D_ARRAY_RTV Texture2DArray; + D3D11_TEX2DMS_RTV Texture2DMS; + D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray; + D3D11_TEX3D_RTV Texture3D; + } ; + } D3D11_RENDER_TARGET_VIEW_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_RENDER_TARGET_VIEW_DESC : public D3D11_RENDER_TARGET_VIEW_DESC +{ + CD3D11_RENDER_TARGET_VIEW_DESC() + {} + explicit CD3D11_RENDER_TARGET_VIEW_DESC( const D3D11_RENDER_TARGET_VIEW_DESC& o ) : + D3D11_RENDER_TARGET_VIEW_DESC( o ) + {} + explicit CD3D11_RENDER_TARGET_VIEW_DESC( + D3D11_RTV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, // FirstElement for BUFFER + UINT firstArraySlice = 0, // NumElements for BUFFER, FirstWSlice for TEXTURE3D + UINT arraySize = -1 ) // WSize for TEXTURE3D + { + Format = format; + ViewDimension = viewDimension; + switch (viewDimension) + { + case D3D11_RTV_DIMENSION_BUFFER: + Buffer.FirstElement = mipSlice; + Buffer.NumElements = firstArraySlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + case D3D11_RTV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + case D3D11_RTV_DIMENSION_TEXTURE3D: + Texture3D.MipSlice = mipSlice; + Texture3D.FirstWSlice = firstArraySlice; + Texture3D.WSize = arraySize; + break; + default: break; + } + } + explicit CD3D11_RENDER_TARGET_VIEW_DESC( + __in ID3D11Buffer*, + DXGI_FORMAT format, + UINT firstElement, + UINT numElements ) + { + Format = format; + ViewDimension = D3D11_RTV_DIMENSION_BUFFER; + Buffer.FirstElement = firstElement; + Buffer.NumElements = numElements; + } + explicit CD3D11_RENDER_TARGET_VIEW_DESC( + __in ID3D11Texture1D* pTex1D, + D3D11_RTV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1 ) + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && D3D11_RTV_DIMENSION_TEXTURE1DARRAY == viewDimension)) + { + D3D11_TEXTURE1D_DESC TexDesc; + pTex1D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_RTV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_RENDER_TARGET_VIEW_DESC( + __in ID3D11Texture2D* pTex2D, + D3D11_RTV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1 ) + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && + (D3D11_RTV_DIMENSION_TEXTURE2DARRAY == viewDimension || + D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY == viewDimension))) + { + D3D11_TEXTURE2D_DESC TexDesc; + pTex2D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_RTV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_RENDER_TARGET_VIEW_DESC( + __in ID3D11Texture3D* pTex3D, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstWSlice = 0, + UINT wSize = -1 ) + { + ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D; + if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize) + { + D3D11_TEXTURE3D_DESC TexDesc; + pTex3D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == wSize) wSize = TexDesc.Depth - firstWSlice; + } + Format = format; + Texture3D.MipSlice = mipSlice; + Texture3D.FirstWSlice = firstWSlice; + Texture3D.WSize = wSize; + } + ~CD3D11_RENDER_TARGET_VIEW_DESC() {} + operator const D3D11_RENDER_TARGET_VIEW_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0011_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0011_v0_0_s_ifspec; + +#ifndef __ID3D11RenderTargetView_INTERFACE_DEFINED__ +#define __ID3D11RenderTargetView_INTERFACE_DEFINED__ + +/* interface ID3D11RenderTargetView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11RenderTargetView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("dfdba067-0b8d-4865-875b-d7b4516cc164") + ID3D11RenderTargetView : public ID3D11View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_RENDER_TARGET_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11RenderTargetViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11RenderTargetView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11RenderTargetView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11RenderTargetView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __out ID3D11Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __out D3D11_RENDER_TARGET_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D11RenderTargetViewVtbl; + + interface ID3D11RenderTargetView + { + CONST_VTBL struct ID3D11RenderTargetViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11RenderTargetView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11RenderTargetView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11RenderTargetView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11RenderTargetView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11RenderTargetView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11RenderTargetView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11RenderTargetView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11RenderTargetView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D11RenderTargetView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11RenderTargetView_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0012 */ +/* [local] */ + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_VIEWPORT : public D3D11_VIEWPORT +{ + CD3D11_VIEWPORT() + {} + explicit CD3D11_VIEWPORT( const D3D11_VIEWPORT& o ) : + D3D11_VIEWPORT( o ) + {} + explicit CD3D11_VIEWPORT( + FLOAT topLeftX, + FLOAT topLeftY, + FLOAT width, + FLOAT height, + FLOAT minDepth = D3D11_MIN_DEPTH, + FLOAT maxDepth = D3D11_MAX_DEPTH ) + { + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = width; + Height = height; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3D11_VIEWPORT( + __in ID3D11Buffer*, + __in ID3D11RenderTargetView* pRTView, + FLOAT topLeftX = 0.0f, + FLOAT minDepth = D3D11_MIN_DEPTH, + FLOAT maxDepth = D3D11_MAX_DEPTH ) + { + D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; + pRTView->GetDesc( &RTVDesc ); + UINT NumElements = 0; + switch (RTVDesc.ViewDimension) + { + case D3D11_RTV_DIMENSION_BUFFER: + NumElements = RTVDesc.Buffer.NumElements; + break; + default: break; + } + TopLeftX = topLeftX; + TopLeftY = 0.0f; + Width = NumElements - topLeftX; + Height = 1.0f; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3D11_VIEWPORT( + __in ID3D11Texture1D* pTex1D, + __in ID3D11RenderTargetView* pRTView, + FLOAT topLeftX = 0.0f, + FLOAT minDepth = D3D11_MIN_DEPTH, + FLOAT maxDepth = D3D11_MAX_DEPTH ) + { + D3D11_TEXTURE1D_DESC TexDesc; + pTex1D->GetDesc( &TexDesc ); + D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; + pRTView->GetDesc( &RTVDesc ); + UINT MipSlice = 0; + switch (RTVDesc.ViewDimension) + { + case D3D11_RTV_DIMENSION_TEXTURE1D: + MipSlice = RTVDesc.Texture1D.MipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE1DARRAY: + MipSlice = RTVDesc.Texture1DArray.MipSlice; + break; + default: break; + } + const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice); + TopLeftX = topLeftX; + TopLeftY = 0.0f; + Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX; + Height = 1.0f; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3D11_VIEWPORT( + __in ID3D11Texture2D* pTex2D, + __in ID3D11RenderTargetView* pRTView, + FLOAT topLeftX = 0.0f, + FLOAT topLeftY = 0.0f, + FLOAT minDepth = D3D11_MIN_DEPTH, + FLOAT maxDepth = D3D11_MAX_DEPTH ) + { + D3D11_TEXTURE2D_DESC TexDesc; + pTex2D->GetDesc( &TexDesc ); + D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; + pRTView->GetDesc( &RTVDesc ); + UINT MipSlice = 0; + switch (RTVDesc.ViewDimension) + { + case D3D11_RTV_DIMENSION_TEXTURE2D: + MipSlice = RTVDesc.Texture2D.MipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: + MipSlice = RTVDesc.Texture2DArray.MipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DMS: + case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY: + break; + default: break; + } + const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice); + const UINT SubResourceHeight = TexDesc.Height / (UINT( 1 ) << MipSlice); + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX; + Height = (SubResourceHeight ? SubResourceHeight : 1) - topLeftY; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3D11_VIEWPORT( + __in ID3D11Texture3D* pTex3D, + __in ID3D11RenderTargetView* pRTView, + FLOAT topLeftX = 0.0f, + FLOAT topLeftY = 0.0f, + FLOAT minDepth = D3D11_MIN_DEPTH, + FLOAT maxDepth = D3D11_MAX_DEPTH ) + { + D3D11_TEXTURE3D_DESC TexDesc; + pTex3D->GetDesc( &TexDesc ); + D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; + pRTView->GetDesc( &RTVDesc ); + UINT MipSlice = 0; + switch (RTVDesc.ViewDimension) + { + case D3D11_RTV_DIMENSION_TEXTURE3D: + MipSlice = RTVDesc.Texture3D.MipSlice; + break; + default: break; + } + const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice); + const UINT SubResourceHeight = TexDesc.Height / (UINT( 1 ) << MipSlice); + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX; + Height = (SubResourceHeight ? SubResourceHeight : 1) - topLeftY; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + ~CD3D11_VIEWPORT() {} + operator const D3D11_VIEWPORT&() const { return *this; } +}; +extern "C"{ +#endif +typedef struct D3D11_TEX1D_DSV + { + UINT MipSlice; + } D3D11_TEX1D_DSV; + +typedef struct D3D11_TEX1D_ARRAY_DSV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX1D_ARRAY_DSV; + +typedef struct D3D11_TEX2D_DSV + { + UINT MipSlice; + } D3D11_TEX2D_DSV; + +typedef struct D3D11_TEX2D_ARRAY_DSV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2D_ARRAY_DSV; + +typedef struct D3D11_TEX2DMS_DSV + { + UINT UnusedField_NothingToDefine; + } D3D11_TEX2DMS_DSV; + +typedef struct D3D11_TEX2DMS_ARRAY_DSV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2DMS_ARRAY_DSV; + +typedef +enum D3D11_DSV_FLAG + { D3D11_DSV_READ_ONLY_DEPTH = 0x1L, + D3D11_DSV_READ_ONLY_STENCIL = 0x2L + } D3D11_DSV_FLAG; + +typedef struct D3D11_DEPTH_STENCIL_VIEW_DESC + { + DXGI_FORMAT Format; + D3D11_DSV_DIMENSION ViewDimension; + UINT Flags; + union + { + D3D11_TEX1D_DSV Texture1D; + D3D11_TEX1D_ARRAY_DSV Texture1DArray; + D3D11_TEX2D_DSV Texture2D; + D3D11_TEX2D_ARRAY_DSV Texture2DArray; + D3D11_TEX2DMS_DSV Texture2DMS; + D3D11_TEX2DMS_ARRAY_DSV Texture2DMSArray; + } ; + } D3D11_DEPTH_STENCIL_VIEW_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_DEPTH_STENCIL_VIEW_DESC : public D3D11_DEPTH_STENCIL_VIEW_DESC +{ + CD3D11_DEPTH_STENCIL_VIEW_DESC() + {} + explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( const D3D11_DEPTH_STENCIL_VIEW_DESC& o ) : + D3D11_DEPTH_STENCIL_VIEW_DESC( o ) + {} + explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( + D3D11_DSV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1, + UINT flags = 0 ) + { + Format = format; + ViewDimension = viewDimension; + Flags = flags; + switch (viewDimension) + { + case D3D11_DSV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_DSV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + case D3D11_DSV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_DSV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_DSV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( + __in ID3D11Texture1D* pTex1D, + D3D11_DSV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1, + UINT flags = 0 ) + { + ViewDimension = viewDimension; + Flags = flags; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && D3D11_DSV_DIMENSION_TEXTURE1DARRAY == viewDimension)) + { + D3D11_TEXTURE1D_DESC TexDesc; + pTex1D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_DSV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_DSV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( + __in ID3D11Texture2D* pTex2D, + D3D11_DSV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1, + UINT flags = 0 ) + { + ViewDimension = viewDimension; + Flags = flags; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && + (D3D11_DSV_DIMENSION_TEXTURE2DARRAY == viewDimension || + D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY == viewDimension))) + { + D3D11_TEXTURE2D_DESC TexDesc; + pTex2D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_DSV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_DSV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_DSV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + default: break; + } + } + ~CD3D11_DEPTH_STENCIL_VIEW_DESC() {} + operator const D3D11_DEPTH_STENCIL_VIEW_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0012_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0012_v0_0_s_ifspec; + +#ifndef __ID3D11DepthStencilView_INTERFACE_DEFINED__ +#define __ID3D11DepthStencilView_INTERFACE_DEFINED__ + +/* interface ID3D11DepthStencilView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11DepthStencilView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9fdac92a-1876-48c3-afad-25b94f84a9b6") + ID3D11DepthStencilView : public ID3D11View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DepthStencilViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11DepthStencilView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11DepthStencilView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11DepthStencilView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __out ID3D11Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __out D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D11DepthStencilViewVtbl; + + interface ID3D11DepthStencilView + { + CONST_VTBL struct ID3D11DepthStencilViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11DepthStencilView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11DepthStencilView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11DepthStencilView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11DepthStencilView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11DepthStencilView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11DepthStencilView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11DepthStencilView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11DepthStencilView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D11DepthStencilView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11DepthStencilView_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0013 */ +/* [local] */ + +typedef +enum D3D11_BUFFER_UAV_FLAG + { D3D11_BUFFER_UAV_FLAG_RAW = 0x1, + D3D11_BUFFER_UAV_FLAG_APPEND = 0x2, + D3D11_BUFFER_UAV_FLAG_COUNTER = 0x4 + } D3D11_BUFFER_UAV_FLAG; + +typedef struct D3D11_BUFFER_UAV + { + UINT FirstElement; + UINT NumElements; + UINT Flags; + } D3D11_BUFFER_UAV; + +typedef struct D3D11_TEX1D_UAV + { + UINT MipSlice; + } D3D11_TEX1D_UAV; + +typedef struct D3D11_TEX1D_ARRAY_UAV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX1D_ARRAY_UAV; + +typedef struct D3D11_TEX2D_UAV + { + UINT MipSlice; + } D3D11_TEX2D_UAV; + +typedef struct D3D11_TEX2D_ARRAY_UAV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2D_ARRAY_UAV; + +typedef struct D3D11_TEX3D_UAV + { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; + } D3D11_TEX3D_UAV; + +typedef struct D3D11_UNORDERED_ACCESS_VIEW_DESC + { + DXGI_FORMAT Format; + D3D11_UAV_DIMENSION ViewDimension; + union + { + D3D11_BUFFER_UAV Buffer; + D3D11_TEX1D_UAV Texture1D; + D3D11_TEX1D_ARRAY_UAV Texture1DArray; + D3D11_TEX2D_UAV Texture2D; + D3D11_TEX2D_ARRAY_UAV Texture2DArray; + D3D11_TEX3D_UAV Texture3D; + } ; + } D3D11_UNORDERED_ACCESS_VIEW_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_UNORDERED_ACCESS_VIEW_DESC : public D3D11_UNORDERED_ACCESS_VIEW_DESC +{ + CD3D11_UNORDERED_ACCESS_VIEW_DESC() + {} + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( const D3D11_UNORDERED_ACCESS_VIEW_DESC& o ) : + D3D11_UNORDERED_ACCESS_VIEW_DESC( o ) + {} + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( + D3D11_UAV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, // FirstElement for BUFFER + UINT firstArraySlice = 0, // NumElements for BUFFER, FirstWSlice for TEXTURE3D + UINT arraySize = -1, // WSize for TEXTURE3D + UINT flags = 0 ) // BUFFER only + { + Format = format; + ViewDimension = viewDimension; + switch (viewDimension) + { + case D3D11_UAV_DIMENSION_BUFFER: + Buffer.FirstElement = mipSlice; + Buffer.NumElements = firstArraySlice; + Buffer.Flags = flags; + break; + case D3D11_UAV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_UAV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + case D3D11_UAV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_UAV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_UAV_DIMENSION_TEXTURE3D: + Texture3D.MipSlice = mipSlice; + Texture3D.FirstWSlice = firstArraySlice; + Texture3D.WSize = arraySize; + break; + default: break; + } + } + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( + __in ID3D11Buffer*, + DXGI_FORMAT format, + UINT firstElement, + UINT numElements, + UINT flags = 0 ) + { + Format = format; + ViewDimension = D3D11_UAV_DIMENSION_BUFFER; + Buffer.FirstElement = firstElement; + Buffer.NumElements = numElements; + Buffer.Flags = flags; + } + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( + __in ID3D11Texture1D* pTex1D, + D3D11_UAV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1 ) + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE1DARRAY == viewDimension)) + { + D3D11_TEXTURE1D_DESC TexDesc; + pTex1D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_UAV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_UAV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( + __in ID3D11Texture2D* pTex2D, + D3D11_UAV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1 ) + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE2DARRAY == viewDimension)) + { + D3D11_TEXTURE2D_DESC TexDesc; + pTex2D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_UAV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_UAV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( + __in ID3D11Texture3D* pTex3D, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstWSlice = 0, + UINT wSize = -1 ) + { + ViewDimension = D3D11_UAV_DIMENSION_TEXTURE3D; + if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize) + { + D3D11_TEXTURE3D_DESC TexDesc; + pTex3D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == wSize) wSize = TexDesc.Depth - firstWSlice; + } + Format = format; + Texture3D.MipSlice = mipSlice; + Texture3D.FirstWSlice = firstWSlice; + Texture3D.WSize = wSize; + } + ~CD3D11_UNORDERED_ACCESS_VIEW_DESC() {} + operator const D3D11_UNORDERED_ACCESS_VIEW_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0013_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0013_v0_0_s_ifspec; + +#ifndef __ID3D11UnorderedAccessView_INTERFACE_DEFINED__ +#define __ID3D11UnorderedAccessView_INTERFACE_DEFINED__ + +/* interface ID3D11UnorderedAccessView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11UnorderedAccessView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("28acf509-7f5c-48f6-8611-f316010a6380") + ID3D11UnorderedAccessView : public ID3D11View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11UnorderedAccessViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11UnorderedAccessView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11UnorderedAccessView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11UnorderedAccessView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __out ID3D11Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __out D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D11UnorderedAccessViewVtbl; + + interface ID3D11UnorderedAccessView + { + CONST_VTBL struct ID3D11UnorderedAccessViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11UnorderedAccessView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11UnorderedAccessView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11UnorderedAccessView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11UnorderedAccessView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11UnorderedAccessView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11UnorderedAccessView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11UnorderedAccessView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11UnorderedAccessView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D11UnorderedAccessView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11UnorderedAccessView_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11VertexShader_INTERFACE_DEFINED__ +#define __ID3D11VertexShader_INTERFACE_DEFINED__ + +/* interface ID3D11VertexShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11VertexShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3b301d64-d678-4289-8897-22f8928b72f3") + ID3D11VertexShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11VertexShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11VertexShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11VertexShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11VertexShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11VertexShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11VertexShaderVtbl; + + interface ID3D11VertexShader + { + CONST_VTBL struct ID3D11VertexShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11VertexShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11VertexShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11VertexShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11VertexShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11VertexShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11VertexShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11VertexShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11VertexShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11HullShader_INTERFACE_DEFINED__ +#define __ID3D11HullShader_INTERFACE_DEFINED__ + +/* interface ID3D11HullShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11HullShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8e5c6061-628a-4c8e-8264-bbe45cb3d5dd") + ID3D11HullShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11HullShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11HullShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11HullShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11HullShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11HullShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11HullShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11HullShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11HullShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11HullShaderVtbl; + + interface ID3D11HullShader + { + CONST_VTBL struct ID3D11HullShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11HullShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11HullShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11HullShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11HullShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11HullShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11HullShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11HullShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11HullShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11DomainShader_INTERFACE_DEFINED__ +#define __ID3D11DomainShader_INTERFACE_DEFINED__ + +/* interface ID3D11DomainShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11DomainShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("f582c508-0f36-490c-9977-31eece268cfa") + ID3D11DomainShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11DomainShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11DomainShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11DomainShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11DomainShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11DomainShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11DomainShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11DomainShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11DomainShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11DomainShaderVtbl; + + interface ID3D11DomainShader + { + CONST_VTBL struct ID3D11DomainShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11DomainShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11DomainShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11DomainShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11DomainShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11DomainShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11DomainShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11DomainShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11DomainShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11GeometryShader_INTERFACE_DEFINED__ +#define __ID3D11GeometryShader_INTERFACE_DEFINED__ + +/* interface ID3D11GeometryShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11GeometryShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("38325b96-effb-4022-ba02-2e795b70275c") + ID3D11GeometryShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11GeometryShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11GeometryShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11GeometryShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11GeometryShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11GeometryShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11GeometryShaderVtbl; + + interface ID3D11GeometryShader + { + CONST_VTBL struct ID3D11GeometryShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11GeometryShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11GeometryShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11GeometryShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11GeometryShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11GeometryShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11GeometryShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11GeometryShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11GeometryShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11PixelShader_INTERFACE_DEFINED__ +#define __ID3D11PixelShader_INTERFACE_DEFINED__ + +/* interface ID3D11PixelShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11PixelShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ea82e40d-51dc-4f33-93d4-db7c9125ae8c") + ID3D11PixelShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11PixelShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11PixelShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11PixelShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11PixelShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11PixelShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11PixelShaderVtbl; + + interface ID3D11PixelShader + { + CONST_VTBL struct ID3D11PixelShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11PixelShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11PixelShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11PixelShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11PixelShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11PixelShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11PixelShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11PixelShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11PixelShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11ComputeShader_INTERFACE_DEFINED__ +#define __ID3D11ComputeShader_INTERFACE_DEFINED__ + +/* interface ID3D11ComputeShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11ComputeShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4f5b196e-c2bd-495e-bd01-1fded38e4969") + ID3D11ComputeShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11ComputeShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11ComputeShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11ComputeShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11ComputeShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11ComputeShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11ComputeShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11ComputeShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11ComputeShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11ComputeShaderVtbl; + + interface ID3D11ComputeShader + { + CONST_VTBL struct ID3D11ComputeShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11ComputeShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11ComputeShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11ComputeShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11ComputeShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11ComputeShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11ComputeShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11ComputeShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11ComputeShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11InputLayout_INTERFACE_DEFINED__ +#define __ID3D11InputLayout_INTERFACE_DEFINED__ + +/* interface ID3D11InputLayout */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11InputLayout; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e4819ddc-4cf0-4025-bd26-5de82a3e07b7") + ID3D11InputLayout : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11InputLayoutVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11InputLayout * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11InputLayout * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11InputLayout * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11InputLayout * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11InputLayoutVtbl; + + interface ID3D11InputLayout + { + CONST_VTBL struct ID3D11InputLayoutVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11InputLayout_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11InputLayout_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11InputLayout_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11InputLayout_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11InputLayout_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11InputLayout_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11InputLayout_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11InputLayout_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0021 */ +/* [local] */ + +typedef +enum D3D11_FILTER + { D3D11_FILTER_MIN_MAG_MIP_POINT = 0, + D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1, + D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4, + D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5, + D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, + D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, + D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, + D3D11_FILTER_MIN_MAG_MIP_LINEAR = 0x15, + D3D11_FILTER_ANISOTROPIC = 0x55, + D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, + D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, + D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84, + D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85, + D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90, + D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91, + D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94, + D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95, + D3D11_FILTER_COMPARISON_ANISOTROPIC = 0xd5 + } D3D11_FILTER; + +typedef +enum D3D11_FILTER_TYPE + { D3D11_FILTER_TYPE_POINT = 0, + D3D11_FILTER_TYPE_LINEAR = 1 + } D3D11_FILTER_TYPE; + +#define D3D11_FILTER_TYPE_MASK ( 0x3 ) + +#define D3D11_MIN_FILTER_SHIFT ( 4 ) + +#define D3D11_MAG_FILTER_SHIFT ( 2 ) + +#define D3D11_MIP_FILTER_SHIFT ( 0 ) + +#define D3D11_COMPARISON_FILTERING_BIT ( 0x80 ) + +#define D3D11_ANISOTROPIC_FILTERING_BIT ( 0x40 ) + +#define D3D11_ENCODE_BASIC_FILTER( min, mag, mip, bComparison ) \ + ( ( D3D11_FILTER ) ( \ + ( ( bComparison ) ? D3D11_COMPARISON_FILTERING_BIT : 0 ) | \ + ( ( ( min ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MIN_FILTER_SHIFT ) | \ + ( ( ( mag ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MAG_FILTER_SHIFT ) | \ + ( ( ( mip ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MIP_FILTER_SHIFT ) ) ) +#define D3D11_ENCODE_ANISOTROPIC_FILTER( bComparison ) \ + ( ( D3D11_FILTER ) ( \ + D3D11_ANISOTROPIC_FILTERING_BIT | \ + D3D11_ENCODE_BASIC_FILTER( D3D11_FILTER_TYPE_LINEAR, \ + D3D11_FILTER_TYPE_LINEAR, \ + D3D11_FILTER_TYPE_LINEAR, \ + bComparison ) ) ) +#define D3D11_DECODE_MIN_FILTER( d3d11Filter ) \ + ( ( D3D11_FILTER_TYPE ) \ + ( ( ( d3d11Filter ) >> D3D11_MIN_FILTER_SHIFT ) & D3D11_FILTER_TYPE_MASK ) ) +#define D3D11_DECODE_MAG_FILTER( d3d11Filter ) \ + ( ( D3D11_FILTER_TYPE ) \ + ( ( ( d3d11Filter ) >> D3D11_MAG_FILTER_SHIFT ) & D3D11_FILTER_TYPE_MASK ) ) +#define D3D11_DECODE_MIP_FILTER( d3d11Filter ) \ + ( ( D3D11_FILTER_TYPE ) \ + ( ( ( d3d11Filter ) >> D3D11_MIP_FILTER_SHIFT ) & D3D11_FILTER_TYPE_MASK ) ) +#define D3D11_DECODE_IS_COMPARISON_FILTER( d3d11Filter ) \ + ( ( d3d11Filter ) & D3D11_COMPARISON_FILTERING_BIT ) +#define D3D11_DECODE_IS_ANISOTROPIC_FILTER( d3d11Filter ) \ + ( ( ( d3d11Filter ) & D3D11_ANISOTROPIC_FILTERING_BIT ) && \ + ( D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIN_FILTER( d3d11Filter ) ) && \ + ( D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MAG_FILTER( d3d11Filter ) ) && \ + ( D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIP_FILTER( d3d11Filter ) ) ) +typedef +enum D3D11_TEXTURE_ADDRESS_MODE + { D3D11_TEXTURE_ADDRESS_WRAP = 1, + D3D11_TEXTURE_ADDRESS_MIRROR = 2, + D3D11_TEXTURE_ADDRESS_CLAMP = 3, + D3D11_TEXTURE_ADDRESS_BORDER = 4, + D3D11_TEXTURE_ADDRESS_MIRROR_ONCE = 5 + } D3D11_TEXTURE_ADDRESS_MODE; + +typedef struct D3D11_SAMPLER_DESC + { + D3D11_FILTER Filter; + D3D11_TEXTURE_ADDRESS_MODE AddressU; + D3D11_TEXTURE_ADDRESS_MODE AddressV; + D3D11_TEXTURE_ADDRESS_MODE AddressW; + FLOAT MipLODBias; + UINT MaxAnisotropy; + D3D11_COMPARISON_FUNC ComparisonFunc; + FLOAT BorderColor[ 4 ]; + FLOAT MinLOD; + FLOAT MaxLOD; + } D3D11_SAMPLER_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_SAMPLER_DESC : public D3D11_SAMPLER_DESC +{ + CD3D11_SAMPLER_DESC() + {} + explicit CD3D11_SAMPLER_DESC( const D3D11_SAMPLER_DESC& o ) : + D3D11_SAMPLER_DESC( o ) + {} + explicit CD3D11_SAMPLER_DESC( CD3D11_DEFAULT ) + { + Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; + AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; + AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; + AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; + MipLODBias = 0; + MaxAnisotropy = 1; + ComparisonFunc = D3D11_COMPARISON_NEVER; + BorderColor[ 0 ] = 1.0f; + BorderColor[ 1 ] = 1.0f; + BorderColor[ 2 ] = 1.0f; + BorderColor[ 3 ] = 1.0f; + MinLOD = -3.402823466e+38F; // -FLT_MAX + MaxLOD = 3.402823466e+38F; // FLT_MAX + } + explicit CD3D11_SAMPLER_DESC( + D3D11_FILTER filter, + D3D11_TEXTURE_ADDRESS_MODE addressU, + D3D11_TEXTURE_ADDRESS_MODE addressV, + D3D11_TEXTURE_ADDRESS_MODE addressW, + FLOAT mipLODBias, + UINT maxAnisotropy, + D3D11_COMPARISON_FUNC comparisonFunc, + __in_ecount_opt( 4 ) const FLOAT* borderColor, // RGBA + FLOAT minLOD, + FLOAT maxLOD ) + { + Filter = filter; + AddressU = addressU; + AddressV = addressV; + AddressW = addressW; + MipLODBias = mipLODBias; + MaxAnisotropy = maxAnisotropy; + ComparisonFunc = comparisonFunc; + const float defaultColor[ 4 ] = { 1.0f, 1.0f, 1.0f, 1.0f }; + if (!borderColor) borderColor = defaultColor; + BorderColor[ 0 ] = borderColor[ 0 ]; + BorderColor[ 1 ] = borderColor[ 1 ]; + BorderColor[ 2 ] = borderColor[ 2 ]; + BorderColor[ 3 ] = borderColor[ 3 ]; + MinLOD = minLOD; + MaxLOD = maxLOD; + } + ~CD3D11_SAMPLER_DESC() {} + operator const D3D11_SAMPLER_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0021_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0021_v0_0_s_ifspec; + +#ifndef __ID3D11SamplerState_INTERFACE_DEFINED__ +#define __ID3D11SamplerState_INTERFACE_DEFINED__ + +/* interface ID3D11SamplerState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11SamplerState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("da6fea51-564c-4487-9810-f0d0f9b4e3a5") + ID3D11SamplerState : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_SAMPLER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11SamplerStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11SamplerState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11SamplerState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11SamplerState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11SamplerState * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11SamplerState * This, + /* [annotation] */ + __out D3D11_SAMPLER_DESC *pDesc); + + END_INTERFACE + } ID3D11SamplerStateVtbl; + + interface ID3D11SamplerState + { + CONST_VTBL struct ID3D11SamplerStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11SamplerState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11SamplerState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11SamplerState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11SamplerState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11SamplerState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11SamplerState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11SamplerState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11SamplerState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11SamplerState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0022 */ +/* [local] */ + +typedef +enum D3D11_FORMAT_SUPPORT + { D3D11_FORMAT_SUPPORT_BUFFER = 0x1, + D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x2, + D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x4, + D3D11_FORMAT_SUPPORT_SO_BUFFER = 0x8, + D3D11_FORMAT_SUPPORT_TEXTURE1D = 0x10, + D3D11_FORMAT_SUPPORT_TEXTURE2D = 0x20, + D3D11_FORMAT_SUPPORT_TEXTURE3D = 0x40, + D3D11_FORMAT_SUPPORT_TEXTURECUBE = 0x80, + D3D11_FORMAT_SUPPORT_SHADER_LOAD = 0x100, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE = 0x200, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x400, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x800, + D3D11_FORMAT_SUPPORT_MIP = 0x1000, + D3D11_FORMAT_SUPPORT_MIP_AUTOGEN = 0x2000, + D3D11_FORMAT_SUPPORT_RENDER_TARGET = 0x4000, + D3D11_FORMAT_SUPPORT_BLENDABLE = 0x8000, + D3D11_FORMAT_SUPPORT_DEPTH_STENCIL = 0x10000, + D3D11_FORMAT_SUPPORT_CPU_LOCKABLE = 0x20000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x40000, + D3D11_FORMAT_SUPPORT_DISPLAY = 0x80000, + D3D11_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000, + D3D11_FORMAT_SUPPORT_SHADER_GATHER = 0x800000, + D3D11_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x1000000, + D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000, + D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON = 0x4000000 + } D3D11_FORMAT_SUPPORT; + +typedef +enum D3D11_FORMAT_SUPPORT2 + { D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20, + D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40, + D3D11_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80 + } D3D11_FORMAT_SUPPORT2; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0022_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0022_v0_0_s_ifspec; + +#ifndef __ID3D11Asynchronous_INTERFACE_DEFINED__ +#define __ID3D11Asynchronous_INTERFACE_DEFINED__ + +/* interface ID3D11Asynchronous */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Asynchronous; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4b35d0cd-1e15-4258-9c98-1b1333f6dd3b") + ID3D11Asynchronous : public ID3D11DeviceChild + { + public: + virtual UINT STDMETHODCALLTYPE GetDataSize( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11AsynchronousVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Asynchronous * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Asynchronous * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Asynchronous * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Asynchronous * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D11Asynchronous * This); + + END_INTERFACE + } ID3D11AsynchronousVtbl; + + interface ID3D11Asynchronous + { + CONST_VTBL struct ID3D11AsynchronousVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Asynchronous_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Asynchronous_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Asynchronous_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Asynchronous_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Asynchronous_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Asynchronous_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Asynchronous_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Asynchronous_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Asynchronous_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0023 */ +/* [local] */ + +typedef +enum D3D11_ASYNC_GETDATA_FLAG + { D3D11_ASYNC_GETDATA_DONOTFLUSH = 0x1 + } D3D11_ASYNC_GETDATA_FLAG; + +typedef +enum D3D11_QUERY + { D3D11_QUERY_EVENT = 0, + D3D11_QUERY_OCCLUSION = ( D3D11_QUERY_EVENT + 1 ) , + D3D11_QUERY_TIMESTAMP = ( D3D11_QUERY_OCCLUSION + 1 ) , + D3D11_QUERY_TIMESTAMP_DISJOINT = ( D3D11_QUERY_TIMESTAMP + 1 ) , + D3D11_QUERY_PIPELINE_STATISTICS = ( D3D11_QUERY_TIMESTAMP_DISJOINT + 1 ) , + D3D11_QUERY_OCCLUSION_PREDICATE = ( D3D11_QUERY_PIPELINE_STATISTICS + 1 ) , + D3D11_QUERY_SO_STATISTICS = ( D3D11_QUERY_OCCLUSION_PREDICATE + 1 ) , + D3D11_QUERY_SO_OVERFLOW_PREDICATE = ( D3D11_QUERY_SO_STATISTICS + 1 ) , + D3D11_QUERY_SO_STATISTICS_STREAM0 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE + 1 ) , + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 = ( D3D11_QUERY_SO_STATISTICS_STREAM0 + 1 ) , + D3D11_QUERY_SO_STATISTICS_STREAM1 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 + 1 ) , + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 = ( D3D11_QUERY_SO_STATISTICS_STREAM1 + 1 ) , + D3D11_QUERY_SO_STATISTICS_STREAM2 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 + 1 ) , + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 = ( D3D11_QUERY_SO_STATISTICS_STREAM2 + 1 ) , + D3D11_QUERY_SO_STATISTICS_STREAM3 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 + 1 ) , + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3 = ( D3D11_QUERY_SO_STATISTICS_STREAM3 + 1 ) + } D3D11_QUERY; + +typedef +enum D3D11_QUERY_MISC_FLAG + { D3D11_QUERY_MISC_PREDICATEHINT = 0x1 + } D3D11_QUERY_MISC_FLAG; + +typedef struct D3D11_QUERY_DESC + { + D3D11_QUERY Query; + UINT MiscFlags; + } D3D11_QUERY_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_QUERY_DESC : public D3D11_QUERY_DESC +{ + CD3D11_QUERY_DESC() + {} + explicit CD3D11_QUERY_DESC( const D3D11_QUERY_DESC& o ) : + D3D11_QUERY_DESC( o ) + {} + explicit CD3D11_QUERY_DESC( + D3D11_QUERY query, + UINT miscFlags = 0 ) + { + Query = query; + MiscFlags = miscFlags; + } + ~CD3D11_QUERY_DESC() {} + operator const D3D11_QUERY_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0023_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0023_v0_0_s_ifspec; + +#ifndef __ID3D11Query_INTERFACE_DEFINED__ +#define __ID3D11Query_INTERFACE_DEFINED__ + +/* interface ID3D11Query */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Query; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("d6c00747-87b7-425e-b84d-44d108560afd") + ID3D11Query : public ID3D11Asynchronous + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_QUERY_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11QueryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Query * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Query * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Query * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Query * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D11Query * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Query * This, + /* [annotation] */ + __out D3D11_QUERY_DESC *pDesc); + + END_INTERFACE + } ID3D11QueryVtbl; + + interface ID3D11Query + { + CONST_VTBL struct ID3D11QueryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Query_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Query_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Query_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Query_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Query_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Query_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Query_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Query_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D11Query_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Query_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11Predicate_INTERFACE_DEFINED__ +#define __ID3D11Predicate_INTERFACE_DEFINED__ + +/* interface ID3D11Predicate */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Predicate; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9eb576dd-9f77-4d86-81aa-8bab5fe490e2") + ID3D11Predicate : public ID3D11Query + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11PredicateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Predicate * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Predicate * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Predicate * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Predicate * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D11Predicate * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Predicate * This, + /* [annotation] */ + __out D3D11_QUERY_DESC *pDesc); + + END_INTERFACE + } ID3D11PredicateVtbl; + + interface ID3D11Predicate + { + CONST_VTBL struct ID3D11PredicateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Predicate_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Predicate_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Predicate_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Predicate_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Predicate_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Predicate_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Predicate_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Predicate_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D11Predicate_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Predicate_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0025 */ +/* [local] */ + +typedef struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT + { + UINT64 Frequency; + BOOL Disjoint; + } D3D11_QUERY_DATA_TIMESTAMP_DISJOINT; + +typedef struct D3D11_QUERY_DATA_PIPELINE_STATISTICS + { + UINT64 IAVertices; + UINT64 IAPrimitives; + UINT64 VSInvocations; + UINT64 GSInvocations; + UINT64 GSPrimitives; + UINT64 CInvocations; + UINT64 CPrimitives; + UINT64 PSInvocations; + UINT64 HSInvocations; + UINT64 DSInvocations; + UINT64 CSInvocations; + } D3D11_QUERY_DATA_PIPELINE_STATISTICS; + +typedef struct D3D11_QUERY_DATA_SO_STATISTICS + { + UINT64 NumPrimitivesWritten; + UINT64 PrimitivesStorageNeeded; + } D3D11_QUERY_DATA_SO_STATISTICS; + +typedef +enum D3D11_COUNTER + { D3D11_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000 + } D3D11_COUNTER; + +typedef +enum D3D11_COUNTER_TYPE + { D3D11_COUNTER_TYPE_FLOAT32 = 0, + D3D11_COUNTER_TYPE_UINT16 = ( D3D11_COUNTER_TYPE_FLOAT32 + 1 ) , + D3D11_COUNTER_TYPE_UINT32 = ( D3D11_COUNTER_TYPE_UINT16 + 1 ) , + D3D11_COUNTER_TYPE_UINT64 = ( D3D11_COUNTER_TYPE_UINT32 + 1 ) + } D3D11_COUNTER_TYPE; + +typedef struct D3D11_COUNTER_DESC + { + D3D11_COUNTER Counter; + UINT MiscFlags; + } D3D11_COUNTER_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_COUNTER_DESC : public D3D11_COUNTER_DESC +{ + CD3D11_COUNTER_DESC() + {} + explicit CD3D11_COUNTER_DESC( const D3D11_COUNTER_DESC& o ) : + D3D11_COUNTER_DESC( o ) + {} + explicit CD3D11_COUNTER_DESC( + D3D11_COUNTER counter, + UINT miscFlags = 0 ) + { + Counter = counter; + MiscFlags = miscFlags; + } + ~CD3D11_COUNTER_DESC() {} + operator const D3D11_COUNTER_DESC&() const { return *this; } +}; +extern "C"{ +#endif +typedef struct D3D11_COUNTER_INFO + { + D3D11_COUNTER LastDeviceDependentCounter; + UINT NumSimultaneousCounters; + UINT8 NumDetectableParallelUnits; + } D3D11_COUNTER_INFO; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0025_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0025_v0_0_s_ifspec; + +#ifndef __ID3D11Counter_INTERFACE_DEFINED__ +#define __ID3D11Counter_INTERFACE_DEFINED__ + +/* interface ID3D11Counter */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Counter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6e8c49fb-a371-4770-b440-29086022b741") + ID3D11Counter : public ID3D11Asynchronous + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_COUNTER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11CounterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Counter * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Counter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Counter * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Counter * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D11Counter * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Counter * This, + /* [annotation] */ + __out D3D11_COUNTER_DESC *pDesc); + + END_INTERFACE + } ID3D11CounterVtbl; + + interface ID3D11Counter + { + CONST_VTBL struct ID3D11CounterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Counter_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Counter_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Counter_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Counter_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Counter_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Counter_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Counter_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Counter_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D11Counter_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Counter_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0026 */ +/* [local] */ + +typedef +enum D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS + { D3D11_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff, + D3D11_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe + } D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS; + +typedef +enum D3D11_DEVICE_CONTEXT_TYPE + { D3D11_DEVICE_CONTEXT_IMMEDIATE = 0, + D3D11_DEVICE_CONTEXT_DEFERRED = ( D3D11_DEVICE_CONTEXT_IMMEDIATE + 1 ) + } D3D11_DEVICE_CONTEXT_TYPE; + +typedef struct D3D11_CLASS_INSTANCE_DESC + { + UINT InstanceId; + UINT InstanceIndex; + UINT TypeId; + UINT ConstantBuffer; + UINT BaseConstantBufferOffset; + UINT BaseTexture; + UINT BaseSampler; + BOOL Created; + } D3D11_CLASS_INSTANCE_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0026_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0026_v0_0_s_ifspec; + +#ifndef __ID3D11ClassInstance_INTERFACE_DEFINED__ +#define __ID3D11ClassInstance_INTERFACE_DEFINED__ + +/* interface ID3D11ClassInstance */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11ClassInstance; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a6cd7faa-b0b7-4a2f-9436-8662a65797cb") + ID3D11ClassInstance : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetClassLinkage( + /* [annotation] */ + __out ID3D11ClassLinkage **ppLinkage) = 0; + + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_CLASS_INSTANCE_DESC *pDesc) = 0; + + virtual void STDMETHODCALLTYPE GetInstanceName( + /* [annotation] */ + __out_ecount_opt(*pBufferLength) LPSTR pInstanceName, + /* [annotation] */ + __inout SIZE_T *pBufferLength) = 0; + + virtual void STDMETHODCALLTYPE GetTypeName( + /* [annotation] */ + __out_ecount_opt(*pBufferLength) LPSTR pTypeName, + /* [annotation] */ + __inout SIZE_T *pBufferLength) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11ClassInstanceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11ClassInstance * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11ClassInstance * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11ClassInstance * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11ClassInstance * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11ClassInstance * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11ClassInstance * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11ClassInstance * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetClassLinkage )( + ID3D11ClassInstance * This, + /* [annotation] */ + __out ID3D11ClassLinkage **ppLinkage); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11ClassInstance * This, + /* [annotation] */ + __out D3D11_CLASS_INSTANCE_DESC *pDesc); + + void ( STDMETHODCALLTYPE *GetInstanceName )( + ID3D11ClassInstance * This, + /* [annotation] */ + __out_ecount_opt(*pBufferLength) LPSTR pInstanceName, + /* [annotation] */ + __inout SIZE_T *pBufferLength); + + void ( STDMETHODCALLTYPE *GetTypeName )( + ID3D11ClassInstance * This, + /* [annotation] */ + __out_ecount_opt(*pBufferLength) LPSTR pTypeName, + /* [annotation] */ + __inout SIZE_T *pBufferLength); + + END_INTERFACE + } ID3D11ClassInstanceVtbl; + + interface ID3D11ClassInstance + { + CONST_VTBL struct ID3D11ClassInstanceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11ClassInstance_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11ClassInstance_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11ClassInstance_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11ClassInstance_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11ClassInstance_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11ClassInstance_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11ClassInstance_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11ClassInstance_GetClassLinkage(This,ppLinkage) \ + ( (This)->lpVtbl -> GetClassLinkage(This,ppLinkage) ) + +#define ID3D11ClassInstance_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define ID3D11ClassInstance_GetInstanceName(This,pInstanceName,pBufferLength) \ + ( (This)->lpVtbl -> GetInstanceName(This,pInstanceName,pBufferLength) ) + +#define ID3D11ClassInstance_GetTypeName(This,pTypeName,pBufferLength) \ + ( (This)->lpVtbl -> GetTypeName(This,pTypeName,pBufferLength) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11ClassInstance_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11ClassLinkage_INTERFACE_DEFINED__ +#define __ID3D11ClassLinkage_INTERFACE_DEFINED__ + +/* interface ID3D11ClassLinkage */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11ClassLinkage; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ddf57cba-9543-46e4-a12b-f207a0fe7fed") + ID3D11ClassLinkage : public ID3D11DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE GetClassInstance( + /* [annotation] */ + __in LPCSTR pClassInstanceName, + /* [annotation] */ + __in UINT InstanceIndex, + /* [annotation] */ + __out ID3D11ClassInstance **ppInstance) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateClassInstance( + /* [annotation] */ + __in LPCSTR pClassTypeName, + /* [annotation] */ + __in UINT ConstantBufferOffset, + /* [annotation] */ + __in UINT ConstantVectorOffset, + /* [annotation] */ + __in UINT TextureOffset, + /* [annotation] */ + __in UINT SamplerOffset, + /* [annotation] */ + __out ID3D11ClassInstance **ppInstance) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11ClassLinkageVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11ClassLinkage * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11ClassLinkage * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11ClassLinkage * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + HRESULT ( STDMETHODCALLTYPE *GetClassInstance )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __in LPCSTR pClassInstanceName, + /* [annotation] */ + __in UINT InstanceIndex, + /* [annotation] */ + __out ID3D11ClassInstance **ppInstance); + + HRESULT ( STDMETHODCALLTYPE *CreateClassInstance )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __in LPCSTR pClassTypeName, + /* [annotation] */ + __in UINT ConstantBufferOffset, + /* [annotation] */ + __in UINT ConstantVectorOffset, + /* [annotation] */ + __in UINT TextureOffset, + /* [annotation] */ + __in UINT SamplerOffset, + /* [annotation] */ + __out ID3D11ClassInstance **ppInstance); + + END_INTERFACE + } ID3D11ClassLinkageVtbl; + + interface ID3D11ClassLinkage + { + CONST_VTBL struct ID3D11ClassLinkageVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11ClassLinkage_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11ClassLinkage_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11ClassLinkage_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11ClassLinkage_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11ClassLinkage_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11ClassLinkage_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11ClassLinkage_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11ClassLinkage_GetClassInstance(This,pClassInstanceName,InstanceIndex,ppInstance) \ + ( (This)->lpVtbl -> GetClassInstance(This,pClassInstanceName,InstanceIndex,ppInstance) ) + +#define ID3D11ClassLinkage_CreateClassInstance(This,pClassTypeName,ConstantBufferOffset,ConstantVectorOffset,TextureOffset,SamplerOffset,ppInstance) \ + ( (This)->lpVtbl -> CreateClassInstance(This,pClassTypeName,ConstantBufferOffset,ConstantVectorOffset,TextureOffset,SamplerOffset,ppInstance) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11ClassLinkage_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11CommandList_INTERFACE_DEFINED__ +#define __ID3D11CommandList_INTERFACE_DEFINED__ + +/* interface ID3D11CommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11CommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a24bc4d1-769e-43f7-8013-98ff566c18e2") + ID3D11CommandList : public ID3D11DeviceChild + { + public: + virtual UINT STDMETHODCALLTYPE GetContextFlags( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11CommandListVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11CommandList * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11CommandList * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11CommandList * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11CommandList * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11CommandList * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11CommandList * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11CommandList * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + UINT ( STDMETHODCALLTYPE *GetContextFlags )( + ID3D11CommandList * This); + + END_INTERFACE + } ID3D11CommandListVtbl; + + interface ID3D11CommandList + { + CONST_VTBL struct ID3D11CommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11CommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11CommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11CommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11CommandList_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11CommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11CommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11CommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11CommandList_GetContextFlags(This) \ + ( (This)->lpVtbl -> GetContextFlags(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11CommandList_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0029 */ +/* [local] */ + +typedef +enum D3D11_FEATURE + { D3D11_FEATURE_THREADING = 0, + D3D11_FEATURE_DOUBLES = ( D3D11_FEATURE_THREADING + 1 ) , + D3D11_FEATURE_FORMAT_SUPPORT = ( D3D11_FEATURE_DOUBLES + 1 ) , + D3D11_FEATURE_FORMAT_SUPPORT2 = ( D3D11_FEATURE_FORMAT_SUPPORT + 1 ) , + D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS = ( D3D11_FEATURE_FORMAT_SUPPORT2 + 1 ) + } D3D11_FEATURE; + +typedef struct D3D11_FEATURE_DATA_THREADING + { + BOOL DriverConcurrentCreates; + BOOL DriverCommandLists; + } D3D11_FEATURE_DATA_THREADING; + +typedef struct D3D11_FEATURE_DATA_DOUBLES + { + BOOL DoublePrecisionFloatShaderOps; + } D3D11_FEATURE_DATA_DOUBLES; + +typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT + { + DXGI_FORMAT InFormat; + UINT OutFormatSupport; + } D3D11_FEATURE_DATA_FORMAT_SUPPORT; + +typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT2 + { + DXGI_FORMAT InFormat; + UINT OutFormatSupport2; + } D3D11_FEATURE_DATA_FORMAT_SUPPORT2; + +typedef struct D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS + { + BOOL ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x; + } D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0029_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0029_v0_0_s_ifspec; + +#ifndef __ID3D11DeviceContext_INTERFACE_DEFINED__ +#define __ID3D11DeviceContext_INTERFACE_DEFINED__ + +/* interface ID3D11DeviceContext */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11DeviceContext; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c0bfa96c-e089-44fb-8eaf-26f8796190da") + ID3D11DeviceContext : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE VSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE PSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE PSSetShader( + /* [annotation] */ + __in_opt ID3D11PixelShader *pPixelShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE PSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE VSSetShader( + /* [annotation] */ + __in_opt ID3D11VertexShader *pVertexShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexed( + /* [annotation] */ + __in UINT IndexCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation) = 0; + + virtual void STDMETHODCALLTYPE Draw( + /* [annotation] */ + __in UINT VertexCount, + /* [annotation] */ + __in UINT StartVertexLocation) = 0; + + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D11_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D11_MAPPED_SUBRESOURCE *pMappedResource) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in UINT Subresource) = 0; + + virtual void STDMETHODCALLTYPE PSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE IASetInputLayout( + /* [annotation] */ + __in_opt ID3D11InputLayout *pInputLayout) = 0; + + virtual void STDMETHODCALLTYPE IASetVertexBuffers( + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppVertexBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pStrides, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE IASetIndexBuffer( + /* [annotation] */ + __in_opt ID3D11Buffer *pIndexBuffer, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT Offset) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexedInstanced( + /* [annotation] */ + __in UINT IndexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE DrawInstanced( + /* [annotation] */ + __in UINT VertexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE GSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE GSSetShader( + /* [annotation] */ + __in_opt ID3D11GeometryShader *pShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE IASetPrimitiveTopology( + /* [annotation] */ + __in D3D11_PRIMITIVE_TOPOLOGY Topology) = 0; + + virtual void STDMETHODCALLTYPE VSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE VSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE Begin( + /* [annotation] */ + __in ID3D11Asynchronous *pAsync) = 0; + + virtual void STDMETHODCALLTYPE End( + /* [annotation] */ + __in ID3D11Asynchronous *pAsync) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetData( + /* [annotation] */ + __in ID3D11Asynchronous *pAsync, + /* [annotation] */ + __out_bcount_opt( DataSize ) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + /* [annotation] */ + __in_opt ID3D11Predicate *pPredicate, + /* [annotation] */ + __in BOOL PredicateValue) = 0; + + virtual void STDMETHODCALLTYPE GSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE GSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE OMSetRenderTargets( + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __in_ecount_opt(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D11DepthStencilView *pDepthStencilView) = 0; + + virtual void STDMETHODCALLTYPE OMSetRenderTargetsAndUnorderedAccessViews( + /* [annotation] */ + __in UINT NumRTVs, + /* [annotation] */ + __in_ecount_opt(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D11DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot, + /* [annotation] */ + __in UINT NumUAVs, + /* [annotation] */ + __in_ecount_opt(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, + /* [annotation] */ + __in_ecount_opt(NumUAVs) const UINT *pUAVInitialCounts) = 0; + + virtual void STDMETHODCALLTYPE OMSetBlendState( + /* [annotation] */ + __in_opt ID3D11BlendState *pBlendState, + /* [annotation] */ + __in_opt const FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __in UINT SampleMask) = 0; + + virtual void STDMETHODCALLTYPE OMSetDepthStencilState( + /* [annotation] */ + __in_opt ID3D11DepthStencilState *pDepthStencilState, + /* [annotation] */ + __in UINT StencilRef) = 0; + + virtual void STDMETHODCALLTYPE SOSetTargets( + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, + /* [annotation] */ + __in_ecount_opt(NumBuffers) ID3D11Buffer *const *ppSOTargets, + /* [annotation] */ + __in_ecount_opt(NumBuffers) const UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE DrawAuto( void) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexedInstancedIndirect( + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs) = 0; + + virtual void STDMETHODCALLTYPE DrawInstancedIndirect( + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs) = 0; + + virtual void STDMETHODCALLTYPE Dispatch( + /* [annotation] */ + __in UINT ThreadGroupCountX, + /* [annotation] */ + __in UINT ThreadGroupCountY, + /* [annotation] */ + __in UINT ThreadGroupCountZ) = 0; + + virtual void STDMETHODCALLTYPE DispatchIndirect( + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs) = 0; + + virtual void STDMETHODCALLTYPE RSSetState( + /* [annotation] */ + __in_opt ID3D11RasterizerState *pRasterizerState) = 0; + + virtual void STDMETHODCALLTYPE RSSetViewports( + /* [annotation] */ + __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + /* [annotation] */ + __in_ecount_opt(NumViewports) const D3D11_VIEWPORT *pViewports) = 0; + + virtual void STDMETHODCALLTYPE RSSetScissorRects( + /* [annotation] */ + __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + /* [annotation] */ + __in_ecount_opt(NumRects) const D3D11_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE CopySubresourceRegion( + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in UINT DstX, + /* [annotation] */ + __in UINT DstY, + /* [annotation] */ + __in UINT DstZ, + /* [annotation] */ + __in ID3D11Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in_opt const D3D11_BOX *pSrcBox) = 0; + + virtual void STDMETHODCALLTYPE CopyResource( + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in ID3D11Resource *pSrcResource) = 0; + + virtual void STDMETHODCALLTYPE UpdateSubresource( + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in_opt const D3D11_BOX *pDstBox, + /* [annotation] */ + __in const void *pSrcData, + /* [annotation] */ + __in UINT SrcRowPitch, + /* [annotation] */ + __in UINT SrcDepthPitch) = 0; + + virtual void STDMETHODCALLTYPE CopyStructureCount( + /* [annotation] */ + __in ID3D11Buffer *pDstBuffer, + /* [annotation] */ + __in UINT DstAlignedByteOffset, + /* [annotation] */ + __in ID3D11UnorderedAccessView *pSrcView) = 0; + + virtual void STDMETHODCALLTYPE ClearRenderTargetView( + /* [annotation] */ + __in ID3D11RenderTargetView *pRenderTargetView, + /* [annotation] */ + __in const FLOAT ColorRGBA[ 4 ]) = 0; + + virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewUint( + /* [annotation] */ + __in ID3D11UnorderedAccessView *pUnorderedAccessView, + /* [annotation] */ + __in const UINT Values[ 4 ]) = 0; + + virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewFloat( + /* [annotation] */ + __in ID3D11UnorderedAccessView *pUnorderedAccessView, + /* [annotation] */ + __in const FLOAT Values[ 4 ]) = 0; + + virtual void STDMETHODCALLTYPE ClearDepthStencilView( + /* [annotation] */ + __in ID3D11DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in UINT ClearFlags, + /* [annotation] */ + __in FLOAT Depth, + /* [annotation] */ + __in UINT8 Stencil) = 0; + + virtual void STDMETHODCALLTYPE GenerateMips( + /* [annotation] */ + __in ID3D11ShaderResourceView *pShaderResourceView) = 0; + + virtual void STDMETHODCALLTYPE SetResourceMinLOD( + /* [annotation] */ + __in ID3D11Resource *pResource, + FLOAT MinLOD) = 0; + + virtual FLOAT STDMETHODCALLTYPE GetResourceMinLOD( + /* [annotation] */ + __in ID3D11Resource *pResource) = 0; + + virtual void STDMETHODCALLTYPE ResolveSubresource( + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in ID3D11Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in DXGI_FORMAT Format) = 0; + + virtual void STDMETHODCALLTYPE ExecuteCommandList( + /* [annotation] */ + __in ID3D11CommandList *pCommandList, + BOOL RestoreContextState) = 0; + + virtual void STDMETHODCALLTYPE HSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE HSSetShader( + /* [annotation] */ + __in_opt ID3D11HullShader *pHullShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE HSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE HSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE DSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE DSSetShader( + /* [annotation] */ + __in_opt ID3D11DomainShader *pDomainShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE DSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE DSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE CSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE CSSetUnorderedAccessViews( + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs, + /* [annotation] */ + __in_ecount(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, + /* [annotation] */ + __in_ecount(NumUAVs) const UINT *pUAVInitialCounts) = 0; + + virtual void STDMETHODCALLTYPE CSSetShader( + /* [annotation] */ + __in_opt ID3D11ComputeShader *pComputeShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE CSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE CSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE VSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE PSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE PSGetShader( + /* [annotation] */ + __out ID3D11PixelShader **ppPixelShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE PSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE VSGetShader( + /* [annotation] */ + __out ID3D11VertexShader **ppVertexShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE PSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE IAGetInputLayout( + /* [annotation] */ + __out ID3D11InputLayout **ppInputLayout) = 0; + + virtual void STDMETHODCALLTYPE IAGetVertexBuffers( + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D11Buffer **ppVertexBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pStrides, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE IAGetIndexBuffer( + /* [annotation] */ + __out_opt ID3D11Buffer **pIndexBuffer, + /* [annotation] */ + __out_opt DXGI_FORMAT *Format, + /* [annotation] */ + __out_opt UINT *Offset) = 0; + + virtual void STDMETHODCALLTYPE GSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE GSGetShader( + /* [annotation] */ + __out ID3D11GeometryShader **ppGeometryShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE IAGetPrimitiveTopology( + /* [annotation] */ + __out D3D11_PRIMITIVE_TOPOLOGY *pTopology) = 0; + + virtual void STDMETHODCALLTYPE VSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE VSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE GetPredication( + /* [annotation] */ + __out_opt ID3D11Predicate **ppPredicate, + /* [annotation] */ + __out_opt BOOL *pPredicateValue) = 0; + + virtual void STDMETHODCALLTYPE GSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE GSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE OMGetRenderTargets( + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __out_ecount_opt(NumViews) ID3D11RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView) = 0; + + virtual void STDMETHODCALLTYPE OMGetRenderTargetsAndUnorderedAccessViews( + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs, + /* [annotation] */ + __out_ecount_opt(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs, + /* [annotation] */ + __out_ecount_opt(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) = 0; + + virtual void STDMETHODCALLTYPE OMGetBlendState( + /* [annotation] */ + __out_opt ID3D11BlendState **ppBlendState, + /* [annotation] */ + __out_opt FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __out_opt UINT *pSampleMask) = 0; + + virtual void STDMETHODCALLTYPE OMGetDepthStencilState( + /* [annotation] */ + __out_opt ID3D11DepthStencilState **ppDepthStencilState, + /* [annotation] */ + __out_opt UINT *pStencilRef) = 0; + + virtual void STDMETHODCALLTYPE SOGetTargets( + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppSOTargets) = 0; + + virtual void STDMETHODCALLTYPE RSGetState( + /* [annotation] */ + __out ID3D11RasterizerState **ppRasterizerState) = 0; + + virtual void STDMETHODCALLTYPE RSGetViewports( + /* [annotation] */ + __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports, + /* [annotation] */ + __out_ecount_opt(*pNumViewports) D3D11_VIEWPORT *pViewports) = 0; + + virtual void STDMETHODCALLTYPE RSGetScissorRects( + /* [annotation] */ + __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects, + /* [annotation] */ + __out_ecount_opt(*pNumRects) D3D11_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE HSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE HSGetShader( + /* [annotation] */ + __out ID3D11HullShader **ppHullShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE HSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE HSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE DSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE DSGetShader( + /* [annotation] */ + __out ID3D11DomainShader **ppDomainShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE DSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE DSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE CSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE CSGetUnorderedAccessViews( + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs, + /* [annotation] */ + __out_ecount(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) = 0; + + virtual void STDMETHODCALLTYPE CSGetShader( + /* [annotation] */ + __out ID3D11ComputeShader **ppComputeShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE CSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE CSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE ClearState( void) = 0; + + virtual void STDMETHODCALLTYPE Flush( void) = 0; + + virtual D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE GetType( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetContextFlags( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE FinishCommandList( + BOOL RestoreDeferredContextState, + /* [annotation] */ + __out_opt ID3D11CommandList **ppCommandList) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DeviceContextVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11DeviceContext * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11DeviceContext * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11DeviceContext * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *VSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11PixelShader *pPixelShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *PSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *VSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11VertexShader *pVertexShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *DrawIndexed )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT IndexCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation); + + void ( STDMETHODCALLTYPE *Draw )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT VertexCount, + /* [annotation] */ + __in UINT StartVertexLocation); + + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D11_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D11_MAPPED_SUBRESOURCE *pMappedResource); + + void ( STDMETHODCALLTYPE *Unmap )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in UINT Subresource); + + void ( STDMETHODCALLTYPE *PSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IASetInputLayout )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11InputLayout *pInputLayout); + + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppVertexBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pStrides, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11Buffer *pIndexBuffer, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT Offset); + + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT IndexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT VertexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *GSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11GeometryShader *pShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in D3D11_PRIMITIVE_TOPOLOGY Topology); + + void ( STDMETHODCALLTYPE *VSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *Begin )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Asynchronous *pAsync); + + void ( STDMETHODCALLTYPE *End )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Asynchronous *pAsync); + + HRESULT ( STDMETHODCALLTYPE *GetData )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Asynchronous *pAsync, + /* [annotation] */ + __out_bcount_opt( DataSize ) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags); + + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11Predicate *pPredicate, + /* [annotation] */ + __in BOOL PredicateValue); + + void ( STDMETHODCALLTYPE *GSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __in_ecount_opt(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D11DepthStencilView *pDepthStencilView); + + void ( STDMETHODCALLTYPE *OMSetRenderTargetsAndUnorderedAccessViews )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT NumRTVs, + /* [annotation] */ + __in_ecount_opt(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D11DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot, + /* [annotation] */ + __in UINT NumUAVs, + /* [annotation] */ + __in_ecount_opt(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, + /* [annotation] */ + __in_ecount_opt(NumUAVs) const UINT *pUAVInitialCounts); + + void ( STDMETHODCALLTYPE *OMSetBlendState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11BlendState *pBlendState, + /* [annotation] */ + __in_opt const FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __in UINT SampleMask); + + void ( STDMETHODCALLTYPE *OMSetDepthStencilState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11DepthStencilState *pDepthStencilState, + /* [annotation] */ + __in UINT StencilRef); + + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, + /* [annotation] */ + __in_ecount_opt(NumBuffers) ID3D11Buffer *const *ppSOTargets, + /* [annotation] */ + __in_ecount_opt(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *DrawAuto )( + ID3D11DeviceContext * This); + + void ( STDMETHODCALLTYPE *DrawIndexedInstancedIndirect )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs); + + void ( STDMETHODCALLTYPE *DrawInstancedIndirect )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs); + + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT ThreadGroupCountX, + /* [annotation] */ + __in UINT ThreadGroupCountY, + /* [annotation] */ + __in UINT ThreadGroupCountZ); + + void ( STDMETHODCALLTYPE *DispatchIndirect )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs); + + void ( STDMETHODCALLTYPE *RSSetState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11RasterizerState *pRasterizerState); + + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + /* [annotation] */ + __in_ecount_opt(NumViewports) const D3D11_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + /* [annotation] */ + __in_ecount_opt(NumRects) const D3D11_RECT *pRects); + + void ( STDMETHODCALLTYPE *CopySubresourceRegion )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in UINT DstX, + /* [annotation] */ + __in UINT DstY, + /* [annotation] */ + __in UINT DstZ, + /* [annotation] */ + __in ID3D11Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in_opt const D3D11_BOX *pSrcBox); + + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in ID3D11Resource *pSrcResource); + + void ( STDMETHODCALLTYPE *UpdateSubresource )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in_opt const D3D11_BOX *pDstBox, + /* [annotation] */ + __in const void *pSrcData, + /* [annotation] */ + __in UINT SrcRowPitch, + /* [annotation] */ + __in UINT SrcDepthPitch); + + void ( STDMETHODCALLTYPE *CopyStructureCount )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Buffer *pDstBuffer, + /* [annotation] */ + __in UINT DstAlignedByteOffset, + /* [annotation] */ + __in ID3D11UnorderedAccessView *pSrcView); + + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11RenderTargetView *pRenderTargetView, + /* [annotation] */ + __in const FLOAT ColorRGBA[ 4 ]); + + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11UnorderedAccessView *pUnorderedAccessView, + /* [annotation] */ + __in const UINT Values[ 4 ]); + + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11UnorderedAccessView *pUnorderedAccessView, + /* [annotation] */ + __in const FLOAT Values[ 4 ]); + + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in UINT ClearFlags, + /* [annotation] */ + __in FLOAT Depth, + /* [annotation] */ + __in UINT8 Stencil); + + void ( STDMETHODCALLTYPE *GenerateMips )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11ShaderResourceView *pShaderResourceView); + + void ( STDMETHODCALLTYPE *SetResourceMinLOD )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + FLOAT MinLOD); + + FLOAT ( STDMETHODCALLTYPE *GetResourceMinLOD )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pResource); + + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in ID3D11Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in DXGI_FORMAT Format); + + void ( STDMETHODCALLTYPE *ExecuteCommandList )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11CommandList *pCommandList, + BOOL RestoreContextState); + + void ( STDMETHODCALLTYPE *HSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *HSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11HullShader *pHullShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *HSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *HSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *DSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *DSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11DomainShader *pDomainShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *DSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *DSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *CSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *CSSetUnorderedAccessViews )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs, + /* [annotation] */ + __in_ecount(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, + /* [annotation] */ + __in_ecount(NumUAVs) const UINT *pUAVInitialCounts); + + void ( STDMETHODCALLTYPE *CSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11ComputeShader *pComputeShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *CSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *CSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *VSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11PixelShader **ppPixelShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *PSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *VSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11VertexShader **ppVertexShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *PSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IAGetInputLayout )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11InputLayout **ppInputLayout); + + void ( STDMETHODCALLTYPE *IAGetVertexBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D11Buffer **ppVertexBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pStrides, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IAGetIndexBuffer )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out_opt ID3D11Buffer **pIndexBuffer, + /* [annotation] */ + __out_opt DXGI_FORMAT *Format, + /* [annotation] */ + __out_opt UINT *Offset); + + void ( STDMETHODCALLTYPE *GSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11GeometryShader **ppGeometryShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out D3D11_PRIMITIVE_TOPOLOGY *pTopology); + + void ( STDMETHODCALLTYPE *VSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *GetPredication )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out_opt ID3D11Predicate **ppPredicate, + /* [annotation] */ + __out_opt BOOL *pPredicateValue); + + void ( STDMETHODCALLTYPE *GSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *OMGetRenderTargets )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __out_ecount_opt(NumViews) ID3D11RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView); + + void ( STDMETHODCALLTYPE *OMGetRenderTargetsAndUnorderedAccessViews )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs, + /* [annotation] */ + __out_ecount_opt(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs, + /* [annotation] */ + __out_ecount_opt(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews); + + void ( STDMETHODCALLTYPE *OMGetBlendState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out_opt ID3D11BlendState **ppBlendState, + /* [annotation] */ + __out_opt FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __out_opt UINT *pSampleMask); + + void ( STDMETHODCALLTYPE *OMGetDepthStencilState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out_opt ID3D11DepthStencilState **ppDepthStencilState, + /* [annotation] */ + __out_opt UINT *pStencilRef); + + void ( STDMETHODCALLTYPE *SOGetTargets )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppSOTargets); + + void ( STDMETHODCALLTYPE *RSGetState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11RasterizerState **ppRasterizerState); + + void ( STDMETHODCALLTYPE *RSGetViewports )( + ID3D11DeviceContext * This, + /* [annotation] */ + __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports, + /* [annotation] */ + __out_ecount_opt(*pNumViewports) D3D11_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSGetScissorRects )( + ID3D11DeviceContext * This, + /* [annotation] */ + __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects, + /* [annotation] */ + __out_ecount_opt(*pNumRects) D3D11_RECT *pRects); + + void ( STDMETHODCALLTYPE *HSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *HSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11HullShader **ppHullShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *HSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *HSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *DSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *DSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11DomainShader **ppDomainShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *DSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *DSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *CSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *CSGetUnorderedAccessViews )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs, + /* [annotation] */ + __out_ecount(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews); + + void ( STDMETHODCALLTYPE *CSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11ComputeShader **ppComputeShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *CSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *CSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *ClearState )( + ID3D11DeviceContext * This); + + void ( STDMETHODCALLTYPE *Flush )( + ID3D11DeviceContext * This); + + D3D11_DEVICE_CONTEXT_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D11DeviceContext * This); + + UINT ( STDMETHODCALLTYPE *GetContextFlags )( + ID3D11DeviceContext * This); + + HRESULT ( STDMETHODCALLTYPE *FinishCommandList )( + ID3D11DeviceContext * This, + BOOL RestoreDeferredContextState, + /* [annotation] */ + __out_opt ID3D11CommandList **ppCommandList); + + END_INTERFACE + } ID3D11DeviceContextVtbl; + + interface ID3D11DeviceContext + { + CONST_VTBL struct ID3D11DeviceContextVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11DeviceContext_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11DeviceContext_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11DeviceContext_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11DeviceContext_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11DeviceContext_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11DeviceContext_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11DeviceContext_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11DeviceContext_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_PSSetShader(This,pPixelShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> PSSetShader(This,pPixelShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_VSSetShader(This,pVertexShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> VSSetShader(This,pVertexShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) \ + ( (This)->lpVtbl -> DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) ) + +#define ID3D11DeviceContext_Draw(This,VertexCount,StartVertexLocation) \ + ( (This)->lpVtbl -> Draw(This,VertexCount,StartVertexLocation) ) + +#define ID3D11DeviceContext_Map(This,pResource,Subresource,MapType,MapFlags,pMappedResource) \ + ( (This)->lpVtbl -> Map(This,pResource,Subresource,MapType,MapFlags,pMappedResource) ) + +#define ID3D11DeviceContext_Unmap(This,pResource,Subresource) \ + ( (This)->lpVtbl -> Unmap(This,pResource,Subresource) ) + +#define ID3D11DeviceContext_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_IASetInputLayout(This,pInputLayout) \ + ( (This)->lpVtbl -> IASetInputLayout(This,pInputLayout) ) + +#define ID3D11DeviceContext_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D11DeviceContext_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D11DeviceContext_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D11DeviceContext_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D11DeviceContext_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_GSSetShader(This,pShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> GSSetShader(This,pShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_IASetPrimitiveTopology(This,Topology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,Topology) ) + +#define ID3D11DeviceContext_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_Begin(This,pAsync) \ + ( (This)->lpVtbl -> Begin(This,pAsync) ) + +#define ID3D11DeviceContext_End(This,pAsync) \ + ( (This)->lpVtbl -> End(This,pAsync) ) + +#define ID3D11DeviceContext_GetData(This,pAsync,pData,DataSize,GetDataFlags) \ + ( (This)->lpVtbl -> GetData(This,pAsync,pData,DataSize,GetDataFlags) ) + +#define ID3D11DeviceContext_SetPredication(This,pPredicate,PredicateValue) \ + ( (This)->lpVtbl -> SetPredication(This,pPredicate,PredicateValue) ) + +#define ID3D11DeviceContext_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) ) + +#define ID3D11DeviceContext_OMSetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,pDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) \ + ( (This)->lpVtbl -> OMSetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,pDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) ) + +#define ID3D11DeviceContext_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) \ + ( (This)->lpVtbl -> OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) ) + +#define ID3D11DeviceContext_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) \ + ( (This)->lpVtbl -> OMSetDepthStencilState(This,pDepthStencilState,StencilRef) ) + +#define ID3D11DeviceContext_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ + ( (This)->lpVtbl -> SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) + +#define ID3D11DeviceContext_DrawAuto(This) \ + ( (This)->lpVtbl -> DrawAuto(This) ) + +#define ID3D11DeviceContext_DrawIndexedInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \ + ( (This)->lpVtbl -> DrawIndexedInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) ) + +#define ID3D11DeviceContext_DrawInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \ + ( (This)->lpVtbl -> DrawInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) ) + +#define ID3D11DeviceContext_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D11DeviceContext_DispatchIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \ + ( (This)->lpVtbl -> DispatchIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) ) + +#define ID3D11DeviceContext_RSSetState(This,pRasterizerState) \ + ( (This)->lpVtbl -> RSSetState(This,pRasterizerState) ) + +#define ID3D11DeviceContext_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D11DeviceContext_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D11DeviceContext_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) ) + +#define ID3D11DeviceContext_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D11DeviceContext_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D11DeviceContext_CopyStructureCount(This,pDstBuffer,DstAlignedByteOffset,pSrcView) \ + ( (This)->lpVtbl -> CopyStructureCount(This,pDstBuffer,DstAlignedByteOffset,pSrcView) ) + +#define ID3D11DeviceContext_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) ) + +#define ID3D11DeviceContext_ClearUnorderedAccessViewUint(This,pUnorderedAccessView,Values) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,pUnorderedAccessView,Values) ) + +#define ID3D11DeviceContext_ClearUnorderedAccessViewFloat(This,pUnorderedAccessView,Values) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,pUnorderedAccessView,Values) ) + +#define ID3D11DeviceContext_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) ) + +#define ID3D11DeviceContext_GenerateMips(This,pShaderResourceView) \ + ( (This)->lpVtbl -> GenerateMips(This,pShaderResourceView) ) + +#define ID3D11DeviceContext_SetResourceMinLOD(This,pResource,MinLOD) \ + ( (This)->lpVtbl -> SetResourceMinLOD(This,pResource,MinLOD) ) + +#define ID3D11DeviceContext_GetResourceMinLOD(This,pResource) \ + ( (This)->lpVtbl -> GetResourceMinLOD(This,pResource) ) + +#define ID3D11DeviceContext_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D11DeviceContext_ExecuteCommandList(This,pCommandList,RestoreContextState) \ + ( (This)->lpVtbl -> ExecuteCommandList(This,pCommandList,RestoreContextState) ) + +#define ID3D11DeviceContext_HSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> HSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_HSSetShader(This,pHullShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> HSSetShader(This,pHullShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_HSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> HSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_HSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> HSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_DSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> DSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_DSSetShader(This,pDomainShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> DSSetShader(This,pDomainShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_DSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> DSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_DSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> DSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_CSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> CSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_CSSetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) \ + ( (This)->lpVtbl -> CSSetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) ) + +#define ID3D11DeviceContext_CSSetShader(This,pComputeShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> CSSetShader(This,pComputeShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_CSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> CSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_CSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> CSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_PSGetShader(This,ppPixelShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> PSGetShader(This,ppPixelShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_VSGetShader(This,ppVertexShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> VSGetShader(This,ppVertexShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_IAGetInputLayout(This,ppInputLayout) \ + ( (This)->lpVtbl -> IAGetInputLayout(This,ppInputLayout) ) + +#define ID3D11DeviceContext_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D11DeviceContext_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D11DeviceContext_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_GSGetShader(This,ppGeometryShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> GSGetShader(This,ppGeometryShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_IAGetPrimitiveTopology(This,pTopology) \ + ( (This)->lpVtbl -> IAGetPrimitiveTopology(This,pTopology) ) + +#define ID3D11DeviceContext_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_GetPredication(This,ppPredicate,pPredicateValue) \ + ( (This)->lpVtbl -> GetPredication(This,ppPredicate,pPredicateValue) ) + +#define ID3D11DeviceContext_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) \ + ( (This)->lpVtbl -> OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) ) + +#define ID3D11DeviceContext_OMGetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,ppDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews) \ + ( (This)->lpVtbl -> OMGetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,ppDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews) ) + +#define ID3D11DeviceContext_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) \ + ( (This)->lpVtbl -> OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) ) + +#define ID3D11DeviceContext_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) \ + ( (This)->lpVtbl -> OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) ) + +#define ID3D11DeviceContext_SOGetTargets(This,NumBuffers,ppSOTargets) \ + ( (This)->lpVtbl -> SOGetTargets(This,NumBuffers,ppSOTargets) ) + +#define ID3D11DeviceContext_RSGetState(This,ppRasterizerState) \ + ( (This)->lpVtbl -> RSGetState(This,ppRasterizerState) ) + +#define ID3D11DeviceContext_RSGetViewports(This,pNumViewports,pViewports) \ + ( (This)->lpVtbl -> RSGetViewports(This,pNumViewports,pViewports) ) + +#define ID3D11DeviceContext_RSGetScissorRects(This,pNumRects,pRects) \ + ( (This)->lpVtbl -> RSGetScissorRects(This,pNumRects,pRects) ) + +#define ID3D11DeviceContext_HSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> HSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_HSGetShader(This,ppHullShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> HSGetShader(This,ppHullShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_HSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> HSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_HSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> HSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_DSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> DSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_DSGetShader(This,ppDomainShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> DSGetShader(This,ppDomainShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_DSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> DSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_DSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> DSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_CSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> CSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_CSGetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews) \ + ( (This)->lpVtbl -> CSGetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews) ) + +#define ID3D11DeviceContext_CSGetShader(This,ppComputeShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> CSGetShader(This,ppComputeShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_CSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> CSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_CSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> CSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D11DeviceContext_Flush(This) \ + ( (This)->lpVtbl -> Flush(This) ) + +#define ID3D11DeviceContext_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + +#define ID3D11DeviceContext_GetContextFlags(This) \ + ( (This)->lpVtbl -> GetContextFlags(This) ) + +#define ID3D11DeviceContext_FinishCommandList(This,RestoreDeferredContextState,ppCommandList) \ + ( (This)->lpVtbl -> FinishCommandList(This,RestoreDeferredContextState,ppCommandList) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11DeviceContext_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11Device_INTERFACE_DEFINED__ +#define __ID3D11Device_INTERFACE_DEFINED__ + +/* interface ID3D11Device */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Device; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("db6f6ddb-ac77-4e88-8253-819df9bbf140") + ID3D11Device : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateBuffer( + /* [annotation] */ + __in const D3D11_BUFFER_DESC *pDesc, + /* [annotation] */ + __in_opt const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Buffer **ppBuffer) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture1D( + /* [annotation] */ + __in const D3D11_TEXTURE1D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture1D **ppTexture1D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture2D( + /* [annotation] */ + __in const D3D11_TEXTURE2D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture2D **ppTexture2D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture3D( + /* [annotation] */ + __in const D3D11_TEXTURE3D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture3D **ppTexture3D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11ShaderResourceView **ppSRView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateUnorderedAccessView( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11UnorderedAccessView **ppUAView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRenderTargetView( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_RENDER_TARGET_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11RenderTargetView **ppRTView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilView( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateInputLayout( + /* [annotation] */ + __in_ecount(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, + /* [annotation] */ + __in const void *pShaderBytecodeWithInputSignature, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D11InputLayout **ppInputLayout) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVertexShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11VertexShader **ppVertexShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGeometryShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11GeometryShader **ppGeometryShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGeometryShaderWithStreamOutput( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_ecount_opt(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration, + /* [annotation] */ + __in_range( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries, + /* [annotation] */ + __in_ecount_opt(NumStrides) const UINT *pBufferStrides, + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides, + /* [annotation] */ + __in UINT RasterizedStream, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11GeometryShader **ppGeometryShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePixelShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11PixelShader **ppPixelShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateHullShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11HullShader **ppHullShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDomainShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11DomainShader **ppDomainShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateComputeShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11ComputeShader **ppComputeShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateClassLinkage( + /* [annotation] */ + __out ID3D11ClassLinkage **ppLinkage) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateBlendState( + /* [annotation] */ + __in const D3D11_BLEND_DESC *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D11BlendState **ppBlendState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilState( + /* [annotation] */ + __in const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc, + /* [annotation] */ + __out_opt ID3D11DepthStencilState **ppDepthStencilState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState( + /* [annotation] */ + __in const D3D11_RASTERIZER_DESC *pRasterizerDesc, + /* [annotation] */ + __out_opt ID3D11RasterizerState **ppRasterizerState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSamplerState( + /* [annotation] */ + __in const D3D11_SAMPLER_DESC *pSamplerDesc, + /* [annotation] */ + __out_opt ID3D11SamplerState **ppSamplerState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateQuery( + /* [annotation] */ + __in const D3D11_QUERY_DESC *pQueryDesc, + /* [annotation] */ + __out_opt ID3D11Query **ppQuery) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePredicate( + /* [annotation] */ + __in const D3D11_QUERY_DESC *pPredicateDesc, + /* [annotation] */ + __out_opt ID3D11Predicate **ppPredicate) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCounter( + /* [annotation] */ + __in const D3D11_COUNTER_DESC *pCounterDesc, + /* [annotation] */ + __out_opt ID3D11Counter **ppCounter) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDeferredContext( + UINT ContextFlags, + /* [annotation] */ + __out_opt ID3D11DeviceContext **ppDeferredContext) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenSharedResource( + /* [annotation] */ + __in HANDLE hResource, + /* [annotation] */ + __in REFIID ReturnedInterface, + /* [annotation] */ + __out_opt void **ppResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckFormatSupport( + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __out UINT *pFormatSupport) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckMultisampleQualityLevels( + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT SampleCount, + /* [annotation] */ + __out UINT *pNumQualityLevels) = 0; + + virtual void STDMETHODCALLTYPE CheckCounterInfo( + /* [annotation] */ + __out D3D11_COUNTER_INFO *pCounterInfo) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckCounter( + /* [annotation] */ + __in const D3D11_COUNTER_DESC *pDesc, + /* [annotation] */ + __out D3D11_COUNTER_TYPE *pType, + /* [annotation] */ + __out UINT *pActiveCounters, + /* [annotation] */ + __out_ecount_opt(*pNameLength) LPSTR szName, + /* [annotation] */ + __inout_opt UINT *pNameLength, + /* [annotation] */ + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + /* [annotation] */ + __inout_opt UINT *pUnitsLength, + /* [annotation] */ + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + /* [annotation] */ + __inout_opt UINT *pDescriptionLength) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport( + D3D11_FEATURE Feature, + /* [annotation] */ + __out_bcount(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData) = 0; + + virtual D3D_FEATURE_LEVEL STDMETHODCALLTYPE GetFeatureLevel( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetCreationFlags( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( void) = 0; + + virtual void STDMETHODCALLTYPE GetImmediateContext( + /* [annotation] */ + __out ID3D11DeviceContext **ppImmediateContext) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetExceptionMode( + UINT RaiseFlags) = 0; + + virtual UINT STDMETHODCALLTYPE GetExceptionMode( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DeviceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Device * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Device * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Device * This); + + HRESULT ( STDMETHODCALLTYPE *CreateBuffer )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_BUFFER_DESC *pDesc, + /* [annotation] */ + __in_opt const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Buffer **ppBuffer); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_TEXTURE1D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture1D **ppTexture1D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_TEXTURE2D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture2D **ppTexture2D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_TEXTURE3D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture3D **ppTexture3D); + + HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D11Device * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11ShaderResourceView **ppSRView); + + HRESULT ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D11Device * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11UnorderedAccessView **ppUAView); + + HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D11Device * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_RENDER_TARGET_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11RenderTargetView **ppRTView); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D11Device * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView); + + HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )( + ID3D11Device * This, + /* [annotation] */ + __in_ecount(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, + /* [annotation] */ + __in const void *pShaderBytecodeWithInputSignature, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D11InputLayout **ppInputLayout); + + HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11VertexShader **ppVertexShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_ecount_opt(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration, + /* [annotation] */ + __in_range( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries, + /* [annotation] */ + __in_ecount_opt(NumStrides) const UINT *pBufferStrides, + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides, + /* [annotation] */ + __in UINT RasterizedStream, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11PixelShader **ppPixelShader); + + HRESULT ( STDMETHODCALLTYPE *CreateHullShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11HullShader **ppHullShader); + + HRESULT ( STDMETHODCALLTYPE *CreateDomainShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11DomainShader **ppDomainShader); + + HRESULT ( STDMETHODCALLTYPE *CreateComputeShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11ComputeShader **ppComputeShader); + + HRESULT ( STDMETHODCALLTYPE *CreateClassLinkage )( + ID3D11Device * This, + /* [annotation] */ + __out ID3D11ClassLinkage **ppLinkage); + + HRESULT ( STDMETHODCALLTYPE *CreateBlendState )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_BLEND_DESC *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D11BlendState **ppBlendState); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc, + /* [annotation] */ + __out_opt ID3D11DepthStencilState **ppDepthStencilState); + + HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_RASTERIZER_DESC *pRasterizerDesc, + /* [annotation] */ + __out_opt ID3D11RasterizerState **ppRasterizerState); + + HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_SAMPLER_DESC *pSamplerDesc, + /* [annotation] */ + __out_opt ID3D11SamplerState **ppSamplerState); + + HRESULT ( STDMETHODCALLTYPE *CreateQuery )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_QUERY_DESC *pQueryDesc, + /* [annotation] */ + __out_opt ID3D11Query **ppQuery); + + HRESULT ( STDMETHODCALLTYPE *CreatePredicate )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_QUERY_DESC *pPredicateDesc, + /* [annotation] */ + __out_opt ID3D11Predicate **ppPredicate); + + HRESULT ( STDMETHODCALLTYPE *CreateCounter )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_COUNTER_DESC *pCounterDesc, + /* [annotation] */ + __out_opt ID3D11Counter **ppCounter); + + HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext )( + ID3D11Device * This, + UINT ContextFlags, + /* [annotation] */ + __out_opt ID3D11DeviceContext **ppDeferredContext); + + HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )( + ID3D11Device * This, + /* [annotation] */ + __in HANDLE hResource, + /* [annotation] */ + __in REFIID ReturnedInterface, + /* [annotation] */ + __out_opt void **ppResource); + + HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )( + ID3D11Device * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __out UINT *pFormatSupport); + + HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )( + ID3D11Device * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT SampleCount, + /* [annotation] */ + __out UINT *pNumQualityLevels); + + void ( STDMETHODCALLTYPE *CheckCounterInfo )( + ID3D11Device * This, + /* [annotation] */ + __out D3D11_COUNTER_INFO *pCounterInfo); + + HRESULT ( STDMETHODCALLTYPE *CheckCounter )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_COUNTER_DESC *pDesc, + /* [annotation] */ + __out D3D11_COUNTER_TYPE *pType, + /* [annotation] */ + __out UINT *pActiveCounters, + /* [annotation] */ + __out_ecount_opt(*pNameLength) LPSTR szName, + /* [annotation] */ + __inout_opt UINT *pNameLength, + /* [annotation] */ + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + /* [annotation] */ + __inout_opt UINT *pUnitsLength, + /* [annotation] */ + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + /* [annotation] */ + __inout_opt UINT *pDescriptionLength); + + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D11Device * This, + D3D11_FEATURE Feature, + /* [annotation] */ + __out_bcount(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + D3D_FEATURE_LEVEL ( STDMETHODCALLTYPE *GetFeatureLevel )( + ID3D11Device * This); + + UINT ( STDMETHODCALLTYPE *GetCreationFlags )( + ID3D11Device * This); + + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D11Device * This); + + void ( STDMETHODCALLTYPE *GetImmediateContext )( + ID3D11Device * This, + /* [annotation] */ + __out ID3D11DeviceContext **ppImmediateContext); + + HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )( + ID3D11Device * This, + UINT RaiseFlags); + + UINT ( STDMETHODCALLTYPE *GetExceptionMode )( + ID3D11Device * This); + + END_INTERFACE + } ID3D11DeviceVtbl; + + interface ID3D11Device + { + CONST_VTBL struct ID3D11DeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Device_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Device_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Device_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Device_CreateBuffer(This,pDesc,pInitialData,ppBuffer) \ + ( (This)->lpVtbl -> CreateBuffer(This,pDesc,pInitialData,ppBuffer) ) + +#define ID3D11Device_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) \ + ( (This)->lpVtbl -> CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) ) + +#define ID3D11Device_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) \ + ( (This)->lpVtbl -> CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) ) + +#define ID3D11Device_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) \ + ( (This)->lpVtbl -> CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) ) + +#define ID3D11Device_CreateShaderResourceView(This,pResource,pDesc,ppSRView) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,ppSRView) ) + +#define ID3D11Device_CreateUnorderedAccessView(This,pResource,pDesc,ppUAView) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pDesc,ppUAView) ) + +#define ID3D11Device_CreateRenderTargetView(This,pResource,pDesc,ppRTView) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,ppRTView) ) + +#define ID3D11Device_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) ) + +#define ID3D11Device_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) \ + ( (This)->lpVtbl -> CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) ) + +#define ID3D11Device_CreateVertexShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppVertexShader) \ + ( (This)->lpVtbl -> CreateVertexShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppVertexShader) ) + +#define ID3D11Device_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppGeometryShader) ) + +#define ID3D11Device_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,pBufferStrides,NumStrides,RasterizedStream,pClassLinkage,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,pBufferStrides,NumStrides,RasterizedStream,pClassLinkage,ppGeometryShader) ) + +#define ID3D11Device_CreatePixelShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppPixelShader) \ + ( (This)->lpVtbl -> CreatePixelShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppPixelShader) ) + +#define ID3D11Device_CreateHullShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppHullShader) \ + ( (This)->lpVtbl -> CreateHullShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppHullShader) ) + +#define ID3D11Device_CreateDomainShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppDomainShader) \ + ( (This)->lpVtbl -> CreateDomainShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppDomainShader) ) + +#define ID3D11Device_CreateComputeShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppComputeShader) \ + ( (This)->lpVtbl -> CreateComputeShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppComputeShader) ) + +#define ID3D11Device_CreateClassLinkage(This,ppLinkage) \ + ( (This)->lpVtbl -> CreateClassLinkage(This,ppLinkage) ) + +#define ID3D11Device_CreateBlendState(This,pBlendStateDesc,ppBlendState) \ + ( (This)->lpVtbl -> CreateBlendState(This,pBlendStateDesc,ppBlendState) ) + +#define ID3D11Device_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) \ + ( (This)->lpVtbl -> CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) ) + +#define ID3D11Device_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) \ + ( (This)->lpVtbl -> CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) ) + +#define ID3D11Device_CreateSamplerState(This,pSamplerDesc,ppSamplerState) \ + ( (This)->lpVtbl -> CreateSamplerState(This,pSamplerDesc,ppSamplerState) ) + +#define ID3D11Device_CreateQuery(This,pQueryDesc,ppQuery) \ + ( (This)->lpVtbl -> CreateQuery(This,pQueryDesc,ppQuery) ) + +#define ID3D11Device_CreatePredicate(This,pPredicateDesc,ppPredicate) \ + ( (This)->lpVtbl -> CreatePredicate(This,pPredicateDesc,ppPredicate) ) + +#define ID3D11Device_CreateCounter(This,pCounterDesc,ppCounter) \ + ( (This)->lpVtbl -> CreateCounter(This,pCounterDesc,ppCounter) ) + +#define ID3D11Device_CreateDeferredContext(This,ContextFlags,ppDeferredContext) \ + ( (This)->lpVtbl -> CreateDeferredContext(This,ContextFlags,ppDeferredContext) ) + +#define ID3D11Device_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) \ + ( (This)->lpVtbl -> OpenSharedResource(This,hResource,ReturnedInterface,ppResource) ) + +#define ID3D11Device_CheckFormatSupport(This,Format,pFormatSupport) \ + ( (This)->lpVtbl -> CheckFormatSupport(This,Format,pFormatSupport) ) + +#define ID3D11Device_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) \ + ( (This)->lpVtbl -> CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) ) + +#define ID3D11Device_CheckCounterInfo(This,pCounterInfo) \ + ( (This)->lpVtbl -> CheckCounterInfo(This,pCounterInfo) ) + +#define ID3D11Device_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) \ + ( (This)->lpVtbl -> CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) ) + +#define ID3D11Device_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D11Device_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Device_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Device_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D11Device_GetFeatureLevel(This) \ + ( (This)->lpVtbl -> GetFeatureLevel(This) ) + +#define ID3D11Device_GetCreationFlags(This) \ + ( (This)->lpVtbl -> GetCreationFlags(This) ) + +#define ID3D11Device_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D11Device_GetImmediateContext(This,ppImmediateContext) \ + ( (This)->lpVtbl -> GetImmediateContext(This,ppImmediateContext) ) + +#define ID3D11Device_SetExceptionMode(This,RaiseFlags) \ + ( (This)->lpVtbl -> SetExceptionMode(This,RaiseFlags) ) + +#define ID3D11Device_GetExceptionMode(This) \ + ( (This)->lpVtbl -> GetExceptionMode(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Device_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0031 */ +/* [local] */ + +typedef +enum D3D11_CREATE_DEVICE_FLAG + { D3D11_CREATE_DEVICE_SINGLETHREADED = 0x1, + D3D11_CREATE_DEVICE_DEBUG = 0x2, + D3D11_CREATE_DEVICE_SWITCH_TO_REF = 0x4, + D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8, + D3D11_CREATE_DEVICE_BGRA_SUPPORT = 0x20 + } D3D11_CREATE_DEVICE_FLAG; + +#define D3D11_SDK_VERSION ( 7 ) + +#include "d3d10_1.h" +#if !defined( D3D11_IGNORE_SDK_LAYERS ) +#include "d3d11sdklayers.h" +#endif +#include "d3d10misc.h" +#include "d3d10shader.h" +#include "d3d10effect.h" +#include "d3d10_1shader.h" + +/////////////////////////////////////////////////////////////////////////// +// D3D11CreateDevice +// ------------------ +// +// pAdapter +// If NULL, D3D11CreateDevice will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D11CreateDevice will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D11CreateDeviceAndSwapChain. +// pFeatureLevels +// Any of those documented for D3D11CreateDeviceAndSwapChain. +// FeatureLevels +// Size of feature levels array. +// SDKVersion +// SDK version. Use the D3D11_SDK_VERSION macro. +// ppDevice +// Pointer to returned interface. May be NULL. +// pFeatureLevel +// Pointer to returned feature level. May be NULL. +// ppImmediateContext +// Pointer to returned interface. May be NULL. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory1 +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D11CreateDevice +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D11_CREATE_DEVICE)( __in_opt IDXGIAdapter*, + D3D_DRIVER_TYPE, HMODULE, UINT, + __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL*, + UINT FeatureLevels, UINT, __out_opt ID3D11Device**, + __out_opt D3D_FEATURE_LEVEL*, __out_opt ID3D11DeviceContext** ); + +HRESULT WINAPI D3D11CreateDevice( + __in_opt IDXGIAdapter* pAdapter, + D3D_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels, + UINT FeatureLevels, + UINT SDKVersion, + __out_opt ID3D11Device** ppDevice, + __out_opt D3D_FEATURE_LEVEL* pFeatureLevel, + __out_opt ID3D11DeviceContext** ppImmediateContext ); + +/////////////////////////////////////////////////////////////////////////// +// D3D11CreateDeviceAndSwapChain +// ------------------------------ +// +// ppAdapter +// If NULL, D3D11CreateDevice will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D11CreateDevice will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D11CreateDevice. +// pFeatureLevels +// Array of any of the following: +// D3D_FEATURE_LEVEL_11_0 +// D3D_FEATURE_LEVEL_10_1 +// D3D_FEATURE_LEVEL_10_0 +// D3D_FEATURE_LEVEL_9_3 +// D3D_FEATURE_LEVEL_9_2 +// D3D_FEATURE_LEVEL_9_1 +// Order indicates sequence in which instantiation will be attempted. If +// NULL, then the implied order is the same as previously listed (i.e. +// prefer most features available). +// FeatureLevels +// Size of feature levels array. +// SDKVersion +// SDK version. Use the D3D11_SDK_VERSION macro. +// pSwapChainDesc +// Swap chain description, may be NULL. +// ppSwapChain +// Pointer to returned interface. May be NULL. +// ppDevice +// Pointer to returned interface. May be NULL. +// pFeatureLevel +// Pointer to returned feature level. May be NULL. +// ppImmediateContext +// Pointer to returned interface. May be NULL. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory1 +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D11CreateDevice +// IDXGIFactory::CreateSwapChain +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN)( __in_opt IDXGIAdapter*, + D3D_DRIVER_TYPE, HMODULE, UINT, + __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL*, + UINT FeatureLevels, UINT, __in_opt CONST DXGI_SWAP_CHAIN_DESC*, + __out_opt IDXGISwapChain**, __out_opt ID3D11Device**, + __out_opt D3D_FEATURE_LEVEL*, __out_opt ID3D11DeviceContext** ); + +HRESULT WINAPI D3D11CreateDeviceAndSwapChain( + __in_opt IDXGIAdapter* pAdapter, + D3D_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels, + UINT FeatureLevels, + UINT SDKVersion, + __in_opt CONST DXGI_SWAP_CHAIN_DESC* pSwapChainDesc, + __out_opt IDXGISwapChain** ppSwapChain, + __out_opt ID3D11Device** ppDevice, + __out_opt D3D_FEATURE_LEVEL* pFeatureLevel, + __out_opt ID3D11DeviceContext** ppImmediateContext ); + +DEFINE_GUID(IID_ID3D11DeviceChild,0x1841e5c8,0x16b0,0x489b,0xbc,0xc8,0x44,0xcf,0xb0,0xd5,0xde,0xae); +DEFINE_GUID(IID_ID3D11DepthStencilState,0x03823efb,0x8d8f,0x4e1c,0x9a,0xa2,0xf6,0x4b,0xb2,0xcb,0xfd,0xf1); +DEFINE_GUID(IID_ID3D11BlendState,0x75b68faa,0x347d,0x4159,0x8f,0x45,0xa0,0x64,0x0f,0x01,0xcd,0x9a); +DEFINE_GUID(IID_ID3D11RasterizerState,0x9bb4ab81,0xab1a,0x4d8f,0xb5,0x06,0xfc,0x04,0x20,0x0b,0x6e,0xe7); +DEFINE_GUID(IID_ID3D11Resource,0xdc8e63f3,0xd12b,0x4952,0xb4,0x7b,0x5e,0x45,0x02,0x6a,0x86,0x2d); +DEFINE_GUID(IID_ID3D11Buffer,0x48570b85,0xd1ee,0x4fcd,0xa2,0x50,0xeb,0x35,0x07,0x22,0xb0,0x37); +DEFINE_GUID(IID_ID3D11Texture1D,0xf8fb5c27,0xc6b3,0x4f75,0xa4,0xc8,0x43,0x9a,0xf2,0xef,0x56,0x4c); +DEFINE_GUID(IID_ID3D11Texture2D,0x6f15aaf2,0xd208,0x4e89,0x9a,0xb4,0x48,0x95,0x35,0xd3,0x4f,0x9c); +DEFINE_GUID(IID_ID3D11Texture3D,0x037e866e,0xf56d,0x4357,0xa8,0xaf,0x9d,0xab,0xbe,0x6e,0x25,0x0e); +DEFINE_GUID(IID_ID3D11View,0x839d1216,0xbb2e,0x412b,0xb7,0xf4,0xa9,0xdb,0xeb,0xe0,0x8e,0xd1); +DEFINE_GUID(IID_ID3D11ShaderResourceView,0xb0e06fe0,0x8192,0x4e1a,0xb1,0xca,0x36,0xd7,0x41,0x47,0x10,0xb2); +DEFINE_GUID(IID_ID3D11RenderTargetView,0xdfdba067,0x0b8d,0x4865,0x87,0x5b,0xd7,0xb4,0x51,0x6c,0xc1,0x64); +DEFINE_GUID(IID_ID3D11DepthStencilView,0x9fdac92a,0x1876,0x48c3,0xaf,0xad,0x25,0xb9,0x4f,0x84,0xa9,0xb6); +DEFINE_GUID(IID_ID3D11UnorderedAccessView,0x28acf509,0x7f5c,0x48f6,0x86,0x11,0xf3,0x16,0x01,0x0a,0x63,0x80); +DEFINE_GUID(IID_ID3D11VertexShader,0x3b301d64,0xd678,0x4289,0x88,0x97,0x22,0xf8,0x92,0x8b,0x72,0xf3); +DEFINE_GUID(IID_ID3D11HullShader,0x8e5c6061,0x628a,0x4c8e,0x82,0x64,0xbb,0xe4,0x5c,0xb3,0xd5,0xdd); +DEFINE_GUID(IID_ID3D11DomainShader,0xf582c508,0x0f36,0x490c,0x99,0x77,0x31,0xee,0xce,0x26,0x8c,0xfa); +DEFINE_GUID(IID_ID3D11GeometryShader,0x38325b96,0xeffb,0x4022,0xba,0x02,0x2e,0x79,0x5b,0x70,0x27,0x5c); +DEFINE_GUID(IID_ID3D11PixelShader,0xea82e40d,0x51dc,0x4f33,0x93,0xd4,0xdb,0x7c,0x91,0x25,0xae,0x8c); +DEFINE_GUID(IID_ID3D11ComputeShader,0x4f5b196e,0xc2bd,0x495e,0xbd,0x01,0x1f,0xde,0xd3,0x8e,0x49,0x69); +DEFINE_GUID(IID_ID3D11InputLayout,0xe4819ddc,0x4cf0,0x4025,0xbd,0x26,0x5d,0xe8,0x2a,0x3e,0x07,0xb7); +DEFINE_GUID(IID_ID3D11SamplerState,0xda6fea51,0x564c,0x4487,0x98,0x10,0xf0,0xd0,0xf9,0xb4,0xe3,0xa5); +DEFINE_GUID(IID_ID3D11Asynchronous,0x4b35d0cd,0x1e15,0x4258,0x9c,0x98,0x1b,0x13,0x33,0xf6,0xdd,0x3b); +DEFINE_GUID(IID_ID3D11Query,0xd6c00747,0x87b7,0x425e,0xb8,0x4d,0x44,0xd1,0x08,0x56,0x0a,0xfd); +DEFINE_GUID(IID_ID3D11Predicate,0x9eb576dd,0x9f77,0x4d86,0x81,0xaa,0x8b,0xab,0x5f,0xe4,0x90,0xe2); +DEFINE_GUID(IID_ID3D11Counter,0x6e8c49fb,0xa371,0x4770,0xb4,0x40,0x29,0x08,0x60,0x22,0xb7,0x41); +DEFINE_GUID(IID_ID3D11ClassInstance,0xa6cd7faa,0xb0b7,0x4a2f,0x94,0x36,0x86,0x62,0xa6,0x57,0x97,0xcb); +DEFINE_GUID(IID_ID3D11ClassLinkage,0xddf57cba,0x9543,0x46e4,0xa1,0x2b,0xf2,0x07,0xa0,0xfe,0x7f,0xed); +DEFINE_GUID(IID_ID3D11CommandList,0xa24bc4d1,0x769e,0x43f7,0x80,0x13,0x98,0xff,0x56,0x6c,0x18,0xe2); +DEFINE_GUID(IID_ID3D11DeviceContext,0xc0bfa96c,0xe089,0x44fb,0x8e,0xaf,0x26,0xf8,0x79,0x61,0x90,0xda); +DEFINE_GUID(IID_ID3D11Device,0xdb6f6ddb,0xac77,0x4e88,0x82,0x53,0x81,0x9d,0xf9,0xbb,0xf1,0x40); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0031_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0031_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/RenderDll/Dx9Sdk/Include/D3D11SDKLayers.h b/RenderDll/Dx9Sdk/Include/D3D11SDKLayers.h new file mode 100644 index 0000000..5970f81 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3D11SDKLayers.h @@ -0,0 +1,1669 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* Compiler settings for d3d11sdklayers.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d11sdklayers_h__ +#define __d3d11sdklayers_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D11Debug_FWD_DEFINED__ +#define __ID3D11Debug_FWD_DEFINED__ +typedef interface ID3D11Debug ID3D11Debug; +#endif /* __ID3D11Debug_FWD_DEFINED__ */ + + +#ifndef __ID3D11SwitchToRef_FWD_DEFINED__ +#define __ID3D11SwitchToRef_FWD_DEFINED__ +typedef interface ID3D11SwitchToRef ID3D11SwitchToRef; +#endif /* __ID3D11SwitchToRef_FWD_DEFINED__ */ + + +#ifndef __ID3D11InfoQueue_FWD_DEFINED__ +#define __ID3D11InfoQueue_FWD_DEFINED__ +typedef interface ID3D11InfoQueue ID3D11InfoQueue; +#endif /* __ID3D11InfoQueue_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "d3d11.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d11sdklayers_0000_0000 */ +/* [local] */ + +#define D3D11_SDK_LAYERS_VERSION ( 1 ) + +#define D3D11_DEBUG_FEATURE_FLUSH_PER_RENDER_OP ( 0x1 ) + +#define D3D11_DEBUG_FEATURE_FINISH_PER_RENDER_OP ( 0x2 ) + +#define D3D11_DEBUG_FEATURE_PRESENT_PER_RENDER_OP ( 0x4 ) + +typedef +enum D3D11_RLDO_FLAGS + { D3D11_RLDO_SUMMARY = 0x1, + D3D11_RLDO_DETAIL = 0x2 + } D3D11_RLDO_FLAGS; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +inline D3D11_RLDO_FLAGS operator~( D3D11_RLDO_FLAGS a ) +{ return D3D11_RLDO_FLAGS( ~UINT( a ) ); } +inline D3D11_RLDO_FLAGS operator&( D3D11_RLDO_FLAGS a, D3D11_RLDO_FLAGS b ) +{ return D3D11_RLDO_FLAGS( UINT( a ) & UINT( b ) ); } +inline D3D11_RLDO_FLAGS operator|( D3D11_RLDO_FLAGS a, D3D11_RLDO_FLAGS b ) +{ return D3D11_RLDO_FLAGS( UINT( a ) | UINT( b ) ); } +inline D3D11_RLDO_FLAGS operator^( D3D11_RLDO_FLAGS a, D3D11_RLDO_FLAGS b ) +{ return D3D11_RLDO_FLAGS( UINT( a ) ^ UINT( b ) ); } +inline D3D11_RLDO_FLAGS& operator&=( D3D11_RLDO_FLAGS& a, D3D11_RLDO_FLAGS b ) +{ a = a & b; return a; } +inline D3D11_RLDO_FLAGS& operator|=( D3D11_RLDO_FLAGS& a, D3D11_RLDO_FLAGS b ) +{ a = a | b; return a; } +inline D3D11_RLDO_FLAGS& operator^=( D3D11_RLDO_FLAGS& a, D3D11_RLDO_FLAGS b ) +{ a = a ^ b; return a; } +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D11Debug_INTERFACE_DEFINED__ +#define __ID3D11Debug_INTERFACE_DEFINED__ + +/* interface ID3D11Debug */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Debug; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("79cf2233-7536-4948-9d36-1e4692dc5760") + ID3D11Debug : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetFeatureMask( + UINT Mask) = 0; + + virtual UINT STDMETHODCALLTYPE GetFeatureMask( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPresentPerRenderOpDelay( + UINT Milliseconds) = 0; + + virtual UINT STDMETHODCALLTYPE GetPresentPerRenderOpDelay( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetSwapChain( + /* [annotation] */ + __in_opt IDXGISwapChain *pSwapChain) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetSwapChain( + /* [annotation] */ + __out IDXGISwapChain **ppSwapChain) = 0; + + virtual HRESULT STDMETHODCALLTYPE ValidateContext( + /* [annotation] */ + __in ID3D11DeviceContext *pContext) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects( + D3D11_RLDO_FLAGS Flags) = 0; + + virtual HRESULT STDMETHODCALLTYPE ValidateContextForDispatch( + /* [annotation] */ + __in ID3D11DeviceContext *pContext) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DebugVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Debug * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Debug * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D11Debug * This, + UINT Mask); + + UINT ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D11Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetPresentPerRenderOpDelay )( + ID3D11Debug * This, + UINT Milliseconds); + + UINT ( STDMETHODCALLTYPE *GetPresentPerRenderOpDelay )( + ID3D11Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetSwapChain )( + ID3D11Debug * This, + /* [annotation] */ + __in_opt IDXGISwapChain *pSwapChain); + + HRESULT ( STDMETHODCALLTYPE *GetSwapChain )( + ID3D11Debug * This, + /* [annotation] */ + __out IDXGISwapChain **ppSwapChain); + + HRESULT ( STDMETHODCALLTYPE *ValidateContext )( + ID3D11Debug * This, + /* [annotation] */ + __in ID3D11DeviceContext *pContext); + + HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )( + ID3D11Debug * This, + D3D11_RLDO_FLAGS Flags); + + HRESULT ( STDMETHODCALLTYPE *ValidateContextForDispatch )( + ID3D11Debug * This, + /* [annotation] */ + __in ID3D11DeviceContext *pContext); + + END_INTERFACE + } ID3D11DebugVtbl; + + interface ID3D11Debug + { + CONST_VTBL struct ID3D11DebugVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Debug_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Debug_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Debug_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Debug_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D11Debug_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + +#define ID3D11Debug_SetPresentPerRenderOpDelay(This,Milliseconds) \ + ( (This)->lpVtbl -> SetPresentPerRenderOpDelay(This,Milliseconds) ) + +#define ID3D11Debug_GetPresentPerRenderOpDelay(This) \ + ( (This)->lpVtbl -> GetPresentPerRenderOpDelay(This) ) + +#define ID3D11Debug_SetSwapChain(This,pSwapChain) \ + ( (This)->lpVtbl -> SetSwapChain(This,pSwapChain) ) + +#define ID3D11Debug_GetSwapChain(This,ppSwapChain) \ + ( (This)->lpVtbl -> GetSwapChain(This,ppSwapChain) ) + +#define ID3D11Debug_ValidateContext(This,pContext) \ + ( (This)->lpVtbl -> ValidateContext(This,pContext) ) + +#define ID3D11Debug_ReportLiveDeviceObjects(This,Flags) \ + ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) ) + +#define ID3D11Debug_ValidateContextForDispatch(This,pContext) \ + ( (This)->lpVtbl -> ValidateContextForDispatch(This,pContext) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Debug_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11SwitchToRef_INTERFACE_DEFINED__ +#define __ID3D11SwitchToRef_INTERFACE_DEFINED__ + +/* interface ID3D11SwitchToRef */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11SwitchToRef; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1ef337e3-58e7-4f83-a692-db221f5ed47e") + ID3D11SwitchToRef : public IUnknown + { + public: + virtual BOOL STDMETHODCALLTYPE SetUseRef( + BOOL UseRef) = 0; + + virtual BOOL STDMETHODCALLTYPE GetUseRef( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11SwitchToRefVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11SwitchToRef * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11SwitchToRef * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11SwitchToRef * This); + + BOOL ( STDMETHODCALLTYPE *SetUseRef )( + ID3D11SwitchToRef * This, + BOOL UseRef); + + BOOL ( STDMETHODCALLTYPE *GetUseRef )( + ID3D11SwitchToRef * This); + + END_INTERFACE + } ID3D11SwitchToRefVtbl; + + interface ID3D11SwitchToRef + { + CONST_VTBL struct ID3D11SwitchToRefVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11SwitchToRef_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11SwitchToRef_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11SwitchToRef_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11SwitchToRef_SetUseRef(This,UseRef) \ + ( (This)->lpVtbl -> SetUseRef(This,UseRef) ) + +#define ID3D11SwitchToRef_GetUseRef(This) \ + ( (This)->lpVtbl -> GetUseRef(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11SwitchToRef_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11sdklayers_0000_0002 */ +/* [local] */ + +typedef +enum D3D11_MESSAGE_CATEGORY + { D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0, + D3D11_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) , + D3D11_MESSAGE_CATEGORY_INITIALIZATION = ( D3D11_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) , + D3D11_MESSAGE_CATEGORY_CLEANUP = ( D3D11_MESSAGE_CATEGORY_INITIALIZATION + 1 ) , + D3D11_MESSAGE_CATEGORY_COMPILATION = ( D3D11_MESSAGE_CATEGORY_CLEANUP + 1 ) , + D3D11_MESSAGE_CATEGORY_STATE_CREATION = ( D3D11_MESSAGE_CATEGORY_COMPILATION + 1 ) , + D3D11_MESSAGE_CATEGORY_STATE_SETTING = ( D3D11_MESSAGE_CATEGORY_STATE_CREATION + 1 ) , + D3D11_MESSAGE_CATEGORY_STATE_GETTING = ( D3D11_MESSAGE_CATEGORY_STATE_SETTING + 1 ) , + D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D11_MESSAGE_CATEGORY_STATE_GETTING + 1 ) , + D3D11_MESSAGE_CATEGORY_EXECUTION = ( D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) + } D3D11_MESSAGE_CATEGORY; + +typedef +enum D3D11_MESSAGE_SEVERITY + { D3D11_MESSAGE_SEVERITY_CORRUPTION = 0, + D3D11_MESSAGE_SEVERITY_ERROR = ( D3D11_MESSAGE_SEVERITY_CORRUPTION + 1 ) , + D3D11_MESSAGE_SEVERITY_WARNING = ( D3D11_MESSAGE_SEVERITY_ERROR + 1 ) , + D3D11_MESSAGE_SEVERITY_INFO = ( D3D11_MESSAGE_SEVERITY_WARNING + 1 ) + } D3D11_MESSAGE_SEVERITY; + +typedef +enum D3D11_MESSAGE_ID + { D3D11_MESSAGE_ID_UNKNOWN = 0, + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_UNKNOWN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_THIS = ( D3D11_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D11_MESSAGE_ID_CORRUPTED_THIS + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) , + D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) , + D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) , + D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) , + D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) , + D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC = ( D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) , + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) , + D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) , + D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1 ) , + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) , + D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1 ) , + D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID = ( D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = ( D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1 ) , + D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1 ) , + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) , + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) , + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) , + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1 ) , + D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1 ) , + D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) , + D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) , + D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) , + D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1 ) , + D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1 ) , + D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) , + D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_REF_THREADING_MODE = ( D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) , + D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D11_MESSAGE_ID_REF_THREADING_MODE + 1 ) , + D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) , + D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) , + D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) , + D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) , + D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) , + D3D11_MESSAGE_ID_REF_INFO = ( D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_REF_INFO + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) , + D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) , + D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) , + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = ( D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1 ) , + D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1 ) , + D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER = ( D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED = ( D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN = ( D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC = ( D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + 1 ) , + D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER = ( D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER + 1 ) , + D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE = ( D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) , + D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED = ( D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + 1 ) , + D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION = ( D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE = ( D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + 1 ) , + D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS = ( D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + 1 ) , + D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION = ( D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + 1 ) , + D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS = ( D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + 1 ) , + D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN = ( D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + 1 ) , + D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE = ( D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + 1 ) , + D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE + 1 ) , + D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1 ) , + D3D11_MESSAGE_ID_D3D10_MESSAGES_END = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x100000, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED = ( D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + 1 ) , + D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + 1 ) , + D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS = ( D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + 1 ) , + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS = ( D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + 1 ) , + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + 1 ) , + D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK = ( D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK = ( D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT = ( D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + 1 ) , + D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD = ( D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER = ( D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE = ( D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES = ( D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + 1 ) , + D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + 1 ) , + D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND = ( D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + 1 ) , + D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 = ( D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED = ( D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + 1 ) , + D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO = ( D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION = ( D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR = ( D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP = ( D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + 1 ) , + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_D3D10L9_MESSAGES_END = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + 1 ) , + D3D11_MESSAGE_ID_D3D11_MESSAGES_START = 0x200000, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_D3D11_MESSAGES_START + 1 ) , + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS + 1 ) , + D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED + 1 ) , + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN + 1 ) , + D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT + 1 ) , + D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL + 1 ) , + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL + 1 ) , + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER = ( D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD = ( D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS = ( D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_CREATE_CONTEXT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_LIVE_CONTEXT = ( D3D11_MESSAGE_ID_CREATE_CONTEXT + 1 ) , + D3D11_MESSAGE_ID_DESTROY_CONTEXT = ( D3D11_MESSAGE_ID_LIVE_CONTEXT + 1 ) , + D3D11_MESSAGE_ID_CREATE_BUFFER = ( D3D11_MESSAGE_ID_DESTROY_CONTEXT + 1 ) , + D3D11_MESSAGE_ID_LIVE_BUFFER = ( D3D11_MESSAGE_ID_CREATE_BUFFER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_BUFFER = ( D3D11_MESSAGE_ID_LIVE_BUFFER + 1 ) , + D3D11_MESSAGE_ID_CREATE_TEXTURE1D = ( D3D11_MESSAGE_ID_DESTROY_BUFFER + 1 ) , + D3D11_MESSAGE_ID_LIVE_TEXTURE1D = ( D3D11_MESSAGE_ID_CREATE_TEXTURE1D + 1 ) , + D3D11_MESSAGE_ID_DESTROY_TEXTURE1D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE1D + 1 ) , + D3D11_MESSAGE_ID_CREATE_TEXTURE2D = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE1D + 1 ) , + D3D11_MESSAGE_ID_LIVE_TEXTURE2D = ( D3D11_MESSAGE_ID_CREATE_TEXTURE2D + 1 ) , + D3D11_MESSAGE_ID_DESTROY_TEXTURE2D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE2D + 1 ) , + D3D11_MESSAGE_ID_CREATE_TEXTURE3D = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE2D + 1 ) , + D3D11_MESSAGE_ID_LIVE_TEXTURE3D = ( D3D11_MESSAGE_ID_CREATE_TEXTURE3D + 1 ) , + D3D11_MESSAGE_ID_DESTROY_TEXTURE3D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE3D + 1 ) , + D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE3D + 1 ) , + D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW + 1 ) , + D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW + 1 ) , + D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW + 1 ) , + D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW + 1 ) , + D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW + 1 ) , + D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW + 1 ) , + D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW + 1 ) , + D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW + 1 ) , + D3D11_MESSAGE_ID_CREATE_VERTEXSHADER = ( D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW + 1 ) , + D3D11_MESSAGE_ID_LIVE_VERTEXSHADER = ( D3D11_MESSAGE_ID_CREATE_VERTEXSHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER = ( D3D11_MESSAGE_ID_LIVE_VERTEXSHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_HULLSHADER = ( D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_HULLSHADER = ( D3D11_MESSAGE_ID_CREATE_HULLSHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_HULLSHADER = ( D3D11_MESSAGE_ID_LIVE_HULLSHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_DOMAINSHADER = ( D3D11_MESSAGE_ID_DESTROY_HULLSHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_DOMAINSHADER = ( D3D11_MESSAGE_ID_CREATE_DOMAINSHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER = ( D3D11_MESSAGE_ID_LIVE_DOMAINSHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_PIXELSHADER = ( D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_PIXELSHADER = ( D3D11_MESSAGE_ID_CREATE_PIXELSHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_PIXELSHADER = ( D3D11_MESSAGE_ID_LIVE_PIXELSHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT = ( D3D11_MESSAGE_ID_DESTROY_PIXELSHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT = ( D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT + 1 ) , + D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT = ( D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT + 1 ) , + D3D11_MESSAGE_ID_CREATE_SAMPLER = ( D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT + 1 ) , + D3D11_MESSAGE_ID_LIVE_SAMPLER = ( D3D11_MESSAGE_ID_CREATE_SAMPLER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_SAMPLER = ( D3D11_MESSAGE_ID_LIVE_SAMPLER + 1 ) , + D3D11_MESSAGE_ID_CREATE_BLENDSTATE = ( D3D11_MESSAGE_ID_DESTROY_SAMPLER + 1 ) , + D3D11_MESSAGE_ID_LIVE_BLENDSTATE = ( D3D11_MESSAGE_ID_CREATE_BLENDSTATE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_BLENDSTATE = ( D3D11_MESSAGE_ID_LIVE_BLENDSTATE + 1 ) , + D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_DESTROY_BLENDSTATE + 1 ) , + D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE + 1 ) , + D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE + 1 ) , + D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE + 1 ) , + D3D11_MESSAGE_ID_CREATE_QUERY = ( D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE + 1 ) , + D3D11_MESSAGE_ID_LIVE_QUERY = ( D3D11_MESSAGE_ID_CREATE_QUERY + 1 ) , + D3D11_MESSAGE_ID_DESTROY_QUERY = ( D3D11_MESSAGE_ID_LIVE_QUERY + 1 ) , + D3D11_MESSAGE_ID_CREATE_PREDICATE = ( D3D11_MESSAGE_ID_DESTROY_QUERY + 1 ) , + D3D11_MESSAGE_ID_LIVE_PREDICATE = ( D3D11_MESSAGE_ID_CREATE_PREDICATE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_PREDICATE = ( D3D11_MESSAGE_ID_LIVE_PREDICATE + 1 ) , + D3D11_MESSAGE_ID_CREATE_COUNTER = ( D3D11_MESSAGE_ID_DESTROY_PREDICATE + 1 ) , + D3D11_MESSAGE_ID_LIVE_COUNTER = ( D3D11_MESSAGE_ID_CREATE_COUNTER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_COUNTER = ( D3D11_MESSAGE_ID_LIVE_COUNTER + 1 ) , + D3D11_MESSAGE_ID_CREATE_COMMANDLIST = ( D3D11_MESSAGE_ID_DESTROY_COUNTER + 1 ) , + D3D11_MESSAGE_ID_LIVE_COMMANDLIST = ( D3D11_MESSAGE_ID_CREATE_COMMANDLIST + 1 ) , + D3D11_MESSAGE_ID_DESTROY_COMMANDLIST = ( D3D11_MESSAGE_ID_LIVE_COMMANDLIST + 1 ) , + D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE = ( D3D11_MESSAGE_ID_DESTROY_COMMANDLIST + 1 ) , + D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE = ( D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE = ( D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE + 1 ) , + D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE = ( D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE + 1 ) , + D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE = ( D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_LIVE_DEVICE = ( D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY = ( D3D11_MESSAGE_ID_LIVE_DEVICE + 1 ) , + D3D11_MESSAGE_ID_CREATE_COMPUTESHADER = ( D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY + 1 ) , + D3D11_MESSAGE_ID_LIVE_COMPUTESHADER = ( D3D11_MESSAGE_ID_CREATE_COMPUTESHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER = ( D3D11_MESSAGE_ID_LIVE_COMPUTESHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW + 1 ) , + D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL = ( D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE = ( D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL + 1 ) , + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE = ( D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS + 1 ) , + D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP + 1 ) , + D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER = ( D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT + 1 ) , + D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY = ( D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY + 1 ) , + D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET + 1 ) , + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET + 1 ) , + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE + 1 ) , + D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW = ( D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET + 1 ) , + D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED = ( D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_REF_WARNING = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_D3D11_MESSAGES_END = ( D3D11_MESSAGE_ID_REF_WARNING + 1 ) + } D3D11_MESSAGE_ID; + +typedef struct D3D11_MESSAGE + { + D3D11_MESSAGE_CATEGORY Category; + D3D11_MESSAGE_SEVERITY Severity; + D3D11_MESSAGE_ID ID; + const char *pDescription; + SIZE_T DescriptionByteLength; + } D3D11_MESSAGE; + +typedef struct D3D11_INFO_QUEUE_FILTER_DESC + { + UINT NumCategories; + D3D11_MESSAGE_CATEGORY *pCategoryList; + UINT NumSeverities; + D3D11_MESSAGE_SEVERITY *pSeverityList; + UINT NumIDs; + D3D11_MESSAGE_ID *pIDList; + } D3D11_INFO_QUEUE_FILTER_DESC; + +typedef struct D3D11_INFO_QUEUE_FILTER + { + D3D11_INFO_QUEUE_FILTER_DESC AllowList; + D3D11_INFO_QUEUE_FILTER_DESC DenyList; + } D3D11_INFO_QUEUE_FILTER; + +#define D3D11_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024 + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0002_v0_0_s_ifspec; + +#ifndef __ID3D11InfoQueue_INTERFACE_DEFINED__ +#define __ID3D11InfoQueue_INTERFACE_DEFINED__ + +/* interface ID3D11InfoQueue */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11InfoQueue; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6543dbb6-1b48-42f5-ab82-e97ec74326f6") + ID3D11InfoQueue : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit( + /* [annotation] */ + __in UINT64 MessageCountLimit) = 0; + + virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetMessage( + /* [annotation] */ + __in UINT64 MessageIndex, + /* [annotation] */ + __out_bcount_opt(*pMessageByteLength) D3D11_MESSAGE *pMessage, + /* [annotation] */ + __inout SIZE_T *pMessageByteLength) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries( + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetStorageFilter( + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushStorageFilter( + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries( + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter( + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter( + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddMessage( + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in D3D11_MESSAGE_ID ID, + /* [annotation] */ + __in LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage( + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory( + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity( + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnID( + /* [annotation] */ + __in D3D11_MESSAGE_ID ID, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory( + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity( + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnID( + /* [annotation] */ + __in D3D11_MESSAGE_ID ID) = 0; + + virtual void STDMETHODCALLTYPE SetMuteDebugOutput( + /* [annotation] */ + __in BOOL bMute) = 0; + + virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11InfoQueueVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11InfoQueue * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11InfoQueue * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in UINT64 MessageCountLimit); + + void ( STDMETHODCALLTYPE *ClearStoredMessages )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *GetMessage )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in UINT64 MessageIndex, + /* [annotation] */ + __out_bcount_opt(*pMessageByteLength) D3D11_MESSAGE *pMessage, + /* [annotation] */ + __inout SIZE_T *pMessageByteLength); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )( + ID3D11InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )( + ID3D11InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )( + ID3D11InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )( + ID3D11InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )( + ID3D11InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter); + + HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )( + ID3D11InfoQueue * This, + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength); + + void ( STDMETHODCALLTYPE *ClearStorageFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter); + + void ( STDMETHODCALLTYPE *PopStorageFilter )( + ID3D11InfoQueue * This); + + UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter); + + HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )( + ID3D11InfoQueue * This, + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength); + + void ( STDMETHODCALLTYPE *ClearRetrievalFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter); + + void ( STDMETHODCALLTYPE *PopRetrievalFilter )( + ID3D11InfoQueue * This); + + UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddMessage )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in D3D11_MESSAGE_ID ID, + /* [annotation] */ + __in LPCSTR pDescription); + + HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in LPCSTR pDescription); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in BOOL bEnable); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in BOOL bEnable); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_ID ID, + /* [annotation] */ + __in BOOL bEnable); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnID )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_ID ID); + + void ( STDMETHODCALLTYPE *SetMuteDebugOutput )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in BOOL bMute); + + BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )( + ID3D11InfoQueue * This); + + END_INTERFACE + } ID3D11InfoQueueVtbl; + + interface ID3D11InfoQueue + { + CONST_VTBL struct ID3D11InfoQueueVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11InfoQueue_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11InfoQueue_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11InfoQueue_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \ + ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) ) + +#define ID3D11InfoQueue_ClearStoredMessages(This) \ + ( (This)->lpVtbl -> ClearStoredMessages(This) ) + +#define ID3D11InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \ + ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) ) + +#define ID3D11InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) ) + +#define ID3D11InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) ) + +#define ID3D11InfoQueue_GetNumStoredMessages(This) \ + ( (This)->lpVtbl -> GetNumStoredMessages(This) ) + +#define ID3D11InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \ + ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) ) + +#define ID3D11InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) ) + +#define ID3D11InfoQueue_GetMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetMessageCountLimit(This) ) + +#define ID3D11InfoQueue_AddStorageFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) ) + +#define ID3D11InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D11InfoQueue_ClearStorageFilter(This) \ + ( (This)->lpVtbl -> ClearStorageFilter(This) ) + +#define ID3D11InfoQueue_PushEmptyStorageFilter(This) \ + ( (This)->lpVtbl -> PushEmptyStorageFilter(This) ) + +#define ID3D11InfoQueue_PushCopyOfStorageFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) ) + +#define ID3D11InfoQueue_PushStorageFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) ) + +#define ID3D11InfoQueue_PopStorageFilter(This) \ + ( (This)->lpVtbl -> PopStorageFilter(This) ) + +#define ID3D11InfoQueue_GetStorageFilterStackSize(This) \ + ( (This)->lpVtbl -> GetStorageFilterStackSize(This) ) + +#define ID3D11InfoQueue_AddRetrievalFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) ) + +#define ID3D11InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D11InfoQueue_ClearRetrievalFilter(This) \ + ( (This)->lpVtbl -> ClearRetrievalFilter(This) ) + +#define ID3D11InfoQueue_PushEmptyRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) ) + +#define ID3D11InfoQueue_PushCopyOfRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) ) + +#define ID3D11InfoQueue_PushRetrievalFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) ) + +#define ID3D11InfoQueue_PopRetrievalFilter(This) \ + ( (This)->lpVtbl -> PopRetrievalFilter(This) ) + +#define ID3D11InfoQueue_GetRetrievalFilterStackSize(This) \ + ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) ) + +#define ID3D11InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \ + ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) ) + +#define ID3D11InfoQueue_AddApplicationMessage(This,Severity,pDescription) \ + ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) ) + +#define ID3D11InfoQueue_SetBreakOnCategory(This,Category,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) ) + +#define ID3D11InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) ) + +#define ID3D11InfoQueue_SetBreakOnID(This,ID,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) ) + +#define ID3D11InfoQueue_GetBreakOnCategory(This,Category) \ + ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) ) + +#define ID3D11InfoQueue_GetBreakOnSeverity(This,Severity) \ + ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) ) + +#define ID3D11InfoQueue_GetBreakOnID(This,ID) \ + ( (This)->lpVtbl -> GetBreakOnID(This,ID) ) + +#define ID3D11InfoQueue_SetMuteDebugOutput(This,bMute) \ + ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) ) + +#define ID3D11InfoQueue_GetMuteDebugOutput(This) \ + ( (This)->lpVtbl -> GetMuteDebugOutput(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11InfoQueue_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11sdklayers_0000_0003 */ +/* [local] */ + +#define D3D11_REGKEY_PATH __TEXT("Software\\Microsoft\\Direct3D") +#define D3D11_MUTE_DEBUG_OUTPUT __TEXT("MuteDebugOutput") +#define D3D11_ENABLE_BREAK_ON_MESSAGE __TEXT("EnableBreakOnMessage") +#define D3D11_INFOQUEUE_STORAGE_FILTER_OVERRIDE __TEXT("InfoQueueStorageFilterOverride") +#define D3D11_MUTE_CATEGORY __TEXT("Mute_CATEGORY_%s") +#define D3D11_MUTE_SEVERITY __TEXT("Mute_SEVERITY_%s") +#define D3D11_MUTE_ID_STRING __TEXT("Mute_ID_%s") +#define D3D11_MUTE_ID_DECIMAL __TEXT("Mute_ID_%d") +#define D3D11_UNMUTE_SEVERITY_INFO __TEXT("Unmute_SEVERITY_INFO") +#define D3D11_BREAKON_CATEGORY __TEXT("BreakOn_CATEGORY_%s") +#define D3D11_BREAKON_SEVERITY __TEXT("BreakOn_SEVERITY_%s") +#define D3D11_BREAKON_ID_STRING __TEXT("BreakOn_ID_%s") +#define D3D11_BREAKON_ID_DECIMAL __TEXT("BreakOn_ID_%d") +#define D3D11_APPSIZE_STRING __TEXT("Size") +#define D3D11_APPNAME_STRING __TEXT("Name") +DEFINE_GUID(IID_ID3D11Debug,0x79cf2233,0x7536,0x4948,0x9d,0x36,0x1e,0x46,0x92,0xdc,0x57,0x60); +DEFINE_GUID(IID_ID3D11SwitchToRef,0x1ef337e3,0x58e7,0x4f83,0xa6,0x92,0xdb,0x22,0x1f,0x5e,0xd4,0x7e); +DEFINE_GUID(IID_ID3D11InfoQueue,0x6543dbb6,0x1b48,0x42f5,0xab,0x82,0xe9,0x7e,0xc7,0x43,0x26,0xf6); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0003_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/RenderDll/Dx9Sdk/Include/D3D11Shader.h b/RenderDll/Dx9Sdk/Include/D3D11Shader.h new file mode 100644 index 0000000..f91897c --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3D11Shader.h @@ -0,0 +1,296 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3D11Shader.h +// Content: D3D11 Shader Types and APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D11SHADER_H__ +#define __D3D11SHADER_H__ + +#include "d3dcommon.h" + + +typedef enum D3D11_SHADER_VERSION_TYPE +{ + D3D11_SHVER_PIXEL_SHADER = 0, + D3D11_SHVER_VERTEX_SHADER = 1, + D3D11_SHVER_GEOMETRY_SHADER = 2, + + // D3D11 Shaders + D3D11_SHVER_HULL_SHADER = 3, + D3D11_SHVER_DOMAIN_SHADER = 4, + D3D11_SHVER_COMPUTE_SHADER = 5, +} D3D11_SHADER_VERSION_TYPE; + +#define D3D11_SHVER_GET_TYPE(_Version) \ + (((_Version) >> 16) & 0xffff) +#define D3D11_SHVER_GET_MAJOR(_Version) \ + (((_Version) >> 4) & 0xf) +#define D3D11_SHVER_GET_MINOR(_Version) \ + (((_Version) >> 0) & 0xf) + +typedef D3D_RESOURCE_RETURN_TYPE D3D11_RESOURCE_RETURN_TYPE; + +typedef D3D_CBUFFER_TYPE D3D11_CBUFFER_TYPE; + + +typedef struct _D3D11_SIGNATURE_PARAMETER_DESC +{ + LPCSTR SemanticName; // Name of the semantic + UINT SemanticIndex; // Index of the semantic + UINT Register; // Number of member variables + D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable + D3D_REGISTER_COMPONENT_TYPE ComponentType;// Scalar type (e.g. uint, float, etc.) + BYTE Mask; // Mask to indicate which components of the register + // are used (combination of D3D10_COMPONENT_MASK values) + BYTE ReadWriteMask; // Mask to indicate whether a given component is + // never written (if this is an output signature) or + // always read (if this is an input signature). + // (combination of D3D10_COMPONENT_MASK values) + UINT Stream; // Stream index +} D3D11_SIGNATURE_PARAMETER_DESC; + +typedef struct _D3D11_SHADER_BUFFER_DESC +{ + LPCSTR Name; // Name of the constant buffer + D3D_CBUFFER_TYPE Type; // Indicates type of buffer content + UINT Variables; // Number of member variables + UINT Size; // Size of CB (in bytes) + UINT uFlags; // Buffer description flags +} D3D11_SHADER_BUFFER_DESC; + +typedef struct _D3D11_SHADER_VARIABLE_DESC +{ + LPCSTR Name; // Name of the variable + UINT StartOffset; // Offset in constant buffer's backing store + UINT Size; // Size of variable (in bytes) + UINT uFlags; // Variable flags + LPVOID DefaultValue; // Raw pointer to default value + UINT StartTexture; // First texture index (or -1 if no textures used) + UINT TextureSize; // Number of texture slots possibly used. + UINT StartSampler; // First sampler index (or -1 if no textures used) + UINT SamplerSize; // Number of sampler slots possibly used. +} D3D11_SHADER_VARIABLE_DESC; + +typedef struct _D3D11_SHADER_TYPE_DESC +{ + D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.) + D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.) + UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable) + UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable) + UINT Elements; // Number of elements (0 if not an array) + UINT Members; // Number of members (0 if not a structure) + UINT Offset; // Offset from the start of structure (0 if not a structure member) + LPCSTR Name; // Name of type, can be NULL +} D3D11_SHADER_TYPE_DESC; + +typedef D3D_TESSELLATOR_DOMAIN D3D11_TESSELLATOR_DOMAIN; + +typedef D3D_TESSELLATOR_PARTITIONING D3D11_TESSELLATOR_PARTITIONING; + +typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D11_TESSELLATOR_OUTPUT_PRIMITIVE; + +typedef struct _D3D11_SHADER_DESC +{ + UINT Version; // Shader version + LPCSTR Creator; // Creator string + UINT Flags; // Shader compilation/parse flags + + UINT ConstantBuffers; // Number of constant buffers + UINT BoundResources; // Number of bound resources + UINT InputParameters; // Number of parameters in the input signature + UINT OutputParameters; // Number of parameters in the output signature + + UINT InstructionCount; // Number of emitted instructions + UINT TempRegisterCount; // Number of temporary registers used + UINT TempArrayCount; // Number of temporary arrays used + UINT DefCount; // Number of constant defines + UINT DclCount; // Number of declarations (input + output) + UINT TextureNormalInstructions; // Number of non-categorized texture instructions + UINT TextureLoadInstructions; // Number of texture load instructions + UINT TextureCompInstructions; // Number of texture comparison instructions + UINT TextureBiasInstructions; // Number of texture bias instructions + UINT TextureGradientInstructions; // Number of texture gradient instructions + UINT FloatInstructionCount; // Number of floating point arithmetic instructions used + UINT IntInstructionCount; // Number of signed integer arithmetic instructions used + UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used + UINT StaticFlowControlCount; // Number of static flow control instructions used + UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used + UINT MacroInstructionCount; // Number of macro instructions used + UINT ArrayInstructionCount; // Number of array instructions used + UINT CutInstructionCount; // Number of cut instructions used + UINT EmitInstructionCount; // Number of emit instructions used + D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology + UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count + D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive + UINT PatchConstantParameters; // Number of parameters in the patch constant signature + UINT cGSInstanceCount; // Number of Geometry shader instances + UINT cControlPoints; // Number of control points in the HS->DS stage + D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator + D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator + D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline) + // instruction counts + UINT cBarrierInstructions; // Number of barrier instructions in a compute shader + UINT cInterlockedInstructions; // Number of interlocked instructions + UINT cTextureStoreInstructions; // Number of texture writes +} D3D11_SHADER_DESC; + +typedef struct _D3D11_SHADER_INPUT_BIND_DESC +{ + LPCSTR Name; // Name of the resource + D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.) + UINT BindPoint; // Starting bind point + UINT BindCount; // Number of contiguous bind points (for arrays) + + UINT uFlags; // Input binding flags + D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture) + D3D_SRV_DIMENSION Dimension; // Dimension (if texture) + UINT NumSamples; // Number of samples (0 if not MS texture) +} D3D11_SHADER_INPUT_BIND_DESC; + + +////////////////////////////////////////////////////////////////////////////// +// Interfaces //////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D11ShaderReflectionType ID3D11ShaderReflectionType; +typedef interface ID3D11ShaderReflectionType *LPD3D11SHADERREFLECTIONTYPE; + +typedef interface ID3D11ShaderReflectionVariable ID3D11ShaderReflectionVariable; +typedef interface ID3D11ShaderReflectionVariable *LPD3D11SHADERREFLECTIONVARIABLE; + +typedef interface ID3D11ShaderReflectionConstantBuffer ID3D11ShaderReflectionConstantBuffer; +typedef interface ID3D11ShaderReflectionConstantBuffer *LPD3D11SHADERREFLECTIONCONSTANTBUFFER; + +typedef interface ID3D11ShaderReflection ID3D11ShaderReflection; +typedef interface ID3D11ShaderReflection *LPD3D11SHADERREFLECTION; + +// {6E6FFA6A-9BAE-4613-A51E-91652D508C21} +DEFINE_GUID(IID_ID3D11ShaderReflectionType, +0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21); + +#undef INTERFACE +#define INTERFACE ID3D11ShaderReflectionType + +DECLARE_INTERFACE(ID3D11ShaderReflectionType) +{ + STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_TYPE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ __in UINT Index) PURE; + STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByName)(THIS_ __in LPCSTR Name) PURE; + STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ __in UINT Index) PURE; + + STDMETHOD(IsEqual)(THIS_ __in ID3D11ShaderReflectionType* pType) PURE; + STDMETHOD_(ID3D11ShaderReflectionType*, GetSubType)(THIS) PURE; + STDMETHOD_(ID3D11ShaderReflectionType*, GetBaseClass)(THIS) PURE; + STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE; + STDMETHOD_(ID3D11ShaderReflectionType*, GetInterfaceByIndex)(THIS_ __in UINT uIndex) PURE; + STDMETHOD(IsOfType)(THIS_ __in ID3D11ShaderReflectionType* pType) PURE; + STDMETHOD(ImplementsInterface)(THIS_ __in ID3D11ShaderReflectionType* pBase) PURE; +}; + +// {51F23923-F3E5-4BD1-91CB-606177D8DB4C} +DEFINE_GUID(IID_ID3D11ShaderReflectionVariable, +0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c); + +#undef INTERFACE +#define INTERFACE ID3D11ShaderReflectionVariable + +DECLARE_INTERFACE(ID3D11ShaderReflectionVariable) +{ + STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D11ShaderReflectionType*, GetType)(THIS) PURE; + STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE; + + STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ __in UINT uArrayIndex) PURE; +}; + +// {EB62D63D-93DD-4318-8AE8-C6F83AD371B8} +DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer, +0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8); + +#undef INTERFACE +#define INTERFACE ID3D11ShaderReflectionConstantBuffer + +DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer) +{ + STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByIndex)(THIS_ __in UINT Index) PURE; + STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ __in LPCSTR Name) PURE; +}; + +// The ID3D11ShaderReflection IID may change from SDK version to SDK version +// if the reflection API changes. This prevents new code with the new API +// from working with an old binary. Recompiling with the new header +// will pick up the new IID. + +// 0a233719-3960-4578-9d7c-203b8b1d9cc1 +DEFINE_GUID(IID_ID3D11ShaderReflection, +0x0a233719, 0x3960, 0x4578, 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1); + +#undef INTERFACE +#define INTERFACE ID3D11ShaderReflection + +DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ __in REFIID iid, + __out LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ __in UINT Index) PURE; + STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ __in LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDesc)(THIS_ __in UINT ResourceIndex, + __out D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD(GetInputParameterDesc)(THIS_ __in UINT ParameterIndex, + __out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetOutputParameterDesc)(THIS_ __in UINT ParameterIndex, + __out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetPatchConstantParameterDesc)(THIS_ __in UINT ParameterIndex, + __out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ __in LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDescByName)(THIS_ __in LPCSTR Name, + __out D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE; + + STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE; + STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE; + + STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE; + STDMETHOD(GetMinFeatureLevel)(THIS_ __out enum D3D_FEATURE_LEVEL* pLevel) PURE; + + STDMETHOD_(UINT, GetThreadGroupSize)(THIS_ + __out_opt UINT* pSizeX, + __out_opt UINT* pSizeY, + __out_opt UINT* pSizeZ) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D11SHADER_H__ + diff --git a/RenderDll/Dx9Sdk/Include/D3DCSX.h b/RenderDll/Dx9Sdk/Include/D3DCSX.h new file mode 100644 index 0000000..240cdbb --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DCSX.h @@ -0,0 +1,409 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3DX11GPGPU.h +// Content: D3DX11 General Purpose GPU computing algorithms +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx11.h" + +#ifndef __D3DX11GPGPU_H__ +#define __D3DX11GPGPU_H__ + +// Current name of the DLL shipped in the same SDK as this header. + + +#define D3DCSX_DLL_W L"d3dcsx_43.dll" +#define D3DCSX_DLL_A "d3dcsx_43.dll" + +#ifdef UNICODE + #define D3DCSX_DLL D3DCSX_DLL_W +#else + #define D3DCSX_DLL D3DCSX_DLL_A +#endif + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + + + + + +////////////////////////////////////////////////////////////////////////////// + +typedef enum D3DX11_SCAN_DATA_TYPE +{ + D3DX11_SCAN_DATA_TYPE_FLOAT = 1, + D3DX11_SCAN_DATA_TYPE_INT, + D3DX11_SCAN_DATA_TYPE_UINT, +} D3DX11_SCAN_DATA_TYPE; + +typedef enum D3DX11_SCAN_OPCODE +{ + D3DX11_SCAN_OPCODE_ADD = 1, + D3DX11_SCAN_OPCODE_MIN, + D3DX11_SCAN_OPCODE_MAX, + D3DX11_SCAN_OPCODE_MUL, + D3DX11_SCAN_OPCODE_AND, + D3DX11_SCAN_OPCODE_OR, + D3DX11_SCAN_OPCODE_XOR, +} D3DX11_SCAN_OPCODE; + +typedef enum D3DX11_SCAN_DIRECTION +{ + D3DX11_SCAN_DIRECTION_FORWARD = 1, + D3DX11_SCAN_DIRECTION_BACKWARD, +} D3DX11_SCAN_DIRECTION; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX11Scan: +////////////////////////////////////////////////////////////////////////////// + +// {5089b68f-e71d-4d38-be8e-f363b95a9405} +DEFINE_GUID(IID_ID3DX11Scan, 0x5089b68f, 0xe71d, 0x4d38, 0xbe, 0x8e, 0xf3, 0x63, 0xb9, 0x5a, 0x94, 0x05); + +#undef INTERFACE +#define INTERFACE ID3DX11Scan + +DECLARE_INTERFACE_(ID3DX11Scan, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX11Scan + + STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE; + + //============================================================================= + // Performs an unsegmented scan of a sequence in-place or out-of-place + // ElementType element type + // OpCode binary operation + // Direction scan direction + // ElementScanSize size of scan, in elements + // pSrc input sequence on the device. pSrc==pDst for in-place scans + // pDst output sequence on the device + //============================================================================= + STDMETHOD(Scan)( THIS_ + D3DX11_SCAN_DATA_TYPE ElementType, + D3DX11_SCAN_OPCODE OpCode, + UINT ElementScanSize, + __in ID3D11UnorderedAccessView* pSrc, + __in ID3D11UnorderedAccessView* pDst + ) PURE; + + //============================================================================= + // Performs a multiscan of a sequence in-place or out-of-place + // ElementType element type + // OpCode binary operation + // Direction scan direction + // ElementScanSize size of scan, in elements + // ElementScanPitch pitch of the next scan, in elements + // ScanCount number of scans in a multiscan + // pSrc input sequence on the device. pSrc==pDst for in-place scans + // pDst output sequence on the device + //============================================================================= + STDMETHOD(Multiscan)( THIS_ + D3DX11_SCAN_DATA_TYPE ElementType, + D3DX11_SCAN_OPCODE OpCode, + UINT ElementScanSize, + UINT ElementScanPitch, + UINT ScanCount, + __in ID3D11UnorderedAccessView* pSrc, + __in ID3D11UnorderedAccessView* pDst + ) PURE; +}; + + +//============================================================================= +// Creates a scan context +// pDevice the device context +// MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT) +// MaxScanCount maximum number of scans in multiscan +// ppScanContext new scan context +//============================================================================= +HRESULT WINAPI D3DX11CreateScan( + __in ID3D11DeviceContext* pDeviceContext, + UINT MaxElementScanSize, + UINT MaxScanCount, + __out ID3DX11Scan** ppScan ); + + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX11SegmentedScan: +////////////////////////////////////////////////////////////////////////////// + +// {a915128c-d954-4c79-bfe1-64db923194d6} +DEFINE_GUID(IID_ID3DX11SegmentedScan, 0xa915128c, 0xd954, 0x4c79, 0xbf, 0xe1, 0x64, 0xdb, 0x92, 0x31, 0x94, 0xd6); + +#undef INTERFACE +#define INTERFACE ID3DX11SegmentedScan + +DECLARE_INTERFACE_(ID3DX11SegmentedScan, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX11SegmentedScan + + STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE; + + //============================================================================= + // Performs a segscan of a sequence in-place or out-of-place + // ElementType element type + // OpCode binary operation + // Direction scan direction + // pSrcElementFlags compact array of bits, one per element of pSrc. A set value + // indicates the start of a new segment. + // ElementScanSize size of scan, in elements + // pSrc input sequence on the device. pSrc==pDst for in-place scans + // pDst output sequence on the device + //============================================================================= + STDMETHOD(SegScan)( THIS_ + D3DX11_SCAN_DATA_TYPE ElementType, + D3DX11_SCAN_OPCODE OpCode, + UINT ElementScanSize, + __in_opt ID3D11UnorderedAccessView* pSrc, + __in ID3D11UnorderedAccessView* pSrcElementFlags, + __in ID3D11UnorderedAccessView* pDst + ) PURE; +}; + + +//============================================================================= +// Creates a segmented scan context +// pDevice the device context +// MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT) +// ppScanContext new scan context +//============================================================================= +HRESULT WINAPI D3DX11CreateSegmentedScan( + __in ID3D11DeviceContext* pDeviceContext, + UINT MaxElementScanSize, + __out ID3DX11SegmentedScan** ppScan ); + + + +////////////////////////////////////////////////////////////////////////////// + +#define D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS 4 +#define D3DX11_FFT_MAX_TEMP_BUFFERS 4 +#define D3DX11_FFT_MAX_DIMENSIONS 32 + + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX11FFT: +////////////////////////////////////////////////////////////////////////////// + +// {b3f7a938-4c93-4310-a675-b30d6de50553} +DEFINE_GUID(IID_ID3DX11FFT, 0xb3f7a938, 0x4c93, 0x4310, 0xa6, 0x75, 0xb3, 0x0d, 0x6d, 0xe5, 0x05, 0x53); + +#undef INTERFACE +#define INTERFACE ID3DX11FFT + +DECLARE_INTERFACE_(ID3DX11FFT, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX11FFT + + // scale for forward transform (defaults to 1 if set to 0) + STDMETHOD(SetForwardScale)(THIS_ FLOAT ForwardScale) PURE; + STDMETHOD_(FLOAT, GetForwardScale)(THIS) PURE; + + // scale for inverse transform (defaults to 1/N if set to 0, where N is + // the product of the transformed dimension lengths + STDMETHOD(SetInverseScale)(THIS_ FLOAT InverseScale) PURE; + STDMETHOD_(FLOAT, GetInverseScale)(THIS) PURE; + + //------------------------------------------------------------------------------ + // Attaches buffers to the context and performs any required precomputation. + // The buffers must be no smaller than the corresponding buffer sizes returned + // by D3DX11CreateFFT*(). Temp buffers may beshared between multiple contexts, + // though care should be taken to concurrently execute multiple FFTs which share + // temp buffers. + // + // NumTempBuffers number of buffers in ppTempBuffers + // ppTempBuffers temp buffers to attach + // NumPrecomputeBuffers number of buffers in ppPrecomputeBufferSizes + // ppPrecomputeBufferSizes buffers to hold precomputed data + STDMETHOD(AttachBuffersAndPrecompute)( THIS_ + __in_range(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBuffers, + __in_ecount(NumTempBuffers) ID3D11UnorderedAccessView*const* ppTempBuffers, + __in_range(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBuffers, + __in_ecount(NumPrecomputeBuffers) ID3D11UnorderedAccessView*const* ppPrecomputeBufferSizes ) PURE; + + //------------------------------------------------------------------------------ + // Call after buffers have been attached to the context, pInput and *ppOuput can + // be one of the temp buffers. If *ppOutput == NULL, then the computation will ping-pong + // between temp buffers and the last buffer written to is stored at *ppOutput. + // Otherwise, *ppOutput is used as the output buffer (which may incur an extra copy). + // + // The format of complex data is interleaved components, e.g. (Real0, Imag0), + // (Real1, Imag1) ... etc. Data is stored in row major order + // + // pInputBuffer view onto input buffer + // ppOutpuBuffert pointer to view of output buffer + STDMETHOD(ForwardTransform)( THIS_ + __in const ID3D11UnorderedAccessView* pInputBuffer, + __inout ID3D11UnorderedAccessView** ppOutputBuffer ) PURE; + + STDMETHOD(InverseTransform)( THIS_ + __in const ID3D11UnorderedAccessView* pInputBuffer, + __inout ID3D11UnorderedAccessView** ppOutputBuffer ) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX11FFT Creation Routines +////////////////////////////////////////////////////////////////////////////// + +typedef enum D3DX11_FFT_DATA_TYPE +{ + D3DX11_FFT_DATA_TYPE_REAL, + D3DX11_FFT_DATA_TYPE_COMPLEX, +} D3DX11_FFT_DATA_TYPE; + +typedef enum D3DX11_FFT_DIM_MASK +{ + D3DX11_FFT_DIM_MASK_1D = 0x1, + D3DX11_FFT_DIM_MASK_2D = 0x3, + D3DX11_FFT_DIM_MASK_3D = 0x7, +} D3DX11_FFT_DIM_MASK; + +typedef struct D3DX11_FFT_DESC +{ + UINT NumDimensions; // number of dimensions + UINT ElementLengths[D3DX11_FFT_MAX_DIMENSIONS]; // length of each dimension + UINT DimensionMask; // a bit set for each dimensions to transform + // (see D3DX11_FFT_DIM_MASK for common masks) + D3DX11_FFT_DATA_TYPE Type; // type of the elements in spatial domain +} D3DX11_FFT_DESC; + + +//------------------------------------------------------------------------------ +// NumTempBufferSizes Number of temporary buffers needed +// pTempBufferSizes Minimum sizes (in FLOATs) of temporary buffers +// NumPrecomputeBufferSizes Number of precompute buffers needed +// pPrecomputeBufferSizes minimum sizes (in FLOATs) for precompute buffers +//------------------------------------------------------------------------------ + +typedef struct D3DX11_FFT_BUFFER_INFO +{ + __range(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBufferSizes; + UINT TempBufferFloatSizes[D3DX11_FFT_MAX_TEMP_BUFFERS]; + __range(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBufferSizes; + UINT PrecomputeBufferFloatSizes[D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS]; +} D3DX11_FFT_BUFFER_INFO; + + +typedef enum D3DX11_FFT_CREATE_FLAG +{ + D3DX11_FFT_CREATE_FLAG_NO_PRECOMPUTE_BUFFERS = 0x01L, // do not precompute values and store into buffers +} D3DX11_FFT_CREATE_FLAG; + + +//------------------------------------------------------------------------------ +// Creates an ID3DX11FFT COM interface object and returns a pointer to it at *ppFFT. +// The descriptor describes the shape of the data as well as the scaling factors +// that should be used for forward and inverse transforms. +// The FFT computation may require temporaries that act as ping-pong buffers +// and for other purposes. aTempSizes is a list of the sizes required for +// temporaries. Likewise, some data may need to be precomputed and the sizes +// of those sizes are returned in aPrecomputedBufferSizes. +// +// To perform a computation, follow these steps: +// 1) Create the FFT context object +// 2) Precompute (and Attach temp working buffers of at least the required size) +// 3) Call Compute() on some input data +// +// Compute() may be called repeatedly with different inputs and transform +// directions. When finished with the FFT work, release the FFT interface() +// +// Device Direct3DDeviceContext to use in +// pDesc Descriptor for FFT transform in +// Count the number of 1D FFTs to perform in +// Flags See D3DX11_FFT_CREATE_FLAG in +// pBufferInfo Pointer to BUFFER_INFO struct, filled by funciton out +// ppFFT Pointer to returned context pointer out +//------------------------------------------------------------------------------ + +HRESULT WINAPI D3DX11CreateFFT( + ID3D11DeviceContext* pDeviceContext, + __in const D3DX11_FFT_DESC* pDesc, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); + +HRESULT WINAPI D3DX11CreateFFT1DReal( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); +HRESULT WINAPI D3DX11CreateFFT1DComplex( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); +HRESULT WINAPI D3DX11CreateFFT2DReal( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Y, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); +HRESULT WINAPI D3DX11CreateFFT2DComplex( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Y, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); +HRESULT WINAPI D3DX11CreateFFT3DReal( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Y, + UINT Z, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); +HRESULT WINAPI D3DX11CreateFFT3DComplex( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Y, + UINT Z, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX11GPGPU_H__ + + diff --git a/RenderDll/Dx9Sdk/Include/D3DX10.h b/RenderDll/Dx9Sdk/Include/D3DX10.h new file mode 100644 index 0000000..5cdcd51 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX10.h @@ -0,0 +1,72 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx10.h +// Content: D3DX10 utility library +// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __D3DX10_INTERNAL__ +#error Incorrect D3DX10 header used +#endif + +#ifndef __D3DX10_H__ +#define __D3DX10_H__ + + +// Defines +#include +#include + +#define D3DX10_DEFAULT ((UINT) -1) +#define D3DX10_FROM_FILE ((UINT) -3) +#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3) + +#ifndef D3DX10INLINE +#ifdef _MSC_VER + #if (_MSC_VER >= 1200) + #define D3DX10INLINE __forceinline + #else + #define D3DX10INLINE __inline + #endif +#else + #ifdef __cplusplus + #define D3DX10INLINE inline + #else + #define D3DX10INLINE + #endif +#endif +#endif + + + +// Includes +#include "d3d10.h" +#include "d3dx10.h" +#include "d3dx10math.h" +#include "d3dx10core.h" +#include "d3dx10tex.h" +#include "d3dx10mesh.h" +#include "d3dx10async.h" + + +// Errors +#define _FACDD 0x876 +#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) + +enum _D3DX10_ERR { + D3DX10_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900), + D3DX10_ERR_INVALID_MESH = MAKE_DDHRESULT(2901), + D3DX10_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902), + D3DX10_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903), + D3DX10_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904), + D3DX10_ERR_INVALID_DATA = MAKE_DDHRESULT(2905), + D3DX10_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906), + D3DX10_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907), + D3DX10_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908), +}; + + +#endif //__D3DX10_H__ + diff --git a/RenderDll/Dx9Sdk/Include/D3DX10core.h b/RenderDll/Dx9Sdk/Include/D3DX10core.h new file mode 100644 index 0000000..290a004 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX10core.h @@ -0,0 +1,444 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx10core.h +// Content: D3DX10 core types and functions +// +/////////////////////////////////////////////////////////////////////////// + +#include "d3dx10.h" + +#ifndef __D3DX10CORE_H__ +#define __D3DX10CORE_H__ + +// Current name of the DLL shipped in the same SDK as this header. + + +#define D3DX10_DLL_W L"d3dx10_43.dll" +#define D3DX10_DLL_A "d3dx10_43.dll" + +#ifdef UNICODE + #define D3DX10_DLL D3DX10_DLL_W +#else + #define D3DX10_DLL D3DX10_DLL_A +#endif + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +/////////////////////////////////////////////////////////////////////////// +// D3DX10_SDK_VERSION: +// ----------------- +// This identifier is passed to D3DX10CheckVersion in order to ensure that an +// application was built against the correct header files and lib files. +// This number is incremented whenever a header (or other) change would +// require applications to be rebuilt. If the version doesn't match, +// D3DX10CreateVersion will return FALSE. (The number itself has no meaning.) +/////////////////////////////////////////////////////////////////////////// + + +#define D3DX10_SDK_VERSION 43 + + +/////////////////////////////////////////////////////////////////////////// +// D3DX10CreateDevice +// D3DX10CreateDeviceAndSwapChain +// D3DX10GetFeatureLevel1 +/////////////////////////////////////////////////////////////////////////// +HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + ID3D10Device **ppDevice); + +HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, + IDXGISwapChain **ppSwapChain, + ID3D10Device **ppDevice); + +typedef interface ID3D10Device1 ID3D10Device1; +HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *pDevice, ID3D10Device1 **ppDevice1); + + +#ifdef D3D_DIAG_DLL +BOOL WINAPI D3DX10DebugMute(BOOL Mute); +#endif +HRESULT WINAPI D3DX10CheckVersion(UINT D3DSdkVersion, UINT D3DX10SdkVersion); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +////////////////////////////////////////////////////////////////////////////// +// D3DX10_SPRITE flags: +// ----------------- +// D3DX10_SPRITE_SAVE_STATE +// Specifies device state should be saved and restored in Begin/End. +// D3DX10SPRITE_SORT_TEXTURE +// Sprites are sorted by texture prior to drawing. This is recommended when +// drawing non-overlapping sprites of uniform depth. For example, drawing +// screen-aligned text with ID3DX10Font. +// D3DX10SPRITE_SORT_DEPTH_FRONT_TO_BACK +// Sprites are sorted by depth front-to-back prior to drawing. This is +// recommended when drawing opaque sprites of varying depths. +// D3DX10SPRITE_SORT_DEPTH_BACK_TO_FRONT +// Sprites are sorted by depth back-to-front prior to drawing. This is +// recommended when drawing transparent sprites of varying depths. +// D3DX10SPRITE_ADDREF_TEXTURES +// AddRef/Release all textures passed in to DrawSpritesBuffered +////////////////////////////////////////////////////////////////////////////// + +typedef enum _D3DX10_SPRITE_FLAG +{ + D3DX10_SPRITE_SORT_TEXTURE = 0x01, + D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT = 0x02, + D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK = 0x04, + D3DX10_SPRITE_SAVE_STATE = 0x08, + D3DX10_SPRITE_ADDREF_TEXTURES = 0x10, +} D3DX10_SPRITE_FLAG; + +typedef struct _D3DX10_SPRITE +{ + D3DXMATRIX matWorld; + + D3DXVECTOR2 TexCoord; + D3DXVECTOR2 TexSize; + + D3DXCOLOR ColorModulate; + + ID3D10ShaderResourceView *pTexture; + UINT TextureIndex; +} D3DX10_SPRITE; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX10Sprite: +// ------------ +// This object intends to provide an easy way to drawing sprites using D3D. +// +// Begin - +// Prepares device for drawing sprites. +// +// Draw - +// Draws a sprite +// +// Flush - +// Forces all batched sprites to submitted to the device. +// +// End - +// Restores device state to how it was when Begin was called. +// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DX10Sprite ID3DX10Sprite; +typedef interface ID3DX10Sprite *LPD3DX10SPRITE; + + +// {BA0B762D-8D28-43ec-B9DC-2F84443B0614} +DEFINE_GUID(IID_ID3DX10Sprite, +0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14); + + +#undef INTERFACE +#define INTERFACE ID3DX10Sprite + +DECLARE_INTERFACE_(ID3DX10Sprite, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX10Sprite + STDMETHOD(Begin)(THIS_ UINT flags) PURE; + + STDMETHOD(DrawSpritesBuffered)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites) PURE; + STDMETHOD(Flush)(THIS) PURE; + + STDMETHOD(DrawSpritesImmediate)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites, UINT cbSprite, UINT flags) PURE; + STDMETHOD(End)(THIS) PURE; + + STDMETHOD(GetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE; + STDMETHOD(SetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE; + STDMETHOD(GetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE; + STDMETHOD(SetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE; + + STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE; +}; + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DX10CreateSprite( + ID3D10Device* pDevice, + UINT cDeviceBufferSize, + LPD3DX10SPRITE* ppSprite); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX10ThreadPump: +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DX10DataLoader + +DECLARE_INTERFACE(ID3DX10DataLoader) +{ + STDMETHOD(Load)(THIS) PURE; + STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; + +#undef INTERFACE +#define INTERFACE ID3DX10DataProcessor + +DECLARE_INTERFACE(ID3DX10DataProcessor) +{ + STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE; + STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; + +// {C93FECFA-6967-478a-ABBC-402D90621FCB} +DEFINE_GUID(IID_ID3DX10ThreadPump, +0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb); + +#undef INTERFACE +#define INTERFACE ID3DX10ThreadPump + +DECLARE_INTERFACE_(ID3DX10ThreadPump, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX10ThreadPump + STDMETHOD(AddWorkItem)(THIS_ ID3DX10DataLoader *pDataLoader, ID3DX10DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE; + STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE; + + STDMETHOD(WaitForAllItems)(THIS) PURE; + STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount); + + STDMETHOD(PurgeAllItems)(THIS) PURE; + STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE; + +}; + +HRESULT WINAPI D3DX10CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump); + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX10Font: +// ---------- +// Font objects contain the textures and resources needed to render a specific +// font on a specific device. +// +// GetGlyphData - +// Returns glyph cache data, for a given glyph. +// +// PreloadCharacters/PreloadGlyphs/PreloadText - +// Preloads glyphs into the glyph cache textures. +// +// DrawText - +// Draws formatted text on a D3D device. Some parameters are +// surprisingly similar to those of GDI's DrawText function. See GDI +// documentation for a detailed description of these parameters. +// If pSprite is NULL, an internal sprite object will be used. +// +////////////////////////////////////////////////////////////////////////////// + +typedef struct _D3DX10_FONT_DESCA +{ + INT Height; + UINT Width; + UINT Weight; + UINT MipLevels; + BOOL Italic; + BYTE CharSet; + BYTE OutputPrecision; + BYTE Quality; + BYTE PitchAndFamily; + CHAR FaceName[LF_FACESIZE]; + +} D3DX10_FONT_DESCA, *LPD3DX10_FONT_DESCA; + +typedef struct _D3DX10_FONT_DESCW +{ + INT Height; + UINT Width; + UINT Weight; + UINT MipLevels; + BOOL Italic; + BYTE CharSet; + BYTE OutputPrecision; + BYTE Quality; + BYTE PitchAndFamily; + WCHAR FaceName[LF_FACESIZE]; + +} D3DX10_FONT_DESCW, *LPD3DX10_FONT_DESCW; + +#ifdef UNICODE +typedef D3DX10_FONT_DESCW D3DX10_FONT_DESC; +typedef LPD3DX10_FONT_DESCW LPD3DX10_FONT_DESC; +#else +typedef D3DX10_FONT_DESCA D3DX10_FONT_DESC; +typedef LPD3DX10_FONT_DESCA LPD3DX10_FONT_DESC; +#endif + + +typedef interface ID3DX10Font ID3DX10Font; +typedef interface ID3DX10Font *LPD3DX10FONT; + + +// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC} +DEFINE_GUID(IID_ID3DX10Font, +0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc); + + +#undef INTERFACE +#define INTERFACE ID3DX10Font + +DECLARE_INTERFACE_(ID3DX10Font, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX10Font + STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE; + STDMETHOD(GetDescA)(THIS_ D3DX10_FONT_DESCA *pDesc) PURE; + STDMETHOD(GetDescW)(THIS_ D3DX10_FONT_DESCW *pDesc) PURE; + STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE; + STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE; + + STDMETHOD_(HDC, GetDC)(THIS) PURE; + STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, ID3D10ShaderResourceView** ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE; + + STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE; + STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE; + STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE; + STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE; + + STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DX10SPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE; + STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DX10SPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE; + +#ifdef __cplusplus +#ifdef UNICODE + HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCW *pDesc) { return GetDescW(pDesc); } + HRESULT WINAPI_INLINE PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); } +#else + HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCA *pDesc) { return GetDescA(pDesc); } + HRESULT WINAPI_INLINE PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); } +#endif +#endif //__cplusplus +}; + +#ifndef GetTextMetrics +#ifdef UNICODE +#define GetTextMetrics GetTextMetricsW +#else +#define GetTextMetrics GetTextMetricsA +#endif +#endif + +#ifndef DrawText +#ifdef UNICODE +#define DrawText DrawTextW +#else +#define DrawText DrawTextA +#endif +#endif + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +HRESULT WINAPI + D3DX10CreateFontA( + ID3D10Device* pDevice, + INT Height, + UINT Width, + UINT Weight, + UINT MipLevels, + BOOL Italic, + UINT CharSet, + UINT OutputPrecision, + UINT Quality, + UINT PitchAndFamily, + LPCSTR pFaceName, + LPD3DX10FONT* ppFont); + +HRESULT WINAPI + D3DX10CreateFontW( + ID3D10Device* pDevice, + INT Height, + UINT Width, + UINT Weight, + UINT MipLevels, + BOOL Italic, + UINT CharSet, + UINT OutputPrecision, + UINT Quality, + UINT PitchAndFamily, + LPCWSTR pFaceName, + LPD3DX10FONT* ppFont); + +#ifdef UNICODE +#define D3DX10CreateFont D3DX10CreateFontW +#else +#define D3DX10CreateFont D3DX10CreateFontA +#endif + + +HRESULT WINAPI + D3DX10CreateFontIndirectA( + ID3D10Device* pDevice, + CONST D3DX10_FONT_DESCA* pDesc, + LPD3DX10FONT* ppFont); + +HRESULT WINAPI + D3DX10CreateFontIndirectW( + ID3D10Device* pDevice, + CONST D3DX10_FONT_DESCW* pDesc, + LPD3DX10FONT* ppFont); + +#ifdef UNICODE +#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectW +#else +#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectA +#endif + +HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *pDevice); + +#ifdef __cplusplus +} +#endif //__cplusplus + +/////////////////////////////////////////////////////////////////////////// + +#define _FACD3D 0x876 +#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) +#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) + +#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) +#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) + +#endif //__D3DX10CORE_H__ + diff --git a/RenderDll/Dx9Sdk/Include/D3DX10math.h b/RenderDll/Dx9Sdk/Include/D3DX10math.h new file mode 100644 index 0000000..a4b8e2d --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX10math.h @@ -0,0 +1,1866 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: D3DX10math.h +// Content: D3DX10 math types and functions +// +////////////////////////////////////////////////////////////////////////////// + +#include "D3DX10.h" + +// D3DX10 and D3DX9 math look the same. You can include either one into your project. +// We are intentionally using the header define from D3DX9 math to prevent double-inclusion. +#ifndef __D3DX9MATH_H__ +#define __D3DX9MATH_H__ + +#include +#if _MSC_VER >= 1200 +#pragma warning(push) +#endif +#pragma warning(disable:4201) // anonymous unions warning + +//=========================================================================== +// +// Type definitions from D3D9 +// +//=========================================================================== + +#ifndef D3DVECTOR_DEFINED +typedef struct _D3DVECTOR { + float x; + float y; + float z; +} D3DVECTOR; +#define D3DVECTOR_DEFINED +#endif + +#ifndef D3DMATRIX_DEFINED +typedef struct _D3DMATRIX { + union { + struct { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + + }; + float m[4][4]; + }; +} D3DMATRIX; +#define D3DMATRIX_DEFINED +#endif + +//=========================================================================== +// +// General purpose utilities +// +//=========================================================================== +#define D3DX_PI (3.14159265358979323846) +#define D3DX_1BYPI ( 1.0 / D3DX_PI ) + +#define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0)) +#define D3DXToDegree( radian ) ((radian) * (180.0 / D3DX_PI)) + + + +//=========================================================================== +// +// 16 bit floating point numbers +// +//=========================================================================== + +#define D3DX_16F_DIG 3 // # of decimal digits of precision +#define D3DX_16F_EPSILON 4.8875809e-4f // smallest such that 1.0 + epsilon != 1.0 +#define D3DX_16F_MANT_DIG 11 // # of bits in mantissa +#define D3DX_16F_MAX 6.550400e+004 // max value +#define D3DX_16F_MAX_10_EXP 4 // max decimal exponent +#define D3DX_16F_MAX_EXP 15 // max binary exponent +#define D3DX_16F_MIN 6.1035156e-5f // min positive value +#define D3DX_16F_MIN_10_EXP (-4) // min decimal exponent +#define D3DX_16F_MIN_EXP (-14) // min binary exponent +#define D3DX_16F_RADIX 2 // exponent radix +#define D3DX_16F_ROUNDS 1 // addition rounding: near +#define D3DX_16F_SIGN_MASK 0x8000 +#define D3DX_16F_EXP_MASK 0x7C00 +#define D3DX_16F_FRAC_MASK 0x03FF + +typedef struct D3DXFLOAT16 +{ +#ifdef __cplusplus +public: + D3DXFLOAT16() {}; + D3DXFLOAT16( FLOAT ); + D3DXFLOAT16( CONST D3DXFLOAT16& ); + + // casting + operator FLOAT (); + + // binary operators + BOOL operator == ( CONST D3DXFLOAT16& ) const; + BOOL operator != ( CONST D3DXFLOAT16& ) const; + +protected: +#endif //__cplusplus + WORD value; +} D3DXFLOAT16, *LPD3DXFLOAT16; + + + +//=========================================================================== +// +// Vectors +// +//=========================================================================== + + +//-------------------------- +// 2D Vector +//-------------------------- +typedef struct D3DXVECTOR2 +{ +#ifdef __cplusplus +public: + D3DXVECTOR2() {}; + D3DXVECTOR2( CONST FLOAT * ); + D3DXVECTOR2( CONST D3DXFLOAT16 * ); + D3DXVECTOR2( FLOAT x, FLOAT y ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR2& operator += ( CONST D3DXVECTOR2& ); + D3DXVECTOR2& operator -= ( CONST D3DXVECTOR2& ); + D3DXVECTOR2& operator *= ( FLOAT ); + D3DXVECTOR2& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR2 operator + () const; + D3DXVECTOR2 operator - () const; + + // binary operators + D3DXVECTOR2 operator + ( CONST D3DXVECTOR2& ) const; + D3DXVECTOR2 operator - ( CONST D3DXVECTOR2& ) const; + D3DXVECTOR2 operator * ( FLOAT ) const; + D3DXVECTOR2 operator / ( FLOAT ) const; + + friend D3DXVECTOR2 operator * ( FLOAT, CONST D3DXVECTOR2& ); + + BOOL operator == ( CONST D3DXVECTOR2& ) const; + BOOL operator != ( CONST D3DXVECTOR2& ) const; + + +public: +#endif //__cplusplus + FLOAT x, y; +} D3DXVECTOR2, *LPD3DXVECTOR2; + + + +//-------------------------- +// 2D Vector (16 bit) +//-------------------------- + +typedef struct D3DXVECTOR2_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR2_16F() {}; + D3DXVECTOR2_16F( CONST FLOAT * ); + D3DXVECTOR2_16F( CONST D3DXFLOAT16 * ); + D3DXVECTOR2_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR2_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR2_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y; + +} D3DXVECTOR2_16F, *LPD3DXVECTOR2_16F; + + + +//-------------------------- +// 3D Vector +//-------------------------- +#ifdef __cplusplus +typedef struct D3DXVECTOR3 : public D3DVECTOR +{ +public: + D3DXVECTOR3() {}; + D3DXVECTOR3( CONST FLOAT * ); + D3DXVECTOR3( CONST D3DVECTOR& ); + D3DXVECTOR3( CONST D3DXFLOAT16 * ); + D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& ); + D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& ); + D3DXVECTOR3& operator *= ( FLOAT ); + D3DXVECTOR3& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR3 operator + () const; + D3DXVECTOR3 operator - () const; + + // binary operators + D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const; + D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const; + D3DXVECTOR3 operator * ( FLOAT ) const; + D3DXVECTOR3 operator / ( FLOAT ) const; + + friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& ); + + BOOL operator == ( CONST D3DXVECTOR3& ) const; + BOOL operator != ( CONST D3DXVECTOR3& ) const; + +} D3DXVECTOR3, *LPD3DXVECTOR3; + +#else //!__cplusplus +typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3; +#endif //!__cplusplus + + + +//-------------------------- +// 3D Vector (16 bit) +//-------------------------- +typedef struct D3DXVECTOR3_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR3_16F() {}; + D3DXVECTOR3_16F( CONST FLOAT * ); + D3DXVECTOR3_16F( CONST D3DVECTOR& ); + D3DXVECTOR3_16F( CONST D3DXFLOAT16 * ); + D3DXVECTOR3_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y, CONST D3DXFLOAT16 &z ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR3_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR3_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y, z; + +} D3DXVECTOR3_16F, *LPD3DXVECTOR3_16F; + + + +//-------------------------- +// 4D Vector +//-------------------------- +typedef struct D3DXVECTOR4 +{ +#ifdef __cplusplus +public: + D3DXVECTOR4() {}; + D3DXVECTOR4( CONST FLOAT* ); + D3DXVECTOR4( CONST D3DXFLOAT16* ); + D3DXVECTOR4( CONST D3DVECTOR& xyz, FLOAT w ); + D3DXVECTOR4( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR4& operator += ( CONST D3DXVECTOR4& ); + D3DXVECTOR4& operator -= ( CONST D3DXVECTOR4& ); + D3DXVECTOR4& operator *= ( FLOAT ); + D3DXVECTOR4& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR4 operator + () const; + D3DXVECTOR4 operator - () const; + + // binary operators + D3DXVECTOR4 operator + ( CONST D3DXVECTOR4& ) const; + D3DXVECTOR4 operator - ( CONST D3DXVECTOR4& ) const; + D3DXVECTOR4 operator * ( FLOAT ) const; + D3DXVECTOR4 operator / ( FLOAT ) const; + + friend D3DXVECTOR4 operator * ( FLOAT, CONST D3DXVECTOR4& ); + + BOOL operator == ( CONST D3DXVECTOR4& ) const; + BOOL operator != ( CONST D3DXVECTOR4& ) const; + +public: +#endif //__cplusplus + FLOAT x, y, z, w; +} D3DXVECTOR4, *LPD3DXVECTOR4; + + +//-------------------------- +// 4D Vector (16 bit) +//-------------------------- +typedef struct D3DXVECTOR4_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR4_16F() {}; + D3DXVECTOR4_16F( CONST FLOAT * ); + D3DXVECTOR4_16F( CONST D3DXFLOAT16* ); + D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& xyz, CONST D3DXFLOAT16& w ); + D3DXVECTOR4_16F( CONST D3DXFLOAT16& x, CONST D3DXFLOAT16& y, CONST D3DXFLOAT16& z, CONST D3DXFLOAT16& w ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR4_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR4_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y, z, w; + +} D3DXVECTOR4_16F, *LPD3DXVECTOR4_16F; + + + +//=========================================================================== +// +// Matrices +// +//=========================================================================== +#ifdef __cplusplus +typedef struct D3DXMATRIX : public D3DMATRIX +{ +public: + D3DXMATRIX() {}; + D3DXMATRIX( CONST FLOAT * ); + D3DXMATRIX( CONST D3DMATRIX& ); + D3DXMATRIX( CONST D3DXFLOAT16 * ); + D3DXMATRIX( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); + + + // access grants + FLOAT& operator () ( UINT Row, UINT Col ); + FLOAT operator () ( UINT Row, UINT Col ) const; + + // casting operators + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXMATRIX& operator *= ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator += ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator -= ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator *= ( FLOAT ); + D3DXMATRIX& operator /= ( FLOAT ); + + // unary operators + D3DXMATRIX operator + () const; + D3DXMATRIX operator - () const; + + // binary operators + D3DXMATRIX operator * ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator + ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator - ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator * ( FLOAT ) const; + D3DXMATRIX operator / ( FLOAT ) const; + + friend D3DXMATRIX operator * ( FLOAT, CONST D3DXMATRIX& ); + + BOOL operator == ( CONST D3DXMATRIX& ) const; + BOOL operator != ( CONST D3DXMATRIX& ) const; + +} D3DXMATRIX, *LPD3DXMATRIX; + +#else //!__cplusplus +typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX; +#endif //!__cplusplus + + +//--------------------------------------------------------------------------- +// Aligned Matrices +// +// This class helps keep matrices 16-byte aligned as preferred by P4 cpus. +// It aligns matrices on the stack and on the heap or in global scope. +// It does this using __declspec(align(16)) which works on VC7 and on VC 6 +// with the processor pack. Unfortunately there is no way to detect the +// latter so this is turned on only on VC7. On other compilers this is the +// the same as D3DXMATRIX. +// +// Using this class on a compiler that does not actually do the alignment +// can be dangerous since it will not expose bugs that ignore alignment. +// E.g if an object of this class in inside a struct or class, and some code +// memcopys data in it assuming tight packing. This could break on a compiler +// that eventually start aligning the matrix. +//--------------------------------------------------------------------------- +#ifdef __cplusplus +typedef struct _D3DXMATRIXA16 : public D3DXMATRIX +{ + _D3DXMATRIXA16() {}; + _D3DXMATRIXA16( CONST FLOAT * ); + _D3DXMATRIXA16( CONST D3DMATRIX& ); + _D3DXMATRIXA16( CONST D3DXFLOAT16 * ); + _D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); + + // new operators + void* operator new ( size_t ); + void* operator new[] ( size_t ); + + // delete operators + void operator delete ( void* ); // These are NOT virtual; Do not + void operator delete[] ( void* ); // cast to D3DXMATRIX and delete. + + // assignment operators + _D3DXMATRIXA16& operator = ( CONST D3DXMATRIX& ); + +} _D3DXMATRIXA16; + +#else //!__cplusplus +typedef D3DXMATRIX _D3DXMATRIXA16; +#endif //!__cplusplus + + + +#if _MSC_VER >= 1300 // VC7 +#define D3DX_ALIGN16 __declspec(align(16)) +#else +#define D3DX_ALIGN16 // Earlier compiler may not understand this, do nothing. +#endif + +typedef D3DX_ALIGN16 _D3DXMATRIXA16 D3DXMATRIXA16, *LPD3DXMATRIXA16; + + + +//=========================================================================== +// +// Quaternions +// +//=========================================================================== +typedef struct D3DXQUATERNION +{ +#ifdef __cplusplus +public: + D3DXQUATERNION() {}; + D3DXQUATERNION( CONST FLOAT * ); + D3DXQUATERNION( CONST D3DXFLOAT16 * ); + D3DXQUATERNION( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXQUATERNION& operator += ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator -= ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator *= ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator *= ( FLOAT ); + D3DXQUATERNION& operator /= ( FLOAT ); + + // unary operators + D3DXQUATERNION operator + () const; + D3DXQUATERNION operator - () const; + + // binary operators + D3DXQUATERNION operator + ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator - ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator * ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator * ( FLOAT ) const; + D3DXQUATERNION operator / ( FLOAT ) const; + + friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION& ); + + BOOL operator == ( CONST D3DXQUATERNION& ) const; + BOOL operator != ( CONST D3DXQUATERNION& ) const; + +#endif //__cplusplus + FLOAT x, y, z, w; +} D3DXQUATERNION, *LPD3DXQUATERNION; + + +//=========================================================================== +// +// Planes +// +//=========================================================================== +typedef struct D3DXPLANE +{ +#ifdef __cplusplus +public: + D3DXPLANE() {}; + D3DXPLANE( CONST FLOAT* ); + D3DXPLANE( CONST D3DXFLOAT16* ); + D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXPLANE& operator *= ( FLOAT ); + D3DXPLANE& operator /= ( FLOAT ); + + // unary operators + D3DXPLANE operator + () const; + D3DXPLANE operator - () const; + + // binary operators + D3DXPLANE operator * ( FLOAT ) const; + D3DXPLANE operator / ( FLOAT ) const; + + friend D3DXPLANE operator * ( FLOAT, CONST D3DXPLANE& ); + + BOOL operator == ( CONST D3DXPLANE& ) const; + BOOL operator != ( CONST D3DXPLANE& ) const; + +#endif //__cplusplus + FLOAT a, b, c, d; +} D3DXPLANE, *LPD3DXPLANE; + + +//=========================================================================== +// +// Colors +// +//=========================================================================== + +typedef struct D3DXCOLOR +{ +#ifdef __cplusplus +public: + D3DXCOLOR() {}; + D3DXCOLOR( UINT argb ); + D3DXCOLOR( CONST FLOAT * ); + D3DXCOLOR( CONST D3DXFLOAT16 * ); + D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a ); + + // casting + operator UINT () const; + + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXCOLOR& operator += ( CONST D3DXCOLOR& ); + D3DXCOLOR& operator -= ( CONST D3DXCOLOR& ); + D3DXCOLOR& operator *= ( FLOAT ); + D3DXCOLOR& operator /= ( FLOAT ); + + // unary operators + D3DXCOLOR operator + () const; + D3DXCOLOR operator - () const; + + // binary operators + D3DXCOLOR operator + ( CONST D3DXCOLOR& ) const; + D3DXCOLOR operator - ( CONST D3DXCOLOR& ) const; + D3DXCOLOR operator * ( FLOAT ) const; + D3DXCOLOR operator / ( FLOAT ) const; + + friend D3DXCOLOR operator * ( FLOAT, CONST D3DXCOLOR& ); + + BOOL operator == ( CONST D3DXCOLOR& ) const; + BOOL operator != ( CONST D3DXCOLOR& ) const; + +#endif //__cplusplus + FLOAT r, g, b, a; +} D3DXCOLOR, *LPD3DXCOLOR; + + + +//=========================================================================== +// +// D3DX math functions: +// +// NOTE: +// * All these functions can take the same object as in and out parameters. +// +// * Out parameters are typically also returned as return values, so that +// the output of one function may be used as a parameter to another. +// +//=========================================================================== + +//-------------------------- +// Float16 +//-------------------------- + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Converts an array 32-bit floats to 16-bit floats +D3DXFLOAT16* WINAPI D3DXFloat32To16Array + ( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n ); + +// Converts an array 16-bit floats to 32-bit floats +FLOAT* WINAPI D3DXFloat16To32Array + ( __out_ecount(n) FLOAT *pOut, __in_ecount(n) CONST D3DXFLOAT16 *pIn, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 2D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec2Length + ( CONST D3DXVECTOR2 *pV ); + +FLOAT D3DXVec2LengthSq + ( CONST D3DXVECTOR2 *pV ); + +FLOAT D3DXVec2Dot + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Z component of ((x1,y1,0) cross (x2,y2,0)) +FLOAT D3DXVec2CCW + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Add + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Subtract + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2) +D3DXVECTOR2* D3DXVec2Minimize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2) +D3DXVECTOR2* D3DXVec2Maximize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Scale + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR2* D3DXVec2Lerp + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +D3DXVECTOR2* WINAPI D3DXVec2Normalize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR2* WINAPI D3DXVec2Hermite + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1, + CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR2* WINAPI D3DXVec2CatmullRom + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1, + CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR2* WINAPI D3DXVec2BaryCentric + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g); + +// Transform (x, y, 0, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec2Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, 0, 1) by matrix, project result back into w=1. +D3DXVECTOR2* WINAPI D3DXVec2TransformCoord + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, 0, 0) by matrix. +D3DXVECTOR2* WINAPI D3DXVec2TransformNormal + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform Array (x, y, 0, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec2TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n); + +// Transform Array (x, y, 0, 1) by matrix, project result back into w=1. +D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray + ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform Array (x, y, 0, 0) by matrix. +D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray + ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + + + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 3D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec3Length + ( CONST D3DXVECTOR3 *pV ); + +FLOAT D3DXVec3LengthSq + ( CONST D3DXVECTOR3 *pV ); + +FLOAT D3DXVec3Dot + ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Cross + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Add + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Subtract + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... +D3DXVECTOR3* D3DXVec3Minimize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... +D3DXVECTOR3* D3DXVec3Maximize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Scale + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR3* D3DXVec3Lerp + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +D3DXVECTOR3* WINAPI D3DXVec3Normalize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR3* WINAPI D3DXVec3Hermite + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1, + CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR3* WINAPI D3DXVec3CatmullRom + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1, + CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR3* WINAPI D3DXVec3BaryCentric + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g); + +// Transform (x, y, z, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec3Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, z, 1) by matrix, project result back into w=1. +D3DXVECTOR3* WINAPI D3DXVec3TransformCoord + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, z, 0) by matrix. If you transforming a normal by a +// non-affine matrix, the matrix you pass to this function should be the +// transpose of the inverse of the matrix you would use to transform a coord. +D3DXVECTOR3* WINAPI D3DXVec3TransformNormal + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + + +// Transform Array (x, y, z, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec3TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform Array (x, y, z, 1) by matrix, project result back into w=1. +D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform (x, y, z, 0) by matrix. If you transforming a normal by a +// non-affine matrix, the matrix you pass to this function should be the +// transpose of the inverse of the matrix you would use to transform a coord. +D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Project vector from object space into screen space +D3DXVECTOR3* WINAPI D3DXVec3Project + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); + +// Project vector from screen space into object space +D3DXVECTOR3* WINAPI D3DXVec3Unproject + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); + +// Project vector Array from object space into screen space +D3DXVECTOR3* WINAPI D3DXVec3ProjectArray + ( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3D10_VIEWPORT *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n); + +// Project vector Array from screen space into object space +D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3D10_VIEWPORT *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n); + + +#ifdef __cplusplus +} +#endif + + + +//-------------------------- +// 4D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec4Length + ( CONST D3DXVECTOR4 *pV ); + +FLOAT D3DXVec4LengthSq + ( CONST D3DXVECTOR4 *pV ); + +FLOAT D3DXVec4Dot + ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ); + +D3DXVECTOR4* D3DXVec4Add + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +D3DXVECTOR4* D3DXVec4Subtract + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... +D3DXVECTOR4* D3DXVec4Minimize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... +D3DXVECTOR4* D3DXVec4Maximize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +D3DXVECTOR4* D3DXVec4Scale + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR4* D3DXVec4Lerp + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Cross-product in 4 dimensions. +D3DXVECTOR4* WINAPI D3DXVec4Cross + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + CONST D3DXVECTOR4 *pV3); + +D3DXVECTOR4* WINAPI D3DXVec4Normalize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR4* WINAPI D3DXVec4Hermite + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1, + CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR4* WINAPI D3DXVec4CatmullRom + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1, + CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR4* WINAPI D3DXVec4BaryCentric + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g); + +// Transform vector by matrix. +D3DXVECTOR4* WINAPI D3DXVec4Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM ); + +// Transform vector array by matrix. +D3DXVECTOR4* WINAPI D3DXVec4TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 4D Matrix +//-------------------------- + +// inline + +D3DXMATRIX* D3DXMatrixIdentity + ( D3DXMATRIX *pOut ); + +BOOL D3DXMatrixIsIdentity + ( CONST D3DXMATRIX *pM ); + + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +FLOAT WINAPI D3DXMatrixDeterminant + ( CONST D3DXMATRIX *pM ); + +HRESULT WINAPI D3DXMatrixDecompose + ( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation, + D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM ); + +D3DXMATRIX* WINAPI D3DXMatrixTranspose + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM ); + +// Matrix multiplication. The result represents the transformation M2 +// followed by the transformation M1. (Out = M1 * M2) +D3DXMATRIX* WINAPI D3DXMatrixMultiply + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); + +// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2)) +D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); + +// Calculate inverse of matrix. Inversion my fail, in which case NULL will +// be returned. The determinant of pM is also returned it pfDeterminant +// is non-NULL. +D3DXMATRIX* WINAPI D3DXMatrixInverse + ( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM ); + +// Build a matrix which scales by (sx, sy, sz) +D3DXMATRIX* WINAPI D3DXMatrixScaling + ( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz ); + +// Build a matrix which translates by (x, y, z) +D3DXMATRIX* WINAPI D3DXMatrixTranslation + ( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z ); + +// Build a matrix which rotates around the X axis +D3DXMATRIX* WINAPI D3DXMatrixRotationX + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around the Y axis +D3DXMATRIX* WINAPI D3DXMatrixRotationY + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around the Z axis +D3DXMATRIX* WINAPI D3DXMatrixRotationZ + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around an arbitrary axis +D3DXMATRIX* WINAPI D3DXMatrixRotationAxis + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); + +// Build a matrix from a quaternion +D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion + ( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ); + +// Yaw around the Y axis, a pitch around the X axis, +// and a roll around the Z axis. +D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll + ( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); + +// Build transformation matrix. NULL arguments are treated as identity. +// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixTransformation + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter, + CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling, + CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, + CONST D3DXVECTOR3 *pTranslation); + +// Build 2D transformation matrix in XY plane. NULL arguments are treated as identity. +// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixTransformation2D + ( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter, + FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling, + CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, + CONST D3DXVECTOR2* pTranslation); + +// Build affine transformation matrix. NULL arguments are treated as identity. +// Mout = Ms * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation + ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter, + CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation); + +// Build 2D affine transformation matrix in XY plane. NULL arguments are treated as identity. +// Mout = Ms * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D + ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter, + FLOAT Rotation, CONST D3DXVECTOR2* pTranslation); + +// Build a lookat matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixLookAtRH + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, + CONST D3DXVECTOR3 *pUp ); + +// Build a lookat matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixLookAtLH + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, + CONST D3DXVECTOR3 *pUp ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH + ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH + ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build an ortho projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoRH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build an ortho projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoLH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build an ortho projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build an ortho projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build a matrix which flattens geometry into a plane, as if casting +// a shadow from a light. +D3DXMATRIX* WINAPI D3DXMatrixShadow + ( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight, + CONST D3DXPLANE *pPlane ); + +// Build a matrix which reflects the coordinate system about a plane +D3DXMATRIX* WINAPI D3DXMatrixReflect + ( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Quaternion +//-------------------------- + +// inline + +FLOAT D3DXQuaternionLength + ( CONST D3DXQUATERNION *pQ ); + +// Length squared, or "norm" +FLOAT D3DXQuaternionLengthSq + ( CONST D3DXQUATERNION *pQ ); + +FLOAT D3DXQuaternionDot + ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ); + +// (0, 0, 0, 1) +D3DXQUATERNION* D3DXQuaternionIdentity + ( D3DXQUATERNION *pOut ); + +BOOL D3DXQuaternionIsIdentity + ( CONST D3DXQUATERNION *pQ ); + +// (-x, -y, -z, w) +D3DXQUATERNION* D3DXQuaternionConjugate + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Compute a quaternin's axis and angle of rotation. Expects unit quaternions. +void WINAPI D3DXQuaternionToAxisAngle + ( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle ); + +// Build a quaternion from a rotation matrix. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix + ( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM); + +// Rotation about arbitrary axis. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis + ( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); + +// Yaw around the Y axis, a pitch around the X axis, +// and a roll around the Z axis. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll + ( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); + +// Quaternion multiplication. The result represents the rotation Q2 +// followed by the rotation Q1. (Out = Q2 * Q1) +D3DXQUATERNION* WINAPI D3DXQuaternionMultiply + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2 ); + +D3DXQUATERNION* WINAPI D3DXQuaternionNormalize + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Conjugate and re-norm +D3DXQUATERNION* WINAPI D3DXQuaternionInverse + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Expects unit quaternions. +// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v) +D3DXQUATERNION* WINAPI D3DXQuaternionLn + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Expects pure quaternions. (w == 0) w is ignored in calculation. +// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v) +D3DXQUATERNION* WINAPI D3DXQuaternionExp + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1). +// Expects unit quaternions. +D3DXQUATERNION* WINAPI D3DXQuaternionSlerp + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, FLOAT t ); + +// Spherical quadrangle interpolation. +// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t)) +D3DXQUATERNION* WINAPI D3DXQuaternionSquad + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB, + CONST D3DXQUATERNION *pC, FLOAT t ); + +// Setup control points for spherical quadrangle interpolation +// from Q1 to Q2. The control points are chosen in such a way +// to ensure the continuity of tangents with adjacent segments. +void WINAPI D3DXQuaternionSquadSetup + ( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut, + CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 ); + +// Barycentric interpolation. +// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g)) +D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3, + FLOAT f, FLOAT g ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Plane +//-------------------------- + +// inline + +// ax + by + cz + dw +FLOAT D3DXPlaneDot + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV); + +// ax + by + cz + d +FLOAT D3DXPlaneDotCoord + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); + +// ax + by + cz +FLOAT D3DXPlaneDotNormal + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); + +D3DXPLANE* D3DXPlaneScale + (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Normalize plane (so that |a,b,c| == 1) +D3DXPLANE* WINAPI D3DXPlaneNormalize + ( D3DXPLANE *pOut, CONST D3DXPLANE *pP); + +// Find the intersection between a plane and a line. If the line is +// parallel to the plane, NULL is returned. +D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine + ( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1, + CONST D3DXVECTOR3 *pV2); + +// Construct a plane from a point and a normal +D3DXPLANE* WINAPI D3DXPlaneFromPointNormal + ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal); + +// Construct a plane from 3 points +D3DXPLANE* WINAPI D3DXPlaneFromPoints + ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + CONST D3DXVECTOR3 *pV3); + +// Transform a plane by a matrix. The vector (a,b,c) must be normal. +// M should be the inverse transpose of the transformation desired. +D3DXPLANE* WINAPI D3DXPlaneTransform + ( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM ); + +// Transform an array of planes by a matrix. The vectors (a,b,c) must be normal. +// M should be the inverse transpose of the transformation desired. +D3DXPLANE* WINAPI D3DXPlaneTransformArray + ( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Color +//-------------------------- + +// inline + +// (1-r, 1-g, 1-b, a) +D3DXCOLOR* D3DXColorNegative + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC); + +D3DXCOLOR* D3DXColorAdd + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +D3DXCOLOR* D3DXColorSubtract + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +D3DXCOLOR* D3DXColorScale + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); + +// (r1*r2, g1*g2, b1*b2, a1*a2) +D3DXCOLOR* D3DXColorModulate + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +// Linear interpolation of r,g,b, and a. C1 + s(C2-C1) +D3DXCOLOR* D3DXColorLerp + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Interpolate r,g,b between desaturated color and color. +// DesaturatedColor + s(Color - DesaturatedColor) +D3DXCOLOR* WINAPI D3DXColorAdjustSaturation + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); + +// Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey) +D3DXCOLOR* WINAPI D3DXColorAdjustContrast + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c); + +#ifdef __cplusplus +} +#endif + + + + +//-------------------------- +// Misc +//-------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +// Calculate Fresnel term given the cosine of theta (likely obtained by +// taking the dot of two normals), and the refraction index of the material. +FLOAT WINAPI D3DXFresnelTerm + (FLOAT CosTheta, FLOAT RefractionIndex); + +#ifdef __cplusplus +} +#endif + + + +//=========================================================================== +// +// Matrix Stack +// +//=========================================================================== + +typedef interface ID3DXMatrixStack ID3DXMatrixStack; +typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK; + +// {C7885BA7-F990-4fe7-922D-8515E477DD85} +DEFINE_GUID(IID_ID3DXMatrixStack, +0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85); + + +#undef INTERFACE +#define INTERFACE ID3DXMatrixStack + +DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) +{ + // + // IUnknown methods + // + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + // + // ID3DXMatrixStack methods + // + + // Pops the top of the stack, returns the current top + // *after* popping the top. + STDMETHOD(Pop)(THIS) PURE; + + // Pushes the stack by one, duplicating the current matrix. + STDMETHOD(Push)(THIS) PURE; + + // Loads identity in the current matrix. + STDMETHOD(LoadIdentity)(THIS) PURE; + + // Loads the given matrix into the current matrix + STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Right-Multiplies the given matrix to the current matrix. + // (transformation is about the current world origin) + STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Left-Multiplies the given matrix to the current matrix + // (transformation is about the local origin of the object) + STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Right multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the current world origin) + STDMETHOD(RotateAxis) + (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + + // Left multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the local origin of the object) + STDMETHOD(RotateAxisLocal) + (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + + // Right multiply the current matrix with the computed rotation + // matrix. All angles are counterclockwise. (rotation is about the + // current world origin) + + // The rotation is composed of a yaw around the Y axis, a pitch around + // the X axis, and a roll around the Z axis. + STDMETHOD(RotateYawPitchRoll) + (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + + // Left multiply the current matrix with the computed rotation + // matrix. All angles are counterclockwise. (rotation is about the + // local origin of the object) + + // The rotation is composed of a yaw around the Y axis, a pitch around + // the X axis, and a roll around the Z axis. + STDMETHOD(RotateYawPitchRollLocal) + (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + + // Right multiply the current matrix with the computed scale + // matrix. (transformation is about the current world origin) + STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Left multiply the current matrix with the computed scale + // matrix. (transformation is about the local origin of the object) + STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Right multiply the current matrix with the computed translation + // matrix. (transformation is about the current world origin) + STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE; + + // Left multiply the current matrix with the computed translation + // matrix. (transformation is about the local origin of the object) + STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Obtain the current matrix at the top of the stack + STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +HRESULT WINAPI + D3DXCreateMatrixStack( + UINT Flags, + LPD3DXMATRIXSTACK* ppStack); + +#ifdef __cplusplus +} +#endif + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +//============================================================================ +// +// Basic Spherical Harmonic math routines +// +//============================================================================ + +#define D3DXSH_MINORDER 2 +#define D3DXSH_MAXORDER 6 + +//============================================================================ +// +// D3DXSHEvalDirection: +// -------------------- +// Evaluates the Spherical Harmonic basis functions +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction to evaluate in - assumed to be normalized +// +//============================================================================ + +FLOAT* WINAPI D3DXSHEvalDirection + ( FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir ); + +//============================================================================ +// +// D3DXSHRotate: +// -------------------- +// Rotates SH vector by a rotation matrix +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned (should not alias with pIn.) +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pMatrix +// Matrix used for rotation - rotation sub matrix should be orthogonal +// and have a unit determinant. +// pIn +// Input SH coeffs (rotated), incorect results if this is also output. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHRotate + ( __out_ecount(Order*Order) FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn ); + +//============================================================================ +// +// D3DXSHRotateZ: +// -------------------- +// Rotates the SH vector in the Z axis by an angle +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned (should not alias with pIn.) +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// Angle +// Angle in radians to rotate around the Z axis. +// pIn +// Input SH coeffs (rotated), incorect results if this is also output. +// +//============================================================================ + + +FLOAT* WINAPI D3DXSHRotateZ + ( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn ); + +//============================================================================ +// +// D3DXSHAdd: +// -------------------- +// Adds two SH vectors, pOut[i] = pA[i] + pB[i]; +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pA +// Input SH coeffs. +// pB +// Input SH coeffs (second vector.) +// +//============================================================================ + +FLOAT* WINAPI D3DXSHAdd + ( __out_ecount(Order*Order) FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); + +//============================================================================ +// +// D3DXSHScale: +// -------------------- +// Adds two SH vectors, pOut[i] = pA[i]*Scale; +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pIn +// Input SH coeffs. +// Scale +// Scale factor. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHScale + ( __out_ecount(Order*Order) FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale ); + +//============================================================================ +// +// D3DXSHDot: +// -------------------- +// Computes the dot product of two SH vectors +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pA +// Input SH coeffs. +// pB +// Second set of input SH coeffs. +// +//============================================================================ + +FLOAT WINAPI D3DXSHDot + ( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); + +//============================================================================ +// +// D3DXSHMultiply[O]: +// -------------------- +// Computes the product of two functions represented using SH (f and g), where: +// pOut[i] = int(y_i(s) * f(s) * g(s)), where y_i(s) is the ith SH basis +// function, f(s) and g(s) are SH functions (sum_i(y_i(s)*c_i)). The order O +// determines the lengths of the arrays, where there should always be O^2 +// coefficients. In general the product of two SH functions of order O generates +// and SH function of order 2*O - 1, but we truncate the result. This means +// that the product commutes (f*g == g*f) but doesn't associate +// (f*(g*h) != (f*g)*h. +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// pF +// Input SH coeffs for first function. +// pG +// Second set of input SH coeffs. +// +//============================================================================ + +__out_ecount(4) FLOAT* WINAPI D3DXSHMultiply2(__out_ecount(4) FLOAT *pOut,__in_ecount(4) CONST FLOAT *pF,__in_ecount(4) CONST FLOAT *pG); +__out_ecount(9) FLOAT* WINAPI D3DXSHMultiply3(__out_ecount(9) FLOAT *pOut,__in_ecount(9) CONST FLOAT *pF,__in_ecount(9) CONST FLOAT *pG); +__out_ecount(16) FLOAT* WINAPI D3DXSHMultiply4(__out_ecount(16) FLOAT *pOut,__in_ecount(16) CONST FLOAT *pF,__in_ecount(16) CONST FLOAT *pG); +__out_ecount(25) FLOAT* WINAPI D3DXSHMultiply5(__out_ecount(25) FLOAT *pOut,__in_ecount(25) CONST FLOAT *pF,__in_ecount(25) CONST FLOAT *pG); +__out_ecount(36) FLOAT* WINAPI D3DXSHMultiply6(__out_ecount(36) FLOAT *pOut,__in_ecount(36) CONST FLOAT *pF,__in_ecount(36) CONST FLOAT *pG); + + +//============================================================================ +// +// Basic Spherical Harmonic lighting routines +// +//============================================================================ + +//============================================================================ +// +// D3DXSHEvalDirectionalLight: +// -------------------- +// Evaluates a directional light and returns spectral SH data. The output +// vector is computed so that if the intensity of R/G/B is unit the resulting +// exit radiance of a point directly under the light on a diffuse object with +// an albedo of 1 would be 1.0. This will compute 3 spectral samples, pROut +// has to be specified, while pGout and pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction light is coming from (assumed to be normalized.) +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalDirectionalLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + __out_ecount_opt(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalSphericalLight: +// -------------------- +// Evaluates a spherical light and returns spectral SH data. There is no +// normalization of the intensity of the light like there is for directional +// lights, care has to be taken when specifiying the intensities. This will +// compute 3 spectral samples, pROut has to be specified, while pGout and +// pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pPos +// Position of light - reciever is assumed to be at the origin. +// Radius +// Radius of the spherical light source. +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalSphericalLight + ( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + __out_ecount_opt(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalConeLight: +// -------------------- +// Evaluates a light that is a cone of constant intensity and returns spectral +// SH data. The output vector is computed so that if the intensity of R/G/B is +// unit the resulting exit radiance of a point directly under the light oriented +// in the cone direction on a diffuse object with an albedo of 1 would be 1.0. +// This will compute 3 spectral samples, pROut has to be specified, while pGout +// and pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction light is coming from (assumed to be normalized.) +// Radius +// Radius of cone in radians. +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalConeLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + __out_ecount_opt(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalHemisphereLight: +// -------------------- +// Evaluates a light that is a linear interpolant between two colors over the +// sphere. The interpolant is linear along the axis of the two points, not +// over the surface of the sphere (ie: if the axis was (0,0,1) it is linear in +// Z, not in the azimuthal angle.) The resulting spherical lighting function +// is normalized so that a point on a perfectly diffuse surface with no +// shadowing and a normal pointed in the direction pDir would result in exit +// radiance with a value of 1 if the top color was white and the bottom color +// was black. This is a very simple model where Top represents the intensity +// of the "sky" and Bottom represents the intensity of the "ground". +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Axis of the hemisphere. +// Top +// Color of the upper hemisphere. +// Bottom +// Color of the lower hemisphere. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green +// pBOut +// Output SH vector for Blue +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalHemisphereLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom, + __out_ecount_opt(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut ); + +// Math intersection functions + +BOOL WINAPI D3DXIntersectTri +( + CONST D3DXVECTOR3 *p0, // Triangle vertex 0 position + CONST D3DXVECTOR3 *p1, // Triangle vertex 1 position + CONST D3DXVECTOR3 *p2, // Triangle vertex 2 position + CONST D3DXVECTOR3 *pRayPos, // Ray origin + CONST D3DXVECTOR3 *pRayDir, // Ray direction + FLOAT *pU, // Barycentric Hit Coordinates + FLOAT *pV, // Barycentric Hit Coordinates + FLOAT *pDist); // Ray-Intersection Parameter Distance + +BOOL WINAPI + D3DXSphereBoundProbe( + CONST D3DXVECTOR3 *pCenter, + FLOAT Radius, + CONST D3DXVECTOR3 *pRayPosition, + CONST D3DXVECTOR3 *pRayDirection); + +BOOL WINAPI + D3DXBoxBoundProbe( + CONST D3DXVECTOR3 *pMin, + CONST D3DXVECTOR3 *pMax, + CONST D3DXVECTOR3 *pRayPosition, + CONST D3DXVECTOR3 *pRayDirection); + +HRESULT WINAPI + D3DXComputeBoundingSphere( + CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position + DWORD NumVertices, + DWORD dwStride, // count in bytes to subsequent position vectors + D3DXVECTOR3 *pCenter, + FLOAT *pRadius); + +HRESULT WINAPI + D3DXComputeBoundingBox( + CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position + DWORD NumVertices, + DWORD dwStride, // count in bytes to subsequent position vectors + D3DXVECTOR3 *pMin, + D3DXVECTOR3 *pMax); + + +/////////////////////////////////////////////////////////////////////////// +// CPU Optimization: +/////////////////////////////////////////////////////////////////////////// + +//------------------------------------------------------------------------- +// D3DX_CPU_OPTIMIZATION flags: +// ---------------------------- +// D3DX_NOT_OPTIMIZED Use Intel Pentium optimizations +// D3DX_3DNOW_OPTIMIZED Use AMD 3DNow optimizations +// D3DX_SSE_OPTIMIZED Use Intel Pentium III SSE optimizations +// D3DX_SSE2_OPTIMIZED Use Intel Pentium IV SSE2 optimizations +//------------------------------------------------------------------------- + + +typedef enum _D3DX_CPU_OPTIMIZATION +{ + D3DX_NOT_OPTIMIZED = 0, + D3DX_3DNOW_OPTIMIZED, + D3DX_SSE2_OPTIMIZED, + D3DX_SSE_OPTIMIZED +} D3DX_CPU_OPTIMIZATION; + + +//------------------------------------------------------------------------- +// D3DXCpuOptimizations: +// --------------------- +// Enables or disables CPU optimizations. Returns the type of CPU, which +// was detected, and for which optimizations exist. +// +// Parameters: +// Enable +// TRUE to enable CPU optimizations. FALSE to disable. +//------------------------------------------------------------------------- + +D3DX_CPU_OPTIMIZATION WINAPI + D3DXCpuOptimizations(BOOL Enable); + +#ifdef __cplusplus +} +#endif + + +#include "D3DX10math.inl" + +#if _MSC_VER >= 1200 +#pragma warning(pop) +#else +#pragma warning(default:4201) +#endif + +#endif // __D3DX9MATH_H__ + diff --git a/RenderDll/Dx9Sdk/Include/D3DX10math.inl b/RenderDll/Dx9Sdk/Include/D3DX10math.inl new file mode 100644 index 0000000..56f1163 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX10math.inl @@ -0,0 +1,2228 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx10math.inl +// Content: D3DX10 math inline functions +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DXMATH_INL__ +#define __D3DXMATH_INL__ + + +//=========================================================================== +// +// Inline Class Methods +// +//=========================================================================== + +#ifdef __cplusplus + +//-------------------------- +// Float16 +//-------------------------- + +D3DX10INLINE +D3DXFLOAT16::D3DXFLOAT16( FLOAT f ) +{ + D3DXFloat32To16Array(this, &f, 1); +} + +D3DX10INLINE +D3DXFLOAT16::D3DXFLOAT16( CONST D3DXFLOAT16& f ) +{ + value = f.value; +} + +// casting +D3DX10INLINE +D3DXFLOAT16::operator FLOAT () +{ + FLOAT f; + D3DXFloat16To32Array(&f, this, 1); + return f; +} + +// binary operators +D3DX10INLINE BOOL +D3DXFLOAT16::operator == ( CONST D3DXFLOAT16& f ) const +{ + // At least one is NaN + if(((value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (value & D3DX_16F_FRAC_MASK)) + || ((f.value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (f.value & D3DX_16F_FRAC_MASK))) + return false; + // +/- Zero + else if((value & ~D3DX_16F_SIGN_MASK) == 0 && (f.value & ~D3DX_16F_SIGN_MASK) == 0) + return true; + else + return value == f.value; +} + +D3DX10INLINE BOOL +D3DXFLOAT16::operator != ( CONST D3DXFLOAT16& f ) const +{ + // At least one is NaN + if(((value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (value & D3DX_16F_FRAC_MASK)) + || ((f.value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (f.value & D3DX_16F_FRAC_MASK))) + return true; + // +/- Zero + else if((value & ~D3DX_16F_SIGN_MASK) == 0 && (f.value & ~D3DX_16F_SIGN_MASK) == 0) + return false; + else + return value != f.value; +} + + +//-------------------------- +// 2D Vector +//-------------------------- + +D3DX10INLINE +D3DXVECTOR2::D3DXVECTOR2( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; +} + +D3DX10INLINE +D3DXVECTOR2::D3DXVECTOR2( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 2); +} + +D3DX10INLINE +D3DXVECTOR2::D3DXVECTOR2( FLOAT fx, FLOAT fy ) +{ + x = fx; + y = fy; +} + + +// casting +D3DX10INLINE +D3DXVECTOR2::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DX10INLINE +D3DXVECTOR2::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DX10INLINE D3DXVECTOR2& +D3DXVECTOR2::operator += ( CONST D3DXVECTOR2& v ) +{ + x += v.x; + y += v.y; + return *this; +} + +D3DX10INLINE D3DXVECTOR2& +D3DXVECTOR2::operator -= ( CONST D3DXVECTOR2& v ) +{ + x -= v.x; + y -= v.y; + return *this; +} + +D3DX10INLINE D3DXVECTOR2& +D3DXVECTOR2::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + return *this; +} + +D3DX10INLINE D3DXVECTOR2& +D3DXVECTOR2::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator - () const +{ + return D3DXVECTOR2(-x, -y); +} + + +// binary operators +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator + ( CONST D3DXVECTOR2& v ) const +{ + return D3DXVECTOR2(x + v.x, y + v.y); +} + +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator - ( CONST D3DXVECTOR2& v ) const +{ + return D3DXVECTOR2(x - v.x, y - v.y); +} + +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator * ( FLOAT f ) const +{ + return D3DXVECTOR2(x * f, y * f); +} + +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR2(x * fInv, y * fInv); +} + +D3DX10INLINE D3DXVECTOR2 +operator * ( FLOAT f, CONST D3DXVECTOR2& v ) +{ + return D3DXVECTOR2(f * v.x, f * v.y); +} + +D3DX10INLINE BOOL +D3DXVECTOR2::operator == ( CONST D3DXVECTOR2& v ) const +{ + return x == v.x && y == v.y; +} + +D3DX10INLINE BOOL +D3DXVECTOR2::operator != ( CONST D3DXVECTOR2& v ) const +{ + return x != v.x || y != v.y; +} + + + +//-------------------------- +// 2D Vector (16 bit) +//-------------------------- + +D3DX10INLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 2); +} + +D3DX10INLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + *((UINT *) &x) = *((UINT *) &pf[0]); +} + +D3DX10INLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy ) +{ + x = fx; + y = fy; +} + + +// casting +D3DX10INLINE +D3DXVECTOR2_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DX10INLINE +D3DXVECTOR2_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DX10INLINE BOOL +D3DXVECTOR2_16F::operator == ( CONST D3DXVECTOR2_16F &v ) const +{ + return x == v.x && y == v.y; +} + +D3DX10INLINE BOOL +D3DXVECTOR2_16F::operator != ( CONST D3DXVECTOR2_16F &v ) const +{ + return x != v.x || y != v.y; +} + + +//-------------------------- +// 3D Vector +//-------------------------- +D3DX10INLINE +D3DXVECTOR3::D3DXVECTOR3( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; +} + +D3DX10INLINE +D3DXVECTOR3::D3DXVECTOR3( CONST D3DVECTOR& v ) +{ + x = v.x; + y = v.y; + z = v.z; +} + +D3DX10INLINE +D3DXVECTOR3::D3DXVECTOR3( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 3); +} + +D3DX10INLINE +D3DXVECTOR3::D3DXVECTOR3( FLOAT fx, FLOAT fy, FLOAT fz ) +{ + x = fx; + y = fy; + z = fz; +} + + +// casting +D3DX10INLINE +D3DXVECTOR3::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DX10INLINE +D3DXVECTOR3::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DX10INLINE D3DXVECTOR3& +D3DXVECTOR3::operator += ( CONST D3DXVECTOR3& v ) +{ + x += v.x; + y += v.y; + z += v.z; + return *this; +} + +D3DX10INLINE D3DXVECTOR3& +D3DXVECTOR3::operator -= ( CONST D3DXVECTOR3& v ) +{ + x -= v.x; + y -= v.y; + z -= v.z; + return *this; +} + +D3DX10INLINE D3DXVECTOR3& +D3DXVECTOR3::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + return *this; +} + +D3DX10INLINE D3DXVECTOR3& +D3DXVECTOR3::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator - () const +{ + return D3DXVECTOR3(-x, -y, -z); +} + + +// binary operators +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator + ( CONST D3DXVECTOR3& v ) const +{ + return D3DXVECTOR3(x + v.x, y + v.y, z + v.z); +} + +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator - ( CONST D3DXVECTOR3& v ) const +{ + return D3DXVECTOR3(x - v.x, y - v.y, z - v.z); +} + +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator * ( FLOAT f ) const +{ + return D3DXVECTOR3(x * f, y * f, z * f); +} + +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR3(x * fInv, y * fInv, z * fInv); +} + + +D3DX10INLINE D3DXVECTOR3 +operator * ( FLOAT f, CONST struct D3DXVECTOR3& v ) +{ + return D3DXVECTOR3(f * v.x, f * v.y, f * v.z); +} + + +D3DX10INLINE BOOL +D3DXVECTOR3::operator == ( CONST D3DXVECTOR3& v ) const +{ + return x == v.x && y == v.y && z == v.z; +} + +D3DX10INLINE BOOL +D3DXVECTOR3::operator != ( CONST D3DXVECTOR3& v ) const +{ + return x != v.x || y != v.y || z != v.z; +} + + + +//-------------------------- +// 3D Vector (16 bit) +//-------------------------- + +D3DX10INLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 3); +} + +D3DX10INLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DVECTOR& v ) +{ + D3DXFloat32To16Array(&x, &v.x, 1); + D3DXFloat32To16Array(&y, &v.y, 1); + D3DXFloat32To16Array(&z, &v.z, 1); +} + +D3DX10INLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + *((UINT *) &x) = *((UINT *) &pf[0]); + *((WORD *) &z) = *((WORD *) &pf[2]); +} + +D3DX10INLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz ) +{ + x = fx; + y = fy; + z = fz; +} + + +// casting +D3DX10INLINE +D3DXVECTOR3_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DX10INLINE +D3DXVECTOR3_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DX10INLINE BOOL +D3DXVECTOR3_16F::operator == ( CONST D3DXVECTOR3_16F &v ) const +{ + return x == v.x && y == v.y && z == v.z; +} + +D3DX10INLINE BOOL +D3DXVECTOR3_16F::operator != ( CONST D3DXVECTOR3_16F &v ) const +{ + return x != v.x || y != v.y || z != v.z; +} + + +//-------------------------- +// 4D Vector +//-------------------------- +D3DX10INLINE +D3DXVECTOR4::D3DXVECTOR4( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; + w = pf[3]; +} + +D3DX10INLINE +D3DXVECTOR4::D3DXVECTOR4( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 4); +} + +D3DX10INLINE +D3DXVECTOR4::D3DXVECTOR4( CONST D3DVECTOR& v, FLOAT f ) +{ + x = v.x; + y = v.y; + z = v.z; + w = f; +} + +D3DX10INLINE +D3DXVECTOR4::D3DXVECTOR4( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DX10INLINE +D3DXVECTOR4::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DX10INLINE +D3DXVECTOR4::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DX10INLINE D3DXVECTOR4& +D3DXVECTOR4::operator += ( CONST D3DXVECTOR4& v ) +{ + x += v.x; + y += v.y; + z += v.z; + w += v.w; + return *this; +} + +D3DX10INLINE D3DXVECTOR4& +D3DXVECTOR4::operator -= ( CONST D3DXVECTOR4& v ) +{ + x -= v.x; + y -= v.y; + z -= v.z; + w -= v.w; + return *this; +} + +D3DX10INLINE D3DXVECTOR4& +D3DXVECTOR4::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + w *= f; + return *this; +} + +D3DX10INLINE D3DXVECTOR4& +D3DXVECTOR4::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + w *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator - () const +{ + return D3DXVECTOR4(-x, -y, -z, -w); +} + + +// binary operators +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator + ( CONST D3DXVECTOR4& v ) const +{ + return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w); +} + +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator - ( CONST D3DXVECTOR4& v ) const +{ + return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w); +} + +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator * ( FLOAT f ) const +{ + return D3DXVECTOR4(x * f, y * f, z * f, w * f); +} + +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR4(x * fInv, y * fInv, z * fInv, w * fInv); +} + +D3DX10INLINE D3DXVECTOR4 +operator * ( FLOAT f, CONST D3DXVECTOR4& v ) +{ + return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w); +} + + +D3DX10INLINE BOOL +D3DXVECTOR4::operator == ( CONST D3DXVECTOR4& v ) const +{ + return x == v.x && y == v.y && z == v.z && w == v.w; +} + +D3DX10INLINE BOOL +D3DXVECTOR4::operator != ( CONST D3DXVECTOR4& v ) const +{ + return x != v.x || y != v.y || z != v.z || w != v.w; +} + + + +//-------------------------- +// 4D Vector (16 bit) +//-------------------------- + +D3DX10INLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 4); +} + +D3DX10INLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + *((UINT *) &x) = *((UINT *) &pf[0]); + *((UINT *) &z) = *((UINT *) &pf[2]); +} + +D3DX10INLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& v, CONST D3DXFLOAT16& f ) +{ + x = v.x; + y = v.y; + z = v.z; + w = f; +} + +D3DX10INLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz, CONST D3DXFLOAT16 &fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DX10INLINE +D3DXVECTOR4_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DX10INLINE +D3DXVECTOR4_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DX10INLINE BOOL +D3DXVECTOR4_16F::operator == ( CONST D3DXVECTOR4_16F &v ) const +{ + return x == v.x && y == v.y && z == v.z && w == v.w; +} + +D3DX10INLINE BOOL +D3DXVECTOR4_16F::operator != ( CONST D3DXVECTOR4_16F &v ) const +{ + return x != v.x || y != v.y || z != v.z || w != v.w; +} + + +//-------------------------- +// Matrix +//-------------------------- +D3DX10INLINE +D3DXMATRIX::D3DXMATRIX( CONST FLOAT* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + memcpy(&_11, pf, sizeof(D3DXMATRIX)); +} + +D3DX10INLINE +D3DXMATRIX::D3DXMATRIX( CONST D3DMATRIX& mat ) +{ + memcpy(&_11, &mat, sizeof(D3DXMATRIX)); +} + +D3DX10INLINE +D3DXMATRIX::D3DXMATRIX( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&_11, pf, 16); +} + +D3DX10INLINE +D3DXMATRIX::D3DXMATRIX( FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14, + FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24, + FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34, + FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44 ) +{ + _11 = f11; _12 = f12; _13 = f13; _14 = f14; + _21 = f21; _22 = f22; _23 = f23; _24 = f24; + _31 = f31; _32 = f32; _33 = f33; _34 = f34; + _41 = f41; _42 = f42; _43 = f43; _44 = f44; +} + + + +// access grants +D3DX10INLINE FLOAT& +D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) +{ + return m[iRow][iCol]; +} + +D3DX10INLINE FLOAT +D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) const +{ + return m[iRow][iCol]; +} + + +// casting operators +D3DX10INLINE +D3DXMATRIX::operator FLOAT* () +{ + return (FLOAT *) &_11; +} + +D3DX10INLINE +D3DXMATRIX::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &_11; +} + + +// assignment operators +D3DX10INLINE D3DXMATRIX& +D3DXMATRIX::operator *= ( CONST D3DXMATRIX& mat ) +{ + D3DXMatrixMultiply(this, this, &mat); + return *this; +} + +D3DX10INLINE D3DXMATRIX& +D3DXMATRIX::operator += ( CONST D3DXMATRIX& mat ) +{ + _11 += mat._11; _12 += mat._12; _13 += mat._13; _14 += mat._14; + _21 += mat._21; _22 += mat._22; _23 += mat._23; _24 += mat._24; + _31 += mat._31; _32 += mat._32; _33 += mat._33; _34 += mat._34; + _41 += mat._41; _42 += mat._42; _43 += mat._43; _44 += mat._44; + return *this; +} + +D3DX10INLINE D3DXMATRIX& +D3DXMATRIX::operator -= ( CONST D3DXMATRIX& mat ) +{ + _11 -= mat._11; _12 -= mat._12; _13 -= mat._13; _14 -= mat._14; + _21 -= mat._21; _22 -= mat._22; _23 -= mat._23; _24 -= mat._24; + _31 -= mat._31; _32 -= mat._32; _33 -= mat._33; _34 -= mat._34; + _41 -= mat._41; _42 -= mat._42; _43 -= mat._43; _44 -= mat._44; + return *this; +} + +D3DX10INLINE D3DXMATRIX& +D3DXMATRIX::operator *= ( FLOAT f ) +{ + _11 *= f; _12 *= f; _13 *= f; _14 *= f; + _21 *= f; _22 *= f; _23 *= f; _24 *= f; + _31 *= f; _32 *= f; _33 *= f; _34 *= f; + _41 *= f; _42 *= f; _43 *= f; _44 *= f; + return *this; +} + +D3DX10INLINE D3DXMATRIX& +D3DXMATRIX::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + _11 *= fInv; _12 *= fInv; _13 *= fInv; _14 *= fInv; + _21 *= fInv; _22 *= fInv; _23 *= fInv; _24 *= fInv; + _31 *= fInv; _32 *= fInv; _33 *= fInv; _34 *= fInv; + _41 *= fInv; _42 *= fInv; _43 *= fInv; _44 *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator - () const +{ + return D3DXMATRIX(-_11, -_12, -_13, -_14, + -_21, -_22, -_23, -_24, + -_31, -_32, -_33, -_34, + -_41, -_42, -_43, -_44); +} + + +// binary operators +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator * ( CONST D3DXMATRIX& mat ) const +{ + D3DXMATRIX matT; + D3DXMatrixMultiply(&matT, this, &mat); + return matT; +} + +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator + ( CONST D3DXMATRIX& mat ) const +{ + return D3DXMATRIX(_11 + mat._11, _12 + mat._12, _13 + mat._13, _14 + mat._14, + _21 + mat._21, _22 + mat._22, _23 + mat._23, _24 + mat._24, + _31 + mat._31, _32 + mat._32, _33 + mat._33, _34 + mat._34, + _41 + mat._41, _42 + mat._42, _43 + mat._43, _44 + mat._44); +} + +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator - ( CONST D3DXMATRIX& mat ) const +{ + return D3DXMATRIX(_11 - mat._11, _12 - mat._12, _13 - mat._13, _14 - mat._14, + _21 - mat._21, _22 - mat._22, _23 - mat._23, _24 - mat._24, + _31 - mat._31, _32 - mat._32, _33 - mat._33, _34 - mat._34, + _41 - mat._41, _42 - mat._42, _43 - mat._43, _44 - mat._44); +} + +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator * ( FLOAT f ) const +{ + return D3DXMATRIX(_11 * f, _12 * f, _13 * f, _14 * f, + _21 * f, _22 * f, _23 * f, _24 * f, + _31 * f, _32 * f, _33 * f, _34 * f, + _41 * f, _42 * f, _43 * f, _44 * f); +} + +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXMATRIX(_11 * fInv, _12 * fInv, _13 * fInv, _14 * fInv, + _21 * fInv, _22 * fInv, _23 * fInv, _24 * fInv, + _31 * fInv, _32 * fInv, _33 * fInv, _34 * fInv, + _41 * fInv, _42 * fInv, _43 * fInv, _44 * fInv); +} + + +D3DX10INLINE D3DXMATRIX +operator * ( FLOAT f, CONST D3DXMATRIX& mat ) +{ + return D3DXMATRIX(f * mat._11, f * mat._12, f * mat._13, f * mat._14, + f * mat._21, f * mat._22, f * mat._23, f * mat._24, + f * mat._31, f * mat._32, f * mat._33, f * mat._34, + f * mat._41, f * mat._42, f * mat._43, f * mat._44); +} + + +D3DX10INLINE BOOL +D3DXMATRIX::operator == ( CONST D3DXMATRIX& mat ) const +{ + return 0 == memcmp(this, &mat, sizeof(D3DXMATRIX)); +} + +D3DX10INLINE BOOL +D3DXMATRIX::operator != ( CONST D3DXMATRIX& mat ) const +{ + return 0 != memcmp(this, &mat, sizeof(D3DXMATRIX)); +} + + + +//-------------------------- +// Aligned Matrices +//-------------------------- + +D3DX10INLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST FLOAT* f ) : + D3DXMATRIX( f ) +{ +} + +D3DX10INLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DMATRIX& m ) : + D3DXMATRIX( m ) +{ +} + +D3DX10INLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DXFLOAT16* f ) : + D3DXMATRIX( f ) +{ +} + +D3DX10INLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ) : + D3DXMATRIX(_11, _12, _13, _14, + _21, _22, _23, _24, + _31, _32, _33, _34, + _41, _42, _43, _44) +{ +} + +#ifndef SIZE_MAX +#define SIZE_MAX ((SIZE_T)-1) +#endif + +D3DX10INLINE void* +_D3DXMATRIXA16::operator new( size_t s ) +{ + if (s > (SIZE_MAX-16)) + return NULL; + LPBYTE p = ::new BYTE[s + 16]; + if (p) + { + BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); + p += offset; + p[-1] = offset; + } + return p; +} + +D3DX10INLINE void* +_D3DXMATRIXA16::operator new[]( size_t s ) +{ + if (s > (SIZE_MAX-16)) + return NULL; + LPBYTE p = ::new BYTE[s + 16]; + if (p) + { + BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); + p += offset; + p[-1] = offset; + } + return p; +} + +D3DX10INLINE void +_D3DXMATRIXA16::operator delete(void* p) +{ + if(p) + { + BYTE* pb = static_cast(p); + pb -= pb[-1]; + ::delete [] pb; + } +} + +D3DX10INLINE void +_D3DXMATRIXA16::operator delete[](void* p) +{ + if(p) + { + BYTE* pb = static_cast(p); + pb -= pb[-1]; + ::delete [] pb; + } +} + +D3DX10INLINE _D3DXMATRIXA16& +_D3DXMATRIXA16::operator=(CONST D3DXMATRIX& rhs) +{ + memcpy(&_11, &rhs, sizeof(D3DXMATRIX)); + return *this; +} + + +//-------------------------- +// Quaternion +//-------------------------- + +D3DX10INLINE +D3DXQUATERNION::D3DXQUATERNION( CONST FLOAT* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; + w = pf[3]; +} + +D3DX10INLINE +D3DXQUATERNION::D3DXQUATERNION( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 4); +} + +D3DX10INLINE +D3DXQUATERNION::D3DXQUATERNION( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DX10INLINE +D3DXQUATERNION::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DX10INLINE +D3DXQUATERNION::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DX10INLINE D3DXQUATERNION& +D3DXQUATERNION::operator += ( CONST D3DXQUATERNION& q ) +{ + x += q.x; + y += q.y; + z += q.z; + w += q.w; + return *this; +} + +D3DX10INLINE D3DXQUATERNION& +D3DXQUATERNION::operator -= ( CONST D3DXQUATERNION& q ) +{ + x -= q.x; + y -= q.y; + z -= q.z; + w -= q.w; + return *this; +} + +D3DX10INLINE D3DXQUATERNION& +D3DXQUATERNION::operator *= ( CONST D3DXQUATERNION& q ) +{ + D3DXQuaternionMultiply(this, this, &q); + return *this; +} + +D3DX10INLINE D3DXQUATERNION& +D3DXQUATERNION::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + w *= f; + return *this; +} + +D3DX10INLINE D3DXQUATERNION& +D3DXQUATERNION::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + w *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator - () const +{ + return D3DXQUATERNION(-x, -y, -z, -w); +} + + +// binary operators +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator + ( CONST D3DXQUATERNION& q ) const +{ + return D3DXQUATERNION(x + q.x, y + q.y, z + q.z, w + q.w); +} + +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator - ( CONST D3DXQUATERNION& q ) const +{ + return D3DXQUATERNION(x - q.x, y - q.y, z - q.z, w - q.w); +} + +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator * ( CONST D3DXQUATERNION& q ) const +{ + D3DXQUATERNION qT; + D3DXQuaternionMultiply(&qT, this, &q); + return qT; +} + +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator * ( FLOAT f ) const +{ + return D3DXQUATERNION(x * f, y * f, z * f, w * f); +} + +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXQUATERNION(x * fInv, y * fInv, z * fInv, w * fInv); +} + + +D3DX10INLINE D3DXQUATERNION +operator * (FLOAT f, CONST D3DXQUATERNION& q ) +{ + return D3DXQUATERNION(f * q.x, f * q.y, f * q.z, f * q.w); +} + + +D3DX10INLINE BOOL +D3DXQUATERNION::operator == ( CONST D3DXQUATERNION& q ) const +{ + return x == q.x && y == q.y && z == q.z && w == q.w; +} + +D3DX10INLINE BOOL +D3DXQUATERNION::operator != ( CONST D3DXQUATERNION& q ) const +{ + return x != q.x || y != q.y || z != q.z || w != q.w; +} + + + +//-------------------------- +// Plane +//-------------------------- + +D3DX10INLINE +D3DXPLANE::D3DXPLANE( CONST FLOAT* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + a = pf[0]; + b = pf[1]; + c = pf[2]; + d = pf[3]; +} + +D3DX10INLINE +D3DXPLANE::D3DXPLANE( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&a, pf, 4); +} + +D3DX10INLINE +D3DXPLANE::D3DXPLANE( FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd ) +{ + a = fa; + b = fb; + c = fc; + d = fd; +} + + +// casting +D3DX10INLINE +D3DXPLANE::operator FLOAT* () +{ + return (FLOAT *) &a; +} + +D3DX10INLINE +D3DXPLANE::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &a; +} + + +// assignment operators +D3DX10INLINE D3DXPLANE& +D3DXPLANE::operator *= ( FLOAT f ) +{ + a *= f; + b *= f; + c *= f; + d *= f; + return *this; +} + +D3DX10INLINE D3DXPLANE& +D3DXPLANE::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + a *= fInv; + b *= fInv; + c *= fInv; + d *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXPLANE +D3DXPLANE::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXPLANE +D3DXPLANE::operator - () const +{ + return D3DXPLANE(-a, -b, -c, -d); +} + + +// binary operators +D3DX10INLINE D3DXPLANE +D3DXPLANE::operator * ( FLOAT f ) const +{ + return D3DXPLANE(a * f, b * f, c * f, d * f); +} + +D3DX10INLINE D3DXPLANE +D3DXPLANE::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXPLANE(a * fInv, b * fInv, c * fInv, d * fInv); +} + +D3DX10INLINE D3DXPLANE +operator * (FLOAT f, CONST D3DXPLANE& p ) +{ + return D3DXPLANE(f * p.a, f * p.b, f * p.c, f * p.d); +} + +D3DX10INLINE BOOL +D3DXPLANE::operator == ( CONST D3DXPLANE& p ) const +{ + return a == p.a && b == p.b && c == p.c && d == p.d; +} + +D3DX10INLINE BOOL +D3DXPLANE::operator != ( CONST D3DXPLANE& p ) const +{ + return a != p.a || b != p.b || c != p.c || d != p.d; +} + + + + +//-------------------------- +// Color +//-------------------------- + +D3DX10INLINE +D3DXCOLOR::D3DXCOLOR( UINT dw ) +{ + CONST FLOAT f = 1.0f / 255.0f; + r = f * (FLOAT) (unsigned char) (dw >> 16); + g = f * (FLOAT) (unsigned char) (dw >> 8); + b = f * (FLOAT) (unsigned char) (dw >> 0); + a = f * (FLOAT) (unsigned char) (dw >> 24); +} + +D3DX10INLINE +D3DXCOLOR::D3DXCOLOR( CONST FLOAT* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + r = pf[0]; + g = pf[1]; + b = pf[2]; + a = pf[3]; +} + +D3DX10INLINE +D3DXCOLOR::D3DXCOLOR( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&r, pf, 4); +} + +D3DX10INLINE +D3DXCOLOR::D3DXCOLOR( FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa ) +{ + r = fr; + g = fg; + b = fb; + a = fa; +} + + +// casting +D3DX10INLINE +D3DXCOLOR::operator UINT () const +{ + UINT dwR = r >= 1.0f ? 0xff : r <= 0.0f ? 0x00 : (UINT) (r * 255.0f + 0.5f); + UINT dwG = g >= 1.0f ? 0xff : g <= 0.0f ? 0x00 : (UINT) (g * 255.0f + 0.5f); + UINT dwB = b >= 1.0f ? 0xff : b <= 0.0f ? 0x00 : (UINT) (b * 255.0f + 0.5f); + UINT dwA = a >= 1.0f ? 0xff : a <= 0.0f ? 0x00 : (UINT) (a * 255.0f + 0.5f); + + return (dwA << 24) | (dwR << 16) | (dwG << 8) | (dwB << 0); +} + + +D3DX10INLINE +D3DXCOLOR::operator FLOAT * () +{ + return (FLOAT *) &r; +} + +D3DX10INLINE +D3DXCOLOR::operator CONST FLOAT * () const +{ + return (CONST FLOAT *) &r; +} + +// assignment operators +D3DX10INLINE D3DXCOLOR& +D3DXCOLOR::operator += ( CONST D3DXCOLOR& c ) +{ + r += c.r; + g += c.g; + b += c.b; + a += c.a; + return *this; +} + +D3DX10INLINE D3DXCOLOR& +D3DXCOLOR::operator -= ( CONST D3DXCOLOR& c ) +{ + r -= c.r; + g -= c.g; + b -= c.b; + a -= c.a; + return *this; +} + +D3DX10INLINE D3DXCOLOR& +D3DXCOLOR::operator *= ( FLOAT f ) +{ + r *= f; + g *= f; + b *= f; + a *= f; + return *this; +} + +D3DX10INLINE D3DXCOLOR& +D3DXCOLOR::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + r *= fInv; + g *= fInv; + b *= fInv; + a *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator - () const +{ + return D3DXCOLOR(-r, -g, -b, -a); +} + + +// binary operators +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator + ( CONST D3DXCOLOR& c ) const +{ + return D3DXCOLOR(r + c.r, g + c.g, b + c.b, a + c.a); +} + +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator - ( CONST D3DXCOLOR& c ) const +{ + return D3DXCOLOR(r - c.r, g - c.g, b - c.b, a - c.a); +} + +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator * ( FLOAT f ) const +{ + return D3DXCOLOR(r * f, g * f, b * f, a * f); +} + +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXCOLOR(r * fInv, g * fInv, b * fInv, a * fInv); +} + + +D3DX10INLINE D3DXCOLOR +operator * (FLOAT f, CONST D3DXCOLOR& c ) +{ + return D3DXCOLOR(f * c.r, f * c.g, f * c.b, f * c.a); +} + + +D3DX10INLINE BOOL +D3DXCOLOR::operator == ( CONST D3DXCOLOR& c ) const +{ + return r == c.r && g == c.g && b == c.b && a == c.a; +} + +D3DX10INLINE BOOL +D3DXCOLOR::operator != ( CONST D3DXCOLOR& c ) const +{ + return r != c.r || g != c.g || b != c.b || a != c.a; +} + + +#endif //__cplusplus + + + +//=========================================================================== +// +// Inline functions +// +//=========================================================================== + + +//-------------------------- +// 2D Vector +//-------------------------- + +D3DX10INLINE FLOAT D3DXVec2Length + ( CONST D3DXVECTOR2 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y); +#endif +} + +D3DX10INLINE FLOAT D3DXVec2LengthSq + ( CONST D3DXVECTOR2 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y; +} + +D3DX10INLINE FLOAT D3DXVec2Dot + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y; +} + +D3DX10INLINE FLOAT D3DXVec2CCW + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->y - pV1->y * pV2->x; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Add + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + return pOut; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Subtract + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + return pOut; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Minimize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + return pOut; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Maximize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + return pOut; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Scale + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + return pOut; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Lerp + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + FLOAT s ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + return pOut; +} + + +//-------------------------- +// 3D Vector +//-------------------------- + +D3DX10INLINE FLOAT D3DXVec3Length + ( CONST D3DXVECTOR3 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); +#endif +} + +D3DX10INLINE FLOAT D3DXVec3LengthSq + ( CONST D3DXVECTOR3 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z; +} + +D3DX10INLINE FLOAT D3DXVec3Dot + ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Cross + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ + D3DXVECTOR3 v; + +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + v.x = pV1->y * pV2->z - pV1->z * pV2->y; + v.y = pV1->z * pV2->x - pV1->x * pV2->z; + v.z = pV1->x * pV2->y - pV1->y * pV2->x; + + *pOut = v; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Add + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + pOut->z = pV1->z + pV2->z; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Subtract + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + pOut->z = pV1->z - pV2->z; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Minimize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Maximize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Scale + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + pOut->z = pV->z * s; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Lerp + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + FLOAT s ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + pOut->z = pV1->z + s * (pV2->z - pV1->z); + return pOut; +} + + +//-------------------------- +// 4D Vector +//-------------------------- + +D3DX10INLINE FLOAT D3DXVec4Length + ( CONST D3DXVECTOR4 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); +#endif +} + +D3DX10INLINE FLOAT D3DXVec4LengthSq + ( CONST D3DXVECTOR4 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w; +} + +D3DX10INLINE FLOAT D3DXVec4Dot + ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z + pV1->w * pV2->w; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Add + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + pOut->z = pV1->z + pV2->z; + pOut->w = pV1->w + pV2->w; + return pOut; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Subtract + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + pOut->z = pV1->z - pV2->z; + pOut->w = pV1->w - pV2->w; + return pOut; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Minimize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; + pOut->w = pV1->w < pV2->w ? pV1->w : pV2->w; + return pOut; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Maximize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; + pOut->w = pV1->w > pV2->w ? pV1->w : pV2->w; + return pOut; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Scale + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + pOut->z = pV->z * s; + pOut->w = pV->w * s; + return pOut; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Lerp + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + FLOAT s ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + pOut->z = pV1->z + s * (pV2->z - pV1->z); + pOut->w = pV1->w + s * (pV2->w - pV1->w); + return pOut; +} + + +//-------------------------- +// 4D Matrix +//-------------------------- + +D3DX10INLINE D3DXMATRIX* D3DXMatrixIdentity + ( D3DXMATRIX *pOut ) +{ +#ifdef D3DX10_DEBUG + if(!pOut) + return NULL; +#endif + + pOut->m[0][1] = pOut->m[0][2] = pOut->m[0][3] = + pOut->m[1][0] = pOut->m[1][2] = pOut->m[1][3] = + pOut->m[2][0] = pOut->m[2][1] = pOut->m[2][3] = + pOut->m[3][0] = pOut->m[3][1] = pOut->m[3][2] = 0.0f; + + pOut->m[0][0] = pOut->m[1][1] = pOut->m[2][2] = pOut->m[3][3] = 1.0f; + return pOut; +} + + +D3DX10INLINE BOOL D3DXMatrixIsIdentity + ( CONST D3DXMATRIX *pM ) +{ +#ifdef D3DX10_DEBUG + if(!pM) + return FALSE; +#endif + + return pM->m[0][0] == 1.0f && pM->m[0][1] == 0.0f && pM->m[0][2] == 0.0f && pM->m[0][3] == 0.0f && + pM->m[1][0] == 0.0f && pM->m[1][1] == 1.0f && pM->m[1][2] == 0.0f && pM->m[1][3] == 0.0f && + pM->m[2][0] == 0.0f && pM->m[2][1] == 0.0f && pM->m[2][2] == 1.0f && pM->m[2][3] == 0.0f && + pM->m[3][0] == 0.0f && pM->m[3][1] == 0.0f && pM->m[3][2] == 0.0f && pM->m[3][3] == 1.0f; +} + + +//-------------------------- +// Quaternion +//-------------------------- + +D3DX10INLINE FLOAT D3DXQuaternionLength + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX10_DEBUG + if(!pQ) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); +#else + return (FLOAT) sqrt(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); +#endif +} + +D3DX10INLINE FLOAT D3DXQuaternionLengthSq + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX10_DEBUG + if(!pQ) + return 0.0f; +#endif + + return pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w; +} + +D3DX10INLINE FLOAT D3DXQuaternionDot + ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ) +{ +#ifdef D3DX10_DEBUG + if(!pQ1 || !pQ2) + return 0.0f; +#endif + + return pQ1->x * pQ2->x + pQ1->y * pQ2->y + pQ1->z * pQ2->z + pQ1->w * pQ2->w; +} + + +D3DX10INLINE D3DXQUATERNION* D3DXQuaternionIdentity + ( D3DXQUATERNION *pOut ) +{ +#ifdef D3DX10_DEBUG + if(!pOut) + return NULL; +#endif + + pOut->x = pOut->y = pOut->z = 0.0f; + pOut->w = 1.0f; + return pOut; +} + +D3DX10INLINE BOOL D3DXQuaternionIsIdentity + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX10_DEBUG + if(!pQ) + return FALSE; +#endif + + return pQ->x == 0.0f && pQ->y == 0.0f && pQ->z == 0.0f && pQ->w == 1.0f; +} + + +D3DX10INLINE D3DXQUATERNION* D3DXQuaternionConjugate + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pQ) + return NULL; +#endif + + pOut->x = -pQ->x; + pOut->y = -pQ->y; + pOut->z = -pQ->z; + pOut->w = pQ->w; + return pOut; +} + + +//-------------------------- +// Plane +//-------------------------- + +D3DX10INLINE FLOAT D3DXPlaneDot + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV) +{ +#ifdef D3DX10_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d * pV->w; +} + +D3DX10INLINE FLOAT D3DXPlaneDotCoord + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) +{ +#ifdef D3DX10_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d; +} + +D3DX10INLINE FLOAT D3DXPlaneDotNormal + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) +{ +#ifdef D3DX10_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z; +} + +D3DX10INLINE D3DXPLANE* D3DXPlaneScale + (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pP) + return NULL; +#endif + + pOut->a = pP->a * s; + pOut->b = pP->b * s; + pOut->c = pP->c * s; + pOut->d = pP->d * s; + return pOut; +} + + +//-------------------------- +// Color +//-------------------------- + +D3DX10INLINE D3DXCOLOR* D3DXColorNegative + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC) + return NULL; +#endif + + pOut->r = 1.0f - pC->r; + pOut->g = 1.0f - pC->g; + pOut->b = 1.0f - pC->b; + pOut->a = pC->a; + return pOut; +} + +D3DX10INLINE D3DXCOLOR* D3DXColorAdd + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r + pC2->r; + pOut->g = pC1->g + pC2->g; + pOut->b = pC1->b + pC2->b; + pOut->a = pC1->a + pC2->a; + return pOut; +} + +D3DX10INLINE D3DXCOLOR* D3DXColorSubtract + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r - pC2->r; + pOut->g = pC1->g - pC2->g; + pOut->b = pC1->b - pC2->b; + pOut->a = pC1->a - pC2->a; + return pOut; +} + +D3DX10INLINE D3DXCOLOR* D3DXColorScale + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC) + return NULL; +#endif + + pOut->r = pC->r * s; + pOut->g = pC->g * s; + pOut->b = pC->b * s; + pOut->a = pC->a * s; + return pOut; +} + +D3DX10INLINE D3DXCOLOR* D3DXColorModulate + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r * pC2->r; + pOut->g = pC1->g * pC2->g; + pOut->b = pC1->b * pC2->b; + pOut->a = pC1->a * pC2->a; + return pOut; +} + +D3DX10INLINE D3DXCOLOR* D3DXColorLerp + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r + s * (pC2->r - pC1->r); + pOut->g = pC1->g + s * (pC2->g - pC1->g); + pOut->b = pC1->b + s * (pC2->b - pC1->b); + pOut->a = pC1->a + s * (pC2->a - pC1->a); + return pOut; +} + + +#endif // __D3DXMATH_INL__ + diff --git a/RenderDll/Dx9Sdk/Include/D3DX10mesh.h b/RenderDll/Dx9Sdk/Include/D3DX10mesh.h new file mode 100644 index 0000000..e5fed8f --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX10mesh.h @@ -0,0 +1,286 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx10mesh.h +// Content: D3DX10 mesh types and functions +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx10.h" + +#ifndef __D3DX10MESH_H__ +#define __D3DX10MESH_H__ + +// {7ED943DD-52E8-40b5-A8D8-76685C406330} +DEFINE_GUID(IID_ID3DX10BaseMesh, +0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30); + +// {04B0D117-1041-46b1-AA8A-3952848BA22E} +DEFINE_GUID(IID_ID3DX10MeshBuffer, +0x4b0d117, 0x1041, 0x46b1, 0xaa, 0x8a, 0x39, 0x52, 0x84, 0x8b, 0xa2, 0x2e); + +// {4020E5C2-1403-4929-883F-E2E849FAC195} +DEFINE_GUID(IID_ID3DX10Mesh, +0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95); + +// {8875769A-D579-4088-AAEB-534D1AD84E96} +DEFINE_GUID(IID_ID3DX10PMesh, +0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96); + +// {667EA4C7-F1CD-4386-B523-7C0290B83CC5} +DEFINE_GUID(IID_ID3DX10SPMesh, +0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5); + +// {3CE6CC22-DBF2-44f4-894D-F9C34A337139} +DEFINE_GUID(IID_ID3DX10PatchMesh, +0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39); + + +// Mesh options - lower 3 bytes only, upper byte used by _D3DX10MESHOPT option flags +enum _D3DX10_MESH { + D3DX10_MESH_32_BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices. + D3DX10_MESH_GS_ADJACENCY = 0x004, // If set, mesh contains GS adjacency info. Not valid on input. + +}; + +typedef struct _D3DX10_ATTRIBUTE_RANGE +{ + UINT AttribId; + UINT FaceStart; + UINT FaceCount; + UINT VertexStart; + UINT VertexCount; +} D3DX10_ATTRIBUTE_RANGE; + +typedef D3DX10_ATTRIBUTE_RANGE* LPD3DX10_ATTRIBUTE_RANGE; + +typedef enum _D3DX10_MESH_DISCARD_FLAGS +{ + D3DX10_MESH_DISCARD_ATTRIBUTE_BUFFER = 0x01, + D3DX10_MESH_DISCARD_ATTRIBUTE_TABLE = 0x02, + D3DX10_MESH_DISCARD_POINTREPS = 0x04, + D3DX10_MESH_DISCARD_ADJACENCY = 0x08, + D3DX10_MESH_DISCARD_DEVICE_BUFFERS = 0x10, + +} D3DX10_MESH_DISCARD_FLAGS; + +typedef struct _D3DX10_WELD_EPSILONS +{ + FLOAT Position; // NOTE: This does NOT replace the epsilon in GenerateAdjacency + // in general, it should be the same value or greater than the one passed to GeneratedAdjacency + FLOAT BlendWeights; + FLOAT Normal; + FLOAT PSize; + FLOAT Specular; + FLOAT Diffuse; + FLOAT Texcoord[8]; + FLOAT Tangent; + FLOAT Binormal; + FLOAT TessFactor; +} D3DX10_WELD_EPSILONS; + +typedef D3DX10_WELD_EPSILONS* LPD3DX10_WELD_EPSILONS; + +typedef struct _D3DX10_INTERSECT_INFO +{ + UINT FaceIndex; // index of face intersected + FLOAT U; // Barycentric Hit Coordinates + FLOAT V; // Barycentric Hit Coordinates + FLOAT Dist; // Ray-Intersection Parameter Distance +} D3DX10_INTERSECT_INFO, *LPD3DX10_INTERSECT_INFO; + +// ID3DX10MeshBuffer is used by D3DX10Mesh vertex and index buffers +#undef INTERFACE +#define INTERFACE ID3DX10MeshBuffer + +DECLARE_INTERFACE_(ID3DX10MeshBuffer, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX10MeshBuffer + STDMETHOD(Map)(THIS_ void **ppData, SIZE_T *pSize) PURE; + STDMETHOD(Unmap)(THIS) PURE; + STDMETHOD_(SIZE_T, GetSize)(THIS) PURE; +}; + +// D3DX10 Mesh interfaces +#undef INTERFACE +#define INTERFACE ID3DX10Mesh + +DECLARE_INTERFACE_(ID3DX10Mesh, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX10Mesh + STDMETHOD_(UINT, GetFaceCount)(THIS) PURE; + STDMETHOD_(UINT, GetVertexCount)(THIS) PURE; + STDMETHOD_(UINT, GetVertexBufferCount)(THIS) PURE; + STDMETHOD_(UINT, GetFlags)(THIS) PURE; + STDMETHOD(GetVertexDescription)(THIS_ CONST D3D10_INPUT_ELEMENT_DESC **ppDesc, UINT *pDeclCount) PURE; + + STDMETHOD(SetVertexData)(THIS_ UINT iBuffer, CONST void *pData) PURE; + STDMETHOD(GetVertexBuffer)(THIS_ UINT iBuffer, ID3DX10MeshBuffer **ppVertexBuffer) PURE; + + STDMETHOD(SetIndexData)(THIS_ CONST void *pData, UINT cIndices) PURE; + STDMETHOD(GetIndexBuffer)(THIS_ ID3DX10MeshBuffer **ppIndexBuffer) PURE; + + STDMETHOD(SetAttributeData)(THIS_ CONST UINT *pData) PURE; + STDMETHOD(GetAttributeBuffer)(THIS_ ID3DX10MeshBuffer **ppAttributeBuffer) PURE; + + STDMETHOD(SetAttributeTable)(THIS_ CONST D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT cAttribTableSize) PURE; + STDMETHOD(GetAttributeTable)(THIS_ D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT *pAttribTableSize) PURE; + + STDMETHOD(GenerateAdjacencyAndPointReps)(THIS_ FLOAT Epsilon) PURE; + STDMETHOD(GenerateGSAdjacency)(THIS) PURE; + + STDMETHOD(SetAdjacencyData)(THIS_ CONST UINT *pAdjacency) PURE; + STDMETHOD(GetAdjacencyBuffer)(THIS_ ID3DX10MeshBuffer **ppAdjacency) PURE; + + STDMETHOD(SetPointRepData)(THIS_ CONST UINT *pPointReps) PURE; + STDMETHOD(GetPointRepBuffer)(THIS_ ID3DX10MeshBuffer **ppPointReps) PURE; + + STDMETHOD(Discard)(THIS_ D3DX10_MESH_DISCARD_FLAGS dwDiscard) PURE; + STDMETHOD(CloneMesh)(THIS_ UINT Flags, LPCSTR pPosSemantic, CONST D3D10_INPUT_ELEMENT_DESC *pDesc, UINT DeclCount, ID3DX10Mesh** ppCloneMesh) PURE; + + STDMETHOD(Optimize)(THIS_ UINT Flags, UINT * pFaceRemap, LPD3D10BLOB *ppVertexRemap) PURE; + STDMETHOD(GenerateAttributeBufferFromTable)(THIS) PURE; + + STDMETHOD(Intersect)(THIS_ D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir, + UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits); + STDMETHOD(IntersectSubset)(THIS_ UINT AttribId, D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir, + UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits); + + // ID3DX10Mesh - Device functions + STDMETHOD(CommitToDevice)(THIS) PURE; + STDMETHOD(DrawSubset)(THIS_ UINT AttribId) PURE; + STDMETHOD(DrawSubsetInstanced)(THIS_ UINT AttribId, UINT InstanceCount, UINT StartInstanceLocation) PURE; + + STDMETHOD(GetDeviceVertexBuffer)(THIS_ UINT iBuffer, ID3D10Buffer **ppVertexBuffer) PURE; + STDMETHOD(GetDeviceIndexBuffer)(THIS_ ID3D10Buffer **ppIndexBuffer) PURE; +}; + + +// Flat API +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DX10CreateMesh( + ID3D10Device *pDevice, + CONST D3D10_INPUT_ELEMENT_DESC *pDeclaration, + UINT DeclCount, + LPCSTR pPositionSemantic, + UINT VertexCount, + UINT FaceCount, + UINT Options, + ID3DX10Mesh **ppMesh); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +// ID3DX10Mesh::Optimize options - upper byte only, lower 3 bytes used from _D3DX10MESH option flags +enum _D3DX10_MESHOPT { + D3DX10_MESHOPT_COMPACT = 0x01000000, + D3DX10_MESHOPT_ATTR_SORT = 0x02000000, + D3DX10_MESHOPT_VERTEX_CACHE = 0x04000000, + D3DX10_MESHOPT_STRIP_REORDER = 0x08000000, + D3DX10_MESHOPT_IGNORE_VERTS = 0x10000000, // optimize faces only, don't touch vertices + D3DX10_MESHOPT_DO_NOT_SPLIT = 0x20000000, // do not split vertices shared between attribute groups when attribute sorting + D3DX10_MESHOPT_DEVICE_INDEPENDENT = 0x00400000, // Only affects VCache. uses a static known good cache size for all cards + + // D3DX10_MESHOPT_SHAREVB has been removed, please use D3DX10MESH_VB_SHARE instead + +}; + + +////////////////////////////////////////////////////////////////////////// +// ID3DXSkinInfo +////////////////////////////////////////////////////////////////////////// + +// {420BD604-1C76-4a34-A466-E45D0658A32C} +DEFINE_GUID(IID_ID3DX10SkinInfo, +0x420bd604, 0x1c76, 0x4a34, 0xa4, 0x66, 0xe4, 0x5d, 0x6, 0x58, 0xa3, 0x2c); + +// scaling modes for ID3DX10SkinInfo::Compact() & ID3DX10SkinInfo::UpdateMesh() +#define D3DX10_SKININFO_NO_SCALING 0 +#define D3DX10_SKININFO_SCALE_TO_1 1 +#define D3DX10_SKININFO_SCALE_TO_TOTAL 2 + +typedef struct _D3DX10_SKINNING_CHANNEL +{ + UINT SrcOffset; + UINT DestOffset; + BOOL IsNormal; +} D3DX10_SKINNING_CHANNEL; + +#undef INTERFACE +#define INTERFACE ID3DX10SkinInfo + +typedef struct ID3DX10SkinInfo *LPD3DX10SKININFO; + +DECLARE_INTERFACE_(ID3DX10SkinInfo, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD_(UINT , GetNumVertices)(THIS) PURE; + STDMETHOD_(UINT , GetNumBones)(THIS) PURE; + STDMETHOD_(UINT , GetMaxBoneInfluences)(THIS) PURE; + + STDMETHOD(AddVertices)(THIS_ UINT Count) PURE; + STDMETHOD(RemapVertices)(THIS_ UINT NewVertexCount, UINT *pVertexRemap) PURE; + + STDMETHOD(AddBones)(THIS_ UINT Count) PURE; + STDMETHOD(RemoveBone)(THIS_ UINT Index) PURE; + STDMETHOD(RemapBones)(THIS_ UINT NewBoneCount, UINT *pBoneRemap) PURE; + + STDMETHOD(AddBoneInfluences)(THIS_ UINT BoneIndex, UINT InfluenceCount, UINT *pIndices, float *pWeights) PURE; + STDMETHOD(ClearBoneInfluences)(THIS_ UINT BoneIndex) PURE; + STDMETHOD_(UINT , GetBoneInfluenceCount)(THIS_ UINT BoneIndex) PURE; + STDMETHOD(GetBoneInfluences)(THIS_ UINT BoneIndex, UINT Offset, UINT Count, UINT *pDestIndices, float *pDestWeights) PURE; + STDMETHOD(FindBoneInfluenceIndex)(THIS_ UINT BoneIndex, UINT VertexIndex, UINT *pInfluenceIndex) PURE; + STDMETHOD(SetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float Weight) PURE; + STDMETHOD(GetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float *pWeight) PURE; + + STDMETHOD(Compact)(THIS_ UINT MaxPerVertexInfluences, UINT ScaleMode, float MinWeight) PURE; + STDMETHOD(DoSoftwareSkinning)(UINT StartVertex, UINT VertexCount, void *pSrcVertices, UINT SrcStride, void *pDestVertices, UINT DestStride, D3DXMATRIX *pBoneMatrices, D3DXMATRIX *pInverseTransposeBoneMatrices, D3DX10_SKINNING_CHANNEL *pChannelDescs, UINT NumChannels) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DX10CreateSkinInfo(LPD3DX10SKININFO* ppSkinInfo); + +#ifdef __cplusplus +} +#endif //__cplusplus + +typedef struct _D3DX10_ATTRIBUTE_WEIGHTS +{ + FLOAT Position; + FLOAT Boundary; + FLOAT Normal; + FLOAT Diffuse; + FLOAT Specular; + FLOAT Texcoord[8]; + FLOAT Tangent; + FLOAT Binormal; +} D3DX10_ATTRIBUTE_WEIGHTS, *LPD3DX10_ATTRIBUTE_WEIGHTS; + +#endif //__D3DX10MESH_H__ + + diff --git a/RenderDll/Dx9Sdk/Include/D3DX10tex.h b/RenderDll/Dx9Sdk/Include/D3DX10tex.h new file mode 100644 index 0000000..a6d8bb9 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX10tex.h @@ -0,0 +1,766 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx10tex.h +// Content: D3DX10 texturing APIs +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx10.h" + +#ifndef __D3DX10TEX_H__ +#define __D3DX10TEX_H__ + + +//---------------------------------------------------------------------------- +// D3DX10_FILTER flags: +// ------------------ +// +// A valid filter must contain one of these values: +// +// D3DX10_FILTER_NONE +// No scaling or filtering will take place. Pixels outside the bounds +// of the source image are assumed to be transparent black. +// D3DX10_FILTER_POINT +// Each destination pixel is computed by sampling the nearest pixel +// from the source image. +// D3DX10_FILTER_LINEAR +// Each destination pixel is computed by linearly interpolating between +// the nearest pixels in the source image. This filter works best +// when the scale on each axis is less than 2. +// D3DX10_FILTER_TRIANGLE +// Every pixel in the source image contributes equally to the +// destination image. This is the slowest of all the filters. +// D3DX10_FILTER_BOX +// Each pixel is computed by averaging a 2x2(x2) box pixels from +// the source image. Only works when the dimensions of the +// destination are half those of the source. (as with mip maps) +// +// And can be OR'd with any of these optional flags: +// +// D3DX10_FILTER_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX10_FILTER_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX10_FILTER_MIRROR_W +// Indicates that pixels off the edge of the texture on the W-axis +// should be mirrored, not wraped. +// D3DX10_FILTER_MIRROR +// Same as specifying D3DX10_FILTER_MIRROR_U | D3DX10_FILTER_MIRROR_V | +// D3DX10_FILTER_MIRROR_V +// D3DX10_FILTER_DITHER +// Dithers the resulting image using a 4x4 order dither pattern. +// D3DX10_FILTER_SRGB_IN +// Denotes that the input data is in sRGB (gamma 2.2) colorspace. +// D3DX10_FILTER_SRGB_OUT +// Denotes that the output data is in sRGB (gamma 2.2) colorspace. +// D3DX10_FILTER_SRGB +// Same as specifying D3DX10_FILTER_SRGB_IN | D3DX10_FILTER_SRGB_OUT +// +//---------------------------------------------------------------------------- + +typedef enum D3DX10_FILTER_FLAG +{ + D3DX10_FILTER_NONE = (1 << 0), + D3DX10_FILTER_POINT = (2 << 0), + D3DX10_FILTER_LINEAR = (3 << 0), + D3DX10_FILTER_TRIANGLE = (4 << 0), + D3DX10_FILTER_BOX = (5 << 0), + + D3DX10_FILTER_MIRROR_U = (1 << 16), + D3DX10_FILTER_MIRROR_V = (2 << 16), + D3DX10_FILTER_MIRROR_W = (4 << 16), + D3DX10_FILTER_MIRROR = (7 << 16), + + D3DX10_FILTER_DITHER = (1 << 19), + D3DX10_FILTER_DITHER_DIFFUSION= (2 << 19), + + D3DX10_FILTER_SRGB_IN = (1 << 21), + D3DX10_FILTER_SRGB_OUT = (2 << 21), + D3DX10_FILTER_SRGB = (3 << 21), +} D3DX10_FILTER_FLAG; + +//---------------------------------------------------------------------------- +// D3DX10_NORMALMAP flags: +// --------------------- +// These flags are used to control how D3DX10ComputeNormalMap generates normal +// maps. Any number of these flags may be OR'd together in any combination. +// +// D3DX10_NORMALMAP_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX10_NORMALMAP_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX10_NORMALMAP_MIRROR +// Same as specifying D3DX10_NORMALMAP_MIRROR_U | D3DX10_NORMALMAP_MIRROR_V +// D3DX10_NORMALMAP_INVERTSIGN +// Inverts the direction of each normal +// D3DX10_NORMALMAP_COMPUTE_OCCLUSION +// Compute the per pixel Occlusion term and encodes it into the alpha. +// An Alpha of 1 means that the pixel is not obscured in anyway, and +// an alpha of 0 would mean that the pixel is completly obscured. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX10_NORMALMAP_FLAG +{ + D3DX10_NORMALMAP_MIRROR_U = (1 << 16), + D3DX10_NORMALMAP_MIRROR_V = (2 << 16), + D3DX10_NORMALMAP_MIRROR = (3 << 16), + D3DX10_NORMALMAP_INVERTSIGN = (8 << 16), + D3DX10_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16), +} D3DX10_NORMALMAP_FLAG; + +//---------------------------------------------------------------------------- +// D3DX10_CHANNEL flags: +// ------------------- +// These flags are used by functions which operate on or more channels +// in a texture. +// +// D3DX10_CHANNEL_RED +// Indicates the red channel should be used +// D3DX10_CHANNEL_BLUE +// Indicates the blue channel should be used +// D3DX10_CHANNEL_GREEN +// Indicates the green channel should be used +// D3DX10_CHANNEL_ALPHA +// Indicates the alpha channel should be used +// D3DX10_CHANNEL_LUMINANCE +// Indicates the luminaces of the red green and blue channels should be +// used. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX10_CHANNEL_FLAG +{ + D3DX10_CHANNEL_RED = (1 << 0), + D3DX10_CHANNEL_BLUE = (1 << 1), + D3DX10_CHANNEL_GREEN = (1 << 2), + D3DX10_CHANNEL_ALPHA = (1 << 3), + D3DX10_CHANNEL_LUMINANCE = (1 << 4), +} D3DX10_CHANNEL_FLAG; + + + +//---------------------------------------------------------------------------- +// D3DX10_IMAGE_FILE_FORMAT: +// --------------------- +// This enum is used to describe supported image file formats. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX10_IMAGE_FILE_FORMAT +{ + D3DX10_IFF_BMP = 0, + D3DX10_IFF_JPG = 1, + D3DX10_IFF_PNG = 3, + D3DX10_IFF_DDS = 4, + D3DX10_IFF_TIFF = 10, + D3DX10_IFF_GIF = 11, + D3DX10_IFF_WMP = 12, + D3DX10_IFF_FORCE_DWORD = 0x7fffffff + +} D3DX10_IMAGE_FILE_FORMAT; + + +//---------------------------------------------------------------------------- +// D3DX10_SAVE_TEXTURE_FLAG: +// --------------------- +// This enum is used to support texture saving options. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX10_SAVE_TEXTURE_FLAG +{ + D3DX10_STF_USEINPUTBLOB = 0x0001, +} D3DX10_SAVE_TEXTURE_FLAG; + + + +//---------------------------------------------------------------------------- +// D3DX10_IMAGE_INFO: +// --------------- +// This structure is used to return a rough description of what the +// the original contents of an image file looked like. +// +// Width +// Width of original image in pixels +// Height +// Height of original image in pixels +// Depth +// Depth of original image in pixels +// ArraySize +// Array size in textures +// MipLevels +// Number of mip levels in original image +// MiscFlags +// Miscellaneous flags +// Format +// D3D format which most closely describes the data in original image +// ResourceDimension +// D3D10_RESOURCE_DIMENSION representing the dimension of texture stored in the file. +// D3D10_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D +// ImageFileFormat +// D3DX10_IMAGE_FILE_FORMAT representing the format of the image file. +//---------------------------------------------------------------------------- + +typedef struct D3DX10_IMAGE_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT ArraySize; + UINT MipLevels; + UINT MiscFlags; + DXGI_FORMAT Format; + D3D10_RESOURCE_DIMENSION ResourceDimension; + D3DX10_IMAGE_FILE_FORMAT ImageFileFormat; +} D3DX10_IMAGE_INFO; + + + + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + + +////////////////////////////////////////////////////////////////////////////// +// Image File APIs /////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX10_IMAGE_LOAD_INFO: +// --------------- +// This structure can be optionally passed in to texture loader APIs to +// control how textures get loaded. Pass in D3DX10_DEFAULT for any of these +// to have D3DX automatically pick defaults based on the source file. +// +// Width +// Rescale texture to Width texels wide +// Height +// Rescale texture to Height texels high +// Depth +// Rescale texture to Depth texels deep +// FirstMipLevel +// First mip level to load +// MipLevels +// Number of mip levels to load after the first level +// Usage +// D3D10_USAGE flag for the new texture +// BindFlags +// D3D10 Bind flags for the new texture +// CpuAccessFlags +// D3D10 CPU Access flags for the new texture +// MiscFlags +// Reserved. Must be 0 +// Format +// Resample texture to the specified format +// Filter +// Filter the texture using the specified filter (only when resampling) +// MipFilter +// Filter the texture mip levels using the specified filter (only if +// generating mips) +// pSrcInfo +// (optional) pointer to a D3DX10_IMAGE_INFO structure that will get +// populated with source image information +//---------------------------------------------------------------------------- + + +typedef struct D3DX10_IMAGE_LOAD_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT FirstMipLevel; + UINT MipLevels; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CpuAccessFlags; + UINT MiscFlags; + DXGI_FORMAT Format; + UINT Filter; + UINT MipFilter; + D3DX10_IMAGE_INFO* pSrcInfo; + +#ifdef __cplusplus + D3DX10_IMAGE_LOAD_INFO() + { + Width = D3DX10_DEFAULT; + Height = D3DX10_DEFAULT; + Depth = D3DX10_DEFAULT; + FirstMipLevel = D3DX10_DEFAULT; + MipLevels = D3DX10_DEFAULT; + Usage = (D3D10_USAGE) D3DX10_DEFAULT; + BindFlags = D3DX10_DEFAULT; + CpuAccessFlags = D3DX10_DEFAULT; + MiscFlags = D3DX10_DEFAULT; + Format = DXGI_FORMAT_FROM_FILE; + Filter = D3DX10_DEFAULT; + MipFilter = D3DX10_DEFAULT; + pSrcInfo = NULL; + } +#endif + +} D3DX10_IMAGE_LOAD_INFO; + +//------------------------------------------------------------------------------- +// GetImageInfoFromFile/Resource/Memory: +// ------------------------------ +// Fills in a D3DX10_IMAGE_INFO struct with information about an image file. +// +// Parameters: +// pSrcFile +// File name of the source image. +// pSrcModule +// Module where resource is located, or NULL for module associated +// with image the os used to create the current process. +// pSrcResource +// Resource name. +// pSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pPump +// Optional pointer to a thread pump object to use. +// pSrcInfo +// Pointer to a D3DX10_IMAGE_INFO structure to be filled in with the +// description of the data in the source image file. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +//------------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10GetImageInfoFromFileA( + LPCSTR pSrcFile, + ID3DX10ThreadPump* pPump, + D3DX10_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10GetImageInfoFromFileW( + LPCWSTR pSrcFile, + ID3DX10ThreadPump* pPump, + D3DX10_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileW +#else +#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileA +#endif + + +HRESULT WINAPI + D3DX10GetImageInfoFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + ID3DX10ThreadPump* pPump, + D3DX10_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10GetImageInfoFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + ID3DX10ThreadPump* pPump, + D3DX10_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceW +#else +#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceA +#endif + + +HRESULT WINAPI + D3DX10GetImageInfoFromMemory( + LPCVOID pSrcData, + SIZE_T SrcDataSize, + ID3DX10ThreadPump* pPump, + D3DX10_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + + +////////////////////////////////////////////////////////////////////////////// +// Create/Save Texture APIs ////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX10CreateTextureFromFile/Resource/Memory: +// D3DX10CreateShaderResourceViewFromFile/Resource/Memory: +// ----------------------------------- +// Create a texture object from a file or resource. +// +// Parameters: +// +// pDevice +// The D3D device with which the texture is going to be used. +// pSrcFile +// File name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module +// pvSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pLoadInfo +// Optional pointer to a D3DX10_IMAGE_LOAD_INFO structure that +// contains additional loader parameters. +// pPump +// Optional pointer to a thread pump object to use. +// ppTexture +// [out] Created texture object. +// ppShaderResourceView +// [out] Shader resource view object created. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +// +//---------------------------------------------------------------------------- + + +// FromFile + +HRESULT WINAPI + D3DX10CreateShaderResourceViewFromFileA( + ID3D10Device* pDevice, + LPCSTR pSrcFile, + D3DX10_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10CreateShaderResourceViewFromFileW( + ID3D10Device* pDevice, + LPCWSTR pSrcFile, + D3DX10_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileW +#else +#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileA +#endif + +HRESULT WINAPI + D3DX10CreateTextureFromFileA( + ID3D10Device* pDevice, + LPCSTR pSrcFile, + D3DX10_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10Resource** ppTexture, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10CreateTextureFromFileW( + ID3D10Device* pDevice, + LPCWSTR pSrcFile, + D3DX10_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10Resource** ppTexture, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileW +#else +#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileA +#endif + + +// FromResource (resources in dll/exes) + +HRESULT WINAPI + D3DX10CreateShaderResourceViewFromResourceA( + ID3D10Device* pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + D3DX10_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10CreateShaderResourceViewFromResourceW( + ID3D10Device* pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + D3DX10_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceW +#else +#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceA +#endif + +HRESULT WINAPI + D3DX10CreateTextureFromResourceA( + ID3D10Device* pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + D3DX10_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10Resource** ppTexture, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10CreateTextureFromResourceW( + ID3D10Device* pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + D3DX10_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10Resource** ppTexture, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceW +#else +#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceA +#endif + + +// FromFileInMemory + +HRESULT WINAPI + D3DX10CreateShaderResourceViewFromMemory( + ID3D10Device* pDevice, + LPCVOID pSrcData, + SIZE_T SrcDataSize, + D3DX10_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10CreateTextureFromMemory( + ID3D10Device* pDevice, + LPCVOID pSrcData, + SIZE_T SrcDataSize, + D3DX10_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10Resource** ppTexture, + HRESULT* pHResult); + + +////////////////////////////////////////////////////////////////////////////// +// Misc Texture APIs ///////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX10_TEXTURE_LOAD_INFO: +// ------------------------ +// +//---------------------------------------------------------------------------- + +typedef struct _D3DX10_TEXTURE_LOAD_INFO +{ + D3D10_BOX *pSrcBox; + D3D10_BOX *pDstBox; + UINT SrcFirstMip; + UINT DstFirstMip; + UINT NumMips; + UINT SrcFirstElement; + UINT DstFirstElement; + UINT NumElements; + UINT Filter; + UINT MipFilter; + +#ifdef __cplusplus + _D3DX10_TEXTURE_LOAD_INFO() + { + pSrcBox = NULL; + pDstBox = NULL; + SrcFirstMip = 0; + DstFirstMip = 0; + NumMips = D3DX10_DEFAULT; + SrcFirstElement = 0; + DstFirstElement = 0; + NumElements = D3DX10_DEFAULT; + Filter = D3DX10_DEFAULT; + MipFilter = D3DX10_DEFAULT; + } +#endif + +} D3DX10_TEXTURE_LOAD_INFO; + + +//---------------------------------------------------------------------------- +// D3DX10LoadTextureFromTexture: +// ---------------------------- +// Load a texture from a texture. +// +// Parameters: +// +//---------------------------------------------------------------------------- + + +HRESULT WINAPI + D3DX10LoadTextureFromTexture( + ID3D10Resource *pSrcTexture, + D3DX10_TEXTURE_LOAD_INFO *pLoadInfo, + ID3D10Resource *pDstTexture); + + +//---------------------------------------------------------------------------- +// D3DX10FilterTexture: +// ------------------ +// Filters mipmaps levels of a texture. +// +// Parameters: +// pBaseTexture +// The texture object to be filtered +// SrcLevel +// The level whose image is used to generate the subsequent levels. +// MipFilter +// D3DX10_FILTER flags controlling how each miplevel is filtered. +// Or D3DX10_DEFAULT for D3DX10_FILTER_BOX, +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10FilterTexture( + ID3D10Resource *pTexture, + UINT SrcLevel, + UINT MipFilter); + + +//---------------------------------------------------------------------------- +// D3DX10SaveTextureToFile: +// ---------------------- +// Save a texture to a file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving. +// pSrcTexture +// Source texture, containing the image to be saved +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10SaveTextureToFileA( + ID3D10Resource *pSrcTexture, + D3DX10_IMAGE_FILE_FORMAT DestFormat, + LPCSTR pDestFile); + +HRESULT WINAPI + D3DX10SaveTextureToFileW( + ID3D10Resource *pSrcTexture, + D3DX10_IMAGE_FILE_FORMAT DestFormat, + LPCWSTR pDestFile); + +#ifdef UNICODE +#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileW +#else +#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileA +#endif + + +//---------------------------------------------------------------------------- +// D3DX10SaveTextureToMemory: +// ---------------------- +// Save a texture to a blob. +// +// Parameters: +// pSrcTexture +// Source texture, containing the image to be saved +// DestFormat +// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving. +// ppDestBuf +// address of a d3dxbuffer pointer to return the image data +// Flags +// optional flags +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10SaveTextureToMemory( + ID3D10Resource* pSrcTexture, + D3DX10_IMAGE_FILE_FORMAT DestFormat, + LPD3D10BLOB* ppDestBuf, + UINT Flags); + + +//---------------------------------------------------------------------------- +// D3DX10ComputeNormalMap: +// --------------------- +// Converts a height map into a normal map. The (x,y,z) components of each +// normal are mapped to the (r,g,b) channels of the output texture. +// +// Parameters +// pSrcTexture +// Pointer to the source heightmap texture +// Flags +// D3DX10_NORMALMAP flags +// Channel +// D3DX10_CHANNEL specifying source of height information +// Amplitude +// The constant value which the height information is multiplied by. +// pDestTexture +// Pointer to the destination texture +//--------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10ComputeNormalMap( + ID3D10Texture2D *pSrcTexture, + UINT Flags, + UINT Channel, + FLOAT Amplitude, + ID3D10Texture2D *pDestTexture); + + +//---------------------------------------------------------------------------- +// D3DX10SHProjectCubeMap: +// ---------------------- +// Projects a function represented in a cube map into spherical harmonics. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pCubeMap +// CubeMap that is going to be projected into spherical harmonics +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green +// pBOut +// Output SH vector for Blue +// +//--------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10SHProjectCubeMap( + __in_range(2,6) UINT Order, + ID3D10Texture2D *pCubeMap, + __out_ecount(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX10TEX_H__ + diff --git a/RenderDll/Dx9Sdk/Include/D3DX11.h b/RenderDll/Dx9Sdk/Include/D3DX11.h new file mode 100644 index 0000000..103c782 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX11.h @@ -0,0 +1,74 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx11.h +// Content: D3DX11 utility library +// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __D3DX11_INTERNAL__ +#error Incorrect D3DX11 header used +#endif + +#ifndef __D3DX11_H__ +#define __D3DX11_H__ + + +// Defines +#include +#include + +#ifdef ALLOW_THROWING_NEW +#include +#endif + +#define D3DX11_DEFAULT ((UINT) -1) +#define D3DX11_FROM_FILE ((UINT) -3) +#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3) + +#ifndef D3DX11INLINE +#ifdef _MSC_VER + #if (_MSC_VER >= 1200) + #define D3DX11INLINE __forceinline + #else + #define D3DX11INLINE __inline + #endif +#else + #ifdef __cplusplus + #define D3DX11INLINE inline + #else + #define D3DX11INLINE + #endif +#endif +#endif + + + +// Includes +#include "d3d11.h" +#include "d3dx11.h" +#include "d3dx11core.h" +#include "d3dx11tex.h" +#include "d3dx11async.h" + + +// Errors +#define _FACDD 0x876 +#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) + +enum _D3DX11_ERR { + D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900), + D3DX11_ERR_INVALID_MESH = MAKE_DDHRESULT(2901), + D3DX11_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902), + D3DX11_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903), + D3DX11_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904), + D3DX11_ERR_INVALID_DATA = MAKE_DDHRESULT(2905), + D3DX11_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906), + D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907), + D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908), +}; + + +#endif //__D3DX11_H__ + diff --git a/RenderDll/Dx9Sdk/Include/D3DX11async.h b/RenderDll/Dx9Sdk/Include/D3DX11async.h new file mode 100644 index 0000000..4586c55 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX11async.h @@ -0,0 +1,164 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3DX11Async.h +// Content: D3DX11 Asynchronous Shader loaders / compilers +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DX11ASYNC_H__ +#define __D3DX11ASYNC_H__ + +#include "d3dx11.h" + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//---------------------------------------------------------------------------- +// D3DX11Compile: +// ------------------ +// Compiles an effect or shader. +// +// Parameters: +// pSrcFile +// Source file name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module. +// pSrcData +// Pointer to source code. +// SrcDataLen +// Size of source code, in bytes. +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pFunctionName +// Name of the entrypoint function where execution should begin. +// pProfile +// Instruction set to be used when generating code. Currently supported +// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0", +// "vs_3_sw", "vs_4_0", "vs_4_1", +// "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0", +// "ps_3_sw", "ps_4_0", "ps_4_1", +// "gs_4_0", "gs_4_1", +// "tx_1_0", +// "fx_4_0", "fx_4_1" +// Note that this entrypoint does not compile fx_2_0 targets, for that +// you need to use the D3DX9 function. +// Flags1 +// See D3D10_SHADER_xxx flags. +// Flags2 +// See D3D10_EFFECT_xxx flags. +// ppShader +// Returns a buffer containing the created shader. This buffer contains +// the compiled shader code, as well as any embedded debug and symbol +// table info. (See D3D10GetShaderConstantTable) +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during the compile. If you are running in a debugger, +// these are the same messages you will see in your debug output. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX11CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CompileFromFile D3DX11CompileFromFileW +#else +#define D3DX11CompileFromFile D3DX11CompileFromFileA +#endif + +HRESULT WINAPI D3DX11CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CompileFromResource D3DX11CompileFromResourceW +#else +#define D3DX11CompileFromResource D3DX11CompileFromResourceA +#endif + +HRESULT WINAPI D3DX11CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileW +#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceW +#else +#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileA +#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceA +#endif + +//---------------------------------------------------------------------------- +// Async processors +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX11CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, + ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor); + +HRESULT WINAPI D3DX11CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor); + +//---------------------------------------------------------------------------- +// D3DX11 Asynchronous texture I/O (advanced mode) +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX11CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX11DataLoader **ppDataLoader); +HRESULT WINAPI D3DX11CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX11DataLoader **ppDataLoader); +HRESULT WINAPI D3DX11CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX11DataLoader **ppDataLoader); +HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX11DataLoader **ppDataLoader); +HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX11DataLoader **ppDataLoader); + +#ifdef UNICODE +#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderW +#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderW +#else +#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderA +#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderA +#endif + +HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor); +HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *pImageInfo, ID3DX11DataProcessor **ppDataProcessor); +HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX11ASYNC_H__ + + diff --git a/RenderDll/Dx9Sdk/Include/D3DX11core.h b/RenderDll/Dx9Sdk/Include/D3DX11core.h new file mode 100644 index 0000000..18e9935 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX11core.h @@ -0,0 +1,128 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx11core.h +// Content: D3DX11 core types and functions +// +/////////////////////////////////////////////////////////////////////////// + +#include "d3dx11.h" + +#ifndef __D3DX11CORE_H__ +#define __D3DX11CORE_H__ + +// Current name of the DLL shipped in the same SDK as this header. + + +#define D3DX11_DLL_W L"d3dx11_43.dll" +#define D3DX11_DLL_A "d3dx11_43.dll" + +#ifdef UNICODE + #define D3DX11_DLL D3DX11_DLL_W +#else + #define D3DX11_DLL D3DX11_DLL_A +#endif + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +/////////////////////////////////////////////////////////////////////////// +// D3DX11_SDK_VERSION: +// ----------------- +// This identifier is passed to D3DX11CheckVersion in order to ensure that an +// application was built against the correct header files and lib files. +// This number is incremented whenever a header (or other) change would +// require applications to be rebuilt. If the version doesn't match, +// D3DX11CreateVersion will return FALSE. (The number itself has no meaning.) +/////////////////////////////////////////////////////////////////////////// + + +#define D3DX11_SDK_VERSION 43 + + +#ifdef D3D_DIAG_DLL +BOOL WINAPI D3DX11DebugMute(BOOL Mute); +#endif +HRESULT WINAPI D3DX11CheckVersion(UINT D3DSdkVersion, UINT D3DX11SdkVersion); + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX11ThreadPump: +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DX11DataLoader + +DECLARE_INTERFACE(ID3DX11DataLoader) +{ + STDMETHOD(Load)(THIS) PURE; + STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; + +#undef INTERFACE +#define INTERFACE ID3DX11DataProcessor + +DECLARE_INTERFACE(ID3DX11DataProcessor) +{ + STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE; + STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; + +// {C93FECFA-6967-478a-ABBC-402D90621FCB} +DEFINE_GUID(IID_ID3DX11ThreadPump, +0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb); + +#undef INTERFACE +#define INTERFACE ID3DX11ThreadPump + +DECLARE_INTERFACE_(ID3DX11ThreadPump, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX11ThreadPump + STDMETHOD(AddWorkItem)(THIS_ ID3DX11DataLoader *pDataLoader, ID3DX11DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE; + STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE; + + STDMETHOD(WaitForAllItems)(THIS) PURE; + STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount); + + STDMETHOD(PurgeAllItems)(THIS) PURE; + STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE; + +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI D3DX11CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX11ThreadPump **ppThreadPump); + +HRESULT WINAPI D3DX11UnsetAllDeviceObjects(ID3D11DeviceContext *pContext); + +#ifdef __cplusplus +} +#endif //__cplusplus + +/////////////////////////////////////////////////////////////////////////// + +#define _FACD3D 0x876 +#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) +#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) + +#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) +#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) + +#endif //__D3DX11CORE_H__ + diff --git a/RenderDll/Dx9Sdk/Include/D3DX11tex.h b/RenderDll/Dx9Sdk/Include/D3DX11tex.h new file mode 100644 index 0000000..16c0409 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX11tex.h @@ -0,0 +1,772 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx11tex.h +// Content: D3DX11 texturing APIs +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx11.h" + +#ifndef __D3DX11TEX_H__ +#define __D3DX11TEX_H__ + + +//---------------------------------------------------------------------------- +// D3DX11_FILTER flags: +// ------------------ +// +// A valid filter must contain one of these values: +// +// D3DX11_FILTER_NONE +// No scaling or filtering will take place. Pixels outside the bounds +// of the source image are assumed to be transparent black. +// D3DX11_FILTER_POINT +// Each destination pixel is computed by sampling the nearest pixel +// from the source image. +// D3DX11_FILTER_LINEAR +// Each destination pixel is computed by linearly interpolating between +// the nearest pixels in the source image. This filter works best +// when the scale on each axis is less than 2. +// D3DX11_FILTER_TRIANGLE +// Every pixel in the source image contributes equally to the +// destination image. This is the slowest of all the filters. +// D3DX11_FILTER_BOX +// Each pixel is computed by averaging a 2x2(x2) box pixels from +// the source image. Only works when the dimensions of the +// destination are half those of the source. (as with mip maps) +// +// And can be OR'd with any of these optional flags: +// +// D3DX11_FILTER_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX11_FILTER_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX11_FILTER_MIRROR_W +// Indicates that pixels off the edge of the texture on the W-axis +// should be mirrored, not wraped. +// D3DX11_FILTER_MIRROR +// Same as specifying D3DX11_FILTER_MIRROR_U | D3DX11_FILTER_MIRROR_V | +// D3DX11_FILTER_MIRROR_V +// D3DX11_FILTER_DITHER +// Dithers the resulting image using a 4x4 order dither pattern. +// D3DX11_FILTER_SRGB_IN +// Denotes that the input data is in sRGB (gamma 2.2) colorspace. +// D3DX11_FILTER_SRGB_OUT +// Denotes that the output data is in sRGB (gamma 2.2) colorspace. +// D3DX11_FILTER_SRGB +// Same as specifying D3DX11_FILTER_SRGB_IN | D3DX11_FILTER_SRGB_OUT +// +//---------------------------------------------------------------------------- + +typedef enum D3DX11_FILTER_FLAG +{ + D3DX11_FILTER_NONE = (1 << 0), + D3DX11_FILTER_POINT = (2 << 0), + D3DX11_FILTER_LINEAR = (3 << 0), + D3DX11_FILTER_TRIANGLE = (4 << 0), + D3DX11_FILTER_BOX = (5 << 0), + + D3DX11_FILTER_MIRROR_U = (1 << 16), + D3DX11_FILTER_MIRROR_V = (2 << 16), + D3DX11_FILTER_MIRROR_W = (4 << 16), + D3DX11_FILTER_MIRROR = (7 << 16), + + D3DX11_FILTER_DITHER = (1 << 19), + D3DX11_FILTER_DITHER_DIFFUSION= (2 << 19), + + D3DX11_FILTER_SRGB_IN = (1 << 21), + D3DX11_FILTER_SRGB_OUT = (2 << 21), + D3DX11_FILTER_SRGB = (3 << 21), +} D3DX11_FILTER_FLAG; + +//---------------------------------------------------------------------------- +// D3DX11_NORMALMAP flags: +// --------------------- +// These flags are used to control how D3DX11ComputeNormalMap generates normal +// maps. Any number of these flags may be OR'd together in any combination. +// +// D3DX11_NORMALMAP_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX11_NORMALMAP_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX11_NORMALMAP_MIRROR +// Same as specifying D3DX11_NORMALMAP_MIRROR_U | D3DX11_NORMALMAP_MIRROR_V +// D3DX11_NORMALMAP_INVERTSIGN +// Inverts the direction of each normal +// D3DX11_NORMALMAP_COMPUTE_OCCLUSION +// Compute the per pixel Occlusion term and encodes it into the alpha. +// An Alpha of 1 means that the pixel is not obscured in anyway, and +// an alpha of 0 would mean that the pixel is completly obscured. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX11_NORMALMAP_FLAG +{ + D3DX11_NORMALMAP_MIRROR_U = (1 << 16), + D3DX11_NORMALMAP_MIRROR_V = (2 << 16), + D3DX11_NORMALMAP_MIRROR = (3 << 16), + D3DX11_NORMALMAP_INVERTSIGN = (8 << 16), + D3DX11_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16), +} D3DX11_NORMALMAP_FLAG; + +//---------------------------------------------------------------------------- +// D3DX11_CHANNEL flags: +// ------------------- +// These flags are used by functions which operate on or more channels +// in a texture. +// +// D3DX11_CHANNEL_RED +// Indicates the red channel should be used +// D3DX11_CHANNEL_BLUE +// Indicates the blue channel should be used +// D3DX11_CHANNEL_GREEN +// Indicates the green channel should be used +// D3DX11_CHANNEL_ALPHA +// Indicates the alpha channel should be used +// D3DX11_CHANNEL_LUMINANCE +// Indicates the luminaces of the red green and blue channels should be +// used. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX11_CHANNEL_FLAG +{ + D3DX11_CHANNEL_RED = (1 << 0), + D3DX11_CHANNEL_BLUE = (1 << 1), + D3DX11_CHANNEL_GREEN = (1 << 2), + D3DX11_CHANNEL_ALPHA = (1 << 3), + D3DX11_CHANNEL_LUMINANCE = (1 << 4), +} D3DX11_CHANNEL_FLAG; + + + +//---------------------------------------------------------------------------- +// D3DX11_IMAGE_FILE_FORMAT: +// --------------------- +// This enum is used to describe supported image file formats. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX11_IMAGE_FILE_FORMAT +{ + D3DX11_IFF_BMP = 0, + D3DX11_IFF_JPG = 1, + D3DX11_IFF_PNG = 3, + D3DX11_IFF_DDS = 4, + D3DX11_IFF_TIFF = 10, + D3DX11_IFF_GIF = 11, + D3DX11_IFF_WMP = 12, + D3DX11_IFF_FORCE_DWORD = 0x7fffffff + +} D3DX11_IMAGE_FILE_FORMAT; + + +//---------------------------------------------------------------------------- +// D3DX11_SAVE_TEXTURE_FLAG: +// --------------------- +// This enum is used to support texture saving options. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX11_SAVE_TEXTURE_FLAG +{ + D3DX11_STF_USEINPUTBLOB = 0x0001, +} D3DX11_SAVE_TEXTURE_FLAG; + + +//---------------------------------------------------------------------------- +// D3DX11_IMAGE_INFO: +// --------------- +// This structure is used to return a rough description of what the +// the original contents of an image file looked like. +// +// Width +// Width of original image in pixels +// Height +// Height of original image in pixels +// Depth +// Depth of original image in pixels +// ArraySize +// Array size in textures +// MipLevels +// Number of mip levels in original image +// MiscFlags +// Miscellaneous flags +// Format +// D3D format which most closely describes the data in original image +// ResourceDimension +// D3D11_RESOURCE_DIMENSION representing the dimension of texture stored in the file. +// D3D11_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D +// ImageFileFormat +// D3DX11_IMAGE_FILE_FORMAT representing the format of the image file. +//---------------------------------------------------------------------------- + +typedef struct D3DX11_IMAGE_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT ArraySize; + UINT MipLevels; + UINT MiscFlags; + DXGI_FORMAT Format; + D3D11_RESOURCE_DIMENSION ResourceDimension; + D3DX11_IMAGE_FILE_FORMAT ImageFileFormat; +} D3DX11_IMAGE_INFO; + + + + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + + +////////////////////////////////////////////////////////////////////////////// +// Image File APIs /////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX11_IMAGE_LOAD_INFO: +// --------------- +// This structure can be optionally passed in to texture loader APIs to +// control how textures get loaded. Pass in D3DX11_DEFAULT for any of these +// to have D3DX automatically pick defaults based on the source file. +// +// Width +// Rescale texture to Width texels wide +// Height +// Rescale texture to Height texels high +// Depth +// Rescale texture to Depth texels deep +// FirstMipLevel +// First mip level to load +// MipLevels +// Number of mip levels to load after the first level +// Usage +// D3D11_USAGE flag for the new texture +// BindFlags +// D3D11 Bind flags for the new texture +// CpuAccessFlags +// D3D11 CPU Access flags for the new texture +// MiscFlags +// Reserved. Must be 0 +// Format +// Resample texture to the specified format +// Filter +// Filter the texture using the specified filter (only when resampling) +// MipFilter +// Filter the texture mip levels using the specified filter (only if +// generating mips) +// pSrcInfo +// (optional) pointer to a D3DX11_IMAGE_INFO structure that will get +// populated with source image information +//---------------------------------------------------------------------------- + + +typedef struct D3DX11_IMAGE_LOAD_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT FirstMipLevel; + UINT MipLevels; + D3D11_USAGE Usage; + UINT BindFlags; + UINT CpuAccessFlags; + UINT MiscFlags; + DXGI_FORMAT Format; + UINT Filter; + UINT MipFilter; + D3DX11_IMAGE_INFO* pSrcInfo; + +#ifdef __cplusplus + D3DX11_IMAGE_LOAD_INFO() + { + Width = D3DX11_DEFAULT; + Height = D3DX11_DEFAULT; + Depth = D3DX11_DEFAULT; + FirstMipLevel = D3DX11_DEFAULT; + MipLevels = D3DX11_DEFAULT; + Usage = (D3D11_USAGE) D3DX11_DEFAULT; + BindFlags = D3DX11_DEFAULT; + CpuAccessFlags = D3DX11_DEFAULT; + MiscFlags = D3DX11_DEFAULT; + Format = DXGI_FORMAT_FROM_FILE; + Filter = D3DX11_DEFAULT; + MipFilter = D3DX11_DEFAULT; + pSrcInfo = NULL; + } +#endif + +} D3DX11_IMAGE_LOAD_INFO; + +//------------------------------------------------------------------------------- +// GetImageInfoFromFile/Resource/Memory: +// ------------------------------ +// Fills in a D3DX11_IMAGE_INFO struct with information about an image file. +// +// Parameters: +// pSrcFile +// File name of the source image. +// pSrcModule +// Module where resource is located, or NULL for module associated +// with image the os used to create the current process. +// pSrcResource +// Resource name. +// pSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pPump +// Optional pointer to a thread pump object to use. +// pSrcInfo +// Pointer to a D3DX11_IMAGE_INFO structure to be filled in with the +// description of the data in the source image file. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +//------------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11GetImageInfoFromFileA( + LPCSTR pSrcFile, + ID3DX11ThreadPump* pPump, + D3DX11_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11GetImageInfoFromFileW( + LPCWSTR pSrcFile, + ID3DX11ThreadPump* pPump, + D3DX11_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11GetImageInfoFromFile D3DX11GetImageInfoFromFileW +#else +#define D3DX11GetImageInfoFromFile D3DX11GetImageInfoFromFileA +#endif + + +HRESULT WINAPI + D3DX11GetImageInfoFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + ID3DX11ThreadPump* pPump, + D3DX11_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11GetImageInfoFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + ID3DX11ThreadPump* pPump, + D3DX11_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11GetImageInfoFromResource D3DX11GetImageInfoFromResourceW +#else +#define D3DX11GetImageInfoFromResource D3DX11GetImageInfoFromResourceA +#endif + + +HRESULT WINAPI + D3DX11GetImageInfoFromMemory( + LPCVOID pSrcData, + SIZE_T SrcDataSize, + ID3DX11ThreadPump* pPump, + D3DX11_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + + +////////////////////////////////////////////////////////////////////////////// +// Create/Save Texture APIs ////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX11CreateTextureFromFile/Resource/Memory: +// D3DX11CreateShaderResourceViewFromFile/Resource/Memory: +// ----------------------------------- +// Create a texture object from a file or resource. +// +// Parameters: +// +// pDevice +// The D3D device with which the texture is going to be used. +// pSrcFile +// File name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module +// pvSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pLoadInfo +// Optional pointer to a D3DX11_IMAGE_LOAD_INFO structure that +// contains additional loader parameters. +// pPump +// Optional pointer to a thread pump object to use. +// ppTexture +// [out] Created texture object. +// ppShaderResourceView +// [out] Shader resource view object created. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +// +//---------------------------------------------------------------------------- + + +// FromFile + +HRESULT WINAPI + D3DX11CreateShaderResourceViewFromFileA( + ID3D11Device* pDevice, + LPCSTR pSrcFile, + D3DX11_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11CreateShaderResourceViewFromFileW( + ID3D11Device* pDevice, + LPCWSTR pSrcFile, + D3DX11_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CreateShaderResourceViewFromFile D3DX11CreateShaderResourceViewFromFileW +#else +#define D3DX11CreateShaderResourceViewFromFile D3DX11CreateShaderResourceViewFromFileA +#endif + +HRESULT WINAPI + D3DX11CreateTextureFromFileA( + ID3D11Device* pDevice, + LPCSTR pSrcFile, + D3DX11_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11Resource** ppTexture, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11CreateTextureFromFileW( + ID3D11Device* pDevice, + LPCWSTR pSrcFile, + D3DX11_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11Resource** ppTexture, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CreateTextureFromFile D3DX11CreateTextureFromFileW +#else +#define D3DX11CreateTextureFromFile D3DX11CreateTextureFromFileA +#endif + + +// FromResource (resources in dll/exes) + +HRESULT WINAPI + D3DX11CreateShaderResourceViewFromResourceA( + ID3D11Device* pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + D3DX11_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11CreateShaderResourceViewFromResourceW( + ID3D11Device* pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + D3DX11_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CreateShaderResourceViewFromResource D3DX11CreateShaderResourceViewFromResourceW +#else +#define D3DX11CreateShaderResourceViewFromResource D3DX11CreateShaderResourceViewFromResourceA +#endif + +HRESULT WINAPI + D3DX11CreateTextureFromResourceA( + ID3D11Device* pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + D3DX11_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11Resource** ppTexture, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11CreateTextureFromResourceW( + ID3D11Device* pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + D3DX11_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11Resource** ppTexture, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CreateTextureFromResource D3DX11CreateTextureFromResourceW +#else +#define D3DX11CreateTextureFromResource D3DX11CreateTextureFromResourceA +#endif + + +// FromFileInMemory + +HRESULT WINAPI + D3DX11CreateShaderResourceViewFromMemory( + ID3D11Device* pDevice, + LPCVOID pSrcData, + SIZE_T SrcDataSize, + D3DX11_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11CreateTextureFromMemory( + ID3D11Device* pDevice, + LPCVOID pSrcData, + SIZE_T SrcDataSize, + D3DX11_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11Resource** ppTexture, + HRESULT* pHResult); + + +////////////////////////////////////////////////////////////////////////////// +// Misc Texture APIs ///////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX11_TEXTURE_LOAD_INFO: +// ------------------------ +// +//---------------------------------------------------------------------------- + +typedef struct _D3DX11_TEXTURE_LOAD_INFO +{ + D3D11_BOX *pSrcBox; + D3D11_BOX *pDstBox; + UINT SrcFirstMip; + UINT DstFirstMip; + UINT NumMips; + UINT SrcFirstElement; + UINT DstFirstElement; + UINT NumElements; + UINT Filter; + UINT MipFilter; + +#ifdef __cplusplus + _D3DX11_TEXTURE_LOAD_INFO() + { + pSrcBox = NULL; + pDstBox = NULL; + SrcFirstMip = 0; + DstFirstMip = 0; + NumMips = D3DX11_DEFAULT; + SrcFirstElement = 0; + DstFirstElement = 0; + NumElements = D3DX11_DEFAULT; + Filter = D3DX11_DEFAULT; + MipFilter = D3DX11_DEFAULT; + } +#endif + +} D3DX11_TEXTURE_LOAD_INFO; + + +//---------------------------------------------------------------------------- +// D3DX11LoadTextureFromTexture: +// ---------------------------- +// Load a texture from a texture. +// +// Parameters: +// +//---------------------------------------------------------------------------- + + +HRESULT WINAPI + D3DX11LoadTextureFromTexture( + ID3D11DeviceContext *pContext, + ID3D11Resource *pSrcTexture, + D3DX11_TEXTURE_LOAD_INFO *pLoadInfo, + ID3D11Resource *pDstTexture); + + +//---------------------------------------------------------------------------- +// D3DX11FilterTexture: +// ------------------ +// Filters mipmaps levels of a texture. +// +// Parameters: +// pBaseTexture +// The texture object to be filtered +// SrcLevel +// The level whose image is used to generate the subsequent levels. +// MipFilter +// D3DX11_FILTER flags controlling how each miplevel is filtered. +// Or D3DX11_DEFAULT for D3DX11_FILTER_BOX, +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11FilterTexture( + ID3D11DeviceContext *pContext, + ID3D11Resource *pTexture, + UINT SrcLevel, + UINT MipFilter); + + +//---------------------------------------------------------------------------- +// D3DX11SaveTextureToFile: +// ---------------------- +// Save a texture to a file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving. +// pSrcTexture +// Source texture, containing the image to be saved +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11SaveTextureToFileA( + ID3D11DeviceContext *pContext, + ID3D11Resource *pSrcTexture, + D3DX11_IMAGE_FILE_FORMAT DestFormat, + LPCSTR pDestFile); + +HRESULT WINAPI + D3DX11SaveTextureToFileW( + ID3D11DeviceContext *pContext, + ID3D11Resource *pSrcTexture, + D3DX11_IMAGE_FILE_FORMAT DestFormat, + LPCWSTR pDestFile); + +#ifdef UNICODE +#define D3DX11SaveTextureToFile D3DX11SaveTextureToFileW +#else +#define D3DX11SaveTextureToFile D3DX11SaveTextureToFileA +#endif + + +//---------------------------------------------------------------------------- +// D3DX11SaveTextureToMemory: +// ---------------------- +// Save a texture to a blob. +// +// Parameters: +// pSrcTexture +// Source texture, containing the image to be saved +// DestFormat +// D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving. +// ppDestBuf +// address of a d3dxbuffer pointer to return the image data +// Flags +// optional flags +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11SaveTextureToMemory( + ID3D11DeviceContext *pContext, + ID3D11Resource* pSrcTexture, + D3DX11_IMAGE_FILE_FORMAT DestFormat, + ID3D10Blob** ppDestBuf, + UINT Flags); + + +//---------------------------------------------------------------------------- +// D3DX11ComputeNormalMap: +// --------------------- +// Converts a height map into a normal map. The (x,y,z) components of each +// normal are mapped to the (r,g,b) channels of the output texture. +// +// Parameters +// pSrcTexture +// Pointer to the source heightmap texture +// Flags +// D3DX11_NORMALMAP flags +// Channel +// D3DX11_CHANNEL specifying source of height information +// Amplitude +// The constant value which the height information is multiplied by. +// pDestTexture +// Pointer to the destination texture +//--------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11ComputeNormalMap( + ID3D11DeviceContext *pContext, + ID3D11Texture2D *pSrcTexture, + UINT Flags, + UINT Channel, + FLOAT Amplitude, + ID3D11Texture2D *pDestTexture); + + +//---------------------------------------------------------------------------- +// D3DX11SHProjectCubeMap: +// ---------------------- +// Projects a function represented in a cube map into spherical harmonics. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pCubeMap +// CubeMap that is going to be projected into spherical harmonics +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green +// pBOut +// Output SH vector for Blue +// +//--------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11SHProjectCubeMap( + ID3D11DeviceContext *pContext, + __in_range(2,6) UINT Order, + ID3D11Texture2D *pCubeMap, + __out_ecount(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX11TEX_H__ + diff --git a/RenderDll/Dx9Sdk/Include/D3DX_DXGIFormatConvert.inl b/RenderDll/Dx9Sdk/Include/D3DX_DXGIFormatConvert.inl new file mode 100644 index 0000000..1cfba72 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3DX_DXGIFormatConvert.inl @@ -0,0 +1,800 @@ +//============================================================================= +// D3D11 HLSL Routines for Manual Pack/Unpack of 32-bit DXGI_FORMAT_* +//============================================================================= +// +// This file contains format conversion routines for use in the +// Compute Shader or Pixel Shader on D3D11 Hardware. +// +// Skip to the end of this comment to see a summary of the routines +// provided. The rest of the text below explains why they are needed +// and how to use them. +// +// The scenario where these can be useful is if your application +// needs to simultaneously both read and write texture - i.e. in-place +// image editing. +// +// D3D11's Unordered Access View (UAV) of a Texture1D/2D/3D resource +// allows random access reads and writes to memory from a Compute Shader +// or Pixel Shader. However, the only texture format that supports this +// is DXGI_FORMAT_R32_UINT. e.g. Other more interesting formats like +// DXGI_FORMAT_R8G8B8A8_UNORM do not support simultaneous read and +// write. You can use such formats for random access writing only +// using a UAV, or reading only using a Shader Resource View (SRV). +// But for simultaneous read+write, the format conversion hardware is +// not available. +// +// There is a workaround to this limitation, involving casting the texture +// to R32_UINT when creating a UAV, as long as the original format of the +// resource supports it (most 32 bit per element formats). This allows +// simultaneous read+write as long as the shader does manual format +// unpacking on read and packing on write. +// +// The benefit is that later on, other views such as RenderTarget Views +// or ShaderResource Views on the same texture can be used with the +// proper format (e.g. DXGI_FORMAT_R16G16_FLOAT) so the hardware can +// do the usual automatic format unpack/pack and do texture filtering etc. +// where there are no hardware limitations. +// +// The sequence of actions for an application is the following: +// +// Suppose you want to make a texture than you can use a Pixel Shader +// or Compute Shader to perform in-place editing, and that the format +// you want the data to be stored in happens to be a descendent +// of of one of these formats: +// +// DXGI_FORMAT_R10G10B10A2_TYPELESS +// DXGI_FORMAT_R8G8B8A8_TYPELESS +// DXGI_FORMAT_B8G8R8A8_TYPELESS +// DXGI_FORMAT_B8G8R8X8_TYPELESS +// DXGI_FORMAT_R16G16_TYPELESS +// +// e.g. DXGI_FORMAT_R10G10B10A2_UNORM is a descendent of +// DXGI_FORMAT_R10G10B10A2_TYPELESS, so it supports the +// usage pattern described here. +// +// (Formats descending from DXGI_FORMAT_R32_TYPELESS, such as +// DXGI_FORMAT_R32_FLOAT, are trivially supported without +// needing any of the format conversion help provided here.) +// +// Steps: +// +// (1) Create a texture with the appropriate _TYPELESS format above +// along with the needed bind flags, such as +// D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_SHADER_RESOURCE. +// +// (2) For in-place image editing, create a UAV with the format +// DXGI_FORMAT_R32_UINT. D3D normally doesn't allow casting +// between different format "families", but the API makes +// an exception here. +// +// (3) In the Compute Shader or Pixel Shader, use the appropriate +// format pack/unpack routines provided in this file. +// For example if the DXGI_FORMAT_R32_UINT UAV really holds +// DXGI_FORMAT_R10G10B10A2_UNORM data, then, after reading a +// uint from the UAV into the shader, unpack by calling: +// +// XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput) +// +// Then to write to the UAV in the same shader, call the following +// to pack shader data into a uint that can be written out: +// +// UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput) +// +// (4) Other views, such as SRVs, can be created with the desired format; +// e.g. DXGI_FORMAT_R10G10B10A2_UNORM if the resource was created as +// DXGI_FORMAT_R10G10B10A2_TYPELESS. When that view is accessed by a +// shader, the hardware can do automatic type conversion as usual. +// +// Note, again, that if the shader only needs to write to a UAV, or read +// as an SRV, then none of this is needed - fully typed UAV or SRVs can +// be used. Only if simultaneous reading and writing to a UAV of a texture +// is needed are the format conversion routines provided here potentially +// useful. +// +// The following is the list of format conversion routines included in this +// file, categorized by the DXGI_FORMAT they unpack/pack. Each of the +// formats supported descends from one of the TYPELESS formats listed +// above, and supports casting to DXGI_FORMAT_R32_UINT as a UAV. +// +// DXGI_FORMAT_R10G10B10A2_UNORM: +// +// XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput) +// UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput) +// +// DXGI_FORMAT_R10G10B10A2_UINT: +// +// XMUINT4 D3DX_R10G10B10A2_UINT_to_UINT4(UINT packedInput) +// UINT D3DX_UINT4_to_R10G10B10A2_UINT(XMUINT4 unpackedInput) +// +// DXGI_FORMAT_R8G8B8A8_UNORM: +// +// XMFLOAT4 D3DX_R8G8B8A8_UNORM_to_FLOAT4(UINT packedInput) +// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput) +// +// DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: +// +// XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput) * +// XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput) +// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput) +// +// * The "_inexact" function above uses shader instructions that don't +// have high enough precision to give the exact answer, albeit close. +// The alternative function uses a lookup table stored in the shader +// to give an exact SRGB->float conversion. +// +// DXGI_FORMAT_R8G8B8A8_UINT: +// +// XMUINT4 D3DX_R8G8B8A8_UINT_to_UINT4(UINT packedInput) +// XMUINT D3DX_UINT4_to_R8G8B8A8_UINT(XMUINT4 unpackedInput) +// +// DXGI_FORMAT_R8G8B8A8_SNORM: +// +// XMFLOAT4 D3DX_R8G8B8A8_SNORM_to_FLOAT4(UINT packedInput) +// UINT D3DX_FLOAT4_to_R8G8B8A8_SNORM(hlsl_precise XMFLOAT4 unpackedInput) +// +// DXGI_FORMAT_R8G8B8A8_SINT: +// +// XMINT4 D3DX_R8G8B8A8_SINT_to_INT4(UINT packedInput) +// UINT D3DX_INT4_to_R8G8B8A8_SINT(XMINT4 unpackedInput) +// +// DXGI_FORMAT_B8G8R8A8_UNORM: +// +// XMFLOAT4 D3DX_B8G8R8A8_UNORM_to_FLOAT4(UINT packedInput) +// UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput) +// +// DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: +// +// XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput) * +// XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput) +// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput) +// +// * The "_inexact" function above uses shader instructions that don't +// have high enough precision to give the exact answer, albeit close. +// The alternative function uses a lookup table stored in the shader +// to give an exact SRGB->float conversion. +// +// DXGI_FORMAT_B8G8R8X8_UNORM: +// +// XMFLOAT3 D3DX_B8G8R8X8_UNORM_to_FLOAT3(UINT packedInput) +// UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM(hlsl_precise XMFLOAT3 unpackedInput) +// +// DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: +// +// XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3_inexact(UINT packedInput) * +// XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3(UINT packedInput) +// UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM_SRGB(hlsl_precise XMFLOAT3 unpackedInput) +// +// * The "_inexact" function above uses shader instructions that don't +// have high enough precision to give the exact answer, albeit close. +// The alternative function uses a lookup table stored in the shader +// to give an exact SRGB->float conversion. +// +// DXGI_FORMAT_R16G16_FLOAT: +// +// XMFLOAT2 D3DX_R16G16_FLOAT_to_FLOAT2(UINT packedInput) +// UINT D3DX_FLOAT2_to_R16G16_FLOAT(hlsl_precise XMFLOAT2 unpackedInput) +// +// DXGI_FORMAT_R16G16_UNORM: +// +// XMFLOAT2 D3DX_R16G16_UNORM_to_FLOAT2(UINT packedInput) +// UINT D3DX_FLOAT2_to_R16G16_UNORM(hlsl_precise FLOAT2 unpackedInput) +// +// DXGI_FORMAT_R16G16_UINT: +// +// XMUINT2 D3DX_R16G16_UINT_to_UINT2(UINT packedInput) +// UINT D3DX_UINT2_to_R16G16_UINT(XMUINT2 unpackedInput) +// +// DXGI_FORMAT_R16G16_SNORM: +// +// XMFLOAT2 D3DX_R16G16_SNORM_to_FLOAT2(UINT packedInput) +// UINT D3DX_FLOAT2_to_R16G16_SNORM(hlsl_precise XMFLOAT2 unpackedInput) +// +// DXGI_FORMAT_R16G16_SINT: +// +// XMINT2 D3DX_R16G16_SINT_to_INT2(UINT packedInput) +// UINT D3DX_INT2_to_R16G16_SINT(XMINT2 unpackedInput) +// +//============================================================================= + +#ifndef __D3DX_DXGI_FORMAT_CONVERT_INL___ +#define __D3DX_DXGI_FORMAT_CONVERT_INL___ + +#if HLSL_VERSION > 0 + +#define D3DX11INLINE + +typedef int INT; +typedef uint UINT; + +typedef float2 XMFLOAT2; +typedef float3 XMFLOAT3; +typedef float4 XMFLOAT4; +typedef int2 XMINT2; +typedef int4 XMINT4; +typedef uint2 XMUINT2; +typedef uint4 XMUINT4; + +#define hlsl_precise precise + +#define D3DX_Saturate_FLOAT(_V) saturate(_V) +#define D3DX_IsNan(_V) isnan(_V) +#define D3DX_Truncate_FLOAT(_V) trunc(_V) + +#else // HLSL_VERSION > 0 + +#ifndef __cplusplus +#error C++ compilation required +#endif + +#include +#include + +#define hlsl_precise + +D3DX11INLINE FLOAT D3DX_Saturate_FLOAT(FLOAT _V) +{ + return min(max(_V, 0), 1); +} +D3DX11INLINE bool D3DX_IsNan(FLOAT _V) +{ + return _V != _V; +} +D3DX11INLINE FLOAT D3DX_Truncate_FLOAT(FLOAT _V) +{ + return _V >= 0 ? floor(_V) : ceil(_V); +} + +// 2D Vector; 32 bit signed integer components +typedef struct _XMINT2 +{ + INT x; + INT y; +} XMINT2; + +// 2D Vector; 32 bit unsigned integer components +typedef struct _XMUINT2 +{ + UINT x; + UINT y; +} XMUINT2; + +// 4D Vector; 32 bit signed integer components +typedef struct _XMINT4 +{ + INT x; + INT y; + INT z; + INT w; +} XMINT4; + +// 4D Vector; 32 bit unsigned integer components +typedef struct _XMUINT4 +{ + UINT x; + UINT y; + UINT z; + UINT w; +} XMUINT4; + +#endif // HLSL_VERSION > 0 + +//============================================================================= +// SRGB Helper Functions Called By Conversions Further Below. +//============================================================================= +// SRGB_to_FLOAT_inexact is imprecise due to precision of pow implementations. +// If exact SRGB->float conversion is needed, a table lookup is provided +// further below. +D3DX11INLINE FLOAT D3DX_SRGB_to_FLOAT_inexact(hlsl_precise FLOAT val) +{ + if( val < 0.04045f ) + val /= 12.92f; + else + val = pow((val + 0.055f)/1.055f,2.4f); + return val; +} + +static const UINT D3DX_SRGBTable[] = +{ + 0x00000000,0x399f22b4,0x3a1f22b4,0x3a6eb40e,0x3a9f22b4,0x3ac6eb61,0x3aeeb40e,0x3b0b3e5d, + 0x3b1f22b4,0x3b33070b,0x3b46eb61,0x3b5b518d,0x3b70f18d,0x3b83e1c6,0x3b8fe616,0x3b9c87fd, + 0x3ba9c9b7,0x3bb7ad6f,0x3bc63549,0x3bd56361,0x3be539c1,0x3bf5ba70,0x3c0373b5,0x3c0c6152, + 0x3c15a703,0x3c1f45be,0x3c293e6b,0x3c3391f7,0x3c3e4149,0x3c494d43,0x3c54b6c7,0x3c607eb1, + 0x3c6ca5df,0x3c792d22,0x3c830aa8,0x3c89af9f,0x3c9085db,0x3c978dc5,0x3c9ec7c2,0x3ca63433, + 0x3cadd37d,0x3cb5a601,0x3cbdac20,0x3cc5e639,0x3cce54ab,0x3cd6f7d5,0x3cdfd010,0x3ce8ddb9, + 0x3cf2212c,0x3cfb9ac1,0x3d02a569,0x3d0798dc,0x3d0ca7e6,0x3d11d2af,0x3d171963,0x3d1c7c2e, + 0x3d21fb3c,0x3d2796b2,0x3d2d4ebb,0x3d332380,0x3d39152b,0x3d3f23e3,0x3d454fd1,0x3d4b991c, + 0x3d51ffef,0x3d58846a,0x3d5f26b7,0x3d65e6fe,0x3d6cc564,0x3d73c20f,0x3d7add29,0x3d810b67, + 0x3d84b795,0x3d887330,0x3d8c3e4a,0x3d9018f6,0x3d940345,0x3d97fd4a,0x3d9c0716,0x3da020bb, + 0x3da44a4b,0x3da883d7,0x3daccd70,0x3db12728,0x3db59112,0x3dba0b3b,0x3dbe95b5,0x3dc33092, + 0x3dc7dbe2,0x3dcc97b6,0x3dd1641f,0x3dd6412c,0x3ddb2eef,0x3de02d77,0x3de53cd5,0x3dea5d19, + 0x3def8e52,0x3df4d091,0x3dfa23e8,0x3dff8861,0x3e027f07,0x3e054280,0x3e080ea3,0x3e0ae378, + 0x3e0dc105,0x3e10a754,0x3e13966b,0x3e168e52,0x3e198f10,0x3e1c98ad,0x3e1fab30,0x3e22c6a3, + 0x3e25eb09,0x3e29186c,0x3e2c4ed0,0x3e2f8e41,0x3e32d6c4,0x3e362861,0x3e39831e,0x3e3ce703, + 0x3e405416,0x3e43ca5f,0x3e4749e4,0x3e4ad2ae,0x3e4e64c2,0x3e520027,0x3e55a4e6,0x3e595303, + 0x3e5d0a8b,0x3e60cb7c,0x3e6495e0,0x3e6869bf,0x3e6c4720,0x3e702e0c,0x3e741e84,0x3e781890, + 0x3e7c1c38,0x3e8014c2,0x3e82203c,0x3e84308d,0x3e8645ba,0x3e885fc5,0x3e8a7eb2,0x3e8ca283, + 0x3e8ecb3d,0x3e90f8e1,0x3e932b74,0x3e9562f8,0x3e979f71,0x3e99e0e2,0x3e9c274e,0x3e9e72b7, + 0x3ea0c322,0x3ea31892,0x3ea57308,0x3ea7d289,0x3eaa3718,0x3eaca0b7,0x3eaf0f69,0x3eb18333, + 0x3eb3fc18,0x3eb67a18,0x3eb8fd37,0x3ebb8579,0x3ebe12e1,0x3ec0a571,0x3ec33d2d,0x3ec5da17, + 0x3ec87c33,0x3ecb2383,0x3ecdd00b,0x3ed081cd,0x3ed338cc,0x3ed5f50b,0x3ed8b68d,0x3edb7d54, + 0x3ede4965,0x3ee11ac1,0x3ee3f16b,0x3ee6cd67,0x3ee9aeb6,0x3eec955d,0x3eef815d,0x3ef272ba, + 0x3ef56976,0x3ef86594,0x3efb6717,0x3efe6e02,0x3f00bd2d,0x3f02460e,0x3f03d1a7,0x3f055ff9, + 0x3f06f106,0x3f0884cf,0x3f0a1b56,0x3f0bb49b,0x3f0d50a0,0x3f0eef67,0x3f1090f1,0x3f12353e, + 0x3f13dc51,0x3f15862b,0x3f1732cd,0x3f18e239,0x3f1a946f,0x3f1c4971,0x3f1e0141,0x3f1fbbdf, + 0x3f21794e,0x3f23398e,0x3f24fca0,0x3f26c286,0x3f288b41,0x3f2a56d3,0x3f2c253d,0x3f2df680, + 0x3f2fca9e,0x3f31a197,0x3f337b6c,0x3f355820,0x3f3737b3,0x3f391a26,0x3f3aff7c,0x3f3ce7b5, + 0x3f3ed2d2,0x3f40c0d4,0x3f42b1be,0x3f44a590,0x3f469c4b,0x3f4895f1,0x3f4a9282,0x3f4c9201, + 0x3f4e946e,0x3f5099cb,0x3f52a218,0x3f54ad57,0x3f56bb8a,0x3f58ccb0,0x3f5ae0cd,0x3f5cf7e0, + 0x3f5f11ec,0x3f612eee,0x3f634eef,0x3f6571e9,0x3f6797e3,0x3f69c0d6,0x3f6beccd,0x3f6e1bbf, + 0x3f704db8,0x3f7282af,0x3f74baae,0x3f76f5ae,0x3f7933b9,0x3f7b74c6,0x3f7db8e0,0x3f800000 +}; + +D3DX11INLINE FLOAT D3DX_SRGB_to_FLOAT(UINT val) +{ +#if HLSL_VERSION > 0 + return asfloat(D3DX_SRGBTable[val]); +#else + return *(FLOAT*)&D3DX_SRGBTable[val]; +#endif +} + +D3DX11INLINE FLOAT D3DX_FLOAT_to_SRGB(hlsl_precise FLOAT val) +{ + if( val < 0.0031308f ) + val *= 12.92f; + else + val = 1.055f * pow(val,1.0f/2.4f) - 0.055f; + return val; +} + +D3DX11INLINE FLOAT D3DX_SaturateSigned_FLOAT(FLOAT _V) +{ + if (D3DX_IsNan(_V)) + { + return 0; + } + + return min(max(_V, -1), 1); +} + +D3DX11INLINE UINT D3DX_FLOAT_to_UINT(FLOAT _V, + FLOAT _Scale) +{ + return (UINT)floor(_V * _Scale + 0.5f); +} + +D3DX11INLINE FLOAT D3DX_INT_to_FLOAT(INT _V, + FLOAT _Scale) +{ + FLOAT Scaled = (FLOAT)_V / _Scale; + // The integer is a two's-complement signed + // number so the negative range is slightly + // larger than the positive range, meaning + // the scaled value can be slight less than -1. + // Clamp to keep the float range [-1, 1]. + return max(Scaled, -1.0f); +} + +D3DX11INLINE INT D3DX_FLOAT_to_INT(FLOAT _V, + FLOAT _Scale) +{ + return (INT)D3DX_Truncate_FLOAT(_V * _Scale + (_V >= 0 ? 0.5f : -0.5f)); +} + +//============================================================================= +// Conversion routines +//============================================================================= +//----------------------------------------------------------------------------- +// R10B10G10A2_UNORM <-> FLOAT4 +//----------------------------------------------------------------------------- +D3DX11INLINE XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput) +{ + hlsl_precise XMFLOAT4 unpackedOutput; + unpackedOutput.x = (FLOAT) (packedInput & 0x000003ff) / 1023; + unpackedOutput.y = (FLOAT)(((packedInput>>10) & 0x000003ff)) / 1023; + unpackedOutput.z = (FLOAT)(((packedInput>>20) & 0x000003ff)) / 1023; + unpackedOutput.w = (FLOAT)(((packedInput>>30) & 0x00000003)) / 3; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput) +{ + UINT packedOutput; + packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 1023)) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 1023)<<10) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 1023)<<20) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 3)<<30) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// R10B10G10A2_UINT <-> UINT4 +//----------------------------------------------------------------------------- +D3DX11INLINE XMUINT4 D3DX_R10G10B10A2_UINT_to_UINT4(UINT packedInput) +{ + XMUINT4 unpackedOutput; + unpackedOutput.x = packedInput & 0x000003ff; + unpackedOutput.y = (packedInput>>10) & 0x000003ff; + unpackedOutput.z = (packedInput>>20) & 0x000003ff; + unpackedOutput.w = (packedInput>>30) & 0x00000003; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_UINT4_to_R10G10B10A2_UINT(XMUINT4 unpackedInput) +{ + UINT packedOutput; + unpackedInput.x = min(unpackedInput.x, 0x000003ff); + unpackedInput.y = min(unpackedInput.y, 0x000003ff); + unpackedInput.z = min(unpackedInput.z, 0x000003ff); + unpackedInput.w = min(unpackedInput.w, 0x00000003); + packedOutput = ( (unpackedInput.x) | + ((unpackedInput.y)<<10) | + ((unpackedInput.z)<<20) | + ((unpackedInput.w)<<30) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// R8G8B8A8_UNORM <-> FLOAT4 +//----------------------------------------------------------------------------- +D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_to_FLOAT4(UINT packedInput) +{ + hlsl_precise XMFLOAT4 unpackedOutput; + unpackedOutput.x = (FLOAT) (packedInput & 0x000000ff) / 255; + unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255; + unpackedOutput.z = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255; + unpackedOutput.w = (FLOAT) (packedInput>>24) / 255; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput) +{ + UINT packedOutput; + packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)<<16) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 255)<<24) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// R8G8B8A8_UNORM_SRGB <-> FLOAT4 +//----------------------------------------------------------------------------- +D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput) +{ + hlsl_precise XMFLOAT4 unpackedOutput; + unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255); + unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255); + unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255); + unpackedOutput.w = (FLOAT)(packedInput>>24) / 255; + return unpackedOutput; +} + +D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput) +{ + hlsl_precise XMFLOAT4 unpackedOutput; + unpackedOutput.x = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) ); + unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff))); + unpackedOutput.z = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff))); + unpackedOutput.w = (FLOAT)(packedInput>>24) / 255; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput) +{ + UINT packedOutput; + unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x)); + unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y)); + unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z)); + unpackedInput.w = D3DX_Saturate_FLOAT(unpackedInput.w); + packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.x, 255)) | + (D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) | + (D3DX_FLOAT_to_UINT(unpackedInput.z, 255)<<16) | + (D3DX_FLOAT_to_UINT(unpackedInput.w, 255)<<24) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// R8G8B8A8_UINT <-> UINT4 +//----------------------------------------------------------------------------- +D3DX11INLINE XMUINT4 D3DX_R8G8B8A8_UINT_to_UINT4(UINT packedInput) +{ + XMUINT4 unpackedOutput; + unpackedOutput.x = packedInput & 0x000000ff; + unpackedOutput.y = (packedInput>> 8) & 0x000000ff; + unpackedOutput.z = (packedInput>>16) & 0x000000ff; + unpackedOutput.w = packedInput>>24; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_UINT4_to_R8G8B8A8_UINT(XMUINT4 unpackedInput) +{ + UINT packedOutput; + unpackedInput.x = min(unpackedInput.x, 0x000000ff); + unpackedInput.y = min(unpackedInput.y, 0x000000ff); + unpackedInput.z = min(unpackedInput.z, 0x000000ff); + unpackedInput.w = min(unpackedInput.w, 0x000000ff); + packedOutput = ( unpackedInput.x | + (unpackedInput.y<< 8) | + (unpackedInput.z<<16) | + (unpackedInput.w<<24) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// R8G8B8A8_SNORM <-> FLOAT4 +//----------------------------------------------------------------------------- +D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_SNORM_to_FLOAT4(UINT packedInput) +{ + hlsl_precise XMFLOAT4 unpackedOutput; + XMINT4 signExtendedBits; + signExtendedBits.x = (INT)(packedInput << 24) >> 24; + signExtendedBits.y = (INT)((packedInput << 16) & 0xff000000) >> 24; + signExtendedBits.z = (INT)((packedInput << 8) & 0xff000000) >> 24; + signExtendedBits.w = (INT)(packedInput & 0xff000000) >> 24; + unpackedOutput.x = D3DX_INT_to_FLOAT(signExtendedBits.x, 127); + unpackedOutput.y = D3DX_INT_to_FLOAT(signExtendedBits.y, 127); + unpackedOutput.z = D3DX_INT_to_FLOAT(signExtendedBits.z, 127); + unpackedOutput.w = D3DX_INT_to_FLOAT(signExtendedBits.w, 127); + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_SNORM(hlsl_precise XMFLOAT4 unpackedInput) +{ + UINT packedOutput; + packedOutput = ( (D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.x), 127) & 0x000000ff) | + ((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.y), 127) & 0x000000ff)<< 8) | + ((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.z), 127) & 0x000000ff)<<16) | + ((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.w), 127)) <<24) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// R8G8B8A8_SINT <-> INT4 +//----------------------------------------------------------------------------- +D3DX11INLINE XMINT4 D3DX_R8G8B8A8_SINT_to_INT4(UINT packedInput) +{ + XMINT4 unpackedOutput; + unpackedOutput.x = (INT)(packedInput << 24) >> 24; + unpackedOutput.y = (INT)((packedInput << 16) & 0xff000000) >> 24; + unpackedOutput.z = (INT)((packedInput << 8) & 0xff000000) >> 24; + unpackedOutput.w = (INT)(packedInput & 0xff000000) >> 24; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_INT4_to_R8G8B8A8_SINT(XMINT4 unpackedInput) +{ + UINT packedOutput; + unpackedInput.x = max(min(unpackedInput.x,127),-128); + unpackedInput.y = max(min(unpackedInput.y,127),-128); + unpackedInput.z = max(min(unpackedInput.z,127),-128); + unpackedInput.w = max(min(unpackedInput.w,127),-128); + packedOutput = ( (unpackedInput.x & 0x000000ff) | + ((unpackedInput.y & 0x000000ff)<< 8) | + ((unpackedInput.z & 0x000000ff)<<16) | + (unpackedInput.w <<24) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// B8G8R8A8_UNORM <-> FLOAT4 +//----------------------------------------------------------------------------- +D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_to_FLOAT4(UINT packedInput) +{ + hlsl_precise XMFLOAT4 unpackedOutput; + unpackedOutput.z = (FLOAT) (packedInput & 0x000000ff) / 255; + unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255; + unpackedOutput.x = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255; + unpackedOutput.w = (FLOAT) (packedInput>>24) / 255; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput) +{ + UINT packedOutput; + packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)<<16) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 255)<<24) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// B8G8R8A8_UNORM_SRGB <-> FLOAT4 +//----------------------------------------------------------------------------- +D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput) +{ + hlsl_precise XMFLOAT4 unpackedOutput; + unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255); + unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255); + unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255); + unpackedOutput.w = (FLOAT)(packedInput>>24) / 255; + return unpackedOutput; +} + +D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput) +{ + hlsl_precise XMFLOAT4 unpackedOutput; + unpackedOutput.z = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) ); + unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff))); + unpackedOutput.x = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff))); + unpackedOutput.w = (FLOAT)(packedInput>>24) / 255; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput) +{ + UINT packedOutput; + unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z)); + unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y)); + unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x)); + unpackedInput.w = D3DX_Saturate_FLOAT(unpackedInput.w); + packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.z, 255)) | + (D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) | + (D3DX_FLOAT_to_UINT(unpackedInput.x, 255)<<16) | + (D3DX_FLOAT_to_UINT(unpackedInput.w, 255)<<24) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// B8G8R8X8_UNORM <-> FLOAT3 +//----------------------------------------------------------------------------- +D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_to_FLOAT3(UINT packedInput) +{ + hlsl_precise XMFLOAT3 unpackedOutput; + unpackedOutput.z = (FLOAT) (packedInput & 0x000000ff) / 255; + unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255; + unpackedOutput.x = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM(hlsl_precise XMFLOAT3 unpackedInput) +{ + UINT packedOutput; + packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)<<16) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// B8G8R8X8_UNORM_SRGB <-> FLOAT3 +//----------------------------------------------------------------------------- +D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3_inexact(UINT packedInput) +{ + hlsl_precise XMFLOAT3 unpackedOutput; + unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255); + unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255); + unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255); + return unpackedOutput; +} + +D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3(UINT packedInput) +{ + hlsl_precise XMFLOAT3 unpackedOutput; + unpackedOutput.z = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) ); + unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff))); + unpackedOutput.x = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff))); + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM_SRGB(hlsl_precise XMFLOAT3 unpackedInput) +{ + UINT packedOutput; + unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z)); + unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y)); + unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x)); + packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.z, 255)) | + (D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) | + (D3DX_FLOAT_to_UINT(unpackedInput.x, 255)<<16) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// R16G16_FLOAT <-> FLOAT2 +//----------------------------------------------------------------------------- + +#if HLSL_VERSION > 0 + +D3DX11INLINE XMFLOAT2 D3DX_R16G16_FLOAT_to_FLOAT2(UINT packedInput) +{ + hlsl_precise XMFLOAT2 unpackedOutput; + unpackedOutput.x = f16tof32(packedInput&0x0000ffff); + unpackedOutput.y = f16tof32(packedInput>>16); + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_FLOAT(hlsl_precise XMFLOAT2 unpackedInput) +{ + UINT packedOutput; + packedOutput = asuint(f32tof16(unpackedInput.x)) | + (asuint(f32tof16(unpackedInput.y)) << 16); + return packedOutput; +} + +#endif // HLSL_VERSION > 0 + +//----------------------------------------------------------------------------- +// R16G16_UNORM <-> FLOAT2 +//----------------------------------------------------------------------------- +D3DX11INLINE XMFLOAT2 D3DX_R16G16_UNORM_to_FLOAT2(UINT packedInput) +{ + hlsl_precise XMFLOAT2 unpackedOutput; + unpackedOutput.x = (FLOAT) (packedInput & 0x0000ffff) / 65535; + unpackedOutput.y = (FLOAT) (packedInput>>16) / 65535; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_UNORM(hlsl_precise XMFLOAT2 unpackedInput) +{ + UINT packedOutput; + packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 65535)) | + (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 65535)<< 16) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// R16G16_UINT <-> UINT2 +//----------------------------------------------------------------------------- +D3DX11INLINE XMUINT2 D3DX_R16G16_UINT_to_UINT2(UINT packedInput) +{ + XMUINT2 unpackedOutput; + unpackedOutput.x = packedInput & 0x0000ffff; + unpackedOutput.y = packedInput>>16; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_UINT2_to_R16G16_UINT(XMUINT2 unpackedInput) +{ + UINT packedOutput; + unpackedInput.x = min(unpackedInput.x,0x0000ffff); + unpackedInput.y = min(unpackedInput.y,0x0000ffff); + packedOutput = ( unpackedInput.x | + (unpackedInput.y<<16) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// R16G16_SNORM <-> FLOAT2 +//----------------------------------------------------------------------------- +D3DX11INLINE XMFLOAT2 D3DX_R16G16_SNORM_to_FLOAT2(UINT packedInput) +{ + hlsl_precise XMFLOAT2 unpackedOutput; + XMINT2 signExtendedBits; + signExtendedBits.x = (INT)(packedInput << 16) >> 16; + signExtendedBits.y = (INT)(packedInput & 0xffff0000) >> 16; + unpackedOutput.x = D3DX_INT_to_FLOAT(signExtendedBits.x, 32767); + unpackedOutput.y = D3DX_INT_to_FLOAT(signExtendedBits.y, 32767); + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_SNORM(hlsl_precise XMFLOAT2 unpackedInput) +{ + UINT packedOutput; + packedOutput = ( (D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.x), 32767) & 0x0000ffff) | + (D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.y), 32767) <<16) ); + return packedOutput; +} + +//----------------------------------------------------------------------------- +// R16G16_SINT <-> INT2 +//----------------------------------------------------------------------------- +D3DX11INLINE XMINT2 D3DX_R16G16_SINT_to_INT2(UINT packedInput) +{ + XMINT2 unpackedOutput; + unpackedOutput.x = (INT)(packedInput << 16) >> 16; + unpackedOutput.y = (INT)(packedInput & 0xffff0000) >> 16; + return unpackedOutput; +} + +D3DX11INLINE UINT D3DX_INT2_to_R16G16_SINT(XMINT2 unpackedInput) +{ + UINT packedOutput; + unpackedInput.x = max(min(unpackedInput.x,32767),-32768); + unpackedInput.y = max(min(unpackedInput.y,32767),-32768); + packedOutput = ( (unpackedInput.x & 0x0000ffff) | + (unpackedInput.y <<16) ); + return packedOutput; +} + +#endif // __D3DX_DXGI_FORMAT_CONVERT_INL___ diff --git a/RenderDll/Dx9Sdk/Include/D3Dcommon.h b/RenderDll/Dx9Sdk/Include/D3Dcommon.h new file mode 100644 index 0000000..032b8b5 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3Dcommon.h @@ -0,0 +1,787 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3dcommon_h__ +#define __d3dcommon_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D10Blob_FWD_DEFINED__ +#define __ID3D10Blob_FWD_DEFINED__ +typedef interface ID3D10Blob ID3D10Blob; +#endif /* __ID3D10Blob_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3dcommon_0000_0000 */ +/* [local] */ + +typedef +enum D3D_DRIVER_TYPE + { D3D_DRIVER_TYPE_UNKNOWN = 0, + D3D_DRIVER_TYPE_HARDWARE = ( D3D_DRIVER_TYPE_UNKNOWN + 1 ) , + D3D_DRIVER_TYPE_REFERENCE = ( D3D_DRIVER_TYPE_HARDWARE + 1 ) , + D3D_DRIVER_TYPE_NULL = ( D3D_DRIVER_TYPE_REFERENCE + 1 ) , + D3D_DRIVER_TYPE_SOFTWARE = ( D3D_DRIVER_TYPE_NULL + 1 ) , + D3D_DRIVER_TYPE_WARP = ( D3D_DRIVER_TYPE_SOFTWARE + 1 ) + } D3D_DRIVER_TYPE; + +typedef +enum D3D_FEATURE_LEVEL + { D3D_FEATURE_LEVEL_9_1 = 0x9100, + D3D_FEATURE_LEVEL_9_2 = 0x9200, + D3D_FEATURE_LEVEL_9_3 = 0x9300, + D3D_FEATURE_LEVEL_10_0 = 0xa000, + D3D_FEATURE_LEVEL_10_1 = 0xa100, + D3D_FEATURE_LEVEL_11_0 = 0xb000 + } D3D_FEATURE_LEVEL; + +typedef +enum D3D_PRIMITIVE_TOPOLOGY + { D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0, + D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1, + D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, + D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13, + D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33, + D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34, + D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35, + D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36, + D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37, + D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38, + D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39, + D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40, + D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41, + D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42, + D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43, + D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44, + D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45, + D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46, + D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47, + D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48, + D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49, + D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50, + D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51, + D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52, + D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53, + D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54, + D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55, + D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56, + D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57, + D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58, + D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59, + D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60, + D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61, + D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62, + D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63, + D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64, + D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, + D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST, + D3D10_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST, + D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, + D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, + D3D11_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST, + D3D11_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST, + D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, + D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST + } D3D_PRIMITIVE_TOPOLOGY; + +typedef +enum D3D_PRIMITIVE + { D3D_PRIMITIVE_UNDEFINED = 0, + D3D_PRIMITIVE_POINT = 1, + D3D_PRIMITIVE_LINE = 2, + D3D_PRIMITIVE_TRIANGLE = 3, + D3D_PRIMITIVE_LINE_ADJ = 6, + D3D_PRIMITIVE_TRIANGLE_ADJ = 7, + D3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 8, + D3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 9, + D3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 10, + D3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 11, + D3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 12, + D3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 13, + D3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 14, + D3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 15, + D3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 16, + D3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 17, + D3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 18, + D3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 19, + D3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 20, + D3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 21, + D3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 22, + D3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 23, + D3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 24, + D3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 25, + D3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 26, + D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 28, + D3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 29, + D3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 30, + D3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 31, + D3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 32, + D3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 33, + D3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 34, + D3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 35, + D3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 36, + D3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 37, + D3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 38, + D3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 39, + D3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 40, + D3D10_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED, + D3D10_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT, + D3D10_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE, + D3D10_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE, + D3D10_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ, + D3D10_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ, + D3D11_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED, + D3D11_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT, + D3D11_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE, + D3D11_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE, + D3D11_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ, + D3D11_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ, + D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH = D3D_PRIMITIVE_1_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH = D3D_PRIMITIVE_2_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH = D3D_PRIMITIVE_3_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH = D3D_PRIMITIVE_4_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH = D3D_PRIMITIVE_5_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH = D3D_PRIMITIVE_6_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH = D3D_PRIMITIVE_7_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH = D3D_PRIMITIVE_8_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH = D3D_PRIMITIVE_9_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH = D3D_PRIMITIVE_10_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH = D3D_PRIMITIVE_11_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH = D3D_PRIMITIVE_12_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH = D3D_PRIMITIVE_13_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH = D3D_PRIMITIVE_14_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH = D3D_PRIMITIVE_15_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH = D3D_PRIMITIVE_16_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH = D3D_PRIMITIVE_17_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH = D3D_PRIMITIVE_18_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH = D3D_PRIMITIVE_19_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH = D3D_PRIMITIVE_20_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH = D3D_PRIMITIVE_21_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH = D3D_PRIMITIVE_22_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH = D3D_PRIMITIVE_23_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH = D3D_PRIMITIVE_24_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH = D3D_PRIMITIVE_25_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH = D3D_PRIMITIVE_26_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH = D3D_PRIMITIVE_27_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH = D3D_PRIMITIVE_28_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH = D3D_PRIMITIVE_29_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH = D3D_PRIMITIVE_30_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH = D3D_PRIMITIVE_31_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH = D3D_PRIMITIVE_32_CONTROL_POINT_PATCH + } D3D_PRIMITIVE; + +typedef +enum D3D_SRV_DIMENSION + { D3D_SRV_DIMENSION_UNKNOWN = 0, + D3D_SRV_DIMENSION_BUFFER = 1, + D3D_SRV_DIMENSION_TEXTURE1D = 2, + D3D_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D_SRV_DIMENSION_TEXTURE2D = 4, + D3D_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D_SRV_DIMENSION_TEXTURE3D = 8, + D3D_SRV_DIMENSION_TEXTURECUBE = 9, + D3D_SRV_DIMENSION_TEXTURECUBEARRAY = 10, + D3D_SRV_DIMENSION_BUFFEREX = 11, + D3D10_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D10_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D10_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D10_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D10_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D10_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D10_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D10_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D10_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D10_1_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D10_1_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D10_1_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D10_1_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY, + D3D11_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D11_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D11_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D11_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D11_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D11_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D11_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D11_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D11_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D11_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY, + D3D11_SRV_DIMENSION_BUFFEREX = D3D_SRV_DIMENSION_BUFFEREX + } D3D_SRV_DIMENSION; + +typedef struct _D3D_SHADER_MACRO + { + LPCSTR Name; + LPCSTR Definition; + } D3D_SHADER_MACRO; + +typedef struct _D3D_SHADER_MACRO *LPD3D_SHADER_MACRO; + +DEFINE_GUID(IID_ID3D10Blob, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2); + + +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D10Blob_INTERFACE_DEFINED__ +#define __ID3D10Blob_INTERFACE_DEFINED__ + +/* interface ID3D10Blob */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Blob; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8BA5FB08-5195-40e2-AC58-0D989C3A0102") + ID3D10Blob : public IUnknown + { + public: + virtual LPVOID STDMETHODCALLTYPE GetBufferPointer( void) = 0; + + virtual SIZE_T STDMETHODCALLTYPE GetBufferSize( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10BlobVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Blob * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Blob * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Blob * This); + + LPVOID ( STDMETHODCALLTYPE *GetBufferPointer )( + ID3D10Blob * This); + + SIZE_T ( STDMETHODCALLTYPE *GetBufferSize )( + ID3D10Blob * This); + + END_INTERFACE + } ID3D10BlobVtbl; + + interface ID3D10Blob + { + CONST_VTBL struct ID3D10BlobVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Blob_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Blob_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Blob_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Blob_GetBufferPointer(This) \ + ( (This)->lpVtbl -> GetBufferPointer(This) ) + +#define ID3D10Blob_GetBufferSize(This) \ + ( (This)->lpVtbl -> GetBufferSize(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Blob_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3dcommon_0000_0001 */ +/* [local] */ + +typedef interface ID3D10Blob* LPD3D10BLOB; +typedef ID3D10Blob ID3DBlob; +typedef ID3DBlob* LPD3DBLOB; +#define IID_ID3DBlob IID_ID3D10Blob +typedef +enum _D3D_INCLUDE_TYPE + { D3D_INCLUDE_LOCAL = 0, + D3D_INCLUDE_SYSTEM = ( D3D_INCLUDE_LOCAL + 1 ) , + D3D10_INCLUDE_LOCAL = D3D_INCLUDE_LOCAL, + D3D10_INCLUDE_SYSTEM = D3D_INCLUDE_SYSTEM, + D3D_INCLUDE_FORCE_DWORD = 0x7fffffff + } D3D_INCLUDE_TYPE; + +typedef interface ID3DInclude ID3DInclude; +#undef INTERFACE +#define INTERFACE ID3DInclude +DECLARE_INTERFACE(ID3DInclude) +{ + STDMETHOD(Open)(THIS_ D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE; + STDMETHOD(Close)(THIS_ LPCVOID pData) PURE; +}; +typedef ID3DInclude* LPD3DINCLUDE; +typedef +enum _D3D_SHADER_VARIABLE_CLASS + { D3D_SVC_SCALAR = 0, + D3D_SVC_VECTOR = ( D3D_SVC_SCALAR + 1 ) , + D3D_SVC_MATRIX_ROWS = ( D3D_SVC_VECTOR + 1 ) , + D3D_SVC_MATRIX_COLUMNS = ( D3D_SVC_MATRIX_ROWS + 1 ) , + D3D_SVC_OBJECT = ( D3D_SVC_MATRIX_COLUMNS + 1 ) , + D3D_SVC_STRUCT = ( D3D_SVC_OBJECT + 1 ) , + D3D_SVC_INTERFACE_CLASS = ( D3D_SVC_STRUCT + 1 ) , + D3D_SVC_INTERFACE_POINTER = ( D3D_SVC_INTERFACE_CLASS + 1 ) , + D3D10_SVC_SCALAR = D3D_SVC_SCALAR, + D3D10_SVC_VECTOR = D3D_SVC_VECTOR, + D3D10_SVC_MATRIX_ROWS = D3D_SVC_MATRIX_ROWS, + D3D10_SVC_MATRIX_COLUMNS = D3D_SVC_MATRIX_COLUMNS, + D3D10_SVC_OBJECT = D3D_SVC_OBJECT, + D3D10_SVC_STRUCT = D3D_SVC_STRUCT, + D3D11_SVC_INTERFACE_CLASS = D3D_SVC_INTERFACE_CLASS, + D3D11_SVC_INTERFACE_POINTER = D3D_SVC_INTERFACE_POINTER, + D3D_SVC_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_VARIABLE_CLASS; + +typedef +enum _D3D_SHADER_VARIABLE_FLAGS + { D3D_SVF_USERPACKED = 1, + D3D_SVF_USED = 2, + D3D_SVF_INTERFACE_POINTER = 4, + D3D_SVF_INTERFACE_PARAMETER = 8, + D3D10_SVF_USERPACKED = D3D_SVF_USERPACKED, + D3D10_SVF_USED = D3D_SVF_USED, + D3D11_SVF_INTERFACE_POINTER = D3D_SVF_INTERFACE_POINTER, + D3D11_SVF_INTERFACE_PARAMETER = D3D_SVF_INTERFACE_PARAMETER, + D3D_SVF_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_VARIABLE_FLAGS; + +typedef +enum _D3D_SHADER_VARIABLE_TYPE + { D3D_SVT_VOID = 0, + D3D_SVT_BOOL = 1, + D3D_SVT_INT = 2, + D3D_SVT_FLOAT = 3, + D3D_SVT_STRING = 4, + D3D_SVT_TEXTURE = 5, + D3D_SVT_TEXTURE1D = 6, + D3D_SVT_TEXTURE2D = 7, + D3D_SVT_TEXTURE3D = 8, + D3D_SVT_TEXTURECUBE = 9, + D3D_SVT_SAMPLER = 10, + D3D_SVT_SAMPLER1D = 11, + D3D_SVT_SAMPLER2D = 12, + D3D_SVT_SAMPLER3D = 13, + D3D_SVT_SAMPLERCUBE = 14, + D3D_SVT_PIXELSHADER = 15, + D3D_SVT_VERTEXSHADER = 16, + D3D_SVT_PIXELFRAGMENT = 17, + D3D_SVT_VERTEXFRAGMENT = 18, + D3D_SVT_UINT = 19, + D3D_SVT_UINT8 = 20, + D3D_SVT_GEOMETRYSHADER = 21, + D3D_SVT_RASTERIZER = 22, + D3D_SVT_DEPTHSTENCIL = 23, + D3D_SVT_BLEND = 24, + D3D_SVT_BUFFER = 25, + D3D_SVT_CBUFFER = 26, + D3D_SVT_TBUFFER = 27, + D3D_SVT_TEXTURE1DARRAY = 28, + D3D_SVT_TEXTURE2DARRAY = 29, + D3D_SVT_RENDERTARGETVIEW = 30, + D3D_SVT_DEPTHSTENCILVIEW = 31, + D3D_SVT_TEXTURE2DMS = 32, + D3D_SVT_TEXTURE2DMSARRAY = 33, + D3D_SVT_TEXTURECUBEARRAY = 34, + D3D_SVT_HULLSHADER = 35, + D3D_SVT_DOMAINSHADER = 36, + D3D_SVT_INTERFACE_POINTER = 37, + D3D_SVT_COMPUTESHADER = 38, + D3D_SVT_DOUBLE = 39, + D3D_SVT_RWTEXTURE1D = 40, + D3D_SVT_RWTEXTURE1DARRAY = 41, + D3D_SVT_RWTEXTURE2D = 42, + D3D_SVT_RWTEXTURE2DARRAY = 43, + D3D_SVT_RWTEXTURE3D = 44, + D3D_SVT_RWBUFFER = 45, + D3D_SVT_BYTEADDRESS_BUFFER = 46, + D3D_SVT_RWBYTEADDRESS_BUFFER = 47, + D3D_SVT_STRUCTURED_BUFFER = 48, + D3D_SVT_RWSTRUCTURED_BUFFER = 49, + D3D_SVT_APPEND_STRUCTURED_BUFFER = 50, + D3D_SVT_CONSUME_STRUCTURED_BUFFER = 51, + D3D10_SVT_VOID = D3D_SVT_VOID, + D3D10_SVT_BOOL = D3D_SVT_BOOL, + D3D10_SVT_INT = D3D_SVT_INT, + D3D10_SVT_FLOAT = D3D_SVT_FLOAT, + D3D10_SVT_STRING = D3D_SVT_STRING, + D3D10_SVT_TEXTURE = D3D_SVT_TEXTURE, + D3D10_SVT_TEXTURE1D = D3D_SVT_TEXTURE1D, + D3D10_SVT_TEXTURE2D = D3D_SVT_TEXTURE2D, + D3D10_SVT_TEXTURE3D = D3D_SVT_TEXTURE3D, + D3D10_SVT_TEXTURECUBE = D3D_SVT_TEXTURECUBE, + D3D10_SVT_SAMPLER = D3D_SVT_SAMPLER, + D3D10_SVT_SAMPLER1D = D3D_SVT_SAMPLER1D, + D3D10_SVT_SAMPLER2D = D3D_SVT_SAMPLER2D, + D3D10_SVT_SAMPLER3D = D3D_SVT_SAMPLER3D, + D3D10_SVT_SAMPLERCUBE = D3D_SVT_SAMPLERCUBE, + D3D10_SVT_PIXELSHADER = D3D_SVT_PIXELSHADER, + D3D10_SVT_VERTEXSHADER = D3D_SVT_VERTEXSHADER, + D3D10_SVT_PIXELFRAGMENT = D3D_SVT_PIXELFRAGMENT, + D3D10_SVT_VERTEXFRAGMENT = D3D_SVT_VERTEXFRAGMENT, + D3D10_SVT_UINT = D3D_SVT_UINT, + D3D10_SVT_UINT8 = D3D_SVT_UINT8, + D3D10_SVT_GEOMETRYSHADER = D3D_SVT_GEOMETRYSHADER, + D3D10_SVT_RASTERIZER = D3D_SVT_RASTERIZER, + D3D10_SVT_DEPTHSTENCIL = D3D_SVT_DEPTHSTENCIL, + D3D10_SVT_BLEND = D3D_SVT_BLEND, + D3D10_SVT_BUFFER = D3D_SVT_BUFFER, + D3D10_SVT_CBUFFER = D3D_SVT_CBUFFER, + D3D10_SVT_TBUFFER = D3D_SVT_TBUFFER, + D3D10_SVT_TEXTURE1DARRAY = D3D_SVT_TEXTURE1DARRAY, + D3D10_SVT_TEXTURE2DARRAY = D3D_SVT_TEXTURE2DARRAY, + D3D10_SVT_RENDERTARGETVIEW = D3D_SVT_RENDERTARGETVIEW, + D3D10_SVT_DEPTHSTENCILVIEW = D3D_SVT_DEPTHSTENCILVIEW, + D3D10_SVT_TEXTURE2DMS = D3D_SVT_TEXTURE2DMS, + D3D10_SVT_TEXTURE2DMSARRAY = D3D_SVT_TEXTURE2DMSARRAY, + D3D10_SVT_TEXTURECUBEARRAY = D3D_SVT_TEXTURECUBEARRAY, + D3D11_SVT_HULLSHADER = D3D_SVT_HULLSHADER, + D3D11_SVT_DOMAINSHADER = D3D_SVT_DOMAINSHADER, + D3D11_SVT_INTERFACE_POINTER = D3D_SVT_INTERFACE_POINTER, + D3D11_SVT_COMPUTESHADER = D3D_SVT_COMPUTESHADER, + D3D11_SVT_DOUBLE = D3D_SVT_DOUBLE, + D3D11_SVT_RWTEXTURE1D = D3D_SVT_RWTEXTURE1D, + D3D11_SVT_RWTEXTURE1DARRAY = D3D_SVT_RWTEXTURE1DARRAY, + D3D11_SVT_RWTEXTURE2D = D3D_SVT_RWTEXTURE2D, + D3D11_SVT_RWTEXTURE2DARRAY = D3D_SVT_RWTEXTURE2DARRAY, + D3D11_SVT_RWTEXTURE3D = D3D_SVT_RWTEXTURE3D, + D3D11_SVT_RWBUFFER = D3D_SVT_RWBUFFER, + D3D11_SVT_BYTEADDRESS_BUFFER = D3D_SVT_BYTEADDRESS_BUFFER, + D3D11_SVT_RWBYTEADDRESS_BUFFER = D3D_SVT_RWBYTEADDRESS_BUFFER, + D3D11_SVT_STRUCTURED_BUFFER = D3D_SVT_STRUCTURED_BUFFER, + D3D11_SVT_RWSTRUCTURED_BUFFER = D3D_SVT_RWSTRUCTURED_BUFFER, + D3D11_SVT_APPEND_STRUCTURED_BUFFER = D3D_SVT_APPEND_STRUCTURED_BUFFER, + D3D11_SVT_CONSUME_STRUCTURED_BUFFER = D3D_SVT_CONSUME_STRUCTURED_BUFFER, + D3D_SVT_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_VARIABLE_TYPE; + +typedef +enum _D3D_SHADER_INPUT_FLAGS + { D3D_SIF_USERPACKED = 1, + D3D_SIF_COMPARISON_SAMPLER = 2, + D3D_SIF_TEXTURE_COMPONENT_0 = 4, + D3D_SIF_TEXTURE_COMPONENT_1 = 8, + D3D_SIF_TEXTURE_COMPONENTS = 12, + D3D10_SIF_USERPACKED = D3D_SIF_USERPACKED, + D3D10_SIF_COMPARISON_SAMPLER = D3D_SIF_COMPARISON_SAMPLER, + D3D10_SIF_TEXTURE_COMPONENT_0 = D3D_SIF_TEXTURE_COMPONENT_0, + D3D10_SIF_TEXTURE_COMPONENT_1 = D3D_SIF_TEXTURE_COMPONENT_1, + D3D10_SIF_TEXTURE_COMPONENTS = D3D_SIF_TEXTURE_COMPONENTS, + D3D_SIF_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_INPUT_FLAGS; + +typedef +enum _D3D_SHADER_INPUT_TYPE + { D3D_SIT_CBUFFER = 0, + D3D_SIT_TBUFFER = ( D3D_SIT_CBUFFER + 1 ) , + D3D_SIT_TEXTURE = ( D3D_SIT_TBUFFER + 1 ) , + D3D_SIT_SAMPLER = ( D3D_SIT_TEXTURE + 1 ) , + D3D_SIT_UAV_RWTYPED = ( D3D_SIT_SAMPLER + 1 ) , + D3D_SIT_STRUCTURED = ( D3D_SIT_UAV_RWTYPED + 1 ) , + D3D_SIT_UAV_RWSTRUCTURED = ( D3D_SIT_STRUCTURED + 1 ) , + D3D_SIT_BYTEADDRESS = ( D3D_SIT_UAV_RWSTRUCTURED + 1 ) , + D3D_SIT_UAV_RWBYTEADDRESS = ( D3D_SIT_BYTEADDRESS + 1 ) , + D3D_SIT_UAV_APPEND_STRUCTURED = ( D3D_SIT_UAV_RWBYTEADDRESS + 1 ) , + D3D_SIT_UAV_CONSUME_STRUCTURED = ( D3D_SIT_UAV_APPEND_STRUCTURED + 1 ) , + D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = ( D3D_SIT_UAV_CONSUME_STRUCTURED + 1 ) , + D3D10_SIT_CBUFFER = D3D_SIT_CBUFFER, + D3D10_SIT_TBUFFER = D3D_SIT_TBUFFER, + D3D10_SIT_TEXTURE = D3D_SIT_TEXTURE, + D3D10_SIT_SAMPLER = D3D_SIT_SAMPLER, + D3D11_SIT_UAV_RWTYPED = D3D_SIT_UAV_RWTYPED, + D3D11_SIT_STRUCTURED = D3D_SIT_STRUCTURED, + D3D11_SIT_UAV_RWSTRUCTURED = D3D_SIT_UAV_RWSTRUCTURED, + D3D11_SIT_BYTEADDRESS = D3D_SIT_BYTEADDRESS, + D3D11_SIT_UAV_RWBYTEADDRESS = D3D_SIT_UAV_RWBYTEADDRESS, + D3D11_SIT_UAV_APPEND_STRUCTURED = D3D_SIT_UAV_APPEND_STRUCTURED, + D3D11_SIT_UAV_CONSUME_STRUCTURED = D3D_SIT_UAV_CONSUME_STRUCTURED, + D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER + } D3D_SHADER_INPUT_TYPE; + +typedef +enum _D3D_SHADER_CBUFFER_FLAGS + { D3D_CBF_USERPACKED = 1, + D3D10_CBF_USERPACKED = D3D_CBF_USERPACKED, + D3D_CBF_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_CBUFFER_FLAGS; + +typedef +enum _D3D_CBUFFER_TYPE + { D3D_CT_CBUFFER = 0, + D3D_CT_TBUFFER = ( D3D_CT_CBUFFER + 1 ) , + D3D_CT_INTERFACE_POINTERS = ( D3D_CT_TBUFFER + 1 ) , + D3D_CT_RESOURCE_BIND_INFO = ( D3D_CT_INTERFACE_POINTERS + 1 ) , + D3D10_CT_CBUFFER = D3D_CT_CBUFFER, + D3D10_CT_TBUFFER = D3D_CT_TBUFFER, + D3D11_CT_CBUFFER = D3D_CT_CBUFFER, + D3D11_CT_TBUFFER = D3D_CT_TBUFFER, + D3D11_CT_INTERFACE_POINTERS = D3D_CT_INTERFACE_POINTERS, + D3D11_CT_RESOURCE_BIND_INFO = D3D_CT_RESOURCE_BIND_INFO + } D3D_CBUFFER_TYPE; + +typedef +enum D3D_NAME + { D3D_NAME_UNDEFINED = 0, + D3D_NAME_POSITION = 1, + D3D_NAME_CLIP_DISTANCE = 2, + D3D_NAME_CULL_DISTANCE = 3, + D3D_NAME_RENDER_TARGET_ARRAY_INDEX = 4, + D3D_NAME_VIEWPORT_ARRAY_INDEX = 5, + D3D_NAME_VERTEX_ID = 6, + D3D_NAME_PRIMITIVE_ID = 7, + D3D_NAME_INSTANCE_ID = 8, + D3D_NAME_IS_FRONT_FACE = 9, + D3D_NAME_SAMPLE_INDEX = 10, + D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR = 11, + D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = 12, + D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR = 13, + D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14, + D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15, + D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16, + D3D_NAME_TARGET = 64, + D3D_NAME_DEPTH = 65, + D3D_NAME_COVERAGE = 66, + D3D_NAME_DEPTH_GREATER_EQUAL = 67, + D3D_NAME_DEPTH_LESS_EQUAL = 68, + D3D10_NAME_UNDEFINED = D3D_NAME_UNDEFINED, + D3D10_NAME_POSITION = D3D_NAME_POSITION, + D3D10_NAME_CLIP_DISTANCE = D3D_NAME_CLIP_DISTANCE, + D3D10_NAME_CULL_DISTANCE = D3D_NAME_CULL_DISTANCE, + D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = D3D_NAME_RENDER_TARGET_ARRAY_INDEX, + D3D10_NAME_VIEWPORT_ARRAY_INDEX = D3D_NAME_VIEWPORT_ARRAY_INDEX, + D3D10_NAME_VERTEX_ID = D3D_NAME_VERTEX_ID, + D3D10_NAME_PRIMITIVE_ID = D3D_NAME_PRIMITIVE_ID, + D3D10_NAME_INSTANCE_ID = D3D_NAME_INSTANCE_ID, + D3D10_NAME_IS_FRONT_FACE = D3D_NAME_IS_FRONT_FACE, + D3D10_NAME_SAMPLE_INDEX = D3D_NAME_SAMPLE_INDEX, + D3D10_NAME_TARGET = D3D_NAME_TARGET, + D3D10_NAME_DEPTH = D3D_NAME_DEPTH, + D3D10_NAME_COVERAGE = D3D_NAME_COVERAGE, + D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR = D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR, + D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR, + D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR = D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR, + D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR = D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR, + D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR = D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR, + D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR = D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR, + D3D11_NAME_DEPTH_GREATER_EQUAL = D3D_NAME_DEPTH_GREATER_EQUAL, + D3D11_NAME_DEPTH_LESS_EQUAL = D3D_NAME_DEPTH_LESS_EQUAL + } D3D_NAME; + +typedef +enum D3D_RESOURCE_RETURN_TYPE + { D3D_RETURN_TYPE_UNORM = 1, + D3D_RETURN_TYPE_SNORM = 2, + D3D_RETURN_TYPE_SINT = 3, + D3D_RETURN_TYPE_UINT = 4, + D3D_RETURN_TYPE_FLOAT = 5, + D3D_RETURN_TYPE_MIXED = 6, + D3D_RETURN_TYPE_DOUBLE = 7, + D3D_RETURN_TYPE_CONTINUED = 8, + D3D10_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM, + D3D10_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM, + D3D10_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT, + D3D10_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT, + D3D10_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT, + D3D10_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED, + D3D11_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM, + D3D11_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM, + D3D11_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT, + D3D11_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT, + D3D11_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT, + D3D11_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED, + D3D11_RETURN_TYPE_DOUBLE = D3D_RETURN_TYPE_DOUBLE, + D3D11_RETURN_TYPE_CONTINUED = D3D_RETURN_TYPE_CONTINUED + } D3D_RESOURCE_RETURN_TYPE; + +typedef +enum D3D_REGISTER_COMPONENT_TYPE + { D3D_REGISTER_COMPONENT_UNKNOWN = 0, + D3D_REGISTER_COMPONENT_UINT32 = 1, + D3D_REGISTER_COMPONENT_SINT32 = 2, + D3D_REGISTER_COMPONENT_FLOAT32 = 3, + D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN, + D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32, + D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32, + D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32 + } D3D_REGISTER_COMPONENT_TYPE; + +typedef +enum D3D_TESSELLATOR_DOMAIN + { D3D_TESSELLATOR_DOMAIN_UNDEFINED = 0, + D3D_TESSELLATOR_DOMAIN_ISOLINE = 1, + D3D_TESSELLATOR_DOMAIN_TRI = 2, + D3D_TESSELLATOR_DOMAIN_QUAD = 3, + D3D11_TESSELLATOR_DOMAIN_UNDEFINED = D3D_TESSELLATOR_DOMAIN_UNDEFINED, + D3D11_TESSELLATOR_DOMAIN_ISOLINE = D3D_TESSELLATOR_DOMAIN_ISOLINE, + D3D11_TESSELLATOR_DOMAIN_TRI = D3D_TESSELLATOR_DOMAIN_TRI, + D3D11_TESSELLATOR_DOMAIN_QUAD = D3D_TESSELLATOR_DOMAIN_QUAD + } D3D_TESSELLATOR_DOMAIN; + +typedef +enum D3D_TESSELLATOR_PARTITIONING + { D3D_TESSELLATOR_PARTITIONING_UNDEFINED = 0, + D3D_TESSELLATOR_PARTITIONING_INTEGER = 1, + D3D_TESSELLATOR_PARTITIONING_POW2 = 2, + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3, + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4, + D3D11_TESSELLATOR_PARTITIONING_UNDEFINED = D3D_TESSELLATOR_PARTITIONING_UNDEFINED, + D3D11_TESSELLATOR_PARTITIONING_INTEGER = D3D_TESSELLATOR_PARTITIONING_INTEGER, + D3D11_TESSELLATOR_PARTITIONING_POW2 = D3D_TESSELLATOR_PARTITIONING_POW2, + D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD, + D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN + } D3D_TESSELLATOR_PARTITIONING; + +typedef +enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE + { D3D_TESSELLATOR_OUTPUT_UNDEFINED = 0, + D3D_TESSELLATOR_OUTPUT_POINT = 1, + D3D_TESSELLATOR_OUTPUT_LINE = 2, + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3, + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4, + D3D11_TESSELLATOR_OUTPUT_UNDEFINED = D3D_TESSELLATOR_OUTPUT_UNDEFINED, + D3D11_TESSELLATOR_OUTPUT_POINT = D3D_TESSELLATOR_OUTPUT_POINT, + D3D11_TESSELLATOR_OUTPUT_LINE = D3D_TESSELLATOR_OUTPUT_LINE, + D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW, + D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW + } D3D_TESSELLATOR_OUTPUT_PRIMITIVE; + +DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00); + + +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/RenderDll/Dx9Sdk/Include/D3Dcompiler.h b/RenderDll/Dx9Sdk/Include/D3Dcompiler.h new file mode 100644 index 0000000..fea519f --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/D3Dcompiler.h @@ -0,0 +1,397 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3DCompiler.h +// Content: D3D Compilation Types and APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DCOMPILER_H__ +#define __D3DCOMPILER_H__ + +// Current name of the DLL shipped in the same SDK as this header. + + +#define D3DCOMPILER_DLL_W L"d3dcompiler_43.dll" +#define D3DCOMPILER_DLL_A "d3dcompiler_43.dll" + +#ifdef UNICODE + #define D3DCOMPILER_DLL D3DCOMPILER_DLL_W +#else + #define D3DCOMPILER_DLL D3DCOMPILER_DLL_A +#endif + +#include "d3d11shader.h" + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +//---------------------------------------------------------------------------- +// D3DCOMPILE flags: +// ----------------- +// D3DCOMPILE_DEBUG +// Insert debug file/line/type/symbol information. +// +// D3DCOMPILE_SKIP_VALIDATION +// Do not validate the generated code against known capabilities and +// constraints. This option is only recommended when compiling shaders +// you KNOW will work. (ie. have compiled before without this option.) +// Shaders are always validated by D3D before they are set to the device. +// +// D3DCOMPILE_SKIP_OPTIMIZATION +// Instructs the compiler to skip optimization steps during code generation. +// Unless you are trying to isolate a problem in your code using this option +// is not recommended. +// +// D3DCOMPILE_PACK_MATRIX_ROW_MAJOR +// Unless explicitly specified, matrices will be packed in row-major order +// on input and output from the shader. +// +// D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR +// Unless explicitly specified, matrices will be packed in column-major +// order on input and output from the shader. This is generally more +// efficient, since it allows vector-matrix multiplication to be performed +// using a series of dot-products. +// +// D3DCOMPILE_PARTIAL_PRECISION +// Force all computations in resulting shader to occur at partial precision. +// This may result in faster evaluation of shaders on some hardware. +// +// D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT +// Force compiler to compile against the next highest available software +// target for vertex shaders. This flag also turns optimizations off, +// and debugging on. +// +// D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT +// Force compiler to compile against the next highest available software +// target for pixel shaders. This flag also turns optimizations off, +// and debugging on. +// +// D3DCOMPILE_NO_PRESHADER +// Disables Preshaders. Using this flag will cause the compiler to not +// pull out static expression for evaluation on the host cpu +// +// D3DCOMPILE_AVOID_FLOW_CONTROL +// Hint compiler to avoid flow-control constructs where possible. +// +// D3DCOMPILE_PREFER_FLOW_CONTROL +// Hint compiler to prefer flow-control constructs where possible. +// +// D3DCOMPILE_ENABLE_STRICTNESS +// By default, the HLSL/Effect compilers are not strict on deprecated syntax. +// Specifying this flag enables the strict mode. Deprecated syntax may be +// removed in a future release, and enabling syntax is a good way to make +// sure your shaders comply to the latest spec. +// +// D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY +// This enables older shaders to compile to 4_0 targets. +// +//---------------------------------------------------------------------------- + +#define D3DCOMPILE_DEBUG (1 << 0) +#define D3DCOMPILE_SKIP_VALIDATION (1 << 1) +#define D3DCOMPILE_SKIP_OPTIMIZATION (1 << 2) +#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR (1 << 3) +#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR (1 << 4) +#define D3DCOMPILE_PARTIAL_PRECISION (1 << 5) +#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT (1 << 6) +#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT (1 << 7) +#define D3DCOMPILE_NO_PRESHADER (1 << 8) +#define D3DCOMPILE_AVOID_FLOW_CONTROL (1 << 9) +#define D3DCOMPILE_PREFER_FLOW_CONTROL (1 << 10) +#define D3DCOMPILE_ENABLE_STRICTNESS (1 << 11) +#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12) +#define D3DCOMPILE_IEEE_STRICTNESS (1 << 13) +#define D3DCOMPILE_OPTIMIZATION_LEVEL0 (1 << 14) +#define D3DCOMPILE_OPTIMIZATION_LEVEL1 0 +#define D3DCOMPILE_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15)) +#define D3DCOMPILE_OPTIMIZATION_LEVEL3 (1 << 15) +#define D3DCOMPILE_RESERVED16 (1 << 16) +#define D3DCOMPILE_RESERVED17 (1 << 17) +#define D3DCOMPILE_WARNINGS_ARE_ERRORS (1 << 18) + +//---------------------------------------------------------------------------- +// D3DCOMPILE_EFFECT flags: +// ------------------------------------- +// These flags are passed in when creating an effect, and affect +// either compilation behavior or runtime effect behavior +// +// D3DCOMPILE_EFFECT_CHILD_EFFECT +// Compile this .fx file to a child effect. Child effects have no +// initializers for any shared values as these are initialied in the +// master effect (pool). +// +// D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS +// By default, performance mode is enabled. Performance mode +// disallows mutable state objects by preventing non-literal +// expressions from appearing in state object definitions. +// Specifying this flag will disable the mode and allow for mutable +// state objects. +// +//---------------------------------------------------------------------------- + +#define D3DCOMPILE_EFFECT_CHILD_EFFECT (1 << 0) +#define D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS (1 << 1) + +//---------------------------------------------------------------------------- +// D3DCompile: +// ---------- +// Compile source text into bytecode appropriate for the given target. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DCompile(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in_opt LPCSTR pSourceName, + __in_xcount_opt(pDefines->Name != NULL) CONST D3D_SHADER_MACRO* pDefines, + __in_opt ID3DInclude* pInclude, + __in LPCSTR pEntrypoint, + __in LPCSTR pTarget, + __in UINT Flags1, + __in UINT Flags2, + __out ID3DBlob** ppCode, + __out_opt ID3DBlob** ppErrorMsgs); + +typedef HRESULT (WINAPI *pD3DCompile) + (LPCVOID pSrcData, + SIZE_T SrcDataSize, + LPCSTR pFileName, + CONST D3D_SHADER_MACRO* pDefines, + ID3DInclude* pInclude, + LPCSTR pEntrypoint, + LPCSTR pTarget, + UINT Flags1, + UINT Flags2, + ID3DBlob** ppCode, + ID3DBlob** ppErrorMsgs); + +//---------------------------------------------------------------------------- +// D3DPreprocess: +// ---------- +// Process source text with the compiler's preprocessor and return +// the resulting text. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DPreprocess(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in_opt LPCSTR pSourceName, + __in_opt CONST D3D_SHADER_MACRO* pDefines, + __in_opt ID3DInclude* pInclude, + __out ID3DBlob** ppCodeText, + __out_opt ID3DBlob** ppErrorMsgs); + +typedef HRESULT (WINAPI *pD3DPreprocess) + (LPCVOID pSrcData, + SIZE_T SrcDataSize, + LPCSTR pFileName, + CONST D3D_SHADER_MACRO* pDefines, + ID3DInclude* pInclude, + ID3DBlob** ppCodeText, + ID3DBlob** ppErrorMsgs); + +//---------------------------------------------------------------------------- +// D3DGetDebugInfo: +// ----------------------- +// Gets shader debug info. Debug info is generated by D3DCompile and is +// embedded in the body of the shader. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DGetDebugInfo(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __out ID3DBlob** ppDebugInfo); + +//---------------------------------------------------------------------------- +// D3DReflect: +// ---------- +// Shader code contains metadata that can be inspected via the +// reflection APIs. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DReflect(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in REFIID pInterface, + __out void** ppReflector); + +//---------------------------------------------------------------------------- +// D3DDisassemble: +// ---------------------- +// Takes a binary shader and returns a buffer containing text assembly. +//---------------------------------------------------------------------------- + +#define D3D_DISASM_ENABLE_COLOR_CODE 0x00000001 +#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS 0x00000002 +#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING 0x00000004 +#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE 0x00000008 +#define D3D_DISASM_DISABLE_DEBUG_INFO 0x00000010 + +HRESULT WINAPI +D3DDisassemble(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in UINT Flags, + __in_opt LPCSTR szComments, + __out ID3DBlob** ppDisassembly); + +typedef HRESULT (WINAPI *pD3DDisassemble) + (__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in UINT Flags, + __in_opt LPCSTR szComments, + __out ID3DBlob** ppDisassembly); + +//---------------------------------------------------------------------------- +// D3DDisassemble10Effect: +// ----------------------- +// Takes a D3D10 effect interface and returns a +// buffer containing text assembly. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DDisassemble10Effect(__in interface ID3D10Effect *pEffect, + __in UINT Flags, + __out ID3DBlob** ppDisassembly); + +//---------------------------------------------------------------------------- +// D3DGetInputSignatureBlob: +// ----------------------- +// Retrieve the input signature from a compilation result. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DGetInputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __out ID3DBlob** ppSignatureBlob); + +//---------------------------------------------------------------------------- +// D3DGetOutputSignatureBlob: +// ----------------------- +// Retrieve the output signature from a compilation result. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DGetOutputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __out ID3DBlob** ppSignatureBlob); + +//---------------------------------------------------------------------------- +// D3DGetInputAndOutputSignatureBlob: +// ----------------------- +// Retrieve the input and output signatures from a compilation result. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DGetInputAndOutputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __out ID3DBlob** ppSignatureBlob); + +//---------------------------------------------------------------------------- +// D3DStripShader: +// ----------------------- +// Removes unwanted blobs from a compilation result +//---------------------------------------------------------------------------- + +typedef enum D3DCOMPILER_STRIP_FLAGS +{ + D3DCOMPILER_STRIP_REFLECTION_DATA = 1, + D3DCOMPILER_STRIP_DEBUG_INFO = 2, + D3DCOMPILER_STRIP_TEST_BLOBS = 4, + D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff, +} D3DCOMPILER_STRIP_FLAGS; + +HRESULT WINAPI +D3DStripShader(__in_bcount(BytecodeLength) LPCVOID pShaderBytecode, + __in SIZE_T BytecodeLength, + __in UINT uStripFlags, + __out ID3DBlob** ppStrippedBlob); + +//---------------------------------------------------------------------------- +// D3DGetBlobPart: +// ----------------------- +// Extracts information from a compilation result. +//---------------------------------------------------------------------------- + +typedef enum D3D_BLOB_PART +{ + D3D_BLOB_INPUT_SIGNATURE_BLOB, + D3D_BLOB_OUTPUT_SIGNATURE_BLOB, + D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB, + D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB, + D3D_BLOB_ALL_SIGNATURE_BLOB, + D3D_BLOB_DEBUG_INFO, + D3D_BLOB_LEGACY_SHADER, + D3D_BLOB_XNA_PREPASS_SHADER, + D3D_BLOB_XNA_SHADER, + + // Test parts are only produced by special compiler versions and so + // are usually not present in shaders. + D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000, + D3D_BLOB_TEST_COMPILE_DETAILS, + D3D_BLOB_TEST_COMPILE_PERF, +} D3D_BLOB_PART; + +HRESULT WINAPI +D3DGetBlobPart(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in D3D_BLOB_PART Part, + __in UINT Flags, + __out ID3DBlob** ppPart); + +//---------------------------------------------------------------------------- +// D3DCompressShaders: +// ----------------------- +// Compresses a set of shaders into a more compact form. +//---------------------------------------------------------------------------- + +typedef struct _D3D_SHADER_DATA +{ + LPCVOID pBytecode; + SIZE_T BytecodeLength; +} D3D_SHADER_DATA; + +#define D3D_COMPRESS_SHADER_KEEP_ALL_PARTS 0x00000001 + +HRESULT WINAPI +D3DCompressShaders(__in UINT uNumShaders, + __in_ecount(uNumShaders) D3D_SHADER_DATA* pShaderData, + __in UINT uFlags, + __out ID3DBlob** ppCompressedData); + +//---------------------------------------------------------------------------- +// D3DDecompressShaders: +// ----------------------- +// Decompresses one or more shaders from a compressed set. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DDecompressShaders(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in UINT uNumShaders, + __in UINT uStartIndex, + __in_ecount_opt(uNumShaders) UINT* pIndices, + __in UINT uFlags, + __out_ecount(uNumShaders) ID3DBlob** ppShaders, + __out_opt UINT* pTotalShaders); + +//---------------------------------------------------------------------------- +// D3DCreateBlob: +// ----------------------- +// Create an ID3DBlob instance. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DCreateBlob(__in SIZE_T Size, + __out ID3DBlob** ppBlob); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif // #ifndef __D3DCOMPILER_H__ diff --git a/RenderDll/Dx9Sdk/Include/DWrite.h b/RenderDll/Dx9Sdk/Include/DWrite.h new file mode 100644 index 0000000..fc3b637 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/DWrite.h @@ -0,0 +1,4995 @@ +//+-------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Abstract: +// DirectX Typography Services public API definitions. +// +//---------------------------------------------------------------------------- + +#ifndef DWRITE_H_INCLUDED +#define DWRITE_H_INCLUDED + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef DWRITE_NO_WINDOWS_H + +#include +#include + +#endif // DWRITE_NO_WINDOWS_H + +#include + +#ifndef DWRITE_DECLARE_INTERFACE +#define DWRITE_DECLARE_INTERFACE(iid) DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE +#endif + +#ifndef DWRITE_EXPORT +#define DWRITE_EXPORT __declspec(dllimport) WINAPI +#endif + +/// +/// The type of a font represented by a single font file. +/// Font formats that consist of multiple files, e.g. Type 1 .PFM and .PFB, have +/// separate enum values for each of the file type. +/// +enum DWRITE_FONT_FILE_TYPE +{ + /// + /// Font type is not recognized by the DirectWrite font system. + /// + DWRITE_FONT_FILE_TYPE_UNKNOWN, + + /// + /// OpenType font with CFF outlines. + /// + DWRITE_FONT_FILE_TYPE_CFF, + + /// + /// OpenType font with TrueType outlines. + /// + DWRITE_FONT_FILE_TYPE_TRUETYPE, + + /// + /// OpenType font that contains a TrueType collection. + /// + DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION, + + /// + /// Type 1 PFM font. + /// + DWRITE_FONT_FILE_TYPE_TYPE1_PFM, + + /// + /// Type 1 PFB font. + /// + DWRITE_FONT_FILE_TYPE_TYPE1_PFB, + + /// + /// Vector .FON font. + /// + DWRITE_FONT_FILE_TYPE_VECTOR, + + /// + /// Bitmap .FON font. + /// + DWRITE_FONT_FILE_TYPE_BITMAP +}; + +/// +/// The file format of a complete font face. +/// Font formats that consist of multiple files, e.g. Type 1 .PFM and .PFB, have +/// a single enum entry. +/// +enum DWRITE_FONT_FACE_TYPE +{ + /// + /// OpenType font face with CFF outlines. + /// + DWRITE_FONT_FACE_TYPE_CFF, + + /// + /// OpenType font face with TrueType outlines. + /// + DWRITE_FONT_FACE_TYPE_TRUETYPE, + + /// + /// OpenType font face that is a part of a TrueType collection. + /// + DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION, + + /// + /// A Type 1 font face. + /// + DWRITE_FONT_FACE_TYPE_TYPE1, + + /// + /// A vector .FON format font face. + /// + DWRITE_FONT_FACE_TYPE_VECTOR, + + /// + /// A bitmap .FON format font face. + /// + DWRITE_FONT_FACE_TYPE_BITMAP, + + /// + /// Font face type is not recognized by the DirectWrite font system. + /// + DWRITE_FONT_FACE_TYPE_UNKNOWN +}; + +/// +/// Specifies algorithmic style simulations to be applied to the font face. +/// Bold and oblique simulations can be combined via bitwise OR operation. +/// +enum DWRITE_FONT_SIMULATIONS +{ + /// + /// No simulations are performed. + /// + DWRITE_FONT_SIMULATIONS_NONE = 0x0000, + + /// + /// Algorithmic emboldening is performed. + /// + DWRITE_FONT_SIMULATIONS_BOLD = 0x0001, + + /// + /// Algorithmic italicization is performed. + /// + DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002 +}; + +#ifdef DEFINE_ENUM_FLAG_OPERATORS +DEFINE_ENUM_FLAG_OPERATORS(DWRITE_FONT_SIMULATIONS); +#endif + +/// +/// The font weight enumeration describes common values for degree of blackness or thickness of strokes of characters in a font. +/// Font weight values less than 1 or greater than 999 are considered to be invalid, and they are rejected by font API functions. +/// +enum DWRITE_FONT_WEIGHT +{ + /// + /// Predefined font weight : Thin (100). + /// + DWRITE_FONT_WEIGHT_THIN = 100, + + /// + /// Predefined font weight : Extra-light (200). + /// + DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200, + + /// + /// Predefined font weight : Ultra-light (200). + /// + DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200, + + /// + /// Predefined font weight : Light (300). + /// + DWRITE_FONT_WEIGHT_LIGHT = 300, + + /// + /// Predefined font weight : Normal (400). + /// + DWRITE_FONT_WEIGHT_NORMAL = 400, + + /// + /// Predefined font weight : Regular (400). + /// + DWRITE_FONT_WEIGHT_REGULAR = 400, + + /// + /// Predefined font weight : Medium (500). + /// + DWRITE_FONT_WEIGHT_MEDIUM = 500, + + /// + /// Predefined font weight : Demi-bold (600). + /// + DWRITE_FONT_WEIGHT_DEMI_BOLD = 600, + + /// + /// Predefined font weight : Semi-bold (600). + /// + DWRITE_FONT_WEIGHT_SEMI_BOLD = 600, + + /// + /// Predefined font weight : Bold (700). + /// + DWRITE_FONT_WEIGHT_BOLD = 700, + + /// + /// Predefined font weight : Extra-bold (800). + /// + DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800, + + /// + /// Predefined font weight : Ultra-bold (800). + /// + DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800, + + /// + /// Predefined font weight : Black (900). + /// + DWRITE_FONT_WEIGHT_BLACK = 900, + + /// + /// Predefined font weight : Heavy (900). + /// + DWRITE_FONT_WEIGHT_HEAVY = 900, + + /// + /// Predefined font weight : Extra-black (950). + /// + DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950, + + /// + /// Predefined font weight : Ultra-black (950). + /// + DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950 +}; + +/// +/// The font stretch enumeration describes relative change from the normal aspect ratio +/// as specified by a font designer for the glyphs in a font. +/// Values less than 1 or greater than 9 are considered to be invalid, and they are rejected by font API functions. +/// +enum DWRITE_FONT_STRETCH +{ + /// + /// Predefined font stretch : Not known (0). + /// + DWRITE_FONT_STRETCH_UNDEFINED = 0, + + /// + /// Predefined font stretch : Ultra-condensed (1). + /// + DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1, + + /// + /// Predefined font stretch : Extra-condensed (2). + /// + DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2, + + /// + /// Predefined font stretch : Condensed (3). + /// + DWRITE_FONT_STRETCH_CONDENSED = 3, + + /// + /// Predefined font stretch : Semi-condensed (4). + /// + DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4, + + /// + /// Predefined font stretch : Normal (5). + /// + DWRITE_FONT_STRETCH_NORMAL = 5, + + /// + /// Predefined font stretch : Medium (5). + /// + DWRITE_FONT_STRETCH_MEDIUM = 5, + + /// + /// Predefined font stretch : Semi-expanded (6). + /// + DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6, + + /// + /// Predefined font stretch : Expanded (7). + /// + DWRITE_FONT_STRETCH_EXPANDED = 7, + + /// + /// Predefined font stretch : Extra-expanded (8). + /// + DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8, + + /// + /// Predefined font stretch : Ultra-expanded (9). + /// + DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9 +}; + +/// +/// The font style enumeration describes the slope style of a font face, such as Normal, Italic or Oblique. +/// Values other than the ones defined in the enumeration are considered to be invalid, and they are rejected by font API functions. +/// +enum DWRITE_FONT_STYLE +{ + /// + /// Font slope style : Normal. + /// + DWRITE_FONT_STYLE_NORMAL, + + /// + /// Font slope style : Oblique. + /// + DWRITE_FONT_STYLE_OBLIQUE, + + /// + /// Font slope style : Italic. + /// + DWRITE_FONT_STYLE_ITALIC + +}; + +/// +/// The informational string enumeration identifies a string in a font. +/// +enum DWRITE_INFORMATIONAL_STRING_ID +{ + /// + /// Unspecified name ID. + /// + DWRITE_INFORMATIONAL_STRING_NONE, + + /// + /// Copyright notice provided by the font. + /// + DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE, + + /// + /// String containing a version number. + /// + DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS, + + /// + /// Trademark information provided by the font. + /// + DWRITE_INFORMATIONAL_STRING_TRADEMARK, + + /// + /// Name of the font manufacturer. + /// + DWRITE_INFORMATIONAL_STRING_MANUFACTURER, + + /// + /// Name of the font designer. + /// + DWRITE_INFORMATIONAL_STRING_DESIGNER, + + /// + /// URL of font designer (with protocol, e.g., http://, ftp://). + /// + DWRITE_INFORMATIONAL_STRING_DESIGNER_URL, + + /// + /// Description of the font. Can contain revision information, usage recommendations, history, features, etc. + /// + DWRITE_INFORMATIONAL_STRING_DESCRIPTION, + + /// + /// URL of font vendor (with protocol, e.g., http://, ftp://). If a unique serial number is embedded in the URL, it can be used to register the font. + /// + DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL, + + /// + /// Description of how the font may be legally used, or different example scenarios for licensed use. This field should be written in plain language, not legalese. + /// + DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION, + + /// + /// URL where additional licensing information can be found. + /// + DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL, + + /// + /// GDI-compatible family name. Because GDI allows a maximum of four fonts per family, fonts in the same family may have different GDI-compatible family names + /// (e.g., "Arial", "Arial Narrow", "Arial Black"). + /// + DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, + + /// + /// GDI-compatible subfamily name. + /// + DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES, + + /// + /// Family name preferred by the designer. This enables font designers to group more than four fonts in a single family without losing compatibility with + /// GDI. This name is typically only present if it differs from the GDI-compatible family name. + /// + DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES, + + /// + /// Subfamily name preferred by the designer. This name is typically only present if it differs from the GDI-compatible subfamily name. + /// + DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES, + + /// + /// Sample text. This can be the font name or any other text that the designer thinks is the best example to display the font in. + /// + DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT +}; + + +/// +/// The DWRITE_FONT_METRICS structure specifies the metrics of a font face that +/// are applicable to all glyphs within the font face. +/// +struct DWRITE_FONT_METRICS +{ + /// + /// The number of font design units per em unit. + /// Font files use their own coordinate system of font design units. + /// A font design unit is the smallest measurable unit in the em square, + /// an imaginary square that is used to size and align glyphs. + /// The concept of em square is used as a reference scale factor when defining font size and device transformation semantics. + /// The size of one em square is also commonly used to compute the paragraph identation value. + /// + UINT16 designUnitsPerEm; + + /// + /// Ascent value of the font face in font design units. + /// Ascent is the distance from the top of font character alignment box to English baseline. + /// + UINT16 ascent; + + /// + /// Descent value of the font face in font design units. + /// Descent is the distance from the bottom of font character alignment box to English baseline. + /// + UINT16 descent; + + /// + /// Line gap in font design units. + /// Recommended additional white space to add between lines to improve legibility. The recommended line spacing + /// (baseline-to-baseline distance) is thus the sum of ascent, descent, and lineGap. The line gap is usually + /// positive or zero but can be negative, in which case the recommended line spacing is less than the height + /// of the character alignment box. + /// + INT16 lineGap; + + /// + /// Cap height value of the font face in font design units. + /// Cap height is the distance from English baseline to the top of a typical English capital. + /// Capital "H" is often used as a reference character for the purpose of calculating the cap height value. + /// + UINT16 capHeight; + + /// + /// x-height value of the font face in font design units. + /// x-height is the distance from English baseline to the top of lowercase letter "x", or a similar lowercase character. + /// + UINT16 xHeight; + + /// + /// The underline position value of the font face in font design units. + /// Underline position is the position of underline relative to the English baseline. + /// The value is usually made negative in order to place the underline below the baseline. + /// + INT16 underlinePosition; + + /// + /// The suggested underline thickness value of the font face in font design units. + /// + UINT16 underlineThickness; + + /// + /// The strikethrough position value of the font face in font design units. + /// Strikethrough position is the position of strikethrough relative to the English baseline. + /// The value is usually made positive in order to place the strikethrough above the baseline. + /// + INT16 strikethroughPosition; + + /// + /// The suggested strikethrough thickness value of the font face in font design units. + /// + UINT16 strikethroughThickness; +}; + +/// +/// The DWRITE_GLYPH_METRICS structure specifies the metrics of an individual glyph. +/// The units depend on how the metrics are obtained. +/// +struct DWRITE_GLYPH_METRICS +{ + /// + /// Specifies the X offset from the glyph origin to the left edge of the black box. + /// The glyph origin is the current horizontal writing position. + /// A negative value means the black box extends to the left of the origin (often true for lowercase italic 'f'). + /// + INT32 leftSideBearing; + + /// + /// Specifies the X offset from the origin of the current glyph to the origin of the next glyph when writing horizontally. + /// + UINT32 advanceWidth; + + /// + /// Specifies the X offset from the right edge of the black box to the origin of the next glyph when writing horizontally. + /// The value is negative when the right edge of the black box overhangs the layout box. + /// + INT32 rightSideBearing; + + /// + /// Specifies the vertical offset from the vertical origin to the top of the black box. + /// Thus, a positive value adds whitespace whereas a negative value means the glyph overhangs the top of the layout box. + /// + INT32 topSideBearing; + + /// + /// Specifies the Y offset from the vertical origin of the current glyph to the vertical origin of the next glyph when writing vertically. + /// (Note that the term "origin" by itself denotes the horizontal origin. The vertical origin is different. + /// Its Y coordinate is specified by verticalOriginY value, + /// and its X coordinate is half the advanceWidth to the right of the horizontal origin). + /// + UINT32 advanceHeight; + + /// + /// Specifies the vertical distance from the black box's bottom edge to the advance height. + /// Positive when the bottom edge of the black box is within the layout box. + /// Negative when the bottom edge of black box overhangs the layout box. + /// + INT32 bottomSideBearing; + + /// + /// Specifies the Y coordinate of a glyph's vertical origin, in the font's design coordinate system. + /// The y coordinate of a glyph's vertical origin is the sum of the glyph's top side bearing + /// and the top (i.e. yMax) of the glyph's bounding box. + /// + INT32 verticalOriginY; +}; + +/// +/// Optional adjustment to a glyph's position. An glyph offset changes the position of a glyph without affecting +/// the pen position. Offsets are in logical, pre-transform units. +/// +struct DWRITE_GLYPH_OFFSET +{ + /// + /// Offset in the advance direction of the run. A positive advance offset moves the glyph to the right + /// (in pre-transform coordinates) if the run is left-to-right or to the left if the run is right-to-left. + /// + FLOAT advanceOffset; + + /// + /// Offset in the ascent direction, i.e., the direction ascenders point. A positive ascender offset moves + /// the glyph up (in pre-transform coordinates). + /// + FLOAT ascenderOffset; +}; + +/// +/// Specifies the type of DirectWrite factory object. +/// DirectWrite factory contains internal state such as font loader registration and cached font data. +/// In most cases it is recommended to use the shared factory object, because it allows multiple components +/// that use DirectWrite to share internal DirectWrite state and reduce memory usage. +/// However, there are cases when it is desirable to reduce the impact of a component, +/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it +/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed +/// component. +/// +enum DWRITE_FACTORY_TYPE +{ + /// + /// Shared factory allow for re-use of cached font data across multiple in process components. + /// Such factories also take advantage of cross process font caching components for better performance. + /// + DWRITE_FACTORY_TYPE_SHARED, + + /// + /// Objects created from the isolated factory do not interact with internal DirectWrite state from other components. + /// + DWRITE_FACTORY_TYPE_ISOLATED +}; + +// Creates an OpenType tag as a 32bit integer such that +// the first character in the tag is the lowest byte, +// (least significant on little endian architectures) +// which can be used to compare with tags in the font file. +// This macro is compatible with DWRITE_FONT_FEATURE_TAG. +// +// Example: DWRITE_MAKE_OPENTYPE_TAG('c','c','m','p') +// Dword: 0x706D6363 +// +#define DWRITE_MAKE_OPENTYPE_TAG(a,b,c,d) ( \ + (static_cast(static_cast(d)) << 24) | \ + (static_cast(static_cast(c)) << 16) | \ + (static_cast(static_cast(b)) << 8) | \ + static_cast(static_cast(a))) + +interface IDWriteFontFileStream; + +/// +/// Font file loader interface handles loading font file resources of a particular type from a key. +/// The font file loader interface is recommended to be implemented by a singleton object. +/// IMPORTANT: font file loader implementations must not register themselves with DirectWrite factory +/// inside their constructors and must not unregister themselves in their destructors, because +/// registration and unregistraton operations increment and decrement the object reference count respectively. +/// Instead, registration and unregistration of font file loaders with DirectWrite factory should be performed +/// outside of the font file loader implementation as a separate step. +/// +interface DWRITE_DECLARE_INTERFACE("727cad4e-d6af-4c9e-8a08-d695b11caa49") IDWriteFontFileLoader : public IUnknown +{ + /// + /// Creates a font file stream object that encapsulates an open file resource. + /// The resource is closed when the last reference to fontFileStream is released. + /// + /// Font file reference key that uniquely identifies the font file resource + /// within the scope of the font loader being used. + /// Size of font file reference key in bytes. + /// Pointer to the newly created font file stream. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateStreamFromKey)( + __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, + UINT32 fontFileReferenceKeySize, + __out IDWriteFontFileStream** fontFileStream + ) PURE; +}; + +/// +/// A built-in implementation of IDWriteFontFileLoader interface that operates on local font files +/// and exposes local font file information from the font file reference key. +/// Font file references created using CreateFontFileReference use this font file loader. +/// +interface DWRITE_DECLARE_INTERFACE("b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2") IDWriteLocalFontFileLoader : public IDWriteFontFileLoader +{ + /// + /// Obtains the length of the absolute file path from the font file reference key. + /// + /// Font file reference key that uniquely identifies the local font file + /// within the scope of the font loader being used. + /// Size of font file reference key in bytes. + /// Length of the file path string not including the terminated NULL character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFilePathLengthFromKey)( + __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, + UINT32 fontFileReferenceKeySize, + __out UINT32* filePathLength + ) PURE; + + /// + /// Obtains the absolute font file path from the font file reference key. + /// + /// Font file reference key that uniquely identifies the local font file + /// within the scope of the font loader being used. + /// Size of font file reference key in bytes. + /// Character array that receives the local file path. + /// Size of the filePath array in character count including the terminated NULL character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFilePathFromKey)( + __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, + UINT32 fontFileReferenceKeySize, + __out_ecount_z(filePathSize) WCHAR* filePath, + UINT32 filePathSize + ) PURE; + + /// + /// Obtains the last write time of the file from the font file reference key. + /// + /// Font file reference key that uniquely identifies the local font file + /// within the scope of the font loader being used. + /// Size of font file reference key in bytes. + /// Last modified time of the font file. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLastWriteTimeFromKey)( + __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, + UINT32 fontFileReferenceKeySize, + __out FILETIME* lastWriteTime + ) PURE; +}; + +/// +/// The interface for loading font file data. +/// +interface DWRITE_DECLARE_INTERFACE("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0") IDWriteFontFileStream : public IUnknown +{ + /// + /// Reads a fragment from a file. + /// + /// Receives the pointer to the start of the font file fragment. + /// Offset of the fragment from the beginning of the font file. + /// Size of the fragment in bytes. + /// The client defined context to be passed to the ReleaseFileFragment. + /// + /// Standard HRESULT error code. + /// + /// + /// IMPORTANT: ReadFileFragment() implementations must check whether the requested file fragment + /// is within the file bounds. Otherwise, an error should be returned from ReadFileFragment. + /// + STDMETHOD(ReadFileFragment)( + __deref_out_bcount(fragmentSize) void const** fragmentStart, + UINT64 fileOffset, + UINT64 fragmentSize, + __out void** fragmentContext + ) PURE; + + /// + /// Releases a fragment from a file. + /// + /// The client defined context of a font fragment returned from ReadFileFragment. + STDMETHOD_(void, ReleaseFileFragment)( + void* fragmentContext + ) PURE; + + /// + /// Obtains the total size of a file. + /// + /// Receives the total size of the file. + /// + /// Standard HRESULT error code. + /// + /// + /// Implementing GetFileSize() for asynchronously loaded font files may require + /// downloading the complete file contents, therefore this method should only be used for operations that + /// either require complete font file to be loaded (e.g., copying a font file) or need to make + /// decisions based on the value of the file size (e.g., validation against a persisted file size). + /// + STDMETHOD(GetFileSize)( + __out UINT64* fileSize + ) PURE; + + /// + /// Obtains the last modified time of the file. The last modified time is used by DirectWrite font selection algorithms + /// to determine whether one font resource is more up to date than another one. + /// + /// Receives the last modifed time of the file in the format that represents + /// the number of 100-nanosecond intervals since January 1, 1601 (UTC). + /// + /// Standard HRESULT error code. For resources that don't have a concept of the last modified time, the implementation of + /// GetLastWriteTime should return E_NOTIMPL. + /// + STDMETHOD(GetLastWriteTime)( + __out UINT64* lastWriteTime + ) PURE; +}; + +/// +/// The interface that represents a reference to a font file. +/// +interface DWRITE_DECLARE_INTERFACE("739d886a-cef5-47dc-8769-1a8b41bebbb0") IDWriteFontFile : public IUnknown +{ + /// + /// This method obtains the pointer to the reference key of a font file. The pointer is only valid until the object that refers to it is released. + /// + /// Pointer to the font file reference key. + /// IMPORTANT: The pointer value is valid until the font file reference object it is obtained from is released. + /// Size of font file reference key in bytes. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetReferenceKey)( + __deref_out_bcount(*fontFileReferenceKeySize) void const** fontFileReferenceKey, + __out UINT32* fontFileReferenceKeySize + ) PURE; + + /// + /// Obtains the file loader associated with a font file object. + /// + /// The font file loader associated with the font file object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLoader)( + __out IDWriteFontFileLoader** fontFileLoader + ) PURE; + + /// + /// Analyzes a file and returns whether it represents a font, and whether the font type is supported by the font system. + /// + /// TRUE if the font type is supported by the font system, FALSE otherwise. + /// The type of the font file. Note that even if isSupportedFontType is FALSE, + /// the fontFileType value may be different from DWRITE_FONT_FILE_TYPE_UNKNOWN. + /// The type of the font face that can be constructed from the font file. + /// Note that even if isSupportedFontType is FALSE, the fontFaceType value may be different from + /// DWRITE_FONT_FACE_TYPE_UNKNOWN. + /// Number of font faces contained in the font file. + /// + /// Standard HRESULT error code if there was a processing error during analysis. + /// + /// + /// IMPORTANT: certain font file types are recognized, but not supported by the font system. + /// For example, the font system will recognize a file as a Type 1 font file, + /// but will not be able to construct a font face object from it. In such situations, Analyze will set + /// isSupportedFontType output parameter to FALSE. + /// + STDMETHOD(Analyze)( + __out BOOL* isSupportedFontType, + __out DWRITE_FONT_FILE_TYPE* fontFileType, + __out_opt DWRITE_FONT_FACE_TYPE* fontFaceType, + __out UINT32* numberOfFaces + ) PURE; +}; + +/// +/// Represents the internal structure of a device pixel (i.e., the physical arrangement of red, +/// green, and blue color components) that is assumed for purposes of rendering text. +/// +#ifndef DWRITE_PIXEL_GEOMETRY_DEFINED +enum DWRITE_PIXEL_GEOMETRY +{ + /// + /// The red, green, and blue color components of each pixel are assumed to occupy the same point. + /// + DWRITE_PIXEL_GEOMETRY_FLAT, + + /// + /// Each pixel comprises three vertical stripes, with red on the left, green in the center, and + /// blue on the right. This is the most common pixel geometry for LCD monitors. + /// + DWRITE_PIXEL_GEOMETRY_RGB, + + /// + /// Each pixel comprises three vertical stripes, with blue on the left, green in the center, and + /// red on the right. + /// + DWRITE_PIXEL_GEOMETRY_BGR +}; +#define DWRITE_PIXEL_GEOMETRY_DEFINED +#endif + +/// +/// Represents a method of rendering glyphs. +/// +enum DWRITE_RENDERING_MODE +{ + /// + /// Specifies that the rendering mode is determined automatically based on the font and size. + /// + DWRITE_RENDERING_MODE_DEFAULT, + + /// + /// Specifies that no anti-aliasing is performed. Each pixel is either set to the foreground + /// color of the text or retains the color of the background. + /// + DWRITE_RENDERING_MODE_ALIASED, + + /// + /// Specifies ClearType rendering with the same metrics as aliased text. Glyphs can only + /// be positioned on whole-pixel boundaries. + /// + DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC, + + /// + /// Specifies ClearType rendering with the same metrics as text rendering using GDI using a font + /// created with CLEARTYPE_NATURAL_QUALITY. Glyph metrics are closer to their ideal values than + /// with aliased text, but glyphs are still positioned on whole-pixel boundaries. + /// + DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL, + + /// + /// Specifies ClearType rendering with anti-aliasing in the horizontal dimension only. This is + /// typically used with small to medium font sizes (up to 16 ppem). + /// + DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL, + + /// + /// Specifies ClearType rendering with anti-aliasing in both horizontal and vertical dimensions. + /// This is typically used at larger sizes to makes curves and diagonal lines look smoother, at + /// the expense of some softness. + /// + DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC, + + /// + /// Specifies that rendering should bypass the rasterizer and use the outlines directly. This is + /// typically used at very large sizes. + /// + DWRITE_RENDERING_MODE_OUTLINE +}; + +/// +/// The DWRITE_MATRIX structure specifies the graphics transform to be applied +/// to rendered glyphs. +/// +struct DWRITE_MATRIX +{ + /// + /// Horizontal scaling / cosine of rotation + /// + FLOAT m11; + + /// + /// Vertical shear / sine of rotation + /// + FLOAT m12; + + /// + /// Horizontal shear / negative sine of rotation + /// + FLOAT m21; + + /// + /// Vertical scaling / cosine of rotation + /// + FLOAT m22; + + /// + /// Horizontal shift (always orthogonal regardless of rotation) + /// + FLOAT dx; + + /// + /// Vertical shift (always orthogonal regardless of rotation) + /// + FLOAT dy; +}; + +/// +/// The interface that represents text rendering settings for glyph rasterization and filtering. +/// +interface DWRITE_DECLARE_INTERFACE("2f0da53a-2add-47cd-82ee-d9ec34688e75") IDWriteRenderingParams : public IUnknown +{ + /// + /// Gets the gamma value used for gamma correction. Valid values must be + /// greater than zero and cannot exceed 256. + /// + STDMETHOD_(FLOAT, GetGamma)() PURE; + + /// + /// Gets the amount of contrast enhancement. Valid values are greater than + /// or equal to zero. + /// + STDMETHOD_(FLOAT, GetEnhancedContrast)() PURE; + + /// + /// Gets the ClearType level. Valid values range from 0.0f (no ClearType) + /// to 1.0f (full ClearType). + /// + STDMETHOD_(FLOAT, GetClearTypeLevel)() PURE; + + /// + /// Gets the pixel geometry. + /// + STDMETHOD_(DWRITE_PIXEL_GEOMETRY, GetPixelGeometry)() PURE; + + /// + /// Gets the rendering mode. + /// + STDMETHOD_(DWRITE_RENDERING_MODE, GetRenderingMode)() PURE; +}; + +// Forward declarations of D2D types +interface ID2D1SimplifiedGeometrySink; + +typedef ID2D1SimplifiedGeometrySink IDWriteGeometrySink; + +/// +/// The interface that represents an absolute reference to a font face. +/// It contains font face type, appropriate file references and face identification data. +/// Various font data such as metrics, names and glyph outlines is obtained from IDWriteFontFace. +/// +interface DWRITE_DECLARE_INTERFACE("5f49804d-7024-4d43-bfa9-d25984f53849") IDWriteFontFace : public IUnknown +{ + /// + /// Obtains the file format type of a font face. + /// + STDMETHOD_(DWRITE_FONT_FACE_TYPE, GetType)() PURE; + + /// + /// Obtains the font files representing a font face. + /// + /// The number of files representing the font face. + /// User provided array that stores pointers to font files representing the font face. + /// This parameter can be NULL if the user is only interested in the number of files representing the font face. + /// This API increments reference count of the font file pointers returned according to COM conventions, and the client + /// should release them when finished. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFiles)( + __inout UINT32* numberOfFiles, + __out_ecount_opt(*numberOfFiles) IDWriteFontFile** fontFiles + ) PURE; + + /// + /// Obtains the zero-based index of the font face in its font file or files. If the font files contain a single face, + /// the return value is zero. + /// + STDMETHOD_(UINT32, GetIndex)() PURE; + + /// + /// Obtains the algorithmic style simulation flags of a font face. + /// + STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE; + + /// + /// Determines whether the font is a symbol font. + /// + STDMETHOD_(BOOL, IsSymbolFont)() PURE; + + /// + /// Obtains design units and common metrics for the font face. + /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations. + /// + /// Points to a DWRITE_FONT_METRICS structure to fill in. + /// The metrics returned by this function are in font design units. + STDMETHOD_(void, GetMetrics)( + __out DWRITE_FONT_METRICS* fontFaceMetrics + ) PURE; + + /// + /// Obtains the number of glyphs in the font face. + /// + STDMETHOD_(UINT16, GetGlyphCount)() PURE; + + /// + /// Obtains ideal glyph metrics in font design units. Design glyphs metrics are used for glyph positioning. + /// + /// An array of glyph indices to compute the metrics for. + /// The number of elements in the glyphIndices array. + /// Array of DWRITE_GLYPH_METRICS structures filled by this function. + /// The metrics returned by this function are in font design units. + /// Indicates whether the font is being used in a sideways run. + /// This can affect the glyph metrics if the font has oblique simulation + /// because sideways oblique simulation differs from non-sideways oblique simulation. + /// + /// Standard HRESULT error code. If any of the input glyph indices are outside of the valid glyph index range + /// for the current font face, E_INVALIDARG will be returned. + /// + STDMETHOD(GetDesignGlyphMetrics)( + __in_ecount(glyphCount) UINT16 const* glyphIndices, + UINT32 glyphCount, + __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics, + BOOL isSideways = FALSE + ) PURE; + + /// + /// Returns the nominal mapping of UCS4 Unicode code points to glyph indices as defined by the font 'CMAP' table. + /// Note that this mapping is primarily provided for line layout engines built on top of the physical font API. + /// Because of OpenType glyph substitution and line layout character substitution, the nominal conversion does not always correspond + /// to how a Unicode string will map to glyph indices when rendering using a particular font face. + /// Also, note that Unicode Variant Selectors provide for alternate mappings for character to glyph. + /// This call will always return the default variant. + /// + /// An array of USC4 code points to obtain nominal glyph indices from. + /// The number of elements in the codePoints array. + /// Array of nominal glyph indices filled by this function. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetGlyphIndices)( + __in_ecount(codePointCount) UINT32 const* codePoints, + UINT32 codePointCount, + __out_ecount(codePointCount) UINT16* glyphIndices + ) PURE; + + /// + /// Finds the specified OpenType font table if it exists and returns a pointer to it. + /// The function accesses the underling font data via the IDWriteFontStream interface + /// implemented by the font file loader. + /// + /// Four character tag of table to find. + /// Use the DWRITE_MAKE_OPENTYPE_TAG() macro to create it. + /// Unlike GDI, it does not support the special TTCF and null tags to access the whole font. + /// + /// Pointer to base of table in memory. + /// The pointer is only valid so long as the FontFace used to get the font table still exists + /// (not any other FontFace, even if it actually refers to the same physical font). + /// + /// Byte size of table. + /// + /// Opaque context which must be freed by calling ReleaseFontTable. + /// The context actually comes from the lower level IDWriteFontFileStream, + /// which may be implemented by the application or DWrite itself. + /// It is possible for a NULL tableContext to be returned, especially if + /// the implementation directly memory maps the whole file. + /// Nevertheless, always release it later, and do not use it as a test for function success. + /// The same table can be queried multiple times, + /// but each returned context can be different, so release each separately. + /// + /// True if table exists. + /// + /// Standard HRESULT error code. + /// If a table can not be found, the function will not return an error, but the size will be 0, table NULL, and exists = FALSE. + /// The context does not need to be freed if the table was not found. + /// + /// + /// The context for the same tag may be different for each call, + /// so each one must be held and released separately. + /// + STDMETHOD(TryGetFontTable)( + __in UINT32 openTypeTableTag, + __deref_out_bcount(*tableSize) const void** tableData, + __out UINT32* tableSize, + __out void** tableContext, + __out BOOL* exists + ) PURE; + + /// + /// Releases the table obtained earlier from TryGetFontTable. + /// + /// Opaque context from TryGetFontTable. + /// + /// Standard HRESULT error code. + /// + STDMETHOD_(void, ReleaseFontTable)( + __in void* tableContext + ) PURE; + + /// + /// Computes the outline of a run of glyphs by calling back to the outline sink interface. + /// + /// Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch. + /// Array of glyph indices. + /// Optional array of glyph advances in DIPs. + /// Optional array of glyph offsets. + /// Number of glyphs. + /// If true, specifies that glyphs are rotated 90 degrees to the left and vertical metrics are used. + /// A client can render a vertical run by specifying isSideways = true and rotating the resulting geometry 90 degrees to the + /// right using a transform. The isSideways and isRightToLeft parameters cannot both be true. + /// If true, specifies that the advance direction is right to left. By default, the advance direction + /// is left to right. + /// Interface the function calls back to draw each element of the geometry. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetGlyphRunOutline)( + FLOAT emSize, + __in_ecount(glyphCount) UINT16 const* glyphIndices, + __in_ecount_opt(glyphCount) FLOAT const* glyphAdvances, + __in_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets, + UINT32 glyphCount, + BOOL isSideways, + BOOL isRightToLeft, + IDWriteGeometrySink* geometrySink + ) PURE; + + /// + /// Determines the recommended rendering mode for the font given the specified size and rendering parameters. + /// + /// Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch. + /// Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this + /// value is 1.0f. If the DPI is 120, this value is 120.0f/96. + /// Specifies measuring method that will be used for glyphs in the font. + /// Renderer implementations may choose different rendering modes for given measuring methods, but + /// best results are seen when the corresponding modes match: + /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL + /// + /// Rendering parameters object. This parameter is necessary in case the rendering parameters + /// object overrides the rendering mode. + /// Receives the recommended rendering mode to use. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetRecommendedRenderingMode)( + FLOAT emSize, + FLOAT pixelsPerDip, + DWRITE_MEASURING_MODE measuringMode, + IDWriteRenderingParams* renderingParams, + __out DWRITE_RENDERING_MODE* renderingMode + ) PURE; + + /// + /// Obtains design units and common metrics for the font face. + /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations. + /// + /// Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch. + /// Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this + /// value is 1.0f. If the DPI is 120, this value is 120.0f/96. + /// Optional transform applied to the glyphs and their positions. This transform is applied after the + /// scaling specified by the font size and pixelsPerDip. + /// Points to a DWRITE_FONT_METRICS structure to fill in. + /// The metrics returned by this function are in font design units. + STDMETHOD(GetGdiCompatibleMetrics)( + FLOAT emSize, + FLOAT pixelsPerDip, + __in_opt DWRITE_MATRIX const* transform, + __out DWRITE_FONT_METRICS* fontFaceMetrics + ) PURE; + + + /// + /// Obtains glyph metrics in font design units with the return values compatible with what GDI would produce. + /// Glyphs metrics are used for positioning of individual glyphs. + /// + /// Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch. + /// Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this + /// value is 1.0f. If the DPI is 120, this value is 120.0f/96. + /// Optional transform applied to the glyphs and their positions. This transform is applied after the + /// scaling specified by the font size and pixelsPerDip. + /// + /// When set to FALSE, the metrics are the same as the metrics of GDI aliased text. + /// When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font + /// created with CLEARTYPE_NATURAL_QUALITY. + /// + /// An array of glyph indices to compute the metrics for. + /// The number of elements in the glyphIndices array. + /// Array of DWRITE_GLYPH_METRICS structures filled by this function. + /// The metrics returned by this function are in font design units. + /// Indicates whether the font is being used in a sideways run. + /// This can affect the glyph metrics if the font has oblique simulation + /// because sideways oblique simulation differs from non-sideways oblique simulation. + /// + /// Standard HRESULT error code. If any of the input glyph indices are outside of the valid glyph index range + /// for the current font face, E_INVALIDARG will be returned. + /// + STDMETHOD(GetGdiCompatibleGlyphMetrics)( + FLOAT emSize, + FLOAT pixelsPerDip, + __in_opt DWRITE_MATRIX const* transform, + BOOL useGdiNatural, + __in_ecount(glyphCount) UINT16 const* glyphIndices, + UINT32 glyphCount, + __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics, + BOOL isSideways = FALSE + ) PURE; +}; + +interface IDWriteFactory; +interface IDWriteFontFileEnumerator; + +/// +/// The font collection loader interface is used to construct a collection of fonts given a particular type of key. +/// The font collection loader interface is recommended to be implemented by a singleton object. +/// IMPORTANT: font collection loader implementations must not register themselves with a DirectWrite factory +/// inside their constructors and must not unregister themselves in their destructors, because +/// registration and unregistraton operations increment and decrement the object reference count respectively. +/// Instead, registration and unregistration of font file loaders with DirectWrite factory should be performed +/// outside of the font file loader implementation as a separate step. +/// +interface DWRITE_DECLARE_INTERFACE("cca920e4-52f0-492b-bfa8-29c72ee0a468") IDWriteFontCollectionLoader : public IUnknown +{ + /// + /// Creates a font file enumerator object that encapsulates a collection of font files. + /// The font system calls back to this interface to create a font collection. + /// + /// Factory associated with the loader. + /// Font collection key that uniquely identifies the collection of font files within + /// the scope of the font collection loader being used. + /// Size of the font collection key in bytes. + /// Pointer to the newly created font file enumerator. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateEnumeratorFromKey)( + IDWriteFactory* factory, + __in_bcount(collectionKeySize) void const* collectionKey, + UINT32 collectionKeySize, + __out IDWriteFontFileEnumerator** fontFileEnumerator + ) PURE; +}; + +/// +/// The font file enumerator interface encapsulates a collection of font files. The font system uses this interface +/// to enumerate font files when building a font collection. +/// +interface DWRITE_DECLARE_INTERFACE("72755049-5ff7-435d-8348-4be97cfa6c7c") IDWriteFontFileEnumerator : public IUnknown +{ + /// + /// Advances to the next font file in the collection. When it is first created, the enumerator is positioned + /// before the first element of the collection and the first call to MoveNext advances to the first file. + /// + /// Receives the value TRUE if the enumerator advances to a file, or FALSE if + /// the enumerator advanced past the last file in the collection. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(MoveNext)( + __out BOOL* hasCurrentFile + ) PURE; + + /// + /// Gets a reference to the current font file. + /// + /// Pointer to the newly created font file object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetCurrentFontFile)( + __out IDWriteFontFile** fontFile + ) PURE; +}; + +/// +/// Represents a collection of strings indexed by locale name. +/// +interface DWRITE_DECLARE_INTERFACE("08256209-099a-4b34-b86d-c22b110e7771") IDWriteLocalizedStrings : public IUnknown +{ + /// + /// Gets the number of language/string pairs. + /// + STDMETHOD_(UINT32, GetCount)() PURE; + + /// + /// Gets the index of the item with the specified locale name. + /// + /// Locale name to look for. + /// Receives the zero-based index of the locale name/string pair. + /// Receives TRUE if the locale name exists or FALSE if not. + /// + /// Standard HRESULT error code. If the specified locale name does not exist, the return value is S_OK, + /// but *index is UINT_MAX and *exists is FALSE. + /// + STDMETHOD(FindLocaleName)( + __in_z WCHAR const* localeName, + __out UINT32* index, + __out BOOL* exists + ) PURE; + + /// + /// Gets the length in characters (not including the null terminator) of the locale name with the specified index. + /// + /// Zero-based index of the locale name. + /// Receives the length in characters, not including the null terminator. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLocaleNameLength)( + UINT32 index, + __out UINT32* length + ) PURE; + + /// + /// Copies the locale name with the specified index to the specified array. + /// + /// Zero-based index of the locale name. + /// Character array that receives the locale name. + /// Size of the array in characters. The size must include space for the terminating + /// null character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLocaleName)( + UINT32 index, + __out_ecount_z(size) WCHAR* localeName, + UINT32 size + ) PURE; + + /// + /// Gets the length in characters (not including the null terminator) of the string with the specified index. + /// + /// Zero-based index of the string. + /// Receives the length in characters, not including the null terminator. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetStringLength)( + UINT32 index, + __out UINT32* length + ) PURE; + + /// + /// Copies the string with the specified index to the specified array. + /// + /// Zero-based index of the string. + /// Character array that receives the string. + /// Size of the array in characters. The size must include space for the terminating + /// null character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetString)( + UINT32 index, + __out_ecount_z(size) WCHAR* stringBuffer, + UINT32 size + ) PURE; +}; + +interface IDWriteFontFamily; +interface IDWriteFont; + +/// +/// The IDWriteFontCollection encapsulates a collection of fonts. +/// +interface DWRITE_DECLARE_INTERFACE("a84cee02-3eea-4eee-a827-87c1a02a0fcc") IDWriteFontCollection : public IUnknown +{ + /// + /// Gets the number of font families in the collection. + /// + STDMETHOD_(UINT32, GetFontFamilyCount)() PURE; + + /// + /// Creates a font family object given a zero-based font family index. + /// + /// Zero-based index of the font family. + /// Receives a pointer the newly created font family object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFamily)( + UINT32 index, + __out IDWriteFontFamily** fontFamily + ) PURE; + + /// + /// Finds the font family with the specified family name. + /// + /// Name of the font family. The name is not case-sensitive but must otherwise exactly match a family name in the collection. + /// Receives the zero-based index of the matching font family if the family name was found or UINT_MAX otherwise. + /// Receives TRUE if the family name exists or FALSE otherwise. + /// + /// Standard HRESULT error code. If the specified family name does not exist, the return value is S_OK, but *index is UINT_MAX and *exists is FALSE. + /// + STDMETHOD(FindFamilyName)( + __in_z WCHAR const* familyName, + __out UINT32* index, + __out BOOL* exists + ) PURE; + + /// + /// Gets the font object that corresponds to the same physical font as the specified font face object. The specified physical font must belong + /// to the font collection. + /// + /// Font face object that specifies the physical font. + /// Receives a pointer to the newly created font object if successful or NULL otherwise. + /// + /// Standard HRESULT error code. If the specified physical font is not part of the font collection the return value is DWRITE_E_NOFONT. + /// + STDMETHOD(GetFontFromFontFace)( + IDWriteFontFace* fontFace, + __out IDWriteFont** font + ) PURE; +}; + +/// +/// The IDWriteFontList interface represents a list of fonts. +/// +interface DWRITE_DECLARE_INTERFACE("1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb") IDWriteFontList : public IUnknown +{ + /// + /// Gets the font collection that contains the fonts. + /// + /// Receives a pointer to the font collection object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontCollection)( + __out IDWriteFontCollection** fontCollection + ) PURE; + + /// + /// Gets the number of fonts in the font list. + /// + STDMETHOD_(UINT32, GetFontCount)() PURE; + + /// + /// Gets a font given its zero-based index. + /// + /// Zero-based index of the font in the font list. + /// Receives a pointer to the newly created font object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFont)( + UINT32 index, + __out IDWriteFont** font + ) PURE; +}; + +/// +/// The IDWriteFontFamily interface represents a set of fonts that share the same design but are differentiated +/// by weight, stretch, and style. +/// +interface DWRITE_DECLARE_INTERFACE("da20d8ef-812a-4c43-9802-62ec4abd7add") IDWriteFontFamily : public IDWriteFontList +{ + /// + /// Creates an localized strings object that contains the family names for the font family, indexed by locale name. + /// + /// Receives a pointer to the newly created localized strings object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFamilyNames)( + __out IDWriteLocalizedStrings** names + ) PURE; + + /// + /// Gets the font that best matches the specified properties. + /// + /// Requested font weight. + /// Requested font stretch. + /// Requested font style. + /// Receives a pointer to the newly created font object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFirstMatchingFont)( + DWRITE_FONT_WEIGHT weight, + DWRITE_FONT_STRETCH stretch, + DWRITE_FONT_STYLE style, + __out IDWriteFont** matchingFont + ) PURE; + + /// + /// Gets a list of fonts in the font family ranked in order of how well they match the specified properties. + /// + /// Requested font weight. + /// Requested font stretch. + /// Requested font style. + /// Receives a pointer to the newly created font list object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetMatchingFonts)( + DWRITE_FONT_WEIGHT weight, + DWRITE_FONT_STRETCH stretch, + DWRITE_FONT_STYLE style, + __out IDWriteFontList** matchingFonts + ) PURE; +}; + +/// +/// The IDWriteFont interface represents a physical font in a font collection. +/// +interface DWRITE_DECLARE_INTERFACE("acd16696-8c14-4f5d-877e-fe3fc1d32737") IDWriteFont : public IUnknown +{ + /// + /// Gets the font family to which the specified font belongs. + /// + /// Receives a pointer to the font family object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFamily)( + __out IDWriteFontFamily** fontFamily + ) PURE; + + /// + /// Gets the weight of the specified font. + /// + STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)() PURE; + + /// + /// Gets the stretch (aka. width) of the specified font. + /// + STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)() PURE; + + /// + /// Gets the style (aka. slope) of the specified font. + /// + STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)() PURE; + + /// + /// Returns TRUE if the font is a symbol font or FALSE if not. + /// + STDMETHOD_(BOOL, IsSymbolFont)() PURE; + + /// + /// Gets a localized strings collection containing the face names for the font (e.g., Regular or Bold), indexed by locale name. + /// + /// Receives a pointer to the newly created localized strings object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFaceNames)( + __out IDWriteLocalizedStrings** names + ) PURE; + + /// + /// Gets a localized strings collection containing the specified informational strings, indexed by locale name. + /// + /// Identifies the string to get. + /// Receives a pointer to the newly created localized strings object. + /// Receives the value TRUE if the font contains the specified string ID or FALSE if not. + /// + /// Standard HRESULT error code. If the font does not contain the specified string, the return value is S_OK but + /// informationalStrings receives a NULL pointer and exists receives the value FALSE. + /// + STDMETHOD(GetInformationalStrings)( + DWRITE_INFORMATIONAL_STRING_ID informationalStringID, + __out IDWriteLocalizedStrings** informationalStrings, + __out BOOL* exists + ) PURE; + + /// + /// Gets a value that indicates what simulation are applied to the specified font. + /// + STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE; + + /// + /// Gets the metrics for the font. + /// + /// Receives the font metrics. + STDMETHOD_(void, GetMetrics)( + __out DWRITE_FONT_METRICS* fontMetrics + ) PURE; + + /// + /// Determines whether the font supports the specified character. + /// + /// Unicode (UCS-4) character value. + /// Receives the value TRUE if the font supports the specified character or FALSE if not. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(HasCharacter)( + UINT32 unicodeValue, + __out BOOL* exists + ) PURE; + + /// + /// Creates a font face object for the font. + /// + /// Receives a pointer to the newly created font face object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateFontFace)( + __out IDWriteFontFace** fontFace + ) PURE; +}; + +/// +/// Direction for how reading progresses. +/// +enum DWRITE_READING_DIRECTION +{ + /// + /// Reading progresses from left to right. + /// + DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, + + /// + /// Reading progresses from right to left. + /// + DWRITE_READING_DIRECTION_RIGHT_TO_LEFT +}; + +/// +/// Direction for how lines of text are placed relative to one another. +/// +enum DWRITE_FLOW_DIRECTION +{ + /// + /// Text lines are placed from top to bottom. + /// + DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM +}; + +/// +/// Alignment of paragraph text along the reading direction axis relative to +/// the leading and trailing edge of the layout box. +/// +enum DWRITE_TEXT_ALIGNMENT +{ + /// + /// The leading edge of the paragraph text is aligned to the layout box's leading edge. + /// + DWRITE_TEXT_ALIGNMENT_LEADING, + + /// + /// The trailing edge of the paragraph text is aligned to the layout box's trailing edge. + /// + DWRITE_TEXT_ALIGNMENT_TRAILING, + + /// + /// The center of the paragraph text is aligned to the center of the layout box. + /// + DWRITE_TEXT_ALIGNMENT_CENTER +}; + +/// +/// Alignment of paragraph text along the flow direction axis relative to the +/// flow's beginning and ending edge of the layout box. +/// +enum DWRITE_PARAGRAPH_ALIGNMENT +{ + /// + /// The first line of paragraph is aligned to the flow's beginning edge of the layout box. + /// + DWRITE_PARAGRAPH_ALIGNMENT_NEAR, + + /// + /// The last line of paragraph is aligned to the flow's ending edge of the layout box. + /// + DWRITE_PARAGRAPH_ALIGNMENT_FAR, + + /// + /// The center of the paragraph is aligned to the center of the flow of the layout box. + /// + DWRITE_PARAGRAPH_ALIGNMENT_CENTER +}; + +/// +/// Word wrapping in multiline paragraph. +/// +enum DWRITE_WORD_WRAPPING +{ + /// + /// Words are broken across lines to avoid text overflowing the layout box. + /// + DWRITE_WORD_WRAPPING_WRAP, + + /// + /// Words are kept within the same line even when it overflows the layout box. + /// This option is often used with scrolling to reveal overflow text. + /// + DWRITE_WORD_WRAPPING_NO_WRAP +}; + +/// +/// The method used for line spacing in layout. +/// +enum DWRITE_LINE_SPACING_METHOD +{ + /// + /// Line spacing depends solely on the content, growing to accomodate the size of fonts and inline objects. + /// + DWRITE_LINE_SPACING_METHOD_DEFAULT, + + /// + /// Lines are explicitly set to uniform spacing, regardless of contained font sizes. + /// This can be useful to avoid the uneven appearance that can occur from font fallback. + /// + DWRITE_LINE_SPACING_METHOD_UNIFORM +}; + +/// +/// Text granularity used to trim text overflowing the layout box. +/// +enum DWRITE_TRIMMING_GRANULARITY +{ + /// + /// No trimming occurs. Text flows beyond the layout width. + /// + DWRITE_TRIMMING_GRANULARITY_NONE, + + /// + /// Trimming occurs at character cluster boundary. + /// + DWRITE_TRIMMING_GRANULARITY_CHARACTER, + + /// + /// Trimming occurs at word boundary. + /// + DWRITE_TRIMMING_GRANULARITY_WORD +}; + +/// +/// Typographic feature of text supplied by the font. +/// +enum DWRITE_FONT_FEATURE_TAG +{ + DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS = 0x63726661, // 'afrc' + DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS = 0x63703263, // 'c2pc' + DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS = 0x63733263, // 'c2sc' + DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES = 0x746c6163, // 'calt' + DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS = 0x65736163, // 'case' + DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION = 0x706d6363, // 'ccmp' + DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES = 0x67696c63, // 'clig' + DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING = 0x70737063, // 'cpsp' + DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH = 0x68777363, // 'cswh' + DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING = 0x73727563, // 'curs' + DWRITE_FONT_FEATURE_TAG_DEFAULT = 0x746c6664, // 'dflt' + DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES = 0x67696c64, // 'dlig' + DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS = 0x74707865, // 'expt' + DWRITE_FONT_FEATURE_TAG_FRACTIONS = 0x63617266, // 'frac' + DWRITE_FONT_FEATURE_TAG_FULL_WIDTH = 0x64697766, // 'fwid' + DWRITE_FONT_FEATURE_TAG_HALF_FORMS = 0x666c6168, // 'half' + DWRITE_FONT_FEATURE_TAG_HALANT_FORMS = 0x6e6c6168, // 'haln' + DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH = 0x746c6168, // 'halt' + DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS = 0x74736968, // 'hist' + DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES = 0x616e6b68, // 'hkna' + DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES = 0x67696c68, // 'hlig' + DWRITE_FONT_FEATURE_TAG_HALF_WIDTH = 0x64697768, // 'hwid' + DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS = 0x6f6a6f68, // 'hojo' + DWRITE_FONT_FEATURE_TAG_JIS04_FORMS = 0x3430706a, // 'jp04' + DWRITE_FONT_FEATURE_TAG_JIS78_FORMS = 0x3837706a, // 'jp78' + DWRITE_FONT_FEATURE_TAG_JIS83_FORMS = 0x3338706a, // 'jp83' + DWRITE_FONT_FEATURE_TAG_JIS90_FORMS = 0x3039706a, // 'jp90' + DWRITE_FONT_FEATURE_TAG_KERNING = 0x6e72656b, // 'kern' + DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES = 0x6167696c, // 'liga' + DWRITE_FONT_FEATURE_TAG_LINING_FIGURES = 0x6d756e6c, // 'lnum' + DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS = 0x6c636f6c, // 'locl' + DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING = 0x6b72616d, // 'mark' + DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK = 0x6b72676d, // 'mgrk' + DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING = 0x6b6d6b6d, // 'mkmk' + DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS = 0x746c616e, // 'nalt' + DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS = 0x6b636c6e, // 'nlck' + DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES = 0x6d756e6f, // 'onum' + DWRITE_FONT_FEATURE_TAG_ORDINALS = 0x6e64726f, // 'ordn' + DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH = 0x746c6170, // 'palt' + DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS = 0x70616370, // 'pcap' + DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES = 0x6d756e70, // 'pnum' + DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS = 0x64697770, // 'pwid' + DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS = 0x64697771, // 'qwid' + DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES = 0x67696c72, // 'rlig' + DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS = 0x79627572, // 'ruby' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES = 0x746c6173, // 'salt' + DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS = 0x666e6973, // 'sinf' + DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS = 0x70636d73, // 'smcp' + DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS = 0x6c706d73, // 'smpl' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1 = 0x31307373, // 'ss01' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2 = 0x32307373, // 'ss02' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3 = 0x33307373, // 'ss03' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4 = 0x34307373, // 'ss04' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5 = 0x35307373, // 'ss05' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6 = 0x36307373, // 'ss06' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7 = 0x37307373, // 'ss07' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8 = 0x38307373, // 'ss08' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9 = 0x39307373, // 'ss09' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10 = 0x30317373, // 'ss10' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11 = 0x31317373, // 'ss11' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12 = 0x32317373, // 'ss12' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13 = 0x33317373, // 'ss13' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14 = 0x34317373, // 'ss14' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15 = 0x35317373, // 'ss15' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16 = 0x36317373, // 'ss16' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17 = 0x37317373, // 'ss17' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18 = 0x38317373, // 'ss18' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19 = 0x39317373, // 'ss19' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = 0x30327373, // 'ss20' + DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = 0x73627573, // 'subs' + DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = 0x73707573, // 'sups' + DWRITE_FONT_FEATURE_TAG_SWASH = 0x68737773, // 'swsh' + DWRITE_FONT_FEATURE_TAG_TITLING = 0x6c746974, // 'titl' + DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = 0x6d616e74, // 'tnam' + DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = 0x6d756e74, // 'tnum' + DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = 0x64617274, // 'trad' + DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = 0x64697774, // 'twid' + DWRITE_FONT_FEATURE_TAG_UNICASE = 0x63696e75, // 'unic' + DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = 0x6f72657a, // 'zero' +}; + +/// +/// The DWRITE_TEXT_RANGE structure specifies a range of text positions where format is applied. +/// +struct DWRITE_TEXT_RANGE +{ + /// + /// The start text position of the range. + /// + UINT32 startPosition; + + /// + /// The number of text positions in the range. + /// + UINT32 length; +}; + +/// +/// The DWRITE_FONT_FEATURE structure specifies properties used to identify and execute typographic feature in the font. +/// +struct DWRITE_FONT_FEATURE +{ + /// + /// The feature OpenType name identifier. + /// + DWRITE_FONT_FEATURE_TAG nameTag; + + /// + /// Execution parameter of the feature. + /// + /// + /// The parameter should be non-zero to enable the feature. Once enabled, a feature can't be disabled again within + /// the same range. Features requiring a selector use this value to indicate the selector index. + /// + UINT32 parameter; +}; + +/// +/// Defines a set of typographic features to be applied during shaping. +/// Notice the character range which this feature list spans is specified +/// as a separate parameter to GetGlyphs. +/// +struct DWRITE_TYPOGRAPHIC_FEATURES +{ + /// + /// Array of font features. + /// + __field_ecount(featureCount) DWRITE_FONT_FEATURE* features; + + /// + /// The number of features. + /// + UINT32 featureCount; +}; + +/// +/// The DWRITE_TRIMMING structure specifies the trimming option for text overflowing the layout box. +/// +struct DWRITE_TRIMMING +{ + /// + /// Text granularity of which trimming applies. + /// + DWRITE_TRIMMING_GRANULARITY granularity; + + /// + /// Character code used as the delimiter signaling the beginning of the portion of text to be preserved, + /// most useful for path ellipsis, where the delimeter would be a slash. + /// + UINT32 delimiter; + + /// + /// How many occurences of the delimiter to step back. + /// + UINT32 delimiterCount; +}; + + +interface IDWriteTypography; +interface IDWriteInlineObject; + +/// +/// The format of text used for text layout purpose. +/// +/// +/// This object may not be thread-safe and it may carry the state of text format change. +/// +interface DWRITE_DECLARE_INTERFACE("9c906818-31d7-4fd3-a151-7c5e225db55a") IDWriteTextFormat : public IUnknown +{ + /// + /// Set alignment option of text relative to layout box's leading and trailing edge. + /// + /// Text alignment option + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetTextAlignment)( + DWRITE_TEXT_ALIGNMENT textAlignment + ) PURE; + + /// + /// Set alignment option of paragraph relative to layout box's top and bottom edge. + /// + /// Paragraph alignment option + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetParagraphAlignment)( + DWRITE_PARAGRAPH_ALIGNMENT paragraphAlignment + ) PURE; + + /// + /// Set word wrapping option. + /// + /// Word wrapping option + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetWordWrapping)( + DWRITE_WORD_WRAPPING wordWrapping + ) PURE; + + /// + /// Set paragraph reading direction. + /// + /// Text reading direction + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetReadingDirection)( + DWRITE_READING_DIRECTION readingDirection + ) PURE; + + /// + /// Set paragraph flow direction. + /// + /// Paragraph flow direction + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFlowDirection)( + DWRITE_FLOW_DIRECTION flowDirection + ) PURE; + + /// + /// Set incremental tab stop position. + /// + /// The incremental tab stop value + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetIncrementalTabStop)( + FLOAT incrementalTabStop + ) PURE; + + /// + /// Set trimming options for any trailing text exceeding the layout width + /// or for any far text exceeding the layout height. + /// + /// Text trimming options. + /// Application-defined omission sign. This parameter may be NULL if no trimming sign is desired. + /// + /// Any inline object can be used for the trimming sign, but CreateEllipsisTrimmingSign + /// provides a typical ellipsis symbol. Trimming is also useful vertically for hiding + /// partial lines. + /// + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetTrimming)( + __in DWRITE_TRIMMING const* trimmingOptions, + IDWriteInlineObject* trimmingSign + ) PURE; + + /// + /// Set line spacing. + /// + /// How to determine line height. + /// The line height, or rather distance between one baseline to another. + /// Distance from top of line to baseline. A reasonable ratio to lineSpacing is 80%. + /// + /// For the default method, spacing depends solely on the content. + /// For uniform spacing, the given line height will override the content. + /// + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetLineSpacing)( + DWRITE_LINE_SPACING_METHOD lineSpacingMethod, + FLOAT lineSpacing, + FLOAT baseline + ) PURE; + + /// + /// Get alignment option of text relative to layout box's leading and trailing edge. + /// + STDMETHOD_(DWRITE_TEXT_ALIGNMENT, GetTextAlignment)() PURE; + + /// + /// Get alignment option of paragraph relative to layout box's top and bottom edge. + /// + STDMETHOD_(DWRITE_PARAGRAPH_ALIGNMENT, GetParagraphAlignment)() PURE; + + /// + /// Get word wrapping option. + /// + STDMETHOD_(DWRITE_WORD_WRAPPING, GetWordWrapping)() PURE; + + /// + /// Get paragraph reading direction. + /// + STDMETHOD_(DWRITE_READING_DIRECTION, GetReadingDirection)() PURE; + + /// + /// Get paragraph flow direction. + /// + STDMETHOD_(DWRITE_FLOW_DIRECTION, GetFlowDirection)() PURE; + + /// + /// Get incremental tab stop position. + /// + STDMETHOD_(FLOAT, GetIncrementalTabStop)() PURE; + + /// + /// Get trimming options for text overflowing the layout width. + /// + /// Text trimming options. + /// Trimming omission sign. This parameter may be NULL. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetTrimming)( + __out DWRITE_TRIMMING* trimmingOptions, + __out IDWriteInlineObject** trimmingSign + ) PURE; + + /// + /// Get line spacing. + /// + /// How line height is determined. + /// The line height, or rather distance between one baseline to another. + /// Distance from top of line to baseline. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLineSpacing)( + __out DWRITE_LINE_SPACING_METHOD* lineSpacingMethod, + __out FLOAT* lineSpacing, + __out FLOAT* baseline + ) PURE; + + /// + /// Get the font collection. + /// + /// The current font collection. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontCollection)( + __out IDWriteFontCollection** fontCollection + ) PURE; + + /// + /// Get the length of the font family name, in characters, not including the terminating NULL character. + /// + STDMETHOD_(UINT32, GetFontFamilyNameLength)() PURE; + + /// + /// Get a copy of the font family name. + /// + /// Character array that receives the current font family name + /// Size of the character array in character count including the terminated NULL character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFamilyName)( + __out_ecount_z(nameSize) WCHAR* fontFamilyName, + UINT32 nameSize + ) PURE; + + /// + /// Get the font weight. + /// + STDMETHOD_(DWRITE_FONT_WEIGHT, GetFontWeight)() PURE; + + /// + /// Get the font style. + /// + STDMETHOD_(DWRITE_FONT_STYLE, GetFontStyle)() PURE; + + /// + /// Get the font stretch. + /// + STDMETHOD_(DWRITE_FONT_STRETCH, GetFontStretch)() PURE; + + /// + /// Get the font em height. + /// + STDMETHOD_(FLOAT, GetFontSize)() PURE; + + /// + /// Get the length of the locale name, in characters, not including the terminating NULL character. + /// + STDMETHOD_(UINT32, GetLocaleNameLength)() PURE; + + /// + /// Get a copy of the locale name. + /// + /// Character array that receives the current locale name + /// Size of the character array in character count including the terminated NULL character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLocaleName)( + __out_ecount_z(nameSize) WCHAR* localeName, + UINT32 nameSize + ) PURE; +}; + + +/// +/// Font typography setting. +/// +interface DWRITE_DECLARE_INTERFACE("55f1112b-1dc2-4b3c-9541-f46894ed85b6") IDWriteTypography : public IUnknown +{ + /// + /// Add font feature. + /// + /// The font feature to add. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(AddFontFeature)( + DWRITE_FONT_FEATURE fontFeature + ) PURE; + + /// + /// Get the number of font features. + /// + STDMETHOD_(UINT32, GetFontFeatureCount)() PURE; + + /// + /// Get the font feature at the specified index. + /// + /// The zero-based index of the font feature to get. + /// The font feature. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFeature)( + UINT32 fontFeatureIndex, + __out DWRITE_FONT_FEATURE* fontFeature + ) PURE; +}; + +enum DWRITE_SCRIPT_SHAPES +{ + /// + /// No additional shaping requirement. Text is shaped with the writing system default behavior. + /// + DWRITE_SCRIPT_SHAPES_DEFAULT = 0, + + /// + /// Text should leave no visual on display i.e. control or format control characters. + /// + DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1 +}; + +#ifdef DEFINE_ENUM_FLAG_OPERATORS +DEFINE_ENUM_FLAG_OPERATORS(DWRITE_SCRIPT_SHAPES); +#endif + +/// +/// Association of text and its writing system script as well as some display attributes. +/// +struct DWRITE_SCRIPT_ANALYSIS +{ + /// + /// Zero-based index representation of writing system script. + /// + UINT16 script; + + /// + /// Additional shaping requirement of text. + /// + DWRITE_SCRIPT_SHAPES shapes; +}; + +/// +/// Condition at the edges of inline object or text used to determine +/// line-breaking behavior. +/// +enum DWRITE_BREAK_CONDITION +{ + /// + /// Whether a break is allowed is determined by the condition of the + /// neighboring text span or inline object. + /// + DWRITE_BREAK_CONDITION_NEUTRAL, + + /// + /// A break is allowed, unless overruled by the condition of the + /// neighboring text span or inline object, either prohibited by a + /// May Not or forced by a Must. + /// + DWRITE_BREAK_CONDITION_CAN_BREAK, + + /// + /// There should be no break, unless overruled by a Must condition from + /// the neighboring text span or inline object. + /// + DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, + + /// + /// The break must happen, regardless of the condition of the adjacent + /// text span or inline object. + /// + DWRITE_BREAK_CONDITION_MUST_BREAK +}; + +/// +/// Line breakpoint characteristics of a character. +/// +struct DWRITE_LINE_BREAKPOINT +{ + /// + /// Breaking condition before the character. + /// + UINT8 breakConditionBefore : 2; + + /// + /// Breaking condition after the character. + /// + UINT8 breakConditionAfter : 2; + + /// + /// The character is some form of whitespace, which may be meaningful + /// for justification. + /// + UINT8 isWhitespace : 1; + + /// + /// The character is a soft hyphen, often used to indicate hyphenation + /// points inside words. + /// + UINT8 isSoftHyphen : 1; + + UINT8 padding : 2; +}; + +/// +/// How to apply number substitution on digits and related punctuation. +/// +enum DWRITE_NUMBER_SUBSTITUTION_METHOD +{ + /// + /// Specifies that the substitution method should be determined based + /// on LOCALE_IDIGITSUBSTITUTION value of the specified text culture. + /// + DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE, + + /// + /// If the culture is Arabic or Farsi, specifies that the number shape + /// depend on the context. Either traditional or nominal number shape + /// are used depending on the nearest preceding strong character or (if + /// there is none) the reading direction of the paragraph. + /// + DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL, + + /// + /// Specifies that code points 0x30-0x39 are always rendered as nominal numeral + /// shapes (ones of the European number), i.e., no substitution is performed. + /// + DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, + + /// + /// Specifies that number are rendered using the national number shape + /// as specified by the LOCALE_SNATIVEDIGITS value of the specified text culture. + /// + DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL, + + /// + /// Specifies that number are rendered using the traditional shape + /// for the specified culture. For most cultures, this is the same as + /// NativeNational. However, NativeNational results in Latin number + /// for some Arabic cultures, whereas this value results in Arabic + /// number for all Arabic cultures. + /// + DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL +}; + +/// +/// Holds the appropriate digits and numeric punctuation for a given locale. +/// +interface DECLSPEC_UUID("14885CC9-BAB0-4f90-B6ED-5C366A2CD03D") DECLSPEC_NOVTABLE IDWriteNumberSubstitution : public IUnknown +{ +}; + +/// +/// Shaping output properties per input character. +/// +struct DWRITE_SHAPING_TEXT_PROPERTIES +{ + /// + /// This character can be shaped independently from the others + /// (usually set for the space character). + /// + UINT16 isShapedAlone : 1; + + /// + /// Reserved for use by shaping engine. + /// + UINT16 reserved : 15; +}; + +/// +/// Shaping output properties per output glyph. +/// +struct DWRITE_SHAPING_GLYPH_PROPERTIES +{ + /// + /// Justification class, whether to use spacing, kashidas, or + /// another method. This exists for backwards compatibility + /// with Uniscribe's SCRIPT_JUSTIFY enum. + /// + UINT16 justification : 4; + + /// + /// Indicates glyph is the first of a cluster. + /// + UINT16 isClusterStart : 1; + + /// + /// Glyph is a diacritic. + /// + UINT16 isDiacritic : 1; + + /// + /// Glyph has no width, blank, ZWJ, ZWNJ etc. + /// + UINT16 isZeroWidthSpace : 1; + + /// + /// Reserved for use by shaping engine. + /// + UINT16 reserved : 9; +}; + +/// +/// The interface implemented by the text analyzer's client to provide text to +/// the analyzer. It allows the separation between the logical view of text as +/// a continuous stream of characters identifiable by unique text positions, +/// and the actual memory layout of potentially discrete blocks of text in the +/// client's backing store. +/// +/// If any of these callbacks returns an error, the analysis functions will +/// stop prematurely and return a callback error. Rather than return E_NOTIMPL, +/// an application should stub the method and return a constant/null and S_OK. +/// +interface DECLSPEC_UUID("688e1a58-5094-47c8-adc8-fbcea60ae92b") DECLSPEC_NOVTABLE IDWriteTextAnalysisSource : public IUnknown +{ + /// + /// Get a block of text starting at the specified text position. + /// Returning NULL indicates the end of text - the position is after + /// the last character. This function is called iteratively for + /// each consecutive block, tying together several fragmented blocks + /// in the backing store into a virtual contiguous string. + /// + /// First position of the piece to obtain. All + /// positions are in UTF16 code-units, not whole characters, which + /// matters when supplementary characters are used. + /// Address that receives a pointer to the text block + /// at the specified position. + /// Number of UTF16 units of the retrieved chunk. + /// The returned length is not the length of the block, but the length + /// remaining in the block, from the given position until its end. + /// So querying for a position that is 75 positions into a 100 + /// postition block would return 25. + /// Pointer to the first character at the given text position. + /// NULL indicates no chunk available at the specified position, either + /// because textPosition >= the entire text content length or because the + /// queried position is not mapped into the app's backing store. + /// + /// Although apps can implement sparse textual content that only maps part of + /// the backing store, the app must map any text that is in the range passed + /// to any analysis functions. + /// + STDMETHOD(GetTextAtPosition)( + UINT32 textPosition, + __out WCHAR const** textString, + __out UINT32* textLength + ) PURE; + + /// + /// Get a block of text immediately preceding the specified position. + /// + /// Position immediately after the last position of the chunk to obtain. + /// Address that receives a pointer to the text block + /// at the specified position. + /// Number of UTF16 units of the retrieved block. + /// The length returned is from the given position to the front of + /// the block. + /// Pointer to the first character at (textPosition - textLength). + /// NULL indicates no chunk available at the specified position, either + /// because textPosition == 0,the textPosition > the entire text content + /// length, or the queried position is not mapped into the app's backing + /// store. + /// + /// Although apps can implement sparse textual content that only maps part of + /// the backing store, the app must map any text that is in the range passed + /// to any analysis functions. + /// + STDMETHOD(GetTextBeforePosition)( + UINT32 textPosition, + __out WCHAR const** textString, + __out UINT32* textLength + ) PURE; + + /// + /// Get paragraph reading direction. + /// + STDMETHOD_(DWRITE_READING_DIRECTION, GetParagraphReadingDirection)() PURE; + + /// + /// Get locale name on the range affected by it. + /// + /// Position to get the locale name of. + /// Receives the length from the given position up to the + /// next differing locale. + /// Address that receives a pointer to the locale + /// at the specified position. + /// + /// The localeName pointer must remain valid until the next call or until + /// the analysis returns. + /// + STDMETHOD(GetLocaleName)( + UINT32 textPosition, + __out UINT32* textLength, + __out_z WCHAR const** localeName + ) PURE; + + /// + /// Get number substitution on the range affected by it. + /// + /// Position to get the number substitution of. + /// Receives the length from the given position up to the + /// next differing number substitution. + /// Address that receives a pointer to the number substitution + /// at the specified position. + /// + /// Any implementation should return the number substitution with an + /// incremented ref count, and the analysis will release when finished + /// with it (either before the next call or before it returns). However, + /// the sink callback may hold onto it after that. + /// + STDMETHOD(GetNumberSubstitution)( + UINT32 textPosition, + __out UINT32* textLength, + __out IDWriteNumberSubstitution** numberSubstitution + ) PURE; +}; + +/// +/// The interface implemented by the text analyzer's client to receive the +/// output of a given text analysis. The Text analyzer disregards any current +/// state of the analysis sink, therefore a Set method call on a range +/// overwrites the previously set analysis result of the same range. +/// +interface DECLSPEC_UUID("5810cd44-0ca0-4701-b3fa-bec5182ae4f6") DECLSPEC_NOVTABLE IDWriteTextAnalysisSink : public IUnknown +{ + /// + /// Report script analysis for the text range. + /// + /// Starting position to report from. + /// Number of UTF16 units of the reported range. + /// Script analysis of characters in range. + /// + /// A successful code or error code to abort analysis. + /// + STDMETHOD(SetScriptAnalysis)( + UINT32 textPosition, + UINT32 textLength, + __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis + ) PURE; + + /// + /// Repport line-break opportunities for each character, starting from + /// the specified position. + /// + /// Starting position to report from. + /// Number of UTF16 units of the reported range. + /// Breaking conditions for each character. + /// + /// A successful code or error code to abort analysis. + /// + STDMETHOD(SetLineBreakpoints)( + UINT32 textPosition, + UINT32 textLength, + __in_ecount(textLength) DWRITE_LINE_BREAKPOINT const* lineBreakpoints + ) PURE; + + /// + /// Set bidirectional level on the range, called once per each + /// level run change (either explicit or resolved implicit). + /// + /// Starting position to report from. + /// Number of UTF16 units of the reported range. + /// Explicit level from embedded control codes + /// RLE/RLO/LRE/LRO/PDF, determined before any additional rules. + /// Final implicit level considering the + /// explicit level and characters' natural directionality, after all + /// Bidi rules have been applied. + /// + /// A successful code or error code to abort analysis. + /// + STDMETHOD(SetBidiLevel)( + UINT32 textPosition, + UINT32 textLength, + UINT8 explicitLevel, + UINT8 resolvedLevel + ) PURE; + + /// + /// Set number substitution on the range. + /// + /// Starting position to report from. + /// Number of UTF16 units of the reported range. + /// The number substitution applicable to + /// the returned range of text. The sink callback may hold onto it by + /// incrementing its ref count. + /// + /// A successful code or error code to abort analysis. + /// + /// + /// Unlike script and bidi analysis, where every character passed to the + /// analyzer has a result, this will only be called for those ranges where + /// substitution is applicable. For any other range, you will simply not + /// be called. + /// + STDMETHOD(SetNumberSubstitution)( + UINT32 textPosition, + UINT32 textLength, + __notnull IDWriteNumberSubstitution* numberSubstitution + ) PURE; +}; + +/// +/// Analyzes various text properties for complex script processing. +/// +interface DWRITE_DECLARE_INTERFACE("b7e6163e-7f46-43b4-84b3-e4e6249c365d") IDWriteTextAnalyzer : public IUnknown +{ + /// + /// Analyzes a text range for script boundaries, reading text attributes + /// from the source and reporting the Unicode script ID to the sink + /// callback SetScript. + /// + /// Source object to analyze. + /// Starting position within the source object. + /// Length to analyze. + /// Callback object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(AnalyzeScript)( + IDWriteTextAnalysisSource* analysisSource, + UINT32 textPosition, + UINT32 textLength, + IDWriteTextAnalysisSink* analysisSink + ) PURE; + + /// + /// Analyzes a text range for script directionality, reading attributes + /// from the source and reporting levels to the sink callback SetBidiLevel. + /// + /// Source object to analyze. + /// Starting position within the source object. + /// Length to analyze. + /// Callback object. + /// + /// Standard HRESULT error code. + /// + /// + /// While the function can handle multiple paragraphs, the text range + /// should not arbitrarily split the middle of paragraphs. Otherwise the + /// returned levels may be wrong, since the Bidi algorithm is meant to + /// apply to the paragraph as a whole. + /// + /// + /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account. + /// + STDMETHOD(AnalyzeBidi)( + IDWriteTextAnalysisSource* analysisSource, + UINT32 textPosition, + UINT32 textLength, + IDWriteTextAnalysisSink* analysisSink + ) PURE; + + /// + /// Analyzes a text range for spans where number substitution is applicable, + /// reading attributes from the source and reporting substitutable ranges + /// to the sink callback SetNumberSubstitution. + /// + /// Source object to analyze. + /// Starting position within the source object. + /// Length to analyze. + /// Callback object. + /// + /// Standard HRESULT error code. + /// + /// + /// While the function can handle multiple ranges of differing number + /// substitutions, the text ranges should not arbitrarily split the + /// middle of numbers. Otherwise it will treat the numbers separately + /// and will not translate any intervening punctuation. + /// + /// + /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account. + /// + STDMETHOD(AnalyzeNumberSubstitution)( + IDWriteTextAnalysisSource* analysisSource, + UINT32 textPosition, + UINT32 textLength, + IDWriteTextAnalysisSink* analysisSink + ) PURE; + + /// + /// Analyzes a text range for potential breakpoint opportunities, reading + /// attributes from the source and reporting breakpoint opportunities to + /// the sink callback SetLineBreakpoints. + /// + /// Source object to analyze. + /// Starting position within the source object. + /// Length to analyze. + /// Callback object. + /// + /// Standard HRESULT error code. + /// + /// + /// While the function can handle multiple paragraphs, the text range + /// should not arbitrarily split the middle of paragraphs, unless the + /// given text span is considered a whole unit. Otherwise the + /// returned properties for the first and last characters will + /// inappropriately allow breaks. + /// + /// + /// Special cases include the first, last, and surrogate characters. Any + /// text span is treated as if adjacent to inline objects on either side. + /// So the rules with contingent-break opportunities are used, where the + /// edge between text and inline objects is always treated as a potential + /// break opportunity, dependent on any overriding rules of the adjacent + /// objects to prohibit or force the break (see Unicode TR #14). + /// Surrogate pairs never break between. + /// + STDMETHOD(AnalyzeLineBreakpoints)( + IDWriteTextAnalysisSource* analysisSource, + UINT32 textPosition, + UINT32 textLength, + IDWriteTextAnalysisSink* analysisSink + ) PURE; + + /// + /// Parses the input text string and maps it to the set of glyphs and associated glyph data + /// according to the font and the writing system's rendering rules. + /// + /// The string to convert to glyphs. + /// The length of textString. + /// The font face to get glyphs from. + /// Set to true if the text is intended to be + /// drawn vertically. + /// Set to TRUE for right-to-left text. + /// Script analysis result from AnalyzeScript. + /// The locale to use when selecting glyphs. + /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs. + /// If this is NULL then the default mapping based on the script is used. + /// Optional number substitution which + /// selects the appropriate glyphs for digits and related numeric characters, + /// depending on the results obtained from AnalyzeNumberSubstitution. Passing + /// null indicates that no substitution is needed and that the digits should + /// receive nominal glyphs. + /// An array of pointers to the sets of typographic + /// features to use in each feature range. + /// The length of each feature range, in characters. + /// The sum of all lengths should be equal to textLength. + /// The number of feature ranges. + /// The maximum number of glyphs that can be + /// returned. + /// The mapping from character ranges to glyph + /// ranges. + /// Per-character output properties. + /// Output glyph indices. + /// Per-glyph output properties. + /// The actual number of glyphs returned if + /// the call succeeds. + /// + /// Standard HRESULT error code. + /// + /// + /// Note that the mapping from characters to glyphs is, in general, many- + /// to-many. The recommended estimate for the per-glyph output buffers is + /// (3 * textLength / 2 + 16). This is not guaranteed to be sufficient. + /// + /// The value of the actualGlyphCount parameter is only valid if the call + /// succeeds. In the event that maxGlyphCount is not big enough + /// E_NOT_SUFFICIENT_BUFFER, which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), + /// will be returned. The application should allocate a larger buffer and try again. + /// + STDMETHOD(GetGlyphs)( + __in_ecount(textLength) WCHAR const* textString, + UINT32 textLength, + IDWriteFontFace* fontFace, + BOOL isSideways, + BOOL isRightToLeft, + __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis, + __in_z_opt WCHAR const* localeName, + __maybenull IDWriteNumberSubstitution* numberSubstitution, + __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features, + __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths, + UINT32 featureRanges, + UINT32 maxGlyphCount, + __out_ecount(textLength) UINT16* clusterMap, + __out_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps, + __out_ecount(maxGlyphCount) UINT16* glyphIndices, + __out_ecount(maxGlyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps, + __out UINT32* actualGlyphCount + ) PURE; + + /// + /// Place glyphs output from the GetGlyphs method according to the font + /// and the writing system's rendering rules. + /// + /// The original string the glyphs came from. + /// The mapping from character ranges to glyph + /// ranges. Returned by GetGlyphs. + /// Per-character properties. Returned by + /// GetGlyphs. + /// The length of textString. + /// Glyph indices. See GetGlyphs + /// Per-glyph properties. See GetGlyphs + /// The number of glyphs. + /// The font face the glyphs came from. + /// Logical font size in DIP's. + /// Set to true if the text is intended to be + /// drawn vertically. + /// Set to TRUE for right-to-left text. + /// Script analysis result from AnalyzeScript. + /// The locale to use when selecting glyphs. + /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs. + /// If this is NULL then the default mapping based on the script is used. + /// An array of pointers to the sets of typographic + /// features to use in each feature range. + /// The length of each feature range, in characters. + /// The sum of all lengths should be equal to textLength. + /// The number of feature ranges. + /// The advance width of each glyph. + /// The offset of the origin of each glyph. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetGlyphPlacements)( + __in_ecount(textLength) WCHAR const* textString, + __in_ecount(textLength) UINT16 const* clusterMap, + __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps, + UINT32 textLength, + __in_ecount(glyphCount) UINT16 const* glyphIndices, + __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps, + UINT32 glyphCount, + IDWriteFontFace * fontFace, + FLOAT fontEmSize, + BOOL isSideways, + BOOL isRightToLeft, + __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis, + __in_z_opt WCHAR const* localeName, + __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features, + __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths, + UINT32 featureRanges, + __out_ecount(glyphCount) FLOAT* glyphAdvances, + __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets + ) PURE; + + /// + /// Place glyphs output from the GetGlyphs method according to the font + /// and the writing system's rendering rules. + /// + /// The original string the glyphs came from. + /// The mapping from character ranges to glyph + /// ranges. Returned by GetGlyphs. + /// Per-character properties. Returned by + /// GetGlyphs. + /// The length of textString. + /// Glyph indices. See GetGlyphs + /// Per-glyph properties. See GetGlyphs + /// The number of glyphs. + /// The font face the glyphs came from. + /// Logical font size in DIP's. + /// Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this + /// value is 1.0f. If the DPI is 120, this value is 120.0f/96. + /// Optional transform applied to the glyphs and their positions. This transform is applied after the + /// scaling specified by the font size and pixelsPerDip. + /// + /// When set to FALSE, the metrics are the same as the metrics of GDI aliased text. + /// When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font + /// created with CLEARTYPE_NATURAL_QUALITY. + /// + /// Set to true if the text is intended to be + /// drawn vertically. + /// Set to TRUE for right-to-left text. + /// Script analysis result from AnalyzeScript. + /// The locale to use when selecting glyphs. + /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs. + /// If this is NULL then the default mapping based on the script is used. + /// An array of pointers to the sets of typographic + /// features to use in each feature range. + /// The length of each feature range, in characters. + /// The sum of all lengths should be equal to textLength. + /// The number of feature ranges. + /// The advance width of each glyph. + /// The offset of the origin of each glyph. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetGdiCompatibleGlyphPlacements)( + __in_ecount(textLength) WCHAR const* textString, + __in_ecount(textLength) UINT16 const* clusterMap, + __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps, + UINT32 textLength, + __in_ecount(glyphCount) UINT16 const* glyphIndices, + __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps, + UINT32 glyphCount, + IDWriteFontFace * fontFace, + FLOAT fontEmSize, + FLOAT pixelsPerDip, + __in_opt DWRITE_MATRIX const* transform, + BOOL useGdiNatural, + BOOL isSideways, + BOOL isRightToLeft, + __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis, + __in_z_opt WCHAR const* localeName, + __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features, + __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths, + UINT32 featureRanges, + __out_ecount(glyphCount) FLOAT* glyphAdvances, + __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets + ) PURE; +}; + +/// +/// The DWRITE_GLYPH_RUN structure contains the information needed by renderers +/// to draw glyph runs. All coordinates are in device independent pixels (DIPs). +/// +struct DWRITE_GLYPH_RUN +{ + /// + /// The physical font face to draw with. + /// + __notnull IDWriteFontFace* fontFace; + + /// + /// Logical size of the font in DIPs, not points (equals 1/96 inch). + /// + FLOAT fontEmSize; + + /// + /// The number of glyphs. + /// + UINT32 glyphCount; + + /// + /// The indices to render. + /// + __field_ecount(glyphCount) UINT16 const* glyphIndices; + + /// + /// Glyph advance widths. + /// + __field_ecount_opt(glyphCount) FLOAT const* glyphAdvances; + + /// + /// Glyph offsets. + /// + __field_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets; + + /// + /// If true, specifies that glyphs are rotated 90 degrees to the left and + /// vertical metrics are used. Vertical writing is achieved by specifying + /// isSideways = true and rotating the entire run 90 degrees to the right + /// via a rotate transform. + /// + BOOL isSideways; + + /// + /// The implicit resolved bidi level of the run. Odd levels indicate + /// right-to-left languages like Hebrew and Arabic, while even levels + /// indicate left-to-right languages like English and Japanese (when + /// written horizontally). For right-to-left languages, the text origin + /// is on the right, and text should be drawn to the left. + /// + UINT32 bidiLevel; +}; + +/// +/// The DWRITE_GLYPH_RUN_DESCRIPTION structure contains additional properties +/// related to those in DWRITE_GLYPH_RUN. +/// +struct DWRITE_GLYPH_RUN_DESCRIPTION +{ + /// + /// The locale name associated with this run. + /// + __nullterminated WCHAR const* localeName; + + /// + /// The text associated with the glyphs. + /// + __field_ecount(stringLength) WCHAR const* string; + + /// + /// The number of characters (UTF16 code-units). + /// Note that this may be different than the number of glyphs. + /// + UINT32 stringLength; + + /// + /// An array of indices to the glyph indices array, of the first glyphs of + /// all the glyph clusters of the glyphs to render. + /// + __field_ecount(stringLength) UINT16 const* clusterMap; + + /// + /// Corresponding text position in the original string + /// this glyph run came from. + /// + UINT32 textPosition; +}; + +/// +/// The DWRITE_UNDERLINE structure contains about the size and placement of +/// underlines. All coordinates are in device independent pixels (DIPs). +/// +struct DWRITE_UNDERLINE +{ + /// + /// Width of the underline, measured parallel to the baseline. + /// + FLOAT width; + + /// + /// Thickness of the underline, measured perpendicular to the + /// baseline. + /// + FLOAT thickness; + + /// + /// Offset of the underline from the baseline. + /// A positive offset represents a position below the baseline and + /// a negative offset is above. + /// + FLOAT offset; + + /// + /// Height of the tallest run where the underline applies. + /// + FLOAT runHeight; + + /// + /// Reading direction of the text associated with the underline. This + /// value is used to interpret whether the width value runs horizontally + /// or vertically. + /// + DWRITE_READING_DIRECTION readingDirection; + + /// + /// Flow direction of the text associated with the underline. This value + /// is used to interpret whether the thickness value advances top to + /// bottom, left to right, or right to left. + /// + DWRITE_FLOW_DIRECTION flowDirection; + + /// + /// Locale of the text the underline is being drawn under. Can be + /// pertinent where the locale affects how the underline is drawn. + /// For example, in vertical text, the underline belongs on the + /// left for Chinese but on the right for Japanese. + /// This choice is completely left up to higher levels. + /// + __nullterminated WCHAR const* localeName; + + /// + /// The measuring mode can be useful to the renderer to determine how + /// underlines are rendered, e.g. rounding the thickness to a whole pixel + /// in GDI-compatible modes. + /// + DWRITE_MEASURING_MODE measuringMode; +}; + +/// +/// The DWRITE_STRIKETHROUGH structure contains about the size and placement of +/// strickthroughs. All coordinates are in device independent pixels (DIPs). +/// +struct DWRITE_STRIKETHROUGH +{ + /// + /// Width of the strikethrough, measured parallel to the baseline. + /// + FLOAT width; + + /// + /// Thickness of the strikethrough, measured perpendicular to the + /// baseline. + /// + FLOAT thickness; + + /// + /// Offset of the stikethrough from the baseline. + /// A positive offset represents a position below the baseline and + /// a negative offset is above. + /// + FLOAT offset; + + /// + /// Reading direction of the text associated with the strikethrough. This + /// value is used to interpret whether the width value runs horizontally + /// or vertically. + /// + DWRITE_READING_DIRECTION readingDirection; + + /// + /// Flow direction of the text associated with the strikethrough. This + /// value is used to interpret whether the thickness value advances top to + /// bottom, left to right, or right to left. + /// + DWRITE_FLOW_DIRECTION flowDirection; + + /// + /// Locale of the range. Can be pertinent where the locale affects the style. + /// + __nullterminated WCHAR const* localeName; + + /// + /// The measuring mode can be useful to the renderer to determine how + /// underlines are rendered, e.g. rounding the thickness to a whole pixel + /// in GDI-compatible modes. + /// + DWRITE_MEASURING_MODE measuringMode; +}; + +/// +/// The DWRITE_LINE_METRICS structure contains information about a formatted +/// line of text. +/// +struct DWRITE_LINE_METRICS +{ + /// + /// The number of total text positions in the line. + /// This includes any trailing whitespace and newline characters. + /// + UINT32 length; + + /// + /// The number of whitespace positions at the end of the line. Newline + /// sequences are considered whitespace. + /// + UINT32 trailingWhitespaceLength; + + /// + /// The number of characters in the newline sequence at the end of the line. + /// If the count is zero, then the line was either wrapped or it is the + /// end of the text. + /// + UINT32 newlineLength; + + /// + /// Height of the line as measured from top to bottom. + /// + FLOAT height; + + /// + /// Distance from the top of the line to its baseline. + /// + FLOAT baseline; + + /// + /// The line is trimmed. + /// + BOOL isTrimmed; +}; + + +/// +/// The DWRITE_CLUSTER_METRICS structure contains information about a glyph cluster. +/// +struct DWRITE_CLUSTER_METRICS +{ + /// + /// The total advance width of all glyphs in the cluster. + /// + FLOAT width; + + /// + /// The number of text positions in the cluster. + /// + UINT16 length; + + /// + /// Indicate whether line can be broken right after the cluster. + /// + UINT16 canWrapLineAfter : 1; + + /// + /// Indicate whether the cluster corresponds to whitespace character. + /// + UINT16 isWhitespace : 1; + + /// + /// Indicate whether the cluster corresponds to a newline character. + /// + UINT16 isNewline : 1; + + /// + /// Indicate whether the cluster corresponds to soft hyphen character. + /// + UINT16 isSoftHyphen : 1; + + /// + /// Indicate whether the cluster is read from right to left. + /// + UINT16 isRightToLeft : 1; + + UINT16 padding : 11; +}; + + +/// +/// Overall metrics associated with text after layout. +/// All coordinates are in device independent pixels (DIPs). +/// +struct DWRITE_TEXT_METRICS +{ + /// + /// Left-most point of formatted text relative to layout box + /// (excluding any glyph overhang). + /// + FLOAT left; + + /// + /// Top-most point of formatted text relative to layout box + /// (excluding any glyph overhang). + /// + FLOAT top; + + /// + /// The width of the formatted text ignoring trailing whitespace + /// at the end of each line. + /// + FLOAT width; + + /// + /// The width of the formatted text taking into account the + /// trailing whitespace at the end of each line. + /// + FLOAT widthIncludingTrailingWhitespace; + + /// + /// The height of the formatted text. The height of an empty string + /// is determined by the size of the default font's line height. + /// + FLOAT height; + + /// + /// Initial width given to the layout. Depending on whether the text + /// was wrapped or not, it can be either larger or smaller than the + /// text content width. + /// + FLOAT layoutWidth; + + /// + /// Initial height given to the layout. Depending on the length of the + /// text, it may be larger or smaller than the text content height. + /// + FLOAT layoutHeight; + + /// + /// The maximum reordering count of any line of text, used + /// to calculate the most number of hit-testing boxes needed. + /// If the layout has no bidirectional text or no text at all, + /// the minimum level is 1. + /// + UINT32 maxBidiReorderingDepth; + + /// + /// Total number of lines. + /// + UINT32 lineCount; +}; + + +/// +/// Properties describing the geometric measurement of an +/// application-defined inline object. +/// +struct DWRITE_INLINE_OBJECT_METRICS +{ + /// + /// Width of the inline object. + /// + FLOAT width; + + /// + /// Height of the inline object as measured from top to bottom. + /// + FLOAT height; + + /// + /// Distance from the top of the object to the baseline where it is lined up with the adjacent text. + /// If the baseline is at the bottom, baseline simply equals height. + /// + FLOAT baseline; + + /// + /// Flag indicating whether the object is to be placed upright or alongside the text baseline + /// for vertical text. + /// + BOOL supportsSideways; +}; + + +/// +/// The DWRITE_OVERHANG_METRICS structure holds how much any visible pixels +/// (in DIPs) overshoot each side of the layout or inline objects. +/// +/// +/// Positive overhangs indicate that the visible area extends outside the layout +/// box or inline object, while negative values mean there is whitespace inside. +/// The returned values are unaffected by rendering transforms or pixel snapping. +/// Additionally, they may not exactly match final target's pixel bounds after +/// applying grid fitting and hinting. +/// +struct DWRITE_OVERHANG_METRICS +{ + /// + /// The distance from the left-most visible DIP to its left alignment edge. + /// + FLOAT left; + + /// + /// The distance from the top-most visible DIP to its top alignment edge. + /// + FLOAT top; + + /// + /// The distance from the right-most visible DIP to its right alignment edge. + /// + FLOAT right; + + /// + /// The distance from the bottom-most visible DIP to its bottom alignment edge. + /// + FLOAT bottom; +}; + + +/// +/// Geometry enclosing of text positions. +/// +struct DWRITE_HIT_TEST_METRICS +{ + /// + /// First text position within the geometry. + /// + UINT32 textPosition; + + /// + /// Number of text positions within the geometry. + /// + UINT32 length; + + /// + /// Left position of the top-left coordinate of the geometry. + /// + FLOAT left; + + /// + /// Top position of the top-left coordinate of the geometry. + /// + FLOAT top; + + /// + /// Geometry's width. + /// + FLOAT width; + + /// + /// Geometry's height. + /// + FLOAT height; + + /// + /// Bidi level of text positions enclosed within the geometry. + /// + UINT32 bidiLevel; + + /// + /// Geometry encloses text? + /// + BOOL isText; + + /// + /// Range is trimmed. + /// + BOOL isTrimmed; +}; + + +interface IDWriteTextRenderer; + + +/// +/// The IDWriteInlineObject interface wraps an application defined inline graphic, +/// allowing DWrite to query metrics as if it was a glyph inline with the text. +/// +interface DWRITE_DECLARE_INTERFACE("8339FDE3-106F-47ab-8373-1C6295EB10B3") IDWriteInlineObject : public IUnknown +{ + /// + /// The application implemented rendering callback (IDWriteTextRenderer::DrawInlineObject) + /// can use this to draw the inline object without needing to cast or query the object + /// type. The text layout does not call this method directly. + /// + /// The context passed to IDWriteTextLayout::Draw. + /// The renderer passed to IDWriteTextLayout::Draw as the object's containing parent. + /// X-coordinate at the top-left corner of the inline object. + /// Y-coordinate at the top-left corner of the inline object. + /// The object should be drawn on its side. + /// The object is in an right-to-left context and should be drawn flipped. + /// The drawing effect set in IDWriteTextLayout::SetDrawingEffect. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(Draw)( + __maybenull void* clientDrawingContext, + IDWriteTextRenderer* renderer, + FLOAT originX, + FLOAT originY, + BOOL isSideways, + BOOL isRightToLeft, + __maybenull IUnknown* clientDrawingEffect + ) PURE; + + /// + /// TextLayout calls this callback function to get the measurement of the inline object. + /// + /// Returned metrics + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetMetrics)( + __out DWRITE_INLINE_OBJECT_METRICS* metrics + ) PURE; + + /// + /// TextLayout calls this callback function to get the visible extents (in DIPs) of the inline object. + /// In the case of a simple bitmap, with no padding and no overhang, all the overhangs will + /// simply be zeroes. + /// + /// Overshoot of visible extents (in DIPs) outside the object. + /// + /// Standard HRESULT error code. + /// + /// + /// The overhangs should be returned relative to the reported size of the object + /// (DWRITE_INLINE_OBJECT_METRICS::width/height), and should not be baseline + /// adjusted. If you have an image that is actually 100x100 DIPs, but you want it + /// slightly inset (perhaps it has a glow) by 20 DIPs on each side, you would + /// return a width/height of 60x60 and four overhangs of 20 DIPs. + /// + STDMETHOD(GetOverhangMetrics)( + __out DWRITE_OVERHANG_METRICS* overhangs + ) PURE; + + /// + /// Layout uses this to determine the line breaking behavior of the inline object + /// amidst the text. + /// + /// Line-breaking condition between the object and the content immediately preceding it. + /// Line-breaking condition between the object and the content immediately following it. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetBreakConditions)( + __out DWRITE_BREAK_CONDITION* breakConditionBefore, + __out DWRITE_BREAK_CONDITION* breakConditionAfter + ) PURE; +}; + +/// +/// The IDWritePixelSnapping interface defines the pixel snapping properties of a text renderer. +/// +interface DWRITE_DECLARE_INTERFACE("eaf3a2da-ecf4-4d24-b644-b34f6842024b") IDWritePixelSnapping : public IUnknown +{ + /// + /// Determines whether pixel snapping is disabled. The recommended default is FALSE, + /// unless doing animation that requires subpixel vertical placement. + /// + /// The context passed to IDWriteTextLayout::Draw. + /// Receives TRUE if pixel snapping is disabled or FALSE if it not. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(IsPixelSnappingDisabled)( + __maybenull void* clientDrawingContext, + __out BOOL* isDisabled + ) PURE; + + /// + /// Gets the current transform that maps abstract coordinates to DIPs, + /// which may disable pixel snapping upon any rotation or shear. + /// + /// The context passed to IDWriteTextLayout::Draw. + /// Receives the transform. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetCurrentTransform)( + __maybenull void* clientDrawingContext, + __out DWRITE_MATRIX* transform + ) PURE; + + /// + /// Gets the number of physical pixels per DIP. A DIP (device-independent pixel) is 1/96 inch, + /// so the pixelsPerDip value is the number of logical pixels per inch divided by 96 (yielding + /// a value of 1 for 96 DPI and 1.25 for 120). + /// + /// The context passed to IDWriteTextLayout::Draw. + /// Receives the number of physical pixels per DIP. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetPixelsPerDip)( + __maybenull void* clientDrawingContext, + __out FLOAT* pixelsPerDip + ) PURE; +}; + +/// +/// The IDWriteTextLayout interface represents a set of application-defined +/// callbacks that perform rendering of text, inline objects, and decorations +/// such as underlines. +/// +interface DWRITE_DECLARE_INTERFACE("ef8a8135-5cc6-45fe-8825-c5a0724eb819") IDWriteTextRenderer : public IDWritePixelSnapping +{ + /// + /// IDWriteTextLayout::Draw calls this function to instruct the client to + /// render a run of glyphs. + /// + /// The context passed to + /// IDWriteTextLayout::Draw. + /// X-coordinate of the baseline. + /// Y-coordinate of the baseline. + /// Specifies measuring method for glyphs in the run. + /// Renderer implementations may choose different rendering modes for given measuring methods, + /// but best results are seen when the rendering mode matches the corresponding measuring mode: + /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL + /// + /// The glyph run to draw. + /// Properties of the characters + /// associated with this run. + /// The drawing effect set in + /// IDWriteTextLayout::SetDrawingEffect. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(DrawGlyphRun)( + __maybenull void* clientDrawingContext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + DWRITE_MEASURING_MODE measuringMode, + __in DWRITE_GLYPH_RUN const* glyphRun, + __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription, + __maybenull IUnknown* clientDrawingEffect + ) PURE; + + /// + /// IDWriteTextLayout::Draw calls this function to instruct the client to draw + /// an underline. + /// + /// The context passed to + /// IDWriteTextLayout::Draw. + /// X-coordinate of the baseline. + /// Y-coordinate of the baseline. + /// Underline logical information. + /// The drawing effect set in + /// IDWriteTextLayout::SetDrawingEffect. + /// + /// Standard HRESULT error code. + /// + /// + /// A single underline can be broken into multiple calls, depending on + /// how the formatting changes attributes. If font sizes/styles change + /// within an underline, the thickness and offset will be averaged + /// weighted according to characters. + /// To get the correct top coordinate of the underline rect, add underline::offset + /// to the baseline's Y. Otherwise the underline will be immediately under the text. + /// The x coordinate will always be passed as the left side, regardless + /// of text directionality. This simplifies drawing and reduces the + /// problem of round-off that could potentially cause gaps or a double + /// stamped alpha blend. To avoid alpha overlap, round the end points + /// to the nearest device pixel. + /// + STDMETHOD(DrawUnderline)( + __maybenull void* clientDrawingContext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + __in DWRITE_UNDERLINE const* underline, + __maybenull IUnknown* clientDrawingEffect + ) PURE; + + /// + /// IDWriteTextLayout::Draw calls this function to instruct the client to draw + /// a strikethrough. + /// + /// The context passed to + /// IDWriteTextLayout::Draw. + /// X-coordinate of the baseline. + /// Y-coordinate of the baseline. + /// Strikethrough logical information. + /// The drawing effect set in + /// IDWriteTextLayout::SetDrawingEffect. + /// + /// Standard HRESULT error code. + /// + /// + /// A single strikethrough can be broken into multiple calls, depending on + /// how the formatting changes attributes. Strikethrough is not averaged + /// across font sizes/styles changes. + /// To get the correct top coordinate of the strikethrough rect, + /// add strikethrough::offset to the baseline's Y. + /// Like underlines, the x coordinate will always be passed as the left side, + /// regardless of text directionality. + /// + STDMETHOD(DrawStrikethrough)( + __maybenull void* clientDrawingContext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + __in DWRITE_STRIKETHROUGH const* strikethrough, + __maybenull IUnknown* clientDrawingEffect + ) PURE; + + /// + /// IDWriteTextLayout::Draw calls this application callback when it needs to + /// draw an inline object. + /// + /// The context passed to IDWriteTextLayout::Draw. + /// X-coordinate at the top-left corner of the inline object. + /// Y-coordinate at the top-left corner of the inline object. + /// The object set using IDWriteTextLayout::SetInlineObject. + /// The object should be drawn on its side. + /// The object is in an right-to-left context and should be drawn flipped. + /// The drawing effect set in + /// IDWriteTextLayout::SetDrawingEffect. + /// + /// Standard HRESULT error code. + /// + /// + /// The right-to-left flag is a hint for those cases where it would look + /// strange for the image to be shown normally (like an arrow pointing to + /// right to indicate a submenu). + /// + STDMETHOD(DrawInlineObject)( + __maybenull void* clientDrawingContext, + FLOAT originX, + FLOAT originY, + IDWriteInlineObject* inlineObject, + BOOL isSideways, + BOOL isRightToLeft, + __maybenull IUnknown* clientDrawingEffect + ) PURE; +}; + +/// +/// The IDWriteTextLayout interface represents a block of text after it has +/// been fully analyzed and formatted. +/// +/// All coordinates are in device independent pixels (DIPs). +/// +interface DWRITE_DECLARE_INTERFACE("53737037-6d14-410b-9bfe-0b182bb70961") IDWriteTextLayout : public IDWriteTextFormat +{ + /// + /// Set layout maximum width + /// + /// Layout maximum width + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetMaxWidth)( + FLOAT maxWidth + ) PURE; + + /// + /// Set layout maximum height + /// + /// Layout maximum height + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetMaxHeight)( + FLOAT maxHeight + ) PURE; + + /// + /// Set the font collection. + /// + /// The font collection to set + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontCollection)( + IDWriteFontCollection* fontCollection, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set null-terminated font family name. + /// + /// Font family name + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontFamilyName)( + __in_z WCHAR const* fontFamilyName, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set font weight. + /// + /// Font weight + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontWeight)( + DWRITE_FONT_WEIGHT fontWeight, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set font style. + /// + /// Font style + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontStyle)( + DWRITE_FONT_STYLE fontStyle, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set font stretch. + /// + /// font stretch + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontStretch)( + DWRITE_FONT_STRETCH fontStretch, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set font em height. + /// + /// Font em height + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontSize)( + FLOAT fontSize, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set underline. + /// + /// The Boolean flag indicates whether underline takes place + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetUnderline)( + BOOL hasUnderline, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set strikethrough. + /// + /// The Boolean flag indicates whether strikethrough takes place + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetStrikethrough)( + BOOL hasStrikethrough, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set application-defined drawing effect. + /// + /// Pointer to an application-defined drawing effect. + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + /// + /// This drawing effect is associated with the specified range and will be passed back + /// to the application via the callback when the range is drawn at drawing time. + /// + STDMETHOD(SetDrawingEffect)( + IUnknown* drawingEffect, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set inline object. + /// + /// Pointer to an application-implemented inline object. + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + /// + /// This inline object applies to the specified range and will be passed back + /// to the application via the DrawInlineObject callback when the range is drawn. + /// Any text in that range will be suppressed. + /// + STDMETHOD(SetInlineObject)( + IDWriteInlineObject* inlineObject, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set font typography features. + /// + /// Pointer to font typography setting. + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetTypography)( + IDWriteTypography* typography, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set locale name. + /// + /// Locale name + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetLocaleName)( + __in_z WCHAR const* localeName, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Get layout maximum width + /// + STDMETHOD_(FLOAT, GetMaxWidth)() PURE; + + /// + /// Get layout maximum height + /// + STDMETHOD_(FLOAT, GetMaxHeight)() PURE; + + /// + /// Get the font collection where the current position is at. + /// + /// The current text position. + /// The current font collection + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontCollection)( + UINT32 currentPosition, + __out IDWriteFontCollection** fontCollection, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the length of the font family name where the current position is at. + /// + /// The current text position. + /// Size of the character array in character count not including the terminated NULL character. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFamilyNameLength)( + UINT32 currentPosition, + __out UINT32* nameLength, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Copy the font family name where the current position is at. + /// + /// The current text position. + /// Character array that receives the current font family name + /// Size of the character array in character count including the terminated NULL character. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFamilyName)( + UINT32 currentPosition, + __out_ecount_z(nameSize) WCHAR* fontFamilyName, + UINT32 nameSize, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the font weight where the current position is at. + /// + /// The current text position. + /// The current font weight + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontWeight)( + UINT32 currentPosition, + __out DWRITE_FONT_WEIGHT* fontWeight, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the font style where the current position is at. + /// + /// The current text position. + /// The current font style + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontStyle)( + UINT32 currentPosition, + __out DWRITE_FONT_STYLE* fontStyle, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the font stretch where the current position is at. + /// + /// The current text position. + /// The current font stretch + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontStretch)( + UINT32 currentPosition, + __out DWRITE_FONT_STRETCH* fontStretch, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the font em height where the current position is at. + /// + /// The current text position. + /// The current font em height + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontSize)( + UINT32 currentPosition, + __out FLOAT* fontSize, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the underline presence where the current position is at. + /// + /// The current text position. + /// The Boolean flag indicates whether text is underlined. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetUnderline)( + UINT32 currentPosition, + __out BOOL* hasUnderline, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the strikethrough presence where the current position is at. + /// + /// The current text position. + /// The Boolean flag indicates whether text has strikethrough. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetStrikethrough)( + UINT32 currentPosition, + __out BOOL* hasStrikethrough, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the application-defined drawing effect where the current position is at. + /// + /// The current text position. + /// The current application-defined drawing effect. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetDrawingEffect)( + UINT32 currentPosition, + __out IUnknown** drawingEffect, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the inline object at the given position. + /// + /// The given text position. + /// The inline object. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetInlineObject)( + UINT32 currentPosition, + __out IDWriteInlineObject** inlineObject, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the typography setting where the current position is at. + /// + /// The current text position. + /// The current typography setting. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetTypography)( + UINT32 currentPosition, + __out IDWriteTypography** typography, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the length of the locale name where the current position is at. + /// + /// The current text position. + /// Size of the character array in character count not including the terminated NULL character. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLocaleNameLength)( + UINT32 currentPosition, + __out UINT32* nameLength, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the locale name where the current position is at. + /// + /// The current text position. + /// Character array that receives the current locale name + /// Size of the character array in character count including the terminated NULL character. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLocaleName)( + UINT32 currentPosition, + __out_ecount_z(nameSize) WCHAR* localeName, + UINT32 nameSize, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Initiate drawing of the text. + /// + /// An application defined value + /// included in rendering callbacks. + /// The set of application-defined callbacks that do + /// the actual rendering. + /// X-coordinate of the layout's left side. + /// Y-coordinate of the layout's top side. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(Draw)( + __maybenull void* clientDrawingContext, + IDWriteTextRenderer* renderer, + FLOAT originX, + FLOAT originY + ) PURE; + + /// + /// GetLineMetrics returns properties of each line. + /// + /// The array to fill with line information. + /// The maximum size of the lineMetrics array. + /// The actual size of the lineMetrics + /// array that is needed. + /// + /// Standard HRESULT error code. + /// + /// + /// If maxLineCount is not large enough E_NOT_SUFFICIENT_BUFFER, + /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), + /// is returned and *actualLineCount is set to the number of lines + /// needed. + /// + STDMETHOD(GetLineMetrics)( + __out_ecount_opt(maxLineCount) DWRITE_LINE_METRICS* lineMetrics, + UINT32 maxLineCount, + __out UINT32* actualLineCount + ) PURE; + + /// + /// GetMetrics retrieves overall metrics for the formatted string. + /// + /// The returned metrics. + /// + /// Standard HRESULT error code. + /// + /// + /// Drawing effects like underline and strikethrough do not contribute + /// to the text size, which is essentially the sum of advance widths and + /// line heights. Additionally, visible swashes and other graphic + /// adornments may extend outside the returned width and height. + /// + STDMETHOD(GetMetrics)( + __out DWRITE_TEXT_METRICS* textMetrics + ) PURE; + + /// + /// GetOverhangMetrics returns the overhangs (in DIPs) of the layout and all + /// objects contained in it, including text glyphs and inline objects. + /// + /// Overshoots of visible extents (in DIPs) outside the layout. + /// + /// Standard HRESULT error code. + /// + /// + /// Any underline and strikethrough do not contribute to the black box + /// determination, since these are actually drawn by the renderer, which + /// is allowed to draw them in any variety of styles. + /// + STDMETHOD(GetOverhangMetrics)( + __out DWRITE_OVERHANG_METRICS* overhangs + ) PURE; + + /// + /// Retrieve logical properties and measurement of each cluster. + /// + /// The array to fill with cluster information. + /// The maximum size of the clusterMetrics array. + /// The actual size of the clusterMetrics array that is needed. + /// + /// Standard HRESULT error code. + /// + /// + /// If maxClusterCount is not large enough E_NOT_SUFFICIENT_BUFFER, + /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), + /// is returned and *actualClusterCount is set to the number of clusters + /// needed. + /// + STDMETHOD(GetClusterMetrics)( + __out_ecount_opt(maxClusterCount) DWRITE_CLUSTER_METRICS* clusterMetrics, + UINT32 maxClusterCount, + __out UINT32* actualClusterCount + ) PURE; + + /// + /// Determines the minimum possible width the layout can be set to without + /// emergency breaking between the characters of whole words. + /// + /// Minimum width. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(DetermineMinWidth)( + __out FLOAT* minWidth + ) PURE; + + /// + /// Given a coordinate (in DIPs) relative to the top-left of the layout box, + /// this returns the corresponding hit-test metrics of the text string where + /// the hit-test has occurred. This is useful for mapping mouse clicks to caret + /// positions. When the given coordinate is outside the text string, the function + /// sets the output value *isInside to false but returns the nearest character + /// position. + /// + /// X coordinate to hit-test, relative to the top-left location of the layout box. + /// Y coordinate to hit-test, relative to the top-left location of the layout box. + /// Output flag indicating whether the hit-test location is at the leading or the trailing + /// side of the character. When the output *isInside value is set to false, this value is set according to the output + /// *position value to represent the edge closest to the hit-test location. + /// Output flag indicating whether the hit-test location is inside the text string. + /// When false, the position nearest the text's edge is returned. + /// Output geometry fully enclosing the hit-test location. When the output *isInside value + /// is set to false, this structure represents the geometry enclosing the edge closest to the hit-test location. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(HitTestPoint)( + FLOAT pointX, + FLOAT pointY, + __out BOOL* isTrailingHit, + __out BOOL* isInside, + __out DWRITE_HIT_TEST_METRICS* hitTestMetrics + ) PURE; + + /// + /// Given a text position and whether the caret is on the leading or trailing + /// edge of that position, this returns the corresponding coordinate (in DIPs) + /// relative to the top-left of the layout box. This is most useful for drawing + /// the caret's current position, but it could also be used to anchor an IME to the + /// typed text or attach a floating menu near the point of interest. It may also be + /// used to programmatically obtain the geometry of a particular text position + /// for UI automation. + /// + /// Text position to get the coordinate of. + /// Flag indicating whether the location is of the leading or the trailing side of the specified text position. + /// Output caret X, relative to the top-left of the layout box. + /// Output caret Y, relative to the top-left of the layout box. + /// Output geometry fully enclosing the specified text position. + /// + /// Standard HRESULT error code. + /// + /// + /// When drawing a caret at the returned X,Y, it should should be centered on X + /// and drawn from the Y coordinate down. The height will be the size of the + /// hit-tested text (which can vary in size within a line). + /// Reading direction also affects which side of the character the caret is drawn. + /// However, the returned X coordinate will be correct for either case. + /// You can get a text length back that is larger than a single character. + /// This happens for complex scripts when multiple characters form a single cluster, + /// when diacritics join their base character, or when you test a surrogate pair. + /// + STDMETHOD(HitTestTextPosition)( + UINT32 textPosition, + BOOL isTrailingHit, + __out FLOAT* pointX, + __out FLOAT* pointY, + __out DWRITE_HIT_TEST_METRICS* hitTestMetrics + ) PURE; + + /// + /// The application calls this function to get a set of hit-test metrics + /// corresponding to a range of text positions. The main usage for this + /// is to draw highlighted selection of the text string. + /// + /// The function returns E_NOT_SUFFICIENT_BUFFER, which is equivalent to + /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), when the buffer size of + /// hitTestMetrics is too small to hold all the regions calculated by the + /// function. In such situation, the function sets the output value + /// *actualHitTestMetricsCount to the number of geometries calculated. + /// The application is responsible to allocate a new buffer of greater + /// size and call the function again. + /// + /// A good value to use as an initial value for maxHitTestMetricsCount may + /// be calculated from the following equation: + /// maxHitTestMetricsCount = lineCount * maxBidiReorderingDepth + /// + /// where lineCount is obtained from the value of the output argument + /// *actualLineCount from the function IDWriteTextLayout::GetLineMetrics, + /// and the maxBidiReorderingDepth value from the DWRITE_TEXT_METRICS + /// structure of the output argument *textMetrics from the function + /// IDWriteFactory::CreateTextLayout. + /// + /// First text position of the specified range. + /// Number of positions of the specified range. + /// Offset of the X origin (left of the layout box) which is added to each of the hit-test metrics returned. + /// Offset of the Y origin (top of the layout box) which is added to each of the hit-test metrics returned. + /// Pointer to a buffer of the output geometry fully enclosing the specified position range. + /// Maximum number of distinct metrics it could hold in its buffer memory. + /// Actual number of metrics returned or needed. + /// + /// Standard HRESULT error code. + /// + /// + /// There are no gaps in the returned metrics. While there could be visual gaps, + /// depending on bidi ordering, each range is contiguous and reports all the text, + /// including any hidden characters and trimmed text. + /// The height of each returned range will be the same within each line, regardless + /// of how the font sizes vary. + /// + STDMETHOD(HitTestTextRange)( + UINT32 textPosition, + UINT32 textLength, + FLOAT originX, + FLOAT originY, + __out_ecount_opt(maxHitTestMetricsCount) DWRITE_HIT_TEST_METRICS* hitTestMetrics, + UINT32 maxHitTestMetricsCount, + __out UINT32* actualHitTestMetricsCount + ) PURE; +}; + +/// +/// Encapsulates a 32-bit device independent bitmap and device context, which can be used for rendering glyphs. +/// +interface DWRITE_DECLARE_INTERFACE("5e5a32a3-8dff-4773-9ff6-0696eab77267") IDWriteBitmapRenderTarget : public IUnknown +{ + /// + /// Draws a run of glyphs to the bitmap. + /// + /// Horizontal position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB. + /// Vertical position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB. + /// Specifies measuring method for glyphs in the run. + /// Renderer implementations may choose different rendering modes for different measuring methods, for example + /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL, + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC, and + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL. + /// + /// Structure containing the properties of the glyph run. + /// Object that controls rendering behavior. + /// Specifies the foreground color of the text. + /// Optional rectangle that receives the bounding box (in pixels not DIPs) of all the pixels affected by + /// drawing the glyph run. The black box rectangle may extend beyond the dimensions of the bitmap. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(DrawGlyphRun)( + FLOAT baselineOriginX, + FLOAT baselineOriginY, + DWRITE_MEASURING_MODE measuringMode, + __in DWRITE_GLYPH_RUN const* glyphRun, + IDWriteRenderingParams* renderingParams, + COLORREF textColor, + __out_opt RECT* blackBoxRect = NULL + ) PURE; + + /// + /// Gets a handle to the memory device context. + /// + /// + /// Returns the device context handle. + /// + /// + /// An application can use the device context to draw using GDI functions. An application can obtain the bitmap handle + /// (HBITMAP) by calling GetCurrentObject. An application that wants information about the underlying bitmap, including + /// a pointer to the pixel data, can call GetObject to fill in a DIBSECTION structure. The bitmap is always a 32-bit + /// top-down DIB. + /// + STDMETHOD_(HDC, GetMemoryDC)() PURE; + + /// + /// Gets the number of bitmap pixels per DIP. A DIP (device-independent pixel) is 1/96 inch so this value is the number + /// if pixels per inch divided by 96. + /// + /// + /// Returns the number of bitmap pixels per DIP. + /// + STDMETHOD_(FLOAT, GetPixelsPerDip)() PURE; + + /// + /// Sets the number of bitmap pixels per DIP. A DIP (device-independent pixel) is 1/96 inch so this value is the number + /// if pixels per inch divided by 96. + /// + /// Specifies the number of pixels per DIP. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetPixelsPerDip)( + FLOAT pixelsPerDip + ) PURE; + + /// + /// Gets the transform that maps abstract coordinate to DIPs. By default this is the identity + /// transform. Note that this is unrelated to the world transform of the underlying device + /// context. + /// + /// Receives the transform. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetCurrentTransform)( + __out DWRITE_MATRIX* transform + ) PURE; + + /// + /// Sets the transform that maps abstract coordinate to DIPs. This does not affect the world + /// transform of the underlying device context. + /// + /// Specifies the new transform. This parameter can be NULL, in which + /// case the identity transform is implied. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetCurrentTransform)( + __in_opt DWRITE_MATRIX const* transform + ) PURE; + + /// + /// Gets the dimensions of the bitmap. + /// + /// Receives the size of the bitmap in pixels. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetSize)( + __out SIZE* size + ) PURE; + + /// + /// Resizes the bitmap. + /// + /// New bitmap width, in pixels. + /// New bitmap height, in pixels. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(Resize)( + UINT32 width, + UINT32 height + ) PURE; +}; + +/// +/// The GDI interop interface provides interoperability with GDI. +/// +interface DWRITE_DECLARE_INTERFACE("1edd9491-9853-4299-898f-6432983b6f3a") IDWriteGdiInterop : public IUnknown +{ + /// + /// Creates a font object that matches the properties specified by the LOGFONT structure. + /// + /// Structure containing a GDI-compatible font description. + /// Receives a newly created font object if successful, or NULL in case of error. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateFontFromLOGFONT)( + __in LOGFONTW const* logFont, + __out IDWriteFont** font + ) PURE; + + /// + /// Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font. + /// + /// Specifies a font in the system font collection. + /// Structure that receives a GDI-compatible font description. + /// Contains TRUE if the specified font object is part of the system font collection + /// or FALSE otherwise. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(ConvertFontToLOGFONT)( + IDWriteFont* font, + __out LOGFONTW* logFont, + __out BOOL* isSystemFont + ) PURE; + + /// + /// Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font. + /// + /// Specifies a font face. + /// Structure that receives a GDI-compatible font description. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(ConvertFontFaceToLOGFONT)( + IDWriteFontFace* font, + __out LOGFONTW* logFont + ) PURE; + + /// + /// Creates a font face object that corresponds to the currently selected HFONT. + /// + /// Handle to a device context into which a font has been selected. It is assumed that the client + /// has already performed font mapping and that the font selected into the DC is the actual font that would be used + /// for rendering glyphs. + /// Contains the newly created font face object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateFontFaceFromHdc)( + HDC hdc, + __out IDWriteFontFace** fontFace + ) PURE; + + /// + /// Creates an object that encapsulates a bitmap and memory DC which can be used for rendering glyphs. + /// + /// Optional device context used to create a compatible memory DC. + /// Width of the bitmap. + /// Height of the bitmap. + /// Receives a pointer to the newly created render target. + STDMETHOD(CreateBitmapRenderTarget)( + __in_opt HDC hdc, + UINT32 width, + UINT32 height, + __out IDWriteBitmapRenderTarget** renderTarget + ) PURE; +}; + +/// +/// The DWRITE_TEXTURE_TYPE enumeration identifies a type of alpha texture. An alpha texture is a bitmap of alpha values, each +/// representing the darkness (i.e., opacity) of a pixel or subpixel. +/// +enum DWRITE_TEXTURE_TYPE +{ + /// + /// Specifies an alpha texture for aliased text rendering (i.e., bi-level, where each pixel is either fully opaque or fully transparent), + /// with one byte per pixel. + /// + DWRITE_TEXTURE_ALIASED_1x1, + + /// + /// Specifies an alpha texture for ClearType text rendering, with three bytes per pixel in the horizontal dimension and + /// one byte per pixel in the vertical dimension. + /// + DWRITE_TEXTURE_CLEARTYPE_3x1 +}; + +/// +/// Maximum alpha value in a texture returned by IDWriteGlyphRunAnalysis::CreateAlphaTexture. +/// +#define DWRITE_ALPHA_MAX 255 + +/// +/// Interface that encapsulates information used to render a glyph run. +/// +interface DWRITE_DECLARE_INTERFACE("7d97dbf7-e085-42d4-81e3-6a883bded118") IDWriteGlyphRunAnalysis : public IUnknown +{ + /// + /// Gets the bounding rectangle of the physical pixels affected by the glyph run. + /// + /// Specifies the type of texture requested. If a bi-level texture is requested, the + /// bounding rectangle includes only bi-level glyphs. Otherwise, the bounding rectangle includes only anti-aliased + /// glyphs. + /// Receives the bounding rectangle, or an empty rectangle if there are no glyphs + /// if the specified type. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetAlphaTextureBounds)( + DWRITE_TEXTURE_TYPE textureType, + __out RECT* textureBounds + ) PURE; + + /// + /// Creates an alpha texture of the specified type. + /// + /// Specifies the type of texture requested. If a bi-level texture is requested, the + /// texture contains only bi-level glyphs. Otherwise, the texture contains only anti-aliased glyphs. + /// Specifies the bounding rectangle of the texture, which can be different than + /// the bounding rectangle returned by GetAlphaTextureBounds. + /// Receives the array of alpha values. + /// Size of the alphaValues array. The minimum size depends on the dimensions of the + /// rectangle and the type of texture requested. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateAlphaTexture)( + DWRITE_TEXTURE_TYPE textureType, + __in RECT const* textureBounds, + __out_bcount(bufferSize) BYTE* alphaValues, + UINT32 bufferSize + ) PURE; + + /// + /// Gets properties required for ClearType blending. + /// + /// Rendering parameters object. In most cases, the values returned in the output + /// parameters are based on the properties of this object. The exception is if a GDI-compatible rendering mode + /// is specified. + /// Receives the gamma value to use for gamma correction. + /// Receives the enhanced contrast value. + /// Receives the ClearType level. + STDMETHOD(GetAlphaBlendParams)( + IDWriteRenderingParams* renderingParams, + __out FLOAT* blendGamma, + __out FLOAT* blendEnhancedContrast, + __out FLOAT* blendClearTypeLevel + ) PURE; +}; + +/// +/// The root factory interface for all DWrite objects. +/// +interface DWRITE_DECLARE_INTERFACE("b859ee5a-d838-4b5b-a2e8-1adc7d93db48") IDWriteFactory : public IUnknown +{ + /// + /// Gets a font collection representing the set of installed fonts. + /// + /// Receives a pointer to the system font collection object, or NULL in case of failure. + /// If this parameter is nonzero, the function performs an immediate check for changes to the set of + /// installed fonts. If this parameter is FALSE, the function will still detect changes if the font cache service is running, but + /// there may be some latency. For example, an application might specify TRUE if it has itself just installed a font and wants to + /// be sure the font collection contains that font. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetSystemFontCollection)( + __out IDWriteFontCollection** fontCollection, + BOOL checkForUpdates = FALSE + ) PURE; + + /// + /// Creates a font collection using a custom font collection loader. + /// + /// Application-defined font collection loader, which must have been previously + /// registered using RegisterFontCollectionLoader. + /// Key used by the loader to identify a collection of font files. + /// Size in bytes of the collection key. + /// Receives a pointer to the system font collection object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateCustomFontCollection)( + IDWriteFontCollectionLoader* collectionLoader, + __in_bcount(collectionKeySize) void const* collectionKey, + UINT32 collectionKeySize, + __out IDWriteFontCollection** fontCollection + ) PURE; + + /// + /// Registers a custom font collection loader with the factory object. + /// + /// Application-defined font collection loader. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(RegisterFontCollectionLoader)( + IDWriteFontCollectionLoader* fontCollectionLoader + ) PURE; + + /// + /// Unregisters a custom font collection loader that was previously registered using RegisterFontCollectionLoader. + /// + /// Application-defined font collection loader. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(UnregisterFontCollectionLoader)( + IDWriteFontCollectionLoader* fontCollectionLoader + ) PURE; + + /// + /// CreateFontFileReference creates a font file reference object from a local font file. + /// + /// Absolute file path. Subsequent operations on the constructed object may fail + /// if the user provided filePath doesn't correspond to a valid file on the disk. + /// Last modified time of the input file path. If the parameter is omitted, + /// the function will access the font file to obtain its last write time, so the clients are encouraged to specify this value + /// to avoid extra disk access. Subsequent operations on the constructed object may fail + /// if the user provided lastWriteTime doesn't match the file on the disk. + /// Contains newly created font file reference object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateFontFileReference)( + __in_z WCHAR const* filePath, + __in_opt FILETIME const* lastWriteTime, + __out IDWriteFontFile** fontFile + ) PURE; + + /// + /// CreateCustomFontFileReference creates a reference to an application specific font file resource. + /// This function enables an application or a document to use a font without having to install it on the system. + /// The fontFileReferenceKey has to be unique only in the scope of the fontFileLoader used in this call. + /// + /// Font file reference key that uniquely identifies the font file resource + /// during the lifetime of fontFileLoader. + /// Size of font file reference key in bytes. + /// Font file loader that will be used by the font system to load data from the file identified by + /// fontFileReferenceKey. + /// Contains the newly created font file object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + /// + /// This function is provided for cases when an application or a document needs to use a font + /// without having to install it on the system. fontFileReferenceKey has to be unique only in the scope + /// of the fontFileLoader used in this call. + /// + STDMETHOD(CreateCustomFontFileReference)( + __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, + UINT32 fontFileReferenceKeySize, + IDWriteFontFileLoader* fontFileLoader, + __out IDWriteFontFile** fontFile + ) PURE; + + /// + /// Creates a font face object. + /// + /// The file format of the font face. + /// The number of font files require to represent the font face. + /// Font files representing the font face. Since IDWriteFontFace maintains its own references + /// to the input font file objects, it's OK to release them after this call. + /// The zero based index of a font face in cases when the font files contain a collection of font faces. + /// If the font files contain a single face, this value should be zero. + /// Font face simulation flags for algorithmic emboldening and italicization. + /// Contains the newly created font face object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateFontFace)( + DWRITE_FONT_FACE_TYPE fontFaceType, + UINT32 numberOfFiles, + __in_ecount(numberOfFiles) IDWriteFontFile* const* fontFiles, + UINT32 faceIndex, + DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags, + __out IDWriteFontFace** fontFace + ) PURE; + + /// + /// Creates a rendering parameters object with default settings for the primary monitor. + /// + /// Holds the newly created rendering parameters object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateRenderingParams)( + __out IDWriteRenderingParams** renderingParams + ) PURE; + + /// + /// Creates a rendering parameters object with default settings for the specified monitor. + /// + /// The monitor to read the default values from. + /// Holds the newly created rendering parameters object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateMonitorRenderingParams)( + HMONITOR monitor, + __out IDWriteRenderingParams** renderingParams + ) PURE; + + /// + /// Creates a rendering parameters object with the specified properties. + /// + /// The gamma value used for gamma correction, which must be greater than zero and cannot exceed 256. + /// The amount of contrast enhancement, zero or greater. + /// The degree of ClearType level, from 0.0f (no ClearType) to 1.0f (full ClearType). + /// The geometry of a device pixel. + /// Method of rendering glyphs. In most cases, this should be DWRITE_RENDERING_MODE_DEFAULT to automatically use an appropriate mode. + /// Holds the newly created rendering parameters object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateCustomRenderingParams)( + FLOAT gamma, + FLOAT enhancedContrast, + FLOAT clearTypeLevel, + DWRITE_PIXEL_GEOMETRY pixelGeometry, + DWRITE_RENDERING_MODE renderingMode, + __out IDWriteRenderingParams** renderingParams + ) PURE; + + /// + /// Registers a font file loader with DirectWrite. + /// + /// Pointer to the implementation of the IDWriteFontFileLoader for a particular file resource type. + /// + /// Standard HRESULT error code. + /// + /// + /// This function registers a font file loader with DirectWrite. + /// Font file loader interface handles loading font file resources of a particular type from a key. + /// The font file loader interface is recommended to be implemented by a singleton object. + /// A given instance can only be registered once. + /// Succeeding attempts will return an error that it has already been registered. + /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite + /// inside their constructors and must not unregister themselves in their destructors, because + /// registration and unregistraton operations increment and decrement the object reference count respectively. + /// Instead, registration and unregistration of font file loaders with DirectWrite should be performed + /// outside of the font file loader implementation as a separate step. + /// + STDMETHOD(RegisterFontFileLoader)( + IDWriteFontFileLoader* fontFileLoader + ) PURE; + + /// + /// Unregisters a font file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader. + /// + /// Pointer to the file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader. + /// + /// This function will succeed if the user loader is requested to be removed. + /// It will fail if the pointer to the file loader identifies a standard DirectWrite loader, + /// or a loader that is never registered or has already been unregistered. + /// + /// + /// This function unregisters font file loader callbacks with the DirectWrite font system. + /// The font file loader interface is recommended to be implemented by a singleton object. + /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite + /// inside their constructors and must not unregister themselves in their destructors, because + /// registration and unregistraton operations increment and decrement the object reference count respectively. + /// Instead, registration and unregistration of font file loaders with DirectWrite should be performed + /// outside of the font file loader implementation as a separate step. + /// + STDMETHOD(UnregisterFontFileLoader)( + IDWriteFontFileLoader* fontFileLoader + ) PURE; + + /// + /// Create a text format object used for text layout. + /// + /// Name of the font family + /// Font collection. NULL indicates the system font collection. + /// Font weight + /// Font style + /// Font stretch + /// Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch. + /// Locale name + /// Contains newly created text format object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateTextFormat)( + __in_z WCHAR const* fontFamilyName, + __maybenull IDWriteFontCollection* fontCollection, + DWRITE_FONT_WEIGHT fontWeight, + DWRITE_FONT_STYLE fontStyle, + DWRITE_FONT_STRETCH fontStretch, + FLOAT fontSize, + __in_z WCHAR const* localeName, + __out IDWriteTextFormat** textFormat + ) PURE; + + /// + /// Create a typography object used in conjunction with text format for text layout. + /// + /// Contains newly created typography object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateTypography)( + __out IDWriteTypography** typography + ) PURE; + + /// + /// Create an object used for interoperability with GDI. + /// + /// Receives the GDI interop object if successful, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetGdiInterop)( + __out IDWriteGdiInterop** gdiInterop + ) PURE; + + /// + /// CreateTextLayout takes a string, format, and associated constraints + /// and produces and object representing the fully analyzed + /// and formatted result. + /// + /// The string to layout. + /// The length of the string. + /// The format to apply to the string. + /// Width of the layout box. + /// Height of the layout box. + /// The resultant object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateTextLayout)( + __in_ecount(stringLength) WCHAR const* string, + UINT32 stringLength, + IDWriteTextFormat* textFormat, + FLOAT maxWidth, + FLOAT maxHeight, + __out IDWriteTextLayout** textLayout + ) PURE; + + /// + /// CreateGdiCompatibleTextLayout takes a string, format, and associated constraints + /// and produces and object representing the result formatted for a particular display resolution + /// and measuring method. The resulting text layout should only be used for the intended resolution, + /// and for cases where text scalability is desired, CreateTextLayout should be used instead. + /// + /// The string to layout. + /// The length of the string. + /// The format to apply to the string. + /// Width of the layout box. + /// Height of the layout box. + /// Number of physical pixels per DIP. For example, if rendering onto a 96 DPI device then pixelsPerDip + /// is 1. If rendering onto a 120 DPI device then pixelsPerDip is 120/96. + /// Optional transform applied to the glyphs and their positions. This transform is applied after the + /// scaling specified the font size and pixelsPerDip. + /// + /// When set to FALSE, instructs the text layout to use the same metrics as GDI aliased text. + /// When set to TRUE, instructs the text layout to use the same metrics as text measured by GDI using a font + /// created with CLEARTYPE_NATURAL_QUALITY. + /// + /// The resultant object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateGdiCompatibleTextLayout)( + __in_ecount(stringLength) WCHAR const* string, + UINT32 stringLength, + IDWriteTextFormat* textFormat, + FLOAT layoutWidth, + FLOAT layoutHeight, + FLOAT pixelsPerDip, + __in_opt DWRITE_MATRIX const* transform, + BOOL useGdiNatural, + __out IDWriteTextLayout** textLayout + ) PURE; + + /// + /// The application may call this function to create an inline object for trimming, using an ellipsis as the omission sign. + /// The ellipsis will be created using the current settings of the format, including base font, style, and any effects. + /// Alternate omission signs can be created by the application by implementing IDWriteInlineObject. + /// + /// Text format used as a template for the omission sign. + /// Created omission sign. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateEllipsisTrimmingSign)( + IDWriteTextFormat* textFormat, + __out IDWriteInlineObject** trimmingSign + ) PURE; + + /// + /// Return an interface to perform text analysis with. + /// + /// The resultant object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateTextAnalyzer)( + __out IDWriteTextAnalyzer** textAnalyzer + ) PURE; + + /// + /// Creates a number substitution object using a locale name, + /// substitution method, and whether to ignore user overrides (uses NLS + /// defaults for the given culture instead). + /// + /// Method of number substitution to use. + /// Which locale to obtain the digits from. + /// Ignore the user's settings and use the locale defaults + /// Receives a pointer to the newly created object. + STDMETHOD(CreateNumberSubstitution)( + __in DWRITE_NUMBER_SUBSTITUTION_METHOD substitutionMethod, + __in_z WCHAR const* localeName, + __in BOOL ignoreUserOverride, + __out IDWriteNumberSubstitution** numberSubstitution + ) PURE; + + /// + /// Creates a glyph run analysis object, which encapsulates information + /// used to render a glyph run. + /// + /// Structure specifying the properties of the glyph run. + /// Number of physical pixels per DIP. For example, if rendering onto a 96 DPI bitmap then pixelsPerDip + /// is 1. If rendering onto a 120 DPI bitmap then pixelsPerDip is 120/96. + /// Optional transform applied to the glyphs and their positions. This transform is applied after the + /// scaling specified the emSize and pixelsPerDip. + /// Specifies the rendering mode, which must be one of the raster rendering modes (i.e., not default + /// and not outline). + /// Specifies the method to measure glyphs. + /// Horizontal position of the baseline origin, in DIPs. + /// Vertical position of the baseline origin, in DIPs. + /// Receives a pointer to the newly created object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateGlyphRunAnalysis)( + __in DWRITE_GLYPH_RUN const* glyphRun, + FLOAT pixelsPerDip, + __in_opt DWRITE_MATRIX const* transform, + DWRITE_RENDERING_MODE renderingMode, + DWRITE_MEASURING_MODE measuringMode, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + __out IDWriteGlyphRunAnalysis** glyphRunAnalysis + ) PURE; + +}; // interface IDWriteFactory + +/// +/// Creates a DirectWrite factory object that is used for subsequent creation of individual DirectWrite objects. +/// +/// Identifies whether the factory object will be shared or isolated. +/// Identifies the DirectWrite factory interface, such as __uuidof(IDWriteFactory). +/// Receives the DirectWrite factory object. +/// +/// Standard HRESULT error code. +/// +/// +/// Obtains DirectWrite factory object that is used for subsequent creation of individual DirectWrite classes. +/// DirectWrite factory contains internal state such as font loader registration and cached font data. +/// In most cases it is recommended to use the shared factory object, because it allows multiple components +/// that use DirectWrite to share internal DirectWrite state and reduce memory usage. +/// However, there are cases when it is desirable to reduce the impact of a component, +/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it +/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed +/// component. +/// +EXTERN_C HRESULT DWRITE_EXPORT DWriteCreateFactory( + __in DWRITE_FACTORY_TYPE factoryType, + __in REFIID iid, + __out IUnknown **factory + ); + +// Macros used to define DirectWrite error codes. +#define FACILITY_DWRITE 0x898 +#define DWRITE_ERR_BASE 0x5000 +#define MAKE_DWRITE_HR(severity, code) MAKE_HRESULT(severity, FACILITY_DWRITE, (DWRITE_ERR_BASE + code)) +#define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code) + +/// +/// Indicates an error in an input file such as a font file. +/// +#define DWRITE_E_FILEFORMAT MAKE_DWRITE_HR_ERR(0x000) + +/// +/// Indicates an error originating in DirectWrite code, which is not expected to occur but is safe to recover from. +/// +#define DWRITE_E_UNEXPECTED MAKE_DWRITE_HR_ERR(0x001) + +/// +/// Indicates the specified font does not exist. +/// +#define DWRITE_E_NOFONT MAKE_DWRITE_HR_ERR(0x002) + +/// +/// A font file could not be opened because the file, directory, network location, drive, or other storage +/// location does not exist or is unavailable. +/// +#define DWRITE_E_FILENOTFOUND MAKE_DWRITE_HR_ERR(0x003) + +/// +/// A font file exists but could not be opened due to access denied, sharing violation, or similar error. +/// +#define DWRITE_E_FILEACCESS MAKE_DWRITE_HR_ERR(0x004) + +/// +/// A font collection is obsolete due to changes in the system. +/// +#define DWRITE_E_FONTCOLLECTIONOBSOLETE MAKE_DWRITE_HR_ERR(0x005) + +/// +/// The given interface is already registered. +/// +#define DWRITE_E_ALREADYREGISTERED MAKE_DWRITE_HR_ERR(0x006) + +#endif /* DWRITE_H_INCLUDED */ diff --git a/RenderDll/Dx9Sdk/Include/DXGI.h b/RenderDll/Dx9Sdk/Include/DXGI.h new file mode 100644 index 0000000..1bfb39e --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/DXGI.h @@ -0,0 +1,2901 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __dxgi_h__ +#define __dxgi_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IDXGIObject_FWD_DEFINED__ +#define __IDXGIObject_FWD_DEFINED__ +typedef interface IDXGIObject IDXGIObject; +#endif /* __IDXGIObject_FWD_DEFINED__ */ + + +#ifndef __IDXGIDeviceSubObject_FWD_DEFINED__ +#define __IDXGIDeviceSubObject_FWD_DEFINED__ +typedef interface IDXGIDeviceSubObject IDXGIDeviceSubObject; +#endif /* __IDXGIDeviceSubObject_FWD_DEFINED__ */ + + +#ifndef __IDXGIResource_FWD_DEFINED__ +#define __IDXGIResource_FWD_DEFINED__ +typedef interface IDXGIResource IDXGIResource; +#endif /* __IDXGIResource_FWD_DEFINED__ */ + + +#ifndef __IDXGIKeyedMutex_FWD_DEFINED__ +#define __IDXGIKeyedMutex_FWD_DEFINED__ +typedef interface IDXGIKeyedMutex IDXGIKeyedMutex; +#endif /* __IDXGIKeyedMutex_FWD_DEFINED__ */ + + +#ifndef __IDXGISurface_FWD_DEFINED__ +#define __IDXGISurface_FWD_DEFINED__ +typedef interface IDXGISurface IDXGISurface; +#endif /* __IDXGISurface_FWD_DEFINED__ */ + + +#ifndef __IDXGISurface1_FWD_DEFINED__ +#define __IDXGISurface1_FWD_DEFINED__ +typedef interface IDXGISurface1 IDXGISurface1; +#endif /* __IDXGISurface1_FWD_DEFINED__ */ + + +#ifndef __IDXGIAdapter_FWD_DEFINED__ +#define __IDXGIAdapter_FWD_DEFINED__ +typedef interface IDXGIAdapter IDXGIAdapter; +#endif /* __IDXGIAdapter_FWD_DEFINED__ */ + + +#ifndef __IDXGIOutput_FWD_DEFINED__ +#define __IDXGIOutput_FWD_DEFINED__ +typedef interface IDXGIOutput IDXGIOutput; +#endif /* __IDXGIOutput_FWD_DEFINED__ */ + + +#ifndef __IDXGISwapChain_FWD_DEFINED__ +#define __IDXGISwapChain_FWD_DEFINED__ +typedef interface IDXGISwapChain IDXGISwapChain; +#endif /* __IDXGISwapChain_FWD_DEFINED__ */ + + +#ifndef __IDXGIFactory_FWD_DEFINED__ +#define __IDXGIFactory_FWD_DEFINED__ +typedef interface IDXGIFactory IDXGIFactory; +#endif /* __IDXGIFactory_FWD_DEFINED__ */ + + +#ifndef __IDXGIDevice_FWD_DEFINED__ +#define __IDXGIDevice_FWD_DEFINED__ +typedef interface IDXGIDevice IDXGIDevice; +#endif /* __IDXGIDevice_FWD_DEFINED__ */ + + +#ifndef __IDXGIFactory1_FWD_DEFINED__ +#define __IDXGIFactory1_FWD_DEFINED__ +typedef interface IDXGIFactory1 IDXGIFactory1; +#endif /* __IDXGIFactory1_FWD_DEFINED__ */ + + +#ifndef __IDXGIAdapter1_FWD_DEFINED__ +#define __IDXGIAdapter1_FWD_DEFINED__ +typedef interface IDXGIAdapter1 IDXGIAdapter1; +#endif /* __IDXGIAdapter1_FWD_DEFINED__ */ + + +#ifndef __IDXGIDevice1_FWD_DEFINED__ +#define __IDXGIDevice1_FWD_DEFINED__ +typedef interface IDXGIDevice1 IDXGIDevice1; +#endif /* __IDXGIDevice1_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgitype.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_dxgi_0000_0000 */ +/* [local] */ + +#define DXGI_CPU_ACCESS_NONE ( 0 ) +#define DXGI_CPU_ACCESS_DYNAMIC ( 1 ) +#define DXGI_CPU_ACCESS_READ_WRITE ( 2 ) +#define DXGI_CPU_ACCESS_SCRATCH ( 3 ) +#define DXGI_CPU_ACCESS_FIELD 15 +#define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) ) +#define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) ) +#define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) ) +#define DXGI_USAGE_SHARED ( 1L << (3 + 4) ) +#define DXGI_USAGE_READ_ONLY ( 1L << (4 + 4) ) +#define DXGI_USAGE_DISCARD_ON_PRESENT ( 1L << (5 + 4) ) +#define DXGI_USAGE_UNORDERED_ACCESS ( 1L << (6 + 4) ) +typedef UINT DXGI_USAGE; + +typedef struct DXGI_FRAME_STATISTICS + { + UINT PresentCount; + UINT PresentRefreshCount; + UINT SyncRefreshCount; + LARGE_INTEGER SyncQPCTime; + LARGE_INTEGER SyncGPUTime; + } DXGI_FRAME_STATISTICS; + +typedef struct DXGI_MAPPED_RECT + { + INT Pitch; + BYTE *pBits; + } DXGI_MAPPED_RECT; + +#ifdef __midl +typedef struct _LUID + { + DWORD LowPart; + LONG HighPart; + } LUID; + +typedef struct _LUID *PLUID; + +#endif +typedef struct DXGI_ADAPTER_DESC + { + WCHAR Description[ 128 ]; + UINT VendorId; + UINT DeviceId; + UINT SubSysId; + UINT Revision; + SIZE_T DedicatedVideoMemory; + SIZE_T DedicatedSystemMemory; + SIZE_T SharedSystemMemory; + LUID AdapterLuid; + } DXGI_ADAPTER_DESC; + +#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500) +#define HMONITOR_DECLARED +#if 0 +typedef HANDLE HMONITOR; + +#endif +DECLARE_HANDLE(HMONITOR); +#endif +typedef struct DXGI_OUTPUT_DESC + { + WCHAR DeviceName[ 32 ]; + RECT DesktopCoordinates; + BOOL AttachedToDesktop; + DXGI_MODE_ROTATION Rotation; + HMONITOR Monitor; + } DXGI_OUTPUT_DESC; + +typedef struct DXGI_SHARED_RESOURCE + { + HANDLE Handle; + } DXGI_SHARED_RESOURCE; + +#define DXGI_RESOURCE_PRIORITY_MINIMUM ( 0x28000000 ) + +#define DXGI_RESOURCE_PRIORITY_LOW ( 0x50000000 ) + +#define DXGI_RESOURCE_PRIORITY_NORMAL ( 0x78000000 ) + +#define DXGI_RESOURCE_PRIORITY_HIGH ( 0xa0000000 ) + +#define DXGI_RESOURCE_PRIORITY_MAXIMUM ( 0xc8000000 ) + +typedef +enum DXGI_RESIDENCY + { DXGI_RESIDENCY_FULLY_RESIDENT = 1, + DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2, + DXGI_RESIDENCY_EVICTED_TO_DISK = 3 + } DXGI_RESIDENCY; + +typedef struct DXGI_SURFACE_DESC + { + UINT Width; + UINT Height; + DXGI_FORMAT Format; + DXGI_SAMPLE_DESC SampleDesc; + } DXGI_SURFACE_DESC; + +typedef +enum DXGI_SWAP_EFFECT + { DXGI_SWAP_EFFECT_DISCARD = 0, + DXGI_SWAP_EFFECT_SEQUENTIAL = 1 + } DXGI_SWAP_EFFECT; + +typedef +enum DXGI_SWAP_CHAIN_FLAG + { DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1, + DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2, + DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4 + } DXGI_SWAP_CHAIN_FLAG; + +typedef struct DXGI_SWAP_CHAIN_DESC + { + DXGI_MODE_DESC BufferDesc; + DXGI_SAMPLE_DESC SampleDesc; + DXGI_USAGE BufferUsage; + UINT BufferCount; + HWND OutputWindow; + BOOL Windowed; + DXGI_SWAP_EFFECT SwapEffect; + UINT Flags; + } DXGI_SWAP_CHAIN_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0000_v0_0_s_ifspec; + +#ifndef __IDXGIObject_INTERFACE_DEFINED__ +#define __IDXGIObject_INTERFACE_DEFINED__ + +/* interface IDXGIObject */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIObject; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("aec22fb8-76f3-4639-9be0-28eb43a67a2e") + IDXGIObject : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetParent( + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIObjectVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIObject * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIObject * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIObject * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIObject * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIObject * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIObject * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIObject * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + END_INTERFACE + } IDXGIObjectVtbl; + + interface IDXGIObject + { + CONST_VTBL struct IDXGIObjectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIObject_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIObject_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIObject_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIObject_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIObject_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIObject_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIObject_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIObject_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGIDeviceSubObject_INTERFACE_DEFINED__ +#define __IDXGIDeviceSubObject_INTERFACE_DEFINED__ + +/* interface IDXGIDeviceSubObject */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIDeviceSubObject; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3d3e0379-f9de-4d58-bb6c-18d62992f1a6") + IDXGIDeviceSubObject : public IDXGIObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDevice( + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppDevice) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIDeviceSubObjectVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIDeviceSubObject * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIDeviceSubObject * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIDeviceSubObject * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIDeviceSubObject * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIDeviceSubObject * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIDeviceSubObject * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIDeviceSubObject * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGIDeviceSubObject * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppDevice); + + END_INTERFACE + } IDXGIDeviceSubObjectVtbl; + + interface IDXGIDeviceSubObject + { + CONST_VTBL struct IDXGIDeviceSubObjectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIDeviceSubObject_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIDeviceSubObject_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIDeviceSubObject_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIDeviceSubObject_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIDeviceSubObject_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIDeviceSubObject_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIDeviceSubObject_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIDeviceSubObject_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIDeviceSubObject_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGIResource_INTERFACE_DEFINED__ +#define __IDXGIResource_INTERFACE_DEFINED__ + +/* interface IDXGIResource */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIResource; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("035f3ab4-482e-4e50-b41f-8a7f8bd8960b") + IDXGIResource : public IDXGIDeviceSubObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetSharedHandle( + /* [annotation][out] */ + __out HANDLE *pSharedHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetUsage( + /* [annotation][out] */ + __out DXGI_USAGE *pUsage) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetEvictionPriority( + /* [in] */ UINT EvictionPriority) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetEvictionPriority( + /* [annotation][retval][out] */ + __out UINT *pEvictionPriority) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIResourceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIResource * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIResource * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIResource * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIResource * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIResource * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIResource * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIResource * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGIResource * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetSharedHandle )( + IDXGIResource * This, + /* [annotation][out] */ + __out HANDLE *pSharedHandle); + + HRESULT ( STDMETHODCALLTYPE *GetUsage )( + IDXGIResource * This, + /* [annotation][out] */ + __out DXGI_USAGE *pUsage); + + HRESULT ( STDMETHODCALLTYPE *SetEvictionPriority )( + IDXGIResource * This, + /* [in] */ UINT EvictionPriority); + + HRESULT ( STDMETHODCALLTYPE *GetEvictionPriority )( + IDXGIResource * This, + /* [annotation][retval][out] */ + __out UINT *pEvictionPriority); + + END_INTERFACE + } IDXGIResourceVtbl; + + interface IDXGIResource + { + CONST_VTBL struct IDXGIResourceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIResource_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIResource_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIResource_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIResource_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIResource_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIResource_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIResource_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIResource_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + + +#define IDXGIResource_GetSharedHandle(This,pSharedHandle) \ + ( (This)->lpVtbl -> GetSharedHandle(This,pSharedHandle) ) + +#define IDXGIResource_GetUsage(This,pUsage) \ + ( (This)->lpVtbl -> GetUsage(This,pUsage) ) + +#define IDXGIResource_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define IDXGIResource_GetEvictionPriority(This,pEvictionPriority) \ + ( (This)->lpVtbl -> GetEvictionPriority(This,pEvictionPriority) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIResource_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGIKeyedMutex_INTERFACE_DEFINED__ +#define __IDXGIKeyedMutex_INTERFACE_DEFINED__ + +/* interface IDXGIKeyedMutex */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIKeyedMutex; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9d8e1289-d7b3-465f-8126-250e349af85d") + IDXGIKeyedMutex : public IDXGIDeviceSubObject + { + public: + virtual HRESULT STDMETHODCALLTYPE AcquireSync( + /* [in] */ UINT64 Key, + /* [in] */ DWORD dwMilliseconds) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReleaseSync( + /* [in] */ UINT64 Key) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIKeyedMutexVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIKeyedMutex * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIKeyedMutex * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIKeyedMutex * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIKeyedMutex * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIKeyedMutex * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIKeyedMutex * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIKeyedMutex * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGIKeyedMutex * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *AcquireSync )( + IDXGIKeyedMutex * This, + /* [in] */ UINT64 Key, + /* [in] */ DWORD dwMilliseconds); + + HRESULT ( STDMETHODCALLTYPE *ReleaseSync )( + IDXGIKeyedMutex * This, + /* [in] */ UINT64 Key); + + END_INTERFACE + } IDXGIKeyedMutexVtbl; + + interface IDXGIKeyedMutex + { + CONST_VTBL struct IDXGIKeyedMutexVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIKeyedMutex_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIKeyedMutex_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIKeyedMutex_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIKeyedMutex_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIKeyedMutex_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIKeyedMutex_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIKeyedMutex_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIKeyedMutex_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + + +#define IDXGIKeyedMutex_AcquireSync(This,Key,dwMilliseconds) \ + ( (This)->lpVtbl -> AcquireSync(This,Key,dwMilliseconds) ) + +#define IDXGIKeyedMutex_ReleaseSync(This,Key) \ + ( (This)->lpVtbl -> ReleaseSync(This,Key) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIKeyedMutex_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0004 */ +/* [local] */ + +#define DXGI_MAP_READ ( 1UL ) + +#define DXGI_MAP_WRITE ( 2UL ) + +#define DXGI_MAP_DISCARD ( 4UL ) + + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0004_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0004_v0_0_s_ifspec; + +#ifndef __IDXGISurface_INTERFACE_DEFINED__ +#define __IDXGISurface_INTERFACE_DEFINED__ + +/* interface IDXGISurface */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGISurface; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("cafcb56c-6ac3-4889-bf47-9e23bbd260ec") + IDXGISurface : public IDXGIDeviceSubObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDesc( + /* [annotation][out] */ + __out DXGI_SURFACE_DESC *pDesc) = 0; + + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation][out] */ + __out DXGI_MAPPED_RECT *pLockedRect, + /* [in] */ UINT MapFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE Unmap( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGISurfaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGISurface * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGISurface * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGISurface * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGISurface * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGISurface * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGISurface * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGISurface * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGISurface * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGISurface * This, + /* [annotation][out] */ + __out DXGI_SURFACE_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *Map )( + IDXGISurface * This, + /* [annotation][out] */ + __out DXGI_MAPPED_RECT *pLockedRect, + /* [in] */ UINT MapFlags); + + HRESULT ( STDMETHODCALLTYPE *Unmap )( + IDXGISurface * This); + + END_INTERFACE + } IDXGISurfaceVtbl; + + interface IDXGISurface + { + CONST_VTBL struct IDXGISurfaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGISurface_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGISurface_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGISurface_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGISurface_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGISurface_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGISurface_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGISurface_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGISurface_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + + +#define IDXGISurface_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGISurface_Map(This,pLockedRect,MapFlags) \ + ( (This)->lpVtbl -> Map(This,pLockedRect,MapFlags) ) + +#define IDXGISurface_Unmap(This) \ + ( (This)->lpVtbl -> Unmap(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGISurface_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGISurface1_INTERFACE_DEFINED__ +#define __IDXGISurface1_INTERFACE_DEFINED__ + +/* interface IDXGISurface1 */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGISurface1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4AE63092-6327-4c1b-80AE-BFE12EA32B86") + IDXGISurface1 : public IDXGISurface + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDC( + /* [in] */ BOOL Discard, + /* [annotation][out] */ + __out HDC *phdc) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReleaseDC( + /* [annotation][in] */ + __in_opt RECT *pDirtyRect) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGISurface1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGISurface1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGISurface1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGISurface1 * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGISurface1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGISurface1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGISurface1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGISurface1 * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGISurface1 * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGISurface1 * This, + /* [annotation][out] */ + __out DXGI_SURFACE_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *Map )( + IDXGISurface1 * This, + /* [annotation][out] */ + __out DXGI_MAPPED_RECT *pLockedRect, + /* [in] */ UINT MapFlags); + + HRESULT ( STDMETHODCALLTYPE *Unmap )( + IDXGISurface1 * This); + + HRESULT ( STDMETHODCALLTYPE *GetDC )( + IDXGISurface1 * This, + /* [in] */ BOOL Discard, + /* [annotation][out] */ + __out HDC *phdc); + + HRESULT ( STDMETHODCALLTYPE *ReleaseDC )( + IDXGISurface1 * This, + /* [annotation][in] */ + __in_opt RECT *pDirtyRect); + + END_INTERFACE + } IDXGISurface1Vtbl; + + interface IDXGISurface1 + { + CONST_VTBL struct IDXGISurface1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGISurface1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGISurface1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGISurface1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGISurface1_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGISurface1_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGISurface1_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGISurface1_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGISurface1_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + + +#define IDXGISurface1_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGISurface1_Map(This,pLockedRect,MapFlags) \ + ( (This)->lpVtbl -> Map(This,pLockedRect,MapFlags) ) + +#define IDXGISurface1_Unmap(This) \ + ( (This)->lpVtbl -> Unmap(This) ) + + +#define IDXGISurface1_GetDC(This,Discard,phdc) \ + ( (This)->lpVtbl -> GetDC(This,Discard,phdc) ) + +#define IDXGISurface1_ReleaseDC(This,pDirtyRect) \ + ( (This)->lpVtbl -> ReleaseDC(This,pDirtyRect) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGISurface1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0006 */ +/* [local] */ + + + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0006_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0006_v0_0_s_ifspec; + +#ifndef __IDXGIAdapter_INTERFACE_DEFINED__ +#define __IDXGIAdapter_INTERFACE_DEFINED__ + +/* interface IDXGIAdapter */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIAdapter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2411e7e1-12ac-4ccf-bd14-9798e8534dc0") + IDXGIAdapter : public IDXGIObject + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumOutputs( + /* [in] */ UINT Output, + /* [annotation][out][in] */ + __out IDXGIOutput **ppOutput) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDesc( + /* [annotation][out] */ + __out DXGI_ADAPTER_DESC *pDesc) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckInterfaceSupport( + /* [annotation][in] */ + __in REFGUID InterfaceName, + /* [annotation][out] */ + __out LARGE_INTEGER *pUMDVersion) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIAdapterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIAdapter * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIAdapter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIAdapter * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIAdapter * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIAdapter * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIAdapter * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIAdapter * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *EnumOutputs )( + IDXGIAdapter * This, + /* [in] */ UINT Output, + /* [annotation][out][in] */ + __out IDXGIOutput **ppOutput); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGIAdapter * This, + /* [annotation][out] */ + __out DXGI_ADAPTER_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )( + IDXGIAdapter * This, + /* [annotation][in] */ + __in REFGUID InterfaceName, + /* [annotation][out] */ + __out LARGE_INTEGER *pUMDVersion); + + END_INTERFACE + } IDXGIAdapterVtbl; + + interface IDXGIAdapter + { + CONST_VTBL struct IDXGIAdapterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIAdapter_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIAdapter_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIAdapter_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIAdapter_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIAdapter_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIAdapter_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIAdapter_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIAdapter_EnumOutputs(This,Output,ppOutput) \ + ( (This)->lpVtbl -> EnumOutputs(This,Output,ppOutput) ) + +#define IDXGIAdapter_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGIAdapter_CheckInterfaceSupport(This,InterfaceName,pUMDVersion) \ + ( (This)->lpVtbl -> CheckInterfaceSupport(This,InterfaceName,pUMDVersion) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIAdapter_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0007 */ +/* [local] */ + +#define DXGI_ENUM_MODES_INTERLACED ( 1UL ) + +#define DXGI_ENUM_MODES_SCALING ( 2UL ) + + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0007_v0_0_s_ifspec; + +#ifndef __IDXGIOutput_INTERFACE_DEFINED__ +#define __IDXGIOutput_INTERFACE_DEFINED__ + +/* interface IDXGIOutput */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIOutput; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ae02eedb-c735-4690-8d52-5a8dc20213aa") + IDXGIOutput : public IDXGIObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDesc( + /* [annotation][out] */ + __out DXGI_OUTPUT_DESC *pDesc) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDisplayModeList( + /* [in] */ DXGI_FORMAT EnumFormat, + /* [in] */ UINT Flags, + /* [annotation][out][in] */ + __inout UINT *pNumModes, + /* [annotation][out] */ + __out_ecount_part_opt(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc) = 0; + + virtual HRESULT STDMETHODCALLTYPE FindClosestMatchingMode( + /* [annotation][in] */ + __in const DXGI_MODE_DESC *pModeToMatch, + /* [annotation][out] */ + __out DXGI_MODE_DESC *pClosestMatch, + /* [annotation][in] */ + __in_opt IUnknown *pConcernedDevice) = 0; + + virtual HRESULT STDMETHODCALLTYPE WaitForVBlank( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE TakeOwnership( + /* [annotation][in] */ + __in IUnknown *pDevice, + BOOL Exclusive) = 0; + + virtual void STDMETHODCALLTYPE ReleaseOwnership( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGammaControlCapabilities( + /* [annotation][out] */ + __out DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetGammaControl( + /* [annotation][in] */ + __in const DXGI_GAMMA_CONTROL *pArray) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGammaControl( + /* [annotation][out] */ + __out DXGI_GAMMA_CONTROL *pArray) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDisplaySurface( + /* [annotation][in] */ + __in IDXGISurface *pScanoutSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDisplaySurfaceData( + /* [annotation][in] */ + __in IDXGISurface *pDestination) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics( + /* [annotation][out] */ + __out DXGI_FRAME_STATISTICS *pStats) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIOutputVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIOutput * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIOutput * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIOutput * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIOutput * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIOutput * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIOutput * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIOutput * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGIOutput * This, + /* [annotation][out] */ + __out DXGI_OUTPUT_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList )( + IDXGIOutput * This, + /* [in] */ DXGI_FORMAT EnumFormat, + /* [in] */ UINT Flags, + /* [annotation][out][in] */ + __inout UINT *pNumModes, + /* [annotation][out] */ + __out_ecount_part_opt(*pNumModes,*pNumModes) DXGI_MODE_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode )( + IDXGIOutput * This, + /* [annotation][in] */ + __in const DXGI_MODE_DESC *pModeToMatch, + /* [annotation][out] */ + __out DXGI_MODE_DESC *pClosestMatch, + /* [annotation][in] */ + __in_opt IUnknown *pConcernedDevice); + + HRESULT ( STDMETHODCALLTYPE *WaitForVBlank )( + IDXGIOutput * This); + + HRESULT ( STDMETHODCALLTYPE *TakeOwnership )( + IDXGIOutput * This, + /* [annotation][in] */ + __in IUnknown *pDevice, + BOOL Exclusive); + + void ( STDMETHODCALLTYPE *ReleaseOwnership )( + IDXGIOutput * This); + + HRESULT ( STDMETHODCALLTYPE *GetGammaControlCapabilities )( + IDXGIOutput * This, + /* [annotation][out] */ + __out DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps); + + HRESULT ( STDMETHODCALLTYPE *SetGammaControl )( + IDXGIOutput * This, + /* [annotation][in] */ + __in const DXGI_GAMMA_CONTROL *pArray); + + HRESULT ( STDMETHODCALLTYPE *GetGammaControl )( + IDXGIOutput * This, + /* [annotation][out] */ + __out DXGI_GAMMA_CONTROL *pArray); + + HRESULT ( STDMETHODCALLTYPE *SetDisplaySurface )( + IDXGIOutput * This, + /* [annotation][in] */ + __in IDXGISurface *pScanoutSurface); + + HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData )( + IDXGIOutput * This, + /* [annotation][in] */ + __in IDXGISurface *pDestination); + + HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )( + IDXGIOutput * This, + /* [annotation][out] */ + __out DXGI_FRAME_STATISTICS *pStats); + + END_INTERFACE + } IDXGIOutputVtbl; + + interface IDXGIOutput + { + CONST_VTBL struct IDXGIOutputVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIOutput_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIOutput_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIOutput_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIOutput_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIOutput_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIOutput_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIOutput_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIOutput_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGIOutput_GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) \ + ( (This)->lpVtbl -> GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) ) + +#define IDXGIOutput_FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) \ + ( (This)->lpVtbl -> FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) ) + +#define IDXGIOutput_WaitForVBlank(This) \ + ( (This)->lpVtbl -> WaitForVBlank(This) ) + +#define IDXGIOutput_TakeOwnership(This,pDevice,Exclusive) \ + ( (This)->lpVtbl -> TakeOwnership(This,pDevice,Exclusive) ) + +#define IDXGIOutput_ReleaseOwnership(This) \ + ( (This)->lpVtbl -> ReleaseOwnership(This) ) + +#define IDXGIOutput_GetGammaControlCapabilities(This,pGammaCaps) \ + ( (This)->lpVtbl -> GetGammaControlCapabilities(This,pGammaCaps) ) + +#define IDXGIOutput_SetGammaControl(This,pArray) \ + ( (This)->lpVtbl -> SetGammaControl(This,pArray) ) + +#define IDXGIOutput_GetGammaControl(This,pArray) \ + ( (This)->lpVtbl -> GetGammaControl(This,pArray) ) + +#define IDXGIOutput_SetDisplaySurface(This,pScanoutSurface) \ + ( (This)->lpVtbl -> SetDisplaySurface(This,pScanoutSurface) ) + +#define IDXGIOutput_GetDisplaySurfaceData(This,pDestination) \ + ( (This)->lpVtbl -> GetDisplaySurfaceData(This,pDestination) ) + +#define IDXGIOutput_GetFrameStatistics(This,pStats) \ + ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIOutput_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0008 */ +/* [local] */ + +#define DXGI_MAX_SWAP_CHAIN_BUFFERS ( 16 ) +#define DXGI_PRESENT_TEST 0x00000001UL +#define DXGI_PRESENT_DO_NOT_SEQUENCE 0x00000002UL +#define DXGI_PRESENT_RESTART 0x00000004UL + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0008_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0008_v0_0_s_ifspec; + +#ifndef __IDXGISwapChain_INTERFACE_DEFINED__ +#define __IDXGISwapChain_INTERFACE_DEFINED__ + +/* interface IDXGISwapChain */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGISwapChain; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("310d36a0-d2e7-4c0a-aa04-6a9d23b8886a") + IDXGISwapChain : public IDXGIDeviceSubObject + { + public: + virtual HRESULT STDMETHODCALLTYPE Present( + /* [in] */ UINT SyncInterval, + /* [in] */ UINT Flags) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetBuffer( + /* [in] */ UINT Buffer, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][out][in] */ + __out void **ppSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetFullscreenState( + /* [in] */ BOOL Fullscreen, + /* [annotation][in] */ + __in_opt IDXGIOutput *pTarget) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFullscreenState( + /* [annotation][out] */ + __out BOOL *pFullscreen, + /* [annotation][out] */ + __out IDXGIOutput **ppTarget) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDesc( + /* [annotation][out] */ + __out DXGI_SWAP_CHAIN_DESC *pDesc) = 0; + + virtual HRESULT STDMETHODCALLTYPE ResizeBuffers( + /* [in] */ UINT BufferCount, + /* [in] */ UINT Width, + /* [in] */ UINT Height, + /* [in] */ DXGI_FORMAT NewFormat, + /* [in] */ UINT SwapChainFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE ResizeTarget( + /* [annotation][in] */ + __in const DXGI_MODE_DESC *pNewTargetParameters) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetContainingOutput( + /* [annotation][out] */ + __out IDXGIOutput **ppOutput) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics( + /* [annotation][out] */ + __out DXGI_FRAME_STATISTICS *pStats) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetLastPresentCount( + /* [annotation][out] */ + __out UINT *pLastPresentCount) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGISwapChainVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGISwapChain * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGISwapChain * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGISwapChain * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGISwapChain * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGISwapChain * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGISwapChain * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGISwapChain * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGISwapChain * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *Present )( + IDXGISwapChain * This, + /* [in] */ UINT SyncInterval, + /* [in] */ UINT Flags); + + HRESULT ( STDMETHODCALLTYPE *GetBuffer )( + IDXGISwapChain * This, + /* [in] */ UINT Buffer, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][out][in] */ + __out void **ppSurface); + + HRESULT ( STDMETHODCALLTYPE *SetFullscreenState )( + IDXGISwapChain * This, + /* [in] */ BOOL Fullscreen, + /* [annotation][in] */ + __in_opt IDXGIOutput *pTarget); + + HRESULT ( STDMETHODCALLTYPE *GetFullscreenState )( + IDXGISwapChain * This, + /* [annotation][out] */ + __out BOOL *pFullscreen, + /* [annotation][out] */ + __out IDXGIOutput **ppTarget); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGISwapChain * This, + /* [annotation][out] */ + __out DXGI_SWAP_CHAIN_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *ResizeBuffers )( + IDXGISwapChain * This, + /* [in] */ UINT BufferCount, + /* [in] */ UINT Width, + /* [in] */ UINT Height, + /* [in] */ DXGI_FORMAT NewFormat, + /* [in] */ UINT SwapChainFlags); + + HRESULT ( STDMETHODCALLTYPE *ResizeTarget )( + IDXGISwapChain * This, + /* [annotation][in] */ + __in const DXGI_MODE_DESC *pNewTargetParameters); + + HRESULT ( STDMETHODCALLTYPE *GetContainingOutput )( + IDXGISwapChain * This, + /* [annotation][out] */ + __out IDXGIOutput **ppOutput); + + HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )( + IDXGISwapChain * This, + /* [annotation][out] */ + __out DXGI_FRAME_STATISTICS *pStats); + + HRESULT ( STDMETHODCALLTYPE *GetLastPresentCount )( + IDXGISwapChain * This, + /* [annotation][out] */ + __out UINT *pLastPresentCount); + + END_INTERFACE + } IDXGISwapChainVtbl; + + interface IDXGISwapChain + { + CONST_VTBL struct IDXGISwapChainVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGISwapChain_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGISwapChain_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGISwapChain_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGISwapChain_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGISwapChain_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGISwapChain_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGISwapChain_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGISwapChain_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + + +#define IDXGISwapChain_Present(This,SyncInterval,Flags) \ + ( (This)->lpVtbl -> Present(This,SyncInterval,Flags) ) + +#define IDXGISwapChain_GetBuffer(This,Buffer,riid,ppSurface) \ + ( (This)->lpVtbl -> GetBuffer(This,Buffer,riid,ppSurface) ) + +#define IDXGISwapChain_SetFullscreenState(This,Fullscreen,pTarget) \ + ( (This)->lpVtbl -> SetFullscreenState(This,Fullscreen,pTarget) ) + +#define IDXGISwapChain_GetFullscreenState(This,pFullscreen,ppTarget) \ + ( (This)->lpVtbl -> GetFullscreenState(This,pFullscreen,ppTarget) ) + +#define IDXGISwapChain_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGISwapChain_ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) \ + ( (This)->lpVtbl -> ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) ) + +#define IDXGISwapChain_ResizeTarget(This,pNewTargetParameters) \ + ( (This)->lpVtbl -> ResizeTarget(This,pNewTargetParameters) ) + +#define IDXGISwapChain_GetContainingOutput(This,ppOutput) \ + ( (This)->lpVtbl -> GetContainingOutput(This,ppOutput) ) + +#define IDXGISwapChain_GetFrameStatistics(This,pStats) \ + ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) ) + +#define IDXGISwapChain_GetLastPresentCount(This,pLastPresentCount) \ + ( (This)->lpVtbl -> GetLastPresentCount(This,pLastPresentCount) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGISwapChain_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0009 */ +/* [local] */ + +#define DXGI_MWA_NO_WINDOW_CHANGES ( 1 << 0 ) +#define DXGI_MWA_NO_ALT_ENTER ( 1 << 1 ) +#define DXGI_MWA_NO_PRINT_SCREEN ( 1 << 2 ) +#define DXGI_MWA_VALID ( 0x7 ) + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0009_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0009_v0_0_s_ifspec; + +#ifndef __IDXGIFactory_INTERFACE_DEFINED__ +#define __IDXGIFactory_INTERFACE_DEFINED__ + +/* interface IDXGIFactory */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7b7166ec-21c7-44ae-b21a-c9ae321ae369") + IDXGIFactory : public IDXGIObject + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumAdapters( + /* [in] */ UINT Adapter, + /* [annotation][out] */ + __out IDXGIAdapter **ppAdapter) = 0; + + virtual HRESULT STDMETHODCALLTYPE MakeWindowAssociation( + HWND WindowHandle, + UINT Flags) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetWindowAssociation( + /* [annotation][out] */ + __out HWND *pWindowHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSwapChain( + /* [annotation][in] */ + __in IUnknown *pDevice, + /* [annotation][in] */ + __in DXGI_SWAP_CHAIN_DESC *pDesc, + /* [annotation][out] */ + __out IDXGISwapChain **ppSwapChain) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSoftwareAdapter( + /* [in] */ HMODULE Module, + /* [annotation][out] */ + __out IDXGIAdapter **ppAdapter) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIFactory * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIFactory * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIFactory * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIFactory * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIFactory * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *EnumAdapters )( + IDXGIFactory * This, + /* [in] */ UINT Adapter, + /* [annotation][out] */ + __out IDXGIAdapter **ppAdapter); + + HRESULT ( STDMETHODCALLTYPE *MakeWindowAssociation )( + IDXGIFactory * This, + HWND WindowHandle, + UINT Flags); + + HRESULT ( STDMETHODCALLTYPE *GetWindowAssociation )( + IDXGIFactory * This, + /* [annotation][out] */ + __out HWND *pWindowHandle); + + HRESULT ( STDMETHODCALLTYPE *CreateSwapChain )( + IDXGIFactory * This, + /* [annotation][in] */ + __in IUnknown *pDevice, + /* [annotation][in] */ + __in DXGI_SWAP_CHAIN_DESC *pDesc, + /* [annotation][out] */ + __out IDXGISwapChain **ppSwapChain); + + HRESULT ( STDMETHODCALLTYPE *CreateSoftwareAdapter )( + IDXGIFactory * This, + /* [in] */ HMODULE Module, + /* [annotation][out] */ + __out IDXGIAdapter **ppAdapter); + + END_INTERFACE + } IDXGIFactoryVtbl; + + interface IDXGIFactory + { + CONST_VTBL struct IDXGIFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIFactory_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIFactory_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIFactory_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIFactory_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIFactory_EnumAdapters(This,Adapter,ppAdapter) \ + ( (This)->lpVtbl -> EnumAdapters(This,Adapter,ppAdapter) ) + +#define IDXGIFactory_MakeWindowAssociation(This,WindowHandle,Flags) \ + ( (This)->lpVtbl -> MakeWindowAssociation(This,WindowHandle,Flags) ) + +#define IDXGIFactory_GetWindowAssociation(This,pWindowHandle) \ + ( (This)->lpVtbl -> GetWindowAssociation(This,pWindowHandle) ) + +#define IDXGIFactory_CreateSwapChain(This,pDevice,pDesc,ppSwapChain) \ + ( (This)->lpVtbl -> CreateSwapChain(This,pDevice,pDesc,ppSwapChain) ) + +#define IDXGIFactory_CreateSoftwareAdapter(This,Module,ppAdapter) \ + ( (This)->lpVtbl -> CreateSoftwareAdapter(This,Module,ppAdapter) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIFactory_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0010 */ +/* [local] */ + +HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **ppFactory); +HRESULT WINAPI CreateDXGIFactory1(REFIID riid, void **ppFactory); + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0010_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0010_v0_0_s_ifspec; + +#ifndef __IDXGIDevice_INTERFACE_DEFINED__ +#define __IDXGIDevice_INTERFACE_DEFINED__ + +/* interface IDXGIDevice */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("54ec77fa-1377-44e6-8c32-88fd5f44c84c") + IDXGIDevice : public IDXGIObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetAdapter( + /* [annotation][out] */ + __out IDXGIAdapter **pAdapter) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSurface( + /* [annotation][in] */ + __in const DXGI_SURFACE_DESC *pDesc, + /* [in] */ UINT NumSurfaces, + /* [in] */ DXGI_USAGE Usage, + /* [annotation][in] */ + __in_opt const DXGI_SHARED_RESOURCE *pSharedResource, + /* [annotation][out] */ + __out IDXGISurface **ppSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE QueryResourceResidency( + /* [annotation][size_is][in] */ + __in_ecount(NumResources) IUnknown *const *ppResources, + /* [annotation][size_is][out] */ + __out_ecount(NumResources) DXGI_RESIDENCY *pResidencyStatus, + /* [in] */ UINT NumResources) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetGPUThreadPriority( + /* [in] */ INT Priority) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGPUThreadPriority( + /* [annotation][retval][out] */ + __out INT *pPriority) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIDeviceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIDevice * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIDevice * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIDevice * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIDevice * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIDevice * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIDevice * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIDevice * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetAdapter )( + IDXGIDevice * This, + /* [annotation][out] */ + __out IDXGIAdapter **pAdapter); + + HRESULT ( STDMETHODCALLTYPE *CreateSurface )( + IDXGIDevice * This, + /* [annotation][in] */ + __in const DXGI_SURFACE_DESC *pDesc, + /* [in] */ UINT NumSurfaces, + /* [in] */ DXGI_USAGE Usage, + /* [annotation][in] */ + __in_opt const DXGI_SHARED_RESOURCE *pSharedResource, + /* [annotation][out] */ + __out IDXGISurface **ppSurface); + + HRESULT ( STDMETHODCALLTYPE *QueryResourceResidency )( + IDXGIDevice * This, + /* [annotation][size_is][in] */ + __in_ecount(NumResources) IUnknown *const *ppResources, + /* [annotation][size_is][out] */ + __out_ecount(NumResources) DXGI_RESIDENCY *pResidencyStatus, + /* [in] */ UINT NumResources); + + HRESULT ( STDMETHODCALLTYPE *SetGPUThreadPriority )( + IDXGIDevice * This, + /* [in] */ INT Priority); + + HRESULT ( STDMETHODCALLTYPE *GetGPUThreadPriority )( + IDXGIDevice * This, + /* [annotation][retval][out] */ + __out INT *pPriority); + + END_INTERFACE + } IDXGIDeviceVtbl; + + interface IDXGIDevice + { + CONST_VTBL struct IDXGIDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIDevice_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIDevice_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIDevice_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIDevice_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIDevice_GetAdapter(This,pAdapter) \ + ( (This)->lpVtbl -> GetAdapter(This,pAdapter) ) + +#define IDXGIDevice_CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) \ + ( (This)->lpVtbl -> CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) ) + +#define IDXGIDevice_QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) \ + ( (This)->lpVtbl -> QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) ) + +#define IDXGIDevice_SetGPUThreadPriority(This,Priority) \ + ( (This)->lpVtbl -> SetGPUThreadPriority(This,Priority) ) + +#define IDXGIDevice_GetGPUThreadPriority(This,pPriority) \ + ( (This)->lpVtbl -> GetGPUThreadPriority(This,pPriority) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIDevice_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0011 */ +/* [local] */ + +typedef +enum DXGI_ADAPTER_FLAG + { DXGI_ADAPTER_FLAG_NONE = 0, + DXGI_ADAPTER_FLAG_REMOTE = 1, + DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xffffffff + } DXGI_ADAPTER_FLAG; + +typedef struct DXGI_ADAPTER_DESC1 + { + WCHAR Description[ 128 ]; + UINT VendorId; + UINT DeviceId; + UINT SubSysId; + UINT Revision; + SIZE_T DedicatedVideoMemory; + SIZE_T DedicatedSystemMemory; + SIZE_T SharedSystemMemory; + LUID AdapterLuid; + UINT Flags; + } DXGI_ADAPTER_DESC1; + +typedef struct DXGI_DISPLAY_COLOR_SPACE + { + FLOAT PrimaryCoordinates[ 8 ][ 2 ]; + FLOAT WhitePoints[ 16 ][ 2 ]; + } DXGI_DISPLAY_COLOR_SPACE; + + + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0011_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0011_v0_0_s_ifspec; + +#ifndef __IDXGIFactory1_INTERFACE_DEFINED__ +#define __IDXGIFactory1_INTERFACE_DEFINED__ + +/* interface IDXGIFactory1 */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIFactory1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("770aae78-f26f-4dba-a829-253c83d1b387") + IDXGIFactory1 : public IDXGIFactory + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumAdapters1( + /* [in] */ UINT Adapter, + /* [annotation][out] */ + __out IDXGIAdapter1 **ppAdapter) = 0; + + virtual BOOL STDMETHODCALLTYPE IsCurrent( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIFactory1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIFactory1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIFactory1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIFactory1 * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIFactory1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIFactory1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIFactory1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIFactory1 * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *EnumAdapters )( + IDXGIFactory1 * This, + /* [in] */ UINT Adapter, + /* [annotation][out] */ + __out IDXGIAdapter **ppAdapter); + + HRESULT ( STDMETHODCALLTYPE *MakeWindowAssociation )( + IDXGIFactory1 * This, + HWND WindowHandle, + UINT Flags); + + HRESULT ( STDMETHODCALLTYPE *GetWindowAssociation )( + IDXGIFactory1 * This, + /* [annotation][out] */ + __out HWND *pWindowHandle); + + HRESULT ( STDMETHODCALLTYPE *CreateSwapChain )( + IDXGIFactory1 * This, + /* [annotation][in] */ + __in IUnknown *pDevice, + /* [annotation][in] */ + __in DXGI_SWAP_CHAIN_DESC *pDesc, + /* [annotation][out] */ + __out IDXGISwapChain **ppSwapChain); + + HRESULT ( STDMETHODCALLTYPE *CreateSoftwareAdapter )( + IDXGIFactory1 * This, + /* [in] */ HMODULE Module, + /* [annotation][out] */ + __out IDXGIAdapter **ppAdapter); + + HRESULT ( STDMETHODCALLTYPE *EnumAdapters1 )( + IDXGIFactory1 * This, + /* [in] */ UINT Adapter, + /* [annotation][out] */ + __out IDXGIAdapter1 **ppAdapter); + + BOOL ( STDMETHODCALLTYPE *IsCurrent )( + IDXGIFactory1 * This); + + END_INTERFACE + } IDXGIFactory1Vtbl; + + interface IDXGIFactory1 + { + CONST_VTBL struct IDXGIFactory1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIFactory1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIFactory1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIFactory1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIFactory1_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIFactory1_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIFactory1_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIFactory1_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIFactory1_EnumAdapters(This,Adapter,ppAdapter) \ + ( (This)->lpVtbl -> EnumAdapters(This,Adapter,ppAdapter) ) + +#define IDXGIFactory1_MakeWindowAssociation(This,WindowHandle,Flags) \ + ( (This)->lpVtbl -> MakeWindowAssociation(This,WindowHandle,Flags) ) + +#define IDXGIFactory1_GetWindowAssociation(This,pWindowHandle) \ + ( (This)->lpVtbl -> GetWindowAssociation(This,pWindowHandle) ) + +#define IDXGIFactory1_CreateSwapChain(This,pDevice,pDesc,ppSwapChain) \ + ( (This)->lpVtbl -> CreateSwapChain(This,pDevice,pDesc,ppSwapChain) ) + +#define IDXGIFactory1_CreateSoftwareAdapter(This,Module,ppAdapter) \ + ( (This)->lpVtbl -> CreateSoftwareAdapter(This,Module,ppAdapter) ) + + +#define IDXGIFactory1_EnumAdapters1(This,Adapter,ppAdapter) \ + ( (This)->lpVtbl -> EnumAdapters1(This,Adapter,ppAdapter) ) + +#define IDXGIFactory1_IsCurrent(This) \ + ( (This)->lpVtbl -> IsCurrent(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIFactory1_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGIAdapter1_INTERFACE_DEFINED__ +#define __IDXGIAdapter1_INTERFACE_DEFINED__ + +/* interface IDXGIAdapter1 */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIAdapter1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("29038f61-3839-4626-91fd-086879011a05") + IDXGIAdapter1 : public IDXGIAdapter + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDesc1( + /* [annotation][out] */ + __out DXGI_ADAPTER_DESC1 *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIAdapter1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIAdapter1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIAdapter1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIAdapter1 * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIAdapter1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIAdapter1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIAdapter1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIAdapter1 * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *EnumOutputs )( + IDXGIAdapter1 * This, + /* [in] */ UINT Output, + /* [annotation][out][in] */ + __out IDXGIOutput **ppOutput); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGIAdapter1 * This, + /* [annotation][out] */ + __out DXGI_ADAPTER_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )( + IDXGIAdapter1 * This, + /* [annotation][in] */ + __in REFGUID InterfaceName, + /* [annotation][out] */ + __out LARGE_INTEGER *pUMDVersion); + + HRESULT ( STDMETHODCALLTYPE *GetDesc1 )( + IDXGIAdapter1 * This, + /* [annotation][out] */ + __out DXGI_ADAPTER_DESC1 *pDesc); + + END_INTERFACE + } IDXGIAdapter1Vtbl; + + interface IDXGIAdapter1 + { + CONST_VTBL struct IDXGIAdapter1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIAdapter1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIAdapter1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIAdapter1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIAdapter1_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIAdapter1_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIAdapter1_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIAdapter1_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIAdapter1_EnumOutputs(This,Output,ppOutput) \ + ( (This)->lpVtbl -> EnumOutputs(This,Output,ppOutput) ) + +#define IDXGIAdapter1_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGIAdapter1_CheckInterfaceSupport(This,InterfaceName,pUMDVersion) \ + ( (This)->lpVtbl -> CheckInterfaceSupport(This,InterfaceName,pUMDVersion) ) + + +#define IDXGIAdapter1_GetDesc1(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc1(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIAdapter1_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGIDevice1_INTERFACE_DEFINED__ +#define __IDXGIDevice1_INTERFACE_DEFINED__ + +/* interface IDXGIDevice1 */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIDevice1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("77db970f-6276-48ba-ba28-070143b4392c") + IDXGIDevice1 : public IDXGIDevice + { + public: + virtual HRESULT STDMETHODCALLTYPE SetMaximumFrameLatency( + /* [in] */ UINT MaxLatency) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetMaximumFrameLatency( + /* [annotation][out] */ + __out UINT *pMaxLatency) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIDevice1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIDevice1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIDevice1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIDevice1 * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIDevice1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [in] */ UINT DataSize, + /* [annotation][in] */ + __in_bcount(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIDevice1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][in] */ + __in const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIDevice1 * This, + /* [annotation][in] */ + __in REFGUID Name, + /* [annotation][out][in] */ + __inout UINT *pDataSize, + /* [annotation][out] */ + __out_bcount(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIDevice1 * This, + /* [annotation][in] */ + __in REFIID riid, + /* [annotation][retval][out] */ + __out void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetAdapter )( + IDXGIDevice1 * This, + /* [annotation][out] */ + __out IDXGIAdapter **pAdapter); + + HRESULT ( STDMETHODCALLTYPE *CreateSurface )( + IDXGIDevice1 * This, + /* [annotation][in] */ + __in const DXGI_SURFACE_DESC *pDesc, + /* [in] */ UINT NumSurfaces, + /* [in] */ DXGI_USAGE Usage, + /* [annotation][in] */ + __in_opt const DXGI_SHARED_RESOURCE *pSharedResource, + /* [annotation][out] */ + __out IDXGISurface **ppSurface); + + HRESULT ( STDMETHODCALLTYPE *QueryResourceResidency )( + IDXGIDevice1 * This, + /* [annotation][size_is][in] */ + __in_ecount(NumResources) IUnknown *const *ppResources, + /* [annotation][size_is][out] */ + __out_ecount(NumResources) DXGI_RESIDENCY *pResidencyStatus, + /* [in] */ UINT NumResources); + + HRESULT ( STDMETHODCALLTYPE *SetGPUThreadPriority )( + IDXGIDevice1 * This, + /* [in] */ INT Priority); + + HRESULT ( STDMETHODCALLTYPE *GetGPUThreadPriority )( + IDXGIDevice1 * This, + /* [annotation][retval][out] */ + __out INT *pPriority); + + HRESULT ( STDMETHODCALLTYPE *SetMaximumFrameLatency )( + IDXGIDevice1 * This, + /* [in] */ UINT MaxLatency); + + HRESULT ( STDMETHODCALLTYPE *GetMaximumFrameLatency )( + IDXGIDevice1 * This, + /* [annotation][out] */ + __out UINT *pMaxLatency); + + END_INTERFACE + } IDXGIDevice1Vtbl; + + interface IDXGIDevice1 + { + CONST_VTBL struct IDXGIDevice1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIDevice1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIDevice1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIDevice1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIDevice1_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIDevice1_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIDevice1_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIDevice1_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIDevice1_GetAdapter(This,pAdapter) \ + ( (This)->lpVtbl -> GetAdapter(This,pAdapter) ) + +#define IDXGIDevice1_CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) \ + ( (This)->lpVtbl -> CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) ) + +#define IDXGIDevice1_QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) \ + ( (This)->lpVtbl -> QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) ) + +#define IDXGIDevice1_SetGPUThreadPriority(This,Priority) \ + ( (This)->lpVtbl -> SetGPUThreadPriority(This,Priority) ) + +#define IDXGIDevice1_GetGPUThreadPriority(This,pPriority) \ + ( (This)->lpVtbl -> GetGPUThreadPriority(This,pPriority) ) + + +#define IDXGIDevice1_SetMaximumFrameLatency(This,MaxLatency) \ + ( (This)->lpVtbl -> SetMaximumFrameLatency(This,MaxLatency) ) + +#define IDXGIDevice1_GetMaximumFrameLatency(This,pMaxLatency) \ + ( (This)->lpVtbl -> GetMaximumFrameLatency(This,pMaxLatency) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIDevice1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0014 */ +/* [local] */ + +#ifdef __cplusplus +#endif /*__cplusplus*/ +DEFINE_GUID(IID_IDXGIObject,0xaec22fb8,0x76f3,0x4639,0x9b,0xe0,0x28,0xeb,0x43,0xa6,0x7a,0x2e); +DEFINE_GUID(IID_IDXGIDeviceSubObject,0x3d3e0379,0xf9de,0x4d58,0xbb,0x6c,0x18,0xd6,0x29,0x92,0xf1,0xa6); +DEFINE_GUID(IID_IDXGIResource,0x035f3ab4,0x482e,0x4e50,0xb4,0x1f,0x8a,0x7f,0x8b,0xd8,0x96,0x0b); +DEFINE_GUID(IID_IDXGIKeyedMutex,0x9d8e1289,0xd7b3,0x465f,0x81,0x26,0x25,0x0e,0x34,0x9a,0xf8,0x5d); +DEFINE_GUID(IID_IDXGISurface,0xcafcb56c,0x6ac3,0x4889,0xbf,0x47,0x9e,0x23,0xbb,0xd2,0x60,0xec); +DEFINE_GUID(IID_IDXGISurface1,0x4AE63092,0x6327,0x4c1b,0x80,0xAE,0xBF,0xE1,0x2E,0xA3,0x2B,0x86); +DEFINE_GUID(IID_IDXGIAdapter,0x2411e7e1,0x12ac,0x4ccf,0xbd,0x14,0x97,0x98,0xe8,0x53,0x4d,0xc0); +DEFINE_GUID(IID_IDXGIOutput,0xae02eedb,0xc735,0x4690,0x8d,0x52,0x5a,0x8d,0xc2,0x02,0x13,0xaa); +DEFINE_GUID(IID_IDXGISwapChain,0x310d36a0,0xd2e7,0x4c0a,0xaa,0x04,0x6a,0x9d,0x23,0xb8,0x88,0x6a); +DEFINE_GUID(IID_IDXGIFactory,0x7b7166ec,0x21c7,0x44ae,0xb2,0x1a,0xc9,0xae,0x32,0x1a,0xe3,0x69); +DEFINE_GUID(IID_IDXGIDevice,0x54ec77fa,0x1377,0x44e6,0x8c,0x32,0x88,0xfd,0x5f,0x44,0xc8,0x4c); +DEFINE_GUID(IID_IDXGIFactory1,0x770aae78,0xf26f,0x4dba,0xa8,0x29,0x25,0x3c,0x83,0xd1,0xb3,0x87); +DEFINE_GUID(IID_IDXGIAdapter1,0x29038f61,0x3839,0x4626,0x91,0xfd,0x08,0x68,0x79,0x01,0x1a,0x05); +DEFINE_GUID(IID_IDXGIDevice1,0x77db970f,0x6276,0x48ba,0xba,0x28,0x07,0x01,0x43,0xb4,0x39,0x2c); + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0014_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0014_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/RenderDll/Dx9Sdk/Include/DXGIFormat.h b/RenderDll/Dx9Sdk/Include/DXGIFormat.h new file mode 100644 index 0000000..e84f7f5 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/DXGIFormat.h @@ -0,0 +1,112 @@ + +#ifndef __dxgiformat_h__ +#define __dxgiformat_h__ + +#define DXGI_FORMAT_DEFINED 1 + +typedef enum DXGI_FORMAT +{ + DXGI_FORMAT_UNKNOWN = 0, + DXGI_FORMAT_R32G32B32A32_TYPELESS = 1, + DXGI_FORMAT_R32G32B32A32_FLOAT = 2, + DXGI_FORMAT_R32G32B32A32_UINT = 3, + DXGI_FORMAT_R32G32B32A32_SINT = 4, + DXGI_FORMAT_R32G32B32_TYPELESS = 5, + DXGI_FORMAT_R32G32B32_FLOAT = 6, + DXGI_FORMAT_R32G32B32_UINT = 7, + DXGI_FORMAT_R32G32B32_SINT = 8, + DXGI_FORMAT_R16G16B16A16_TYPELESS = 9, + DXGI_FORMAT_R16G16B16A16_FLOAT = 10, + DXGI_FORMAT_R16G16B16A16_UNORM = 11, + DXGI_FORMAT_R16G16B16A16_UINT = 12, + DXGI_FORMAT_R16G16B16A16_SNORM = 13, + DXGI_FORMAT_R16G16B16A16_SINT = 14, + DXGI_FORMAT_R32G32_TYPELESS = 15, + DXGI_FORMAT_R32G32_FLOAT = 16, + DXGI_FORMAT_R32G32_UINT = 17, + DXGI_FORMAT_R32G32_SINT = 18, + DXGI_FORMAT_R32G8X24_TYPELESS = 19, + DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20, + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21, + DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22, + DXGI_FORMAT_R10G10B10A2_TYPELESS = 23, + DXGI_FORMAT_R10G10B10A2_UNORM = 24, + DXGI_FORMAT_R10G10B10A2_UINT = 25, + DXGI_FORMAT_R11G11B10_FLOAT = 26, + DXGI_FORMAT_R8G8B8A8_TYPELESS = 27, + DXGI_FORMAT_R8G8B8A8_UNORM = 28, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29, + DXGI_FORMAT_R8G8B8A8_UINT = 30, + DXGI_FORMAT_R8G8B8A8_SNORM = 31, + DXGI_FORMAT_R8G8B8A8_SINT = 32, + DXGI_FORMAT_R16G16_TYPELESS = 33, + DXGI_FORMAT_R16G16_FLOAT = 34, + DXGI_FORMAT_R16G16_UNORM = 35, + DXGI_FORMAT_R16G16_UINT = 36, + DXGI_FORMAT_R16G16_SNORM = 37, + DXGI_FORMAT_R16G16_SINT = 38, + DXGI_FORMAT_R32_TYPELESS = 39, + DXGI_FORMAT_D32_FLOAT = 40, + DXGI_FORMAT_R32_FLOAT = 41, + DXGI_FORMAT_R32_UINT = 42, + DXGI_FORMAT_R32_SINT = 43, + DXGI_FORMAT_R24G8_TYPELESS = 44, + DXGI_FORMAT_D24_UNORM_S8_UINT = 45, + DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46, + DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47, + DXGI_FORMAT_R8G8_TYPELESS = 48, + DXGI_FORMAT_R8G8_UNORM = 49, + DXGI_FORMAT_R8G8_UINT = 50, + DXGI_FORMAT_R8G8_SNORM = 51, + DXGI_FORMAT_R8G8_SINT = 52, + DXGI_FORMAT_R16_TYPELESS = 53, + DXGI_FORMAT_R16_FLOAT = 54, + DXGI_FORMAT_D16_UNORM = 55, + DXGI_FORMAT_R16_UNORM = 56, + DXGI_FORMAT_R16_UINT = 57, + DXGI_FORMAT_R16_SNORM = 58, + DXGI_FORMAT_R16_SINT = 59, + DXGI_FORMAT_R8_TYPELESS = 60, + DXGI_FORMAT_R8_UNORM = 61, + DXGI_FORMAT_R8_UINT = 62, + DXGI_FORMAT_R8_SNORM = 63, + DXGI_FORMAT_R8_SINT = 64, + DXGI_FORMAT_A8_UNORM = 65, + DXGI_FORMAT_R1_UNORM = 66, + DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67, + DXGI_FORMAT_R8G8_B8G8_UNORM = 68, + DXGI_FORMAT_G8R8_G8B8_UNORM = 69, + DXGI_FORMAT_BC1_TYPELESS = 70, + DXGI_FORMAT_BC1_UNORM = 71, + DXGI_FORMAT_BC1_UNORM_SRGB = 72, + DXGI_FORMAT_BC2_TYPELESS = 73, + DXGI_FORMAT_BC2_UNORM = 74, + DXGI_FORMAT_BC2_UNORM_SRGB = 75, + DXGI_FORMAT_BC3_TYPELESS = 76, + DXGI_FORMAT_BC3_UNORM = 77, + DXGI_FORMAT_BC3_UNORM_SRGB = 78, + DXGI_FORMAT_BC4_TYPELESS = 79, + DXGI_FORMAT_BC4_UNORM = 80, + DXGI_FORMAT_BC4_SNORM = 81, + DXGI_FORMAT_BC5_TYPELESS = 82, + DXGI_FORMAT_BC5_UNORM = 83, + DXGI_FORMAT_BC5_SNORM = 84, + DXGI_FORMAT_B5G6R5_UNORM = 85, + DXGI_FORMAT_B5G5R5A1_UNORM = 86, + DXGI_FORMAT_B8G8R8A8_UNORM = 87, + DXGI_FORMAT_B8G8R8X8_UNORM = 88, + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89, + DXGI_FORMAT_B8G8R8A8_TYPELESS = 90, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91, + DXGI_FORMAT_B8G8R8X8_TYPELESS = 92, + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93, + DXGI_FORMAT_BC6H_TYPELESS = 94, + DXGI_FORMAT_BC6H_UF16 = 95, + DXGI_FORMAT_BC6H_SF16 = 96, + DXGI_FORMAT_BC7_TYPELESS = 97, + DXGI_FORMAT_BC7_UNORM = 98, + DXGI_FORMAT_BC7_UNORM_SRGB = 99, + DXGI_FORMAT_FORCE_UINT = 0xffffffff +} DXGI_FORMAT; + +#endif // __dxgiformat_h__ diff --git a/RenderDll/Dx9Sdk/Include/DXGIType.h b/RenderDll/Dx9Sdk/Include/DXGIType.h new file mode 100644 index 0000000..89dd86a --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/DXGIType.h @@ -0,0 +1,123 @@ + +#ifndef __dxgitype_h__ +#define __dxgitype_h__ + + +#include "dxgiformat.h" + +#define _FACDXGI 0x87a +#define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code) +#define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code) + +#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1) +#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2) +#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4) +#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5) +#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6) +#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7) +#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8) + + +#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1) +#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2) +#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3) +#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4) +#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5) +#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6) +#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7) +#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10) +#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11) +#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12) +#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32) +#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33) +#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34) +#define DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED MAKE_DXGI_HRESULT(35) +#define DXGI_ERROR_REMOTE_OUTOFMEMORY MAKE_DXGI_HRESULT(36) + + + +#define DXGI_CPU_ACCESS_NONE ( 0 ) +#define DXGI_CPU_ACCESS_DYNAMIC ( 1 ) +#define DXGI_CPU_ACCESS_READ_WRITE ( 2 ) +#define DXGI_CPU_ACCESS_SCRATCH ( 3 ) +#define DXGI_CPU_ACCESS_FIELD 15 + +#define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) ) +#define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) ) +#define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) ) +#define DXGI_USAGE_SHARED ( 1L << (3 + 4) ) +#define DXGI_USAGE_READ_ONLY ( 1L << (4 + 4) ) +#define DXGI_USAGE_DISCARD_ON_PRESENT ( 1L << (5 + 4) ) +#define DXGI_USAGE_UNORDERED_ACCESS ( 1L << (6 + 4) ) + +typedef struct DXGI_RGB +{ + float Red; + float Green; + float Blue; +} DXGI_RGB; + +typedef struct DXGI_GAMMA_CONTROL +{ + DXGI_RGB Scale; + DXGI_RGB Offset; + DXGI_RGB GammaCurve[ 1025 ]; +} DXGI_GAMMA_CONTROL; + +typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES +{ + BOOL ScaleAndOffsetSupported; + float MaxConvertedValue; + float MinConvertedValue; + UINT NumGammaControlPoints; + float ControlPointPositions[1025]; +} DXGI_GAMMA_CONTROL_CAPABILITIES; + +typedef struct DXGI_RATIONAL +{ + UINT Numerator; + UINT Denominator; +} DXGI_RATIONAL; + +typedef enum DXGI_MODE_SCANLINE_ORDER +{ + DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0, + DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1, + DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2, + DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3 +} DXGI_MODE_SCANLINE_ORDER; + +typedef enum DXGI_MODE_SCALING +{ + DXGI_MODE_SCALING_UNSPECIFIED = 0, + DXGI_MODE_SCALING_CENTERED = 1, + DXGI_MODE_SCALING_STRETCHED = 2 +} DXGI_MODE_SCALING; + +typedef enum DXGI_MODE_ROTATION +{ + DXGI_MODE_ROTATION_UNSPECIFIED = 0, + DXGI_MODE_ROTATION_IDENTITY = 1, + DXGI_MODE_ROTATION_ROTATE90 = 2, + DXGI_MODE_ROTATION_ROTATE180 = 3, + DXGI_MODE_ROTATION_ROTATE270 = 4 +} DXGI_MODE_ROTATION; + +typedef struct DXGI_MODE_DESC +{ + UINT Width; + UINT Height; + DXGI_RATIONAL RefreshRate; + DXGI_FORMAT Format; + DXGI_MODE_SCANLINE_ORDER ScanlineOrdering; + DXGI_MODE_SCALING Scaling; +} DXGI_MODE_DESC; + +typedef struct DXGI_SAMPLE_DESC +{ + UINT Count; + UINT Quality; +} DXGI_SAMPLE_DESC; + +#endif // __dxgitype_h__ + diff --git a/RenderDll/Dx9Sdk/Include/Dcommon.h b/RenderDll/Dx9Sdk/Include/Dcommon.h new file mode 100644 index 0000000..4ecc5c1 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/Dcommon.h @@ -0,0 +1,65 @@ +//+-------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Abstract: +// Public API definitions for DWrite and D2D +// +//---------------------------------------------------------------------------- + +#ifndef DCOMMON_H_INCLUDED +#define DCOMMON_H_INCLUDED + +// +//These macros are defined in the Windows 7 SDK, however to enable development using the technical preview, +//they are included here temporarily. +// +#ifndef DEFINE_ENUM_FLAG_OPERATORS +#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \ +extern "C++" { \ +inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \ +inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \ +inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \ +inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \ +inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \ +inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \ +inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \ +} +#endif + +#ifndef __field_ecount_opt +#define __field_ecount_opt(x) +#endif + +#ifndef __range +#define __range(x,y) +#endif + +#ifndef __field_ecount +#define __field_ecount(x) +#endif + +/// +/// The measuring method used for text layout. +/// +typedef enum DWRITE_MEASURING_MODE +{ + /// + /// Text is measured using glyph ideal metrics whose values are independent to the current display resolution. + /// + DWRITE_MEASURING_MODE_NATURAL, + + /// + /// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution. + /// + DWRITE_MEASURING_MODE_GDI_CLASSIC, + + /// + /// Text is measured using the same glyph display metrics as text measured by GDI using a font + /// created with CLEARTYPE_NATURAL_QUALITY. + /// + DWRITE_MEASURING_MODE_GDI_NATURAL + +} DWRITE_MEASURING_MODE; + +#endif /* DCOMMON_H_INCLUDED */ diff --git a/RenderDll/Dx9Sdk/Include/dxerr9.h b/RenderDll/Dx9Sdk/Include/DxErr.h similarity index 60% rename from RenderDll/Dx9Sdk/Include/dxerr9.h rename to RenderDll/Dx9Sdk/Include/DxErr.h index 3fc6fba..2bd7591 100644 --- a/RenderDll/Dx9Sdk/Include/dxerr9.h +++ b/RenderDll/Dx9Sdk/Include/DxErr.h @@ -1,55 +1,55 @@ /*==========================================================================; * * - * File: dxerr9.h + * File: dxerr.h * Content: DirectX Error Library Include File * ****************************************************************************/ -#ifndef _DXERR9_H_ -#define _DXERR9_H_ +#ifndef _DXERR_H_ +#define _DXERR_H_ #ifdef __cplusplus extern "C" { #endif //__cplusplus // -// DXGetErrorString9 +// DXGetErrorString // -// Desc: Converts a DirectX 9 or earlier HRESULT to a string +// Desc: Converts a DirectX HRESULT to a string // // Args: HRESULT hr Can be any error code from -// D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW +// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW // // Return: Converted string // -const char* WINAPI DXGetErrorString9A(HRESULT hr); -const WCHAR* WINAPI DXGetErrorString9W(HRESULT hr); +const char* WINAPI DXGetErrorStringA(__in HRESULT hr); +const WCHAR* WINAPI DXGetErrorStringW(__in HRESULT hr); #ifdef UNICODE -#define DXGetErrorString9 DXGetErrorString9W +#define DXGetErrorString DXGetErrorStringW #else -#define DXGetErrorString9 DXGetErrorString9A +#define DXGetErrorString DXGetErrorStringA #endif // -// DXGetErrorDescription9 +// DXGetErrorDescription // -// Desc: Returns a string description of a DirectX 9 or earlier HRESULT +// Desc: Returns a string description of a DirectX HRESULT // // Args: HRESULT hr Can be any error code from -// D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW +// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW // // Return: String description // -const char* WINAPI DXGetErrorDescription9A(HRESULT hr); -const WCHAR* WINAPI DXGetErrorDescription9W(HRESULT hr); +const char* WINAPI DXGetErrorDescriptionA(__in HRESULT hr); +const WCHAR* WINAPI DXGetErrorDescriptionW(__in HRESULT hr); #ifdef UNICODE - #define DXGetErrorDescription9 DXGetErrorDescription9W + #define DXGetErrorDescription DXGetErrorDescriptionW #else - #define DXGetErrorDescription9 DXGetErrorDescription9A + #define DXGetErrorDescription DXGetErrorDescriptionA #endif @@ -68,8 +68,8 @@ const WCHAR* WINAPI DXGetErrorDescription9W(HRESULT hr); // // Return: The hr that was passed in. // -HRESULT WINAPI DXTraceA( const char* strFile, DWORD dwLine, HRESULT hr, const char* strMsg, BOOL bPopMsgBox ); -HRESULT WINAPI DXTraceW( const char* strFile, DWORD dwLine, HRESULT hr, const WCHAR* strMsg, BOOL bPopMsgBox ); +HRESULT WINAPI DXTraceA( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const char* strMsg, __in BOOL bPopMsgBox ); +HRESULT WINAPI DXTraceW( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const WCHAR* strMsg, __in BOOL bPopMsgBox ); #ifdef UNICODE #define DXTrace DXTraceW @@ -96,5 +96,4 @@ HRESULT WINAPI DXTraceW( const char* strFile, DWORD dwLine, HRESULT hr, const WC } #endif //__cplusplus -#endif // _DXERR9_H_ - +#endif // _DXERR_H_ diff --git a/RenderDll/Dx9Sdk/Include/PIXPlugin.h b/RenderDll/Dx9Sdk/Include/PIXPlugin.h new file mode 100644 index 0000000..9c249af --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/PIXPlugin.h @@ -0,0 +1,120 @@ +//================================================================================================== +// PIXPlugin.h +// +// Microsoft PIX Plugin Header +// +// Copyright (c) Microsoft Corporation, All rights reserved +//================================================================================================== + +#pragma once + +#ifdef __cplusplus +extern "C" +{ +#endif + + +//================================================================================================== +// PIX_PLUGIN_SYSTEM_VERSION - Indicates version of the plugin interface the plugin is built with. +//================================================================================================== +#define PIX_PLUGIN_SYSTEM_VERSION 0x101 + + +//================================================================================================== +// PIXCOUNTERID - A unique identifier for each PIX plugin counter. +//================================================================================================== +typedef int PIXCOUNTERID; + + +//================================================================================================== +// PIXCOUNTERDATATYPE - Indicates what type of data the counter produces. +//================================================================================================== +enum PIXCOUNTERDATATYPE +{ + PCDT_RESERVED, + PCDT_FLOAT, + PCDT_INT, + PCDT_INT64, + PCDT_STRING, +}; + + +//================================================================================================== +// PIXPLUGININFO - This structure is filled out by PIXGetPluginInfo and passed back to PIX. +//================================================================================================== +struct PIXPLUGININFO +{ + // Filled in by caller: + HINSTANCE hinst; + + // Filled in by PIXGetPluginInfo: + WCHAR* pstrPluginName; // Name of plugin + int iPluginVersion; // Version of this particular plugin + int iPluginSystemVersion; // Version of PIX's plugin system this plugin was designed for +}; + + +//================================================================================================== +// PIXCOUNTERINFO - This structure is filled out by PIXGetCounterInfo and passed back to PIX +// to allow PIX to determine information about the counters in the plugin. +//================================================================================================== +struct PIXCOUNTERINFO +{ + PIXCOUNTERID counterID; // Used to uniquely ID this counter + WCHAR* pstrName; // String name of the counter + PIXCOUNTERDATATYPE pcdtDataType; // Data type returned by this counter +}; + + +//================================================================================================== +// PIXGetPluginInfo - This returns basic information about this plugin to PIX. +//================================================================================================== +BOOL WINAPI PIXGetPluginInfo( PIXPLUGININFO* pPIXPluginInfo ); + + +//================================================================================================== +// PIXGetCounterInfo - This returns an array of PIXCOUNTERINFO structs to PIX. +// These PIXCOUNTERINFOs allow PIX to enumerate the counters contained +// in this plugin. +//================================================================================================== +BOOL WINAPI PIXGetCounterInfo( DWORD* pdwReturnCounters, PIXCOUNTERINFO** ppCounterInfoList ); + + +//================================================================================================== +// PIXGetCounterDesc - This is called by PIX to request a description of the indicated counter. +//================================================================================================== +BOOL WINAPI PIXGetCounterDesc( PIXCOUNTERID id, WCHAR** ppstrCounterDesc ); + + +//================================================================================================== +// PIXBeginExperiment - This called by PIX once per counter when instrumentation starts. +//================================================================================================== +BOOL WINAPI PIXBeginExperiment( PIXCOUNTERID id, const WCHAR* pstrApplication ); + + +//================================================================================================== +// PIXEndFrame - This is called by PIX once per counter at the end of each frame to gather the +// counter value for that frame. Note that the pointer to the return data must +// continue to point to valid counter data until the next call to PIXEndFrame (or +// PIXEndExperiment) for the same counter. So do not set *ppReturnData to the same +// pointer for multiple counters, or point to a local variable that will go out of +// scope. See the sample PIX plugin for an example of how to structure a plugin +// properly. +//================================================================================================== +BOOL WINAPI PIXEndFrame( PIXCOUNTERID id, UINT iFrame, DWORD* pdwReturnBytes, BYTE** ppReturnData ); + + +//================================================================================================== +// PIXEndExperiment - This is called by PIX once per counter when instrumentation ends. +//================================================================================================== +BOOL WINAPI PIXEndExperiment( PIXCOUNTERID id ); + + +#ifdef __cplusplus +}; +#endif + +//================================================================================================== +// eof: PIXPlugin.h +//================================================================================================== + diff --git a/RenderDll/Dx9Sdk/Include/X3DAudio.h b/RenderDll/Dx9Sdk/Include/X3DAudio.h new file mode 100644 index 0000000..c25d98f --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/X3DAudio.h @@ -0,0 +1,316 @@ +/*-========================================================================-_ + | - X3DAUDIO - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |PROJECT: X3DAudio MODEL: Unmanaged User-mode | + |VERSION: 1.7 EXCEPT: No Exceptions | + |CLASS: N / A MINREQ: WinXP, Xbox360 | + |BASE: N / A DIALECT: MSC++ 14.00 | + |>------------------------------------------------------------------------<| + | DUTY: Cross-platform stand-alone 3D audio math library | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. USE THE DEBUG DLL TO ENABLE PARAMETER VALIDATION VIA ASSERTS! + Here's how: + Copy X3DAudioDX_X.dll to where your application exists. + The debug DLL can be found under %WINDIR%\system32. + Rename X3DAudioDX_X.dll to X3DAudioX_X.dll to use the debug version. + + Only parameters required by DSP settings being calculated as + stipulated by the calculation control flags are validated. + + 2. Definition of terms: + LFE: Low Frequency Effect -- always omnidirectional. + LPF: Low Pass Filter, divided into two classifications: + Direct -- Applied to the direct signal path, + used for obstruction/occlusion effects. + Reverb -- Applied to the reverb signal path, + used for occlusion effects only. + + 3. Volume level is expressed as a linear amplitude scaler: + 1.0f represents no attenuation applied to the original signal, + 0.5f denotes an attenuation of 6dB, and 0.0f results in silence. + Amplification (volume > 1.0f) is also allowed, and is not clamped. + + LPF values range from 1.0f representing all frequencies pass through, + to 0.0f which results in silence as all frequencies are filtered out. + + 4. X3DAudio uses a left-handed Cartesian coordinate system with values + on the x-axis increasing from left to right, on the y-axis from + bottom to top, and on the z-axis from near to far. + Azimuths are measured clockwise from a given reference direction. + + Distance measurement is with respect to user-defined world units. + Applications may provide coordinates using any system of measure + as all non-normalized calculations are scale invariant, with such + operations natively occurring in user-defined world unit space. + Metric constants are supplied only as a convenience. + Distance is calculated using the Euclidean norm formula. + + 5. Only real values are permissible with functions using 32-bit + float parameters -- NAN and infinite values are not accepted. + All computation occurs in 32-bit precision mode. */ + +#pragma once +//---------------------------------------------------// +#include // general windows types +#if defined(_XBOX) + #include +#endif +#include // for D3DVECTOR + +// speaker geometry configuration flags, specifies assignment of channels to speaker positions, defined as per WAVEFORMATEXTENSIBLE.dwChannelMask +#if !defined(_SPEAKER_POSITIONS_) + #define _SPEAKER_POSITIONS_ + #define SPEAKER_FRONT_LEFT 0x00000001 + #define SPEAKER_FRONT_RIGHT 0x00000002 + #define SPEAKER_FRONT_CENTER 0x00000004 + #define SPEAKER_LOW_FREQUENCY 0x00000008 + #define SPEAKER_BACK_LEFT 0x00000010 + #define SPEAKER_BACK_RIGHT 0x00000020 + #define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040 + #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080 + #define SPEAKER_BACK_CENTER 0x00000100 + #define SPEAKER_SIDE_LEFT 0x00000200 + #define SPEAKER_SIDE_RIGHT 0x00000400 + #define SPEAKER_TOP_CENTER 0x00000800 + #define SPEAKER_TOP_FRONT_LEFT 0x00001000 + #define SPEAKER_TOP_FRONT_CENTER 0x00002000 + #define SPEAKER_TOP_FRONT_RIGHT 0x00004000 + #define SPEAKER_TOP_BACK_LEFT 0x00008000 + #define SPEAKER_TOP_BACK_CENTER 0x00010000 + #define SPEAKER_TOP_BACK_RIGHT 0x00020000 + #define SPEAKER_RESERVED 0x7FFC0000 // bit mask locations reserved for future use + #define SPEAKER_ALL 0x80000000 // used to specify that any possible permutation of speaker configurations +#endif + +// standard speaker geometry configurations, used with X3DAudioInitialize +#if !defined(SPEAKER_MONO) + #define SPEAKER_MONO SPEAKER_FRONT_CENTER + #define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) + #define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY) + #define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) + #define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER) + #define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) + #define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) +#endif + +// Xbox360 speaker geometry configuration, used with X3DAudioInitialize +#if defined(_XBOX) + #define SPEAKER_XBOX SPEAKER_5POINT1 +#endif + + +// size of instance handle in bytes +#define X3DAUDIO_HANDLE_BYTESIZE 20 + +// float math constants +#define X3DAUDIO_PI 3.141592654f +#define X3DAUDIO_2PI 6.283185307f + +// speed of sound in meters per second for dry air at approximately 20C, used with X3DAudioInitialize +#define X3DAUDIO_SPEED_OF_SOUND 343.5f + +// calculation control flags, used with X3DAudioCalculate +#define X3DAUDIO_CALCULATE_MATRIX 0x00000001 // enable matrix coefficient table calculation +#define X3DAUDIO_CALCULATE_DELAY 0x00000002 // enable delay time array calculation (stereo final mix only) +#define X3DAUDIO_CALCULATE_LPF_DIRECT 0x00000004 // enable LPF direct-path coefficient calculation +#define X3DAUDIO_CALCULATE_LPF_REVERB 0x00000008 // enable LPF reverb-path coefficient calculation +#define X3DAUDIO_CALCULATE_REVERB 0x00000010 // enable reverb send level calculation +#define X3DAUDIO_CALCULATE_DOPPLER 0x00000020 // enable doppler shift factor calculation +#define X3DAUDIO_CALCULATE_EMITTER_ANGLE 0x00000040 // enable emitter-to-listener interior angle calculation + +#define X3DAUDIO_CALCULATE_ZEROCENTER 0x00010000 // do not position to front center speaker, signal positioned to remaining speakers instead, front center destination channel will be zero in returned matrix coefficient table, valid only for matrix calculations with final mix formats that have a front center channel +#define X3DAUDIO_CALCULATE_REDIRECT_TO_LFE 0x00020000 // apply equal mix of all source channels to LFE destination channel, valid only for matrix calculations with sources that have no LFE channel and final mix formats that have an LFE channel + + +//-----------------------------------------------------// +#pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments + + +// primitive types +typedef float FLOAT32; // 32-bit IEEE float +typedef D3DVECTOR X3DAUDIO_VECTOR; // float 3D vector + +// instance handle of precalculated constants +typedef BYTE X3DAUDIO_HANDLE[X3DAUDIO_HANDLE_BYTESIZE]; + + +// Distance curve point: +// Defines a DSP setting at a given normalized distance. +typedef struct X3DAUDIO_DISTANCE_CURVE_POINT +{ + FLOAT32 Distance; // normalized distance, must be within [0.0f, 1.0f] + FLOAT32 DSPSetting; // DSP setting +} X3DAUDIO_DISTANCE_CURVE_POINT, *LPX3DAUDIO_DISTANCE_CURVE_POINT; + +// Distance curve: +// A piecewise curve made up of linear segments used to +// define DSP behaviour with respect to normalized distance. +// +// Note that curve point distances are normalized within [0.0f, 1.0f]. +// X3DAUDIO_EMITTER.CurveDistanceScaler must be used to scale the +// normalized distances to user-defined world units. +// For distances beyond CurveDistanceScaler * 1.0f, +// pPoints[PointCount-1].DSPSetting is used as the DSP setting. +// +// All distance curve spans must be such that: +// pPoints[k-1].DSPSetting + ((pPoints[k].DSPSetting-pPoints[k-1].DSPSetting) / (pPoints[k].Distance-pPoints[k-1].Distance)) * (pPoints[k].Distance-pPoints[k-1].Distance) != NAN or infinite values +// For all points in the distance curve where 1 <= k < PointCount. +typedef struct X3DAUDIO_DISTANCE_CURVE +{ + X3DAUDIO_DISTANCE_CURVE_POINT* pPoints; // distance curve point array, must have at least PointCount elements with no duplicates and be sorted in ascending order with respect to Distance + UINT32 PointCount; // number of distance curve points, must be >= 2 as all distance curves must have at least two endpoints, defining DSP settings at 0.0f and 1.0f normalized distance +} X3DAUDIO_DISTANCE_CURVE, *LPX3DAUDIO_DISTANCE_CURVE; +static const X3DAUDIO_DISTANCE_CURVE_POINT X3DAudioDefault_LinearCurvePoints[2] = { 0.0f, 1.0f, 1.0f, 0.0f }; +static const X3DAUDIO_DISTANCE_CURVE X3DAudioDefault_LinearCurve = { (X3DAUDIO_DISTANCE_CURVE_POINT*)&X3DAudioDefault_LinearCurvePoints[0], 2 }; + +// Cone: +// Specifies directionality for a listener or single-channel emitter by +// modifying DSP behaviour with respect to its front orientation. +// This is modeled using two sound cones: an inner cone and an outer cone. +// On/within the inner cone, DSP settings are scaled by the inner values. +// On/beyond the outer cone, DSP settings are scaled by the outer values. +// If on both the cones, DSP settings are scaled by the inner values only. +// Between the two cones, the scaler is linearly interpolated between the +// inner and outer values. Set both cone angles to 0 or X3DAUDIO_2PI for +// omnidirectionality using only the outer or inner values respectively. +typedef struct X3DAUDIO_CONE +{ + FLOAT32 InnerAngle; // inner cone angle in radians, must be within [0.0f, X3DAUDIO_2PI] + FLOAT32 OuterAngle; // outer cone angle in radians, must be within [InnerAngle, X3DAUDIO_2PI] + + FLOAT32 InnerVolume; // volume level scaler on/within inner cone, used only for matrix calculations, must be within [0.0f, 2.0f] when used + FLOAT32 OuterVolume; // volume level scaler on/beyond outer cone, used only for matrix calculations, must be within [0.0f, 2.0f] when used + FLOAT32 InnerLPF; // LPF (both direct and reverb paths) coefficient subtrahend on/within inner cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0f, 1.0f] when used + FLOAT32 OuterLPF; // LPF (both direct and reverb paths) coefficient subtrahend on/beyond outer cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0f, 1.0f] when used + FLOAT32 InnerReverb; // reverb send level scaler on/within inner cone, used only for reverb calculations, must be within [0.0f, 2.0f] when used + FLOAT32 OuterReverb; // reverb send level scaler on/beyond outer cone, used only for reverb calculations, must be within [0.0f, 2.0f] when used +} X3DAUDIO_CONE, *LPX3DAUDIO_CONE; +static const X3DAUDIO_CONE X3DAudioDefault_DirectionalCone = { X3DAUDIO_PI/2, X3DAUDIO_PI, 1.0f, 0.708f, 0.0f, 0.25f, 0.708f, 1.0f }; + + +// Listener: +// Defines a point of 3D audio reception. +// +// The cone is directed by the listener's front orientation. +typedef struct X3DAUDIO_LISTENER +{ + X3DAUDIO_VECTOR OrientFront; // orientation of front direction, used only for matrix and delay calculations or listeners with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used + X3DAUDIO_VECTOR OrientTop; // orientation of top direction, used only for matrix and delay calculations, must be orthonormal with OrientFront when used + + X3DAUDIO_VECTOR Position; // position in user-defined world units, does not affect Velocity + X3DAUDIO_VECTOR Velocity; // velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position + + X3DAUDIO_CONE* pCone; // sound cone, used only for matrix, LPF (both direct and reverb paths), and reverb calculations, NULL specifies omnidirectionality +} X3DAUDIO_LISTENER, *LPX3DAUDIO_LISTENER; + +// Emitter: +// Defines a 3D audio source, divided into two classifications: +// +// Single-point -- For use with single-channel sounds. +// Positioned at the emitter base, i.e. the channel radius +// and azimuth are ignored if the number of channels == 1. +// +// May be omnidirectional or directional using a cone. +// The cone originates from the emitter base position, +// and is directed by the emitter's front orientation. +// +// Multi-point -- For use with multi-channel sounds. +// Each non-LFE channel is positioned using an +// azimuth along the channel radius with respect to the +// front orientation vector in the plane orthogonal to the +// top orientation vector. An azimuth of X3DAUDIO_2PI +// specifies a channel is an LFE. Such channels are +// positioned at the emitter base and are calculated +// with respect to pLFECurve only, never pVolumeCurve. +// +// Multi-point emitters are always omnidirectional, +// i.e. the cone is ignored if the number of channels > 1. +// +// Note that many properties are shared among all channel points, +// locking certain behaviour with respect to the emitter base position. +// For example, doppler shift is always calculated with respect to the +// emitter base position and so is constant for all its channel points. +// Distance curve calculations are also with respect to the emitter base +// position, with the curves being calculated independently of each other. +// For instance, volume and LFE calculations do not affect one another. +typedef struct X3DAUDIO_EMITTER +{ + X3DAUDIO_CONE* pCone; // sound cone, used only with single-channel emitters for matrix, LPF (both direct and reverb paths), and reverb calculations, NULL specifies omnidirectionality + X3DAUDIO_VECTOR OrientFront; // orientation of front direction, used only for emitter angle calculations or with multi-channel emitters for matrix calculations or single-channel emitters with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used + X3DAUDIO_VECTOR OrientTop; // orientation of top direction, used only with multi-channel emitters for matrix calculations, must be orthonormal with OrientFront when used + + X3DAUDIO_VECTOR Position; // position in user-defined world units, does not affect Velocity + X3DAUDIO_VECTOR Velocity; // velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position + + FLOAT32 InnerRadius; // inner radius, must be within [0.0f, FLT_MAX] + FLOAT32 InnerRadiusAngle; // inner radius angle, must be within [0.0f, X3DAUDIO_PI/4.0) + + UINT32 ChannelCount; // number of sound channels, must be > 0 + FLOAT32 ChannelRadius; // channel radius, used only with multi-channel emitters for matrix calculations, must be >= 0.0f when used + FLOAT32* pChannelAzimuths; // channel azimuth array, used only with multi-channel emitters for matrix calculations, contains positions of each channel expressed in radians along the channel radius with respect to the front orientation vector in the plane orthogonal to the top orientation vector, or X3DAUDIO_2PI to specify an LFE channel, must have at least ChannelCount elements, all within [0.0f, X3DAUDIO_2PI] when used + + X3DAUDIO_DISTANCE_CURVE* pVolumeCurve; // volume level distance curve, used only for matrix calculations, NULL specifies a default curve that conforms to the inverse square law, calculated in user-defined world units with distances <= CurveDistanceScaler clamped to no attenuation + X3DAUDIO_DISTANCE_CURVE* pLFECurve; // LFE level distance curve, used only for matrix calculations, NULL specifies a default curve that conforms to the inverse square law, calculated in user-defined world units with distances <= CurveDistanceScaler clamped to no attenuation + X3DAUDIO_DISTANCE_CURVE* pLPFDirectCurve; // LPF direct-path coefficient distance curve, used only for LPF direct-path calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.75f] + X3DAUDIO_DISTANCE_CURVE* pLPFReverbCurve; // LPF reverb-path coefficient distance curve, used only for LPF reverb-path calculations, NULL specifies the default curve: [0.0f,0.75f], [1.0f,0.75f] + X3DAUDIO_DISTANCE_CURVE* pReverbCurve; // reverb send level distance curve, used only for reverb calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.0f] + + FLOAT32 CurveDistanceScaler; // curve distance scaler, used to scale normalized distance curves to user-defined world units and/or exaggerate their effect, used only for matrix, LPF (both direct and reverb paths), and reverb calculations, must be within [FLT_MIN, FLT_MAX] when used + FLOAT32 DopplerScaler; // doppler shift scaler, used to exaggerate doppler shift effect, used only for doppler calculations, must be within [0.0f, FLT_MAX] when used +} X3DAUDIO_EMITTER, *LPX3DAUDIO_EMITTER; + + +// DSP settings: +// Receives results from a call to X3DAudioCalculate to be sent +// to the low-level audio rendering API for 3D signal processing. +// +// The user is responsible for allocating the matrix coefficient table, +// delay time array, and initializing the channel counts when used. +typedef struct X3DAUDIO_DSP_SETTINGS +{ + FLOAT32* pMatrixCoefficients; // [inout] matrix coefficient table, receives an array representing the volume level used to send from source channel S to destination channel D, stored as pMatrixCoefficients[SrcChannelCount * D + S], must have at least SrcChannelCount*DstChannelCount elements + FLOAT32* pDelayTimes; // [inout] delay time array, receives delays for each destination channel in milliseconds, must have at least DstChannelCount elements (stereo final mix only) + UINT32 SrcChannelCount; // [in] number of source channels, must equal number of channels in respective emitter + UINT32 DstChannelCount; // [in] number of destination channels, must equal number of channels of the final mix + + FLOAT32 LPFDirectCoefficient; // [out] LPF direct-path coefficient + FLOAT32 LPFReverbCoefficient; // [out] LPF reverb-path coefficient + FLOAT32 ReverbLevel; // [out] reverb send level + FLOAT32 DopplerFactor; // [out] doppler shift factor, scales resampler ratio for doppler shift effect, where the effective frequency = DopplerFactor * original frequency + FLOAT32 EmitterToListenerAngle; // [out] emitter-to-listener interior angle, expressed in radians with respect to the emitter's front orientation + + FLOAT32 EmitterToListenerDistance; // [out] distance in user-defined world units from the emitter base to listener position, always calculated + FLOAT32 EmitterVelocityComponent; // [out] component of emitter velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler + FLOAT32 ListenerVelocityComponent; // [out] component of listener velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler +} X3DAUDIO_DSP_SETTINGS, *LPX3DAUDIO_DSP_SETTINGS; + + +//-------------------------------------------------------------// +// function storage-class attribute and calltype +#if defined(_XBOX) || defined(X3DAUDIOSTATIC) + #define X3DAUDIO_API_(type) EXTERN_C type STDAPIVCALLTYPE +#else + #if defined(X3DEXPORT) + #define X3DAUDIO_API_(type) EXTERN_C __declspec(dllexport) type STDAPIVCALLTYPE + #else + #define X3DAUDIO_API_(type) EXTERN_C __declspec(dllimport) type STDAPIVCALLTYPE + #endif +#endif +#define X3DAUDIO_IMP_(type) type STDMETHODVCALLTYPE + + +//-------------------------------------------------------// +// initializes instance handle +X3DAUDIO_API_(void) X3DAudioInitialize (UINT32 SpeakerChannelMask, FLOAT32 SpeedOfSound, __out X3DAUDIO_HANDLE Instance); + +// calculates DSP settings with respect to 3D parameters +X3DAUDIO_API_(void) X3DAudioCalculate (__in const X3DAUDIO_HANDLE Instance, __in const X3DAUDIO_LISTENER* pListener, __in const X3DAUDIO_EMITTER* pEmitter, UINT32 Flags, __inout X3DAUDIO_DSP_SETTINGS* pDSPSettings); + + +#pragma pack(pop) // revert packing alignment +//---------------------------------<-EOF->----------------------------------// diff --git a/RenderDll/Dx9Sdk/Include/XAPO.h b/RenderDll/Dx9Sdk/Include/XAPO.h new file mode 100644 index 0000000..17947d6 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/XAPO.h @@ -0,0 +1,645 @@ +/*-========================================================================-_ + | - XAPO - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |PROJECT: XAPO MODEL: Unmanaged User-mode | + |VERSION: 1.0 EXCEPT: No Exceptions | + |CLASS: N / A MINREQ: WinXP, Xbox360 | + |BASE: N / A DIALECT: MSC++ 14.00 | + |>------------------------------------------------------------------------<| + | DUTY: Cross-platform Audio Processing Object interfaces | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. Definition of terms: + DSP: Digital Signal Processing. + + CBR: Constant BitRate -- DSP that consumes a constant number of + input samples to produce an output sample. + For example, a 22kHz to 44kHz resampler is CBR DSP. + Even though the number of input to output samples differ, + the ratio between input to output rate remains constant. + All user-defined XAPOs are assumed to be CBR as + XAudio2 only allows CBR DSP to be added to an effect chain. + + XAPO: Cross-platform Audio Processing Object -- + a thin wrapper that manages DSP code, allowing it + to be easily plugged into an XAudio2 effect chain. + + Frame: A block of samples, one per channel, + to be played simultaneously. + + In-Place: Processing such that the input buffer equals the + output buffer (i.e. input data modified directly). + This form of processing is generally more efficient + than using separate memory for input and output. + However, an XAPO may not perform format conversion + when processing in-place. + + 2. XAPO member variables are divided into three classifications: + Immutable: Set once via IXAPO::Initialize and remain + constant during the lifespan of the XAPO. + + Locked: May change before the XAPO is locked via + IXAPO::LockForProcess but remain constant + until IXAPO::UnlockForProcess is called. + + Dynamic: May change from one processing pass to the next, + usually via IXAPOParameters::SetParameters. + XAPOs should assign reasonable defaults to their dynamic + variables during IXAPO::Initialize/LockForProcess so + that calling IXAPOParameters::SetParameters is not + required before processing begins. + + When implementing an XAPO, determine the type of each variable and + initialize them in the appropriate method. Immutable variables are + generally preferable over locked which are preferable over dynamic. + That is, one should strive to minimize XAPO state changes for + best performance, maintainability, and ease of use. + + 3. To minimize glitches, the realtime audio processing thread must + not block. XAPO methods called by the realtime thread are commented + as non-blocking and therefore should not use blocking synchronization, + allocate memory, access the disk, etc. The XAPO interfaces were + designed to allow an effect implementer to move such operations + into other methods called on an application controlled thread. + + 4. Extending functionality is accomplished through the addition of new + COM interfaces. For example, if a new member is added to a parameter + structure, a new interface using the new structure should be added, + leaving the original interface unchanged. + This ensures consistent communication between future versions of + XAudio2 and various versions of XAPOs that may exist in an application. + + 5. All audio data is interleaved in XAudio2. + The default audio format for an effect chain is WAVE_FORMAT_IEEE_FLOAT. + + 6. User-defined XAPOs should assume all input and output buffers are + 16-byte aligned. + + 7. See XAPOBase.h for an XAPO base class which provides a default + implementation for most of the interface methods defined below. */ + +#pragma once +//---------------------------------------------------// +#include "comdecl.h" // for DEFINE_IID + +// XAPO interface IDs +DEFINE_IID(IXAPO, A90BC001, E897, E897, 55, E4, 9E, 47, 00, 00, 00, 00); +DEFINE_IID(IXAPOParameters, A90BC001, E897, E897, 55, E4, 9E, 47, 00, 00, 00, 01); + + +#if !defined(GUID_DEFS_ONLY) // ignore rest if only GUID definitions requested + #if defined(_XBOX) // general windows and COM declarations + #include + #include + #else + #include + #include + #endif + #include "audiodefs.h" // for WAVEFORMATEX etc. + + // XAPO error codes + #define FACILITY_XAPO 0x897 + #define XAPO_E_FORMAT_UNSUPPORTED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XAPO, 0x01) // requested audio format unsupported + + // supported number of channels (samples per frame) range + #define XAPO_MIN_CHANNELS 1 + #define XAPO_MAX_CHANNELS 64 + + // supported framerate range + #define XAPO_MIN_FRAMERATE 1000 + #define XAPO_MAX_FRAMERATE 200000 + + // unicode string length, including terminator, used with XAPO_REGISTRATION_PROPERTIES + #define XAPO_REGISTRATION_STRING_LENGTH 256 + + + // XAPO property flags, used with XAPO_REGISTRATION_PROPERTIES.Flags: + // Number of channels of input and output buffers must match, + // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat. + #define XAPO_FLAG_CHANNELS_MUST_MATCH 0x00000001 + + // Framerate of input and output buffers must match, + // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat. + #define XAPO_FLAG_FRAMERATE_MUST_MATCH 0x00000002 + + // Bit depth of input and output buffers must match, + // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat. + // Container size of input and output buffers must also match if + // XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat is WAVEFORMATEXTENSIBLE. + #define XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH 0x00000004 + + // Number of input and output buffers must match, + // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS. + // + // Also, XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount must + // equal XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount and + // XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount must equal + // XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount when used. + #define XAPO_FLAG_BUFFERCOUNT_MUST_MATCH 0x00000008 + + // XAPO must be run in-place. Use this flag only if your DSP + // implementation cannot process separate input and output buffers. + // If set, the following flags must also be set: + // XAPO_FLAG_CHANNELS_MUST_MATCH + // XAPO_FLAG_FRAMERATE_MUST_MATCH + // XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH + // XAPO_FLAG_BUFFERCOUNT_MUST_MATCH + // XAPO_FLAG_INPLACE_SUPPORTED + // + // Multiple input and output buffers may be used with in-place XAPOs, + // though the input buffer count must equal the output buffer count. + // When multiple input/output buffers are used, the XAPO may assume + // input buffer [N] equals output buffer [N] for in-place processing. + #define XAPO_FLAG_INPLACE_REQUIRED 0x00000020 + + // XAPO may be run in-place. If the XAPO is used in a chain + // such that the requirements for XAPO_FLAG_INPLACE_REQUIRED are met, + // XAudio2 will ensure the XAPO is run in-place. If not met, XAudio2 + // will still run the XAPO albeit with separate input and output buffers. + // + // For example, consider an effect which may be ran in stereo->5.1 mode or + // mono->mono mode. When set to stereo->5.1, it will be run with separate + // input and output buffers as format conversion is not permitted in-place. + // However, if configured to run mono->mono, the same XAPO can be run + // in-place. Thus the same implementation may be conveniently reused + // for various input/output configurations, while taking advantage of + // in-place processing when possible. + #define XAPO_FLAG_INPLACE_SUPPORTED 0x00000010 + + +//-----------------------------------------------------// + #pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments + + + // XAPO registration properties, describes general XAPO characteristics, used with IXAPO::GetRegistrationProperties + typedef struct XAPO_REGISTRATION_PROPERTIES { + CLSID clsid; // COM class ID, used with CoCreate + WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH]; // friendly name unicode string + WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH]; // copyright information unicode string + UINT32 MajorVersion; // major version + UINT32 MinorVersion; // minor version + UINT32 Flags; // XAPO property flags, describes supported input/output configuration + UINT32 MinInputBufferCount; // minimum number of input buffers required for processing, can be 0 + UINT32 MaxInputBufferCount; // maximum number of input buffers supported for processing, must be >= MinInputBufferCount + UINT32 MinOutputBufferCount; // minimum number of output buffers required for processing, can be 0, must match MinInputBufferCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used + UINT32 MaxOutputBufferCount; // maximum number of output buffers supported for processing, must be >= MinOutputBufferCount, must match MaxInputBufferCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used + } XAPO_REGISTRATION_PROPERTIES; + + + // LockForProcess buffer parameters: + // Defines buffer parameters that remain constant while an XAPO is locked. + // Used with IXAPO::LockForProcess. + // + // For CBR XAPOs, MaxFrameCount is the only number of frames + // IXAPO::Process would have to handle for the respective buffer. + typedef struct XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS { + const WAVEFORMATEX* pFormat; // buffer audio format + UINT32 MaxFrameCount; // maximum number of frames in respective buffer that IXAPO::Process would have to handle, irrespective of dynamic variable settings, can be 0 + } XAPO_LOCKFORPROCESS_PARAMETERS; + + // Buffer flags: + // Describes assumed content of the respective buffer. + // Used with XAPO_PROCESS_BUFFER_PARAMETERS.BufferFlags. + // + // This meta-data can be used by an XAPO to implement + // optimizations that require knowledge of a buffer's content. + // + // For example, XAPOs that always produce silent output from silent input + // can check the flag on the input buffer to determine if any signal + // processing is necessary. If silent, the XAPO may simply set the flag + // on the output buffer to silent and return, optimizing out the work of + // processing silent data: XAPOs that generate silence for any reason may + // set the buffer's flag accordingly rather than writing out silent + // frames to the buffer itself. + // + // The flags represent what should be assumed is in the respective buffer. + // The flags may not reflect what is actually stored in memory. + typedef enum XAPO_BUFFER_FLAGS { + XAPO_BUFFER_SILENT, // silent data should be assumed, respective memory may be uninitialized + XAPO_BUFFER_VALID, // arbitrary data should be assumed (may or may not be silent frames), respective memory initialized + } XAPO_BUFFER_FLAGS; + + // Process buffer parameters: + // Defines buffer parameters that may change from one + // processing pass to the next. Used with IXAPO::Process. + // + // Note the byte size of the respective buffer must be at least: + // XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount * XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat->nBlockAlign + // + // Although the audio format and maximum size of the respective + // buffer is locked (defined by XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS), + // the actual memory address of the buffer given is permitted to change + // from one processing pass to the next. + // + // For CBR XAPOs, ValidFrameCount is constant while locked and equals + // the respective XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount. + typedef struct XAPO_PROCESS_BUFFER_PARAMETERS { + void* pBuffer; // audio data buffer, must be non-NULL + XAPO_BUFFER_FLAGS BufferFlags; // describes assumed content of pBuffer, does not affect ValidFrameCount + UINT32 ValidFrameCount; // number of frames of valid data, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs, does not affect BufferFlags + } XAPO_PROCESS_BUFFER_PARAMETERS; + + +//-------------------------------------------------------------// + // Memory allocation macros that allow one module to allocate memory and + // another to free it, by guaranteeing that the same heap manager is used + // regardless of differences between build environments of the two modules. + // + // Used by IXAPO methods that must allocate arbitrary sized structures + // such as WAVEFORMATEX that are subsequently returned to the application. + #if defined(_XBOX) + #define XAPO_ALLOC_ATTRIBUTES MAKE_XALLOC_ATTRIBUTES ( \ + 0, /* ObjectType */ \ + FALSE, /* HeapTracksAttributes */ \ + FALSE, /* MustSucceed */ \ + FALSE, /* FixedSize */ \ + eXALLOCAllocatorId_XAUDIO2, /* AllocatorId */ \ + XALLOC_ALIGNMENT_DEFAULT, /* Alignment */ \ + XALLOC_MEMPROTECT_READWRITE, /* MemoryProtect */ \ + FALSE, /* ZeroInitialize */ \ + XALLOC_MEMTYPE_HEAP /* MemoryType */ \ + ) + #define XAPOAlloc(size) XMemAlloc(size, XAPO_ALLOC_ATTRIBUTES) + #define XAPOFree(p) XMemFree(p, XAPO_ALLOC_ATTRIBUTES) + #else + #define XAPOAlloc(size) CoTaskMemAlloc(size) + #define XAPOFree(p) CoTaskMemFree(p) + #endif + + +//-----------------------------------------------------// + // IXAPO: + // The only mandatory XAPO COM interface -- a thin wrapper that manages + // DSP code, allowing it to be easily plugged into an XAudio2 effect chain. + #undef INTERFACE + #define INTERFACE IXAPO + DECLARE_INTERFACE_(IXAPO, IUnknown) { + //// + // DESCRIPTION: + // Allocates a copy of the registration properties of the XAPO. + // + // PARAMETERS: + // ppRegistrationProperties - [out] receives pointer to copy of registration properties, use XAPOFree to free structure, left untouched on failure + // + // RETURN VALUE: + // COM error code + //// + STDMETHOD(GetRegistrationProperties) (THIS_ __deref_out XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties) PURE; + + //// + // DESCRIPTION: + // Queries if an input/output configuration is supported. + // + // REMARKS: + // This method allows XAPOs to express dependency of input format + // with respect to output format. + // + // If the input/output format pair configuration is unsupported, + // this method also determines the nearest input format supported. + // Nearest meaning closest bit depth, framerate, and channel count, + // in that order of importance. + // + // The behaviour of this method should remain constant after the + // XAPO has been initialized. + // + // PARAMETERS: + // pOutputFormat - [in] output format known to be supported + // pRequestedInputFormat - [in] input format to examine + // ppSupportedInputFormat - [out] receives pointer to nearest input format supported if not NULL and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except XAPO_E_FORMAT_UNSUPPORTED + // + // RETURN VALUE: + // COM error code, including: + // S_OK - input/output configuration supported, ppSupportedInputFormat left untouched + // XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, ppSupportedInputFormat receives pointer to nearest input format supported if not NULL + // E_INVALIDARG - either audio format invalid, ppSupportedInputFormat left untouched + //// + STDMETHOD(IsInputFormatSupported) (THIS_ const WAVEFORMATEX* pOutputFormat, const WAVEFORMATEX* pRequestedInputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedInputFormat) PURE; + + //// + // DESCRIPTION: + // Queries if an input/output configuration is supported. + // + // REMARKS: + // This method allows XAPOs to express dependency of output format + // with respect to input format. + // + // If the input/output format pair configuration is unsupported, + // this method also determines the nearest output format supported. + // Nearest meaning closest bit depth, framerate, and channel count, + // in that order of importance. + // + // The behaviour of this method should remain constant after the + // XAPO has been initialized. + // + // PARAMETERS: + // pInputFormat - [in] input format known to be supported + // pRequestedOutputFormat - [in] output format to examine + // ppSupportedOutputFormat - [out] receives pointer to nearest output format supported if not NULL and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except XAPO_E_FORMAT_UNSUPPORTED + // + // RETURN VALUE: + // COM error code, including: + // S_OK - input/output configuration supported, ppSupportedOutputFormat left untouched + // XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, ppSupportedOutputFormat receives pointer to nearest output format supported if not NULL + // E_INVALIDARG - either audio format invalid, ppSupportedOutputFormat left untouched + //// + STDMETHOD(IsOutputFormatSupported) (THIS_ const WAVEFORMATEX* pInputFormat, const WAVEFORMATEX* pRequestedOutputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedOutputFormat) PURE; + + //// + // DESCRIPTION: + // Performs any effect-specific initialization if required. + // + // REMARKS: + // The contents of pData are defined by the XAPO. + // Immutable variables (constant during the lifespan of the XAPO) + // should be set once via this method. + // Once initialized, an XAPO cannot be initialized again. + // + // An XAPO should be initialized before passing it to XAudio2 + // as part of an effect chain. XAudio2 will not call this method; + // it exists for future content-driven initialization by XACT. + // + // PARAMETERS: + // pData - [in] effect-specific initialization parameters, may be NULL if DataByteSize == 0 + // DataByteSize - [in] size of pData in bytes, may be 0 if DataByteSize is NULL + // + // RETURN VALUE: + // COM error code + //// + STDMETHOD(Initialize) (THIS_ __in_bcount_opt(DataByteSize) const void* pData, UINT32 DataByteSize) PURE; + + //// + // DESCRIPTION: + // Resets variables dependent on frame history. + // + // REMARKS: + // All other variables remain unchanged, including variables set by + // IXAPOParameters::SetParameters. + // + // For example, an effect with delay should zero out its delay line + // during this method, but should not reallocate anything as the + // XAPO remains locked with a constant input/output configuration. + // + // XAudio2 calls this method only if the XAPO is locked. + // This method should not block as it is called from the + // realtime thread. + // + // PARAMETERS: + // void + // + // RETURN VALUE: + // void + //// + STDMETHOD_(void, Reset) (THIS) PURE; + + //// + // DESCRIPTION: + // Locks the XAPO to a specific input/output configuration, + // allowing it to do any final initialization before Process + // is called on the realtime thread. + // + // REMARKS: + // Once locked, the input/output configuration and any other locked + // variables remain constant until UnlockForProcess is called. + // + // XAPOs should assert the input/output configuration is supported + // and that any required effect-specific initialization is complete. + // IsInputFormatSupported, IsOutputFormatSupported, and Initialize + // should be called as necessary before this method is called. + // + // All internal memory buffers required for Process should be + // allocated by the time this method returns successfully + // as Process is non-blocking and should not allocate memory. + // + // Once locked, an XAPO cannot be locked again until + // UnLockForProcess is called. + // + // PARAMETERS: + // InputLockedParameterCount - [in] number of input buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount] + // pInputLockedParameters - [in] array of input locked buffer parameter structures, may be NULL if InputLockedParameterCount == 0, otherwise must have InputLockedParameterCount elements + // OutputLockedParameterCount - [in] number of output buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount], must match InputLockedParameterCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used + // pOutputLockedParameters - [in] array of output locked buffer parameter structures, may be NULL if OutputLockedParameterCount == 0, otherwise must have OutputLockedParameterCount elements + // + // RETURN VALUE: + // COM error code + //// + STDMETHOD(LockForProcess) (THIS_ UINT32 InputLockedParameterCount, __in_ecount_opt(InputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters, UINT32 OutputLockedParameterCount, __in_ecount_opt(OutputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters) PURE; + + //// + // DESCRIPTION: + // Opposite of LockForProcess. Variables allocated during + // LockForProcess should be deallocated by this method. + // + // REMARKS: + // Unlocking an XAPO allows an XAPO instance to be reused with + // different input/output configurations. + // + // PARAMETERS: + // void + // + // RETURN VALUE: + // void + //// + STDMETHOD_(void, UnlockForProcess) (THIS) PURE; + + //// + // DESCRIPTION: + // Runs the XAPO's DSP code on the given input/output buffers. + // + // REMARKS: + // In addition to writing to the output buffers as appropriate, + // an XAPO must set the BufferFlags and ValidFrameCount members + // of all elements in pOutputProcessParameters accordingly. + // + // ppInputProcessParameters will not necessarily be the same as + // ppOutputProcessParameters for in-place processing, rather + // the pBuffer members of each will point to the same memory. + // + // Multiple input/output buffers may be used with in-place XAPOs, + // though the input buffer count must equal the output buffer count. + // When multiple input/output buffers are used with in-place XAPOs, + // the XAPO may assume input buffer [N] equals output buffer [N]. + // + // When IsEnabled is FALSE, the XAPO should process thru. + // Thru processing means an XAPO should not apply its normal + // processing to the given input/output buffers during Process. + // It should instead pass data from input to output with as little + // modification possible. Effects that perform format conversion + // should continue to do so. The effect must ensure transitions + // between normal and thru processing do not introduce + // discontinuities into the signal. + // + // XAudio2 calls this method only if the XAPO is locked. + // This method should not block as it is called from the + // realtime thread. + // + // PARAMETERS: + // InputProcessParameterCount - [in] number of input buffers, matches respective InputLockedParameterCount parameter given to LockForProcess + // pInputProcessParameters - [in] array of input process buffer parameter structures, may be NULL if InputProcessParameterCount == 0, otherwise must have InputProcessParameterCount elements + // OutputProcessParameterCount - [in] number of output buffers, matches respective OutputLockedParameterCount parameter given to LockForProcess + // pOutputProcessParameters - [in/out] array of output process buffer parameter structures, may be NULL if OutputProcessParameterCount == 0, otherwise must have OutputProcessParameterCount elements + // IsEnabled - [in] TRUE to process normally, FALSE to process thru + // + // RETURN VALUE: + // void + //// + STDMETHOD_(void, Process) (THIS_ UINT32 InputProcessParameterCount, __in_ecount_opt(InputProcessParameterCount) const XAPO_PROCESS_BUFFER_PARAMETERS* pInputProcessParameters, UINT32 OutputProcessParameterCount, __inout_ecount_opt(OutputProcessParameterCount) XAPO_PROCESS_BUFFER_PARAMETERS* pOutputProcessParameters, BOOL IsEnabled) PURE; + + //// + // DESCRIPTION: + // Returns the number of input frames required to generate the + // requested number of output frames. + // + // REMARKS: + // XAudio2 may call this method to determine how many input frames + // an XAPO requires. This is constant for locked CBR XAPOs; + // this method need only be called once while an XAPO is locked. + // + // XAudio2 calls this method only if the XAPO is locked. + // This method should not block as it is called from the + // realtime thread. + // + // PARAMETERS: + // OutputFrameCount - [in] requested number of output frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs + // + // RETURN VALUE: + // number of input frames required + //// + STDMETHOD_(UINT32, CalcInputFrames) (THIS_ UINT32 OutputFrameCount) PURE; + + //// + // DESCRIPTION: + // Returns the number of output frames generated for the + // requested number of input frames. + // + // REMARKS: + // XAudio2 may call this method to determine how many output frames + // an XAPO will generate. This is constant for locked CBR XAPOs; + // this method need only be called once while an XAPO is locked. + // + // XAudio2 calls this method only if the XAPO is locked. + // This method should not block as it is called from the + // realtime thread. + // + // PARAMETERS: + // InputFrameCount - [in] requested number of input frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs + // + // RETURN VALUE: + // number of output frames generated + //// + STDMETHOD_(UINT32, CalcOutputFrames) (THIS_ UINT32 InputFrameCount) PURE; + }; + + + + // IXAPOParameters: + // Optional XAPO COM interface that allows an XAPO to use + // effect-specific parameters. + #undef INTERFACE + #define INTERFACE IXAPOParameters + DECLARE_INTERFACE_(IXAPOParameters, IUnknown) { + //// + // DESCRIPTION: + // Sets effect-specific parameters. + // + // REMARKS: + // This method may only be called on the realtime thread; + // no synchronization between it and IXAPO::Process is necessary. + // + // This method should not block as it is called from the + // realtime thread. + // + // PARAMETERS: + // pParameters - [in] effect-specific parameter block, must be != NULL + // ParameterByteSize - [in] size of pParameters in bytes, must be > 0 + // + // RETURN VALUE: + // void + //// + STDMETHOD_(void, SetParameters) (THIS_ __in_bcount(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize) PURE; + + //// + // DESCRIPTION: + // Gets effect-specific parameters. + // + // REMARKS: + // Unlike SetParameters, XAudio2 does not call this method on the + // realtime thread. Thus, the XAPO must protect variables shared + // with SetParameters/Process using appropriate synchronization. + // + // PARAMETERS: + // pParameters - [out] receives effect-specific parameter block, must be != NULL + // ParameterByteSize - [in] size of pParameters in bytes, must be > 0 + // + // RETURN VALUE: + // void + //// + STDMETHOD_(void, GetParameters) (THIS_ __out_bcount(ParameterByteSize) void* pParameters, UINT32 ParameterByteSize) PURE; + }; + + +//-------------------------------------------------------------// + // macros to allow XAPO interfaces to be used in C code + #if !defined(__cplusplus) + // IXAPO + #define IXAPO_QueryInterface(This, riid, ppInterface) \ + ( (This)->lpVtbl->QueryInterface(This, riid, ppInterface) ) + + #define IXAPO_AddRef(This) \ + ( (This)->lpVtbl->AddRef(This) ) + + #define IXAPO_Release(This) \ + ( (This)->lpVtbl->Release(This) ) + + #define IXAPO_GetRegistrationProperties(This, ppRegistrationProperties) \ + ( (This)->lpVtbl->GetRegistrationProperties(This, ppRegistrationProperties) ) + + #define IXAPO_IsInputFormatSupported(This, pOutputFormat, pRequestedInputFormat, ppSupportedInputFormat) \ + ( (This)->lpVtbl->IsInputFormatSupported(This, pOutputFormat, pRequestedInputFormat, ppSupportedInputFormat) ) + + #define IXAPO_IsOutputFormatSupported(This, pInputFormat, pRequestedOutputFormat, ppSupportedOutputFormat) \ + ( (This)->lpVtbl->IsOutputFormatSupported(This, pInputFormat, pRequestedOutputFormat, ppSupportedOutputFormat) ) + + #define IXAPO_Initialize(This, pData, DataByteSize) \ + ( (This)->lpVtbl->Initialize(This, pData, DataByteSize) ) + + #define IXAPO_Reset(This) \ + ( (This)->lpVtbl->Reset(This) ) + + #define IXAPO_LockForProcess(This, InputLockedParameterCount, pInputLockedParameters, OutputLockedParameterCount, pOutputLockedParameters) \ + ( (This)->lpVtbl->LockForProcess(This, InputLockedParameterCount, pInputLockedParameters, OutputLockedParameterCount, pOutputLockedParameters) ) + + #define IXAPO_UnlockForProcess(This) \ + ( (This)->lpVtbl->UnlockForProcess(This) ) + + #define IXAPO_Process(This, InputProcessParameterCount, pInputProcessParameters, OutputProcessParameterCount, pOutputProcessParameters, IsEnabled) \ + ( (This)->lpVtbl->Process(This, InputProcessParameterCount, pInputProcessParameters, OutputProcessParameterCount, pOutputProcessParameters, IsEnabled) ) + + #define IXAPO_CalcInputFrames(This, OutputFrameCount) \ + ( (This)->lpVtbl->CalcInputFrames(This, OutputFrameCount) ) + + #define IXAPO_CalcOutputFrames(This, InputFrameCount) \ + ( (This)->lpVtbl->CalcOutputFrames(This, InputFrameCount) ) + + + // IXAPOParameters + #define IXAPOParameters_QueryInterface(This, riid, ppInterface) \ + ( (This)->lpVtbl->QueryInterface(This, riid, ppInterface) ) + + #define IXAPOParameters_AddRef(This) \ + ( (This)->lpVtbl->AddRef(This) ) + + #define IXAPOParameters_Release(This) \ + ( (This)->lpVtbl->Release(This) ) + + #define IXAPOParameters_SetParameters(This, pParameters, ParameterByteSize) \ + ( (This)->lpVtbl->SetParameters(This, pParameters, ParameterByteSize) ) + + #define IXAPOParameters_GetParameters(This, pParameters, ParameterByteSize) \ + ( (This)->lpVtbl->GetParameters(This, pParameters, ParameterByteSize) ) + #endif // !defined(__cplusplus) + + + #pragma pack(pop) // revert packing alignment +#endif // !defined(GUID_DEFS_ONLY) +//---------------------------------<-EOF->----------------------------------// diff --git a/RenderDll/Dx9Sdk/Include/XAPOBase.h b/RenderDll/Dx9Sdk/Include/XAPOBase.h new file mode 100644 index 0000000..24c5c6f --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/XAPOBase.h @@ -0,0 +1,337 @@ +/*-========================================================================-_ + | - XAPO - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |PROJECT: XAPO MODEL: Unmanaged User-mode | + |VERSION: 1.0 EXCEPT: No Exceptions | + |CLASS: N / A MINREQ: WinXP, Xbox360 | + |BASE: N / A DIALECT: MSC++ 14.00 | + |>------------------------------------------------------------------------<| + | DUTY: XAPO base classes | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. See XAPO.h for the rules governing XAPO interface behaviour. */ + +#pragma once +//---------------------------------------------------// +#include "XAPO.h" + +// default audio format ranges supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat +#define XAPOBASE_DEFAULT_FORMAT_TAG WAVE_FORMAT_IEEE_FLOAT // 32-bit float only, applies to WAVEFORMATEX.wFormatTag or WAVEFORMATEXTENSIBLE.SubFormat when used +#define XAPOBASE_DEFAULT_FORMAT_MIN_CHANNELS XAPO_MIN_CHANNELS // minimum channel count, applies to WAVEFORMATEX.nChannels +#define XAPOBASE_DEFAULT_FORMAT_MAX_CHANNELS XAPO_MAX_CHANNELS // maximum channel count, applies to WAVEFORMATEX.nChannels +#define XAPOBASE_DEFAULT_FORMAT_MIN_FRAMERATE XAPO_MIN_FRAMERATE // minimum framerate, applies to WAVEFORMATEX.nSamplesPerSec +#define XAPOBASE_DEFAULT_FORMAT_MAX_FRAMERATE XAPO_MAX_FRAMERATE // maximum framerate, applies to WAVEFORMATEX.nSamplesPerSec +#define XAPOBASE_DEFAULT_FORMAT_BITSPERSAMPLE 32 // 32-bit float only, applies to WAVEFORMATEX.wBitsPerSample and WAVEFORMATEXTENSIBLE.wValidBitsPerSample when used + +// default XAPO property flags supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS +#define XAPOBASE_DEFAULT_FLAG (XAPO_FLAG_CHANNELS_MUST_MATCH | XAPO_FLAG_FRAMERATE_MUST_MATCH | XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH | XAPO_FLAG_BUFFERCOUNT_MUST_MATCH | XAPO_FLAG_INPLACE_SUPPORTED) + +// default number of input and output buffers supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS +#define XAPOBASE_DEFAULT_BUFFER_COUNT 1 + + +//-------------------------------------------------------------// +// assertion +#if !defined(XAPOASSERT) + #if XAPODEBUG + #define XAPOASSERT(exp) if (!(exp)) { OutputDebugStringA("XAPO ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); } + #else + #define XAPOASSERT(exp) __assume(exp) + #endif +#endif + + +//-----------------------------------------------------// +#pragma pack(push, 8) // set packing alignment to ensure consistency across arbitrary build environments, and ensure synchronization variables used by Interlocked functionality are correctly aligned + + +// primitive types +typedef float FLOAT32; // 32-bit IEEE float + + + //// + // DESCRIPTION: + // Default implementation of the IXAPO and IUnknown interfaces. + // Provides overridable implementations for all methods save IXAPO::Process. + //// +class __declspec(novtable) CXAPOBase: public IXAPO { +private: + const XAPO_REGISTRATION_PROPERTIES* m_pRegistrationProperties; // pointer to registration properties of the XAPO, set via constructor + + void* m_pfnMatrixMixFunction; // optimal matrix function pointer, used for thru processing + FLOAT32* m_pfl32MatrixCoefficients; // matrix coefficient table, used for thru processing + UINT32 m_nSrcFormatType; // input format type, used for thru processing + BOOL m_fIsScalarMatrix; // TRUE if m_pfl32MatrixCoefficients is diagonal matrix with all main diagonal entries equal, i.e. m_pfnMatrixMixFunction only used for type conversion (no channel conversion), used for thru processing + BOOL m_fIsLocked; // TRUE if XAPO locked via CXAPOBase.LockForProcess + + +protected: + LONG m_lReferenceCount; // COM reference count, must be aligned for atomic operations + + //// + // DESCRIPTION: + // Verifies an audio format falls within the default ranges supported. + // + // REMARKS: + // If pFormat is unsupported, and fOverwrite is TRUE, + // pFormat is overwritten with the nearest format supported. + // Nearest meaning closest bit depth, framerate, and channel count, + // in that order of importance. + // + // PARAMETERS: + // pFormat - [in/out] audio format to examine + // fOverwrite - [in] TRUE to overwrite pFormat if audio format unsupported + // + // RETURN VALUE: + // COM error code, including: + // S_OK - audio format supported, pFormat left untouched + // XAPO_E_FORMAT_UNSUPPORTED - audio format unsupported, pFormat overwritten with nearest audio format supported if fOverwrite TRUE + // E_INVALIDARG - audio format invalid, pFormat left untouched + //// + virtual HRESULT ValidateFormatDefault (__inout WAVEFORMATEX* pFormat, BOOL fOverwrite); + + //// + // DESCRIPTION: + // Verifies that an input/output format pair configuration is supported + // with respect to the XAPO property flags. + // + // REMARKS: + // If pRequestedFormat is unsupported, and fOverwrite is TRUE, + // pRequestedFormat is overwritten with the nearest format supported. + // Nearest meaning closest bit depth, framerate, and channel count, + // in that order of importance. + // + // PARAMETERS: + // pSupportedFormat - [in] audio format known to be supported + // pRequestedFormat - [in/out] audio format to examine, must be WAVEFORMATEXTENSIBLE if fOverwrite TRUE + // fOverwrite - [in] TRUE to overwrite pRequestedFormat if input/output configuration unsupported + // + // RETURN VALUE: + // COM error code, including: + // S_OK - input/output configuration supported, pRequestedFormat left untouched + // XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, pRequestedFormat overwritten with nearest audio format supported if fOverwrite TRUE + // E_INVALIDARG - either audio format invalid, pRequestedFormat left untouched + //// + HRESULT ValidateFormatPair (const WAVEFORMATEX* pSupportedFormat, __inout WAVEFORMATEX* pRequestedFormat, BOOL fOverwrite); + + //// + // DESCRIPTION: + // This method may be called by an IXAPO::Process implementation + // for thru processing. It copies/mixes data from source to + // destination, making as few changes as possible to the audio data. + // + // REMARKS: + // However, this method is capable of channel upmix/downmix and uses + // the same matrix coefficient table used by windows Vista to do so. + // + // For in-place processing (input buffer == output buffer) + // this method does nothing. + // + // This method should be called only if the XAPO is locked and + // XAPO_FLAG_FRAMERATE_MUST_MATCH is used. + // + // PARAMETERS: + // pInputBuffer - [in] input buffer, format may be INT8, INT16, INT20 (contained in 24 or 32 bits), INT24 (contained in 24 or 32 bits), INT32, or FLOAT32 + // pOutputBuffer - [out] output buffer, format must be FLOAT32 + // FrameCount - [in] number of frames to process + // InputChannelCount - [in] number of input channels + // OutputChannelCount - [in] number of output channels + // MixWithOutput - [in] TRUE to mix with output, FALSE to overwrite output + // + // RETURN VALUE: + // void + //// + void ProcessThru (__in void* pInputBuffer, __inout FLOAT32* pOutputBuffer, UINT32 FrameCount, WORD InputChannelCount, WORD OutputChannelCount, BOOL MixWithOutput); + + // accessors + const XAPO_REGISTRATION_PROPERTIES* GetRegistrationPropertiesInternal () { return m_pRegistrationProperties; } + BOOL IsLocked () { return m_fIsLocked; } + + +public: + CXAPOBase (const XAPO_REGISTRATION_PROPERTIES* pRegistrationProperties); + virtual ~CXAPOBase (); + + // IUnknown methods: + // retrieves the requested interface pointer if supported + STDMETHOD(QueryInterface) (REFIID riid, __deref_out_opt void** ppInterface) + { + XAPOASSERT(ppInterface != NULL); + HRESULT hr = S_OK; + + if (riid == __uuidof(IXAPO)) { + *ppInterface = static_cast(this); + AddRef(); + } else if (riid == __uuidof(IUnknown)) { + *ppInterface = static_cast(this); + AddRef(); + } else { + *ppInterface = NULL; + hr = E_NOINTERFACE; + } + + return hr; + } + + // increments reference count + STDMETHOD_(ULONG, AddRef) () + { + return (ULONG)InterlockedIncrement(&m_lReferenceCount); + } + + // decrements reference count and deletes the object if the reference count falls to zero + STDMETHOD_(ULONG, Release) () + { + ULONG uTmpReferenceCount = (ULONG)InterlockedDecrement(&m_lReferenceCount); + if (uTmpReferenceCount == 0) { + delete this; + } + return uTmpReferenceCount; + } + + // IXAPO methods: + // Allocates a copy of the registration properties of the XAPO. + // This default implementation returns a copy of the registration + // properties given to the constructor, allocated via XAPOAlloc. + STDMETHOD(GetRegistrationProperties) (__deref_out XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties); + + // Queries if a specific input format is supported for a given output format. + // This default implementation assumes only the format described by the + // XAPOBASE_DEFAULT_FORMAT values are supported for both input and output. + STDMETHOD(IsInputFormatSupported) (const WAVEFORMATEX* pOutputFormat, const WAVEFORMATEX* pRequestedInputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedInputFormat); + + // Queries if a specific output format is supported for a given input format. + // This default implementation assumes only the format described by the + // XAPOBASE_DEFAULT_FORMAT values are supported for both input and output. + STDMETHOD(IsOutputFormatSupported) (const WAVEFORMATEX* pInputFormat, const WAVEFORMATEX* pRequestedOutputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedOutputFormat); + + // Performs any effect-specific initialization. + // This default implementation is a no-op and only returns S_OK. + STDMETHOD(Initialize) (__in_bcount_opt(DataByteSize) const void*, UINT32 DataByteSize) + { + UNREFERENCED_PARAMETER(DataByteSize); + return S_OK; + } + + // Resets variables dependent on frame history. + // This default implementation is a no-op: this base class contains no + // relevant state to reset. + STDMETHOD_(void, Reset) () { return; } + + // Notifies XAPO of buffer formats Process() will be given. + // This default implementation performs basic input/output format + // validation against the XAPO's registration properties. + // Derived XAPOs should call the base implementation first. + STDMETHOD(LockForProcess) (UINT32 InputLockedParameterCount, __in_ecount_opt(InputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters, UINT32 OutputLockedParameterCount, __in_ecount_opt(OutputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters); + + // Opposite of LockForProcess. + // Derived XAPOs should call the base implementation first. + STDMETHOD_(void, UnlockForProcess) (); + + // Returns the number of input frames required to generate the requested number of output frames. + // By default, this method returns the same number of frames it was passed. + STDMETHOD_(UINT32, CalcInputFrames) (UINT32 OutputFrameCount) { return OutputFrameCount; } + + // Returns the number of output frames generated for the requested number of input frames. + // By default, this method returns the same number of frames it was passed. + STDMETHOD_(UINT32, CalcOutputFrames) (UINT32 InputFrameCount) { return InputFrameCount; } +}; + + + + + +//--------------------------------------------------------------------------// + //// + // DESCRIPTION: + // Extends CXAPOBase, providing a default implementation of the + // IXAPOParameters interface with appropriate synchronization to + // protect variables shared between IXAPOParameters::GetParameters + // and IXAPOParameters::SetParameters/IXAPO::Process. + // + // This class is for parameter blocks whose size is larger than 4 bytes. + // For smaller parameter blocks, use atomic operations directly + // on the parameters for synchronization. + //// +class __declspec(novtable) CXAPOParametersBase: public CXAPOBase, public IXAPOParameters { +private: + BYTE* m_pParameterBlocks; // three contiguous process parameter blocks used for synchronization, user responsible for initialization of parameter blocks before IXAPO::Process/SetParameters/GetParameters called + BYTE* m_pCurrentParameters; // pointer to current process parameters, must be aligned for atomic operations + BYTE* m_pCurrentParametersInternal; // pointer to current process parameters (temp pointer read by SetParameters/BeginProcess/EndProcess) + UINT32 m_uCurrentParametersIndex; // index of current process parameters + UINT32 m_uParameterBlockByteSize; // size of a single parameter block in bytes, must be > 0 + BOOL m_fNewerResultsReady; // TRUE if there exists new processing results not yet picked up by GetParameters(), must be aligned for atomic operations + BOOL m_fProducer; // IXAPO::Process produces data to be returned by GetParameters(); SetParameters() disallowed + + +public: + //// + // PARAMETERS: + // pRegistrationProperties - [in] registration properties of the XAPO + // pParameterBlocks - [in] three contiguous process parameter blocks used for synchronization + // uParameterBlockByteSize - [in] size of one of the parameter blocks, must be > 0 + // fProducer - [in] TRUE if IXAPO::Process produces data to be returned by GetParameters() (SetParameters() and ParametersChanged() disallowed) + //// + CXAPOParametersBase (const XAPO_REGISTRATION_PROPERTIES* pRegistrationProperties, BYTE* pParameterBlocks, UINT32 uParameterBlockByteSize, BOOL fProducer); + virtual ~CXAPOParametersBase (); + + // IUnknown methods: + // retrieves the requested interface pointer if supported + STDMETHOD(QueryInterface) (REFIID riid, __deref_out_opt void** ppInterface) + { + XAPOASSERT(ppInterface != NULL); + HRESULT hr = S_OK; + + if (riid == __uuidof(IXAPOParameters)) { + *ppInterface = static_cast(this); + CXAPOBase::AddRef(); + } else { + hr = CXAPOBase::QueryInterface(riid, ppInterface); + } + + return hr; + } + + // increments reference count + STDMETHOD_(ULONG, AddRef)() { return CXAPOBase::AddRef(); } + + // decrements reference count and deletes the object if the reference count falls to zero + STDMETHOD_(ULONG, Release)() { return CXAPOBase::Release(); } + + // IXAPOParameters methods: + // Sets effect-specific parameters. + // This method may only be called on the realtime audio processing thread. + STDMETHOD_(void, SetParameters) (__in_bcount(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize); + + // Gets effect-specific parameters. + // This method may block and should not be called from the realtime thread. + // Get the current parameters via BeginProcess. + STDMETHOD_(void, GetParameters) (__out_bcount(ParameterByteSize) void* pParameters, UINT32 ParameterByteSize); + + // Called by SetParameters() to allow for user-defined parameter validation. + // SetParameters validates that ParameterByteSize == m_uParameterBlockByteSize + // so the user may assume/assert ParameterByteSize == m_uParameterBlockByteSize. + // This method should not block as it is called from the realtime thread. + virtual void OnSetParameters (const void*, UINT32) { } + + // Returns TRUE if SetParameters() has been called since the last processing pass. + // May only be used within the XAPO's IXAPO::Process implementation, + // before BeginProcess is called. + BOOL ParametersChanged (); + + // Returns latest process parameters. + // XAPOs must call this method within their IXAPO::Process + // implementation to access latest process parameters in threadsafe manner. + BYTE* BeginProcess (); + + // Notifies CXAPOParametersBase that the XAPO has finished accessing + // the latest process parameters. + // XAPOs must call this method within their IXAPO::Process + // implementation to access latest process parameters in threadsafe manner. + void EndProcess (); +}; + + +#pragma pack(pop) // revert packing alignment +//---------------------------------<-EOF->----------------------------------// diff --git a/RenderDll/Dx9Sdk/Include/XAPOFX.h b/RenderDll/Dx9Sdk/Include/XAPOFX.h new file mode 100644 index 0000000..a5dbeef --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/XAPOFX.h @@ -0,0 +1,167 @@ +/*-========================================================================-_ + | - XAPOFX - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |PROJECT: XAPOFX MODEL: Unmanaged User-mode | + |VERSION: 1.3 EXCEPT: No Exceptions | + |CLASS: N / A MINREQ: WinXP, Xbox360 | + |BASE: N / A DIALECT: MSC++ 14.00 | + |>------------------------------------------------------------------------<| + | DUTY: Cross-platform Audio Processing Objects | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. USE THE DEBUG DLL TO ENABLE PARAMETER VALIDATION VIA ASSERTS! + Here's how: + Copy XAPOFXDX_X.dll to where your application exists. + The debug DLL can be found under %WINDIR%\system32. + Rename XAPOFXDX_X.dll to XAPOFXX_X.dll to use the debug version. */ + +#pragma once +//---------------------------------------------------// +#include "comdecl.h" // for DEFINE_CLSID + +// FX class IDs +DEFINE_CLSID(FXEQ, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 00); +DEFINE_CLSID(FXMasteringLimiter, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 01); +DEFINE_CLSID(FXReverb, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 02); +DEFINE_CLSID(FXEcho, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 03); + + +#if !defined(GUID_DEFS_ONLY) // ignore rest if only GUID definitions requested + #if defined(_XBOX) // general windows and COM declarations + #include + #include + #else + #include + #include + #endif + #include // float bounds + + + // EQ parameter bounds (inclusive), used with XEQ: + #define FXEQ_MIN_FRAMERATE 22000 + #define FXEQ_MAX_FRAMERATE 48000 + + #define FXEQ_MIN_FREQUENCY_CENTER 20.0f + #define FXEQ_MAX_FREQUENCY_CENTER 20000.0f + #define FXEQ_DEFAULT_FREQUENCY_CENTER_0 100.0f // band 0 + #define FXEQ_DEFAULT_FREQUENCY_CENTER_1 800.0f // band 1 + #define FXEQ_DEFAULT_FREQUENCY_CENTER_2 2000.0f // band 2 + #define FXEQ_DEFAULT_FREQUENCY_CENTER_3 10000.0f // band 3 + + #define FXEQ_MIN_GAIN 0.126f // -18dB + #define FXEQ_MAX_GAIN 7.94f // +18dB + #define FXEQ_DEFAULT_GAIN 1.0f // 0dB change, all bands + + #define FXEQ_MIN_BANDWIDTH 0.1f + #define FXEQ_MAX_BANDWIDTH 2.0f + #define FXEQ_DEFAULT_BANDWIDTH 1.0f // all bands + + + // Mastering limiter parameter bounds (inclusive), used with XMasteringLimiter: + #define FXMASTERINGLIMITER_MIN_RELEASE 1 + #define FXMASTERINGLIMITER_MAX_RELEASE 20 + #define FXMASTERINGLIMITER_DEFAULT_RELEASE 6 + + #define FXMASTERINGLIMITER_MIN_LOUDNESS 1 + #define FXMASTERINGLIMITER_MAX_LOUDNESS 1800 + #define FXMASTERINGLIMITER_DEFAULT_LOUDNESS 1000 + + + // Reverb parameter bounds (inclusive), used with XReverb: + #define FXREVERB_MIN_DIFFUSION 0.0f + #define FXREVERB_MAX_DIFFUSION 1.0f + #define FXREVERB_DEFAULT_DIFFUSION 0.9f + + #define FXREVERB_MIN_ROOMSIZE 0.0001f + #define FXREVERB_MAX_ROOMSIZE 1.0f + #define FXREVERB_DEFAULT_ROOMSIZE 0.6f + + + // Echo parameter bounds (inclusive), used with XEcho: + #define FXECHO_MIN_WETDRYMIX 0.0f + #define FXECHO_MAX_WETDRYMIX 1.0f + #define FXECHO_DEFAULT_WETDRYMIX 0.5f + + #define FXECHO_MIN_FEEDBACK 0.0f + #define FXECHO_MAX_FEEDBACK 1.0f + #define FXECHO_DEFAULT_FEEDBACK 0.5f + + #define FXECHO_MIN_DELAY 1.0f + #define FXECHO_MAX_DELAY 2000.0f + #define FXECHO_DEFAULT_DELAY 500.0f + + +//-----------------------------------------------------// + #pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments + + + // EQ parameters (4 bands), used with IXAPOParameters::SetParameters: + // The EQ supports only FLOAT32 audio foramts. + // The framerate must be within [22000, 48000] Hz. + typedef struct FXEQ_PARAMETERS { + float FrequencyCenter0; // center frequency in Hz, band 0 + float Gain0; // boost/cut + float Bandwidth0; // bandwidth, region of EQ is center frequency +/- bandwidth/2 + float FrequencyCenter1; // band 1 + float Gain1; + float Bandwidth1; + float FrequencyCenter2; // band 2 + float Gain2; + float Bandwidth2; + float FrequencyCenter3; // band 3 + float Gain3; + float Bandwidth3; + } FXEQ_PARAMETERS; + + + // Mastering limiter parameters, used with IXAPOParameters::SetParameters: + // The mastering limiter supports only FLOAT32 audio formats. + typedef struct FXMASTERINGLIMITER_PARAMETERS { + UINT32 Release; // release time (tuning factor with no specific units) + UINT32 Loudness; // loudness target (threshold) + } FXMASTERINGLIMITER_PARAMETERS; + + + // Reverb parameters, used with IXAPOParameters::SetParameters: + // The reverb supports only FLOAT32 audio formats with the following + // channel configurations: + // Input: Mono Output: Mono + // Input: Stereo Output: Stereo + typedef struct FXREVERB_PARAMETERS { + float Diffusion; // diffusion + float RoomSize; // room size + } FXREVERB_PARAMETERS; + + + // Echo parameters, used with IXAPOParameters::SetParameters: + // The echo supports only FLOAT32 audio formats. + typedef struct FXECHO_PARAMETERS { + float WetDryMix; // ratio of wet (processed) signal to dry (original) signal + float Feedback; // amount of output fed back into input + float Delay; // delay (all channels) in milliseconds + } FXECHO_PARAMETERS; + + +//-------------------------------------------------------------// + // function storage-class attribute and calltype + #if defined(_XBOX) || !defined(FXDLL) + #define FX_API_(type) EXTERN_C type STDAPIVCALLTYPE + #else + #if defined(FXEXPORT) + #define FX_API_(type) EXTERN_C __declspec(dllexport) type STDAPIVCALLTYPE + #else + #define FX_API_(type) EXTERN_C __declspec(dllimport) type STDAPIVCALLTYPE + #endif + #endif + #define FX_IMP_(type) type STDMETHODVCALLTYPE + + +//-------------------------------------------------------// + // creates instance of requested XAPO, use Release to free instance + FX_API_(HRESULT) CreateFX (REFCLSID clsid, __deref_out IUnknown** pEffect); + + + #pragma pack(pop) // revert packing alignment +#endif // !defined(GUID_DEFS_ONLY) +//---------------------------------<-EOF->----------------------------------// diff --git a/RenderDll/Dx9Sdk/Include/XAudio2.h b/RenderDll/Dx9Sdk/Include/XAudio2.h new file mode 100644 index 0000000..885b92f --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/XAudio2.h @@ -0,0 +1,1282 @@ +/************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: xaudio2.h + * Content: Declarations for the XAudio2 game audio API. + * + **************************************************************************/ + +#ifndef __XAUDIO2_INCLUDED__ +#define __XAUDIO2_INCLUDED__ + + +/************************************************************************** + * + * XAudio2 COM object class and interface IDs. + * + **************************************************************************/ + +#include // For DEFINE_CLSID and DEFINE_IID + +// XAudio 2.0 (March 2008 SDK) +//DEFINE_CLSID(XAudio2, fac23f48, 31f5, 45a8, b4, 9b, 52, 25, d6, 14, 01, aa); +//DEFINE_CLSID(XAudio2_Debug, fac23f48, 31f5, 45a8, b4, 9b, 52, 25, d6, 14, 01, db); + +// XAudio 2.1 (June 2008 SDK) +//DEFINE_CLSID(XAudio2, e21a7345, eb21, 468e, be, 50, 80, 4d, b9, 7c, f7, 08); +//DEFINE_CLSID(XAudio2_Debug, f7a76c21, 53d4, 46bb, ac, 53, 8b, 45, 9c, ae, 46, bd); + +// XAudio 2.2 (August 2008 SDK) +//DEFINE_CLSID(XAudio2, b802058a, 464a, 42db, bc, 10, b6, 50, d6, f2, 58, 6a); +//DEFINE_CLSID(XAudio2_Debug, 97dfb7e7, 5161, 4015, 87, a9, c7, 9e, 6a, 19, 52, cc); + +// XAudio 2.3 (November 2008 SDK) +//DEFINE_CLSID(XAudio2, 4c5e637a, 16c7, 4de3, 9c, 46, 5e, d2, 21, 81, 96, 2d); +//DEFINE_CLSID(XAudio2_Debug, ef0aa05d, 8075, 4e5d, be, ad, 45, be, 0c, 3c, cb, b3); + +// XAudio 2.4 (March 2009 SDK) +//DEFINE_CLSID(XAudio2, 03219e78, 5bc3, 44d1, b9, 2e, f6, 3d, 89, cc, 65, 26); +//DEFINE_CLSID(XAudio2_Debug, 4256535c, 1ea4, 4d4b, 8a, d5, f9, db, 76, 2e, ca, 9e); + +// XAudio 2.5 (August 2009 SDK) +//DEFINE_CLSID(XAudio2, 4c9b6dde, 6809, 46e6, a2, 78, 9b, 6a, 97, 58, 86, 70); +//DEFINE_CLSID(XAudio2_Debug, 715bdd1a, aa82, 436b, b0, fa, 6a, ce, a3, 9b, d0, a1); + +// XAudio 2.6 (February 2010 SDK) +//DEFINE_CLSID(XAudio2, 3eda9b49, 2085, 498b, 9b, b2, 39, a6, 77, 84, 93, de); +//DEFINE_CLSID(XAudio2_Debug, 47199894, 7cc2, 444d, 98, 73, ce, d2, 56, 2c, c6, 0e); + +// XAudio 2.7 (June 2010 SDK) +DEFINE_CLSID(XAudio2, 5a508685, a254, 4fba, 9b, 82, 9a, 24, b0, 03, 06, af); +DEFINE_CLSID(XAudio2_Debug, db05ea35, 0329, 4d4b, a5, 3a, 6d, ea, d0, 3d, 38, 52); +DEFINE_IID(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb); + + +// Ignore the rest of this header if only the GUID definitions were requested +#ifndef GUID_DEFS_ONLY + +#ifdef _XBOX + #include // Xbox COM declarations (IUnknown, etc) +#else + #include // Windows COM declarations +#endif + +#include // Markers for documenting API semantics +#include // Basic audio data types and constants +#include // Data types and constants for XMA2 audio + +// All structures defined in this file use tight field packing +#pragma pack(push, 1) + + +/************************************************************************** + * + * XAudio2 constants, flags and error codes. + * + **************************************************************************/ + +// Numeric boundary values +#define XAUDIO2_MAX_BUFFER_BYTES 0x80000000 // Maximum bytes allowed in a source buffer +#define XAUDIO2_MAX_QUEUED_BUFFERS 64 // Maximum buffers allowed in a voice queue +#define XAUDIO2_MAX_BUFFERS_SYSTEM 2 // Maximum buffers allowed for system threads (Xbox 360 only) +#define XAUDIO2_MAX_AUDIO_CHANNELS 64 // Maximum channels in an audio stream +#define XAUDIO2_MIN_SAMPLE_RATE 1000 // Minimum audio sample rate supported +#define XAUDIO2_MAX_SAMPLE_RATE 200000 // Maximum audio sample rate supported +#define XAUDIO2_MAX_VOLUME_LEVEL 16777216.0f // Maximum acceptable volume level (2^24) +#define XAUDIO2_MIN_FREQ_RATIO (1/1024.0f) // Minimum SetFrequencyRatio argument +#define XAUDIO2_MAX_FREQ_RATIO 1024.0f // Maximum MaxFrequencyRatio argument +#define XAUDIO2_DEFAULT_FREQ_RATIO 2.0f // Default MaxFrequencyRatio argument +#define XAUDIO2_MAX_FILTER_ONEOVERQ 1.5f // Maximum XAUDIO2_FILTER_PARAMETERS.OneOverQ +#define XAUDIO2_MAX_FILTER_FREQUENCY 1.0f // Maximum XAUDIO2_FILTER_PARAMETERS.Frequency +#define XAUDIO2_MAX_LOOP_COUNT 254 // Maximum non-infinite XAUDIO2_BUFFER.LoopCount +#define XAUDIO2_MAX_INSTANCES 8 // Maximum simultaneous XAudio2 objects on Xbox 360 + +// For XMA voices on Xbox 360 there is an additional restriction on the MaxFrequencyRatio +// argument and the voice's sample rate: the product of these numbers cannot exceed 600000 +// for one-channel voices or 300000 for voices with more than one channel. +#define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MONO 600000 +#define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL 300000 + +// Numeric values with special meanings +#define XAUDIO2_COMMIT_NOW 0 // Used as an OperationSet argument +#define XAUDIO2_COMMIT_ALL 0 // Used in IXAudio2::CommitChanges +#define XAUDIO2_INVALID_OPSET (UINT32)(-1) // Not allowed for OperationSet arguments +#define XAUDIO2_NO_LOOP_REGION 0 // Used in XAUDIO2_BUFFER.LoopCount +#define XAUDIO2_LOOP_INFINITE 255 // Used in XAUDIO2_BUFFER.LoopCount +#define XAUDIO2_DEFAULT_CHANNELS 0 // Used in CreateMasteringVoice +#define XAUDIO2_DEFAULT_SAMPLERATE 0 // Used in CreateMasteringVoice + +// Flags +#define XAUDIO2_DEBUG_ENGINE 0x0001 // Used in XAudio2Create on Windows only +#define XAUDIO2_VOICE_NOPITCH 0x0002 // Used in IXAudio2::CreateSourceVoice +#define XAUDIO2_VOICE_NOSRC 0x0004 // Used in IXAudio2::CreateSourceVoice +#define XAUDIO2_VOICE_USEFILTER 0x0008 // Used in IXAudio2::CreateSource/SubmixVoice +#define XAUDIO2_VOICE_MUSIC 0x0010 // Used in IXAudio2::CreateSourceVoice +#define XAUDIO2_PLAY_TAILS 0x0020 // Used in IXAudio2SourceVoice::Stop +#define XAUDIO2_END_OF_STREAM 0x0040 // Used in XAUDIO2_BUFFER.Flags +#define XAUDIO2_SEND_USEFILTER 0x0080 // Used in XAUDIO2_SEND_DESCRIPTOR.Flags + +// Default parameters for the built-in filter +#define XAUDIO2_DEFAULT_FILTER_TYPE LowPassFilter +#define XAUDIO2_DEFAULT_FILTER_FREQUENCY XAUDIO2_MAX_FILTER_FREQUENCY +#define XAUDIO2_DEFAULT_FILTER_ONEOVERQ 1.0f + +// Internal XAudio2 constants +#ifdef _XBOX + #define XAUDIO2_QUANTUM_NUMERATOR 2 // On Xbox 360, XAudio2 processes audio + #define XAUDIO2_QUANTUM_DENOMINATOR 375 // in 5.333ms chunks (= 2/375 seconds) +#else + #define XAUDIO2_QUANTUM_NUMERATOR 1 // On Windows, XAudio2 processes audio + #define XAUDIO2_QUANTUM_DENOMINATOR 100 // in 10ms chunks (= 1/100 seconds) +#endif +#define XAUDIO2_QUANTUM_MS (1000.0f * XAUDIO2_QUANTUM_NUMERATOR / XAUDIO2_QUANTUM_DENOMINATOR) + +// XAudio2 error codes +#define FACILITY_XAUDIO2 0x896 +#define XAUDIO2_E_INVALID_CALL 0x88960001 // An API call or one of its arguments was illegal +#define XAUDIO2_E_XMA_DECODER_ERROR 0x88960002 // The XMA hardware suffered an unrecoverable error +#define XAUDIO2_E_XAPO_CREATION_FAILED 0x88960003 // XAudio2 failed to initialize an XAPO effect +#define XAUDIO2_E_DEVICE_INVALIDATED 0x88960004 // An audio device became unusable (unplugged, etc) + + +/************************************************************************** + * + * Forward declarations for the XAudio2 interfaces. + * + **************************************************************************/ + +#ifdef __cplusplus + #define FWD_DECLARE(x) interface x +#else + #define FWD_DECLARE(x) typedef interface x x +#endif + +FWD_DECLARE(IXAudio2); +FWD_DECLARE(IXAudio2Voice); +FWD_DECLARE(IXAudio2SourceVoice); +FWD_DECLARE(IXAudio2SubmixVoice); +FWD_DECLARE(IXAudio2MasteringVoice); +FWD_DECLARE(IXAudio2EngineCallback); +FWD_DECLARE(IXAudio2VoiceCallback); + + +/************************************************************************** + * + * XAudio2 structures and enumerations. + * + **************************************************************************/ + +// Used in IXAudio2::Initialize +#ifdef _XBOX + typedef enum XAUDIO2_XBOX_HWTHREAD_SPECIFIER + { + XboxThread0 = 0x01, + XboxThread1 = 0x02, + XboxThread2 = 0x04, + XboxThread3 = 0x08, + XboxThread4 = 0x10, + XboxThread5 = 0x20, + XAUDIO2_ANY_PROCESSOR = XboxThread4, + XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR + } XAUDIO2_XBOX_HWTHREAD_SPECIFIER, XAUDIO2_PROCESSOR; +#else + typedef enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER + { + Processor1 = 0x00000001, + Processor2 = 0x00000002, + Processor3 = 0x00000004, + Processor4 = 0x00000008, + Processor5 = 0x00000010, + Processor6 = 0x00000020, + Processor7 = 0x00000040, + Processor8 = 0x00000080, + Processor9 = 0x00000100, + Processor10 = 0x00000200, + Processor11 = 0x00000400, + Processor12 = 0x00000800, + Processor13 = 0x00001000, + Processor14 = 0x00002000, + Processor15 = 0x00004000, + Processor16 = 0x00008000, + Processor17 = 0x00010000, + Processor18 = 0x00020000, + Processor19 = 0x00040000, + Processor20 = 0x00080000, + Processor21 = 0x00100000, + Processor22 = 0x00200000, + Processor23 = 0x00400000, + Processor24 = 0x00800000, + Processor25 = 0x01000000, + Processor26 = 0x02000000, + Processor27 = 0x04000000, + Processor28 = 0x08000000, + Processor29 = 0x10000000, + Processor30 = 0x20000000, + Processor31 = 0x40000000, + Processor32 = 0x80000000, + XAUDIO2_ANY_PROCESSOR = 0xffffffff, + XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR + } XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER, XAUDIO2_PROCESSOR; +#endif + +// Used in XAUDIO2_DEVICE_DETAILS below to describe the types of applications +// that the user has specified each device as a default for. 0 means that the +// device isn't the default for any role. +typedef enum XAUDIO2_DEVICE_ROLE +{ + NotDefaultDevice = 0x0, + DefaultConsoleDevice = 0x1, + DefaultMultimediaDevice = 0x2, + DefaultCommunicationsDevice = 0x4, + DefaultGameDevice = 0x8, + GlobalDefaultDevice = 0xf, + InvalidDeviceRole = ~GlobalDefaultDevice +} XAUDIO2_DEVICE_ROLE; + +// Returned by IXAudio2::GetDeviceDetails +typedef struct XAUDIO2_DEVICE_DETAILS +{ + WCHAR DeviceID[256]; // String identifier for the audio device. + WCHAR DisplayName[256]; // Friendly name suitable for display to a human. + XAUDIO2_DEVICE_ROLE Role; // Roles that the device should be used for. + WAVEFORMATEXTENSIBLE OutputFormat; // The device's native PCM audio output format. +} XAUDIO2_DEVICE_DETAILS; + +// Returned by IXAudio2Voice::GetVoiceDetails +typedef struct XAUDIO2_VOICE_DETAILS +{ + UINT32 CreationFlags; // Flags the voice was created with. + UINT32 InputChannels; // Channels in the voice's input audio. + UINT32 InputSampleRate; // Sample rate of the voice's input audio. +} XAUDIO2_VOICE_DETAILS; + +// Used in XAUDIO2_VOICE_SENDS below +typedef struct XAUDIO2_SEND_DESCRIPTOR +{ + UINT32 Flags; // Either 0 or XAUDIO2_SEND_USEFILTER. + IXAudio2Voice* pOutputVoice; // This send's destination voice. +} XAUDIO2_SEND_DESCRIPTOR; + +// Used in the voice creation functions and in IXAudio2Voice::SetOutputVoices +typedef struct XAUDIO2_VOICE_SENDS +{ + UINT32 SendCount; // Number of sends from this voice. + XAUDIO2_SEND_DESCRIPTOR* pSends; // Array of SendCount send descriptors. +} XAUDIO2_VOICE_SENDS; + +// Used in XAUDIO2_EFFECT_CHAIN below +typedef struct XAUDIO2_EFFECT_DESCRIPTOR +{ + IUnknown* pEffect; // Pointer to the effect object's IUnknown interface. + BOOL InitialState; // TRUE if the effect should begin in the enabled state. + UINT32 OutputChannels; // How many output channels the effect should produce. +} XAUDIO2_EFFECT_DESCRIPTOR; + +// Used in the voice creation functions and in IXAudio2Voice::SetEffectChain +typedef struct XAUDIO2_EFFECT_CHAIN +{ + UINT32 EffectCount; // Number of effects in this voice's effect chain. + XAUDIO2_EFFECT_DESCRIPTOR* pEffectDescriptors; // Array of effect descriptors. +} XAUDIO2_EFFECT_CHAIN; + +// Used in XAUDIO2_FILTER_PARAMETERS below +typedef enum XAUDIO2_FILTER_TYPE +{ + LowPassFilter, // Attenuates frequencies above the cutoff frequency. + BandPassFilter, // Attenuates frequencies outside a given range. + HighPassFilter, // Attenuates frequencies below the cutoff frequency. + NotchFilter // Attenuates frequencies inside a given range. +} XAUDIO2_FILTER_TYPE; + +// Used in IXAudio2Voice::Set/GetFilterParameters and Set/GetOutputFilterParameters +typedef struct XAUDIO2_FILTER_PARAMETERS +{ + XAUDIO2_FILTER_TYPE Type; // Low-pass, band-pass or high-pass. + float Frequency; // Radian frequency (2 * sin(pi*CutoffFrequency/SampleRate)); + // must be >= 0 and <= XAUDIO2_MAX_FILTER_FREQUENCY + // (giving a maximum CutoffFrequency of SampleRate/6). + float OneOverQ; // Reciprocal of the filter's quality factor Q; + // must be > 0 and <= XAUDIO2_MAX_FILTER_ONEOVERQ. +} XAUDIO2_FILTER_PARAMETERS; + +// Used in IXAudio2SourceVoice::SubmitSourceBuffer +typedef struct XAUDIO2_BUFFER +{ + UINT32 Flags; // Either 0 or XAUDIO2_END_OF_STREAM. + UINT32 AudioBytes; // Size of the audio data buffer in bytes. + const BYTE* pAudioData; // Pointer to the audio data buffer. + UINT32 PlayBegin; // First sample in this buffer to be played. + UINT32 PlayLength; // Length of the region to be played in samples, + // or 0 to play the whole buffer. + UINT32 LoopBegin; // First sample of the region to be looped. + UINT32 LoopLength; // Length of the desired loop region in samples, + // or 0 to loop the entire buffer. + UINT32 LoopCount; // Number of times to repeat the loop region, + // or XAUDIO2_LOOP_INFINITE to loop forever. + void* pContext; // Context value to be passed back in callbacks. +} XAUDIO2_BUFFER; + +// Used in IXAudio2SourceVoice::SubmitSourceBuffer when submitting XWMA data. +// NOTE: If an XWMA sound is submitted in more than one buffer, each buffer's +// pDecodedPacketCumulativeBytes[PacketCount-1] value must be subtracted from +// all the entries in the next buffer's pDecodedPacketCumulativeBytes array. +// And whether a sound is submitted in more than one buffer or not, the final +// buffer of the sound should use the XAUDIO2_END_OF_STREAM flag, or else the +// client must call IXAudio2SourceVoice::Discontinuity after submitting it. +typedef struct XAUDIO2_BUFFER_WMA +{ + const UINT32* pDecodedPacketCumulativeBytes; // Decoded packet's cumulative size array. + // Each element is the number of bytes accumulated + // when the corresponding XWMA packet is decoded in + // order. The array must have PacketCount elements. + UINT32 PacketCount; // Number of XWMA packets submitted. Must be >= 1 and + // divide evenly into XAUDIO2_BUFFER.AudioBytes. +} XAUDIO2_BUFFER_WMA; + +// Returned by IXAudio2SourceVoice::GetState +typedef struct XAUDIO2_VOICE_STATE +{ + void* pCurrentBufferContext; // The pContext value provided in the XAUDIO2_BUFFER + // that is currently being processed, or NULL if + // there are no buffers in the queue. + UINT32 BuffersQueued; // Number of buffers currently queued on the voice + // (including the one that is being processed). + UINT64 SamplesPlayed; // Total number of samples produced by the voice since + // it began processing the current audio stream. +} XAUDIO2_VOICE_STATE; + +// Returned by IXAudio2::GetPerformanceData +typedef struct XAUDIO2_PERFORMANCE_DATA +{ + // CPU usage information + UINT64 AudioCyclesSinceLastQuery; // CPU cycles spent on audio processing since the + // last call to StartEngine or GetPerformanceData. + UINT64 TotalCyclesSinceLastQuery; // Total CPU cycles elapsed since the last call + // (only counts the CPU XAudio2 is running on). + UINT32 MinimumCyclesPerQuantum; // Fewest CPU cycles spent processing any one + // audio quantum since the last call. + UINT32 MaximumCyclesPerQuantum; // Most CPU cycles spent processing any one + // audio quantum since the last call. + + // Memory usage information + UINT32 MemoryUsageInBytes; // Total heap space currently in use. + + // Audio latency and glitching information + UINT32 CurrentLatencyInSamples; // Minimum delay from when a sample is read from a + // source buffer to when it reaches the speakers. + UINT32 GlitchesSinceEngineStarted; // Audio dropouts since the engine was started. + + // Data about XAudio2's current workload + UINT32 ActiveSourceVoiceCount; // Source voices currently playing. + UINT32 TotalSourceVoiceCount; // Source voices currently existing. + UINT32 ActiveSubmixVoiceCount; // Submix voices currently playing/existing. + + UINT32 ActiveResamplerCount; // Resample xAPOs currently active. + UINT32 ActiveMatrixMixCount; // MatrixMix xAPOs currently active. + + // Usage of the hardware XMA decoder (Xbox 360 only) + UINT32 ActiveXmaSourceVoices; // Number of source voices decoding XMA data. + UINT32 ActiveXmaStreams; // A voice can use more than one XMA stream. +} XAUDIO2_PERFORMANCE_DATA; + +// Used in IXAudio2::SetDebugConfiguration +typedef struct XAUDIO2_DEBUG_CONFIGURATION +{ + UINT32 TraceMask; // Bitmap of enabled debug message types. + UINT32 BreakMask; // Message types that will break into the debugger. + BOOL LogThreadID; // Whether to log the thread ID with each message. + BOOL LogFileline; // Whether to log the source file and line number. + BOOL LogFunctionName; // Whether to log the function name. + BOOL LogTiming; // Whether to log message timestamps. +} XAUDIO2_DEBUG_CONFIGURATION; + +// Values for the TraceMask and BreakMask bitmaps. Only ERRORS and WARNINGS +// are valid in BreakMask. WARNINGS implies ERRORS, DETAIL implies INFO, and +// FUNC_CALLS implies API_CALLS. By default, TraceMask is ERRORS and WARNINGS +// and all the other settings are zero. +#define XAUDIO2_LOG_ERRORS 0x0001 // For handled errors with serious effects. +#define XAUDIO2_LOG_WARNINGS 0x0002 // For handled errors that may be recoverable. +#define XAUDIO2_LOG_INFO 0x0004 // Informational chit-chat (e.g. state changes). +#define XAUDIO2_LOG_DETAIL 0x0008 // More detailed chit-chat. +#define XAUDIO2_LOG_API_CALLS 0x0010 // Public API function entries and exits. +#define XAUDIO2_LOG_FUNC_CALLS 0x0020 // Internal function entries and exits. +#define XAUDIO2_LOG_TIMING 0x0040 // Delays detected and other timing data. +#define XAUDIO2_LOG_LOCKS 0x0080 // Usage of critical sections and mutexes. +#define XAUDIO2_LOG_MEMORY 0x0100 // Memory heap usage information. +#define XAUDIO2_LOG_STREAMING 0x1000 // Audio streaming information. + + +/************************************************************************** + * + * IXAudio2: Top-level XAudio2 COM interface. + * + **************************************************************************/ + +// Use default arguments if compiling as C++ +#ifdef __cplusplus + #define X2DEFAULT(x) =x +#else + #define X2DEFAULT(x) +#endif + +#undef INTERFACE +#define INTERFACE IXAudio2 +DECLARE_INTERFACE_(IXAudio2, IUnknown) +{ + // NAME: IXAudio2::QueryInterface + // DESCRIPTION: Queries for a given COM interface on the XAudio2 object. + // Only IID_IUnknown and IID_IXAudio2 are supported. + // + // ARGUMENTS: + // riid - IID of the interface to be obtained. + // ppvInterface - Returns a pointer to the requested interface. + // + STDMETHOD(QueryInterface) (THIS_ REFIID riid, __deref_out void** ppvInterface) PURE; + + // NAME: IXAudio2::AddRef + // DESCRIPTION: Adds a reference to the XAudio2 object. + // + STDMETHOD_(ULONG, AddRef) (THIS) PURE; + + // NAME: IXAudio2::Release + // DESCRIPTION: Releases a reference to the XAudio2 object. + // + STDMETHOD_(ULONG, Release) (THIS) PURE; + + // NAME: IXAudio2::GetDeviceCount + // DESCRIPTION: Returns the number of audio output devices available. + // + // ARGUMENTS: + // pCount - Returns the device count. + // + STDMETHOD(GetDeviceCount) (THIS_ __out UINT32* pCount) PURE; + + // NAME: IXAudio2::GetDeviceDetails + // DESCRIPTION: Returns information about the device with the given index. + // + // ARGUMENTS: + // Index - Index of the device to be queried. + // pDeviceDetails - Returns the device details. + // + STDMETHOD(GetDeviceDetails) (THIS_ UINT32 Index, __out XAUDIO2_DEVICE_DETAILS* pDeviceDetails) PURE; + + // NAME: IXAudio2::Initialize + // DESCRIPTION: Sets global XAudio2 parameters and prepares it for use. + // + // ARGUMENTS: + // Flags - Flags specifying the XAudio2 object's behavior. Currently unused. + // XAudio2Processor - An XAUDIO2_PROCESSOR enumeration value that specifies + // the hardware thread (Xbox) or processor (Windows) that XAudio2 will use. + // The enumeration values are platform-specific; platform-independent code + // can use XAUDIO2_DEFAULT_PROCESSOR to use the default on each platform. + // + STDMETHOD(Initialize) (THIS_ UINT32 Flags X2DEFAULT(0), + XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) PURE; + + // NAME: IXAudio2::RegisterForCallbacks + // DESCRIPTION: Adds a new client to receive XAudio2's engine callbacks. + // + // ARGUMENTS: + // pCallback - Callback interface to be called during each processing pass. + // + STDMETHOD(RegisterForCallbacks) (__in IXAudio2EngineCallback* pCallback) PURE; + + // NAME: IXAudio2::UnregisterForCallbacks + // DESCRIPTION: Removes an existing receiver of XAudio2 engine callbacks. + // + // ARGUMENTS: + // pCallback - Previously registered callback interface to be removed. + // + STDMETHOD_(void, UnregisterForCallbacks) (__in IXAudio2EngineCallback* pCallback) PURE; + + // NAME: IXAudio2::CreateSourceVoice + // DESCRIPTION: Creates and configures a source voice. + // + // ARGUMENTS: + // ppSourceVoice - Returns the new object's IXAudio2SourceVoice interface. + // pSourceFormat - Format of the audio that will be fed to the voice. + // Flags - XAUDIO2_VOICE flags specifying the source voice's behavior. + // MaxFrequencyRatio - Maximum SetFrequencyRatio argument to be allowed. + // pCallback - Optional pointer to a client-provided callback interface. + // pSendList - Optional list of voices this voice should send audio to. + // pEffectChain - Optional list of effects to apply to the audio data. + // + STDMETHOD(CreateSourceVoice) (THIS_ __deref_out IXAudio2SourceVoice** ppSourceVoice, + __in const WAVEFORMATEX* pSourceFormat, + UINT32 Flags X2DEFAULT(0), + float MaxFrequencyRatio X2DEFAULT(XAUDIO2_DEFAULT_FREQ_RATIO), + __in_opt IXAudio2VoiceCallback* pCallback X2DEFAULT(NULL), + __in_opt const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL), + __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; + + // NAME: IXAudio2::CreateSubmixVoice + // DESCRIPTION: Creates and configures a submix voice. + // + // ARGUMENTS: + // ppSubmixVoice - Returns the new object's IXAudio2SubmixVoice interface. + // InputChannels - Number of channels in this voice's input audio data. + // InputSampleRate - Sample rate of this voice's input audio data. + // Flags - XAUDIO2_VOICE flags specifying the submix voice's behavior. + // ProcessingStage - Arbitrary number that determines the processing order. + // pSendList - Optional list of voices this voice should send audio to. + // pEffectChain - Optional list of effects to apply to the audio data. + // + STDMETHOD(CreateSubmixVoice) (THIS_ __deref_out IXAudio2SubmixVoice** ppSubmixVoice, + UINT32 InputChannels, UINT32 InputSampleRate, + UINT32 Flags X2DEFAULT(0), UINT32 ProcessingStage X2DEFAULT(0), + __in_opt const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL), + __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; + + + // NAME: IXAudio2::CreateMasteringVoice + // DESCRIPTION: Creates and configures a mastering voice. + // + // ARGUMENTS: + // ppMasteringVoice - Returns the new object's IXAudio2MasteringVoice interface. + // InputChannels - Number of channels in this voice's input audio data. + // InputSampleRate - Sample rate of this voice's input audio data. + // Flags - XAUDIO2_VOICE flags specifying the mastering voice's behavior. + // DeviceIndex - Identifier of the device to receive the output audio. + // pEffectChain - Optional list of effects to apply to the audio data. + // + STDMETHOD(CreateMasteringVoice) (THIS_ __deref_out IXAudio2MasteringVoice** ppMasteringVoice, + UINT32 InputChannels X2DEFAULT(XAUDIO2_DEFAULT_CHANNELS), + UINT32 InputSampleRate X2DEFAULT(XAUDIO2_DEFAULT_SAMPLERATE), + UINT32 Flags X2DEFAULT(0), UINT32 DeviceIndex X2DEFAULT(0), + __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; + + // NAME: IXAudio2::StartEngine + // DESCRIPTION: Creates and starts the audio processing thread. + // + STDMETHOD(StartEngine) (THIS) PURE; + + // NAME: IXAudio2::StopEngine + // DESCRIPTION: Stops and destroys the audio processing thread. + // + STDMETHOD_(void, StopEngine) (THIS) PURE; + + // NAME: IXAudio2::CommitChanges + // DESCRIPTION: Atomically applies a set of operations previously tagged + // with a given identifier. + // + // ARGUMENTS: + // OperationSet - Identifier of the set of operations to be applied. + // + STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE; + + // NAME: IXAudio2::GetPerformanceData + // DESCRIPTION: Returns current resource usage details: memory, CPU, etc. + // + // ARGUMENTS: + // pPerfData - Returns the performance data structure. + // + STDMETHOD_(void, GetPerformanceData) (THIS_ __out XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE; + + // NAME: IXAudio2::SetDebugConfiguration + // DESCRIPTION: Configures XAudio2's debug output (in debug builds only). + // + // ARGUMENTS: + // pDebugConfiguration - Structure describing the debug output behavior. + // pReserved - Optional parameter; must be NULL. + // + STDMETHOD_(void, SetDebugConfiguration) (THIS_ __in_opt const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration, + __in_opt __reserved void* pReserved X2DEFAULT(NULL)) PURE; +}; + + +/************************************************************************** + * + * IXAudio2Voice: Base voice management interface. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2Voice +DECLARE_INTERFACE(IXAudio2Voice) +{ + // These methods are declared in a macro so that the same declarations + // can be used in the derived voice types (IXAudio2SourceVoice, etc). + + #define Declare_IXAudio2Voice_Methods() \ + \ + /* NAME: IXAudio2Voice::GetVoiceDetails + // DESCRIPTION: Returns the basic characteristics of this voice. + // + // ARGUMENTS: + // pVoiceDetails - Returns the voice's details. + */\ + STDMETHOD_(void, GetVoiceDetails) (THIS_ __out XAUDIO2_VOICE_DETAILS* pVoiceDetails) PURE; \ + \ + /* NAME: IXAudio2Voice::SetOutputVoices + // DESCRIPTION: Replaces the set of submix/mastering voices that receive + // this voice's output. + // + // ARGUMENTS: + // pSendList - Optional list of voices this voice should send audio to. + */\ + STDMETHOD(SetOutputVoices) (THIS_ __in_opt const XAUDIO2_VOICE_SENDS* pSendList) PURE; \ + \ + /* NAME: IXAudio2Voice::SetEffectChain + // DESCRIPTION: Replaces this voice's current effect chain with a new one. + // + // ARGUMENTS: + // pEffectChain - Structure describing the new effect chain to be used. + */\ + STDMETHOD(SetEffectChain) (THIS_ __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain) PURE; \ + \ + /* NAME: IXAudio2Voice::EnableEffect + // DESCRIPTION: Enables an effect in this voice's effect chain. + // + // ARGUMENTS: + // EffectIndex - Index of an effect within this voice's effect chain. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(EnableEffect) (THIS_ UINT32 EffectIndex, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::DisableEffect + // DESCRIPTION: Disables an effect in this voice's effect chain. + // + // ARGUMENTS: + // EffectIndex - Index of an effect within this voice's effect chain. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(DisableEffect) (THIS_ UINT32 EffectIndex, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetEffectState + // DESCRIPTION: Returns the running state of an effect. + // + // ARGUMENTS: + // EffectIndex - Index of an effect within this voice's effect chain. + // pEnabled - Returns the enabled/disabled state of the given effect. + */\ + STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, __out BOOL* pEnabled) PURE; \ + \ + /* NAME: IXAudio2Voice::SetEffectParameters + // DESCRIPTION: Sets effect-specific parameters. + // + // REMARKS: Unlike IXAPOParameters::SetParameters, this method may + // be called from any thread. XAudio2 implements + // appropriate synchronization to copy the parameters to the + // realtime audio processing thread. + // + // ARGUMENTS: + // EffectIndex - Index of an effect within this voice's effect chain. + // pParameters - Pointer to an effect-specific parameters block. + // ParametersByteSize - Size of the pParameters array in bytes. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \ + __in_bcount(ParametersByteSize) const void* pParameters, \ + UINT32 ParametersByteSize, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetEffectParameters + // DESCRIPTION: Obtains the current effect-specific parameters. + // + // ARGUMENTS: + // EffectIndex - Index of an effect within this voice's effect chain. + // pParameters - Returns the current values of the effect-specific parameters. + // ParametersByteSize - Size of the pParameters array in bytes. + */\ + STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, \ + __out_bcount(ParametersByteSize) void* pParameters, \ + UINT32 ParametersByteSize) PURE; \ + \ + /* NAME: IXAudio2Voice::SetFilterParameters + // DESCRIPTION: Sets this voice's filter parameters. + // + // ARGUMENTS: + // pParameters - Pointer to the filter's parameter structure. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetFilterParameters) (THIS_ __in const XAUDIO2_FILTER_PARAMETERS* pParameters, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetFilterParameters + // DESCRIPTION: Returns this voice's current filter parameters. + // + // ARGUMENTS: + // pParameters - Returns the filter parameters. + */\ + STDMETHOD_(void, GetFilterParameters) (THIS_ __out XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \ + \ + /* NAME: IXAudio2Voice::SetOutputFilterParameters + // DESCRIPTION: Sets the filter parameters on one of this voice's sends. + // + // ARGUMENTS: + // pDestinationVoice - Destination voice of the send whose filter parameters will be set. + // pParameters - Pointer to the filter's parameter structure. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetOutputFilterParameters) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ + __in const XAUDIO2_FILTER_PARAMETERS* pParameters, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetOutputFilterParameters + // DESCRIPTION: Returns the filter parameters from one of this voice's sends. + // + // ARGUMENTS: + // pDestinationVoice - Destination voice of the send whose filter parameters will be read. + // pParameters - Returns the filter parameters. + */\ + STDMETHOD_(void, GetOutputFilterParameters) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ + __out XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \ + \ + /* NAME: IXAudio2Voice::SetVolume + // DESCRIPTION: Sets this voice's overall volume level. + // + // ARGUMENTS: + // Volume - New overall volume level to be used, as an amplitude factor. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetVolume) (THIS_ float Volume, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetVolume + // DESCRIPTION: Obtains this voice's current overall volume level. + // + // ARGUMENTS: + // pVolume: Returns the voice's current overall volume level. + */\ + STDMETHOD_(void, GetVolume) (THIS_ __out float* pVolume) PURE; \ + \ + /* NAME: IXAudio2Voice::SetChannelVolumes + // DESCRIPTION: Sets this voice's per-channel volume levels. + // + // ARGUMENTS: + // Channels - Used to confirm the voice's channel count. + // pVolumes - Array of per-channel volume levels to be used. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetChannelVolumes) (THIS_ UINT32 Channels, __in_ecount(Channels) const float* pVolumes, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetChannelVolumes + // DESCRIPTION: Returns this voice's current per-channel volume levels. + // + // ARGUMENTS: + // Channels - Used to confirm the voice's channel count. + // pVolumes - Returns an array of the current per-channel volume levels. + */\ + STDMETHOD_(void, GetChannelVolumes) (THIS_ UINT32 Channels, __out_ecount(Channels) float* pVolumes) PURE; \ + \ + /* NAME: IXAudio2Voice::SetOutputMatrix + // DESCRIPTION: Sets the volume levels used to mix from each channel of this + // voice's output audio to each channel of a given destination + // voice's input audio. + // + // ARGUMENTS: + // pDestinationVoice - The destination voice whose mix matrix to change. + // SourceChannels - Used to confirm this voice's output channel count + // (the number of channels produced by the last effect in the chain). + // DestinationChannels - Confirms the destination voice's input channels. + // pLevelMatrix - Array of [SourceChannels * DestinationChannels] send + // levels. The level used to send from source channel S to destination + // channel D should be in pLevelMatrix[S + SourceChannels * D]. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetOutputMatrix) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ + UINT32 SourceChannels, UINT32 DestinationChannels, \ + __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetOutputMatrix + // DESCRIPTION: Obtains the volume levels used to send each channel of this + // voice's output audio to each channel of a given destination + // voice's input audio. + // + // ARGUMENTS: + // pDestinationVoice - The destination voice whose mix matrix to obtain. + // SourceChannels - Used to confirm this voice's output channel count + // (the number of channels produced by the last effect in the chain). + // DestinationChannels - Confirms the destination voice's input channels. + // pLevelMatrix - Array of send levels, as above. + */\ + STDMETHOD_(void, GetOutputMatrix) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ + UINT32 SourceChannels, UINT32 DestinationChannels, \ + __out_ecount(SourceChannels * DestinationChannels) float* pLevelMatrix) PURE; \ + \ + /* NAME: IXAudio2Voice::DestroyVoice + // DESCRIPTION: Destroys this voice, stopping it if necessary and removing + // it from the XAudio2 graph. + */\ + STDMETHOD_(void, DestroyVoice) (THIS) PURE + + Declare_IXAudio2Voice_Methods(); +}; + + +/************************************************************************** + * + * IXAudio2SourceVoice: Source voice management interface. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2SourceVoice +DECLARE_INTERFACE_(IXAudio2SourceVoice, IXAudio2Voice) +{ + // Methods from IXAudio2Voice base interface + Declare_IXAudio2Voice_Methods(); + + // NAME: IXAudio2SourceVoice::Start + // DESCRIPTION: Makes this voice start consuming and processing audio. + // + // ARGUMENTS: + // Flags - Flags controlling how the voice should be started. + // OperationSet - Used to identify this call as part of a deferred batch. + // + STDMETHOD(Start) (THIS_ UINT32 Flags X2DEFAULT(0), UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; + + // NAME: IXAudio2SourceVoice::Stop + // DESCRIPTION: Makes this voice stop consuming audio. + // + // ARGUMENTS: + // Flags - Flags controlling how the voice should be stopped. + // OperationSet - Used to identify this call as part of a deferred batch. + // + STDMETHOD(Stop) (THIS_ UINT32 Flags X2DEFAULT(0), UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; + + // NAME: IXAudio2SourceVoice::SubmitSourceBuffer + // DESCRIPTION: Adds a new audio buffer to this voice's input queue. + // + // ARGUMENTS: + // pBuffer - Pointer to the buffer structure to be queued. + // pBufferWMA - Additional structure used only when submitting XWMA data. + // + STDMETHOD(SubmitSourceBuffer) (THIS_ __in const XAUDIO2_BUFFER* pBuffer, __in_opt const XAUDIO2_BUFFER_WMA* pBufferWMA X2DEFAULT(NULL)) PURE; + + // NAME: IXAudio2SourceVoice::FlushSourceBuffers + // DESCRIPTION: Removes all pending audio buffers from this voice's queue. + // + STDMETHOD(FlushSourceBuffers) (THIS) PURE; + + // NAME: IXAudio2SourceVoice::Discontinuity + // DESCRIPTION: Notifies the voice of an intentional break in the stream of + // audio buffers (e.g. the end of a sound), to prevent XAudio2 + // from interpreting an empty buffer queue as a glitch. + // + STDMETHOD(Discontinuity) (THIS) PURE; + + // NAME: IXAudio2SourceVoice::ExitLoop + // DESCRIPTION: Breaks out of the current loop when its end is reached. + // + // ARGUMENTS: + // OperationSet - Used to identify this call as part of a deferred batch. + // + STDMETHOD(ExitLoop) (THIS_ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; + + // NAME: IXAudio2SourceVoice::GetState + // DESCRIPTION: Returns the number of buffers currently queued on this voice, + // the pContext value associated with the currently processing + // buffer (if any), and other voice state information. + // + // ARGUMENTS: + // pVoiceState - Returns the state information. + // + STDMETHOD_(void, GetState) (THIS_ __out XAUDIO2_VOICE_STATE* pVoiceState) PURE; + + // NAME: IXAudio2SourceVoice::SetFrequencyRatio + // DESCRIPTION: Sets this voice's frequency adjustment, i.e. its pitch. + // + // ARGUMENTS: + // Ratio - Frequency change, expressed as source frequency / target frequency. + // OperationSet - Used to identify this call as part of a deferred batch. + // + STDMETHOD(SetFrequencyRatio) (THIS_ float Ratio, + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; + + // NAME: IXAudio2SourceVoice::GetFrequencyRatio + // DESCRIPTION: Returns this voice's current frequency adjustment ratio. + // + // ARGUMENTS: + // pRatio - Returns the frequency adjustment. + // + STDMETHOD_(void, GetFrequencyRatio) (THIS_ __out float* pRatio) PURE; + + // NAME: IXAudio2SourceVoice::SetSourceSampleRate + // DESCRIPTION: Reconfigures this voice to treat its source data as being + // at a different sample rate than the original one specified + // in CreateSourceVoice's pSourceFormat argument. + // + // ARGUMENTS: + // UINT32 - The intended sample rate of further submitted source data. + // + STDMETHOD(SetSourceSampleRate) (THIS_ UINT32 NewSourceSampleRate) PURE; +}; + + +/************************************************************************** + * + * IXAudio2SubmixVoice: Submixing voice management interface. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2SubmixVoice +DECLARE_INTERFACE_(IXAudio2SubmixVoice, IXAudio2Voice) +{ + // Methods from IXAudio2Voice base interface + Declare_IXAudio2Voice_Methods(); + + // There are currently no methods specific to submix voices. +}; + + +/************************************************************************** + * + * IXAudio2MasteringVoice: Mastering voice management interface. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2MasteringVoice +DECLARE_INTERFACE_(IXAudio2MasteringVoice, IXAudio2Voice) +{ + // Methods from IXAudio2Voice base interface + Declare_IXAudio2Voice_Methods(); + + // There are currently no methods specific to mastering voices. +}; + + +/************************************************************************** + * + * IXAudio2EngineCallback: Client notification interface for engine events. + * + * REMARKS: Contains methods to notify the client when certain events happen + * in the XAudio2 engine. This interface should be implemented by + * the client. XAudio2 will call these methods via the interface + * pointer provided by the client when it calls XAudio2Create or + * IXAudio2::Initialize. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2EngineCallback +DECLARE_INTERFACE(IXAudio2EngineCallback) +{ + // Called by XAudio2 just before an audio processing pass begins. + STDMETHOD_(void, OnProcessingPassStart) (THIS) PURE; + + // Called just after an audio processing pass ends. + STDMETHOD_(void, OnProcessingPassEnd) (THIS) PURE; + + // Called in the event of a critical system error which requires XAudio2 + // to be closed down and restarted. The error code is given in Error. + STDMETHOD_(void, OnCriticalError) (THIS_ HRESULT Error) PURE; +}; + + +/************************************************************************** + * + * IXAudio2VoiceCallback: Client notification interface for voice events. + * + * REMARKS: Contains methods to notify the client when certain events happen + * in an XAudio2 voice. This interface should be implemented by the + * client. XAudio2 will call these methods via an interface pointer + * provided by the client in the IXAudio2::CreateSourceVoice call. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2VoiceCallback +DECLARE_INTERFACE(IXAudio2VoiceCallback) +{ + // Called just before this voice's processing pass begins. + STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE; + + // Called just after this voice's processing pass ends. + STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE; + + // Called when this voice has just finished playing a buffer stream + // (as marked with the XAUDIO2_END_OF_STREAM flag on the last buffer). + STDMETHOD_(void, OnStreamEnd) (THIS) PURE; + + // Called when this voice is about to start processing a new buffer. + STDMETHOD_(void, OnBufferStart) (THIS_ void* pBufferContext) PURE; + + // Called when this voice has just finished processing a buffer. + // The buffer can now be reused or destroyed. + STDMETHOD_(void, OnBufferEnd) (THIS_ void* pBufferContext) PURE; + + // Called when this voice has just reached the end position of a loop. + STDMETHOD_(void, OnLoopEnd) (THIS_ void* pBufferContext) PURE; + + // Called in the event of a critical error during voice processing, + // such as a failing xAPO or an error from the hardware XMA decoder. + // The voice may have to be destroyed and re-created to recover from + // the error. The callback arguments report which buffer was being + // processed when the error occurred, and its HRESULT code. + STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) PURE; +}; + + +/************************************************************************** + * + * Macros to make it easier to use the XAudio2 COM interfaces in C code. + * + **************************************************************************/ + +#ifndef __cplusplus + +// IXAudio2 +#define IXAudio2_QueryInterface(This,riid,ppvInterface) ((This)->lpVtbl->QueryInterface(This,riid,ppvInterface)) +#define IXAudio2_AddRef(This) ((This)->lpVtbl->AddRef(This)) +#define IXAudio2_Release(This) ((This)->lpVtbl->Release(This)) +#define IXAudio2_GetDeviceCount(This,puCount) ((This)->lpVtbl->GetDeviceCount(This,puCount)) +#define IXAudio2_GetDeviceDetails(This,Index,pDeviceDetails) ((This)->lpVtbl->GetDeviceDetails(This,Index,pDeviceDetails)) +#define IXAudio2_Initialize(This,Flags,XAudio2Processor) ((This)->lpVtbl->Initialize(This,Flags,XAudio2Processor)) +#define IXAudio2_CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain) ((This)->lpVtbl->CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain)) +#define IXAudio2_CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain) ((This)->lpVtbl->CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain)) +#define IXAudio2_CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain) ((This)->lpVtbl->CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain)) +#define IXAudio2_StartEngine(This) ((This)->lpVtbl->StartEngine(This)) +#define IXAudio2_StopEngine(This) ((This)->lpVtbl->StopEngine(This)) +#define IXAudio2_CommitChanges(This,OperationSet) ((This)->lpVtbl->CommitChanges(This,OperationSet)) +#define IXAudio2_GetPerformanceData(This,pPerfData) ((This)->lpVtbl->GetPerformanceData(This,pPerfData)) +#define IXAudio2_SetDebugConfiguration(This,pDebugConfiguration,pReserved) ((This)->lpVtbl->SetDebugConfiguration(This,pDebugConfiguration,pReserved)) + +// IXAudio2Voice +#define IXAudio2Voice_GetVoiceDetails(This,pVoiceDetails) ((This)->lpVtbl->GetVoiceDetails(This,pVoiceDetails)) +#define IXAudio2Voice_SetOutputVoices(This,pSendList) ((This)->lpVtbl->SetOutputVoices(This,pSendList)) +#define IXAudio2Voice_SetEffectChain(This,pEffectChain) ((This)->lpVtbl->SetEffectChain(This,pEffectChain)) +#define IXAudio2Voice_EnableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->EnableEffect(This,EffectIndex,OperationSet)) +#define IXAudio2Voice_DisableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->DisableEffect(This,EffectIndex,OperationSet)) +#define IXAudio2Voice_GetEffectState(This,EffectIndex,pEnabled) ((This)->lpVtbl->GetEffectState(This,EffectIndex,pEnabled)) +#define IXAudio2Voice_SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize, OperationSet) ((This)->lpVtbl->SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize,OperationSet)) +#define IXAudio2Voice_GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize) ((This)->lpVtbl->GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize)) +#define IXAudio2Voice_SetFilterParameters(This,pParameters,OperationSet) ((This)->lpVtbl->SetFilterParameters(This,pParameters,OperationSet)) +#define IXAudio2Voice_GetFilterParameters(This,pParameters) ((This)->lpVtbl->GetFilterParameters(This,pParameters)) +#define IXAudio2Voice_SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet) ((This)->lpVtbl->SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet)) +#define IXAudio2Voice_GetOutputFilterParameters(This,pDestinationVoice,pParameters) ((This)->lpVtbl->GetOutputFilterParameters(This,pDestinationVoice,pParameters)) +#define IXAudio2Voice_SetVolume(This,Volume,OperationSet) ((This)->lpVtbl->SetVolume(This,Volume,OperationSet)) +#define IXAudio2Voice_GetVolume(This,pVolume) ((This)->lpVtbl->GetVolume(This,pVolume)) +#define IXAudio2Voice_SetChannelVolumes(This,Channels,pVolumes,OperationSet) ((This)->lpVtbl->SetChannelVolumes(This,Channels,pVolumes,OperationSet)) +#define IXAudio2Voice_GetChannelVolumes(This,Channels,pVolumes) ((This)->lpVtbl->GetChannelVolumes(This,Channels,pVolumes)) +#define IXAudio2Voice_SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet) ((This)->lpVtbl->SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet)) +#define IXAudio2Voice_GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix) ((This)->lpVtbl->GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix)) +#define IXAudio2Voice_DestroyVoice(This) ((This)->lpVtbl->DestroyVoice(This)) + +// IXAudio2SourceVoice +#define IXAudio2SourceVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails +#define IXAudio2SourceVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices +#define IXAudio2SourceVoice_SetEffectChain IXAudio2Voice_SetEffectChain +#define IXAudio2SourceVoice_EnableEffect IXAudio2Voice_EnableEffect +#define IXAudio2SourceVoice_DisableEffect IXAudio2Voice_DisableEffect +#define IXAudio2SourceVoice_GetEffectState IXAudio2Voice_GetEffectState +#define IXAudio2SourceVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters +#define IXAudio2SourceVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters +#define IXAudio2SourceVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters +#define IXAudio2SourceVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters +#define IXAudio2SourceVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters +#define IXAudio2SourceVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters +#define IXAudio2SourceVoice_SetVolume IXAudio2Voice_SetVolume +#define IXAudio2SourceVoice_GetVolume IXAudio2Voice_GetVolume +#define IXAudio2SourceVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes +#define IXAudio2SourceVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes +#define IXAudio2SourceVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix +#define IXAudio2SourceVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix +#define IXAudio2SourceVoice_DestroyVoice IXAudio2Voice_DestroyVoice +#define IXAudio2SourceVoice_Start(This,Flags,OperationSet) ((This)->lpVtbl->Start(This,Flags,OperationSet)) +#define IXAudio2SourceVoice_Stop(This,Flags,OperationSet) ((This)->lpVtbl->Stop(This,Flags,OperationSet)) +#define IXAudio2SourceVoice_SubmitSourceBuffer(This,pBuffer,pBufferWMA) ((This)->lpVtbl->SubmitSourceBuffer(This,pBuffer,pBufferWMA)) +#define IXAudio2SourceVoice_FlushSourceBuffers(This) ((This)->lpVtbl->FlushSourceBuffers(This)) +#define IXAudio2SourceVoice_Discontinuity(This) ((This)->lpVtbl->Discontinuity(This)) +#define IXAudio2SourceVoice_ExitLoop(This,OperationSet) ((This)->lpVtbl->ExitLoop(This,OperationSet)) +#define IXAudio2SourceVoice_GetState(This,pVoiceState) ((This)->lpVtbl->GetState(This,pVoiceState)) +#define IXAudio2SourceVoice_SetFrequencyRatio(This,Ratio,OperationSet) ((This)->lpVtbl->SetFrequencyRatio(This,Ratio,OperationSet)) +#define IXAudio2SourceVoice_GetFrequencyRatio(This,pRatio) ((This)->lpVtbl->GetFrequencyRatio(This,pRatio)) +#define IXAudio2SourceVoice_SetSourceSampleRate(This,NewSourceSampleRate) ((This)->lpVtbl->SetSourceSampleRate(This,NewSourceSampleRate)) + +// IXAudio2SubmixVoice +#define IXAudio2SubmixVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails +#define IXAudio2SubmixVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices +#define IXAudio2SubmixVoice_SetEffectChain IXAudio2Voice_SetEffectChain +#define IXAudio2SubmixVoice_EnableEffect IXAudio2Voice_EnableEffect +#define IXAudio2SubmixVoice_DisableEffect IXAudio2Voice_DisableEffect +#define IXAudio2SubmixVoice_GetEffectState IXAudio2Voice_GetEffectState +#define IXAudio2SubmixVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters +#define IXAudio2SubmixVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters +#define IXAudio2SubmixVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters +#define IXAudio2SubmixVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters +#define IXAudio2SubmixVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters +#define IXAudio2SubmixVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters +#define IXAudio2SubmixVoice_SetVolume IXAudio2Voice_SetVolume +#define IXAudio2SubmixVoice_GetVolume IXAudio2Voice_GetVolume +#define IXAudio2SubmixVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes +#define IXAudio2SubmixVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes +#define IXAudio2SubmixVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix +#define IXAudio2SubmixVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix +#define IXAudio2SubmixVoice_DestroyVoice IXAudio2Voice_DestroyVoice + +// IXAudio2MasteringVoice +#define IXAudio2MasteringVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails +#define IXAudio2MasteringVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices +#define IXAudio2MasteringVoice_SetEffectChain IXAudio2Voice_SetEffectChain +#define IXAudio2MasteringVoice_EnableEffect IXAudio2Voice_EnableEffect +#define IXAudio2MasteringVoice_DisableEffect IXAudio2Voice_DisableEffect +#define IXAudio2MasteringVoice_GetEffectState IXAudio2Voice_GetEffectState +#define IXAudio2MasteringVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters +#define IXAudio2MasteringVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters +#define IXAudio2MasteringVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters +#define IXAudio2MasteringVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters +#define IXAudio2MasteringVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters +#define IXAudio2MasteringVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters +#define IXAudio2MasteringVoice_SetVolume IXAudio2Voice_SetVolume +#define IXAudio2MasteringVoice_GetVolume IXAudio2Voice_GetVolume +#define IXAudio2MasteringVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes +#define IXAudio2MasteringVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes +#define IXAudio2MasteringVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix +#define IXAudio2MasteringVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix +#define IXAudio2MasteringVoice_DestroyVoice IXAudio2Voice_DestroyVoice + +#endif // #ifndef __cplusplus + + +/************************************************************************** + * + * Utility functions used to convert from pitch in semitones and volume + * in decibels to the frequency and amplitude ratio units used by XAudio2. + * These are only defined if the client #defines XAUDIO2_HELPER_FUNCTIONS + * prior to #including xaudio2.h. + * + **************************************************************************/ + +#ifdef XAUDIO2_HELPER_FUNCTIONS + +#define _USE_MATH_DEFINES // Make math.h define M_PI +#include // For powf, log10f, sinf and asinf + +// Calculate the argument to SetVolume from a decibel value +__inline float XAudio2DecibelsToAmplitudeRatio(float Decibels) +{ + return powf(10.0f, Decibels / 20.0f); +} + +// Recover a volume in decibels from an amplitude factor +__inline float XAudio2AmplitudeRatioToDecibels(float Volume) +{ + if (Volume == 0) + { + return -3.402823466e+38f; // Smallest float value (-FLT_MAX) + } + return 20.0f * log10f(Volume); +} + +// Calculate the argument to SetFrequencyRatio from a semitone value +__inline float XAudio2SemitonesToFrequencyRatio(float Semitones) +{ + // FrequencyRatio = 2 ^ Octaves + // = 2 ^ (Semitones / 12) + return powf(2.0f, Semitones / 12.0f); +} + +// Recover a pitch in semitones from a frequency ratio +__inline float XAudio2FrequencyRatioToSemitones(float FrequencyRatio) +{ + // Semitones = 12 * log2(FrequencyRatio) + // = 12 * log2(10) * log10(FrequencyRatio) + return 39.86313713864835f * log10f(FrequencyRatio); +} + +// Convert from filter cutoff frequencies expressed in Hertz to the radian +// frequency values used in XAUDIO2_FILTER_PARAMETERS.Frequency. Note that +// the highest CutoffFrequency supported is SampleRate/6. Higher values of +// CutoffFrequency will return XAUDIO2_MAX_FILTER_FREQUENCY. +__inline float XAudio2CutoffFrequencyToRadians(float CutoffFrequency, UINT32 SampleRate) +{ + if ((UINT32)(CutoffFrequency * 6.0f) >= SampleRate) + { + return XAUDIO2_MAX_FILTER_FREQUENCY; + } + return 2.0f * sinf((float)M_PI * CutoffFrequency / SampleRate); +} + +// Convert from radian frequencies back to absolute frequencies in Hertz +__inline float XAudio2RadiansToCutoffFrequency(float Radians, float SampleRate) +{ + return SampleRate * asinf(Radians / 2.0f) / (float)M_PI; +} +#endif // #ifdef XAUDIO2_HELPER_FUNCTIONS + + +/************************************************************************** + * + * XAudio2Create: Top-level function that creates an XAudio2 instance. + * + * On Windows this is just an inline function that calls CoCreateInstance + * and Initialize. The arguments are described above, under Initialize, + * except that the XAUDIO2_DEBUG_ENGINE flag can be used here to select + * the debug version of XAudio2. + * + * On Xbox, this function is implemented in the XAudio2 library, and the + * XAUDIO2_DEBUG_ENGINE flag has no effect; the client must explicitly + * link with the debug version of the library to obtain debug behavior. + * + **************************************************************************/ + +#ifdef _XBOX + +STDAPI XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0), + XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)); + +#else // Windows + +__inline HRESULT XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0), + XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) +{ + // Instantiate the appropriate XAudio2 engine + IXAudio2* pXAudio2; + + #ifdef __cplusplus + + HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? __uuidof(XAudio2_Debug) : __uuidof(XAudio2), + NULL, CLSCTX_INPROC_SERVER, __uuidof(IXAudio2), (void**)&pXAudio2); + if (SUCCEEDED(hr)) + { + hr = pXAudio2->Initialize(Flags, XAudio2Processor); + + if (SUCCEEDED(hr)) + { + *ppXAudio2 = pXAudio2; + } + else + { + pXAudio2->Release(); + } + } + + #else + + HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? &CLSID_XAudio2_Debug : &CLSID_XAudio2, + NULL, CLSCTX_INPROC_SERVER, &IID_IXAudio2, (void**)&pXAudio2); + if (SUCCEEDED(hr)) + { + hr = pXAudio2->lpVtbl->Initialize(pXAudio2, Flags, XAudio2Processor); + + if (SUCCEEDED(hr)) + { + *ppXAudio2 = pXAudio2; + } + else + { + pXAudio2->lpVtbl->Release(pXAudio2); + } + } + + #endif // #ifdef __cplusplus + + return hr; +} + +#endif // #ifdef _XBOX + + +// Undo the #pragma pack(push, 1) directive at the top of this file +#pragma pack(pop) + +#endif // #ifndef GUID_DEFS_ONLY +#endif // #ifndef __XAUDIO2_INCLUDED__ diff --git a/RenderDll/Dx9Sdk/Include/XAudio2fx.h b/RenderDll/Dx9Sdk/Include/XAudio2fx.h new file mode 100644 index 0000000..4284bd2 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/XAudio2fx.h @@ -0,0 +1,431 @@ +/************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: xaudio2fx.h + * Content: Declarations for the audio effects included with XAudio2. + * + **************************************************************************/ + +#ifndef __XAUDIO2FX_INCLUDED__ +#define __XAUDIO2FX_INCLUDED__ + + +/************************************************************************** + * + * XAudio2 effect class IDs. + * + **************************************************************************/ + +#include "comdecl.h" // For DEFINE_CLSID and DEFINE_IID + +// XAudio 2.0 (March 2008 SDK) +//DEFINE_CLSID(AudioVolumeMeter, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, E2); +//DEFINE_CLSID(AudioVolumeMeter_Debug, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, DB); +//DEFINE_CLSID(AudioReverb, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, 63); +//DEFINE_CLSID(AudioReverb_Debug, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, DB); + +// XAudio 2.1 (June 2008 SDK) +//DEFINE_CLSID(AudioVolumeMeter, c1e3f122, a2ea, 442c, 85, 4f, 20, d9, 8f, 83, 57, a1); +//DEFINE_CLSID(AudioVolumeMeter_Debug, 6d97a461, b02d, 48ae, b5, 43, 82, bc, 35, fd, fa, e2); +//DEFINE_CLSID(AudioReverb, f4769300, b949, 4df9, b3, 33, 00, d3, 39, 32, e9, a6); +//DEFINE_CLSID(AudioReverb_Debug, aea2cabc, 8c7c, 46aa, ba, 44, 0e, 6d, 75, 88, a1, f2); + +// XAudio 2.2 (August 2008 SDK) +//DEFINE_CLSID(AudioVolumeMeter, f5ca7b34, 8055, 42c0, b8, 36, 21, 61, 29, eb, 7e, 30); +//DEFINE_CLSID(AudioVolumeMeter_Debug, f796f5f7, 6059, 4a9f, 98, 2d, 61, ee, c2, ed, 67, ca); +//DEFINE_CLSID(AudioReverb, 629cf0de, 3ecc, 41e7, 99, 26, f7, e4, 3e, eb, ec, 51); +//DEFINE_CLSID(AudioReverb_Debug, 4aae4299, 3260, 46d4, 97, cc, 6c, c7, 60, c8, 53, 29); + +// XAudio 2.3 (November 2008 SDK) +//DEFINE_CLSID(AudioVolumeMeter, e180344b, ac83, 4483, 95, 9e, 18, a5, c5, 6a, 5e, 19); +//DEFINE_CLSID(AudioVolumeMeter_Debug, 922a0a56, 7d13, 40ae, a4, 81, 3c, 6c, 60, f1, 14, 01); +//DEFINE_CLSID(AudioReverb, 9cab402c, 1d37, 44b4, 88, 6d, fa, 4f, 36, 17, 0a, 4c); +//DEFINE_CLSID(AudioReverb_Debug, eadda998, 3be6, 4505, 84, be, ea, 06, 36, 5d, b9, 6b); + +// XAudio 2.4 (March 2009 SDK) +//DEFINE_CLSID(AudioVolumeMeter, c7338b95, 52b8, 4542, aa, 79, 42, eb, 01, 6c, 8c, 1c); +//DEFINE_CLSID(AudioVolumeMeter_Debug, 524bd872, 5c0b, 4217, bd, b8, 0a, 86, 81, 83, 0b, a5); +//DEFINE_CLSID(AudioReverb, 8bb7778b, 645b, 4475, 9a, 73, 1d, e3, 17, 0b, d3, af); +//DEFINE_CLSID(AudioReverb_Debug, da7738a2, cd0c, 4367, 9a, ac, d7, ea, d7, c6, 4f, 98); + +// XAudio 2.5 (March 2009 SDK) +//DEFINE_CLSID(AudioVolumeMeter, 2139e6da, c341, 4774, 9a, c3, b4, e0, 26, 34, 7f, 64); +//DEFINE_CLSID(AudioVolumeMeter_Debug, a5cc4e13, ca00, 416b, a6, ee, 49, fe, e7, b5, 43, d0); +//DEFINE_CLSID(AudioReverb, d06df0d0, 8518, 441e, 82, 2f, 54, 51, d5, c5, 95, b8); +//DEFINE_CLSID(AudioReverb_Debug, 613604ec, 304c, 45ec, a4, ed, 7a, 1c, 61, 2e, 9e, 72); + +// XAudio 2.6 (February 2010 SDK) +//DEFINE_CLSID(AudioVolumeMeter, e48c5a3f, 93ef, 43bb, a0, 92, 2c, 7c, eb, 94, 6f, 27); +//DEFINE_CLSID(AudioVolumeMeter_Debug, 9a9eaef7, a9e0, 4088, 9b, 1b, 9c, a0, 3a, 1a, ec, d4); +//DEFINE_CLSID(AudioReverb, cecec95a, d894, 491a, be, e3, 5e, 10, 6f, b5, 9f, 2d); +//DEFINE_CLSID(AudioReverb_Debug, 99a1c72e, 364c, 4c1b, 96, 23, fd, 5c, 8a, bd, 90, c7); + +// XAudio 2.7 (June 2010 SDK) +DEFINE_CLSID(AudioVolumeMeter, cac1105f, 619b, 4d04, 83, 1a, 44, e1, cb, f1, 2d, 57); +DEFINE_CLSID(AudioVolumeMeter_Debug, 2d9a0f9c, e67b, 4b24, ab, 44, 92, b3, e7, 70, c0, 20); +DEFINE_CLSID(AudioReverb, 6a93130e, 1d53, 41d1, a9, cf, e7, 58, 80, 0b, b1, 79); +DEFINE_CLSID(AudioReverb_Debug, c4f82dd4, cb4e, 4ce1, 8b, db, ee, 32, d4, 19, 82, 69); + +// Ignore the rest of this header if only the GUID definitions were requested +#ifndef GUID_DEFS_ONLY + +#ifdef _XBOX + #include // Xbox COM declarations (IUnknown, etc) +#else + #include // Windows COM declarations +#endif +#include // For log10() + + +// All structures defined in this file should use tight packing +#pragma pack(push, 1) + + +/************************************************************************** + * + * Effect creation functions. On Windows, these are just inline functions + * that call CoCreateInstance and Initialize; the XAUDIO2FX_DEBUG flag can + * be used to select the debug version of the effects. On Xbox, these map + * to real functions included in xaudio2.lib, and the XAUDIO2FX_DEBUG flag + * is ignored; the application must link with the debug library to use the + * debug functionality. + * + **************************************************************************/ + +// Use default values for some parameters if building C++ code +#ifdef __cplusplus + #define DEFAULT(x) =x +#else + #define DEFAULT(x) +#endif + +#define XAUDIO2FX_DEBUG 1 // To select the debug version of an effect + +#ifdef _XBOX + + STDAPI CreateAudioVolumeMeter(__deref_out IUnknown** ppApo); + STDAPI CreateAudioReverb(__deref_out IUnknown** ppApo); + + __inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0)) + { + return CreateAudioVolumeMeter(ppApo); + } + + __inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0)) + { + return CreateAudioReverb(ppApo); + } + +#else // Windows + + __inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0)) + { + #ifdef __cplusplus + return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? __uuidof(AudioVolumeMeter_Debug) + : __uuidof(AudioVolumeMeter), + NULL, CLSCTX_INPROC_SERVER, __uuidof(IUnknown), (void**)ppApo); + #else + return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioVolumeMeter_Debug + : &CLSID_AudioVolumeMeter, + NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo); + #endif + } + + __inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0)) + { + #ifdef __cplusplus + return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? __uuidof(AudioReverb_Debug) + : __uuidof(AudioReverb), + NULL, CLSCTX_INPROC_SERVER, __uuidof(IUnknown), (void**)ppApo); + #else + return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioReverb_Debug + : &CLSID_AudioReverb, + NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo); + #endif + } + +#endif // #ifdef _XBOX + + + +/************************************************************************** + * + * Volume meter parameters. + * The volume meter supports FLOAT32 audio formats and must be used in-place. + * + **************************************************************************/ + +// XAUDIO2FX_VOLUMEMETER_LEVELS: Receives results from GetEffectParameters(). +// The user is responsible for allocating pPeakLevels, pRMSLevels, and +// initializing ChannelCount accordingly. +// The volume meter does not support SetEffectParameters(). +typedef struct XAUDIO2FX_VOLUMEMETER_LEVELS +{ + float* pPeakLevels; // Peak levels table: receives maximum absolute level for each channel + // over a processing pass; may be NULL if pRMSLevls != NULL, + // otherwise must have at least ChannelCount elements. + float* pRMSLevels; // Root mean square levels table: receives RMS level for each channel + // over a processing pass; may be NULL if pPeakLevels != NULL, + // otherwise must have at least ChannelCount elements. + UINT32 ChannelCount; // Number of channels being processed by the volume meter APO +} XAUDIO2FX_VOLUMEMETER_LEVELS; + + + +/************************************************************************** + * + * Reverb parameters. + * The reverb supports only FLOAT32 audio with the following channel + * configurations: + * Input: Mono Output: Mono + * Input: Mono Output: 5.1 + * Input: Stereo Output: Stereo + * Input: Stereo Output: 5.1 + * The framerate must be within [20000, 48000] Hz. + * + * When using mono input, delay filters associated with the right channel + * are not executed. In this case, parameters such as PositionRight and + * PositionMatrixRight have no effect. This also means the reverb uses + * less CPU when hosted in a mono submix. + * + **************************************************************************/ + +#define XAUDIO2FX_REVERB_MIN_FRAMERATE 20000 +#define XAUDIO2FX_REVERB_MAX_FRAMERATE 48000 + +// XAUDIO2FX_REVERB_PARAMETERS: Native parameter set for the reverb effect + +typedef struct XAUDIO2FX_REVERB_PARAMETERS +{ + // ratio of wet (processed) signal to dry (original) signal + float WetDryMix; // [0, 100] (percentage) + + // Delay times + UINT32 ReflectionsDelay; // [0, 300] in ms + BYTE ReverbDelay; // [0, 85] in ms + BYTE RearDelay; // [0, 5] in ms + + // Indexed parameters + BYTE PositionLeft; // [0, 30] no units + BYTE PositionRight; // [0, 30] no units, ignored when configured to mono + BYTE PositionMatrixLeft; // [0, 30] no units + BYTE PositionMatrixRight; // [0, 30] no units, ignored when configured to mono + BYTE EarlyDiffusion; // [0, 15] no units + BYTE LateDiffusion; // [0, 15] no units + BYTE LowEQGain; // [0, 12] no units + BYTE LowEQCutoff; // [0, 9] no units + BYTE HighEQGain; // [0, 8] no units + BYTE HighEQCutoff; // [0, 14] no units + + // Direct parameters + float RoomFilterFreq; // [20, 20000] in Hz + float RoomFilterMain; // [-100, 0] in dB + float RoomFilterHF; // [-100, 0] in dB + float ReflectionsGain; // [-100, 20] in dB + float ReverbGain; // [-100, 20] in dB + float DecayTime; // [0.1, inf] in seconds + float Density; // [0, 100] (percentage) + float RoomSize; // [1, 100] in feet +} XAUDIO2FX_REVERB_PARAMETERS; + + +// Maximum, minimum and default values for the parameters above +#define XAUDIO2FX_REVERB_MIN_WET_DRY_MIX 0.0f +#define XAUDIO2FX_REVERB_MIN_REFLECTIONS_DELAY 0 +#define XAUDIO2FX_REVERB_MIN_REVERB_DELAY 0 +#define XAUDIO2FX_REVERB_MIN_REAR_DELAY 0 +#define XAUDIO2FX_REVERB_MIN_POSITION 0 +#define XAUDIO2FX_REVERB_MIN_DIFFUSION 0 +#define XAUDIO2FX_REVERB_MIN_LOW_EQ_GAIN 0 +#define XAUDIO2FX_REVERB_MIN_LOW_EQ_CUTOFF 0 +#define XAUDIO2FX_REVERB_MIN_HIGH_EQ_GAIN 0 +#define XAUDIO2FX_REVERB_MIN_HIGH_EQ_CUTOFF 0 +#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_FREQ 20.0f +#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_MAIN -100.0f +#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_HF -100.0f +#define XAUDIO2FX_REVERB_MIN_REFLECTIONS_GAIN -100.0f +#define XAUDIO2FX_REVERB_MIN_REVERB_GAIN -100.0f +#define XAUDIO2FX_REVERB_MIN_DECAY_TIME 0.1f +#define XAUDIO2FX_REVERB_MIN_DENSITY 0.0f +#define XAUDIO2FX_REVERB_MIN_ROOM_SIZE 0.0f + +#define XAUDIO2FX_REVERB_MAX_WET_DRY_MIX 100.0f +#define XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY 300 +#define XAUDIO2FX_REVERB_MAX_REVERB_DELAY 85 +#define XAUDIO2FX_REVERB_MAX_REAR_DELAY 5 +#define XAUDIO2FX_REVERB_MAX_POSITION 30 +#define XAUDIO2FX_REVERB_MAX_DIFFUSION 15 +#define XAUDIO2FX_REVERB_MAX_LOW_EQ_GAIN 12 +#define XAUDIO2FX_REVERB_MAX_LOW_EQ_CUTOFF 9 +#define XAUDIO2FX_REVERB_MAX_HIGH_EQ_GAIN 8 +#define XAUDIO2FX_REVERB_MAX_HIGH_EQ_CUTOFF 14 +#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_FREQ 20000.0f +#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_MAIN 0.0f +#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_HF 0.0f +#define XAUDIO2FX_REVERB_MAX_REFLECTIONS_GAIN 20.0f +#define XAUDIO2FX_REVERB_MAX_REVERB_GAIN 20.0f +#define XAUDIO2FX_REVERB_MAX_DENSITY 100.0f +#define XAUDIO2FX_REVERB_MAX_ROOM_SIZE 100.0f + +#define XAUDIO2FX_REVERB_DEFAULT_WET_DRY_MIX 100.0f +#define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_DELAY 5 +#define XAUDIO2FX_REVERB_DEFAULT_REVERB_DELAY 5 +#define XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY 5 +#define XAUDIO2FX_REVERB_DEFAULT_POSITION 6 +#define XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX 27 +#define XAUDIO2FX_REVERB_DEFAULT_EARLY_DIFFUSION 8 +#define XAUDIO2FX_REVERB_DEFAULT_LATE_DIFFUSION 8 +#define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_GAIN 8 +#define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_CUTOFF 4 +#define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_GAIN 8 +#define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_CUTOFF 4 +#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_FREQ 5000.0f +#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_MAIN 0.0f +#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_HF 0.0f +#define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_GAIN 0.0f +#define XAUDIO2FX_REVERB_DEFAULT_REVERB_GAIN 0.0f +#define XAUDIO2FX_REVERB_DEFAULT_DECAY_TIME 1.0f +#define XAUDIO2FX_REVERB_DEFAULT_DENSITY 100.0f +#define XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE 100.0f + + +// XAUDIO2FX_REVERB_I3DL2_PARAMETERS: Parameter set compliant with the I3DL2 standard + +typedef struct XAUDIO2FX_REVERB_I3DL2_PARAMETERS +{ + // ratio of wet (processed) signal to dry (original) signal + float WetDryMix; // [0, 100] (percentage) + + // Standard I3DL2 parameters + INT32 Room; // [-10000, 0] in mB (hundredths of decibels) + INT32 RoomHF; // [-10000, 0] in mB (hundredths of decibels) + float RoomRolloffFactor; // [0.0, 10.0] + float DecayTime; // [0.1, 20.0] in seconds + float DecayHFRatio; // [0.1, 2.0] + INT32 Reflections; // [-10000, 1000] in mB (hundredths of decibels) + float ReflectionsDelay; // [0.0, 0.3] in seconds + INT32 Reverb; // [-10000, 2000] in mB (hundredths of decibels) + float ReverbDelay; // [0.0, 0.1] in seconds + float Diffusion; // [0.0, 100.0] (percentage) + float Density; // [0.0, 100.0] (percentage) + float HFReference; // [20.0, 20000.0] in Hz +} XAUDIO2FX_REVERB_I3DL2_PARAMETERS; + + +// ReverbConvertI3DL2ToNative: Utility function to map from I3DL2 to native parameters + +__inline void ReverbConvertI3DL2ToNative +( + __in const XAUDIO2FX_REVERB_I3DL2_PARAMETERS* pI3DL2, + __out XAUDIO2FX_REVERB_PARAMETERS* pNative +) +{ + float reflectionsDelay; + float reverbDelay; + + // RoomRolloffFactor is ignored + + // These parameters have no equivalent in I3DL2 + pNative->RearDelay = XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY; // 5 + pNative->PositionLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6 + pNative->PositionRight = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6 + pNative->PositionMatrixLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27 + pNative->PositionMatrixRight = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27 + pNative->RoomSize = XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE; // 100 + pNative->LowEQCutoff = 4; + pNative->HighEQCutoff = 6; + + // The rest of the I3DL2 parameters map to the native property set + pNative->RoomFilterMain = (float)pI3DL2->Room / 100.0f; + pNative->RoomFilterHF = (float)pI3DL2->RoomHF / 100.0f; + + if (pI3DL2->DecayHFRatio >= 1.0f) + { + INT32 index = (INT32)(-4.0 * log10(pI3DL2->DecayHFRatio)); + if (index < -8) index = -8; + pNative->LowEQGain = (BYTE)((index < 0) ? index + 8 : 8); + pNative->HighEQGain = 8; + pNative->DecayTime = pI3DL2->DecayTime * pI3DL2->DecayHFRatio; + } + else + { + INT32 index = (INT32)(4.0 * log10(pI3DL2->DecayHFRatio)); + if (index < -8) index = -8; + pNative->LowEQGain = 8; + pNative->HighEQGain = (BYTE)((index < 0) ? index + 8 : 8); + pNative->DecayTime = pI3DL2->DecayTime; + } + + reflectionsDelay = pI3DL2->ReflectionsDelay * 1000.0f; + if (reflectionsDelay >= XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY) // 300 + { + reflectionsDelay = (float)(XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY - 1); + } + else if (reflectionsDelay <= 1) + { + reflectionsDelay = 1; + } + pNative->ReflectionsDelay = (UINT32)reflectionsDelay; + + reverbDelay = pI3DL2->ReverbDelay * 1000.0f; + if (reverbDelay >= XAUDIO2FX_REVERB_MAX_REVERB_DELAY) // 85 + { + reverbDelay = (float)(XAUDIO2FX_REVERB_MAX_REVERB_DELAY - 1); + } + pNative->ReverbDelay = (BYTE)reverbDelay; + + pNative->ReflectionsGain = pI3DL2->Reflections / 100.0f; + pNative->ReverbGain = pI3DL2->Reverb / 100.0f; + pNative->EarlyDiffusion = (BYTE)(15.0f * pI3DL2->Diffusion / 100.0f); + pNative->LateDiffusion = pNative->EarlyDiffusion; + pNative->Density = pI3DL2->Density; + pNative->RoomFilterFreq = pI3DL2->HFReference; + + pNative->WetDryMix = pI3DL2->WetDryMix; +} + + +/************************************************************************** + * + * Standard I3DL2 reverb presets (100% wet). + * + **************************************************************************/ + +#define XAUDIO2FX_I3DL2_PRESET_DEFAULT {100,-10000, 0,0.0f, 1.00f,0.50f,-10000,0.020f,-10000,0.040f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_GENERIC {100, -1000, -100,0.0f, 1.49f,0.83f, -2602,0.007f, 200,0.011f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_PADDEDCELL {100, -1000,-6000,0.0f, 0.17f,0.10f, -1204,0.001f, 207,0.002f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_ROOM {100, -1000, -454,0.0f, 0.40f,0.83f, -1646,0.002f, 53,0.003f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_BATHROOM {100, -1000,-1200,0.0f, 1.49f,0.54f, -370,0.007f, 1030,0.011f,100.0f, 60.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_LIVINGROOM {100, -1000,-6000,0.0f, 0.50f,0.10f, -1376,0.003f, -1104,0.004f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_STONEROOM {100, -1000, -300,0.0f, 2.31f,0.64f, -711,0.012f, 83,0.017f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_AUDITORIUM {100, -1000, -476,0.0f, 4.32f,0.59f, -789,0.020f, -289,0.030f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_CONCERTHALL {100, -1000, -500,0.0f, 3.92f,0.70f, -1230,0.020f, -2,0.029f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_CAVE {100, -1000, 0,0.0f, 2.91f,1.30f, -602,0.015f, -302,0.022f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_ARENA {100, -1000, -698,0.0f, 7.24f,0.33f, -1166,0.020f, 16,0.030f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_HANGAR {100, -1000,-1000,0.0f,10.05f,0.23f, -602,0.020f, 198,0.030f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_CARPETEDHALLWAY {100, -1000,-4000,0.0f, 0.30f,0.10f, -1831,0.002f, -1630,0.030f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_HALLWAY {100, -1000, -300,0.0f, 1.49f,0.59f, -1219,0.007f, 441,0.011f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_STONECORRIDOR {100, -1000, -237,0.0f, 2.70f,0.79f, -1214,0.013f, 395,0.020f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_ALLEY {100, -1000, -270,0.0f, 1.49f,0.86f, -1204,0.007f, -4,0.011f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_FOREST {100, -1000,-3300,0.0f, 1.49f,0.54f, -2560,0.162f, -613,0.088f, 79.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_CITY {100, -1000, -800,0.0f, 1.49f,0.67f, -2273,0.007f, -2217,0.011f, 50.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_MOUNTAINS {100, -1000,-2500,0.0f, 1.49f,0.21f, -2780,0.300f, -2014,0.100f, 27.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_QUARRY {100, -1000,-1000,0.0f, 1.49f,0.83f,-10000,0.061f, 500,0.025f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_PLAIN {100, -1000,-2000,0.0f, 1.49f,0.50f, -2466,0.179f, -2514,0.100f, 21.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_PARKINGLOT {100, -1000, 0,0.0f, 1.65f,1.50f, -1363,0.008f, -1153,0.012f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_SEWERPIPE {100, -1000,-1000,0.0f, 2.81f,0.14f, 429,0.014f, 648,0.021f, 80.0f, 60.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_UNDERWATER {100, -1000,-4000,0.0f, 1.49f,0.10f, -449,0.007f, 1700,0.011f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_SMALLROOM {100, -1000, -600,0.0f, 1.10f,0.83f, -400,0.005f, 500,0.010f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_MEDIUMROOM {100, -1000, -600,0.0f, 1.30f,0.83f, -1000,0.010f, -200,0.020f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_LARGEROOM {100, -1000, -600,0.0f, 1.50f,0.83f, -1600,0.020f, -1000,0.040f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_MEDIUMHALL {100, -1000, -600,0.0f, 1.80f,0.70f, -1300,0.015f, -800,0.030f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_LARGEHALL {100, -1000, -600,0.0f, 1.80f,0.70f, -2000,0.030f, -1400,0.060f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_PLATE {100, -1000, -200,0.0f, 1.30f,0.90f, 0,0.002f, 0,0.010f,100.0f, 75.0f,5000.0f} + + +// Undo the #pragma pack(push, 1) at the top of this file +#pragma pack(pop) + +#endif // #ifndef GUID_DEFS_ONLY +#endif // #ifndef __XAUDIO2FX_INCLUDED__ diff --git a/RenderDll/Dx9Sdk/Include/XDSP.h b/RenderDll/Dx9Sdk/Include/XDSP.h new file mode 100644 index 0000000..6ed0dc5 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/XDSP.h @@ -0,0 +1,754 @@ +/*-========================================================================-_ + | - XDSP - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |PROJECT: XDSP MODEL: Unmanaged User-mode | + |VERSION: 1.2 EXCEPT: No Exceptions | + |CLASS: N / A MINREQ: WinXP, Xbox360 | + |BASE: N / A DIALECT: MSC++ 14.00 | + |>------------------------------------------------------------------------<| + | DUTY: DSP functions with CPU extension specific optimizations | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. Definition of terms: + DSP: Digital Signal Processing. + FFT: Fast Fourier Transform. + Frame: A block of samples, one per channel, + to be played simultaneously. + + 2. All buffer parameters must be 16-byte aligned. + + 3. All FFT functions support only FLOAT32 audio. */ + +#pragma once +//---------------------------------------------------// +#include // general windows types +#include // trigonometric functions +#if defined(_XBOX) // SIMD intrinsics + #include +#else + #include +#endif + + +//-------------------------------------------------------------// +// assertion +#if !defined(DSPASSERT) + #if DBG + #define DSPASSERT(exp) if (!(exp)) { OutputDebugStringA("XDSP ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); } + #else + #define DSPASSERT(exp) __assume(exp) + #endif +#endif + +// true if n is a power of 2 +#if !defined(ISPOWEROF2) + #define ISPOWEROF2(n) ( ((n)&((n)-1)) == 0 && (n) != 0 ) +#endif + + +//-----------------------------------------------------------// +namespace XDSP { +#pragma warning(push) +#pragma warning(disable: 4328 4640) // disable "indirection alignment of formal parameter", "construction of local static object is not thread-safe" compile warnings + + +// Helper functions, used by the FFT functions. +// The application need not call them directly. + + // primitive types + typedef __m128 XVECTOR; + typedef XVECTOR& XVECTORREF; + typedef const XVECTOR& XVECTORREFC; + + + // Parallel multiplication of four complex numbers, assuming + // real and imaginary values are stored in separate vectors. + __forceinline void vmulComplex (__out XVECTORREF rResult, __out XVECTORREF iResult, __in XVECTORREFC r1, __in XVECTORREFC i1, __in XVECTORREFC r2, __in XVECTORREFC i2) + { + // (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1) + XVECTOR vi1i2 = _mm_mul_ps(i1, i2); + XVECTOR vr1r2 = _mm_mul_ps(r1, r2); + XVECTOR vr1i2 = _mm_mul_ps(r1, i2); + XVECTOR vr2i1 = _mm_mul_ps(r2, i1); + rResult = _mm_sub_ps(vr1r2, vi1i2); // real: (r1*r2 - i1*i2) + iResult = _mm_add_ps(vr1i2, vr2i1); // imaginary: (r1*i2 + r2*i1) + } + __forceinline void vmulComplex (__inout XVECTORREF r1, __inout XVECTORREF i1, __in XVECTORREFC r2, __in XVECTORREFC i2) + { + // (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1) + XVECTOR vi1i2 = _mm_mul_ps(i1, i2); + XVECTOR vr1r2 = _mm_mul_ps(r1, r2); + XVECTOR vr1i2 = _mm_mul_ps(r1, i2); + XVECTOR vr2i1 = _mm_mul_ps(r2, i1); + r1 = _mm_sub_ps(vr1r2, vi1i2); // real: (r1*r2 - i1*i2) + i1 = _mm_add_ps(vr1i2, vr2i1); // imaginary: (r1*i2 + r2*i1) + } + + + // Radix-4 decimation-in-time FFT butterfly. + // This version assumes that all four elements of the butterfly are + // adjacent in a single vector. + // + // Compute the product of the complex input vector and the + // 4-element DFT matrix: + // | 1 1 1 1 | | (r1X,i1X) | + // | 1 -j -1 j | | (r1Y,i1Y) | + // | 1 -1 1 -1 | | (r1Z,i1Z) | + // | 1 j -1 -j | | (r1W,i1W) | + // + // This matrix can be decomposed into two simpler ones to reduce the + // number of additions needed. The decomposed matrices look like this: + // | 1 0 1 0 | | 1 0 1 0 | + // | 0 1 0 -j | | 1 0 -1 0 | + // | 1 0 -1 0 | | 0 1 0 1 | + // | 0 1 0 j | | 0 1 0 -1 | + // + // Combine as follows: + // | 1 0 1 0 | | (r1X,i1X) | | (r1X + r1Z, i1X + i1Z) | + // Temp = | 1 0 -1 0 | * | (r1Y,i1Y) | = | (r1X - r1Z, i1X - i1Z) | + // | 0 1 0 1 | | (r1Z,i1Z) | | (r1Y + r1W, i1Y + i1W) | + // | 0 1 0 -1 | | (r1W,i1W) | | (r1Y - r1W, i1Y - i1W) | + // + // | 1 0 1 0 | | (rTempX,iTempX) | | (rTempX + rTempZ, iTempX + iTempZ) | + // Result = | 0 1 0 -j | * | (rTempY,iTempY) | = | (rTempY + iTempW, iTempY - rTempW) | + // | 1 0 -1 0 | | (rTempZ,iTempZ) | | (rTempX - rTempZ, iTempX - iTempZ) | + // | 0 1 0 j | | (rTempW,iTempW) | | (rTempY - iTempW, iTempY + rTempW) | + __forceinline void ButterflyDIT4_1 (__inout XVECTORREF r1, __inout XVECTORREF i1) + { + // sign constants for radix-4 butterflies + const static XVECTOR vDFT4SignBits1 = { 0.0f, -0.0f, 0.0f, -0.0f }; + const static XVECTOR vDFT4SignBits2 = { 0.0f, 0.0f, -0.0f, -0.0f }; + const static XVECTOR vDFT4SignBits3 = { 0.0f, -0.0f, -0.0f, 0.0f }; + + + // calculating Temp + XVECTOR rTemp = _mm_add_ps( _mm_shuffle_ps(r1, r1, _MM_SHUFFLE(1, 1, 0, 0)), // [r1X| r1X|r1Y| r1Y] + + _mm_xor_ps(_mm_shuffle_ps(r1, r1, _MM_SHUFFLE(3, 3, 2, 2)), vDFT4SignBits1) ); // [r1Z|-r1Z|r1W|-r1W] + XVECTOR iTemp = _mm_add_ps( _mm_shuffle_ps(i1, i1, _MM_SHUFFLE(1, 1, 0, 0)), // [i1X| i1X|i1Y| i1Y] + + _mm_xor_ps(_mm_shuffle_ps(i1, i1, _MM_SHUFFLE(3, 3, 2, 2)), vDFT4SignBits1) ); // [i1Z|-i1Z|i1W|-i1W] + + // calculating Result + XVECTOR rZrWiZiW = _mm_shuffle_ps(rTemp, iTemp, _MM_SHUFFLE(3, 2, 3, 2)); // [rTempZ|rTempW|iTempZ|iTempW] + XVECTOR rZiWrZiW = _mm_shuffle_ps(rZrWiZiW, rZrWiZiW, _MM_SHUFFLE(3, 0, 3, 0)); // [rTempZ|iTempW|rTempZ|iTempW] + XVECTOR iZrWiZrW = _mm_shuffle_ps(rZrWiZiW, rZrWiZiW, _MM_SHUFFLE(1, 2, 1, 2)); // [rTempZ|iTempW|rTempZ|iTempW] + r1 = _mm_add_ps( _mm_shuffle_ps(rTemp, rTemp, _MM_SHUFFLE(1, 0, 1, 0)), // [rTempX| rTempY| rTempX| rTempY] + + _mm_xor_ps(rZiWrZiW, vDFT4SignBits2) ); // [rTempZ| iTempW|-rTempZ|-iTempW] + i1 = _mm_add_ps( _mm_shuffle_ps(iTemp, iTemp, _MM_SHUFFLE(1, 0, 1, 0)), // [iTempX| iTempY| iTempX| iTempY] + + _mm_xor_ps(iZrWiZrW, vDFT4SignBits3) ); // [iTempZ|-rTempW|-iTempZ| rTempW] + } + + // Radix-4 decimation-in-time FFT butterfly. + // This version assumes that elements of the butterfly are + // in different vectors, so that each vector in the input + // contains elements from four different butterflies. + // The four separate butterflies are processed in parallel. + // + // The calculations here are the same as the ones in the single-vector + // radix-4 DFT, but instead of being done on a single vector (X,Y,Z,W) + // they are done in parallel on sixteen independent complex values. + // There is no interdependence between the vector elements: + // | 1 0 1 0 | | (rIn0,iIn0) | | (rIn0 + rIn2, iIn0 + iIn2) | + // | 1 0 -1 0 | * | (rIn1,iIn1) | = Temp = | (rIn0 - rIn2, iIn0 - iIn2) | + // | 0 1 0 1 | | (rIn2,iIn2) | | (rIn1 + rIn3, iIn1 + iIn3) | + // | 0 1 0 -1 | | (rIn3,iIn3) | | (rIn1 - rIn3, iIn1 - iIn3) | + // + // | 1 0 1 0 | | (rTemp0,iTemp0) | | (rTemp0 + rTemp2, iTemp0 + iTemp2) | + // Result = | 0 1 0 -j | * | (rTemp1,iTemp1) | = | (rTemp1 + iTemp3, iTemp1 - rTemp3) | + // | 1 0 -1 0 | | (rTemp2,iTemp2) | | (rTemp0 - rTemp2, iTemp0 - iTemp2) | + // | 0 1 0 j | | (rTemp3,iTemp3) | | (rTemp1 - iTemp3, iTemp1 + rTemp3) | + __forceinline void ButterflyDIT4_4 (__inout XVECTORREF r0, + __inout XVECTORREF r1, + __inout XVECTORREF r2, + __inout XVECTORREF r3, + __inout XVECTORREF i0, + __inout XVECTORREF i1, + __inout XVECTORREF i2, + __inout XVECTORREF i3, + __in_ecount(uStride*4) const XVECTOR* __restrict pUnityTableReal, + __in_ecount(uStride*4) const XVECTOR* __restrict pUnityTableImaginary, + const UINT32 uStride, const BOOL fLast) + { + DSPASSERT(pUnityTableReal != NULL); + DSPASSERT(pUnityTableImaginary != NULL); + DSPASSERT((UINT_PTR)pUnityTableReal % 16 == 0); + DSPASSERT((UINT_PTR)pUnityTableImaginary % 16 == 0); + DSPASSERT(ISPOWEROF2(uStride)); + + XVECTOR rTemp0, rTemp1, rTemp2, rTemp3, rTemp4, rTemp5, rTemp6, rTemp7; + XVECTOR iTemp0, iTemp1, iTemp2, iTemp3, iTemp4, iTemp5, iTemp6, iTemp7; + + + // calculating Temp + rTemp0 = _mm_add_ps(r0, r2); iTemp0 = _mm_add_ps(i0, i2); + rTemp2 = _mm_add_ps(r1, r3); iTemp2 = _mm_add_ps(i1, i3); + rTemp1 = _mm_sub_ps(r0, r2); iTemp1 = _mm_sub_ps(i0, i2); + rTemp3 = _mm_sub_ps(r1, r3); iTemp3 = _mm_sub_ps(i1, i3); + rTemp4 = _mm_add_ps(rTemp0, rTemp2); iTemp4 = _mm_add_ps(iTemp0, iTemp2); + rTemp5 = _mm_add_ps(rTemp1, iTemp3); iTemp5 = _mm_sub_ps(iTemp1, rTemp3); + rTemp6 = _mm_sub_ps(rTemp0, rTemp2); iTemp6 = _mm_sub_ps(iTemp0, iTemp2); + rTemp7 = _mm_sub_ps(rTemp1, iTemp3); iTemp7 = _mm_add_ps(iTemp1, rTemp3); + + // calculating Result + // vmulComplex(rTemp0, iTemp0, rTemp0, iTemp0, pUnityTableReal[0], pUnityTableImaginary[0]); // first one is always trivial + vmulComplex(rTemp5, iTemp5, pUnityTableReal[uStride], pUnityTableImaginary[uStride]); + vmulComplex(rTemp6, iTemp6, pUnityTableReal[uStride*2], pUnityTableImaginary[uStride*2]); + vmulComplex(rTemp7, iTemp7, pUnityTableReal[uStride*3], pUnityTableImaginary[uStride*3]); + if (fLast) { + ButterflyDIT4_1(rTemp4, iTemp4); + ButterflyDIT4_1(rTemp5, iTemp5); + ButterflyDIT4_1(rTemp6, iTemp6); + ButterflyDIT4_1(rTemp7, iTemp7); + } + + + r0 = rTemp4; i0 = iTemp4; + r1 = rTemp5; i1 = iTemp5; + r2 = rTemp6; i2 = iTemp6; + r3 = rTemp7; i3 = iTemp7; + } + +//-------------------------------------------------------// + + //// + // DESCRIPTION: + // 4-sample FFT. + // + // PARAMETERS: + // pReal - [inout] real components, must have at least uCount elements + // pImaginary - [inout] imaginary components, must have at least uCount elements + // uCount - [in] number of FFT iterations + // + // RETURN VALUE: + // void + //// + __forceinline void FFT4 (__inout_ecount(uCount) XVECTOR* __restrict pReal, __inout_ecount(uCount) XVECTOR* __restrict pImaginary, const UINT32 uCount=1) + { + DSPASSERT(pReal != NULL); + DSPASSERT(pImaginary != NULL); + DSPASSERT((UINT_PTR)pReal % 16 == 0); + DSPASSERT((UINT_PTR)pImaginary % 16 == 0); + DSPASSERT(ISPOWEROF2(uCount)); + + for (UINT32 uIndex=0; uIndex 16 + // uCount - [in] number of FFT iterations + // + // RETURN VALUE: + // void + //// + inline void FFT (__inout_ecount((uLength*uCount)/4) XVECTOR* __restrict pReal, __inout_ecount((uLength*uCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(uLength*uCount) const XVECTOR* __restrict pUnityTable, const UINT32 uLength, const UINT32 uCount=1) + { + DSPASSERT(pReal != NULL); + DSPASSERT(pImaginary != NULL); + DSPASSERT(pUnityTable != NULL); + DSPASSERT((UINT_PTR)pReal % 16 == 0); + DSPASSERT((UINT_PTR)pImaginary % 16 == 0); + DSPASSERT((UINT_PTR)pUnityTable % 16 == 0); + DSPASSERT(uLength > 16); + DSPASSERT(ISPOWEROF2(uLength)); + DSPASSERT(ISPOWEROF2(uCount)); + + const XVECTOR* __restrict pUnityTableReal = pUnityTable; + const XVECTOR* __restrict pUnityTableImaginary = pUnityTable + (uLength>>2); + const UINT32 uTotal = uCount * uLength; + const UINT32 uTotal_vectors = uTotal >> 2; + const UINT32 uStage_vectors = uLength >> 2; + const UINT32 uStage_vectors_mask = uStage_vectors - 1; + const UINT32 uStride = uLength >> 4; // stride between butterfly elements + const UINT32 uStrideMask = uStride - 1; + const UINT32 uStride2 = uStride * 2; + const UINT32 uStride3 = uStride * 3; + const UINT32 uStrideInvMask = ~uStrideMask; + + + for (UINT32 uIndex=0; uIndex<(uTotal_vectors>>2); ++uIndex) { + const UINT32 n = ((uIndex & uStrideInvMask) << 2) + (uIndex & uStrideMask); + ButterflyDIT4_4(pReal[n], + pReal[n + uStride], + pReal[n + uStride2], + pReal[n + uStride3], + pImaginary[n ], + pImaginary[n + uStride], + pImaginary[n + uStride2], + pImaginary[n + uStride3], + pUnityTableReal + (n & uStage_vectors_mask), + pUnityTableImaginary + (n & uStage_vectors_mask), + uStride, FALSE); + } + + + if (uLength > 16*4) { + FFT(pReal, pImaginary, pUnityTable+(uLength>>1), uLength>>2, uCount*4); + } else if (uLength == 16*4) { + FFT16(pReal, pImaginary, uCount*4); + } else if (uLength == 8*4) { + FFT8(pReal, pImaginary, uCount*4); + } else if (uLength == 4*4) { + FFT4(pReal, pImaginary, uCount*4); + } + } + +//--------------------------------------------------------------------------// + //// + // DESCRIPTION: + // Initializes unity roots lookup table used by FFT functions. + // Once initialized, the table need not be initialized again unless a + // different FFT length is desired. + // + // REMARKS: + // The unity tables of FFT length 16 and below are hard coded into the + // respective FFT functions and so need not be initialized. + // + // PARAMETERS: + // pUnityTable - [out] unity table, receives unity roots lookup table, must have at least uLength elements + // uLength - [in] FFT length in frames, must be a power of 2 > 16 + // + // RETURN VALUE: + // void + //// +inline void FFTInitializeUnityTable (__out_ecount(uLength) XVECTOR* __restrict pUnityTable, UINT32 uLength) +{ + DSPASSERT(pUnityTable != NULL); + DSPASSERT(uLength > 16); + DSPASSERT(ISPOWEROF2(uLength)); + + FLOAT32* __restrict pfUnityTable = (FLOAT32* __restrict)pUnityTable; + + + // initialize unity table for recursive FFT lengths: uLength, uLength/4, uLength/16... > 16 + do { + FLOAT32 flStep = 6.283185307f / uLength; // 2PI / FFT length + uLength >>= 2; + + // pUnityTable[0 to uLength*4-1] contains real components for current FFT length + // pUnityTable[uLength*4 to uLength*8-1] contains imaginary components for current FFT length + for (UINT32 i=0; i<4; ++i) { + for (UINT32 j=0; j 16); +} + + + //// + // DESCRIPTION: + // The FFT functions generate output in bit reversed order. + // Use this function to re-arrange them into order of increasing frequency. + // + // REMARKS: + // + // PARAMETERS: + // pOutput - [out] output buffer, receives samples in order of increasing frequency, cannot overlap pInput, must have at least (1<= 2 + // + // RETURN VALUE: + // void + //// +inline void FFTUnswizzle (__out_ecount((1<= 2); + + FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput; + const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput; + const UINT32 uLength = UINT32(1 << uLog2Length); + + + if ((uLog2Length & 0x1) == 0) { + // even powers of two + for (UINT32 uIndex=0; uIndex> 2 ) | ( (n & 0x33333333) << 2 ); + n = ( (n & 0xf0f0f0f0) >> 4 ) | ( (n & 0x0f0f0f0f) << 4 ); + n = ( (n & 0xff00ff00) >> 8 ) | ( (n & 0x00ff00ff) << 8 ); + n = ( (n & 0xffff0000) >> 16 ) | ( (n & 0x0000ffff) << 16 ); + n >>= (32 - uLog2Length); + pfOutput[n] = pfInput[uIndex]; + } + } else { + // odd powers of two + for (UINT32 uIndex=0; uIndex>3); + n = ( (n & 0xcccccccc) >> 2 ) | ( (n & 0x33333333) << 2 ); + n = ( (n & 0xf0f0f0f0) >> 4 ) | ( (n & 0x0f0f0f0f) << 4 ); + n = ( (n & 0xff00ff00) >> 8 ) | ( (n & 0x00ff00ff) << 8 ); + n = ( (n & 0xffff0000) >> 16 ) | ( (n & 0x0000ffff) << 16 ); + n >>= (32 - (uLog2Length-3)); + n |= ((uIndex & 0x7) << (uLog2Length - 3)); + pfOutput[n] = pfInput[uIndex]; + } + } +} + + + //// + // DESCRIPTION: + // Convert complex components to polar form. + // + // PARAMETERS: + // pOutput - [out] output buffer, receives samples in polar form, must have at least uLength/4 elements + // pInputReal - [in] input buffer (real components), must have at least uLength/4 elements + // pInputImaginary - [in] input buffer (imaginary components), must have at least uLength/4 elements + // uLength - [in] FFT length in samples, must be a power of 2 >= 4 + // + // RETURN VALUE: + // void + //// +inline void FFTPolar (__out_ecount(uLength/4) XVECTOR* __restrict pOutput, __in_ecount(uLength/4) const XVECTOR* __restrict pInputReal, __in_ecount(uLength/4) const XVECTOR* __restrict pInputImaginary, const UINT32 uLength) +{ + DSPASSERT(pOutput != NULL); + DSPASSERT(pInputReal != NULL); + DSPASSERT(pInputImaginary != NULL); + DSPASSERT(uLength >= 4); + DSPASSERT(ISPOWEROF2(uLength)); + + FLOAT32 flOneOverLength = 1.0f / uLength; + + + // result = sqrtf((real/uLength)^2 + (imaginary/uLength)^2) * 2 + XVECTOR vOneOverLength = _mm_set_ps1(flOneOverLength); + + for (UINT32 uIndex=0; uIndex<(uLength>>2); ++uIndex) { + XVECTOR vReal = _mm_mul_ps(pInputReal[uIndex], vOneOverLength); + XVECTOR vImaginary = _mm_mul_ps(pInputImaginary[uIndex], vOneOverLength); + XVECTOR vRR = _mm_mul_ps(vReal, vReal); + XVECTOR vII = _mm_mul_ps(vImaginary, vImaginary); + XVECTOR vRRplusII = _mm_add_ps(vRR, vII); + XVECTOR vTotal = _mm_sqrt_ps(vRRplusII); + pOutput[uIndex] = _mm_add_ps(vTotal, vTotal); + } +} + + + + + +//--------------------------------------------------------------------------// + //// + // DESCRIPTION: + // Deinterleaves audio samples such that all samples corresponding to + + // + // REMARKS: + // For example, audio of the form [LRLRLR] becomes [LLLRRR]. + // + // PARAMETERS: + // pOutput - [out] output buffer, receives samples in deinterleaved form, cannot overlap pInput, must have at least (uChannelCount*uFrameCount)/4 elements + // pInput - [in] input buffer, cannot overlap pOutput, must have at least (uChannelCount*uFrameCount)/4 elements + // uChannelCount - [in] number of channels, must be > 1 + // uFrameCount - [in] number of frames of valid data, must be > 0 + // + // RETURN VALUE: + // void + //// +inline void Deinterleave (__out_ecount((uChannelCount*uFrameCount)/4) XVECTOR* __restrict pOutput, __in_ecount((uChannelCount*uFrameCount)/4) const XVECTOR* __restrict pInput, const UINT32 uChannelCount, const UINT32 uFrameCount) +{ + DSPASSERT(pOutput != NULL); + DSPASSERT(pInput != NULL); + DSPASSERT(uChannelCount > 1); + DSPASSERT(uFrameCount > 0); + + FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput; + const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput; + + + for (UINT32 uChannel=0; uChannel 1 + // uFrameCount - [in] number of frames of valid data, must be > 0 + // + // RETURN VALUE: + // void + //// +inline void Interleave (__out_ecount((uChannelCount*uFrameCount)/4) XVECTOR* __restrict pOutput, __in_ecount((uChannelCount*uFrameCount)/4) const XVECTOR* __restrict pInput, const UINT32 uChannelCount, const UINT32 uFrameCount) +{ + DSPASSERT(pOutput != NULL); + DSPASSERT(pInput != NULL); + DSPASSERT(uChannelCount > 1); + DSPASSERT(uFrameCount > 0); + + FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput; + const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput; + + + for (UINT32 uChannel=0; uChannel 0 && uChannelCount <= 6); + DSPASSERT(uLog2Length >= 2 && uLog2Length <= 9); + + XVECTOR vRealTemp[768]; + XVECTOR vImaginaryTemp[768]; + const UINT32 uLength = UINT32(1 << uLog2Length); + + + if (uChannelCount > 1) { + Deinterleave(vRealTemp, pReal, uChannelCount, uLength); + } else { + CopyMemory(vRealTemp, pReal, (uLength>>2)*sizeof(XVECTOR)); + } + for (UINT32 u=0; u>2); u++) { + vImaginaryTemp[u] = _mm_setzero_ps(); + } + + if (uLength > 16) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)], pUnityTable, uLength); + } + } else if (uLength == 16) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } else if (uLength == 8) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } else if (uLength == 4) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } + + for (UINT32 uChannel=0; uChannel>2)], &vRealTemp[uChannel*(uLength>>2)], uLog2Length); + FFTUnswizzle(&pImaginary[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], uLog2Length); + } +} + + + //// + // DESCRIPTION: + // This function applies a 2^N-sample inverse FFT. + // Audio is interleaved if multichannel. + // + // PARAMETERS: + // pReal - [inout] real components, must have at least (1< 0 + // uLog2Length - [in] LOG (base 2) of FFT length in frames, must within [2, 10] + // + // RETURN VALUE: + // void + //// +inline void IFFTDeinterleaved (__inout_ecount((1< 0 && uChannelCount <= 6); + DSPASSERT(uLog2Length >= 2 && uLog2Length <= 9); + + XVECTOR vRealTemp[768]; + XVECTOR vImaginaryTemp[768]; + const UINT32 uLength = UINT32(1 << uLog2Length); + + + const XVECTOR vRnp = _mm_set_ps1(1.0f/uLength); + const XVECTOR vRnm = _mm_set_ps1(-1.0f/uLength); + for (UINT32 u=0; u>2); u++) { + vRealTemp[u] = _mm_mul_ps(pReal[u], vRnp); + vImaginaryTemp[u] = _mm_mul_ps(pImaginary[u], vRnm); + } + + if (uLength > 16) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)], pUnityTable, uLength); + } + } else if (uLength == 16) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } else if (uLength == 8) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } else if (uLength == 4) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } + + for (UINT32 uChannel=0; uChannel>2)], &vRealTemp[uChannel*(uLength>>2)], uLog2Length); + } + if (uChannelCount > 1) { + Interleave(pReal, vImaginaryTemp, uChannelCount, uLength); + } else { + CopyMemory(pReal, vImaginaryTemp, (uLength>>2)*sizeof(XVECTOR)); + } +} + + +#pragma warning(pop) +}; // namespace XDSP +//---------------------------------<-EOF->----------------------------------// + diff --git a/RenderDll/Dx9Sdk/Include/XInput.h b/RenderDll/Dx9Sdk/Include/XInput.h new file mode 100644 index 0000000..c50a5cb --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/XInput.h @@ -0,0 +1,283 @@ +/*************************************************************************** +* * +* XInput.h -- This module defines XBOX controller APIs * +* and constansts for the Windows platform. * +* * +* Copyright (c) Microsoft Corp. All rights reserved. * +* * +***************************************************************************/ +#ifndef _XINPUT_H_ +#define _XINPUT_H_ + +#include + +// Current name of the DLL shipped in the same SDK as this header. +// The name reflects the current version +#ifndef XINPUT_USE_9_1_0 +#define XINPUT_DLL_A "xinput1_3.dll" +#define XINPUT_DLL_W L"xinput1_3.dll" +#else +#define XINPUT_DLL_A "xinput9_1_0.dll" +#define XINPUT_DLL_W L"xinput9_1_0.dll" +#endif +#ifdef UNICODE + #define XINPUT_DLL XINPUT_DLL_W +#else + #define XINPUT_DLL XINPUT_DLL_A +#endif + +// +// Device types available in XINPUT_CAPABILITIES +// +#define XINPUT_DEVTYPE_GAMEPAD 0x01 + +// +// Device subtypes available in XINPUT_CAPABILITIES +// +#define XINPUT_DEVSUBTYPE_GAMEPAD 0x01 + +#ifndef XINPUT_USE_9_1_0 + +#define XINPUT_DEVSUBTYPE_WHEEL 0x02 +#define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03 +#define XINPUT_DEVSUBTYPE_FLIGHT_SICK 0x04 +#define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05 +#define XINPUT_DEVSUBTYPE_GUITAR 0x06 +#define XINPUT_DEVSUBTYPE_DRUM_KIT 0x08 + +#endif // !XINPUT_USE_9_1_0 + + + +// +// Flags for XINPUT_CAPABILITIES +// +#define XINPUT_CAPS_VOICE_SUPPORTED 0x0004 + +// +// Constants for gamepad buttons +// +#define XINPUT_GAMEPAD_DPAD_UP 0x0001 +#define XINPUT_GAMEPAD_DPAD_DOWN 0x0002 +#define XINPUT_GAMEPAD_DPAD_LEFT 0x0004 +#define XINPUT_GAMEPAD_DPAD_RIGHT 0x0008 +#define XINPUT_GAMEPAD_START 0x0010 +#define XINPUT_GAMEPAD_BACK 0x0020 +#define XINPUT_GAMEPAD_LEFT_THUMB 0x0040 +#define XINPUT_GAMEPAD_RIGHT_THUMB 0x0080 +#define XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100 +#define XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200 +#define XINPUT_GAMEPAD_A 0x1000 +#define XINPUT_GAMEPAD_B 0x2000 +#define XINPUT_GAMEPAD_X 0x4000 +#define XINPUT_GAMEPAD_Y 0x8000 + + +// +// Gamepad thresholds +// +#define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE 7849 +#define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689 +#define XINPUT_GAMEPAD_TRIGGER_THRESHOLD 30 + +// +// Flags to pass to XInputGetCapabilities +// +#define XINPUT_FLAG_GAMEPAD 0x00000001 + + +#ifndef XINPUT_USE_9_1_0 + +// +// Devices that support batteries +// +#define BATTERY_DEVTYPE_GAMEPAD 0x00 +#define BATTERY_DEVTYPE_HEADSET 0x01 + +// +// Flags for battery status level +// +#define BATTERY_TYPE_DISCONNECTED 0x00 // This device is not connected +#define BATTERY_TYPE_WIRED 0x01 // Wired device, no battery +#define BATTERY_TYPE_ALKALINE 0x02 // Alkaline battery source +#define BATTERY_TYPE_NIMH 0x03 // Nickel Metal Hydride battery source +#define BATTERY_TYPE_UNKNOWN 0xFF // Cannot determine the battery type + +// These are only valid for wireless, connected devices, with known battery types +// The amount of use time remaining depends on the type of device. +#define BATTERY_LEVEL_EMPTY 0x00 +#define BATTERY_LEVEL_LOW 0x01 +#define BATTERY_LEVEL_MEDIUM 0x02 +#define BATTERY_LEVEL_FULL 0x03 + +// User index definitions +#define XUSER_MAX_COUNT 4 + +#define XUSER_INDEX_ANY 0x000000FF + + +// +// Codes returned for the gamepad keystroke +// + +#define VK_PAD_A 0x5800 +#define VK_PAD_B 0x5801 +#define VK_PAD_X 0x5802 +#define VK_PAD_Y 0x5803 +#define VK_PAD_RSHOULDER 0x5804 +#define VK_PAD_LSHOULDER 0x5805 +#define VK_PAD_LTRIGGER 0x5806 +#define VK_PAD_RTRIGGER 0x5807 + +#define VK_PAD_DPAD_UP 0x5810 +#define VK_PAD_DPAD_DOWN 0x5811 +#define VK_PAD_DPAD_LEFT 0x5812 +#define VK_PAD_DPAD_RIGHT 0x5813 +#define VK_PAD_START 0x5814 +#define VK_PAD_BACK 0x5815 +#define VK_PAD_LTHUMB_PRESS 0x5816 +#define VK_PAD_RTHUMB_PRESS 0x5817 + +#define VK_PAD_LTHUMB_UP 0x5820 +#define VK_PAD_LTHUMB_DOWN 0x5821 +#define VK_PAD_LTHUMB_RIGHT 0x5822 +#define VK_PAD_LTHUMB_LEFT 0x5823 +#define VK_PAD_LTHUMB_UPLEFT 0x5824 +#define VK_PAD_LTHUMB_UPRIGHT 0x5825 +#define VK_PAD_LTHUMB_DOWNRIGHT 0x5826 +#define VK_PAD_LTHUMB_DOWNLEFT 0x5827 + +#define VK_PAD_RTHUMB_UP 0x5830 +#define VK_PAD_RTHUMB_DOWN 0x5831 +#define VK_PAD_RTHUMB_RIGHT 0x5832 +#define VK_PAD_RTHUMB_LEFT 0x5833 +#define VK_PAD_RTHUMB_UPLEFT 0x5834 +#define VK_PAD_RTHUMB_UPRIGHT 0x5835 +#define VK_PAD_RTHUMB_DOWNRIGHT 0x5836 +#define VK_PAD_RTHUMB_DOWNLEFT 0x5837 + +// +// Flags used in XINPUT_KEYSTROKE +// +#define XINPUT_KEYSTROKE_KEYDOWN 0x0001 +#define XINPUT_KEYSTROKE_KEYUP 0x0002 +#define XINPUT_KEYSTROKE_REPEAT 0x0004 + +#endif //!XINPUT_USE_9_1_0 + +// +// Structures used by XInput APIs +// +typedef struct _XINPUT_GAMEPAD +{ + WORD wButtons; + BYTE bLeftTrigger; + BYTE bRightTrigger; + SHORT sThumbLX; + SHORT sThumbLY; + SHORT sThumbRX; + SHORT sThumbRY; +} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD; + +typedef struct _XINPUT_STATE +{ + DWORD dwPacketNumber; + XINPUT_GAMEPAD Gamepad; +} XINPUT_STATE, *PXINPUT_STATE; + +typedef struct _XINPUT_VIBRATION +{ + WORD wLeftMotorSpeed; + WORD wRightMotorSpeed; +} XINPUT_VIBRATION, *PXINPUT_VIBRATION; + +typedef struct _XINPUT_CAPABILITIES +{ + BYTE Type; + BYTE SubType; + WORD Flags; + XINPUT_GAMEPAD Gamepad; + XINPUT_VIBRATION Vibration; +} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES; + +#ifndef XINPUT_USE_9_1_0 + +typedef struct _XINPUT_BATTERY_INFORMATION +{ + BYTE BatteryType; + BYTE BatteryLevel; +} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION; + +typedef struct _XINPUT_KEYSTROKE +{ + WORD VirtualKey; + WCHAR Unicode; + WORD Flags; + BYTE UserIndex; + BYTE HidCode; +} XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE; + +#endif // !XINPUT_USE_9_1_0 + +// +// XInput APIs +// +#ifdef __cplusplus +extern "C" { +#endif + +DWORD WINAPI XInputGetState +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __out XINPUT_STATE* pState // Receives the current state +); + +DWORD WINAPI XInputSetState +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __in XINPUT_VIBRATION* pVibration // The vibration information to send to the controller +); + +DWORD WINAPI XInputGetCapabilities +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __in DWORD dwFlags, // Input flags that identify the device type + __out XINPUT_CAPABILITIES* pCapabilities // Receives the capabilities +); + +void WINAPI XInputEnable +( + __in BOOL enable // [in] Indicates whether xinput is enabled or disabled. +); + +DWORD WINAPI XInputGetDSoundAudioDeviceGuids +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __out GUID* pDSoundRenderGuid, // DSound device ID for render + __out GUID* pDSoundCaptureGuid // DSound device ID for capture +); + +#ifndef XINPUT_USE_9_1_0 + +DWORD WINAPI XInputGetBatteryInformation +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __in BYTE devType, // Which device on this user index + __out XINPUT_BATTERY_INFORMATION* pBatteryInformation // Contains the level and types of batteries +); + +DWORD WINAPI XInputGetKeystroke +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __reserved DWORD dwReserved, // Reserved for future use + __out PXINPUT_KEYSTROKE pKeystroke // Pointer to an XINPUT_KEYSTROKE structure that receives an input event. +); + +#endif //!XINPUT_USE_9_1_0 + +#ifdef __cplusplus +} +#endif + +#endif //_XINPUT_H_ + diff --git a/RenderDll/Dx9Sdk/Include/audiodefs.h b/RenderDll/Dx9Sdk/Include/audiodefs.h new file mode 100644 index 0000000..ff995ec --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/audiodefs.h @@ -0,0 +1,263 @@ +/*************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: audiodefs.h + * Content: Basic constants and data types for audio work. + * + * Remarks: This header file defines all of the audio format constants and + * structures required for XAudio2 and XACT work. Providing these + * in a single location avoids certain dependency problems in the + * legacy audio headers (mmreg.h, mmsystem.h, ksmedia.h). + * + * NOTE: Including the legacy headers after this one may cause a + * compilation error, because they define some of the same types + * defined here without preprocessor guards to avoid multiple + * definitions. If a source file needs one of the old headers, + * it must include it before including audiodefs.h. + * + ***************************************************************************/ + +#ifndef __AUDIODEFS_INCLUDED__ +#define __AUDIODEFS_INCLUDED__ + +#include // For WORD, DWORD, etc. + +#pragma pack(push, 1) // Pack structures to 1-byte boundaries + + +/************************************************************************** + * + * WAVEFORMATEX: Base structure for many audio formats. Format-specific + * extensions can be defined for particular formats by using a non-zero + * cbSize value and adding extra fields to the end of this structure. + * + ***************************************************************************/ + +#ifndef _WAVEFORMATEX_ + + #define _WAVEFORMATEX_ + typedef struct tWAVEFORMATEX + { + WORD wFormatTag; // Integer identifier of the format + WORD nChannels; // Number of audio channels + DWORD nSamplesPerSec; // Audio sample rate + DWORD nAvgBytesPerSec; // Bytes per second (possibly approximate) + WORD nBlockAlign; // Size in bytes of a sample block (all channels) + WORD wBitsPerSample; // Size in bits of a single per-channel sample + WORD cbSize; // Bytes of extra data appended to this struct + } WAVEFORMATEX; + +#endif + +// Defining pointer types outside of the #if block to make sure they are +// defined even if mmreg.h or mmsystem.h is #included before this file + +typedef WAVEFORMATEX *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX; +typedef const WAVEFORMATEX *PCWAVEFORMATEX, *LPCWAVEFORMATEX; + + +/************************************************************************** + * + * WAVEFORMATEXTENSIBLE: Extended version of WAVEFORMATEX that should be + * used as a basis for all new audio formats. The format tag is replaced + * with a GUID, allowing new formats to be defined without registering a + * format tag with Microsoft. There are also new fields that can be used + * to specify the spatial positions for each channel and the bit packing + * used for wide samples (e.g. 24-bit PCM samples in 32-bit containers). + * + ***************************************************************************/ + +#ifndef _WAVEFORMATEXTENSIBLE_ + + #define _WAVEFORMATEXTENSIBLE_ + typedef struct + { + WAVEFORMATEX Format; // Base WAVEFORMATEX data + union + { + WORD wValidBitsPerSample; // Valid bits in each sample container + WORD wSamplesPerBlock; // Samples per block of audio data; valid + // if wBitsPerSample=0 (but rarely used). + WORD wReserved; // Zero if neither case above applies. + } Samples; + DWORD dwChannelMask; // Positions of the audio channels + GUID SubFormat; // Format identifier GUID + } WAVEFORMATEXTENSIBLE; + +#endif + +typedef WAVEFORMATEXTENSIBLE *PWAVEFORMATEXTENSIBLE, *LPWAVEFORMATEXTENSIBLE; +typedef const WAVEFORMATEXTENSIBLE *PCWAVEFORMATEXTENSIBLE, *LPCWAVEFORMATEXTENSIBLE; + + + +/************************************************************************** + * + * Define the most common wave format tags used in WAVEFORMATEX formats. + * + ***************************************************************************/ + +#ifndef WAVE_FORMAT_PCM // Pulse Code Modulation + + // If WAVE_FORMAT_PCM is not defined, we need to define some legacy types + // for compatibility with the Windows mmreg.h / mmsystem.h header files. + + // Old general format structure (information common to all formats) + typedef struct waveformat_tag + { + WORD wFormatTag; + WORD nChannels; + DWORD nSamplesPerSec; + DWORD nAvgBytesPerSec; + WORD nBlockAlign; + } WAVEFORMAT, *PWAVEFORMAT, NEAR *NPWAVEFORMAT, FAR *LPWAVEFORMAT; + + // Specific format structure for PCM data + typedef struct pcmwaveformat_tag + { + WAVEFORMAT wf; + WORD wBitsPerSample; + } PCMWAVEFORMAT, *PPCMWAVEFORMAT, NEAR *NPPCMWAVEFORMAT, FAR *LPPCMWAVEFORMAT; + + #define WAVE_FORMAT_PCM 0x0001 + +#endif + +#ifndef WAVE_FORMAT_ADPCM // Microsoft Adaptive Differental PCM + + // Replicate the Microsoft ADPCM type definitions from mmreg.h. + + typedef struct adpcmcoef_tag + { + short iCoef1; + short iCoef2; + } ADPCMCOEFSET; + + #pragma warning(push) + #pragma warning(disable:4200) // Disable zero-sized array warnings + + typedef struct adpcmwaveformat_tag { + WAVEFORMATEX wfx; + WORD wSamplesPerBlock; + WORD wNumCoef; + ADPCMCOEFSET aCoef[]; // Always 7 coefficient pairs for MS ADPCM + } ADPCMWAVEFORMAT; + + #pragma warning(pop) + + #define WAVE_FORMAT_ADPCM 0x0002 + +#endif + +// Other frequently used format tags + +#ifndef WAVE_FORMAT_UNKNOWN + #define WAVE_FORMAT_UNKNOWN 0x0000 // Unknown or invalid format tag +#endif + +#ifndef WAVE_FORMAT_IEEE_FLOAT + #define WAVE_FORMAT_IEEE_FLOAT 0x0003 // 32-bit floating-point +#endif + +#ifndef WAVE_FORMAT_MPEGLAYER3 + #define WAVE_FORMAT_MPEGLAYER3 0x0055 // ISO/MPEG Layer3 +#endif + +#ifndef WAVE_FORMAT_DOLBY_AC3_SPDIF + #define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 // Dolby Audio Codec 3 over S/PDIF +#endif + +#ifndef WAVE_FORMAT_WMAUDIO2 + #define WAVE_FORMAT_WMAUDIO2 0x0161 // Windows Media Audio +#endif + +#ifndef WAVE_FORMAT_WMAUDIO3 + #define WAVE_FORMAT_WMAUDIO3 0x0162 // Windows Media Audio Pro +#endif + +#ifndef WAVE_FORMAT_WMASPDIF + #define WAVE_FORMAT_WMASPDIF 0x0164 // Windows Media Audio over S/PDIF +#endif + +#ifndef WAVE_FORMAT_EXTENSIBLE + #define WAVE_FORMAT_EXTENSIBLE 0xFFFE // All WAVEFORMATEXTENSIBLE formats +#endif + + +/************************************************************************** + * + * Define the most common wave format GUIDs used in WAVEFORMATEXTENSIBLE + * formats. Note that including the Windows ksmedia.h header after this + * one will cause build problems; this cannot be avoided, since ksmedia.h + * defines these macros without preprocessor guards. + * + ***************************************************************************/ + +#ifdef __cplusplus // uuid() and __uuidof() are only available in C++ + + #ifndef KSDATAFORMAT_SUBTYPE_PCM + struct __declspec(uuid("00000001-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_PCM_STRUCT; + #define KSDATAFORMAT_SUBTYPE_PCM __uuidof(KSDATAFORMAT_SUBTYPE_PCM_STRUCT) + #endif + + #ifndef KSDATAFORMAT_SUBTYPE_ADPCM + struct __declspec(uuid("00000002-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT; + #define KSDATAFORMAT_SUBTYPE_ADPCM __uuidof(KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT) + #endif + + #ifndef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT + struct __declspec(uuid("00000003-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT; + #define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT __uuidof(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT) + #endif + +#endif + + +/************************************************************************** + * + * Speaker positions used in the WAVEFORMATEXTENSIBLE dwChannelMask field. + * + ***************************************************************************/ + +#ifndef SPEAKER_FRONT_LEFT + #define SPEAKER_FRONT_LEFT 0x00000001 + #define SPEAKER_FRONT_RIGHT 0x00000002 + #define SPEAKER_FRONT_CENTER 0x00000004 + #define SPEAKER_LOW_FREQUENCY 0x00000008 + #define SPEAKER_BACK_LEFT 0x00000010 + #define SPEAKER_BACK_RIGHT 0x00000020 + #define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040 + #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080 + #define SPEAKER_BACK_CENTER 0x00000100 + #define SPEAKER_SIDE_LEFT 0x00000200 + #define SPEAKER_SIDE_RIGHT 0x00000400 + #define SPEAKER_TOP_CENTER 0x00000800 + #define SPEAKER_TOP_FRONT_LEFT 0x00001000 + #define SPEAKER_TOP_FRONT_CENTER 0x00002000 + #define SPEAKER_TOP_FRONT_RIGHT 0x00004000 + #define SPEAKER_TOP_BACK_LEFT 0x00008000 + #define SPEAKER_TOP_BACK_CENTER 0x00010000 + #define SPEAKER_TOP_BACK_RIGHT 0x00020000 + #define SPEAKER_RESERVED 0x7FFC0000 + #define SPEAKER_ALL 0x80000000 + #define _SPEAKER_POSITIONS_ +#endif + +#ifndef SPEAKER_STEREO + #define SPEAKER_MONO (SPEAKER_FRONT_CENTER) + #define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) + #define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY) + #define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) + #define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER) + #define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) + #define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) +#endif + + +#pragma pack(pop) + +#endif // #ifndef __AUDIODEFS_INCLUDED__ diff --git a/RenderDll/Dx9Sdk/Include/comdecl.h b/RenderDll/Dx9Sdk/Include/comdecl.h new file mode 100644 index 0000000..2ae9a96 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/comdecl.h @@ -0,0 +1,59 @@ +// comdecl.h: Macros to facilitate COM interface and GUID declarations. +// Copyright (c) Microsoft Corporation. All rights reserved. + +#ifndef _COMDECL_H_ +#define _COMDECL_H_ + +#ifndef _XBOX + #include // For standard COM interface macros +#else + #pragma warning(push) + #pragma warning(disable:4061) + #include // Required by xobjbase.h + #include // Special definitions for Xbox build + #pragma warning(pop) +#endif + +// The DEFINE_CLSID() and DEFINE_IID() macros defined below allow COM GUIDs to +// be declared and defined in such a way that clients can obtain the GUIDs using +// either the __uuidof() extension or the old-style CLSID_Foo / IID_IFoo names. +// If using the latter approach, the client can also choose whether to get the +// GUID definitions by defining the INITGUID preprocessor constant or by linking +// to a GUID library. This works in either C or C++. + +#ifdef __cplusplus + + #define DECLSPEC_UUID_WRAPPER(x) __declspec(uuid(#x)) + #ifdef INITGUID + + #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \ + EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_##className = __uuidof(className) + + #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \ + EXTERN_C const GUID DECLSPEC_SELECTANY IID_##interfaceName = __uuidof(interfaceName) + + #else // INITGUID + + #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \ + EXTERN_C const GUID CLSID_##className + + #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \ + EXTERN_C const GUID IID_##interfaceName + + #endif // INITGUID + +#else // __cplusplus + + #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + DEFINE_GUID(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) + + #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + DEFINE_GUID(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) + +#endif // __cplusplus + +#endif // #ifndef _COMDECL_H_ diff --git a/RenderDll/Dx9Sdk/Include/d3d10misc.h b/RenderDll/Dx9Sdk/Include/d3d10misc.h new file mode 100644 index 0000000..a20644d --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/d3d10misc.h @@ -0,0 +1,143 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3D10Misc.h +// Content: D3D10 Device Creation APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D10MISC_H__ +#define __D3D10MISC_H__ + +#include "d3d10.h" + +// ID3D10Blob has been made version-neutral and moved to d3dcommon.h. + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +/////////////////////////////////////////////////////////////////////////// +// D3D10_DRIVER_TYPE +// ---------------- +// +// This identifier is used to determine the implementation of Direct3D10 +// to be used. +// +// Pass one of these values to D3D10CreateDevice +// +/////////////////////////////////////////////////////////////////////////// +typedef enum D3D10_DRIVER_TYPE +{ + D3D10_DRIVER_TYPE_HARDWARE = 0, + D3D10_DRIVER_TYPE_REFERENCE = 1, + D3D10_DRIVER_TYPE_NULL = 2, + D3D10_DRIVER_TYPE_SOFTWARE = 3, + D3D10_DRIVER_TYPE_WARP = 5, +} D3D10_DRIVER_TYPE; + +DEFINE_GUID(GUID_DeviceType, +0xd722fb4d, 0x7a68, 0x437a, 0xb2, 0x0c, 0x58, 0x04, 0xee, 0x24, 0x94, 0xa6); + +/////////////////////////////////////////////////////////////////////////// +// D3D10CreateDevice +// ------------------ +// +// pAdapter +// If NULL, D3D10CreateDevice will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D10CreateDevice will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D10CreateDevice. +// SDKVersion +// SDK version. Use the D3D10_SDK_VERSION macro. +// ppDevice +// Pointer to returned interface. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D10CreateDevice +// +/////////////////////////////////////////////////////////////////////////// +HRESULT WINAPI D3D10CreateDevice( + IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + UINT SDKVersion, + ID3D10Device **ppDevice); + +/////////////////////////////////////////////////////////////////////////// +// D3D10CreateDeviceAndSwapChain +// ------------------------------ +// +// ppAdapter +// If NULL, D3D10CreateDevice will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D10CreateDevice will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D10CreateDevice. +// SDKVersion +// SDK version. Use the D3D10_SDK_VERSION macro. +// pSwapChainDesc +// Swap chain description, may be NULL. +// ppSwapChain +// Pointer to returned interface. May be NULL. +// ppDevice +// Pointer to returned interface. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D10CreateDevice +// IDXGIFactory::CreateSwapChain +// +/////////////////////////////////////////////////////////////////////////// +HRESULT WINAPI D3D10CreateDeviceAndSwapChain( + IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + UINT SDKVersion, + DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, + IDXGISwapChain **ppSwapChain, + ID3D10Device **ppDevice); + + +/////////////////////////////////////////////////////////////////////////// +// D3D10CreateBlob: +// ----------------- +// Creates a Buffer of n Bytes +////////////////////////////////////////////////////////////////////////// + +HRESULT WINAPI D3D10CreateBlob(SIZE_T NumBytes, LPD3D10BLOB *ppBuffer); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D10EFFECT_H__ + + diff --git a/RenderDll/Dx9Sdk/Include/d3d10sdklayers.h b/RenderDll/Dx9Sdk/Include/d3d10sdklayers.h new file mode 100644 index 0000000..ef432eb --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/d3d10sdklayers.h @@ -0,0 +1,1361 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* Compiler settings for d3d10sdklayers.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d10sdklayers_h__ +#define __d3d10sdklayers_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D10Debug_FWD_DEFINED__ +#define __ID3D10Debug_FWD_DEFINED__ +typedef interface ID3D10Debug ID3D10Debug; +#endif /* __ID3D10Debug_FWD_DEFINED__ */ + + +#ifndef __ID3D10SwitchToRef_FWD_DEFINED__ +#define __ID3D10SwitchToRef_FWD_DEFINED__ +typedef interface ID3D10SwitchToRef ID3D10SwitchToRef; +#endif /* __ID3D10SwitchToRef_FWD_DEFINED__ */ + + +#ifndef __ID3D10InfoQueue_FWD_DEFINED__ +#define __ID3D10InfoQueue_FWD_DEFINED__ +typedef interface ID3D10InfoQueue ID3D10InfoQueue; +#endif /* __ID3D10InfoQueue_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgi.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d10sdklayers_0000_0000 */ +/* [local] */ + +#define D3D10_SDK_LAYERS_VERSION ( 11 ) + +#define D3D10_DEBUG_FEATURE_FLUSH_PER_RENDER_OP ( 0x1 ) + +#define D3D10_DEBUG_FEATURE_FINISH_PER_RENDER_OP ( 0x2 ) + +#define D3D10_DEBUG_FEATURE_PRESENT_PER_RENDER_OP ( 0x4 ) + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D10Debug_INTERFACE_DEFINED__ +#define __ID3D10Debug_INTERFACE_DEFINED__ + +/* interface ID3D10Debug */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Debug; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4E01-342C-4106-A19F-4F2704F689F0") + ID3D10Debug : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetFeatureMask( + UINT Mask) = 0; + + virtual UINT STDMETHODCALLTYPE GetFeatureMask( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPresentPerRenderOpDelay( + UINT Milliseconds) = 0; + + virtual UINT STDMETHODCALLTYPE GetPresentPerRenderOpDelay( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetSwapChain( + /* [annotation] */ + __in_opt IDXGISwapChain *pSwapChain) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetSwapChain( + /* [annotation] */ + __out IDXGISwapChain **ppSwapChain) = 0; + + virtual HRESULT STDMETHODCALLTYPE Validate( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10DebugVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Debug * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Debug * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D10Debug * This, + UINT Mask); + + UINT ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D10Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetPresentPerRenderOpDelay )( + ID3D10Debug * This, + UINT Milliseconds); + + UINT ( STDMETHODCALLTYPE *GetPresentPerRenderOpDelay )( + ID3D10Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetSwapChain )( + ID3D10Debug * This, + /* [annotation] */ + __in_opt IDXGISwapChain *pSwapChain); + + HRESULT ( STDMETHODCALLTYPE *GetSwapChain )( + ID3D10Debug * This, + /* [annotation] */ + __out IDXGISwapChain **ppSwapChain); + + HRESULT ( STDMETHODCALLTYPE *Validate )( + ID3D10Debug * This); + + END_INTERFACE + } ID3D10DebugVtbl; + + interface ID3D10Debug + { + CONST_VTBL struct ID3D10DebugVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Debug_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Debug_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Debug_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Debug_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D10Debug_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + +#define ID3D10Debug_SetPresentPerRenderOpDelay(This,Milliseconds) \ + ( (This)->lpVtbl -> SetPresentPerRenderOpDelay(This,Milliseconds) ) + +#define ID3D10Debug_GetPresentPerRenderOpDelay(This) \ + ( (This)->lpVtbl -> GetPresentPerRenderOpDelay(This) ) + +#define ID3D10Debug_SetSwapChain(This,pSwapChain) \ + ( (This)->lpVtbl -> SetSwapChain(This,pSwapChain) ) + +#define ID3D10Debug_GetSwapChain(This,ppSwapChain) \ + ( (This)->lpVtbl -> GetSwapChain(This,ppSwapChain) ) + +#define ID3D10Debug_Validate(This) \ + ( (This)->lpVtbl -> Validate(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Debug_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10SwitchToRef_INTERFACE_DEFINED__ +#define __ID3D10SwitchToRef_INTERFACE_DEFINED__ + +/* interface ID3D10SwitchToRef */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10SwitchToRef; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4E02-342C-4106-A19F-4F2704F689F0") + ID3D10SwitchToRef : public IUnknown + { + public: + virtual BOOL STDMETHODCALLTYPE SetUseRef( + BOOL UseRef) = 0; + + virtual BOOL STDMETHODCALLTYPE GetUseRef( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10SwitchToRefVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10SwitchToRef * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10SwitchToRef * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10SwitchToRef * This); + + BOOL ( STDMETHODCALLTYPE *SetUseRef )( + ID3D10SwitchToRef * This, + BOOL UseRef); + + BOOL ( STDMETHODCALLTYPE *GetUseRef )( + ID3D10SwitchToRef * This); + + END_INTERFACE + } ID3D10SwitchToRefVtbl; + + interface ID3D10SwitchToRef + { + CONST_VTBL struct ID3D10SwitchToRefVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10SwitchToRef_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10SwitchToRef_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10SwitchToRef_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10SwitchToRef_SetUseRef(This,UseRef) \ + ( (This)->lpVtbl -> SetUseRef(This,UseRef) ) + +#define ID3D10SwitchToRef_GetUseRef(This) \ + ( (This)->lpVtbl -> GetUseRef(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10SwitchToRef_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10sdklayers_0000_0002 */ +/* [local] */ + +typedef +enum D3D10_MESSAGE_CATEGORY + { D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0, + D3D10_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) , + D3D10_MESSAGE_CATEGORY_INITIALIZATION = ( D3D10_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) , + D3D10_MESSAGE_CATEGORY_CLEANUP = ( D3D10_MESSAGE_CATEGORY_INITIALIZATION + 1 ) , + D3D10_MESSAGE_CATEGORY_COMPILATION = ( D3D10_MESSAGE_CATEGORY_CLEANUP + 1 ) , + D3D10_MESSAGE_CATEGORY_STATE_CREATION = ( D3D10_MESSAGE_CATEGORY_COMPILATION + 1 ) , + D3D10_MESSAGE_CATEGORY_STATE_SETTING = ( D3D10_MESSAGE_CATEGORY_STATE_CREATION + 1 ) , + D3D10_MESSAGE_CATEGORY_STATE_GETTING = ( D3D10_MESSAGE_CATEGORY_STATE_SETTING + 1 ) , + D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D10_MESSAGE_CATEGORY_STATE_GETTING + 1 ) , + D3D10_MESSAGE_CATEGORY_EXECUTION = ( D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) + } D3D10_MESSAGE_CATEGORY; + +typedef +enum D3D10_MESSAGE_SEVERITY + { D3D10_MESSAGE_SEVERITY_CORRUPTION = 0, + D3D10_MESSAGE_SEVERITY_ERROR = ( D3D10_MESSAGE_SEVERITY_CORRUPTION + 1 ) , + D3D10_MESSAGE_SEVERITY_WARNING = ( D3D10_MESSAGE_SEVERITY_ERROR + 1 ) , + D3D10_MESSAGE_SEVERITY_INFO = ( D3D10_MESSAGE_SEVERITY_WARNING + 1 ) + } D3D10_MESSAGE_SEVERITY; + +typedef +enum D3D10_MESSAGE_ID + { D3D10_MESSAGE_ID_UNKNOWN = 0, + D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_UNKNOWN + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_THIS = ( D3D10_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D10_MESSAGE_ID_CORRUPTED_THIS + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) , + D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) , + D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) , + D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) , + D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) , + D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) , + D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC = ( D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) , + D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) , + D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) , + D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1 ) , + D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) , + D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1 ) , + D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID = ( D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = ( D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1 ) , + D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1 ) , + D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) , + D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = ( D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE = ( D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) , + D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) , + D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1 ) , + D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1 ) , + D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) , + D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) , + D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) , + D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = ( D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) , + D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = ( D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1 ) , + D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1 ) , + D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) , + D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) , + D3D10_MESSAGE_ID_REF_THREADING_MODE = ( D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) , + D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D10_MESSAGE_ID_REF_THREADING_MODE + 1 ) , + D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) , + D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) , + D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) , + D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) , + D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) , + D3D10_MESSAGE_ID_REF_INFO = ( D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_REF_INFO + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) , + D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) , + D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1 ) , + D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1 ) , + D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1 ) , + D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) , + D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = ( D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1 ) , + D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1 ) , + D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER = ( D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED = ( D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN = ( D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC = ( D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + 1 ) , + D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER = ( D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER + 1 ) , + D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE = ( D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) , + D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED = ( D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + 1 ) , + D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION = ( D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE = ( D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + 1 ) , + D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS = ( D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + 1 ) , + D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION = ( D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + 1 ) , + D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS = ( D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + 1 ) , + D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN = ( D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + 1 ) , + D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE = ( D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + 1 ) , + D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE + 1 ) , + D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1 ) , + D3D10_MESSAGE_ID_D3D10_MESSAGES_END = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x100000, + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED = ( D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + 1 ) , + D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + 1 ) , + D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS = ( D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + 1 ) , + D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS = ( D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + 1 ) , + D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + 1 ) , + D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK = ( D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK = ( D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT = ( D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + 1 ) , + D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD = ( D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER = ( D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE = ( D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES = ( D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + 1 ) , + D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + 1 ) , + D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND = ( D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + 1 ) , + D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 = ( D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED = ( D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + 1 ) , + D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO = ( D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION = ( D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR = ( D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP = ( D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + 1 ) , + D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_D3D10L9_MESSAGES_END = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + 1 ) + } D3D10_MESSAGE_ID; + +typedef struct D3D10_MESSAGE + { + D3D10_MESSAGE_CATEGORY Category; + D3D10_MESSAGE_SEVERITY Severity; + D3D10_MESSAGE_ID ID; + const char *pDescription; + SIZE_T DescriptionByteLength; + } D3D10_MESSAGE; + +typedef struct D3D10_INFO_QUEUE_FILTER_DESC + { + UINT NumCategories; + D3D10_MESSAGE_CATEGORY *pCategoryList; + UINT NumSeverities; + D3D10_MESSAGE_SEVERITY *pSeverityList; + UINT NumIDs; + D3D10_MESSAGE_ID *pIDList; + } D3D10_INFO_QUEUE_FILTER_DESC; + +typedef struct D3D10_INFO_QUEUE_FILTER + { + D3D10_INFO_QUEUE_FILTER_DESC AllowList; + D3D10_INFO_QUEUE_FILTER_DESC DenyList; + } D3D10_INFO_QUEUE_FILTER; + +#define D3D10_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024 + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0002_v0_0_s_ifspec; + +#ifndef __ID3D10InfoQueue_INTERFACE_DEFINED__ +#define __ID3D10InfoQueue_INTERFACE_DEFINED__ + +/* interface ID3D10InfoQueue */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10InfoQueue; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1b940b17-2642-4d1f-ab1f-b99bad0c395f") + ID3D10InfoQueue : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit( + /* [annotation] */ + __in UINT64 MessageCountLimit) = 0; + + virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetMessage( + /* [annotation] */ + __in UINT64 MessageIndex, + /* [annotation] */ + __out_bcount_opt(*pMessageByteLength) D3D10_MESSAGE *pMessage, + /* [annotation] */ + __inout SIZE_T *pMessageByteLength) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries( + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetStorageFilter( + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushStorageFilter( + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries( + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter( + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter( + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddMessage( + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in D3D10_MESSAGE_ID ID, + /* [annotation] */ + __in LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage( + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory( + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity( + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnID( + /* [annotation] */ + __in D3D10_MESSAGE_ID ID, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory( + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity( + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnID( + /* [annotation] */ + __in D3D10_MESSAGE_ID ID) = 0; + + virtual void STDMETHODCALLTYPE SetMuteDebugOutput( + /* [annotation] */ + __in BOOL bMute) = 0; + + virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10InfoQueueVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10InfoQueue * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10InfoQueue * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in UINT64 MessageCountLimit); + + void ( STDMETHODCALLTYPE *ClearStoredMessages )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *GetMessage )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in UINT64 MessageIndex, + /* [annotation] */ + __out_bcount_opt(*pMessageByteLength) D3D10_MESSAGE *pMessage, + /* [annotation] */ + __inout SIZE_T *pMessageByteLength); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )( + ID3D10InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )( + ID3D10InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )( + ID3D10InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )( + ID3D10InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )( + ID3D10InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter); + + HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )( + ID3D10InfoQueue * This, + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength); + + void ( STDMETHODCALLTYPE *ClearStorageFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter); + + void ( STDMETHODCALLTYPE *PopStorageFilter )( + ID3D10InfoQueue * This); + + UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter); + + HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )( + ID3D10InfoQueue * This, + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength); + + void ( STDMETHODCALLTYPE *ClearRetrievalFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter); + + void ( STDMETHODCALLTYPE *PopRetrievalFilter )( + ID3D10InfoQueue * This); + + UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddMessage )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in D3D10_MESSAGE_ID ID, + /* [annotation] */ + __in LPCSTR pDescription); + + HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in LPCSTR pDescription); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in BOOL bEnable); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in BOOL bEnable); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_ID ID, + /* [annotation] */ + __in BOOL bEnable); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnID )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_ID ID); + + void ( STDMETHODCALLTYPE *SetMuteDebugOutput )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in BOOL bMute); + + BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )( + ID3D10InfoQueue * This); + + END_INTERFACE + } ID3D10InfoQueueVtbl; + + interface ID3D10InfoQueue + { + CONST_VTBL struct ID3D10InfoQueueVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10InfoQueue_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10InfoQueue_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10InfoQueue_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \ + ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) ) + +#define ID3D10InfoQueue_ClearStoredMessages(This) \ + ( (This)->lpVtbl -> ClearStoredMessages(This) ) + +#define ID3D10InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \ + ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) ) + +#define ID3D10InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) ) + +#define ID3D10InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) ) + +#define ID3D10InfoQueue_GetNumStoredMessages(This) \ + ( (This)->lpVtbl -> GetNumStoredMessages(This) ) + +#define ID3D10InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \ + ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) ) + +#define ID3D10InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) ) + +#define ID3D10InfoQueue_GetMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetMessageCountLimit(This) ) + +#define ID3D10InfoQueue_AddStorageFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) ) + +#define ID3D10InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D10InfoQueue_ClearStorageFilter(This) \ + ( (This)->lpVtbl -> ClearStorageFilter(This) ) + +#define ID3D10InfoQueue_PushEmptyStorageFilter(This) \ + ( (This)->lpVtbl -> PushEmptyStorageFilter(This) ) + +#define ID3D10InfoQueue_PushCopyOfStorageFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) ) + +#define ID3D10InfoQueue_PushStorageFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) ) + +#define ID3D10InfoQueue_PopStorageFilter(This) \ + ( (This)->lpVtbl -> PopStorageFilter(This) ) + +#define ID3D10InfoQueue_GetStorageFilterStackSize(This) \ + ( (This)->lpVtbl -> GetStorageFilterStackSize(This) ) + +#define ID3D10InfoQueue_AddRetrievalFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) ) + +#define ID3D10InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D10InfoQueue_ClearRetrievalFilter(This) \ + ( (This)->lpVtbl -> ClearRetrievalFilter(This) ) + +#define ID3D10InfoQueue_PushEmptyRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) ) + +#define ID3D10InfoQueue_PushCopyOfRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) ) + +#define ID3D10InfoQueue_PushRetrievalFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) ) + +#define ID3D10InfoQueue_PopRetrievalFilter(This) \ + ( (This)->lpVtbl -> PopRetrievalFilter(This) ) + +#define ID3D10InfoQueue_GetRetrievalFilterStackSize(This) \ + ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) ) + +#define ID3D10InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \ + ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) ) + +#define ID3D10InfoQueue_AddApplicationMessage(This,Severity,pDescription) \ + ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) ) + +#define ID3D10InfoQueue_SetBreakOnCategory(This,Category,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) ) + +#define ID3D10InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) ) + +#define ID3D10InfoQueue_SetBreakOnID(This,ID,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) ) + +#define ID3D10InfoQueue_GetBreakOnCategory(This,Category) \ + ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) ) + +#define ID3D10InfoQueue_GetBreakOnSeverity(This,Severity) \ + ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) ) + +#define ID3D10InfoQueue_GetBreakOnID(This,ID) \ + ( (This)->lpVtbl -> GetBreakOnID(This,ID) ) + +#define ID3D10InfoQueue_SetMuteDebugOutput(This,bMute) \ + ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) ) + +#define ID3D10InfoQueue_GetMuteDebugOutput(This) \ + ( (This)->lpVtbl -> GetMuteDebugOutput(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10InfoQueue_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10sdklayers_0000_0003 */ +/* [local] */ + +#define D3D10_REGKEY_PATH __TEXT("Software\\Microsoft\\Direct3D") +#define D3D10_MUTE_DEBUG_OUTPUT __TEXT("MuteDebugOutput") +#define D3D10_ENABLE_BREAK_ON_MESSAGE __TEXT("EnableBreakOnMessage") +#define D3D10_INFOQUEUE_STORAGE_FILTER_OVERRIDE __TEXT("InfoQueueStorageFilterOverride") +#define D3D10_MUTE_CATEGORY __TEXT("Mute_CATEGORY_%s") +#define D3D10_MUTE_SEVERITY __TEXT("Mute_SEVERITY_%s") +#define D3D10_MUTE_ID_STRING __TEXT("Mute_ID_%s") +#define D3D10_MUTE_ID_DECIMAL __TEXT("Mute_ID_%d") +#define D3D10_UNMUTE_SEVERITY_INFO __TEXT("Unmute_SEVERITY_INFO") +#define D3D10_BREAKON_CATEGORY __TEXT("BreakOn_CATEGORY_%s") +#define D3D10_BREAKON_SEVERITY __TEXT("BreakOn_SEVERITY_%s") +#define D3D10_BREAKON_ID_STRING __TEXT("BreakOn_ID_%s") +#define D3D10_BREAKON_ID_DECIMAL __TEXT("BreakOn_ID_%d") +#define D3D10_APPSIZE_STRING __TEXT("Size") +#define D3D10_APPNAME_STRING __TEXT("Name") +DEFINE_GUID(IID_ID3D10Debug,0x9B7E4E01,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10SwitchToRef,0x9B7E4E02,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10InfoQueue,0x1b940b17,0x2642,0x4d1f,0xab,0x1f,0xb9,0x9b,0xad,0x0c,0x39,0x5f); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0003_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/RenderDll/Dx9Sdk/Include/d3d9.h b/RenderDll/Dx9Sdk/Include/d3d9.h index 0c25201..e5c7847 100644 --- a/RenderDll/Dx9Sdk/Include/d3d9.h +++ b/RenderDll/Dx9Sdk/Include/d3d9.h @@ -25,10 +25,12 @@ * (The number itself has no meaning.)*/ #ifdef D3D_DEBUG_INFO -#define D3D_SDK_VERSION (31 | 0x80000000) +#define D3D_SDK_VERSION (32 | 0x80000000) +#define D3D9b_SDK_VERSION (31 | 0x80000000) #else -#define D3D_SDK_VERSION 31 +#define D3D_SDK_VERSION 32 +#define D3D9b_SDK_VERSION 31 #endif @@ -124,6 +126,40 @@ DEFINE_GUID(IID_IDirect3DQuery9, 0xd9771460, 0xa695, 0x4f26, 0xbb, 0xd3, 0x27, 0 /* {E4A36723-FDFE-4b22-B146-3C04C07F4CC8} */ DEFINE_GUID(IID_HelperName, 0xe4a36723, 0xfdfe, 0x4b22, 0xb1, 0x46, 0x3c, 0x4, 0xc0, 0x7f, 0x4c, 0xc8); +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/* IID_IDirect3D9Ex */ +/* {02177241-69FC-400C-8FF1-93A44DF6861D} */ +DEFINE_GUID(IID_IDirect3D9Ex, 0x02177241, 0x69FC, 0x400C, 0x8F, 0xF1, 0x93, 0xA4, 0x4D, 0xF6, 0x86, 0x1D); + +/* IID_IDirect3DDevice9Ex */ +// {B18B10CE-2649-405a-870F-95F777D4313A} +DEFINE_GUID(IID_IDirect3DDevice9Ex, 0xb18b10ce, 0x2649, 0x405a, 0x87, 0xf, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a); + +/* IID_IDirect3DSwapChain9Ex */ +/* {91886CAF-1C3D-4d2e-A0AB-3E4C7D8D3303} */ +DEFINE_GUID(IID_IDirect3DSwapChain9Ex, 0x91886caf, 0x1c3d, 0x4d2e, 0xa0, 0xab, 0x3e, 0x4c, 0x7d, 0x8d, 0x33, 0x3); + +/* IID_IDirect3D9ExOverlayExtension */ +/* {187aeb13-aaf5-4c59-876d-e059088c0df8} */ +DEFINE_GUID(IID_IDirect3D9ExOverlayExtension, 0x187aeb13, 0xaaf5, 0x4c59, 0x87, 0x6d, 0xe0, 0x59, 0x8, 0x8c, 0xd, 0xf8); + +/* IID_IDirect3DDevice9Video */ +// {26DC4561-A1EE-4ae7-96DA-118A36C0EC95} +DEFINE_GUID(IID_IDirect3DDevice9Video, 0x26dc4561, 0xa1ee, 0x4ae7, 0x96, 0xda, 0x11, 0x8a, 0x36, 0xc0, 0xec, 0x95); + +/* IID_IDirect3D9AuthenticatedChannel */ +// {FF24BEEE-DA21-4beb-98B5-D2F899F98AF9} +DEFINE_GUID(IID_IDirect3DAuthenticatedChannel9, 0xff24beee, 0xda21, 0x4beb, 0x98, 0xb5, 0xd2, 0xf8, 0x99, 0xf9, 0x8a, 0xf9); + +/* IID_IDirect3DCryptoSession9 */ +// {FA0AB799-7A9C-48ca-8C5B-237E71A54434} +DEFINE_GUID(IID_IDirect3DCryptoSession9, 0xfa0ab799, 0x7a9c, 0x48ca, 0x8c, 0x5b, 0x23, 0x7e, 0x71, 0xa5, 0x44, 0x34); + + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ #endif @@ -160,6 +196,20 @@ interface DECLSPEC_UUID("794950F2-ADFC-458a-905E-10A10B0B503B") IDirect3DSwapCha interface DECLSPEC_UUID("d9771460-a695-4f26-bbd3-27b840b541cc") IDirect3DQuery9; +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +interface DECLSPEC_UUID("02177241-69FC-400C-8FF1-93A44DF6861D") IDirect3D9Ex; +interface DECLSPEC_UUID("B18B10CE-2649-405a-870F-95F777D4313A") IDirect3DDevice9Ex; +interface DECLSPEC_UUID("91886CAF-1C3D-4d2e-A0AB-3E4C7D8D3303") IDirect3DSwapChain9Ex; +interface DECLSPEC_UUID("187AEB13-AAF5-4C59-876D-E059088C0DF8") IDirect3D9ExOverlayExtension; +interface DECLSPEC_UUID("26DC4561-A1EE-4ae7-96DA-118A36C0EC95") IDirect3DDevice9Video; +interface DECLSPEC_UUID("FF24BEEE-DA21-4beb-98B5-D2F899F98AF9") IDirect3DAuthenticatedChannel9; +interface DECLSPEC_UUID("FA0AB799-7A9C-48CA-8C5B-237E71A54434") IDirect3DCryptoSession9; + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + #if defined(_COM_SMARTPTR_TYPEDEF) _COM_SMARTPTR_TYPEDEF(IDirect3D9, __uuidof(IDirect3D9)); _COM_SMARTPTR_TYPEDEF(IDirect3DDevice9, __uuidof(IDirect3DDevice9)); @@ -183,7 +233,23 @@ _COM_SMARTPTR_TYPEDEF(IDirect3DVolume9, __uuidof(IDirect3DVolume9)); _COM_SMARTPTR_TYPEDEF(IDirect3DSwapChain9, __uuidof(IDirect3DSwapChain9)); _COM_SMARTPTR_TYPEDEF(IDirect3DQuery9, __uuidof(IDirect3DQuery9)); + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +_COM_SMARTPTR_TYPEDEF(IDirect3D9Ex, __uuidof(IDirect3D9Ex)); +_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9Ex, __uuidof(IDirect3DDevice9Ex)); +_COM_SMARTPTR_TYPEDEF(IDirect3DSwapChain9Ex, __uuidof(IDirect3DSwapChain9Ex)); +_COM_SMARTPTR_TYPEDEF(IDirect3D9ExOverlayExtension, __uuidof(IDirect3D9ExOverlayExtension)); +_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9Video, __uuidof(IDirect3DDevice9Video)); +_COM_SMARTPTR_TYPEDEF(IDirect3DAuthenticatedChannel9, __uuidof(IDirect3DAuthenticatedChannel9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DCryptoSession9, __uuidof(IDirect3DCryptoSession9)); + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + #endif + #endif @@ -206,6 +272,21 @@ typedef interface IDirect3DSwapChain9 IDirect3DSwapChain9; typedef interface IDirect3DQuery9 IDirect3DQuery9; +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + +typedef interface IDirect3D9Ex IDirect3D9Ex; +typedef interface IDirect3DDevice9Ex IDirect3DDevice9Ex; +typedef interface IDirect3DSwapChain9Ex IDirect3DSwapChain9Ex; +typedef interface IDirect3D9ExOverlayExtension IDirect3D9ExOverlayExtension; +typedef interface IDirect3DDevice9Video IDirect3DDevice9Video; +typedef interface IDirect3DAuthenticatedChannel9 IDirect3DAuthenticatedChannel9; +typedef interface IDirect3DCryptoSession9 IDirect3DCryptoSession9; + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + #include "d3d9types.h" #include "d3d9caps.h" @@ -233,8 +314,9 @@ int WINAPI D3DPERF_EndEvent( void ); void WINAPI D3DPERF_SetMarker( D3DCOLOR col, LPCWSTR wszName ); void WINAPI D3DPERF_SetRegion( D3DCOLOR col, LPCWSTR wszName ); BOOL WINAPI D3DPERF_QueryRepeatFrame( void ); -void WINAPI D3DPERF_SetOptions( DWORD_PTR dwOptions ); -DWORD_PTR WINAPI D3DPERF_GetStatus( void ); + +void WINAPI D3DPERF_SetOptions( DWORD dwOptions ); +DWORD WINAPI D3DPERF_GetStatus( void ); /* * Direct3D interfaces @@ -747,6 +829,9 @@ typedef struct IDirect3DDevice9 *LPDIRECT3DDEVICE9, *PDIRECT3DDEVICE9; #endif + + + #undef INTERFACE #define INTERFACE IDirect3DStateBlock9 @@ -1761,6 +1846,23 @@ typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9; // mode, etc.) should be coded. #define D3DCREATE_NOWINDOWCHANGES 0x00000800L +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +// Disable multithreading for software vertex processing +#define D3DCREATE_DISABLE_PSGP_THREADING 0x00002000L +// This flag enables present statistics on device. +#define D3DCREATE_ENABLE_PRESENTSTATS 0x00004000L +// This flag disables printscreen support in the runtime for this device +#define D3DCREATE_DISABLE_PRINTSCREEN 0x00008000L + +#define D3DCREATE_SCREENSAVER 0x10000000L + + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + /**************************************************************************** * @@ -1776,8 +1878,24 @@ typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9; * ****************************************************************************/ +/* + * The D3DENUM_WHQL_LEVEL value has been retired for 9Ex and future versions, + * but it needs to be defined here for compatibility with DX9 and earlier versions. + * See the DirectX SDK for sample code on discovering driver signatures. + */ #define D3DENUM_WHQL_LEVEL 0x00000002L +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/* NO_DRIVERVERSION will not fill out the DriverVersion field, nor will the + DriverVersion be incorporated into the DeviceIdentifier GUID. WINNT only */ +#define D3DENUM_NO_DRIVERVERSION 0x00000004L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + /**************************************************************************** * * Maximum number of back-buffers supported in DX9 @@ -1786,6 +1904,20 @@ typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9; #define D3DPRESENT_BACK_BUFFERS_MAX 3L +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/**************************************************************************** + * + * Maximum number of back-buffers supported when apps use CreateDeviceEx + * + ****************************************************************************/ + +#define D3DPRESENT_BACK_BUFFERS_MAX_EX 30L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + /**************************************************************************** * * Flags for IDirect3DDevice9::SetGammaRamp @@ -1812,6 +1944,21 @@ typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9; #define D3DPRESENT_DONOTWAIT 0x00000001L #define D3DPRESENT_LINEAR_CONTENT 0x00000002L +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DPRESENT_DONOTFLIP 0x00000004L +#define D3DPRESENT_FLIPRESTART 0x00000008L +#define D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR 0x00000010L +#define D3DPRESENT_UPDATEOVERLAYONLY 0x00000020L +#define D3DPRESENT_HIDEOVERLAY 0x00000040L +#define D3DPRESENT_UPDATECOLORKEY 0x00000080L +#define D3DPRESENT_FORCEIMMEDIATE 0x00000100L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + /**************************************************************************** * * Flags for DrawPrimitive/DrawIndexedPrimitive @@ -1857,6 +2004,783 @@ typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9; #define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) #define D3DOK_NOAUTOGEN MAKE_D3DSTATUS(2159) +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + +#define D3DERR_DEVICEREMOVED MAKE_D3DHRESULT(2160) +#define S_NOT_RESIDENT MAKE_D3DSTATUS(2165) +#define S_RESIDENT_IN_SHARED_MEMORY MAKE_D3DSTATUS(2166) +#define S_PRESENT_MODE_CHANGED MAKE_D3DSTATUS(2167) +#define S_PRESENT_OCCLUDED MAKE_D3DSTATUS(2168) +#define D3DERR_DEVICEHUNG MAKE_D3DHRESULT(2164) +#define D3DERR_UNSUPPORTEDOVERLAY MAKE_D3DHRESULT(2171) +#define D3DERR_UNSUPPORTEDOVERLAYFORMAT MAKE_D3DHRESULT(2172) +#define D3DERR_CANNOTPROTECTCONTENT MAKE_D3DHRESULT(2173) +#define D3DERR_UNSUPPORTEDCRYPTO MAKE_D3DHRESULT(2174) +#define D3DERR_PRESENT_STATISTICS_DISJOINT MAKE_D3DHRESULT(2180) + + +/********************* +/* D3D9Ex interfaces +/*********************/ + +HRESULT WINAPI Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex**); + + + + +#undef INTERFACE +#define INTERFACE IDirect3D9Ex + +DECLARE_INTERFACE_(IDirect3D9Ex, IDirect3D9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D9 methods ***/ + STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; + STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) PURE; + STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter,D3DFORMAT Format) PURE; + STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) PURE; + STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; + STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) PURE; + STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; + STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) PURE; + STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; + STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) PURE; + STDMETHOD_(UINT, GetAdapterModeCountEx)(THIS_ UINT Adapter,CONST D3DDISPLAYMODEFILTER* pFilter ) PURE; + STDMETHOD(EnumAdapterModesEx)(THIS_ UINT Adapter,CONST D3DDISPLAYMODEFILTER* pFilter,UINT Mode,D3DDISPLAYMODEEX* pMode) PURE; + STDMETHOD(GetAdapterDisplayModeEx)(THIS_ UINT Adapter,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; + STDMETHOD(CreateDeviceEx)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX* pFullscreenDisplayMode,IDirect3DDevice9Ex** ppReturnedDeviceInterface) PURE; + STDMETHOD(GetAdapterLUID)(THIS_ UINT Adapter,LUID * pLUID) PURE; +}; + +typedef struct IDirect3D9Ex *LPDIRECT3D9EX, *PDIRECT3D9EX; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D9Ex_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D9Ex_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) +#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) +#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b) +#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) +#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d) +#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) +#define IDirect3D9Ex_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) +#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) +#define IDirect3D9Ex_GetAdapterModeCountEx(p,a,b) (p)->lpVtbl->GetAdapterModeCountEx(p,a,b) +#define IDirect3D9Ex_EnumAdapterModesEx(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModesEx(p,a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayModeEx(p,a,b,c) (p)->lpVtbl->GetAdapterDisplayModeEx(p,a,b,c) +#define IDirect3D9Ex_CreateDeviceEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d,e,f,g) +#define IDirect3D9Ex_GetAdapterLUID(p,a,b) (p)->lpVtbl->GetAdapterLUID(p,a,b) +#else +#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D9Ex_AddRef(p) (p)->AddRef() +#define IDirect3D9Ex_Release(p) (p)->Release() +#define IDirect3D9Ex_GetAdapterCount(p) (p)->GetAdapterCount() +#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) +#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->GetAdapterModeCount(a,b) +#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d) (p)->EnumAdapterModes(a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) +#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d) (p)->CheckDeviceFormatConversion(a,b,c,d) +#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) +#define IDirect3D9Ex_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) +#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) +#define IDirect3D9Ex_GetAdapterModeCountEx(p,a,b) (p)->GetAdapterModeCountEx(a,b) +#define IDirect3D9Ex_EnumAdapterModesEx(p,a,b,c,d) (p)->EnumAdapterModesEx(a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayModeEx(p,a,b,c) (p)->GetAdapterDisplayModeEx(a,b,c) +#define IDirect3D9Ex_CreateDeviceEx(p,a,b,c,d,e,f,g) (p)->CreateDeviceEx(a,b,c,d,e,f,g) +#define IDirect3D9Ex_GetAdapterLUID(p,a,b) (p)->GetAdapterLUID(a,b) +#endif + + + + + + + + + + + + + + + + + + + + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DDevice9Ex + +DECLARE_INTERFACE_(IDirect3DDevice9Ex, IDirect3DDevice9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice9 methods ***/ + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; + STDMETHOD(EvictManagedResources)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; + STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) PURE; + STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE; + STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; + STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE; + STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE; + STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; + STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp) PURE; + STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) PURE; + STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) PURE; + STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) PURE; + STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) PURE; + STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) PURE; + STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) PURE; + STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE; + STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; + STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9*) PURE; + STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; + STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; + STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; + STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; + STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(BeginStateBlock)(THIS) PURE; + STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture) PURE; + STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; + STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) PURE; + STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; + STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; + STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; + STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; + STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; + STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE; + STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE; + STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE; + STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE; + STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE; + STDMETHOD_(float, GetNPatchMode)(THIS) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; + STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) PURE; + STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE; + STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE; + STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) PURE; + STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride) PURE; + STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting) PURE; + STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting) PURE; + STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE; + STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE; + STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE; + STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; + STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; + STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; + STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) PURE; + STDMETHOD(SetConvolutionMonoKernel)(THIS_ UINT width,UINT height,float* rows,float* columns) PURE; + STDMETHOD(ComposeRects)(THIS_ IDirect3DSurface9* pSrc,IDirect3DSurface9* pDst,IDirect3DVertexBuffer9* pSrcRectDescs,UINT NumRects,IDirect3DVertexBuffer9* pDstRectDescs,D3DCOMPOSERECTSOP Operation,int Xoffset,int Yoffset) PURE; + STDMETHOD(PresentEx)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; + STDMETHOD(GetGPUThreadPriority)(THIS_ INT* pPriority) PURE; + STDMETHOD(SetGPUThreadPriority)(THIS_ INT Priority) PURE; + STDMETHOD(WaitForVBlank)(THIS_ UINT iSwapChain) PURE; + STDMETHOD(CheckResourceResidency)(THIS_ IDirect3DResource9** pResourceArray,UINT32 NumResources) PURE; + STDMETHOD(SetMaximumFrameLatency)(THIS_ UINT MaxLatency) PURE; + STDMETHOD(GetMaximumFrameLatency)(THIS_ UINT* pMaxLatency) PURE; + STDMETHOD(CheckDeviceState)(THIS_ HWND hDestinationWindow) PURE; + STDMETHOD(CreateRenderTargetEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; + STDMETHOD(CreateOffscreenPlainSurfaceEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; + STDMETHOD(CreateDepthStencilSurfaceEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; + STDMETHOD(ResetEx)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX *pFullscreenDisplayMode) PURE; + STDMETHOD(GetDisplayModeEx)(THIS_ UINT iSwapChain,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; +}; + +typedef struct IDirect3DDevice9Ex *LPDIRECT3DDEVICE9EX, *PDIRECT3DDEVICE9EX; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice9Ex_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice9Ex_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) +#define IDirect3DDevice9Ex_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) +#define IDirect3DDevice9Ex_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p) +#define IDirect3DDevice9Ex_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) +#define IDirect3DDevice9Ex_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) +#define IDirect3DDevice9Ex_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b) +#define IDirect3DDevice9Ex_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) +#define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) +#define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) +#define IDirect3DDevice9Ex_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) +#define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) +#define IDirect3DDevice9Ex_GetSwapChain(p,a,b) (p)->lpVtbl->GetSwapChain(p,a,b) +#define IDirect3DDevice9Ex_GetNumberOfSwapChains(p) (p)->lpVtbl->GetNumberOfSwapChains(p) +#define IDirect3DDevice9Ex_Reset(p,a) (p)->lpVtbl->Reset(p,a) +#define IDirect3DDevice9Ex_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) +#define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d) (p)->lpVtbl->GetBackBuffer(p,a,b,c,d) +#define IDirect3DDevice9Ex_GetRasterStatus(p,a,b) (p)->lpVtbl->GetRasterStatus(p,a,b) +#define IDirect3DDevice9Ex_SetDialogBoxMode(p,a) (p)->lpVtbl->SetDialogBoxMode(p,a) +#define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c) (p)->lpVtbl->SetGammaRamp(p,a,b,c) +#define IDirect3DDevice9Ex_GetGammaRamp(p,a,b) (p)->lpVtbl->GetGammaRamp(p,a,b) +#define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d) +#define IDirect3DDevice9Ex_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) +#define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b) +#define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b) +#define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e) +#define IDirect3DDevice9Ex_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) +#define IDirect3DDevice9Ex_GetRenderTarget(p,a,b) (p)->lpVtbl->GetRenderTarget(p,a,b) +#define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a) (p)->lpVtbl->SetDepthStencilSurface(p,a) +#define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) +#define IDirect3DDevice9Ex_BeginScene(p) (p)->lpVtbl->BeginScene(p) +#define IDirect3DDevice9Ex_EndScene(p) (p)->lpVtbl->EndScene(p) +#define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) +#define IDirect3DDevice9Ex_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) +#define IDirect3DDevice9Ex_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) +#define IDirect3DDevice9Ex_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) +#define IDirect3DDevice9Ex_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) +#define IDirect3DDevice9Ex_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DDevice9Ex_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DDevice9Ex_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) +#define IDirect3DDevice9Ex_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) +#define IDirect3DDevice9Ex_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) +#define IDirect3DDevice9Ex_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) +#define IDirect3DDevice9Ex_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) +#define IDirect3DDevice9Ex_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) +#define IDirect3DDevice9Ex_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) +#define IDirect3DDevice9Ex_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) +#define IDirect3DDevice9Ex_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) +#define IDirect3DDevice9Ex_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) +#define IDirect3DDevice9Ex_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) +#define IDirect3DDevice9Ex_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) +#define IDirect3DDevice9Ex_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) +#define IDirect3DDevice9Ex_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) +#define IDirect3DDevice9Ex_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) +#define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) +#define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) +#define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c) (p)->lpVtbl->GetSamplerState(p,a,b,c) +#define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c) (p)->lpVtbl->SetSamplerState(p,a,b,c) +#define IDirect3DDevice9Ex_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) +#define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) +#define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) +#define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) +#define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) +#define IDirect3DDevice9Ex_SetScissorRect(p,a) (p)->lpVtbl->SetScissorRect(p,a) +#define IDirect3DDevice9Ex_GetScissorRect(p,a) (p)->lpVtbl->GetScissorRect(p,a) +#define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a) (p)->lpVtbl->SetSoftwareVertexProcessing(p,a) +#define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p) (p)->lpVtbl->GetSoftwareVertexProcessing(p) +#define IDirect3DDevice9Ex_SetNPatchMode(p,a) (p)->lpVtbl->SetNPatchMode(p,a) +#define IDirect3DDevice9Ex_GetNPatchMode(p) (p)->lpVtbl->GetNPatchMode(p) +#define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) +#define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) +#define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b) (p)->lpVtbl->CreateVertexDeclaration(p,a,b) +#define IDirect3DDevice9Ex_SetVertexDeclaration(p,a) (p)->lpVtbl->SetVertexDeclaration(p,a) +#define IDirect3DDevice9Ex_GetVertexDeclaration(p,a) (p)->lpVtbl->GetVertexDeclaration(p,a) +#define IDirect3DDevice9Ex_SetFVF(p,a) (p)->lpVtbl->SetFVF(p,a) +#define IDirect3DDevice9Ex_GetFVF(p,a) (p)->lpVtbl->GetFVF(p,a) +#define IDirect3DDevice9Ex_CreateVertexShader(p,a,b) (p)->lpVtbl->CreateVertexShader(p,a,b) +#define IDirect3DDevice9Ex_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) +#define IDirect3DDevice9Ex_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) +#define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d) (p)->lpVtbl->SetStreamSource(p,a,b,c,d) +#define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d) (p)->lpVtbl->GetStreamSource(p,a,b,c,d) +#define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b) (p)->lpVtbl->SetStreamSourceFreq(p,a,b) +#define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b) (p)->lpVtbl->GetStreamSourceFreq(p,a,b) +#define IDirect3DDevice9Ex_SetIndices(p,a) (p)->lpVtbl->SetIndices(p,a) +#define IDirect3DDevice9Ex_GetIndices(p,a) (p)->lpVtbl->GetIndices(p,a) +#define IDirect3DDevice9Ex_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) +#define IDirect3DDevice9Ex_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) +#define IDirect3DDevice9Ex_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) +#define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) +#define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) +#define IDirect3DDevice9Ex_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) +#define IDirect3DDevice9Ex_CreateQuery(p,a,b) (p)->lpVtbl->CreateQuery(p,a,b) +#define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d) (p)->lpVtbl->SetConvolutionMonoKernel(p,a,b,c,d) +#define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->ComposeRects(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e) (p)->lpVtbl->PresentEx(p,a,b,c,d,e) +#define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a) (p)->lpVtbl->GetGPUThreadPriority(p,a) +#define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a) (p)->lpVtbl->SetGPUThreadPriority(p,a) +#define IDirect3DDevice9Ex_WaitForVBlank(p,a) (p)->lpVtbl->WaitForVBlank(p,a) +#define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b) (p)->lpVtbl->CheckResourceResidency(p,a,b) +#define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a) (p)->lpVtbl->SetMaximumFrameLatency(p,a) +#define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a) (p)->lpVtbl->GetMaximumFrameLatency(p,a) +#define IDirect3DDevice9Ex_CheckDeviceState(p,a) (p)->lpVtbl->CheckDeviceState(p,a) +#define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_ResetEx(p,a,b) (p)->lpVtbl->ResetEx(p,a,b) +#define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c) (p)->lpVtbl->GetDisplayModeEx(p,a,b,c) +#else +#define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice9Ex_AddRef(p) (p)->AddRef() +#define IDirect3DDevice9Ex_Release(p) (p)->Release() +#define IDirect3DDevice9Ex_TestCooperativeLevel(p) (p)->TestCooperativeLevel() +#define IDirect3DDevice9Ex_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() +#define IDirect3DDevice9Ex_EvictManagedResources(p) (p)->EvictManagedResources() +#define IDirect3DDevice9Ex_GetDirect3D(p,a) (p)->GetDirect3D(a) +#define IDirect3DDevice9Ex_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) +#define IDirect3DDevice9Ex_GetDisplayMode(p,a,b) (p)->GetDisplayMode(a,b) +#define IDirect3DDevice9Ex_GetCreationParameters(p,a) (p)->GetCreationParameters(a) +#define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) +#define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) +#define IDirect3DDevice9Ex_ShowCursor(p,a) (p)->ShowCursor(a) +#define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) +#define IDirect3DDevice9Ex_GetSwapChain(p,a,b) (p)->GetSwapChain(a,b) +#define IDirect3DDevice9Ex_GetNumberOfSwapChains(p) (p)->GetNumberOfSwapChains() +#define IDirect3DDevice9Ex_Reset(p,a) (p)->Reset(a) +#define IDirect3DDevice9Ex_Present(p,a,b,c,d) (p)->Present(a,b,c,d) +#define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d) (p)->GetBackBuffer(a,b,c,d) +#define IDirect3DDevice9Ex_GetRasterStatus(p,a,b) (p)->GetRasterStatus(a,b) +#define IDirect3DDevice9Ex_SetDialogBoxMode(p,a) (p)->SetDialogBoxMode(a) +#define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c) (p)->SetGammaRamp(a,b,c) +#define IDirect3DDevice9Ex_GetGammaRamp(p,a,b) (p)->GetGammaRamp(a,b) +#define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->CreateTexture(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->CreateCubeTexture(a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->CreateVertexBuffer(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->CreateIndexBuffer(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->CreateRenderTarget(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d) (p)->UpdateSurface(a,b,c,d) +#define IDirect3DDevice9Ex_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) +#define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b) (p)->GetRenderTargetData(a,b) +#define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b) (p)->GetFrontBufferData(a,b) +#define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e) (p)->StretchRect(a,b,c,d,e) +#define IDirect3DDevice9Ex_ColorFill(p,a,b,c) (p)->ColorFill(a,b,c) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) +#define IDirect3DDevice9Ex_GetRenderTarget(p,a,b) (p)->GetRenderTarget(a,b) +#define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a) (p)->SetDepthStencilSurface(a) +#define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) +#define IDirect3DDevice9Ex_BeginScene(p) (p)->BeginScene() +#define IDirect3DDevice9Ex_EndScene(p) (p)->EndScene() +#define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetTransform(p,a,b) (p)->SetTransform(a,b) +#define IDirect3DDevice9Ex_GetTransform(p,a,b) (p)->GetTransform(a,b) +#define IDirect3DDevice9Ex_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) +#define IDirect3DDevice9Ex_SetViewport(p,a) (p)->SetViewport(a) +#define IDirect3DDevice9Ex_GetViewport(p,a) (p)->GetViewport(a) +#define IDirect3DDevice9Ex_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DDevice9Ex_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DDevice9Ex_SetLight(p,a,b) (p)->SetLight(a,b) +#define IDirect3DDevice9Ex_GetLight(p,a,b) (p)->GetLight(a,b) +#define IDirect3DDevice9Ex_LightEnable(p,a,b) (p)->LightEnable(a,b) +#define IDirect3DDevice9Ex_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) +#define IDirect3DDevice9Ex_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) +#define IDirect3DDevice9Ex_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) +#define IDirect3DDevice9Ex_SetRenderState(p,a,b) (p)->SetRenderState(a,b) +#define IDirect3DDevice9Ex_GetRenderState(p,a,b) (p)->GetRenderState(a,b) +#define IDirect3DDevice9Ex_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) +#define IDirect3DDevice9Ex_BeginStateBlock(p) (p)->BeginStateBlock() +#define IDirect3DDevice9Ex_EndStateBlock(p,a) (p)->EndStateBlock(a) +#define IDirect3DDevice9Ex_SetClipStatus(p,a) (p)->SetClipStatus(a) +#define IDirect3DDevice9Ex_GetClipStatus(p,a) (p)->GetClipStatus(a) +#define IDirect3DDevice9Ex_GetTexture(p,a,b) (p)->GetTexture(a,b) +#define IDirect3DDevice9Ex_SetTexture(p,a,b) (p)->SetTexture(a,b) +#define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) +#define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) +#define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c) (p)->GetSamplerState(a,b,c) +#define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c) (p)->SetSamplerState(a,b,c) +#define IDirect3DDevice9Ex_ValidateDevice(p,a) (p)->ValidateDevice(a) +#define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) +#define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) +#define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) +#define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) +#define IDirect3DDevice9Ex_SetScissorRect(p,a) (p)->SetScissorRect(a) +#define IDirect3DDevice9Ex_GetScissorRect(p,a) (p)->GetScissorRect(a) +#define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a) (p)->SetSoftwareVertexProcessing(a) +#define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p) (p)->GetSoftwareVertexProcessing() +#define IDirect3DDevice9Ex_SetNPatchMode(p,a) (p)->SetNPatchMode(a) +#define IDirect3DDevice9Ex_GetNPatchMode(p) (p)->GetNPatchMode() +#define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) +#define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->DrawIndexedPrimitive(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) +#define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f) (p)->ProcessVertices(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b) (p)->CreateVertexDeclaration(a,b) +#define IDirect3DDevice9Ex_SetVertexDeclaration(p,a) (p)->SetVertexDeclaration(a) +#define IDirect3DDevice9Ex_GetVertexDeclaration(p,a) (p)->GetVertexDeclaration(a) +#define IDirect3DDevice9Ex_SetFVF(p,a) (p)->SetFVF(a) +#define IDirect3DDevice9Ex_GetFVF(p,a) (p)->GetFVF(a) +#define IDirect3DDevice9Ex_CreateVertexShader(p,a,b) (p)->CreateVertexShader(a,b) +#define IDirect3DDevice9Ex_SetVertexShader(p,a) (p)->SetVertexShader(a) +#define IDirect3DDevice9Ex_GetVertexShader(p,a) (p)->GetVertexShader(a) +#define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c) (p)->SetVertexShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c) (p)->GetVertexShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c) (p)->SetVertexShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c) (p)->GetVertexShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c) (p)->SetVertexShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c) (p)->GetVertexShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d) (p)->SetStreamSource(a,b,c,d) +#define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d) (p)->GetStreamSource(a,b,c,d) +#define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b) (p)->SetStreamSourceFreq(a,b) +#define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b) (p)->GetStreamSourceFreq(a,b) +#define IDirect3DDevice9Ex_SetIndices(p,a) (p)->SetIndices(a) +#define IDirect3DDevice9Ex_GetIndices(p,a) (p)->GetIndices(a) +#define IDirect3DDevice9Ex_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) +#define IDirect3DDevice9Ex_SetPixelShader(p,a) (p)->SetPixelShader(a) +#define IDirect3DDevice9Ex_GetPixelShader(p,a) (p)->GetPixelShader(a) +#define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c) (p)->SetPixelShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c) (p)->GetPixelShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c) (p)->SetPixelShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c) (p)->GetPixelShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c) (p)->SetPixelShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c) (p)->GetPixelShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) +#define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) +#define IDirect3DDevice9Ex_DeletePatch(p,a) (p)->DeletePatch(a) +#define IDirect3DDevice9Ex_CreateQuery(p,a,b) (p)->CreateQuery(a,b) +#define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d) (p)->SetConvolutionMonoKernel(a,b,c,d) +#define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h) (p)->ComposeRects(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e) (p)->PresentEx(a,b,c,d,e) +#define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a) (p)->GetGPUThreadPriority(a) +#define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a) (p)->SetGPUThreadPriority(a) +#define IDirect3DDevice9Ex_WaitForVBlank(p,a) (p)->WaitForVBlank(a) +#define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b) (p)->CheckResourceResidency(a,b) +#define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a) (p)->SetMaximumFrameLatency(a) +#define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a) (p)->GetMaximumFrameLatency(a) +#define IDirect3DDevice9Ex_CheckDeviceState(p,a) (p)->CheckDeviceState(a) +#define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) (p)->CreateRenderTargetEx(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) (p)->CreateOffscreenPlainSurfaceEx(a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) (p)->CreateDepthStencilSurfaceEx(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_ResetEx(p,a,b) (p)->ResetEx(a,b) +#define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c) (p)->GetDisplayModeEx(a,b,c) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DSwapChain9Ex + +DECLARE_INTERFACE_(IDirect3DSwapChain9Ex, IDirect3DSwapChain9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DSwapChain9 methods ***/ + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(GetLastPresentCount)(THIS_ UINT* pLastPresentCount) PURE; + STDMETHOD(GetPresentStats)(THIS_ D3DPRESENTSTATS* pPresentationStatistics) PURE; + STDMETHOD(GetDisplayModeEx)(THIS_ D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; +}; + +typedef struct IDirect3DSwapChain9Ex *LPDIRECT3DSWAPCHAIN9EX, *PDIRECT3DSWAPCHAIN9EX; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DSwapChain9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSwapChain9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSwapChain9Ex_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e) +#define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a) +#define IDirect3DSwapChain9Ex_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) +#define IDirect3DSwapChain9Ex_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) +#define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) +#define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a) +#define IDirect3DSwapChain9Ex_GetLastPresentCount(p,a) (p)->lpVtbl->GetLastPresentCount(p,a) +#define IDirect3DSwapChain9Ex_GetPresentStats(p,a) (p)->lpVtbl->GetPresentStats(p,a) +#define IDirect3DSwapChain9Ex_GetDisplayModeEx(p,a,b) (p)->lpVtbl->GetDisplayModeEx(p,a,b) +#else +#define IDirect3DSwapChain9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSwapChain9Ex_AddRef(p) (p)->AddRef() +#define IDirect3DSwapChain9Ex_Release(p) (p)->Release() +#define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->Present(a,b,c,d,e) +#define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->GetFrontBufferData(a) +#define IDirect3DSwapChain9Ex_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) +#define IDirect3DSwapChain9Ex_GetRasterStatus(p,a) (p)->GetRasterStatus(a) +#define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->GetDisplayMode(a) +#define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->GetPresentParameters(a) +#define IDirect3DSwapChain9Ex_GetLastPresentCount(p,a) (p)->GetLastPresentCount(a) +#define IDirect3DSwapChain9Ex_GetPresentStats(p,a) (p)->GetPresentStats(a) +#define IDirect3DSwapChain9Ex_GetDisplayModeEx(p,a,b) (p)->GetDisplayModeEx(a,b) +#endif + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + + +#undef INTERFACE +#define INTERFACE IDirect3D9ExOverlayExtension + +DECLARE_INTERFACE_(IDirect3D9ExOverlayExtension, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D9ExOverlayExtension methods ***/ + STDMETHOD(CheckDeviceOverlayType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,UINT OverlayWidth,UINT OverlayHeight,D3DFORMAT OverlayFormat,D3DDISPLAYMODEEX* pDisplayMode,D3DDISPLAYROTATION DisplayRotation,D3DOVERLAYCAPS* pOverlayCaps) PURE; +}; + +typedef struct IDirect3D9ExOverlayExtension *LPDIRECT3D9EXOVERLAYEXTENSION, *PDIRECT3D9EXOVERLAYEXTENSION; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D9ExOverlayExtension_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D9ExOverlayExtension_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D9ExOverlayExtension_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D9ExOverlayExtension_CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) +#else +#define IDirect3D9ExOverlayExtension_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D9ExOverlayExtension_AddRef(p) (p)->AddRef() +#define IDirect3D9ExOverlayExtension_Release(p) (p)->Release() +#define IDirect3D9ExOverlayExtension_CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) (p)->CheckDeviceOverlayType(a,b,c,d,e,f,g,h) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DDevice9Video + +DECLARE_INTERFACE_(IDirect3DDevice9Video, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice9Video methods ***/ + STDMETHOD(GetContentProtectionCaps)(THIS_ CONST GUID* pCryptoType,CONST GUID* pDecodeProfile,D3DCONTENTPROTECTIONCAPS* pCaps) PURE; + STDMETHOD(CreateAuthenticatedChannel)(THIS_ D3DAUTHENTICATEDCHANNELTYPE ChannelType,IDirect3DAuthenticatedChannel9** ppAuthenticatedChannel,HANDLE* pChannelHandle) PURE; + STDMETHOD(CreateCryptoSession)(THIS_ CONST GUID* pCryptoType,CONST GUID* pDecodeProfile,IDirect3DCryptoSession9** ppCryptoSession,HANDLE* pCryptoHandle) PURE; +}; + +typedef struct IDirect3DDevice9Video *LPDIRECT3DDEVICE9VIDEO, *PDIRECT3DDEVICE9VIDEO; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice9Video_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice9Video_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice9Video_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice9Video_GetContentProtectionCaps(p,a,b,c) (p)->lpVtbl->GetContentProtectionCaps(p,a,b,c) +#define IDirect3DDevice9Video_CreateAuthenticatedChannel(p,a,b,c) (p)->lpVtbl->CreateAuthenticatedChannel(p,a,b,c) +#define IDirect3DDevice9Video_CreateCryptoSession(p,a,b,c,d) (p)->lpVtbl->CreateCryptoSession(p,a,b,c,d) +#else +#define IDirect3DDevice9Video_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice9Video_AddRef(p) (p)->AddRef() +#define IDirect3DDevice9Video_Release(p) (p)->Release() +#define IDirect3DDevice9Video_GetContentProtectionCaps(p,a,b,c) (p)->GetContentProtectionCaps(a,b,c) +#define IDirect3DDevice9Video_CreateAuthenticatedChannel(p,a,b,c) (p)->CreateAuthenticatedChannel(a,b,c) +#define IDirect3DDevice9Video_CreateCryptoSession(p,a,b,c,d) (p)->CreateCryptoSession(a,b,c,d) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DAuthenticatedChannel9 + +DECLARE_INTERFACE_(IDirect3DAuthenticatedChannel9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DAuthenticatedChannel9 methods ***/ + STDMETHOD(GetCertificateSize)(THIS_ UINT* pCertificateSize) PURE; + STDMETHOD(GetCertificate)(THIS_ UINT CertifacteSize,BYTE* ppCertificate) PURE; + STDMETHOD(NegotiateKeyExchange)(THIS_ UINT DataSize,VOID* pData) PURE; + STDMETHOD(Query)(THIS_ UINT InputSize,CONST VOID* pInput,UINT OutputSize,VOID* pOutput) PURE; + STDMETHOD(Configure)(THIS_ UINT InputSize,CONST VOID* pInput,D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT* pOutput) PURE; +}; + +typedef struct IDirect3DAuthenticatedChannel9 *LPDIRECT3DAUTHENTICATEDCHANNEL9, *PDIRECT3DAUTHENTICATEDCHANNEL9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DAuthenticatedChannel9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DAuthenticatedChannel9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DAuthenticatedChannel9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DAuthenticatedChannel9_GetCertificateSize(p,a) (p)->lpVtbl->GetCertificateSize(p,a) +#define IDirect3DAuthenticatedChannel9_GetCertificate(p,a,b) (p)->lpVtbl->GetCertificate(p,a,b) +#define IDirect3DAuthenticatedChannel9_NegotiateKeyExchange(p,a,b) (p)->lpVtbl->NegotiateKeyExchange(p,a,b) +#define IDirect3DAuthenticatedChannel9_Query(p,a,b,c,d) (p)->lpVtbl->Query(p,a,b,c,d) +#define IDirect3DAuthenticatedChannel9_Configure(p,a,b,c) (p)->lpVtbl->Configure(p,a,b,c) +#else +#define IDirect3DAuthenticatedChannel9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DAuthenticatedChannel9_AddRef(p) (p)->AddRef() +#define IDirect3DAuthenticatedChannel9_Release(p) (p)->Release() +#define IDirect3DAuthenticatedChannel9_GetCertificateSize(p,a) (p)->GetCertificateSize(a) +#define IDirect3DAuthenticatedChannel9_GetCertificate(p,a,b) (p)->GetCertificate(a,b) +#define IDirect3DAuthenticatedChannel9_NegotiateKeyExchange(p,a,b) (p)->NegotiateKeyExchange(a,b) +#define IDirect3DAuthenticatedChannel9_Query(p,a,b,c,d) (p)->Query(a,b,c,d) +#define IDirect3DAuthenticatedChannel9_Configure(p,a,b,c) (p)->Configure(a,b,c) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DCryptoSession9 + +DECLARE_INTERFACE_(IDirect3DCryptoSession9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DCryptoSession9 methods ***/ + STDMETHOD(GetCertificateSize)(THIS_ UINT* pCertificateSize) PURE; + STDMETHOD(GetCertificate)(THIS_ UINT CertifacteSize,BYTE* ppCertificate) PURE; + STDMETHOD(NegotiateKeyExchange)(THIS_ UINT DataSize,VOID* pData) PURE; + STDMETHOD(EncryptionBlt)(THIS_ IDirect3DSurface9* pSrcSurface,IDirect3DSurface9* pDstSurface,UINT DstSurfaceSize,VOID* pIV) PURE; + STDMETHOD(DecryptionBlt)(THIS_ IDirect3DSurface9* pSrcSurface,IDirect3DSurface9* pDstSurface,UINT SrcSurfaceSize,D3DENCRYPTED_BLOCK_INFO* pEncryptedBlockInfo,VOID* pContentKey,VOID* pIV) PURE; + STDMETHOD(GetSurfacePitch)(THIS_ IDirect3DSurface9* pSrcSurface,UINT* pSurfacePitch) PURE; + STDMETHOD(StartSessionKeyRefresh)(THIS_ VOID* pRandomNumber,UINT RandomNumberSize) PURE; + STDMETHOD(FinishSessionKeyRefresh)(THIS) PURE; + STDMETHOD(GetEncryptionBltKey)(THIS_ VOID* pReadbackKey,UINT KeySize) PURE; +}; + +typedef struct IDirect3DCryptoSession9 *LPDIRECT3DCRYPTOSESSION9, *PDIRECT3DCRYPTOSESSION9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DCryptoSession9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DCryptoSession9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DCryptoSession9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DCryptoSession9_GetCertificateSize(p,a) (p)->lpVtbl->GetCertificateSize(p,a) +#define IDirect3DCryptoSession9_GetCertificate(p,a,b) (p)->lpVtbl->GetCertificate(p,a,b) +#define IDirect3DCryptoSession9_NegotiateKeyExchange(p,a,b) (p)->lpVtbl->NegotiateKeyExchange(p,a,b) +#define IDirect3DCryptoSession9_EncryptionBlt(p,a,b,c,d) (p)->lpVtbl->EncryptionBlt(p,a,b,c,d) +#define IDirect3DCryptoSession9_DecryptionBlt(p,a,b,c,d,e,f) (p)->lpVtbl->DecryptionBlt(p,a,b,c,d,e,f) +#define IDirect3DCryptoSession9_GetSurfacePitch(p,a,b) (p)->lpVtbl->GetSurfacePitch(p,a,b) +#define IDirect3DCryptoSession9_StartSessionKeyRefresh(p,a,b) (p)->lpVtbl->StartSessionKeyRefresh(p,a,b) +#define IDirect3DCryptoSession9_FinishSessionKeyRefresh(p) (p)->lpVtbl->FinishSessionKeyRefresh(p) +#define IDirect3DCryptoSession9_GetEncryptionBltKey(p,a,b) (p)->lpVtbl->GetEncryptionBltKey(p,a,b) +#else +#define IDirect3DCryptoSession9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DCryptoSession9_AddRef(p) (p)->AddRef() +#define IDirect3DCryptoSession9_Release(p) (p)->Release() +#define IDirect3DCryptoSession9_GetCertificateSize(p,a) (p)->GetCertificateSize(a) +#define IDirect3DCryptoSession9_GetCertificate(p,a,b) (p)->GetCertificate(a,b) +#define IDirect3DCryptoSession9_NegotiateKeyExchange(p,a,b) (p)->NegotiateKeyExchange(a,b) +#define IDirect3DCryptoSession9_EncryptionBlt(p,a,b,c,d) (p)->EncryptionBlt(a,b,c,d) +#define IDirect3DCryptoSession9_DecryptionBlt(p,a,b,c,d,e,f) (p)->DecryptionBlt(a,b,c,d,e,f) +#define IDirect3DCryptoSession9_GetSurfacePitch(p,a,b) (p)->GetSurfacePitch(a,b) +#define IDirect3DCryptoSession9_StartSessionKeyRefresh(p,a,b) (p)->StartSessionKeyRefresh(a,b) +#define IDirect3DCryptoSession9_FinishSessionKeyRefresh(p) (p)->FinishSessionKeyRefresh() +#define IDirect3DCryptoSession9_GetEncryptionBltKey(p,a,b) (p)->GetEncryptionBltKey(a,b) +#endif + +/* -- D3D9Ex only */ +#endif // !D3D_DISABLE_9EX + #ifdef __cplusplus }; diff --git a/RenderDll/Dx9Sdk/Include/d3d9caps.h b/RenderDll/Dx9Sdk/Include/d3d9caps.h index 6489f0e..c10c4cd 100644 --- a/RenderDll/Dx9Sdk/Include/d3d9caps.h +++ b/RenderDll/Dx9Sdk/Include/d3d9caps.h @@ -17,7 +17,7 @@ // include this file content only if compiling for DX9 interfaces #if(DIRECT3D_VERSION >= 0x0900) -#if defined(_X86_) || defined(_IA64) +#if defined(_X86_) || defined(_IA64_) #pragma pack(4) #endif @@ -65,6 +65,59 @@ typedef struct _D3DPSHADERCAPS2_0 #define D3DMIN30SHADERINSTRUCTIONS 512 #define D3DMAX30SHADERINSTRUCTIONS 32768 +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +typedef struct _D3DOVERLAYCAPS +{ + UINT Caps; + UINT MaxOverlayDisplayWidth; + UINT MaxOverlayDisplayHeight; +} D3DOVERLAYCAPS; + +#define D3DOVERLAYCAPS_FULLRANGERGB 0x00000001 +#define D3DOVERLAYCAPS_LIMITEDRANGERGB 0x00000002 +#define D3DOVERLAYCAPS_YCbCr_BT601 0x00000004 +#define D3DOVERLAYCAPS_YCbCr_BT709 0x00000008 +#define D3DOVERLAYCAPS_YCbCr_BT601_xvYCC 0x00000010 +#define D3DOVERLAYCAPS_YCbCr_BT709_xvYCC 0x00000020 +#define D3DOVERLAYCAPS_STRETCHX 0x00000040 +#define D3DOVERLAYCAPS_STRETCHY 0x00000080 + + +typedef struct _D3DCONTENTPROTECTIONCAPS +{ + DWORD Caps; + GUID KeyExchangeType; + UINT BufferAlignmentStart; + UINT BlockAlignmentSize; + ULONGLONG ProtectedMemorySize; +} D3DCONTENTPROTECTIONCAPS; + +#define D3DCPCAPS_SOFTWARE 0x00000001 +#define D3DCPCAPS_HARDWARE 0x00000002 +#define D3DCPCAPS_PROTECTIONALWAYSON 0x00000004 +#define D3DCPCAPS_PARTIALDECRYPTION 0x00000008 +#define D3DCPCAPS_CONTENTKEY 0x00000010 +#define D3DCPCAPS_FRESHENSESSIONKEY 0x00000020 +#define D3DCPCAPS_ENCRYPTEDREADBACK 0x00000040 +#define D3DCPCAPS_ENCRYPTEDREADBACKKEY 0x00000080 +#define D3DCPCAPS_SEQUENTIAL_CTR_IV 0x00000100 +#define D3DCPCAPS_ENCRYPTSLICEDATAONLY 0x00000200 + +DEFINE_GUID(D3DCRYPTOTYPE_AES128_CTR, +0x9b6bd711, 0x4f74, 0x41c9, 0x9e, 0x7b, 0xb, 0xe2, 0xd7, 0xd9, 0x3b, 0x4f); +DEFINE_GUID(D3DCRYPTOTYPE_PROPRIETARY, +0xab4e9afd, 0x1d1c, 0x46e6, 0xa7, 0x2f, 0x8, 0x69, 0x91, 0x7b, 0xd, 0xe8); + +DEFINE_GUID(D3DKEYEXCHANGE_RSAES_OAEP, +0xc1949895, 0xd72a, 0x4a1d, 0x8e, 0x5d, 0xed, 0x85, 0x7d, 0x17, 0x15, 0x20); +DEFINE_GUID(D3DKEYEXCHANGE_DXVA, +0x43d3775c, 0x38e5, 0x4924, 0x8d, 0x86, 0xd3, 0xfc, 0xcf, 0x15, 0x3e, 0x9b); + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + typedef struct _D3DCAPS9 { /* Device Info */ @@ -167,6 +220,7 @@ typedef struct _D3DCAPS9 // // Caps // +#define D3DCAPS_OVERLAY 0x00000800L #define D3DCAPS_READ_SCANLINE 0x00020000L // @@ -179,6 +233,14 @@ typedef struct _D3DCAPS9 #define D3DCAPS2_DYNAMICTEXTURES 0x20000000L #define D3DCAPS2_CANAUTOGENMIPMAP 0x40000000L +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DCAPS2_CANSHARERESOURCE 0x80000000L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + // // Caps3 // @@ -195,6 +257,7 @@ typedef struct _D3DCAPS9 #define D3DCAPS3_COPY_TO_VIDMEM 0x00000100L /* Device can acclerate copies from sysmem to local vidmem */ #define D3DCAPS3_COPY_TO_SYSTEMMEM 0x00000200L /* Device can acclerate copies from local vidmem to sysmem */ +#define D3DCAPS3_DXVAHD 0x00000400L // @@ -261,6 +324,15 @@ typedef struct _D3DCAPS9 #define D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING 0x00080000L /* Device supports post-pixel shader operations for MRT */ #define D3DPMISCCAPS_FOGVERTEXCLAMPED 0x00100000L /* Device clamps fog blend factor per vertex */ +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DPMISCCAPS_POSTBLENDSRGBCONVERT 0x00200000L /* Indicates device can perform conversion to sRGB after blending. */ + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + // // LineCaps // @@ -321,6 +393,16 @@ typedef struct _D3DCAPS9 #define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L #define D3DPBLENDCAPS_BLENDFACTOR 0x00002000L /* Supports both D3DBLEND_BLENDFACTOR and D3DBLEND_INVBLENDFACTOR */ +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DPBLENDCAPS_SRCCOLOR2 0x00004000L +#define D3DPBLENDCAPS_INVSRCCOLOR2 0x00008000L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + // // ShadeCaps // @@ -364,6 +446,15 @@ typedef struct _D3DCAPS9 #define D3DPTFILTERCAPS_MINFGAUSSIANQUAD 0x00001000L #define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */ #define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DPTFILTERCAPS_CONVOLUTIONMONO 0x00040000L /* Min and Mag for the convolution mono filter */ + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + #define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */ #define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L #define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L diff --git a/RenderDll/Dx9Sdk/Include/d3d9types.h b/RenderDll/Dx9Sdk/Include/d3d9types.h index 4c2108f..4dd3cfa 100644 --- a/RenderDll/Dx9Sdk/Include/d3d9types.h +++ b/RenderDll/Dx9Sdk/Include/d3d9types.h @@ -23,7 +23,7 @@ #pragma warning(push) #endif #pragma warning(disable:4201) // anonymous unions warning -#if defined(_X86_) || defined(_IA64) +#if defined(_X86_) || defined(_IA64_) #pragma pack(4) #endif @@ -224,6 +224,14 @@ typedef enum _D3DBLEND { D3DBLEND_BOTHINVSRCALPHA = 13, D3DBLEND_BLENDFACTOR = 14, /* Only supported if D3DPBLENDCAPS_BLENDFACTOR is on */ D3DBLEND_INVBLENDFACTOR = 15, /* Only supported if D3DPBLENDCAPS_BLENDFACTOR is on */ +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + D3DBLEND_SRCCOLOR2 = 16, + D3DBLEND_INVSRCCOLOR2 = 17, + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ } D3DBLEND; @@ -625,6 +633,13 @@ typedef enum _D3DTEXTUREFILTERTYPE D3DTEXF_ANISOTROPIC = 3, // anisotropic D3DTEXF_PYRAMIDALQUAD = 6, // 4-sample tent D3DTEXF_GAUSSIANQUAD = 7, // 4-sample gaussian +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + D3DTEXF_CONVOLUTIONMONO = 8, // Convolution filter for monochrome textures + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ D3DTEXF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum } D3DTEXTUREFILTERTYPE; @@ -1377,6 +1392,16 @@ typedef enum _D3DFORMAT D3DFMT_D32F_LOCKABLE = 82, D3DFMT_D24FS8 = 83, +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + /* Z-Stencil formats valid for CPU access */ + D3DFMT_D32_LOCKABLE = 84, + D3DFMT_S8_LOCKABLE = 85, + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + D3DFMT_L16 = 81, @@ -1402,6 +1427,22 @@ typedef enum _D3DFORMAT D3DFMT_CxV8U8 = 117, +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + // Monochrome 1 bit per pixel format + D3DFMT_A1 = 118, + + // 2.8 biased fixed point + D3DFMT_A2B10G10R10_XR_BIAS = 119, + + + // Binary format indicating that the data has no inherent type + D3DFMT_BINARYBUFFER = 199, + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + D3DFMT_FORCE_DWORD =0x7fffffff } D3DFORMAT; @@ -1432,6 +1473,13 @@ typedef enum _D3DSWAPEFFECT D3DSWAPEFFECT_FLIP = 2, D3DSWAPEFFECT_COPY = 3, +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + D3DSWAPEFFECT_OVERLAY = 4, + D3DSWAPEFFECT_FLIPEX = 5, +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + D3DSWAPEFFECT_FORCE_DWORD = 0x7fffffff } D3DSWAPEFFECT; @@ -1480,6 +1528,20 @@ typedef struct _D3DPRESENT_PARAMETERS_ #define D3DPRESENTFLAG_DEVICECLIP 0x00000004 #define D3DPRESENTFLAG_VIDEO 0x00000010 +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DPRESENTFLAG_NOAUTOROTATE 0x00000020 +#define D3DPRESENTFLAG_UNPRUNEDMODE 0x00000040 +#define D3DPRESENTFLAG_OVERLAY_LIMITEDRGB 0x00000080 +#define D3DPRESENTFLAG_OVERLAY_YCbCr_BT709 0x00000100 +#define D3DPRESENTFLAG_OVERLAY_YCbCr_xvYCC 0x00000200 +#define D3DPRESENTFLAG_RESTRICTED_CONTENT 0x00000400 +#define D3DPRESENTFLAG_RESTRICT_SHARED_RESOURCE_DRIVER 0x00000800 + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + /* Gamma Ramp: Same as DX7 */ typedef struct _D3DGAMMARAMP @@ -1508,7 +1570,7 @@ typedef enum _D3DRESOURCETYPE { D3DRTYPE_VOLUMETEXTURE = 4, D3DRTYPE_CUBETEXTURE = 5, D3DRTYPE_VERTEXBUFFER = 6, - D3DRTYPE_INDEXBUFFER = 7, + D3DRTYPE_INDEXBUFFER = 7, //if this changes, change _D3DDEVINFO_RESOURCEMANAGER definition D3DRTYPE_FORCE_DWORD = 0x7fffffff @@ -1519,6 +1581,14 @@ typedef enum _D3DRESOURCETYPE { #define D3DUSAGE_DEPTHSTENCIL (0x00000002L) #define D3DUSAGE_DYNAMIC (0x00000200L) +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DUSAGE_NONSECURE (0x00800000L) + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + // When passed to CheckDeviceFormat, D3DUSAGE_AUTOGENMIPMAP may return // D3DOK_NOAUTOGEN if the device doesn't support autogeneration for that format. // D3DOK_NOAUTOGEN is a success code, not a failure code... the SUCCEEDED and FAILED macros @@ -1543,6 +1613,23 @@ typedef enum _D3DRESOURCETYPE { #define D3DUSAGE_RTPATCHES (0x00000080L) #define D3DUSAGE_NPATCHES (0x00000100L) +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DUSAGE_TEXTAPI (0x10000000L) +#define D3DUSAGE_RESTRICTED_CONTENT (0x00000800L) +#define D3DUSAGE_RESTRICT_SHARED_RESOURCE (0x00002000L) +#define D3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER (0x00001000L) + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + + + + + + @@ -1756,6 +1843,10 @@ typedef enum _D3DQUERYTYPE { D3DQUERYTYPE_PIXELTIMINGS = 16, /* D3DISSUE_BEGIN, D3DISSUE_END */ D3DQUERYTYPE_BANDWIDTHTIMINGS = 17, /* D3DISSUE_BEGIN, D3DISSUE_END */ D3DQUERYTYPE_CACHEUTILIZATION = 18, /* D3DISSUE_BEGIN, D3DISSUE_END */ +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + D3DQUERYTYPE_MEMORYPRESSURE = 19, /* D3DISSUE_BEGIN, D3DISSUE_END */ +#endif // !D3D_DISABLE_9EX } D3DQUERYTYPE; // Flags field for Issue @@ -1788,7 +1879,11 @@ typedef struct _D3DRESOURCESTATS typedef struct _D3DDEVINFO_RESOURCEMANAGER { +#ifndef WOW64_ENUM_WORKAROUND D3DRESOURCESTATS stats[D3DRTYPECOUNT]; +#else + D3DRESOURCESTATS stats[8]; +#endif } D3DDEVINFO_RESOURCEMANAGER, *LPD3DDEVINFO_RESOURCEMANAGER; typedef struct _D3DDEVINFO_D3DVERTEXSTATS @@ -1799,7 +1894,7 @@ typedef struct _D3DDEVINFO_D3DVERTEXSTATS typedef struct _D3DDEVINFO_VCACHE { - DWORD Pattern; /* bit pattern, return value must be FOUR_CC(‘C’, ‘A’, ‘C’, ‘H’) */ + DWORD Pattern; /* bit pattern, return value must be FOUR_CC('C', 'A', 'C', 'H') */ DWORD OptMethod; /* optimization method 0 means longest strips, 1 means vertex cache based */ DWORD CacheSize; /* cache size to optimize for (only required if type is 1) */ DWORD MagicNumber; /* used to determine when to restart strips (only required if type is 1)*/ @@ -1843,6 +1938,472 @@ typedef struct _D3DDEVINFO_D3D9CACHEUTILIZATION FLOAT PostTransformVertexCacheHitRate; } D3DDEVINFO_D3D9CACHEUTILIZATION; +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +typedef struct _D3DMEMORYPRESSURE +{ + UINT64 BytesEvictedFromProcess; + UINT64 SizeOfInefficientAllocation; + DWORD LevelOfEfficiency; +} D3DMEMORYPRESSURE; + +typedef enum _D3DCOMPOSERECTSOP{ + D3DCOMPOSERECTS_COPY = 1, + D3DCOMPOSERECTS_OR = 2, + D3DCOMPOSERECTS_AND = 3, + D3DCOMPOSERECTS_NEG = 4, + D3DCOMPOSERECTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DCOMPOSERECTSOP; + +typedef struct _D3DCOMPOSERECTDESC +{ + USHORT X, Y; // Top-left coordinates of a rect in the source surface + USHORT Width, Height; // Dimensions of the rect +} D3DCOMPOSERECTDESC; + +typedef struct _D3DCOMPOSERECTDESTINATION +{ + USHORT SrcRectIndex; // Index of D3DCOMPOSERECTDESC + USHORT Reserved; // For alignment + SHORT X, Y; // Top-left coordinates of the rect in the destination surface +} D3DCOMPOSERECTDESTINATION; + +#define D3DCOMPOSERECTS_MAXNUMRECTS 0xFFFF +#define D3DCONVOLUTIONMONO_MAXWIDTH 7 +#define D3DCONVOLUTIONMONO_MAXHEIGHT D3DCONVOLUTIONMONO_MAXWIDTH +#define D3DFMT_A1_SURFACE_MAXWIDTH 8192 +#define D3DFMT_A1_SURFACE_MAXHEIGHT 2048 + + +typedef struct _D3DPRESENTSTATS { + UINT PresentCount; + UINT PresentRefreshCount; + UINT SyncRefreshCount; + LARGE_INTEGER SyncQPCTime; + LARGE_INTEGER SyncGPUTime; +} D3DPRESENTSTATS; + +typedef enum D3DSCANLINEORDERING +{ + D3DSCANLINEORDERING_UNKNOWN = 0, + D3DSCANLINEORDERING_PROGRESSIVE = 1, + D3DSCANLINEORDERING_INTERLACED = 2, +} D3DSCANLINEORDERING; + + +typedef struct D3DDISPLAYMODEEX +{ + UINT Size; + UINT Width; + UINT Height; + UINT RefreshRate; + D3DFORMAT Format; + D3DSCANLINEORDERING ScanLineOrdering; +} D3DDISPLAYMODEEX; + +typedef struct D3DDISPLAYMODEFILTER +{ + UINT Size; + D3DFORMAT Format; + D3DSCANLINEORDERING ScanLineOrdering; +} D3DDISPLAYMODEFILTER; + + +typedef enum D3DDISPLAYROTATION +{ + D3DDISPLAYROTATION_IDENTITY = 1, // No rotation. + D3DDISPLAYROTATION_90 = 2, // Rotated 90 degrees. + D3DDISPLAYROTATION_180 = 3, // Rotated 180 degrees. + D3DDISPLAYROTATION_270 = 4 // Rotated 270 degrees. +} D3DDISPLAYROTATION; + +/* For use in ID3DResource9::SetPriority calls */ +#define D3D9_RESOURCE_PRIORITY_MINIMUM 0x28000000 +#define D3D9_RESOURCE_PRIORITY_LOW 0x50000000 +#define D3D9_RESOURCE_PRIORITY_NORMAL 0x78000000 +#define D3D9_RESOURCE_PRIORITY_HIGH 0xa0000000 +#define D3D9_RESOURCE_PRIORITY_MAXIMUM 0xc8000000 + +#define D3D_OMAC_SIZE 16 + +typedef struct _D3D_OMAC +{ + BYTE Omac[D3D_OMAC_SIZE]; +} D3D_OMAC; + +typedef enum _D3DAUTHENTICATEDCHANNELTYPE +{ + D3DAUTHENTICATEDCHANNEL_D3D9 = 1, + D3DAUTHENTICATEDCHANNEL_DRIVER_SOFTWARE = 2, + D3DAUTHENTICATEDCHANNEL_DRIVER_HARDWARE = 3, +} D3DAUTHENTICATEDCHANNELTYPE; + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERY_INPUT +{ + GUID QueryType; + HANDLE hChannel; + UINT SequenceNumber; +} D3DAUTHENTICATEDCHANNEL_QUERY_INPUT; + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT +{ + D3D_OMAC omac; + GUID QueryType; + HANDLE hChannel; + UINT SequenceNumber; + HRESULT ReturnCode; +} D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT; + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_PROTECTION, +0xa84eb584, 0xc495, 0x48aa, 0xb9, 0x4d, 0x8b, 0xd2, 0xd6, 0xfb, 0xce, 0x5); + +typedef struct _D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS +{ + union + { + struct + { + UINT ProtectionEnabled : 1; + UINT OverlayOrFullscreenRequired : 1; + UINT Reserved : 30; + }; + UINT Value; + }; + +} D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS; + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYPROTECTION_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS ProtectionFlags; + +} D3DAUTHENTICATEDCHANNEL_QUERYPROTECTION_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_CHANNELTYPE, +0xbc1b18a5, 0xb1fb, 0x42ab, 0xbd, 0x94, 0xb5, 0x82, 0x8b, 0x4b, 0xf7, 0xbe); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYCHANNELTYPE_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + D3DAUTHENTICATEDCHANNELTYPE ChannelType; + +} D3DAUTHENTICATEDCHANNEL_QUERYCHANNELTYPE_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_DEVICEHANDLE, +0xec1c539d, 0x8cff, 0x4e2a, 0xbc, 0xc4, 0xf5, 0x69, 0x2f, 0x99, 0xf4, 0x80); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYDEVICEHANDLE_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + HANDLE DeviceHandle; + +} D3DAUTHENTICATEDCHANNEL_QUERYDEVICEHANDLE_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_CRYPTOSESSION, +0x2634499e, 0xd018, 0x4d74, 0xac, 0x17, 0x7f, 0x72, 0x40, 0x59, 0x52, 0x8d); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYCRYPTOSESSION_INPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_INPUT Input; + + HANDLE DXVA2DecodeHandle; + +} D3DAUTHENTICATEDCHANNEL_QUERYCRYPTOSESSION_INPUT; + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYCRYPTOSESSION_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + HANDLE DXVA2DecodeHandle; + HANDLE CryptoSessionHandle; + HANDLE DeviceHandle; + +} D3DAUTHENTICATEDCHANNEL_QUERYCRYPTOSESSION_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_RESTRICTEDSHAREDRESOURCEPROCESSCOUNT, +0xdb207b3, 0x9450, 0x46a6, 0x82, 0xde, 0x1b, 0x96, 0xd4, 0x4f, 0x9c, 0xf2); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESSCOUNT_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + UINT NumRestrictedSharedResourceProcesses; + +} D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESSCOUNT_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_RESTRICTEDSHAREDRESOURCEPROCESS, +0x649bbadb, 0xf0f4, 0x4639, 0xa1, 0x5b, 0x24, 0x39, 0x3f, 0xc3, 0xab, 0xac); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESS_INPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_INPUT Input; + + UINT ProcessIndex; + +} D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESS_INPUT; + +typedef enum _D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE +{ + PROCESSIDTYPE_UNKNOWN = 0, + PROCESSIDTYPE_DWM = 1, + PROCESSIDTYPE_HANDLE = 2 +} D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE; + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESS_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + UINT ProcessIndex; + D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE ProcessIdentifer; + HANDLE ProcessHandle; + +} D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESS_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_UNRESTRICTEDPROTECTEDSHAREDRESOURCECOUNT, +0x12f0bd6, 0xe662, 0x4474, 0xbe, 0xfd, 0xaa, 0x53, 0xe5, 0x14, 0x3c, 0x6d); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYUNRESTRICTEDPROTECTEDSHAREDRESOURCECOUNT_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + UINT NumUnrestrictedProtectedSharedResources; + +} D3DAUTHENTICATEDCHANNEL_QUERYUNRESTRICTEDPROTECTEDSHAREDRESOURCECOUNT_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_OUTPUTIDCOUNT, +0x2c042b5e, 0x8c07, 0x46d5, 0xaa, 0xbe, 0x8f, 0x75, 0xcb, 0xad, 0x4c, 0x31); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTIDCOUNT_INPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_INPUT Input; + + HANDLE DeviceHandle; + HANDLE CryptoSessionHandle; + +} D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTIDCOUNT_INPUT; + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTIDCOUNT_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + HANDLE DeviceHandle; + HANDLE CryptoSessionHandle; + UINT NumOutputIDs; + +} D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTIDCOUNT_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_OUTPUTID, +0x839ddca3, 0x9b4e, 0x41e4, 0xb0, 0x53, 0x89, 0x2b, 0xd2, 0xa1, 0x1e, 0xe7); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTID_INPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_INPUT Input; + + HANDLE DeviceHandle; + HANDLE CryptoSessionHandle; + UINT OutputIDIndex; + +} D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTID_INPUT; + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTID_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + HANDLE DeviceHandle; + HANDLE CryptoSessionHandle; + UINT OutputIDIndex; + UINT64 OutputID; + +} D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTID_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_ACCESSIBILITYATTRIBUTES, +0x6214d9d2, 0x432c, 0x4abb, 0x9f, 0xce, 0x21, 0x6e, 0xea, 0x26, 0x9e, 0x3b); + +typedef enum _D3DBUSTYPE +{ + D3DBUSTYPE_OTHER = 0x00000000, + D3DBUSTYPE_PCI = 0x00000001, + D3DBUSTYPE_PCIX = 0x00000002, + D3DBUSTYPE_PCIEXPRESS = 0x00000003, + D3DBUSTYPE_AGP = 0x00000004, + D3DBUSIMPL_MODIFIER_INSIDE_OF_CHIPSET = 0x00010000, + D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP = 0x00020000, + D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET = 0x00030000, + D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR = 0x00040000, + D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE = 0x00050000, + D3DBUSIMPL_MODIFIER_NON_STANDARD = 0x80000000, +} D3DBUSTYPE; + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYINFOBUSTYPE_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + D3DBUSTYPE BusType; + BOOL bAccessibleInContiguousBlocks; + BOOL bAccessibleInNonContiguousBlocks; + +} D3DAUTHENTICATEDCHANNEL_QUERYINFOBUSTYPE_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_ENCRYPTIONWHENACCESSIBLEGUIDCOUNT, +0xb30f7066, 0x203c, 0x4b07, 0x93, 0xfc, 0xce, 0xaa, 0xfd, 0x61, 0x24, 0x1e); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUIDCOUNT_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + UINT NumEncryptionGuids; + +} D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUIDCOUNT_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_ENCRYPTIONWHENACCESSIBLEGUID, +0xf83a5958, 0xe986, 0x4bda, 0xbe, 0xb0, 0x41, 0x1f, 0x6a, 0x7a, 0x1, 0xb7); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUID_INPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_INPUT Input; + + UINT EncryptionGuidIndex; + +} D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUID_INPUT; + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUID_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + UINT EncryptionGuidIndex; + GUID EncryptionGuid; + +} D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUID_OUTPUT; + + +DEFINE_GUID(D3DAUTHENTICATEDQUERY_CURRENTENCRYPTIONWHENACCESSIBLE, +0xec1791c7, 0xdad3, 0x4f15, 0x9e, 0xc3, 0xfa, 0xa9, 0x3d, 0x60, 0xd4, 0xf0); + +typedef struct _D3DAUTHENTICATEDCHANNEL_QUERYUNCOMPRESSEDENCRYPTIONLEVEL_OUTPUT +{ + D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT Output; + + GUID EncryptionGuid; + +} D3DAUTHENTICATEDCHANNEL_QUERYUNCOMPRESSEDENCRYPTIONLEVEL_OUTPUT; + + +typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT +{ + D3D_OMAC omac; + GUID ConfigureType; + HANDLE hChannel; + UINT SequenceNumber; + +} D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT; + +typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT +{ + D3D_OMAC omac; + GUID ConfigureType; + HANDLE hChannel; + UINT SequenceNumber; + HRESULT ReturnCode; + +} D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT; + +DEFINE_GUID(D3DAUTHENTICATEDCONFIGURE_INITIALIZE, +0x6114bdb, 0x3523, 0x470a, 0x8d, 0xca, 0xfb, 0xc2, 0x84, 0x51, 0x54, 0xf0); + +typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGUREINITIALIZE +{ + D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters; + + UINT StartSequenceQuery; + UINT StartSequenceConfigure; + +} D3DAUTHENTICATEDCHANNEL_CONFIGUREINITIALIZE; + + +DEFINE_GUID(D3DAUTHENTICATEDCONFIGURE_PROTECTION, +0x50455658, 0x3f47, 0x4362, 0xbf, 0x99, 0xbf, 0xdf, 0xcd, 0xe9, 0xed, 0x29); + +typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION +{ + D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters; + + D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS Protections; + +} D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION; + + +DEFINE_GUID(D3DAUTHENTICATEDCONFIGURE_CRYPTOSESSION, +0x6346cc54, 0x2cfc, 0x4ad4, 0x82, 0x24, 0xd1, 0x58, 0x37, 0xde, 0x77, 0x0); + +typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGURECRYPTOSESSION +{ + D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters; + + HANDLE DXVA2DecodeHandle; + HANDLE CryptoSessionHandle; + HANDLE DeviceHandle; + +} D3DAUTHENTICATEDCHANNEL_CONFIGURECRYPTOSESSION; + + +DEFINE_GUID(D3DAUTHENTICATEDCONFIGURE_SHAREDRESOURCE, +0x772d047, 0x1b40, 0x48e8, 0x9c, 0xa6, 0xb5, 0xf5, 0x10, 0xde, 0x9f, 0x1); + +typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGURESHAREDRESOURCE +{ + D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters; + + D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE ProcessIdentiferType; + HANDLE ProcessHandle; + BOOL AllowAccess; + +} D3DAUTHENTICATEDCHANNEL_CONFIGURESHAREDRESOURCE; + + +DEFINE_GUID(D3DAUTHENTICATEDCONFIGURE_ENCRYPTIONWHENACCESSIBLE, +0x41fff286, 0x6ae0, 0x4d43, 0x9d, 0x55, 0xa4, 0x6e, 0x9e, 0xfd, 0x15, 0x8a); + +typedef struct _D3DAUTHENTICATEDCHANNEL_CONFIGUREUNCOMPRESSEDENCRYPTION +{ + D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters; + + GUID EncryptionGuid; + +} D3DAUTHENTICATEDCHANNEL_CONFIGUREUNCOMPRESSEDENCRYPTION; + +typedef struct _D3DENCRYPTED_BLOCK_INFO +{ + UINT NumEncryptedBytesAtBeginning; + UINT NumBytesInSkipPattern; + UINT NumBytesInEncryptPattern; +} D3DENCRYPTED_BLOCK_INFO; + +typedef struct _D3DAES_CTR_IV +{ + UINT64 IV; // Big-Endian IV + UINT64 Count; // Big-Endian Block Count +} D3DAES_CTR_IV; + + + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + #pragma pack() #if _MSC_VER >= 1200 #pragma warning(pop) diff --git a/RenderDll/Dx9Sdk/Include/d3dx10async.h b/RenderDll/Dx9Sdk/Include/d3dx10async.h new file mode 100644 index 0000000..d1b1fc5 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/d3dx10async.h @@ -0,0 +1,290 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3DX10Async.h +// Content: D3DX10 Asynchronous Effect / Shader loaders / compilers +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DX10ASYNC_H__ +#define __D3DX10ASYNC_H__ + +#include "d3dx10.h" + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//---------------------------------------------------------------------------- +// D3DX10Compile: +// ------------------ +// Compiles an effect or shader. +// +// Parameters: +// pSrcFile +// Source file name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module. +// pSrcData +// Pointer to source code. +// SrcDataLen +// Size of source code, in bytes. +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pFunctionName +// Name of the entrypoint function where execution should begin. +// pProfile +// Instruction set to be used when generating code. Currently supported +// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0", +// "vs_3_sw", "vs_4_0", "vs_4_1", +// "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0", +// "ps_3_sw", "ps_4_0", "ps_4_1", +// "gs_4_0", "gs_4_1", +// "tx_1_0", +// "fx_4_0", "fx_4_1" +// Note that this entrypoint does not compile fx_2_0 targets, for that +// you need to use the D3DX9 function. +// Flags1 +// See D3D10_SHADER_xxx flags. +// Flags2 +// See D3D10_EFFECT_xxx flags. +// ppShader +// Returns a buffer containing the created shader. This buffer contains +// the compiled shader code, as well as any embedded debug and symbol +// table info. (See D3D10GetShaderConstantTable) +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during the compile. If you are running in a debugger, +// these are the same messages you will see in your debug output. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX10CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CompileFromFile D3DX10CompileFromFileW +#else +#define D3DX10CompileFromFile D3DX10CompileFromFileA +#endif + +HRESULT WINAPI D3DX10CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CompileFromResource D3DX10CompileFromResourceW +#else +#define D3DX10CompileFromResource D3DX10CompileFromResourceA +#endif + +HRESULT WINAPI D3DX10CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +//---------------------------------------------------------------------------- +// D3DX10CreateEffectFromXXXX: +// -------------------------- +// Creates an effect from a binary effect or file +// +// Parameters: +// +// [in] +// +// +// pFileName +// Name of the ASCII (uncompiled) or binary (compiled) Effect file to load +// +// hModule +// Handle to the module containing the resource to compile from +// pResourceName +// Name of the resource within hModule to compile from +// +// pData +// Blob of effect data, either ASCII (uncompiled) or binary (compiled) +// DataLength +// Length of the data blob +// +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pProfile +// Profile to use when compiling the effect. +// HLSLFlags +// Compilation flags pertaining to shaders and data types, honored by +// the HLSL compiler +// FXFlags +// Compilation flags pertaining to Effect compilation, honored +// by the Effect compiler +// pDevice +// Pointer to the D3D10 device on which to create Effect resources +// pEffectPool +// Pointer to an Effect pool to share variables with or NULL +// +// [out] +// +// ppEffect +// Address of the newly created Effect interface +// ppEffectPool +// Address of the newly created Effect pool interface +// ppErrors +// If non-NULL, address of a buffer with error messages that occurred +// during parsing or compilation +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +//---------------------------------------------------------------------------- + + +HRESULT WINAPI D3DX10CreateEffectFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult); + + +#ifdef UNICODE +#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileW +#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceW +#else +#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileA +#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceA +#endif + +HRESULT WINAPI D3DX10CreateEffectPoolFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump, + ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectPoolFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump, + ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectPoolFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectPoolFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileW +#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceW +#else +#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileA +#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceA +#endif + +HRESULT WINAPI D3DX10PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileW +#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceW +#else +#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileA +#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceA +#endif + +//---------------------------------------------------------------------------- +// Async processors +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX10CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, + ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor); + +HRESULT WINAPI D3DX10CreateAsyncEffectCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pPool, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor); + +HRESULT WINAPI D3DX10CreateAsyncEffectPoolCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor); + +HRESULT WINAPI D3DX10CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor); + + + +//---------------------------------------------------------------------------- +// D3DX10 Asynchronous texture I/O (advanced mode) +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX10CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX10DataLoader **ppDataLoader); +HRESULT WINAPI D3DX10CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX10DataLoader **ppDataLoader); +HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX10DataLoader **ppDataLoader); +HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX10DataLoader **ppDataLoader); +HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX10DataLoader **ppDataLoader); + +#ifdef UNICODE +#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderW +#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderW +#else +#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderA +#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderA +#endif + +HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor); +HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *pImageInfo, ID3DX10DataProcessor **ppDataProcessor); +HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX10ASYNC_H__ + + diff --git a/RenderDll/Dx9Sdk/Include/d3dx9.h b/RenderDll/Dx9Sdk/Include/d3dx9.h index 822f0a8..43f9e62 100644 --- a/RenderDll/Dx9Sdk/Include/d3dx9.h +++ b/RenderDll/Dx9Sdk/Include/d3dx9.h @@ -50,11 +50,13 @@ #include "d3dx9mesh.h" #include "d3dx9shader.h" #include "d3dx9effect.h" + #include "d3dx9tex.h" #include "d3dx9shape.h" #include "d3dx9anim.h" + // Errors #define _FACDD 0x876 #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) diff --git a/RenderDll/Dx9Sdk/Include/d3dx9core.h b/RenderDll/Dx9Sdk/Include/d3dx9core.h index bc65377..45243f4 100644 --- a/RenderDll/Dx9Sdk/Include/d3dx9core.h +++ b/RenderDll/Dx9Sdk/Include/d3dx9core.h @@ -20,11 +20,12 @@ // application was built against the correct header files and lib files. // This number is incremented whenever a header (or other) change would // require applications to be rebuilt. If the version doesn't match, -// D3DXCreateVersion will return FALSE. (The number itself has no meaning.) +// D3DXCheckVersion will return FALSE. (The number itself has no meaning.) /////////////////////////////////////////////////////////////////////////// #define D3DX_VERSION 0x0902 -#define D3DX_SDK_VERSION 22 + +#define D3DX_SDK_VERSION 43 #ifdef __cplusplus extern "C" { @@ -39,6 +40,26 @@ BOOL WINAPI +/////////////////////////////////////////////////////////////////////////// +// D3DXDebugMute +// Mutes D3DX and D3D debug spew (TRUE - mute, FALSE - not mute) +// +// returns previous mute value +// +/////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +BOOL WINAPI + D3DXDebugMute(BOOL Mute); + +#ifdef __cplusplus +} +#endif //__cplusplus + + /////////////////////////////////////////////////////////////////////////// // D3DXGetDriverLevel: // Returns driver version information: @@ -126,6 +147,9 @@ DECLARE_INTERFACE_(ID3DXBuffer, IUnknown) // D3DXSPRITE_SORT_DEPTH_BACKTOFRONT // Sprites are sorted by depth back-to-front prior to drawing. This is // recommended when drawing transparent sprites of varying depths. +// D3DXSPRITE_DO_NOT_ADDREF_TEXTURE +// Disables calling AddRef() on every draw, and Release() on Flush() for +// better performance. ////////////////////////////////////////////////////////////////////////////// #define D3DXSPRITE_DONOTSAVESTATE (1 << 0) @@ -136,6 +160,7 @@ DECLARE_INTERFACE_(ID3DXBuffer, IUnknown) #define D3DXSPRITE_SORT_TEXTURE (1 << 5) #define D3DXSPRITE_SORT_DEPTH_FRONTTOBACK (1 << 6) #define D3DXSPRITE_SORT_DEPTH_BACKTOFRONT (1 << 7) +#define D3DXSPRITE_DO_NOT_ADDREF_TEXTURE (1 << 8) ////////////////////////////////////////////////////////////////////////////// diff --git a/RenderDll/Dx9Sdk/Include/d3dx9effect.h b/RenderDll/Dx9Sdk/Include/d3dx9effect.h index 3359a1d..a3bcd30 100644 --- a/RenderDll/Dx9Sdk/Include/d3dx9effect.h +++ b/RenderDll/Dx9Sdk/Include/d3dx9effect.h @@ -25,12 +25,20 @@ // D3DXFX_DONOTSAVESAMPLERSTATE // This flag is used as a parameter to ID3DXEffect::Begin(). When this flag // is specified, sampler device state is not saved or restored in Begin/End. +// D3DXFX_NOT_CLONEABLE +// This flag is used as a parameter to the D3DXCreateEffect family of APIs. +// When this flag is specified, the effect will be non-cloneable and will not +// contain any shader binary data. +// Furthermore, GetPassDesc will not return shader function pointers. +// Setting this flag reduces effect memory usage by about 50%. //---------------------------------------------------------------------------- #define D3DXFX_DONOTSAVESTATE (1 << 0) #define D3DXFX_DONOTSAVESHADERSTATE (1 << 1) #define D3DXFX_DONOTSAVESAMPLERSTATE (1 << 2) +#define D3DXFX_NOT_CLONEABLE (1 << 11) +#define D3DXFX_LARGEADDRESSAWARE (1 << 17) //---------------------------------------------------------------------------- // D3DX_PARAMETER_SHARED @@ -49,7 +57,6 @@ #define D3DX_PARAMETER_LITERAL (1 << 1) #define D3DX_PARAMETER_ANNOTATION (1 << 2) - //---------------------------------------------------------------------------- // D3DXEFFECT_DESC: //---------------------------------------------------------------------------- @@ -159,9 +166,9 @@ DECLARE_INTERFACE_(ID3DXEffectPool, IUnknown) typedef interface ID3DXBaseEffect ID3DXBaseEffect; typedef interface ID3DXBaseEffect *LPD3DXBASEEFFECT; -// {3B7A6FFB-3A69-46d7-BC01-A6B2AD4C2BB0} +// {017C18AC-103F-4417-8C51-6BF6EF1E56BE} DEFINE_GUID(IID_ID3DXBaseEffect, -0x3b7a6ffb, 0x3a69, 0x46d7, 0xbc, 0x1, 0xa6, 0xb2, 0xad, 0x4c, 0x2b, 0xb0); +0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0xf6, 0xef, 0x1e, 0x56, 0xbe); #undef INTERFACE @@ -230,9 +237,7 @@ DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown) STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; - STDMETHOD(SetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 pPShader) PURE; STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; - STDMETHOD(SetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 pVShader) PURE; STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; //Set Range of an Array to pass to device @@ -303,9 +308,9 @@ DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown) typedef interface ID3DXEffect ID3DXEffect; typedef interface ID3DXEffect *LPD3DXEFFECT; -// {0F0DCC9F-6152-4117-A933-FFAC29C43AA4} +// {F6CEB4B3-4E4C-40dd-B883-8D8DE5EA0CD5} DEFINE_GUID(IID_ID3DXEffect, -0xf0dcc9f, 0x6152, 0x4117, 0xa9, 0x33, 0xff, 0xac, 0x29, 0xc4, 0x3a, 0xa4); +0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5); #undef INTERFACE #define INTERFACE ID3DXEffect @@ -373,9 +378,7 @@ DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect) STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; - STDMETHOD(SetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 pPShader) PURE; STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; - STDMETHOD(SetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 pVShader) PURE; STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; //Set Range of an Array to pass to device @@ -420,9 +423,13 @@ DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect) STDMETHOD(BeginParameterBlock)(THIS) PURE; STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE; STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE; + STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE; // Cloning STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE9 pDevice, LPD3DXEFFECT* ppEffect) PURE; + + // Fast path for setting variables directly in ID3DXEffect + STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT ByteOffset, UINT Bytes) PURE; }; @@ -433,9 +440,9 @@ DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect) typedef interface ID3DXEffectCompiler ID3DXEffectCompiler; typedef interface ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER; -// {15A709EB-5A8E-40a0-86A9-0C024124339B} +// {51B8A949-1A31-47e6-BEA0-4B30DB53F1E0} DEFINE_GUID(IID_ID3DXEffectCompiler, -0x15a709eb, 0x5a8e, 0x40a0, 0x86, 0xa9, 0xc, 0x2, 0x41, 0x24, 0x33, 0x9b); +0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4b, 0x30, 0xdb, 0x53, 0xf1, 0xe0); #undef INTERFACE @@ -504,9 +511,7 @@ DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect) STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; - STDMETHOD(SetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 pPShader) PURE; STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; - STDMETHOD(SetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 pVShader) PURE; STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; //Set Range of an Array to pass to device @@ -573,6 +578,14 @@ HRESULT WINAPI // Size of the effect description in bytes // pDefines // Optional NULL-terminated array of preprocessor macro definitions. +// Flags +// See D3DXSHADER_xxx flags. +// pSkipConstants +// A list of semi-colon delimited variable names. The effect will +// not set these variables to the device when they are referenced +// by a shader. NOTE: the variables specified here must be +// register bound in the file and must not be used in expressions +// in passes or samplers or the file will not load. // pInclude // Optional interface pointer to use for handling #include directives. // If this parameter is NULL, #includes will be honored when compiling @@ -660,7 +673,86 @@ HRESULT WINAPI LPD3DXEFFECT* ppEffect, LPD3DXBUFFER* ppCompilationErrors); +// +// Ex functions that accept pSkipConstants in addition to other parameters +// + +HRESULT WINAPI + D3DXCreateEffectFromFileExA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +HRESULT WINAPI + D3DXCreateEffectFromFileExW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +#ifdef UNICODE +#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExW +#else +#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExA +#endif + + +HRESULT WINAPI + D3DXCreateEffectFromResourceExA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +HRESULT WINAPI + D3DXCreateEffectFromResourceExW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +#ifdef UNICODE +#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExW +#else +#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExA +#endif + +HRESULT WINAPI + D3DXCreateEffectEx( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); //---------------------------------------------------------------------------- // D3DXCreateEffectCompiler: diff --git a/RenderDll/Dx9Sdk/Include/d3dx9math.h b/RenderDll/Dx9Sdk/Include/d3dx9math.h index 2ba4a60..3fda053 100644 --- a/RenderDll/Dx9Sdk/Include/d3dx9math.h +++ b/RenderDll/Dx9Sdk/Include/d3dx9math.h @@ -47,7 +47,7 @@ #define D3DX_16F_MAX_EXP 15 // max binary exponent #define D3DX_16F_MIN 6.1035156e-5f // min positive value #define D3DX_16F_MIN_10_EXP (-4) // min decimal exponent -#define D3DX_16F_MIN_EXP (-12) // min binary exponent +#define D3DX_16F_MIN_EXP (-14) // min binary exponent #define D3DX_16F_RADIX 2 // exponent radix #define D3DX_16F_ROUNDS 1 // addition rounding: near @@ -1565,6 +1565,37 @@ FLOAT* WINAPI D3DXSHScale FLOAT WINAPI D3DXSHDot ( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); +//============================================================================ +// +// D3DXSHMultiply[O]: +// -------------------- +// Computes the product of two functions represented using SH (f and g), where: +// pOut[i] = int(y_i(s) * f(s) * g(s)), where y_i(s) is the ith SH basis +// function, f(s) and g(s) are SH functions (sum_i(y_i(s)*c_i)). The order O +// determines the lengths of the arrays, where there should always be O^2 +// coefficients. In general the product of two SH functions of order O generates +// and SH function of order 2*O - 1, but we truncate the result. This means +// that the product commutes (f*g == g*f) but doesn't associate +// (f*(g*h) != (f*g)*h. +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// pF +// Input SH coeffs for first function. +// pG +// Second set of input SH coeffs. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHMultiply2( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply3( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply4( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply5( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply6( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); + + //============================================================================ // // Basic Spherical Harmonic lighting routines diff --git a/RenderDll/Dx9Sdk/Include/d3dx9math.inl b/RenderDll/Dx9Sdk/Include/d3dx9math.inl index ecf52f9..a3652ed 100644 --- a/RenderDll/Dx9Sdk/Include/d3dx9math.inl +++ b/RenderDll/Dx9Sdk/Include/d3dx9math.inl @@ -10,7 +10,6 @@ #ifndef __D3DX9MATH_INL__ #define __D3DX9MATH_INL__ - //=========================================================================== // // Inline Class Methods @@ -983,9 +982,15 @@ _D3DXMATRIXA16::_D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, { } +#ifndef SIZE_MAX +#define SIZE_MAX ((SIZE_T)-1) +#endif + D3DXINLINE void* _D3DXMATRIXA16::operator new( size_t s ) { + if (s > (SIZE_MAX-16)) + return NULL; LPBYTE p = ::new BYTE[s + 16]; if (p) { @@ -999,6 +1004,8 @@ _D3DXMATRIXA16::operator new( size_t s ) D3DXINLINE void* _D3DXMATRIXA16::operator new[]( size_t s ) { + if (s > (SIZE_MAX-16)) + return NULL; LPBYTE p = ::new BYTE[s + 16]; if (p) { diff --git a/RenderDll/Dx9Sdk/Include/d3dx9mesh.h b/RenderDll/Dx9Sdk/Include/d3dx9mesh.h index ba2bd47..a009d9a 100644 --- a/RenderDll/Dx9Sdk/Include/d3dx9mesh.h +++ b/RenderDll/Dx9Sdk/Include/d3dx9mesh.h @@ -103,12 +103,52 @@ enum _MAX_FVF_DECL_SIZE MAX_FVF_DECL_SIZE = MAXD3DDECLLENGTH + 1 // +1 for END }; +typedef enum _D3DXTANGENT +{ + D3DXTANGENT_WRAP_U = 0x01, + D3DXTANGENT_WRAP_V = 0x02, + D3DXTANGENT_WRAP_UV = 0x03, + D3DXTANGENT_DONT_NORMALIZE_PARTIALS = 0x04, + D3DXTANGENT_DONT_ORTHOGONALIZE = 0x08, + D3DXTANGENT_ORTHOGONALIZE_FROM_V = 0x010, + D3DXTANGENT_ORTHOGONALIZE_FROM_U = 0x020, + D3DXTANGENT_WEIGHT_BY_AREA = 0x040, + D3DXTANGENT_WEIGHT_EQUAL = 0x080, + D3DXTANGENT_WIND_CW = 0x0100, + D3DXTANGENT_CALCULATE_NORMALS = 0x0200, + D3DXTANGENT_GENERATE_IN_PLACE = 0x0400, +} D3DXTANGENT; + +// D3DXIMT_WRAP_U means the texture wraps in the U direction +// D3DXIMT_WRAP_V means the texture wraps in the V direction +// D3DXIMT_WRAP_UV means the texture wraps in both directions +typedef enum _D3DXIMT +{ + D3DXIMT_WRAP_U = 0x01, + D3DXIMT_WRAP_V = 0x02, + D3DXIMT_WRAP_UV = 0x03, +} D3DXIMT; + +// These options are only valid for UVAtlasCreate and UVAtlasPartition, we may add more for UVAtlasPack if necessary +// D3DXUVATLAS_DEFAULT - Meshes with more than 25k faces go through fast, meshes with fewer than 25k faces go through quality +// D3DXUVATLAS_GEODESIC_FAST - Uses approximations to improve charting speed at the cost of added stretch or more charts. +// D3DXUVATLAS_GEODESIC_QUALITY - Provides better quality charts, but requires more time and memory than fast. +typedef enum _D3DXUVATLAS +{ + D3DXUVATLAS_DEFAULT = 0x00, + D3DXUVATLAS_GEODESIC_FAST = 0x01, + D3DXUVATLAS_GEODESIC_QUALITY = 0x02, +} D3DXUVATLAS; + typedef struct ID3DXBaseMesh *LPD3DXBASEMESH; typedef struct ID3DXMesh *LPD3DXMESH; typedef struct ID3DXPMesh *LPD3DXPMESH; typedef struct ID3DXSPMesh *LPD3DXSPMESH; typedef struct ID3DXSkinInfo *LPD3DXSKININFO; typedef struct ID3DXPatchMesh *LPD3DXPATCHMESH; +typedef interface ID3DXTextureGutterHelper *LPD3DXTEXTUREGUTTERHELPER; +typedef interface ID3DXPRTBuffer *LPD3DXPRTBUFFER; + typedef struct _D3DXATTRIBUTERANGE { @@ -1056,6 +1096,26 @@ BOOL WINAPI CONST D3DXVECTOR3 *pRayDirection); +HRESULT WINAPI D3DXComputeTangentFrame(ID3DXMesh *pMesh, + DWORD dwOptions); + +HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *pMesh, + DWORD dwTextureInSemantic, + DWORD dwTextureInIndex, + DWORD dwUPartialOutSemantic, + DWORD dwUPartialOutIndex, + DWORD dwVPartialOutSemantic, + DWORD dwVPartialOutIndex, + DWORD dwNormalOutSemantic, + DWORD dwNormalOutIndex, + DWORD dwOptions, + CONST DWORD *pdwAdjacency, + FLOAT fPartialEdgeThreshold, + FLOAT fSingularPointThreshold, + FLOAT fNormalEdgeThreshold, + ID3DXMesh **ppMeshOut, + ID3DXBuffer **ppVertexMapping); + //D3DXComputeTangent // @@ -1080,6 +1140,307 @@ HRESULT WINAPI D3DXComputeTangent(LPD3DXMESH Mesh, DWORD Wrap, CONST DWORD *pAdjacency); +//============================================================================ +// +// UVAtlas apis +// +//============================================================================ +typedef HRESULT (WINAPI *LPD3DXUVATLASCB)(FLOAT fPercentDone, LPVOID lpUserContext); + +// This function creates atlases for meshes. There are two modes of operation, +// either based on the number of charts, or the maximum allowed stretch. If the +// maximum allowed stretch is 0, then each triangle will likely be in its own +// chart. + +// +// The parameters are as follows: +// pMesh - Input mesh to calculate an atlas for. This must have a position +// channel and at least a 2-d texture channel. +// uMaxChartNumber - The maximum number of charts required for the atlas. +// If this is 0, it will be parameterized based solely on +// stretch. +// fMaxStretch - The maximum amount of stretch, if 0, no stretching is allowed, +// if 1, then any amount of stretching is allowed. +// uWidth - The width of the texture the atlas will be used on. +// uHeight - The height of the texture the atlas will be used on. +// fGutter - The minimum distance, in texels between two charts on the atlas. +// this gets scaled by the width, so if fGutter is 2.5, and it is +// used on a 512x512 texture, then the minimum distance will be +// 2.5 / 512 in u-v space. +// dwTextureIndex - Specifies which texture coordinate to write to in the +// output mesh (which is cloned from the input mesh). Useful +// if your vertex has multiple texture coordinates. +// pdwAdjacency - a pointer to an array with 3 DWORDs per face, indicating +// which triangles are adjacent to each other. +// pdwFalseEdgeAdjacency - a pointer to an array with 3 DWORDS per face, indicating +// at each face, whether an edge is a false edge or not (using +// the same ordering as the adjacency data structure). If this +// is NULL, then it is assumed that there are no false edges. If +// not NULL, then a non-false edge is indicated by -1 and a false +// edge is indicated by any other value (it is not required, but +// it may be useful for the caller to use the original adjacency +// value). This allows you to parameterize a mesh of quads, and +// the edges down the middle of each quad will not be cut when +// parameterizing the mesh. +// pfIMTArray - a pointer to an array with 3 FLOATs per face, describing the +// integrated metric tensor for that face. This lets you control +// the way this triangle may be stretched in the atlas. The IMT +// passed in will be 3 floats (a,b,c) and specify a symmetric +// matrix (a b) that, given a vector (s,t), specifies the +// (b c) +// distance between a vector v1 and a vector v2 = v1 + (s,t) as +// sqrt((s, t) * M * (s, t)^T). +// In other words, this lets one specify the magnitude of the +// stretch in an arbitrary direction in u-v space. For example +// if a = b = c = 1, then this scales the vector (1,1) by 2, and +// the vector (1,-1) by 0. Note that this is multiplying the edge +// length by the square of the matrix, so if you want the face to +// stretch to twice its +// size with no shearing, the IMT value should be (2, 0, 2), which +// is just the identity matrix times 2. +// Note that this assumes you have an orientation for the triangle +// in some 2-D space. For D3DXUVAtlas, this space is created by +// letting S be the direction from the first to the second +// vertex, and T be the cross product between the normal and S. +// +// pStatusCallback - Since the atlas creation process can be very CPU intensive, +// this allows the programmer to specify a function to be called +// periodically, similarly to how it is done in the PRT simulation +// engine. +// fCallbackFrequency - This lets you specify how often the callback will be +// called. A decent default should be 0.0001f. +// pUserContext - a void pointer to be passed back to the callback function +// dwOptions - A combination of flags in the D3DXUVATLAS enum +// ppMeshOut - A pointer to a location to store a pointer for the newly created +// mesh. +// ppFacePartitioning - A pointer to a location to store a pointer for an array, +// one DWORD per face, giving the final partitioning +// created by the atlasing algorithm. +// ppVertexRemapArray - A pointer to a location to store a pointer for an array, +// one DWORD per vertex, giving the vertex it was copied +// from, if any vertices needed to be split. +// pfMaxStretchOut - A location to store the maximum stretch resulting from the +// atlasing algorithm. +// puNumChartsOut - A location to store the number of charts created, or if the +// maximum number of charts was too low, this gives the minimum +// number of charts needed to create an atlas. + +HRESULT WINAPI D3DXUVAtlasCreate(LPD3DXMESH pMesh, + UINT uMaxChartNumber, + FLOAT fMaxStretch, + UINT uWidth, + UINT uHeight, + FLOAT fGutter, + DWORD dwTextureIndex, + CONST DWORD *pdwAdjacency, + CONST DWORD *pdwFalseEdgeAdjacency, + CONST FLOAT *pfIMTArray, + LPD3DXUVATLASCB pStatusCallback, + FLOAT fCallbackFrequency, + LPVOID pUserContext, + DWORD dwOptions, + LPD3DXMESH *ppMeshOut, + LPD3DXBUFFER *ppFacePartitioning, + LPD3DXBUFFER *ppVertexRemapArray, + FLOAT *pfMaxStretchOut, + UINT *puNumChartsOut); + +// This has the same exact arguments as Create, except that it does not perform the +// final packing step. This method allows one to get a partitioning out, and possibly +// modify it before sending it to be repacked. Note that if you change the +// partitioning, you'll also need to calculate new texture coordinates for any faces +// that have switched charts. +// +// The partition result adjacency output parameter is meant to be passed to the +// UVAtlasPack function, this adjacency cuts edges that are between adjacent +// charts, and also can include cuts inside of a chart in order to make it +// equivalent to a disc. For example: +// +// _______ +// | ___ | +// | |_| | +// |_____| +// +// In order to make this equivalent to a disc, we would need to add a cut, and it +// Would end up looking like: +// _______ +// | ___ | +// | |_|_| +// |_____| +// +// The resulting partition adjacency parameter cannot be NULL, because it is +// required for the packing step. + + + +HRESULT WINAPI D3DXUVAtlasPartition(LPD3DXMESH pMesh, + UINT uMaxChartNumber, + FLOAT fMaxStretch, + DWORD dwTextureIndex, + CONST DWORD *pdwAdjacency, + CONST DWORD *pdwFalseEdgeAdjacency, + CONST FLOAT *pfIMTArray, + LPD3DXUVATLASCB pStatusCallback, + FLOAT fCallbackFrequency, + LPVOID pUserContext, + DWORD dwOptions, + LPD3DXMESH *ppMeshOut, + LPD3DXBUFFER *ppFacePartitioning, + LPD3DXBUFFER *ppVertexRemapArray, + LPD3DXBUFFER *ppPartitionResultAdjacency, + FLOAT *pfMaxStretchOut, + UINT *puNumChartsOut); + +// This takes the face partitioning result from Partition and packs it into an +// atlas of the given size. pdwPartitionResultAdjacency should be derived from +// the adjacency returned from the partition step. This value cannot be NULL +// because Pack needs to know where charts were cut in the partition step in +// order to find the edges of each chart. +// The options parameter is currently reserved. +HRESULT WINAPI D3DXUVAtlasPack(ID3DXMesh *pMesh, + UINT uWidth, + UINT uHeight, + FLOAT fGutter, + DWORD dwTextureIndex, + CONST DWORD *pdwPartitionResultAdjacency, + LPD3DXUVATLASCB pStatusCallback, + FLOAT fCallbackFrequency, + LPVOID pUserContext, + DWORD dwOptions, + LPD3DXBUFFER pFacePartitioning); + + +//============================================================================ +// +// IMT Calculation apis +// +// These functions all compute the Integrated Metric Tensor for use in the +// UVAtlas API. They all calculate the IMT with respect to the canonical +// triangle, where the coordinate system is set up so that the u axis goes +// from vertex 0 to 1 and the v axis is N x u. So, for example, the second +// vertex's canonical uv coordinates are (d,0) where d is the distance between +// vertices 0 and 1. This way the IMT does not depend on the parameterization +// of the mesh, and if the signal over the surface doesn't change, then +// the IMT doesn't need to be recalculated. +//============================================================================ + +// This callback is used by D3DXComputeIMTFromSignal. +// +// uv - The texture coordinate for the vertex. +// uPrimitiveID - Face ID of the triangle on which to compute the signal. +// uSignalDimension - The number of floats to store in pfSignalOut. +// pUserData - The pUserData pointer passed in to ComputeIMTFromSignal. +// pfSignalOut - A pointer to where to store the signal data. +typedef HRESULT (WINAPI* LPD3DXIMTSIGNALCALLBACK) + (CONST D3DXVECTOR2 *uv, + UINT uPrimitiveID, + UINT uSignalDimension, + VOID *pUserData, + FLOAT *pfSignalOut); + +// This function is used to calculate the IMT from per vertex data. It sets +// up a linear system over the triangle, solves for the jacobian J, then +// constructs the IMT from that (J^TJ). +// This function allows you to calculate the IMT based off of any value in a +// mesh (color, normal, etc) by specifying the correct stride of the array. +// The IMT computed will cause areas of the mesh that have similar values to +// take up less space in the texture. +// +// pMesh - The mesh to calculate the IMT for. +// pVertexSignal - A float array of size uSignalStride * v, where v is the +// number of vertices in the mesh. +// uSignalDimension - How many floats per vertex to use in calculating the IMT. +// uSignalStride - The number of bytes per vertex in the array. This must be +// a multiple of sizeof(float) +// ppIMTData - Where to store the buffer holding the IMT data + +HRESULT WINAPI D3DXComputeIMTFromPerVertexSignal ( + LPD3DXMESH pMesh, + CONST FLOAT *pfVertexSignal, // uSignalDimension floats per vertex + UINT uSignalDimension, + UINT uSignalStride, // stride of signal in bytes + DWORD dwOptions, // reserved for future use + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +// This function is used to calculate the IMT from data that varies over the +// surface of the mesh (generally at a higher frequency than vertex data). +// This function requires the mesh to already be parameterized (so it already +// has texture coordinates). It allows the user to define a signal arbitrarily +// over the surface of the mesh. +// +// pMesh - The mesh to calculate the IMT for. +// dwTextureIndex - This describes which set of texture coordinates in the +// mesh to use. +// uSignalDimension - How many components there are in the signal. +// fMaxUVDistance - The subdivision will continue until the distance between +// all vertices is at most fMaxUVDistance. +// dwOptions - reserved for future use +// pSignalCallback - The callback to use to get the signal. +// pUserData - A pointer that will be passed in to the callback. +// ppIMTData - Where to store the buffer holding the IMT data +HRESULT WINAPI D3DXComputeIMTFromSignal( + LPD3DXMESH pMesh, + DWORD dwTextureIndex, + UINT uSignalDimension, + FLOAT fMaxUVDistance, + DWORD dwOptions, // reserved for future use + LPD3DXIMTSIGNALCALLBACK pSignalCallback, + VOID *pUserData, + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +// This function is used to calculate the IMT from texture data. Given a texture +// that maps over the surface of the mesh, the algorithm computes the IMT for +// each face. This will cause large areas that are very similar to take up less +// room when parameterized with UVAtlas. The texture is assumed to be +// interpolated over the mesh bilinearly. +// +// pMesh - The mesh to calculate the IMT for. +// pTexture - The texture to load data from. +// dwTextureIndex - This describes which set of texture coordinates in the +// mesh to use. +// dwOptions - Combination of one or more D3DXIMT flags. +// ppIMTData - Where to store the buffer holding the IMT data +HRESULT WINAPI D3DXComputeIMTFromTexture ( + LPD3DXMESH pMesh, + LPDIRECT3DTEXTURE9 pTexture, + DWORD dwTextureIndex, + DWORD dwOptions, + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +// This function is very similar to ComputeIMTFromTexture, but it uses a +// float array to pass in the data, and it can calculate higher dimensional +// values than 4. +// +// pMesh - The mesh to calculate the IMT for. +// dwTextureIndex - This describes which set of texture coordinates in the +// mesh to use. +// pfFloatArray - a pointer to a float array of size +// uWidth*uHeight*uComponents +// uWidth - The width of the texture +// uHeight - The height of the texture +// uSignalDimension - The number of floats per texel in the signal +// uComponents - The number of floats in each texel +// dwOptions - Combination of one or more D3DXIMT flags +// ppIMTData - Where to store the buffer holding the IMT data +HRESULT WINAPI D3DXComputeIMTFromPerTexelSignal( + LPD3DXMESH pMesh, + DWORD dwTextureIndex, + FLOAT *pfTexelSignal, + UINT uWidth, + UINT uHeight, + UINT uSignalDimension, + UINT uComponents, + DWORD dwOptions, + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + HRESULT WINAPI D3DXConvertMeshSubsetToSingleStrip( LPD3DXBASEMESH MeshIn, @@ -1247,23 +1608,18 @@ DEFINE_GUID(IID_ID3DXPRTBuffer, DEFINE_GUID(IID_ID3DXPRTCompBuffer, 0xa758d465, 0xfe8d, 0x45ad, 0x9c, 0xf0, 0xd0, 0x1e, 0x56, 0x26, 0x6a, 0x7); -// {06F57E0A-BD95-43f1-A3DA-791CF6CA297B} +// {838F01EC-9729-4527-AADB-DF70ADE7FEA9} DEFINE_GUID(IID_ID3DXTextureGutterHelper, -0x6f57e0a, 0xbd95, 0x43f1, 0xa3, 0xda, 0x79, 0x1c, 0xf6, 0xca, 0x29, 0x7b); +0x838f01ec, 0x9729, 0x4527, 0xaa, 0xdb, 0xdf, 0x70, 0xad, 0xe7, 0xfe, 0xa9); -// {C3F4ADBF-E6D2-4b7b-BFE8-9E7208746ADF} +// {683A4278-CD5F-4d24-90AD-C4E1B6855D53} DEFINE_GUID(IID_ID3DXPRTEngine, -0xc3f4adbf, 0xe6d2, 0x4b7b, 0xbf, 0xe8, 0x9e, 0x72, 0x8, 0x74, 0x6a, 0xdf); +0x683a4278, 0xcd5f, 0x4d24, 0x90, 0xad, 0xc4, 0xe1, 0xb6, 0x85, 0x5d, 0x53); // interface defenitions - typedef interface ID3DXTextureGutterHelper ID3DXTextureGutterHelper; -typedef interface ID3DXTextureGutterHelper *LPD3DXTEXTUREGUTTERHELPER; - typedef interface ID3DXPRTBuffer ID3DXPRTBuffer; -typedef interface ID3DXPRTBuffer *LPD3DXPRTBUFFER; - #undef INTERFACE #define INTERFACE ID3DXPRTBuffer @@ -1431,6 +1787,27 @@ DECLARE_INTERFACE_(ID3DXTextureGutterHelper, IUnknown) // Applies gutters to a D3DXPRTBuffer // Dimensions must match GutterHelper STDMETHOD(ApplyGuttersPRT)(THIS_ LPD3DXPRTBUFFER pBuffer); + + // Resamples a texture from a mesh onto this gutterhelpers + // parameterization. It is assumed that the UV coordinates + // for this gutter helper are in TEXTURE 0 (usage/usage index) + // and the texture coordinates should all be within [0,1] for + // both sets. + // + // pTextureIn - texture represented using parameterization in pMeshIn + // pMeshIn - Mesh with texture coordinates that represent pTextureIn + // pTextureOut texture coordinates are assumed to be in + // TEXTURE 0 + // Usage - field in DECL for pMeshIn that stores texture coordinates + // for pTextureIn + // UsageIndex - which index for Usage above for pTextureIn + // pTextureOut- Resampled texture + // + // Usage would generally be D3DDECLUSAGE_TEXCOORD and UsageIndex other than zero + STDMETHOD(ResampleTex)(THIS_ LPDIRECT3DTEXTURE9 pTextureIn, + LPD3DXMESH pMeshIn, + D3DDECLUSAGE Usage, UINT UsageIndex, + LPDIRECT3DTEXTURE9 pTextureOut); // the routines below provide access to the data structures // used by the Apply functions @@ -1594,6 +1971,15 @@ DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown) // Number of faces currently allocated (includes new faces) STDMETHOD_(UINT, GetNumFaces)(THIS) PURE; + // Sets the Minimum/Maximum intersection distances, this can be used to control + // maximum distance that objects can shadow/reflect light, and help with "bad" + // art that might have near features that you don't want to shadow. This does not + // apply for GPU simulations. + // fMin - minimum intersection distance, must be positive and less than fMax + // fMax - maximum intersection distance, if 0.0f use the previous value, otherwise + // must be strictly greater than fMin + STDMETHOD(SetMinMaxIntersection)(THIS_ FLOAT fMin, FLOAT fMax) PURE; + // This will subdivide faces on a mesh so that adaptively simulations can // use a more conservative threshold (it won't miss features.) // MinEdgeLength - minimum edge length that will be generated, if 0.0f a @@ -1685,6 +2071,24 @@ DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown) STDMETHOD(ComputeSS)(THIS_ LPD3DXPRTBUFFER pDataIn, LPD3DXPRTBUFFER pDataOut, LPD3DXPRTBUFFER pDataTotal) PURE; + // Adaptive version of ComputeSS. + // + // pDataIn - input data (previous bounce) + // AdaptiveThresh - threshold for adaptive subdivision (in PRT vector error) + // if value is less then 1e-6f, 1e-6f is specified + // MinEdgeLength - minimum edge length that will be generated + // if value is too small a fairly conservative model dependent value + // is used + // MaxSubdiv - maximum subdivision level, if 0 is specified it + // will default to 4 + // pDataOut - result of subsurface scattering simulation + // pDataTotal - [optional] results can be summed into this buffer + STDMETHOD(ComputeSSAdaptive)(THIS_ LPD3DXPRTBUFFER pDataIn, + FLOAT AdaptiveThresh, + FLOAT MinEdgeLength, + UINT MaxSubdiv, + LPD3DXPRTBUFFER pDataOut, LPD3DXPRTBUFFER pDataTotal) PURE; + // computes a single bounce of inter-reflected light // works for SH based PRT or generic lighting // Albedo is not multiplied by result @@ -1765,6 +2169,38 @@ DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown) UINT NumVolSamples, CONST D3DXVECTOR3 *pSampleLocs, LPD3DXPRTBUFFER pDataOut) PURE; + + // Computes direct lighting (SH) for a point not on the mesh + // with a given normal - cannot use texture buffers. + // + // SHOrder - order of SH to use + // NumSamples - number of sample locations + // pSampleLocs - position for each sample + // pSampleNorms - normal for each sample + // pDataOut - PRT Buffer that will store output results + STDMETHOD(ComputeSurfSamplesDirectSH)(THIS_ UINT SHOrder, + UINT NumSamples, + CONST D3DXVECTOR3 *pSampleLocs, + CONST D3DXVECTOR3 *pSampleNorms, + LPD3DXPRTBUFFER pDataOut) PURE; + + + // given the solution for PRT or light maps, computes transfer vector at arbitrary + // position/normal pairs in space + // + // pSurfDataIn - input data + // NumSamples - number of sample locations + // pSampleLocs - position for each sample + // pSampleNorms - normal for each sample + // pDataOut - PRT Buffer that will store output results + // pDataTotal - optional buffer to sum results into - can be NULL + STDMETHOD(ComputeSurfSamplesBounce)(THIS_ LPD3DXPRTBUFFER pSurfDataIn, + UINT NumSamples, + CONST D3DXVECTOR3 *pSampleLocs, + CONST D3DXVECTOR3 *pSampleNorms, + LPD3DXPRTBUFFER pDataOut, + LPD3DXPRTBUFFER pDataTotal) PURE; + // Frees temporary data structures that can be created for subsurface scattering // this data is freed when the PRTComputeEngine is freed and is lazily created STDMETHOD(FreeSSData)(THIS) PURE; @@ -1773,24 +2209,25 @@ DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown) // this data is freed when the PRTComputeEngine is freed and is lazily created STDMETHOD(FreeBounceData)(THIS) PURE; - // This computes the convolution coefficients relative to the per sample normals - // that minimize error in a least squares sense with respect to the input PRT - // data set. These coefficients can be used with skinned/transformed normals to - // model global effects with dynamic objects. Shading normals can optionaly be - // solved for - these normals (along with the convolution coefficients) can more - // accurately represent the PRT signal. + // This computes the Local Deformable PRT (LDPRT) coefficients relative to the + // per sample normals that minimize error in a least squares sense with respect + // to the input PRT data set. These coefficients can be used with skinned/transformed + // normals to model global effects with dynamic objects. Shading normals can + // optionally be solved for - these normals (along with the LDPRT coefficients) can + // more accurately represent the PRT signal. The coefficients are for zonal + // harmonics oriented in the normal/shading normal direction. // // pDataIn - SH PRT dataset that is input // SHOrder - Order of SH to compute conv coefficients for // pNormOut - Optional array of vectors (passed in) that will be filled with - // "shading normals", convolution coefficients are optimized for + // "shading normals", LDPRT coefficients are optimized for // these normals. This array must be the same size as the number of // samples in pDataIn - // pDataOut - Output buffer (SHOrder convolution coefficients per channel per sample) - STDMETHOD(ComputeConvCoeffs)(THIS_ LPD3DXPRTBUFFER pDataIn, - UINT SHOrder, - D3DXVECTOR3 *pNormOut, - LPD3DXPRTBUFFER pDataOut) PURE; + // pDataOut - Output buffer (SHOrder zonal harmonic coefficients per channel per sample) + STDMETHOD(ComputeLDPRTCoeffs)(THIS_ LPD3DXPRTBUFFER pDataIn, + UINT SHOrder, + D3DXVECTOR3 *pNormOut, + LPD3DXPRTBUFFER pDataOut) PURE; // scales all the samples associated with a given sub mesh // can be useful when using subsurface scattering @@ -1817,6 +2254,31 @@ DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown) // will be invoked // lpUserContext - will be passed back to the users call back STDMETHOD(SetCallBack)(THIS_ LPD3DXSHPRTSIMCB pCB, FLOAT Frequency, LPVOID lpUserContext) PURE; + + // Returns TRUE if the ray intersects the mesh, FALSE if it does not. This function + // takes into account settings from SetMinMaxIntersection. If the closest intersection + // is not needed this function is more efficient compared to the ClosestRayIntersection + // method. + // pRayPos - origin of ray + // pRayDir - normalized ray direction (normalization required for SetMinMax to be meaningful) + + STDMETHOD_(BOOL, ShadowRayIntersects)(THIS_ CONST D3DXVECTOR3 *pRayPos, CONST D3DXVECTOR3 *pRayDir) PURE; + + // Returns TRUE if the ray intersects the mesh, FALSE if it does not. If there is an + // intersection the closest face that was intersected and its first two barycentric coordinates + // are returned. This function takes into account settings from SetMinMaxIntersection. + // This is a slower function compared to ShadowRayIntersects and should only be used where + // needed. The third vertices barycentric coordinates will be 1 - pU - pV. + // pRayPos - origin of ray + // pRayDir - normalized ray direction (normalization required for SetMinMax to be meaningful) + // pFaceIndex - Closest face that intersects. This index is based on stacking the pBlockerMesh + // faces before the faces from pMesh + // pU - Barycentric coordinate for vertex 0 + // pV - Barycentric coordinate for vertex 1 + // pDist - Distance along ray where the intersection occured + + STDMETHOD_(BOOL, ClosestRayIntersects)(THIS_ CONST D3DXVECTOR3 *pRayPos, CONST D3DXVECTOR3 *pRayDir, + DWORD *pFaceIndex, FLOAT *pU, FLOAT *pV, FLOAT *pDist) PURE; }; @@ -2019,7 +2481,11 @@ HRESULT WINAPI // Number of clusters to compute // NumPCA // Number of basis vectors to compute -// ppBufferIn +// pCB +// Optional Callback function +// lpUserContext +// Optional user context +// pBufferIn // Buffer that will be compressed // ppBufferOut // Compressed buffer that will be created @@ -2032,6 +2498,8 @@ HRESULT WINAPI D3DXSHCOMPRESSQUALITYTYPE Quality, UINT NumClusters, UINT NumPCA, + LPD3DXSHPRTSIMCB pCB, + LPVOID lpUserContext, LPD3DXPRTBUFFER pBufferIn, LPD3DXPRTCOMPBUFFER *ppBufferOut ); @@ -2079,6 +2547,8 @@ HRESULT WINAPI // pMesh // Mesh that represents the scene - must have an AttributeTable // where vertices are in a unique attribute. +// pAdjacency +// Optional adjacency information // ExtractUVs // Set this to true if textures are going to be used for albedos // or to store PRT vectors @@ -2092,7 +2562,8 @@ HRESULT WINAPI HRESULT WINAPI D3DXCreatePRTEngine( - LPD3DXMESH pMesh, + LPD3DXMESH pMesh, + DWORD *pAdjacency, BOOL ExtractUVs, LPD3DXMESH pBlockerMesh, LPD3DXPRTENGINE* ppEngine); diff --git a/RenderDll/Dx9Sdk/Include/d3dx9shader.h b/RenderDll/Dx9Sdk/Include/d3dx9shader.h index cae915a..5ed3f01 100644 --- a/RenderDll/Dx9Sdk/Include/d3dx9shader.h +++ b/RenderDll/Dx9Sdk/Include/d3dx9shader.h @@ -76,17 +76,35 @@ // //---------------------------------------------------------------------------- -#define D3DXSHADER_DEBUG (1 << 0) -#define D3DXSHADER_SKIPVALIDATION (1 << 1) -#define D3DXSHADER_SKIPOPTIMIZATION (1 << 2) -#define D3DXSHADER_PACKMATRIX_ROWMAJOR (1 << 3) -#define D3DXSHADER_PACKMATRIX_COLUMNMAJOR (1 << 4) -#define D3DXSHADER_PARTIALPRECISION (1 << 5) -#define D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT (1 << 6) -#define D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT (1 << 7) -#define D3DXSHADER_NO_PRESHADER (1 << 8) -#define D3DXSHADER_AVOID_FLOW_CONTROL (1 << 9) -#define D3DXSHADER_PREFER_FLOW_CONTROL (1 << 10) +#define D3DXSHADER_DEBUG (1 << 0) +#define D3DXSHADER_SKIPVALIDATION (1 << 1) +#define D3DXSHADER_SKIPOPTIMIZATION (1 << 2) +#define D3DXSHADER_PACKMATRIX_ROWMAJOR (1 << 3) +#define D3DXSHADER_PACKMATRIX_COLUMNMAJOR (1 << 4) +#define D3DXSHADER_PARTIALPRECISION (1 << 5) +#define D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT (1 << 6) +#define D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT (1 << 7) +#define D3DXSHADER_NO_PRESHADER (1 << 8) +#define D3DXSHADER_AVOID_FLOW_CONTROL (1 << 9) +#define D3DXSHADER_PREFER_FLOW_CONTROL (1 << 10) +#define D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12) +#define D3DXSHADER_IEEE_STRICTNESS (1 << 13) +#define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL (1 << 16) + + +// optimization level flags +#define D3DXSHADER_OPTIMIZATION_LEVEL0 (1 << 14) +#define D3DXSHADER_OPTIMIZATION_LEVEL1 0 +#define D3DXSHADER_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15)) +#define D3DXSHADER_OPTIMIZATION_LEVEL3 (1 << 15) + + + +//---------------------------------------------------------------------------- +// D3DXCONSTTABLE flags: +// ------------------- + +#define D3DXCONSTTABLE_LARGEADDRESSAWARE (1 << 17) @@ -97,7 +115,11 @@ // Strings can be used as handles. However, handles are not always strings. //---------------------------------------------------------------------------- +#ifndef D3DXFX_LARGEADDRESS_HANDLE typedef LPCSTR D3DXHANDLE; +#else +typedef UINT_PTR D3DXHANDLE; +#endif typedef D3DXHANDLE *LPD3DXHANDLE; @@ -130,18 +152,6 @@ typedef struct _D3DXSEMANTIC -//---------------------------------------------------------------------------- -// D3DXFRAGMENT_DESC: -//---------------------------------------------------------------------------- - -typedef struct _D3DXFRAGMENT_DESC -{ - LPCSTR Name; - DWORD Target; - -} D3DXFRAGMENT_DESC, *LPD3DXFRAGMENT_DESC; - - //---------------------------------------------------------------------------- // D3DXREGISTER_SET: //---------------------------------------------------------------------------- @@ -203,6 +213,7 @@ typedef enum _D3DXPARAMETER_TYPE D3DXPT_VERTEXSHADER, D3DXPT_PIXELFRAGMENT, D3DXPT_VERTEXFRAGMENT, + D3DXPT_UNSUPPORTED, // force 32-bit size enum D3DXPT_FORCE_DWORD = 0x7fffffff @@ -360,53 +371,6 @@ DECLARE_INTERFACE_(ID3DXTextureShader, IUnknown) }; - -//---------------------------------------------------------------------------- -// ID3DXFragmentLinker -//---------------------------------------------------------------------------- - -typedef interface ID3DXFragmentLinker ID3DXFragmentLinker; -typedef interface ID3DXFragmentLinker *LPD3DXFRAGMENTLINKER; - -// {1A2C0CC2-E5B6-4ebc-9E8D-390E057811B6} -DEFINE_GUID(IID_ID3DXFragmentLinker, -0x1a2c0cc2, 0xe5b6, 0x4ebc, 0x9e, 0x8d, 0x39, 0xe, 0x5, 0x78, 0x11, 0xb6); - -#undef INTERFACE -#define INTERFACE ID3DXFragmentLinker - -DECLARE_INTERFACE_(ID3DXFragmentLinker, IUnknown) -{ - // IUnknown - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; - STDMETHOD_(ULONG, AddRef)(THIS) PURE; - STDMETHOD_(ULONG, Release)(THIS) PURE; - - // ID3DXFragmentLinker - - // fragment access and information retrieval functions - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; - STDMETHOD_(UINT, GetNumberOfFragments)(THIS) PURE; - - STDMETHOD_(D3DXHANDLE, GetFragmentHandleByIndex)(THIS_ UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetFragmentHandleByName)(THIS_ LPCSTR Name) PURE; - STDMETHOD(GetFragmentDesc)(THIS_ D3DXHANDLE Name, LPD3DXFRAGMENT_DESC FragDesc) PURE; - - // add the fragments in the buffer to the linker - STDMETHOD(AddFragments)(THIS_ CONST DWORD *Fragments) PURE; - - // Create a buffer containing the fragments. Suitable for saving to disk - STDMETHOD(GetAllFragments)(THIS_ LPD3DXBUFFER *ppBuffer) PURE; - STDMETHOD(GetFragment)(THIS_ D3DXHANDLE Name, LPD3DXBUFFER *ppBuffer) PURE; - - STDMETHOD(LinkShader)(THIS_ LPCSTR pProfile, DWORD Flags, CONST D3DXHANDLE *rgFragmentHandles, UINT cFragments, LPD3DXBUFFER *ppBuffer, LPD3DXBUFFER *ppErrorMsgs) PURE; - STDMETHOD(LinkVertexShader)(THIS_ LPCSTR pProfile, DWORD Flags, CONST D3DXHANDLE *rgFragmentHandles, UINT cFragments, LPDIRECT3DVERTEXSHADER9 *pVShader, LPD3DXBUFFER *ppErrorMsgs) PURE; - STDMETHOD(LinkPixelShader)(THIS_ LPCSTR pProfile, DWORD Flags, CONST D3DXHANDLE *rgFragmentHandles, UINT cFragments, LPDIRECT3DPIXELSHADER9 *pPShader, LPD3DXBUFFER *ppErrorMsgs) PURE; - - STDMETHOD(ClearCache)(THIS) PURE; -}; - - //---------------------------------------------------------------------------- // D3DXINCLUDE_TYPE: //---------------------------------------------------------------------------- @@ -432,7 +396,7 @@ typedef enum _D3DXINCLUDE_TYPE // Open() // Opens an include file. If successful, it should fill in ppData and // pBytes. The data pointer returned must remain valid until Close is -// subsequently called. +// subsequently called. The name of the file is encoded in UTF-8 format. // Close() // Closes an include file. If Open was successful, Close is guaranteed // to be called before the API using this interface returns. @@ -846,6 +810,8 @@ HRESULT WINAPI // Parameters: // pFunction // Pointer to the function DWORD stream +// Flags +// See D3DXCONSTTABLE_xxx // ppConstantTable // Returns a ID3DXConstantTable object which can be used to set // shader constants to the device. Alternatively, an application can @@ -858,6 +824,12 @@ HRESULT WINAPI CONST DWORD* pFunction, LPD3DXCONSTANTTABLE* ppConstantTable); +HRESULT WINAPI + D3DXGetShaderConstantTableEx( + CONST DWORD* pFunction, + DWORD Flags, + LPD3DXCONSTANTTABLE* ppConstantTable); + //---------------------------------------------------------------------------- @@ -879,12 +851,13 @@ HRESULT WINAPI LPD3DXTEXTURESHADER* ppTextureShader); - //---------------------------------------------------------------------------- -// D3DXGatherFragments: -// ------------------- -// Assembles shader fragments into a buffer to be passed to a fragment linker. -// will generate shader fragments for all fragments in the file +// D3DXPreprocessShader: +// --------------------- +// Runs the preprocessor on the specified shader or effect, but does +// not actually compile it. This is useful for evaluating the #includes +// and #defines in a shader and then emitting a reformatted token stream +// for debugging purposes or for generating a self-contained shader. // // Parameters: // pSrcFile @@ -903,104 +876,69 @@ HRESULT WINAPI // Optional interface pointer to use for handling #include directives. // If this parameter is NULL, #includes will be honored when assembling // from file, and will error when assembling from resource or memory. -// Flags -// See D3DXSHADER_xxx flags -// ppShader -// Returns a buffer containing the created shader fragments. This buffer contains -// the assembled shader code, as well as any embedded debug info. +// ppShaderText +// Returns a buffer containing a single large string that represents +// the resulting formatted token stream // ppErrorMsgs // Returns a buffer containing a listing of errors and warnings that were // encountered during assembly. If you are running in a debugger, // these are the same messages you will see in your debug output. //---------------------------------------------------------------------------- - -HRESULT WINAPI -D3DXGatherFragmentsFromFileA( - LPCSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); - -HRESULT WINAPI -D3DXGatherFragmentsFromFileW( - LPCWSTR pSrcFile, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); +HRESULT WINAPI + D3DXPreprocessShaderFromFileA( + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXPreprocessShaderFromFileW( + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); #ifdef UNICODE -#define D3DXGatherFragmentsFromFile D3DXGatherFragmentsFromFileW +#define D3DXPreprocessShaderFromFile D3DXPreprocessShaderFromFileW #else -#define D3DXGatherFragmentsFromFile D3DXGatherFragmentsFromFileA +#define D3DXPreprocessShaderFromFile D3DXPreprocessShaderFromFileA #endif - - -HRESULT WINAPI - D3DXGatherFragmentsFromResourceA( - HMODULE hSrcModule, - LPCSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); - -HRESULT WINAPI - D3DXGatherFragmentsFromResourceW( - HMODULE hSrcModule, - LPCWSTR pSrcResource, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXPreprocessShaderFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXPreprocessShaderFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); #ifdef UNICODE -#define D3DXGatherFragmentsFromResource D3DXGatherFragmentsFromResourceW +#define D3DXPreprocessShaderFromResource D3DXPreprocessShaderFromResourceW #else -#define D3DXGatherFragmentsFromResource D3DXGatherFragmentsFromResourceA +#define D3DXPreprocessShaderFromResource D3DXPreprocessShaderFromResourceA #endif - -HRESULT WINAPI - D3DXGatherFragments( - LPCSTR pSrcData, - UINT SrcDataLen, - CONST D3DXMACRO* pDefines, - LPD3DXINCLUDE pInclude, - DWORD Flags, - LPD3DXBUFFER* ppShader, - LPD3DXBUFFER* ppErrorMsgs); - - - -//---------------------------------------------------------------------------- -// D3DXCreateFragmentLinker: -// ------------------------- -// Creates a fragment linker with a given cache size. The interface returned -// can be used to link together shader fragments. (both HLSL & ASM fragements) -// -// Parameters: -// pDevice -// Pointer to the device on which to create the shaders -// ShaderCacheSize -// Size of the shader cache -// ppFragmentLinker -// pointer to a memory location to put the created interface pointer -// -//---------------------------------------------------------------------------- - -HRESULT WINAPI - D3DXCreateFragmentLinker( - LPDIRECT3DDEVICE9 pDevice, - UINT ShaderCacheSize, - LPD3DXFRAGMENTLINKER* ppFragmentLinker); - +HRESULT WINAPI + D3DXPreprocessShader( + LPCSTR pSrcData, + UINT SrcDataSize, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); #ifdef __cplusplus diff --git a/RenderDll/Dx9Sdk/Include/d3dx9tex.h b/RenderDll/Dx9Sdk/Include/d3dx9tex.h index 0d62b69..c4b6510 100644 --- a/RenderDll/Dx9Sdk/Include/d3dx9tex.h +++ b/RenderDll/Dx9Sdk/Include/d3dx9tex.h @@ -81,6 +81,17 @@ #define D3DX_FILTER_SRGB (3 << 21) +//----------------------------------------------------------------------------- +// D3DX_SKIP_DDS_MIP_LEVELS is used to skip mip levels when loading a DDS file: +//----------------------------------------------------------------------------- + +#define D3DX_SKIP_DDS_MIP_LEVELS_MASK 0x1F +#define D3DX_SKIP_DDS_MIP_LEVELS_SHIFT 26 +#define D3DX_SKIP_DDS_MIP_LEVELS(levels, filter) ((((levels) & D3DX_SKIP_DDS_MIP_LEVELS_MASK) << D3DX_SKIP_DDS_MIP_LEVELS_SHIFT) | ((filter) == D3DX_DEFAULT ? D3DX_FILTER_BOX : (filter))) + + + + //---------------------------------------------------------------------------- // D3DX_NORMALMAP flags: // --------------------- @@ -1035,7 +1046,9 @@ HRESULT WINAPI // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. // MipFilter // D3DX_FILTER flags controlling how each miplevel is filtered. -// Or D3DX_DEFAULT for D3DX_FILTER_BOX, +// Or D3DX_DEFAULT for D3DX_FILTER_BOX. +// Use the D3DX_SKIP_DDS_MIP_LEVELS macro to specify both a filter and the +// number of mip levels to skip when loading DDS files. // ColorKey // Color to replace with transparent black, or 0 to disable colorkey. // This is always a 32-bit ARGB color, independent of the source image @@ -1051,7 +1064,6 @@ HRESULT WINAPI // //---------------------------------------------------------------------------- - // FromFile HRESULT WINAPI diff --git a/RenderDll/Dx9Sdk/Include/ddraw.h b/RenderDll/Dx9Sdk/Include/ddraw.h deleted file mode 100644 index e66314b..0000000 --- a/RenderDll/Dx9Sdk/Include/ddraw.h +++ /dev/null @@ -1,5792 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: ddraw.h - * Content: DirectDraw include file - * - ***************************************************************************/ - -#ifndef __DDRAW_INCLUDED__ -#define __DDRAW_INCLUDED__ - -//Disable the nameless union warning when building internally -#undef ENABLE_NAMELESS_UNION_PRAGMA -#ifdef DIRECTX_REDIST -#define ENABLE_NAMELESS_UNION_PRAGMA -#endif - -#ifdef ENABLE_NAMELESS_UNION_PRAGMA -#pragma warning(disable:4201) -#endif - -/* - * If you wish an application built against the newest version of DirectDraw - * to run against an older DirectDraw run time then define DIRECTDRAW_VERSION - * to be the earlies version of DirectDraw you wish to run against. For, - * example if you wish an application to run against a DX 3 runtime define - * DIRECTDRAW_VERSION to be 0x0300. - */ -#ifndef DIRECTDRAW_VERSION -#define DIRECTDRAW_VERSION 0x0700 -#endif /* DIRECTDRAW_VERSION */ - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#define COM_NO_WINDOWS_H -#include -#else -#define IUnknown void -#if !defined( NT_BUILD_ENVIRONMENT ) && !defined(WINNT) - #define CO_E_NOTINITIALIZED 0x800401F0L -#endif -#endif - -#define _FACDD 0x876 -#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) - -#ifdef __cplusplus -extern "C" { -#endif - -// -// For compilers that don't support nameless unions, do a -// -// #define NONAMELESSUNION -// -// before #include -// -#ifndef DUMMYUNIONNAMEN -#if defined(__cplusplus) || !defined(NONAMELESSUNION) -#define DUMMYUNIONNAMEN(n) -#else -#define DUMMYUNIONNAMEN(n) u##n -#endif -#endif - -#ifndef MAKEFOURCC - #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ - ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ - ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) -#endif //defined(MAKEFOURCC) - -/* - * FOURCC codes for DX compressed-texture pixel formats - */ -#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1')) -#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2')) -#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3')) -#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4')) -#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5')) - -/* - * GUIDS used by DirectDraw objects - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) - -DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 ); -DEFINE_GUID( CLSID_DirectDraw7, 0x3c305196,0x50db,0x11d3,0x9c,0xfe,0x00,0xc0,0x4f,0xd9,0x30,0xc5 ); -DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 ); -DEFINE_GUID( IID_IDirectDraw7, 0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b ); -DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 ); -DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB ); -DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B ); -DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b ); -DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawColorControl, 0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 ); -DEFINE_GUID( IID_IDirectDrawGammaControl, 0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E ); - -#endif - -/*============================================================================ - * - * DirectDraw Structures - * - * Various structures used to invoke DirectDraw. - * - *==========================================================================*/ - -struct IDirectDraw; -struct IDirectDrawSurface; -struct IDirectDrawPalette; -struct IDirectDrawClipper; - -typedef struct IDirectDraw FAR *LPDIRECTDRAW; -typedef struct IDirectDraw2 FAR *LPDIRECTDRAW2; -typedef struct IDirectDraw4 FAR *LPDIRECTDRAW4; -typedef struct IDirectDraw7 FAR *LPDIRECTDRAW7; -typedef struct IDirectDrawSurface FAR *LPDIRECTDRAWSURFACE; -typedef struct IDirectDrawSurface2 FAR *LPDIRECTDRAWSURFACE2; -typedef struct IDirectDrawSurface3 FAR *LPDIRECTDRAWSURFACE3; -typedef struct IDirectDrawSurface4 FAR *LPDIRECTDRAWSURFACE4; -typedef struct IDirectDrawSurface7 FAR *LPDIRECTDRAWSURFACE7; -typedef struct IDirectDrawPalette FAR *LPDIRECTDRAWPALETTE; -typedef struct IDirectDrawClipper FAR *LPDIRECTDRAWCLIPPER; -typedef struct IDirectDrawColorControl FAR *LPDIRECTDRAWCOLORCONTROL; -typedef struct IDirectDrawGammaControl FAR *LPDIRECTDRAWGAMMACONTROL; - -typedef struct _DDFXROP FAR *LPDDFXROP; -typedef struct _DDSURFACEDESC FAR *LPDDSURFACEDESC; -typedef struct _DDSURFACEDESC2 FAR *LPDDSURFACEDESC2; -typedef struct _DDCOLORCONTROL FAR *LPDDCOLORCONTROL; - -/* - * API's - */ -#if (defined (WIN32) || defined( _WIN32 ) ) && !defined( _NO_COM ) -//#if defined( _WIN32 ) && !defined( _NO_ENUM ) - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID); - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID); - extern HRESULT WINAPI DirectDrawEnumerateW( LPDDENUMCALLBACKW lpCallback, LPVOID lpContext ); - extern HRESULT WINAPI DirectDrawEnumerateA( LPDDENUMCALLBACKA lpCallback, LPVOID lpContext ); - /* - * Protect against old SDKs - */ - #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) - #define HMONITOR_DECLARED - DECLARE_HANDLE(HMONITOR); - #endif - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR); - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID, HMONITOR); - extern HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags); - extern HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags); - typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags); - typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXW)( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags); - - #ifdef UNICODE - typedef LPDDENUMCALLBACKW LPDDENUMCALLBACK; - #define DirectDrawEnumerate DirectDrawEnumerateW - typedef LPDDENUMCALLBACKEXW LPDDENUMCALLBACKEX; - typedef LPDIRECTDRAWENUMERATEEXW LPDIRECTDRAWENUMERATEEX; - #define DirectDrawEnumerateEx DirectDrawEnumerateExW - #else - typedef LPDDENUMCALLBACKA LPDDENUMCALLBACK; - #define DirectDrawEnumerate DirectDrawEnumerateA - typedef LPDDENUMCALLBACKEXA LPDDENUMCALLBACKEX; - typedef LPDIRECTDRAWENUMERATEEXA LPDIRECTDRAWENUMERATEEX; - #define DirectDrawEnumerateEx DirectDrawEnumerateExA - #endif - extern HRESULT WINAPI DirectDrawCreate( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter ); - extern HRESULT WINAPI DirectDrawCreateEx( GUID FAR * lpGuid, LPVOID *lplpDD, REFIID iid,IUnknown FAR *pUnkOuter ); - extern HRESULT WINAPI DirectDrawCreateClipper( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter ); -#endif -/* - * Flags for DirectDrawEnumerateEx - * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to - * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx. - * By default, only the primary display device is enumerated. - * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES) - */ - -/* - * This flag causes enumeration of any GDI display devices which are part of - * the Windows Desktop - */ -#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L - -/* - * This flag causes enumeration of any GDI display devices which are not - * part of the Windows Desktop - */ -#define DDENUM_DETACHEDSECONDARYDEVICES 0x00000002L - -/* - * This flag causes enumeration of non-display devices - */ -#define DDENUM_NONDISPLAYDEVICES 0x00000004L - - -#define REGSTR_KEY_DDHW_DESCRIPTION "Description" -#define REGSTR_KEY_DDHW_DRIVERNAME "DriverName" -#define REGSTR_PATH_DDHW "Hardware\\DirectDrawDrivers" - -#define DDCREATE_HARDWAREONLY 0x00000001l -#define DDCREATE_EMULATIONONLY 0x00000002l - -#if defined(WINNT) || !defined(WIN32) -typedef long HRESULT; -#endif - -//#ifndef WINNT -typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID); -typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID); -typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID); -typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID); -typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK7)(LPDIRECTDRAWSURFACE7, LPDDSURFACEDESC2, LPVOID); -//#endif - -/* - * Generic pixel format with 8-bit RGB and alpha components - */ -typedef struct _DDARGB -{ - BYTE blue; - BYTE green; - BYTE red; - BYTE alpha; -} DDARGB; - -typedef DDARGB FAR *LPDDARGB; - -/* - * This version of the structure remains for backwards source compatibility. - * The DDARGB structure is the one that should be used for all DirectDraw APIs. - */ -typedef struct _DDRGBA -{ - BYTE red; - BYTE green; - BYTE blue; - BYTE alpha; -} DDRGBA; - -typedef DDRGBA FAR *LPDDRGBA; - - -/* - * DDCOLORKEY - */ -typedef struct _DDCOLORKEY -{ - DWORD dwColorSpaceLowValue; // low boundary of color space that is to - // be treated as Color Key, inclusive - DWORD dwColorSpaceHighValue; // high boundary of color space that is - // to be treated as Color Key, inclusive -} DDCOLORKEY; - -typedef DDCOLORKEY FAR* LPDDCOLORKEY; - -/* - * DDBLTFX - * Used to pass override information to the DIRECTDRAWSURFACE callback Blt. - */ -typedef struct _DDBLTFX -{ - DWORD dwSize; // size of structure - DWORD dwDDFX; // FX operations - DWORD dwROP; // Win32 raster operations - DWORD dwDDROP; // Raster operations new for DirectDraw - DWORD dwRotationAngle; // Rotation angle for blt - DWORD dwZBufferOpCode; // ZBuffer compares - DWORD dwZBufferLow; // Low limit of Z buffer - DWORD dwZBufferHigh; // High limit of Z buffer - DWORD dwZBufferBaseDest; // Destination base value - DWORD dwZDestConstBitDepth; // Bit depth used to specify Z constant for destination - union - { - DWORD dwZDestConst; // Constant to use as Z buffer for dest - LPDIRECTDRAWSURFACE lpDDSZBufferDest; // Surface to use as Z buffer for dest - } DUMMYUNIONNAMEN(1); - DWORD dwZSrcConstBitDepth; // Bit depth used to specify Z constant for source - union - { - DWORD dwZSrcConst; // Constant to use as Z buffer for src - LPDIRECTDRAWSURFACE lpDDSZBufferSrc; // Surface to use as Z buffer for src - } DUMMYUNIONNAMEN(2); - DWORD dwAlphaEdgeBlendBitDepth; // Bit depth used to specify constant for alpha edge blend - DWORD dwAlphaEdgeBlend; // Alpha for edge blending - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; // Bit depth used to specify alpha constant for destination - union - { - DWORD dwAlphaDestConst; // Constant to use as Alpha Channel - LPDIRECTDRAWSURFACE lpDDSAlphaDest; // Surface to use as Alpha Channel - } DUMMYUNIONNAMEN(3); - DWORD dwAlphaSrcConstBitDepth; // Bit depth used to specify alpha constant for source - union - { - DWORD dwAlphaSrcConst; // Constant to use as Alpha Channel - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; // Surface to use as Alpha Channel - } DUMMYUNIONNAMEN(4); - union - { - DWORD dwFillColor; // color in RGB or Palettized - DWORD dwFillDepth; // depth value for z-buffer - DWORD dwFillPixel; // pixel value for RGBA or RGBZ - LPDIRECTDRAWSURFACE lpDDSPattern; // Surface to use as pattern - } DUMMYUNIONNAMEN(5); - DDCOLORKEY ddckDestColorkey; // DestColorkey override - DDCOLORKEY ddckSrcColorkey; // SrcColorkey override -} DDBLTFX; - -typedef DDBLTFX FAR* LPDDBLTFX; - - - -/* - * DDSCAPS - */ -typedef struct _DDSCAPS -{ - DWORD dwCaps; // capabilities of surface wanted -} DDSCAPS; - -typedef DDSCAPS FAR* LPDDSCAPS; - - -/* - * DDOSCAPS - */ -typedef struct _DDOSCAPS -{ - DWORD dwCaps; // capabilities of surface wanted -} DDOSCAPS; - -typedef DDOSCAPS FAR* LPDDOSCAPS; - -/* - * This structure is used internally by DirectDraw. - */ -typedef struct _DDSCAPSEX -{ - DWORD dwCaps2; - DWORD dwCaps3; - union - { - DWORD dwCaps4; - DWORD dwVolumeDepth; - } DUMMYUNIONNAMEN(1); -} DDSCAPSEX, FAR * LPDDSCAPSEX; - -/* - * DDSCAPS2 - */ -typedef struct _DDSCAPS2 -{ - DWORD dwCaps; // capabilities of surface wanted - DWORD dwCaps2; - DWORD dwCaps3; - union - { - DWORD dwCaps4; - DWORD dwVolumeDepth; - } DUMMYUNIONNAMEN(1); -} DDSCAPS2; - -typedef DDSCAPS2 FAR* LPDDSCAPS2; - -/* - * DDCAPS - */ -#define DD_ROP_SPACE (256/32) // space required to store ROP array -/* - * NOTE: Our choosen structure number scheme is to append a single digit to - * the end of the structure giving the version that structure is associated - * with. - */ - -/* - * This structure represents the DDCAPS structure released in DirectDraw 1.0. It is used internally - * by DirectDraw to interpret caps passed into ddraw by drivers written prior to the release of DirectDraw 2.0. - * New applications should use the DDCAPS structure defined below. - */ -typedef struct _DDCAPS_DX1 -{ - DWORD dwSize; // size of the DDDRIVERCAPS structure - DWORD dwCaps; // driver specific capabilities - DWORD dwCaps2; // more driver specific capabilites - DWORD dwCKeyCaps; // color key capabilities of the surface - DWORD dwFXCaps; // driver specific stretching and effects capabilites - DWORD dwFXAlphaCaps; // alpha driver specific capabilities - DWORD dwPalCaps; // palette capabilities - DWORD dwSVCaps; // stereo vision capabilities - DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 - DWORD dwVidMemTotal; // total amount of video memory - DWORD dwVidMemFree; // amount of free video memory - DWORD dwMaxVisibleOverlays; // maximum number of visible overlays - DWORD dwCurrVisibleOverlays; // current number of visible overlays - DWORD dwNumFourCCCodes; // number of four cc codes - DWORD dwAlignBoundarySrc; // source rectangle alignment - DWORD dwAlignSizeSrc; // source rectangle byte size - DWORD dwAlignBoundaryDest; // dest rectangle alignment - DWORD dwAlignSizeDest; // dest rectangle byte size - DWORD dwAlignStrideAlign; // stride alignment - DWORD dwRops[DD_ROP_SPACE]; // ROPS supported - DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities - DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMinLiveVideoStretch; // OBSOLETE! This field remains for compatability reasons only - DWORD dwMaxLiveVideoStretch; // OBSOLETE! This field remains for compatability reasons only - DWORD dwMinHwCodecStretch; // OBSOLETE! This field remains for compatability reasons only - DWORD dwMaxHwCodecStretch; // OBSOLETE! This field remains for compatability reasons only - DWORD dwReserved1; // reserved - DWORD dwReserved2; // reserved - DWORD dwReserved3; // reserved -} DDCAPS_DX1; - -typedef DDCAPS_DX1 FAR* LPDDCAPS_DX1; - -/* - * This structure is the DDCAPS structure as it was in version 2 and 3 of Direct X. - * It is present for back compatability. - */ -typedef struct _DDCAPS_DX3 -{ - DWORD dwSize; // size of the DDDRIVERCAPS structure - DWORD dwCaps; // driver specific capabilities - DWORD dwCaps2; // more driver specific capabilites - DWORD dwCKeyCaps; // color key capabilities of the surface - DWORD dwFXCaps; // driver specific stretching and effects capabilites - DWORD dwFXAlphaCaps; // alpha driver specific capabilities - DWORD dwPalCaps; // palette capabilities - DWORD dwSVCaps; // stereo vision capabilities - DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 - DWORD dwVidMemTotal; // total amount of video memory - DWORD dwVidMemFree; // amount of free video memory - DWORD dwMaxVisibleOverlays; // maximum number of visible overlays - DWORD dwCurrVisibleOverlays; // current number of visible overlays - DWORD dwNumFourCCCodes; // number of four cc codes - DWORD dwAlignBoundarySrc; // source rectangle alignment - DWORD dwAlignSizeSrc; // source rectangle byte size - DWORD dwAlignBoundaryDest; // dest rectangle alignment - DWORD dwAlignSizeDest; // dest rectangle byte size - DWORD dwAlignStrideAlign; // stride alignment - DWORD dwRops[DD_ROP_SPACE]; // ROPS supported - DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities - DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwReserved1; // reserved - DWORD dwReserved2; // reserved - DWORD dwReserved3; // reserved - DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts - DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts - DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts - DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts - DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts - DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts - DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts - DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts - DWORD dwSSBCaps; // driver specific capabilities for System->System blts - DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts - DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts - DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts - DWORD dwReserved4; // reserved - DWORD dwReserved5; // reserved - DWORD dwReserved6; // reserved -} DDCAPS_DX3; -typedef DDCAPS_DX3 FAR* LPDDCAPS_DX3; - -/* - * This structure is the DDCAPS structure as it was in version 5 of Direct X. - * It is present for back compatability. - */ -typedef struct _DDCAPS_DX5 -{ -/* 0*/ DWORD dwSize; // size of the DDDRIVERCAPS structure -/* 4*/ DWORD dwCaps; // driver specific capabilities -/* 8*/ DWORD dwCaps2; // more driver specific capabilites -/* c*/ DWORD dwCKeyCaps; // color key capabilities of the surface -/* 10*/ DWORD dwFXCaps; // driver specific stretching and effects capabilites -/* 14*/ DWORD dwFXAlphaCaps; // alpha driver specific capabilities -/* 18*/ DWORD dwPalCaps; // palette capabilities -/* 1c*/ DWORD dwSVCaps; // stereo vision capabilities -/* 20*/ DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 -/* 24*/ DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 -/* 28*/ DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 -/* 2c*/ DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 -/* 30*/ DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 -/* 34*/ DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 -/* 38*/ DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 -/* 3c*/ DWORD dwVidMemTotal; // total amount of video memory -/* 40*/ DWORD dwVidMemFree; // amount of free video memory -/* 44*/ DWORD dwMaxVisibleOverlays; // maximum number of visible overlays -/* 48*/ DWORD dwCurrVisibleOverlays; // current number of visible overlays -/* 4c*/ DWORD dwNumFourCCCodes; // number of four cc codes -/* 50*/ DWORD dwAlignBoundarySrc; // source rectangle alignment -/* 54*/ DWORD dwAlignSizeSrc; // source rectangle byte size -/* 58*/ DWORD dwAlignBoundaryDest; // dest rectangle alignment -/* 5c*/ DWORD dwAlignSizeDest; // dest rectangle byte size -/* 60*/ DWORD dwAlignStrideAlign; // stride alignment -/* 64*/ DWORD dwRops[DD_ROP_SPACE]; // ROPS supported -/* 84*/ DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities -/* 88*/ DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 8c*/ DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 90*/ DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 94*/ DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 98*/ DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 9c*/ DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* a0*/ DWORD dwReserved1; // reserved -/* a4*/ DWORD dwReserved2; // reserved -/* a8*/ DWORD dwReserved3; // reserved -/* ac*/ DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts -/* b0*/ DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts -/* b4*/ DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts -/* b8*/ DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts -/* d8*/ DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts -/* dc*/ DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts -/* e0*/ DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts -/* e4*/ DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts -/*104*/ DWORD dwSSBCaps; // driver specific capabilities for System->System blts -/*108*/ DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts -/*10c*/ DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts -/*110*/ DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts -// Members added for DX5: -/*130*/ DWORD dwMaxVideoPorts; // maximum number of usable video ports -/*134*/ DWORD dwCurrVideoPorts; // current number of video ports used -/*138*/ DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts -/*13c*/ DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts -/*140*/ DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts -/*144*/ DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts -/*148*/ DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts -/*14c*/ DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts -} DDCAPS_DX5; -typedef DDCAPS_DX5 FAR* LPDDCAPS_DX5; - -typedef struct _DDCAPS_DX6 -{ -/* 0*/ DWORD dwSize; // size of the DDDRIVERCAPS structure -/* 4*/ DWORD dwCaps; // driver specific capabilities -/* 8*/ DWORD dwCaps2; // more driver specific capabilites -/* c*/ DWORD dwCKeyCaps; // color key capabilities of the surface -/* 10*/ DWORD dwFXCaps; // driver specific stretching and effects capabilites -/* 14*/ DWORD dwFXAlphaCaps; // alpha caps -/* 18*/ DWORD dwPalCaps; // palette capabilities -/* 1c*/ DWORD dwSVCaps; // stereo vision capabilities -/* 20*/ DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 -/* 24*/ DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 -/* 28*/ DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 -/* 2c*/ DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 -/* 30*/ DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 -/* 34*/ DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 -/* 38*/ DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 -/* 3c*/ DWORD dwVidMemTotal; // total amount of video memory -/* 40*/ DWORD dwVidMemFree; // amount of free video memory -/* 44*/ DWORD dwMaxVisibleOverlays; // maximum number of visible overlays -/* 48*/ DWORD dwCurrVisibleOverlays; // current number of visible overlays -/* 4c*/ DWORD dwNumFourCCCodes; // number of four cc codes -/* 50*/ DWORD dwAlignBoundarySrc; // source rectangle alignment -/* 54*/ DWORD dwAlignSizeSrc; // source rectangle byte size -/* 58*/ DWORD dwAlignBoundaryDest; // dest rectangle alignment -/* 5c*/ DWORD dwAlignSizeDest; // dest rectangle byte size -/* 60*/ DWORD dwAlignStrideAlign; // stride alignment -/* 64*/ DWORD dwRops[DD_ROP_SPACE]; // ROPS supported -/* 84*/ DDSCAPS ddsOldCaps; // Was DDSCAPS ddsCaps. ddsCaps is of type DDSCAPS2 for DX6 -/* 88*/ DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 8c*/ DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 90*/ DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 94*/ DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 98*/ DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 9c*/ DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* a0*/ DWORD dwReserved1; // reserved -/* a4*/ DWORD dwReserved2; // reserved -/* a8*/ DWORD dwReserved3; // reserved -/* ac*/ DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts -/* b0*/ DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts -/* b4*/ DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts -/* b8*/ DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts -/* d8*/ DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts -/* dc*/ DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts -/* e0*/ DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts -/* e4*/ DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts -/*104*/ DWORD dwSSBCaps; // driver specific capabilities for System->System blts -/*108*/ DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts -/*10c*/ DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts -/*110*/ DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts -/*130*/ DWORD dwMaxVideoPorts; // maximum number of usable video ports -/*134*/ DWORD dwCurrVideoPorts; // current number of video ports used -/*138*/ DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts -/*13c*/ DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts -/*140*/ DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts -/*144*/ DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts -/*148*/ DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts -/*14c*/ DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts -// Members added for DX6 release -/*16c*/ DDSCAPS2 ddsCaps; // Surface Caps -} DDCAPS_DX6; -typedef DDCAPS_DX6 FAR* LPDDCAPS_DX6; - -typedef struct _DDCAPS_DX7 -{ -/* 0*/ DWORD dwSize; // size of the DDDRIVERCAPS structure -/* 4*/ DWORD dwCaps; // driver specific capabilities -/* 8*/ DWORD dwCaps2; // more driver specific capabilites -/* c*/ DWORD dwCKeyCaps; // color key capabilities of the surface -/* 10*/ DWORD dwFXCaps; // driver specific stretching and effects capabilites -/* 14*/ DWORD dwFXAlphaCaps; // alpha driver specific capabilities -/* 18*/ DWORD dwPalCaps; // palette capabilities -/* 1c*/ DWORD dwSVCaps; // stereo vision capabilities -/* 20*/ DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 -/* 24*/ DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 -/* 28*/ DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 -/* 2c*/ DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 -/* 30*/ DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 -/* 34*/ DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 -/* 38*/ DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 -/* 3c*/ DWORD dwVidMemTotal; // total amount of video memory -/* 40*/ DWORD dwVidMemFree; // amount of free video memory -/* 44*/ DWORD dwMaxVisibleOverlays; // maximum number of visible overlays -/* 48*/ DWORD dwCurrVisibleOverlays; // current number of visible overlays -/* 4c*/ DWORD dwNumFourCCCodes; // number of four cc codes -/* 50*/ DWORD dwAlignBoundarySrc; // source rectangle alignment -/* 54*/ DWORD dwAlignSizeSrc; // source rectangle byte size -/* 58*/ DWORD dwAlignBoundaryDest; // dest rectangle alignment -/* 5c*/ DWORD dwAlignSizeDest; // dest rectangle byte size -/* 60*/ DWORD dwAlignStrideAlign; // stride alignment -/* 64*/ DWORD dwRops[DD_ROP_SPACE]; // ROPS supported -/* 84*/ DDSCAPS ddsOldCaps; // Was DDSCAPS ddsCaps. ddsCaps is of type DDSCAPS2 for DX6 -/* 88*/ DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 8c*/ DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 90*/ DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 94*/ DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 98*/ DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 9c*/ DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* a0*/ DWORD dwReserved1; // reserved -/* a4*/ DWORD dwReserved2; // reserved -/* a8*/ DWORD dwReserved3; // reserved -/* ac*/ DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts -/* b0*/ DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts -/* b4*/ DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts -/* b8*/ DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts -/* d8*/ DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts -/* dc*/ DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts -/* e0*/ DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts -/* e4*/ DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts -/*104*/ DWORD dwSSBCaps; // driver specific capabilities for System->System blts -/*108*/ DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts -/*10c*/ DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts -/*110*/ DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts -/*130*/ DWORD dwMaxVideoPorts; // maximum number of usable video ports -/*134*/ DWORD dwCurrVideoPorts; // current number of video ports used -/*138*/ DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts -/*13c*/ DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts -/*140*/ DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts -/*144*/ DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts -/*148*/ DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts -/*14c*/ DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts -// Members added for DX6 release -/*16c*/ DDSCAPS2 ddsCaps; // Surface Caps -} DDCAPS_DX7; -typedef DDCAPS_DX7 FAR* LPDDCAPS_DX7; - - -#if DIRECTDRAW_VERSION <= 0x300 - typedef DDCAPS_DX3 DDCAPS; -#elif DIRECTDRAW_VERSION <= 0x500 - typedef DDCAPS_DX5 DDCAPS; -#elif DIRECTDRAW_VERSION <= 0x600 - typedef DDCAPS_DX6 DDCAPS; -#else - typedef DDCAPS_DX7 DDCAPS; -#endif - -typedef DDCAPS FAR* LPDDCAPS; - - - -/* - * DDPIXELFORMAT - */ -typedef struct _DDPIXELFORMAT -{ - DWORD dwSize; // size of structure - DWORD dwFlags; // pixel format flags - DWORD dwFourCC; // (FOURCC code) - union - { - DWORD dwRGBBitCount; // how many bits per pixel - DWORD dwYUVBitCount; // how many bits per pixel - DWORD dwZBufferBitDepth; // how many total bits/pixel in z buffer (including any stencil bits) - DWORD dwAlphaBitDepth; // how many bits for alpha channels - DWORD dwLuminanceBitCount; // how many bits per pixel - DWORD dwBumpBitCount; // how many bits per "buxel", total - DWORD dwPrivateFormatBitCount;// Bits per pixel of private driver formats. Only valid in texture - // format list and if DDPF_D3DFORMAT is set - } DUMMYUNIONNAMEN(1); - union - { - DWORD dwRBitMask; // mask for red bit - DWORD dwYBitMask; // mask for Y bits - DWORD dwStencilBitDepth; // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits) - DWORD dwLuminanceBitMask; // mask for luminance bits - DWORD dwBumpDuBitMask; // mask for bump map U delta bits - DWORD dwOperations; // DDPF_D3DFORMAT Operations - } DUMMYUNIONNAMEN(2); - union - { - DWORD dwGBitMask; // mask for green bits - DWORD dwUBitMask; // mask for U bits - DWORD dwZBitMask; // mask for Z bits - DWORD dwBumpDvBitMask; // mask for bump map V delta bits - struct - { - WORD wFlipMSTypes; // Multisample methods supported via flip for this D3DFORMAT - WORD wBltMSTypes; // Multisample methods supported via blt for this D3DFORMAT - } MultiSampleCaps; - - } DUMMYUNIONNAMEN(3); - union - { - DWORD dwBBitMask; // mask for blue bits - DWORD dwVBitMask; // mask for V bits - DWORD dwStencilBitMask; // mask for stencil bits - DWORD dwBumpLuminanceBitMask; // mask for luminance in bump map - } DUMMYUNIONNAMEN(4); - union - { - DWORD dwRGBAlphaBitMask; // mask for alpha channel - DWORD dwYUVAlphaBitMask; // mask for alpha channel - DWORD dwLuminanceAlphaBitMask;// mask for alpha channel - DWORD dwRGBZBitMask; // mask for Z channel - DWORD dwYUVZBitMask; // mask for Z channel - } DUMMYUNIONNAMEN(5); -} DDPIXELFORMAT; - -typedef DDPIXELFORMAT FAR* LPDDPIXELFORMAT; - -/* - * DDOVERLAYFX - */ -typedef struct _DDOVERLAYFX -{ - DWORD dwSize; // size of structure - DWORD dwAlphaEdgeBlendBitDepth; // Bit depth used to specify constant for alpha edge blend - DWORD dwAlphaEdgeBlend; // Constant to use as alpha for edge blend - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; // Bit depth used to specify alpha constant for destination - union - { - DWORD dwAlphaDestConst; // Constant to use as alpha channel for dest - LPDIRECTDRAWSURFACE lpDDSAlphaDest; // Surface to use as alpha channel for dest - } DUMMYUNIONNAMEN(1); - DWORD dwAlphaSrcConstBitDepth; // Bit depth used to specify alpha constant for source - union - { - DWORD dwAlphaSrcConst; // Constant to use as alpha channel for src - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; // Surface to use as alpha channel for src - } DUMMYUNIONNAMEN(2); - DDCOLORKEY dckDestColorkey; // DestColorkey override - DDCOLORKEY dckSrcColorkey; // DestColorkey override - DWORD dwDDFX; // Overlay FX - DWORD dwFlags; // flags -} DDOVERLAYFX; - -typedef DDOVERLAYFX FAR *LPDDOVERLAYFX; - - -/* - * DDBLTBATCH: BltBatch entry structure - */ -typedef struct _DDBLTBATCH -{ - LPRECT lprDest; - LPDIRECTDRAWSURFACE lpDDSSrc; - LPRECT lprSrc; - DWORD dwFlags; - LPDDBLTFX lpDDBltFx; -} DDBLTBATCH; - -typedef DDBLTBATCH FAR * LPDDBLTBATCH; - - -/* - * DDGAMMARAMP - */ -typedef struct _DDGAMMARAMP -{ - WORD red[256]; - WORD green[256]; - WORD blue[256]; -} DDGAMMARAMP; -typedef DDGAMMARAMP FAR * LPDDGAMMARAMP; - -/* - * This is the structure within which DirectDraw returns data about the current graphics driver and chipset - */ - -#define MAX_DDDEVICEID_STRING 512 - -typedef struct tagDDDEVICEIDENTIFIER -{ - /* - * These elements are for presentation to the user only. They should not be used to identify particular - * drivers, since this is unreliable and many different strings may be associated with the same - * device, and the same driver from different vendors. - */ - char szDriver[MAX_DDDEVICEID_STRING]; - char szDescription[MAX_DDDEVICEID_STRING]; - - /* - * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons - * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic - * drivers. It is recommended that guidDeviceIdentifier is used for this purpose. - * - * This version has the form: - * wProduct = HIWORD(liDriverVersion.HighPart) - * wVersion = LOWORD(liDriverVersion.HighPart) - * wSubVersion = HIWORD(liDriverVersion.LowPart) - * wBuild = LOWORD(liDriverVersion.LowPart) - */ -#ifdef _WIN32 - LARGE_INTEGER liDriverVersion; /* Defined for applications and other 32 bit components */ -#else - DWORD dwDriverVersionLowPart; /* Defined for 16 bit driver components */ - DWORD dwDriverVersionHighPart; -#endif - - - /* - * These elements can be used to identify particular chipsets. Use with extreme caution. - * dwVendorId Identifies the manufacturer. May be zero if unknown. - * dwDeviceId Identifies the type of chipset. May be zero if unknown. - * dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown. - * dwRevision Identifies the revision level of the chipset. May be zero if unknown. - */ - DWORD dwVendorId; - DWORD dwDeviceId; - DWORD dwSubSysId; - DWORD dwRevision; - - /* - * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the - * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to - * reprofile the graphics subsystem. - * This element can also be used to identify particular problematic drivers. - */ - GUID guidDeviceIdentifier; -} DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER; - -typedef struct tagDDDEVICEIDENTIFIER2 -{ - /* - * These elements are for presentation to the user only. They should not be used to identify particular - * drivers, since this is unreliable and many different strings may be associated with the same - * device, and the same driver from different vendors. - */ - char szDriver[MAX_DDDEVICEID_STRING]; - char szDescription[MAX_DDDEVICEID_STRING]; - - /* - * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons - * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic - * drivers. It is recommended that guidDeviceIdentifier is used for this purpose. - * - * This version has the form: - * wProduct = HIWORD(liDriverVersion.HighPart) - * wVersion = LOWORD(liDriverVersion.HighPart) - * wSubVersion = HIWORD(liDriverVersion.LowPart) - * wBuild = LOWORD(liDriverVersion.LowPart) - */ -#ifdef _WIN32 - LARGE_INTEGER liDriverVersion; /* Defined for applications and other 32 bit components */ -#else - DWORD dwDriverVersionLowPart; /* Defined for 16 bit driver components */ - DWORD dwDriverVersionHighPart; -#endif - - - /* - * These elements can be used to identify particular chipsets. Use with extreme caution. - * dwVendorId Identifies the manufacturer. May be zero if unknown. - * dwDeviceId Identifies the type of chipset. May be zero if unknown. - * dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown. - * dwRevision Identifies the revision level of the chipset. May be zero if unknown. - */ - DWORD dwVendorId; - DWORD dwDeviceId; - DWORD dwSubSysId; - DWORD dwRevision; - - /* - * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the - * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to - * reprofile the graphics subsystem. - * This element can also be used to identify particular problematic drivers. - */ - GUID guidDeviceIdentifier; - - /* - * This element is used to determine the Windows Hardware Quality Lab (WHQL) - * certification level for this driver/device pair. - */ - DWORD dwWHQLLevel; - -} DDDEVICEIDENTIFIER2, * LPDDDEVICEIDENTIFIER2; - -/* - * Flags for the IDirectDraw4::GetDeviceIdentifier method - */ - -/* - * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped - * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the - * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is - * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities - * of the DirectDraw object involved. - */ -#define DDGDI_GETHOSTIDENTIFIER 0x00000001L - -/* - * Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel - */ -#define GET_WHQL_YEAR( dwWHQLLevel ) \ - ( (dwWHQLLevel) / 0x10000 ) -#define GET_WHQL_MONTH( dwWHQLLevel ) \ - ( ( (dwWHQLLevel) / 0x100 ) & 0x00ff ) -#define GET_WHQL_DAY( dwWHQLLevel ) \ - ( (dwWHQLLevel) & 0xff ) - - -/* - * callbacks - */ -typedef DWORD (FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper, HWND hWnd, DWORD code, LPVOID lpContext ); -#ifdef STREAMING -typedef DWORD (FAR PASCAL *LPSURFACESTREAMINGCALLBACK)(DWORD); -#endif - - -/* - * INTERACES FOLLOW: - * IDirectDraw - * IDirectDrawClipper - * IDirectDrawPalette - * IDirectDrawSurface - */ - -/* - * IDirectDraw - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw -DECLARE_INTERFACE_( IDirectDraw, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw_SetDisplayMode(p, a, b, c) (p)->lpVtbl->SetDisplayMode(p, a, b, c) -#define IDirectDraw_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#else -#define IDirectDraw_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDraw_AddRef(p) (p)->AddRef() -#define IDirectDraw_Release(p) (p)->Release() -#define IDirectDraw_Compact(p) (p)->Compact() -#define IDirectDraw_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) -#define IDirectDraw_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) -#define IDirectDraw_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) -#define IDirectDraw_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) -#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) -#define IDirectDraw_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) -#define IDirectDraw_FlipToGDISurface(p) (p)->FlipToGDISurface() -#define IDirectDraw_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirectDraw_GetDisplayMode(p, a) (p)->GetDisplayMode(a) -#define IDirectDraw_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) -#define IDirectDraw_GetGDISurface(p, a) (p)->GetGDISurface(a) -#define IDirectDraw_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) -#define IDirectDraw_GetScanLine(p, a) (p)->GetScanLine(a) -#define IDirectDraw_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) -#define IDirectDraw_Initialize(p, a) (p)->Initialize(a) -#define IDirectDraw_RestoreDisplayMode(p) (p)->RestoreDisplayMode() -#define IDirectDraw_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) -#define IDirectDraw_SetDisplayMode(p, a, b, c) (p)->SetDisplayMode(a, b, c) -#define IDirectDraw_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) -#endif - -#endif - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw2 -DECLARE_INTERFACE_( IDirectDraw2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE; -}; -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw2_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw2_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw2_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw2_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw2_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw2_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw2_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw2_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw2_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw2_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw2_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw2_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw2_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw2_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw2_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw2_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw2_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) -#define IDirectDraw2_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#define IDirectDraw2_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) -#else -#define IDirectDraw2_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDraw2_AddRef(p) (p)->AddRef() -#define IDirectDraw2_Release(p) (p)->Release() -#define IDirectDraw2_Compact(p) (p)->Compact() -#define IDirectDraw2_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) -#define IDirectDraw2_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) -#define IDirectDraw2_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) -#define IDirectDraw2_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) -#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) -#define IDirectDraw2_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) -#define IDirectDraw2_FlipToGDISurface(p) (p)->FlipToGDISurface() -#define IDirectDraw2_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirectDraw2_GetDisplayMode(p, a) (p)->GetDisplayMode(a) -#define IDirectDraw2_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) -#define IDirectDraw2_GetGDISurface(p, a) (p)->GetGDISurface(a) -#define IDirectDraw2_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) -#define IDirectDraw2_GetScanLine(p, a) (p)->GetScanLine(a) -#define IDirectDraw2_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) -#define IDirectDraw2_Initialize(p, a) (p)->Initialize(a) -#define IDirectDraw2_RestoreDisplayMode(p) (p)->RestoreDisplayMode() -#define IDirectDraw2_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) -#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e) -#define IDirectDraw2_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) -#define IDirectDraw2_GetAvailableVidMem(p, a, b, c) (p)->GetAvailableVidMem(a, b, c) -#endif - -#endif - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw4 -DECLARE_INTERFACE_( IDirectDraw4, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE4 FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE4, LPDIRECTDRAWSURFACE4 FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2 ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID,LPDDENUMSURFACESCALLBACK2 ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC2) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE4 FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE; - /*** Added in the V4 Interface ***/ - STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE4 *) PURE; - STDMETHOD(RestoreAllSurfaces)(THIS) PURE; - STDMETHOD(TestCooperativeLevel)(THIS) PURE; - STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER, DWORD ) PURE; -}; -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw4_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw4_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw4_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw4_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw4_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw4_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw4_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw4_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw4_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw4_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw4_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw4_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw4_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw4_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw4_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw4_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw4_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw4_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw4_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw4_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) -#define IDirectDraw4_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#define IDirectDraw4_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) -#define IDirectDraw4_GetSurfaceFromDC(p, a, b) (p)->lpVtbl->GetSurfaceFromDC(p, a, b) -#define IDirectDraw4_RestoreAllSurfaces(p) (p)->lpVtbl->RestoreAllSurfaces(p) -#define IDirectDraw4_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) -#define IDirectDraw4_GetDeviceIdentifier(p,a,b) (p)->lpVtbl->GetDeviceIdentifier(p,a,b) -#else -#define IDirectDraw4_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDraw4_AddRef(p) (p)->AddRef() -#define IDirectDraw4_Release(p) (p)->Release() -#define IDirectDraw4_Compact(p) (p)->Compact() -#define IDirectDraw4_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) -#define IDirectDraw4_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) -#define IDirectDraw4_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) -#define IDirectDraw4_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) -#define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) -#define IDirectDraw4_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) -#define IDirectDraw4_FlipToGDISurface(p) (p)->FlipToGDISurface() -#define IDirectDraw4_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirectDraw4_GetDisplayMode(p, a) (p)->GetDisplayMode(a) -#define IDirectDraw4_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) -#define IDirectDraw4_GetGDISurface(p, a) (p)->GetGDISurface(a) -#define IDirectDraw4_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) -#define IDirectDraw4_GetScanLine(p, a) (p)->GetScanLine(a) -#define IDirectDraw4_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) -#define IDirectDraw4_Initialize(p, a) (p)->Initialize(a) -#define IDirectDraw4_RestoreDisplayMode(p) (p)->RestoreDisplayMode() -#define IDirectDraw4_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) -#define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e) -#define IDirectDraw4_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) -#define IDirectDraw4_GetAvailableVidMem(p, a, b, c) (p)->GetAvailableVidMem(a, b, c) -#define IDirectDraw4_GetSurfaceFromDC(p, a, b) (p)->GetSurfaceFromDC(a, b) -#define IDirectDraw4_RestoreAllSurfaces(p) (p)->RestoreAllSurfaces() -#define IDirectDraw4_TestCooperativeLevel(p) (p)->TestCooperativeLevel() -#define IDirectDraw4_GetDeviceIdentifier(p,a,b) (p)->GetDeviceIdentifier(a,b) -#endif - -#endif - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw7 -DECLARE_INTERFACE_( IDirectDraw7, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE7 FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE7, LPDIRECTDRAWSURFACE7 FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2 ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID,LPDDENUMSURFACESCALLBACK7 ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC2) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE7 FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE; - /*** Added in the V4 Interface ***/ - STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE7 *) PURE; - STDMETHOD(RestoreAllSurfaces)(THIS) PURE; - STDMETHOD(TestCooperativeLevel)(THIS) PURE; - STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER2, DWORD ) PURE; - STDMETHOD(StartModeTest)(THIS_ LPSIZE, DWORD, DWORD ) PURE; - STDMETHOD(EvaluateMode)(THIS_ DWORD, DWORD * ) PURE; -}; -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw7_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw7_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw7_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw7_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw7_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw7_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw7_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw7_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw7_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw7_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw7_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw7_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw7_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw7_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw7_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw7_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw7_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw7_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw7_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw7_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw7_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) -#define IDirectDraw7_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#define IDirectDraw7_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) -#define IDirectDraw7_GetSurfaceFromDC(p, a, b) (p)->lpVtbl->GetSurfaceFromDC(p, a, b) -#define IDirectDraw7_RestoreAllSurfaces(p) (p)->lpVtbl->RestoreAllSurfaces(p) -#define IDirectDraw7_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) -#define IDirectDraw7_GetDeviceIdentifier(p,a,b) (p)->lpVtbl->GetDeviceIdentifier(p,a,b) -#define IDirectDraw7_StartModeTest(p,a,b,c) (p)->lpVtbl->StartModeTest(p,a,b,c) -#define IDirectDraw7_EvaluateMode(p,a,b) (p)->lpVtbl->EvaluateMode(p,a,b) -#else -#define IDirectDraw7_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDraw7_AddRef(p) (p)->AddRef() -#define IDirectDraw7_Release(p) (p)->Release() -#define IDirectDraw7_Compact(p) (p)->Compact() -#define IDirectDraw7_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) -#define IDirectDraw7_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) -#define IDirectDraw7_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) -#define IDirectDraw7_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) -#define IDirectDraw7_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) -#define IDirectDraw7_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) -#define IDirectDraw7_FlipToGDISurface(p) (p)->FlipToGDISurface() -#define IDirectDraw7_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirectDraw7_GetDisplayMode(p, a) (p)->GetDisplayMode(a) -#define IDirectDraw7_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) -#define IDirectDraw7_GetGDISurface(p, a) (p)->GetGDISurface(a) -#define IDirectDraw7_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) -#define IDirectDraw7_GetScanLine(p, a) (p)->GetScanLine(a) -#define IDirectDraw7_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) -#define IDirectDraw7_Initialize(p, a) (p)->Initialize(a) -#define IDirectDraw7_RestoreDisplayMode(p) (p)->RestoreDisplayMode() -#define IDirectDraw7_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) -#define IDirectDraw7_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e) -#define IDirectDraw7_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) -#define IDirectDraw7_GetAvailableVidMem(p, a, b, c) (p)->GetAvailableVidMem(a, b, c) -#define IDirectDraw7_GetSurfaceFromDC(p, a, b) (p)->GetSurfaceFromDC(a, b) -#define IDirectDraw7_RestoreAllSurfaces(p) (p)->RestoreAllSurfaces() -#define IDirectDraw7_TestCooperativeLevel(p) (p)->TestCooperativeLevel() -#define IDirectDraw7_GetDeviceIdentifier(p,a,b) (p)->GetDeviceIdentifier(a,b) -#define IDirectDraw7_StartModeTest(p,a,b,c) (p)->lpVtbl->StartModeTest(a,b,c) -#define IDirectDraw7_EvaluateMode(p,a,b) (p)->lpVtbl->EvaluateMode(a,b) -#endif - -#endif - - -/* - * IDirectDrawPalette - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawPalette -DECLARE_INTERFACE_( IDirectDrawPalette, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawPalette methods ***/ - STDMETHOD(GetCaps)(THIS_ LPDWORD) PURE; - STDMETHOD(GetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD, LPPALETTEENTRY) PURE; - STDMETHOD(SetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawPalette_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawPalette_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawPalette_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawPalette_GetCaps(p, a) (p)->lpVtbl->GetCaps(p, a) -#define IDirectDrawPalette_GetEntries(p, a, b, c, d) (p)->lpVtbl->GetEntries(p, a, b, c, d) -#define IDirectDrawPalette_Initialize(p, a, b, c) (p)->lpVtbl->Initialize(p, a, b, c) -#define IDirectDrawPalette_SetEntries(p, a, b, c, d) (p)->lpVtbl->SetEntries(p, a, b, c, d) -#else -#define IDirectDrawPalette_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawPalette_AddRef(p) (p)->AddRef() -#define IDirectDrawPalette_Release(p) (p)->Release() -#define IDirectDrawPalette_GetCaps(p, a) (p)->GetCaps(a) -#define IDirectDrawPalette_GetEntries(p, a, b, c, d) (p)->GetEntries(a, b, c, d) -#define IDirectDrawPalette_Initialize(p, a, b, c) (p)->Initialize(a, b, c) -#define IDirectDrawPalette_SetEntries(p, a, b, c, d) (p)->SetEntries(a, b, c, d) -#endif - -#endif - - -/* - * IDirectDrawClipper - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawClipper -DECLARE_INTERFACE_( IDirectDrawClipper, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawClipper methods ***/ - STDMETHOD(GetClipList)(THIS_ LPRECT, LPRGNDATA, LPDWORD) PURE; - STDMETHOD(GetHWnd)(THIS_ HWND FAR *) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD) PURE; - STDMETHOD(IsClipListChanged)(THIS_ BOOL FAR *) PURE; - STDMETHOD(SetClipList)(THIS_ LPRGNDATA,DWORD) PURE; - STDMETHOD(SetHWnd)(THIS_ DWORD, HWND ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawClipper_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawClipper_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawClipper_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawClipper_GetClipList(p, a, b, c) (p)->lpVtbl->GetClipList(p, a, b, c) -#define IDirectDrawClipper_GetHWnd(p, a) (p)->lpVtbl->GetHWnd(p, a) -#define IDirectDrawClipper_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b) -#define IDirectDrawClipper_IsClipListChanged(p, a) (p)->lpVtbl->IsClipListChanged(p, a) -#define IDirectDrawClipper_SetClipList(p, a, b) (p)->lpVtbl->SetClipList(p, a, b) -#define IDirectDrawClipper_SetHWnd(p, a, b) (p)->lpVtbl->SetHWnd(p, a, b) -#else -#define IDirectDrawClipper_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawClipper_AddRef(p) (p)->AddRef() -#define IDirectDrawClipper_Release(p) (p)->Release() -#define IDirectDrawClipper_GetClipList(p, a, b, c) (p)->GetClipList(a, b, c) -#define IDirectDrawClipper_GetHWnd(p, a) (p)->GetHWnd(a) -#define IDirectDrawClipper_Initialize(p, a, b) (p)->Initialize(a, b) -#define IDirectDrawClipper_IsClipListChanged(p, a) (p)->IsClipListChanged(a) -#define IDirectDrawClipper_SetClipList(p, a, b) (p)->SetClipList(a, b) -#define IDirectDrawClipper_SetHWnd(p, a, b) (p)->SetHWnd(a, b) -#endif - -#endif - -/* - * IDirectDrawSurface and related interfaces - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawSurface -DECLARE_INTERFACE_( IDirectDrawSurface, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#else -#define IDirectDrawSurface_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface_Release(p) (p)->Release() -#define IDirectDrawSurface_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface_Restore(p) (p)->Restore() -#define IDirectDrawSurface_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#endif - -/* - * IDirectDrawSurface2 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface2 -DECLARE_INTERFACE_( IDirectDrawSurface2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE2, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE2) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE2 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface2_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface2_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface2_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface2_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface2_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface2_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface2_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface2_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface2_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface2_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface2_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface2_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface2_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface2_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface2_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface2_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface2_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface2_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface2_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface2_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface2_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface2_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface2_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#else -#define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface2_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface2_Release(p) (p)->Release() -#define IDirectDrawSurface2_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface2_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface2_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface2_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface2_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface2_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface2_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface2_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface2_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface2_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface2_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface2_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface2_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface2_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface2_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface2_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface2_Restore(p) (p)->Restore() -#define IDirectDrawSurface2_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface2_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface2_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface2_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#define IDirectDrawSurface2_GetDDInterface(p,a) (p)->GetDDInterface(a) -#define IDirectDrawSurface2_PageLock(p,a) (p)->PageLock(a) -#define IDirectDrawSurface2_PageUnlock(p,a) (p)->PageUnlock(a) -#endif - -/* - * IDirectDrawSurface3 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface3 -DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; - /*** Added in the V3 interface ***/ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface3_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface3_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface3_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface3_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface3_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface3_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface3_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface3_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface3_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface3_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface3_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface3_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface3_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface3_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface3_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface3_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface3_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface3_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface3_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface3_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface3_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface3_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface3_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface3_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface3_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b) -#else -#define IDirectDrawSurface3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface3_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface3_Release(p) (p)->Release() -#define IDirectDrawSurface3_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface3_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface3_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface3_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface3_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface3_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface3_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface3_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface3_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface3_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface3_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface3_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface3_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface3_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface3_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface3_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface3_Restore(p) (p)->Restore() -#define IDirectDrawSurface3_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface3_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface3_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface3_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#define IDirectDrawSurface3_GetDDInterface(p,a) (p)->GetDDInterface(a) -#define IDirectDrawSurface3_PageLock(p,a) (p)->PageLock(a) -#define IDirectDrawSurface3_PageUnlock(p,a) (p)->PageUnlock(a) -#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b) -#endif - -/* - * IDirectDrawSurface4 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface4 -DECLARE_INTERFACE_( IDirectDrawSurface4, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE4, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE4, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE4) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK2) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE4 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPRECT) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE4) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; - /*** Added in the v3 interface ***/ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE; - /*** Added in the v4 interface ***/ - STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE; - STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE; - STDMETHOD(ChangeUniquenessValue)(THIS) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface4_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface4_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface4_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface4_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface4_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface4_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface4_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface4_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface4_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface4_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface4_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface4_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface4_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface4_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface4_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface4_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface4_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface4_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface4_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface4_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface4_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface4_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface4_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface4_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface4_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface4_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface4_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b) -#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirectDrawSurface4_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirectDrawSurface4_GetUniquenessValue(p, a) (p)->lpVtbl->GetUniquenessValue(p, a) -#define IDirectDrawSurface4_ChangeUniquenessValue(p) (p)->lpVtbl->ChangeUniquenessValue(p) -#else -#define IDirectDrawSurface4_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface4_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface4_Release(p) (p)->Release() -#define IDirectDrawSurface4_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface4_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface4_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface4_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface4_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface4_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface4_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface4_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface4_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface4_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface4_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface4_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface4_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface4_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface4_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface4_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface4_Restore(p) (p)->Restore() -#define IDirectDrawSurface4_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface4_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface4_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface4_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#define IDirectDrawSurface4_GetDDInterface(p,a) (p)->GetDDInterface(a) -#define IDirectDrawSurface4_PageLock(p,a) (p)->PageLock(a) -#define IDirectDrawSurface4_PageUnlock(p,a) (p)->PageUnlock(a) -#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b) -#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirectDrawSurface4_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirectDrawSurface4_GetUniquenessValue(p, a) (p)->GetUniquenessValue(a) -#define IDirectDrawSurface4_ChangeUniquenessValue(p) (p)->ChangeUniquenessValue() -#endif - -/* - * IDirectDrawSurface7 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface7 -DECLARE_INTERFACE_( IDirectDrawSurface7, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE7) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE7, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE7, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE7) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK7) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK7) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE7, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE7 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPRECT) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE7,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE7) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; - /*** Added in the v3 interface ***/ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE; - /*** Added in the v4 interface ***/ - STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE; - STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE; - STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE; - STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE; - STDMETHOD(ChangeUniquenessValue)(THIS) PURE; - /*** Moved Texture7 methods here ***/ - STDMETHOD(SetPriority)(THIS_ DWORD) PURE; - STDMETHOD(GetPriority)(THIS_ LPDWORD) PURE; - STDMETHOD(SetLOD)(THIS_ DWORD) PURE; - STDMETHOD(GetLOD)(THIS_ LPDWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface7_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface7_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface7_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface7_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface7_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface7_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface7_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface7_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface7_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface7_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface7_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface7_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface7_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface7_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface7_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface7_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface7_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface7_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface7_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface7_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface7_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface7_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface7_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface7_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface7_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b) -#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) -#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) -#define IDirectDrawSurface7_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) -#define IDirectDrawSurface7_GetUniquenessValue(p, a) (p)->lpVtbl->GetUniquenessValue(p, a) -#define IDirectDrawSurface7_ChangeUniquenessValue(p) (p)->lpVtbl->ChangeUniquenessValue(p) -#define IDirectDrawSurface7_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IDirectDrawSurface7_GetPriority(p,a) (p)->lpVtbl->GetPriority(p,a) -#define IDirectDrawSurface7_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) -#define IDirectDrawSurface7_GetLOD(p,a) (p)->lpVtbl->GetLOD(p,a) -#else -#define IDirectDrawSurface7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface7_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface7_Release(p) (p)->Release() -#define IDirectDrawSurface7_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface7_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface7_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface7_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface7_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface7_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface7_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface7_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface7_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface7_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface7_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface7_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface7_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface7_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface7_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface7_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface7_Restore(p) (p)->Restore() -#define IDirectDrawSurface7_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface7_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface7_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface7_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#define IDirectDrawSurface7_GetDDInterface(p,a) (p)->GetDDInterface(a) -#define IDirectDrawSurface7_PageLock(p,a) (p)->PageLock(a) -#define IDirectDrawSurface7_PageUnlock(p,a) (p)->PageUnlock(a) -#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b) -#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) -#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) -#define IDirectDrawSurface7_FreePrivateData(p,a) (p)->FreePrivateData(a) -#define IDirectDrawSurface7_GetUniquenessValue(p, a) (p)->GetUniquenessValue(a) -#define IDirectDrawSurface7_ChangeUniquenessValue(p) (p)->ChangeUniquenessValue() -#define IDirectDrawSurface7_SetPriority(p,a) (p)->SetPriority(a) -#define IDirectDrawSurface7_GetPriority(p,a) (p)->GetPriority(a) -#define IDirectDrawSurface7_SetLOD(p,a) (p)->SetLOD(a) -#define IDirectDrawSurface7_GetLOD(p,a) (p)->GetLOD(a) -#endif - - -/* - * IDirectDrawColorControl - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawColorControl -DECLARE_INTERFACE_( IDirectDrawColorControl, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawColorControl methods ***/ - STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; - STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawColorControl_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawColorControl_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawColorControl_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawColorControl_GetColorControls(p, a) (p)->lpVtbl->GetColorControls(p, a) -#define IDirectDrawColorControl_SetColorControls(p, a) (p)->lpVtbl->SetColorControls(p, a) -#else -#define IDirectDrawColorControl_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawColorControl_AddRef(p) (p)->AddRef() -#define IDirectDrawColorControl_Release(p) (p)->Release() -#define IDirectDrawColorControl_GetColorControls(p, a) (p)->GetColorControls(a) -#define IDirectDrawColorControl_SetColorControls(p, a) (p)->SetColorControls(a) -#endif - -#endif - - -/* - * IDirectDrawGammaControl - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawGammaControl -DECLARE_INTERFACE_( IDirectDrawGammaControl, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawGammaControl methods ***/ - STDMETHOD(GetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE; - STDMETHOD(SetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawGammaControl_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawGammaControl_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawGammaControl_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawGammaControl_GetGammaRamp(p, a, b) (p)->lpVtbl->GetGammaRamp(p, a, b) -#define IDirectDrawGammaControl_SetGammaRamp(p, a, b) (p)->lpVtbl->SetGammaRamp(p, a, b) -#else -#define IDirectDrawGammaControl_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawGammaControl_AddRef(p) (p)->AddRef() -#define IDirectDrawGammaControl_Release(p) (p)->Release() -#define IDirectDrawGammaControl_GetGammaRamp(p, a, b) (p)->GetGammaRamp(a, b) -#define IDirectDrawGammaControl_SetGammaRamp(p, a, b) (p)->SetGammaRamp(a, b) -#endif - -#endif - - - -#endif - - -/* - * DDSURFACEDESC - */ -typedef struct _DDSURFACEDESC -{ - DWORD dwSize; // size of the DDSURFACEDESC structure - DWORD dwFlags; // determines what fields are valid - DWORD dwHeight; // height of surface to be created - DWORD dwWidth; // width of input surface - union - { - LONG lPitch; // distance to start of next line (return value only) - DWORD dwLinearSize; // Formless late-allocated optimized surface size - } DUMMYUNIONNAMEN(1); - DWORD dwBackBufferCount; // number of back buffers requested - union - { - DWORD dwMipMapCount; // number of mip-map levels requested - DWORD dwZBufferBitDepth; // depth of Z buffer requested - DWORD dwRefreshRate; // refresh rate (used when display mode is described) - } DUMMYUNIONNAMEN(2); - DWORD dwAlphaBitDepth; // depth of alpha buffer requested - DWORD dwReserved; // reserved - LPVOID lpSurface; // pointer to the associated surface memory - DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use - DDCOLORKEY ddckCKDestBlt; // color key for destination blt use - DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use - DDCOLORKEY ddckCKSrcBlt; // color key for source blt use - DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface - DDSCAPS ddsCaps; // direct draw surface capabilities -} DDSURFACEDESC; - -/* - * DDSURFACEDESC2 - */ -typedef struct _DDSURFACEDESC2 -{ - DWORD dwSize; // size of the DDSURFACEDESC structure - DWORD dwFlags; // determines what fields are valid - DWORD dwHeight; // height of surface to be created - DWORD dwWidth; // width of input surface - union - { - LONG lPitch; // distance to start of next line (return value only) - DWORD dwLinearSize; // Formless late-allocated optimized surface size - } DUMMYUNIONNAMEN(1); - union - { - DWORD dwBackBufferCount; // number of back buffers requested - DWORD dwDepth; // the depth if this is a volume texture - } DUMMYUNIONNAMEN(5); - union - { - DWORD dwMipMapCount; // number of mip-map levels requestde - // dwZBufferBitDepth removed, use ddpfPixelFormat one instead - DWORD dwRefreshRate; // refresh rate (used when display mode is described) - DWORD dwSrcVBHandle; // The source used in VB::Optimize - } DUMMYUNIONNAMEN(2); - DWORD dwAlphaBitDepth; // depth of alpha buffer requested - DWORD dwReserved; // reserved - LPVOID lpSurface; // pointer to the associated surface memory - union - { - DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use - DWORD dwEmptyFaceColor; // Physical color for empty cubemap faces - } DUMMYUNIONNAMEN(3); - DDCOLORKEY ddckCKDestBlt; // color key for destination blt use - DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use - DDCOLORKEY ddckCKSrcBlt; // color key for source blt use - union - { - DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface - DWORD dwFVF; // vertex format description of vertex buffers - } DUMMYUNIONNAMEN(4); - DDSCAPS2 ddsCaps; // direct draw surface capabilities - DWORD dwTextureStage; // stage in multitexture cascade -} DDSURFACEDESC2; - -/* - * ddsCaps field is valid. - */ -#define DDSD_CAPS 0x00000001l // default - -/* - * dwHeight field is valid. - */ -#define DDSD_HEIGHT 0x00000002l - -/* - * dwWidth field is valid. - */ -#define DDSD_WIDTH 0x00000004l - -/* - * lPitch is valid. - */ -#define DDSD_PITCH 0x00000008l - -/* - * dwBackBufferCount is valid. - */ -#define DDSD_BACKBUFFERCOUNT 0x00000020l - -/* - * dwZBufferBitDepth is valid. (shouldnt be used in DDSURFACEDESC2) - */ -#define DDSD_ZBUFFERBITDEPTH 0x00000040l - -/* - * dwAlphaBitDepth is valid. - */ -#define DDSD_ALPHABITDEPTH 0x00000080l - - -/* - * lpSurface is valid. - */ -#define DDSD_LPSURFACE 0x00000800l - -/* - * ddpfPixelFormat is valid. - */ -#define DDSD_PIXELFORMAT 0x00001000l - -/* - * ddckCKDestOverlay is valid. - */ -#define DDSD_CKDESTOVERLAY 0x00002000l - -/* - * ddckCKDestBlt is valid. - */ -#define DDSD_CKDESTBLT 0x00004000l - -/* - * ddckCKSrcOverlay is valid. - */ -#define DDSD_CKSRCOVERLAY 0x00008000l - -/* - * ddckCKSrcBlt is valid. - */ -#define DDSD_CKSRCBLT 0x00010000l - -/* - * dwMipMapCount is valid. - */ -#define DDSD_MIPMAPCOUNT 0x00020000l - - /* - * dwRefreshRate is valid - */ -#define DDSD_REFRESHRATE 0x00040000l - -/* - * dwLinearSize is valid - */ -#define DDSD_LINEARSIZE 0x00080000l - -/* - * dwTextureStage is valid - */ -#define DDSD_TEXTURESTAGE 0x00100000l -/* - * dwFVF is valid - */ -#define DDSD_FVF 0x00200000l -/* - * dwSrcVBHandle is valid - */ -#define DDSD_SRCVBHANDLE 0x00400000l - -/* - * dwDepth is valid - */ -#define DDSD_DEPTH 0x00800000l - -/* - * All input fields are valid. - */ -#define DDSD_ALL 0x00fff9eel - -/* - * DDOPTSURFACEDESC - */ -typedef struct _DDOPTSURFACEDESC -{ - DWORD dwSize; // size of the DDOPTSURFACEDESC structure - DWORD dwFlags; // determines what fields are valid - DDSCAPS2 ddSCaps; // Common caps like: Memory type - DDOSCAPS ddOSCaps; // Common caps like: Memory type - GUID guid; // Compression technique GUID - DWORD dwCompressionRatio; // Compression ratio -} DDOPTSURFACEDESC; - -/* - * guid field is valid. - */ -#define DDOSD_GUID 0x00000001l - -/* - * dwCompressionRatio field is valid. - */ -#define DDOSD_COMPRESSION_RATIO 0x00000002l - -/* - * ddSCaps field is valid. - */ -#define DDOSD_SCAPS 0x00000004l - -/* - * ddOSCaps field is valid. - */ -#define DDOSD_OSCAPS 0x00000008l - -/* - * All input fields are valid. - */ -#define DDOSD_ALL 0x0000000fl - -/* - * The surface's optimized pixelformat is compressed - */ -#define DDOSDCAPS_OPTCOMPRESSED 0x00000001l - -/* - * The surface's optimized pixelformat is reordered - */ -#define DDOSDCAPS_OPTREORDERED 0x00000002l - -/* - * The opt surface is a monolithic mipmap - */ -#define DDOSDCAPS_MONOLITHICMIPMAP 0x00000004l - -/* - * The valid Surf caps: - * #define DDSCAPS_SYSTEMMEMORY 0x00000800l - * #define DDSCAPS_VIDEOMEMORY 0x00004000l - * #define DDSCAPS_LOCALVIDMEM 0x10000000l - * #define DDSCAPS_NONLOCALVIDMEM 0x20000000l - */ -#define DDOSDCAPS_VALIDSCAPS 0x30004800l - -/* - * The valid OptSurf caps - */ -#define DDOSDCAPS_VALIDOSCAPS 0x00000007l - - -/* - * DDCOLORCONTROL - */ -typedef struct _DDCOLORCONTROL -{ - DWORD dwSize; - DWORD dwFlags; - LONG lBrightness; - LONG lContrast; - LONG lHue; - LONG lSaturation; - LONG lSharpness; - LONG lGamma; - LONG lColorEnable; - DWORD dwReserved1; -} DDCOLORCONTROL; - - -/* - * lBrightness field is valid. - */ -#define DDCOLOR_BRIGHTNESS 0x00000001l - -/* - * lContrast field is valid. - */ -#define DDCOLOR_CONTRAST 0x00000002l - -/* - * lHue field is valid. - */ -#define DDCOLOR_HUE 0x00000004l - -/* - * lSaturation field is valid. - */ -#define DDCOLOR_SATURATION 0x00000008l - -/* - * lSharpness field is valid. - */ -#define DDCOLOR_SHARPNESS 0x00000010l - -/* - * lGamma field is valid. - */ -#define DDCOLOR_GAMMA 0x00000020l - -/* - * lColorEnable field is valid. - */ -#define DDCOLOR_COLORENABLE 0x00000040l - - - -/*============================================================================ - * - * Direct Draw Capability Flags - * - * These flags are used to describe the capabilities of a given Surface. - * All flags are bit flags. - * - *==========================================================================*/ - -/**************************************************************************** - * - * DIRECTDRAWSURFACE CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * This bit is reserved. It should not be specified. - */ -#define DDSCAPS_RESERVED1 0x00000001l - -/* - * Indicates that this surface contains alpha-only information. - * (To determine if a surface is RGBA/YUVA, the pixel format must be - * interrogated.) - */ -#define DDSCAPS_ALPHA 0x00000002l - -/* - * Indicates that this surface is a backbuffer. It is generally - * set by CreateSurface when the DDSCAPS_FLIP capability bit is set. - * It indicates that this surface is THE back buffer of a surface - * flipping structure. DirectDraw supports N surfaces in a - * surface flipping structure. Only the surface that immediately - * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set. - * The other surfaces are identified as back buffers by the presence - * of the DDSCAPS_FLIP capability, their attachment order, and the - * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER - * capabilities. The bit is sent to CreateSurface when a standalone - * back buffer is being created. This surface could be attached to - * a front buffer and/or back buffers to form a flipping surface - * structure after the CreateSurface call. See AddAttachments for - * a detailed description of the behaviors in this case. - */ -#define DDSCAPS_BACKBUFFER 0x00000004l - -/* - * Indicates a complex surface structure is being described. A - * complex surface structure results in the creation of more than - * one surface. The additional surfaces are attached to the root - * surface. The complex structure can only be destroyed by - * destroying the root. - */ -#define DDSCAPS_COMPLEX 0x00000008l - -/* - * Indicates that this surface is a part of a surface flipping structure. - * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and - * DDSCAP_BACKBUFFER bits are not set. They are set by CreateSurface - * on the resulting creations. The dwBackBufferCount field in the - * DDSURFACEDESC structure must be set to at least 1 in order for - * the CreateSurface call to succeed. The DDSCAPS_COMPLEX capability - * must always be set with creating multiple surfaces through CreateSurface. - */ -#define DDSCAPS_FLIP 0x00000010l - -/* - * Indicates that this surface is THE front buffer of a surface flipping - * structure. It is generally set by CreateSurface when the DDSCAPS_FLIP - * capability bit is set. - * If this capability is sent to CreateSurface then a standalonw front buffer - * is created. This surface will not have the DDSCAPS_FLIP capability. - * It can be attached to other back buffers to form a flipping structure. - * See AddAttachments for a detailed description of the behaviors in this - * case. - */ -#define DDSCAPS_FRONTBUFFER 0x00000020l - -/* - * Indicates that this surface is any offscreen surface that is not an overlay, - * texture, zbuffer, front buffer, back buffer, or alpha surface. It is used - * to identify plain vanilla surfaces. - */ -#define DDSCAPS_OFFSCREENPLAIN 0x00000040l - -/* - * Indicates that this surface is an overlay. It may or may not be directly visible - * depending on whether or not it is currently being overlayed onto the primary - * surface. DDSCAPS_VISIBLE can be used to determine whether or not it is being - * overlayed at the moment. - */ -#define DDSCAPS_OVERLAY 0x00000080l - -/* - * Indicates that unique DirectDrawPalette objects can be created and - * attached to this surface. - */ -#define DDSCAPS_PALETTE 0x00000100l - -/* - * Indicates that this surface is the primary surface. The primary - * surface represents what the user is seeing at the moment. - */ -#define DDSCAPS_PRIMARYSURFACE 0x00000200l - - -/* - * This flag used to be DDSCAPS_PRIMARYSURFACELEFT, which is now - * obsolete. - */ -#define DDSCAPS_RESERVED3 0x00000400l -#define DDSCAPS_PRIMARYSURFACELEFT 0x00000000l - -/* - * Indicates that this surface memory was allocated in system memory - */ -#define DDSCAPS_SYSTEMMEMORY 0x00000800l - -/* - * Indicates that this surface can be used as a 3D texture. It does not - * indicate whether or not the surface is being used for that purpose. - */ -#define DDSCAPS_TEXTURE 0x00001000l - -/* - * Indicates that a surface may be a destination for 3D rendering. This - * bit must be set in order to query for a Direct3D Device Interface - * from this surface. - */ -#define DDSCAPS_3DDEVICE 0x00002000l - -/* - * Indicates that this surface exists in video memory. - */ -#define DDSCAPS_VIDEOMEMORY 0x00004000l - -/* - * Indicates that changes made to this surface are immediately visible. - * It is always set for the primary surface and is set for overlays while - * they are being overlayed and texture maps while they are being textured. - */ -#define DDSCAPS_VISIBLE 0x00008000l - -/* - * Indicates that only writes are permitted to the surface. Read accesses - * from the surface may or may not generate a protection fault, but the - * results of a read from this surface will not be meaningful. READ ONLY. - */ -#define DDSCAPS_WRITEONLY 0x00010000l - -/* - * Indicates that this surface is a z buffer. A z buffer does not contain - * displayable information. Instead it contains bit depth information that is - * used to determine which pixels are visible and which are obscured. - */ -#define DDSCAPS_ZBUFFER 0x00020000l - -/* - * Indicates surface will have a DC associated long term - */ -#define DDSCAPS_OWNDC 0x00040000l - -/* - * Indicates surface should be able to receive live video - */ -#define DDSCAPS_LIVEVIDEO 0x00080000l - -/* - * Indicates surface should be able to have a stream decompressed - * to it by the hardware. - */ -#define DDSCAPS_HWCODEC 0x00100000l - -/* - * Surface is a ModeX surface. - * - */ -#define DDSCAPS_MODEX 0x00200000l - -/* - * Indicates surface is one level of a mip-map. This surface will - * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map. - * This can be done explicitly, by creating a number of surfaces and - * attaching them with AddAttachedSurface or by implicitly by CreateSurface. - * If this bit is set then DDSCAPS_TEXTURE must also be set. - */ -#define DDSCAPS_MIPMAP 0x00400000l - -/* - * This bit is reserved. It should not be specified. - */ -#define DDSCAPS_RESERVED2 0x00800000l - - -/* - * Indicates that memory for the surface is not allocated until the surface - * is loaded (via the Direct3D texture Load() function). - */ -#define DDSCAPS_ALLOCONLOAD 0x04000000l - -/* - * Indicates that the surface will recieve data from a video port. - */ -#define DDSCAPS_VIDEOPORT 0x08000000l - -/* - * Indicates that a video memory surface is resident in true, local video - * memory rather than non-local video memory. If this flag is specified then - * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with - * DDSCAPS_NONLOCALVIDMEM. - */ -#define DDSCAPS_LOCALVIDMEM 0x10000000l - -/* - * Indicates that a video memory surface is resident in non-local video - * memory rather than true, local video memory. If this flag is specified - * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with - * DDSCAPS_LOCALVIDMEM. - */ -#define DDSCAPS_NONLOCALVIDMEM 0x20000000l - -/* - * Indicates that this surface is a standard VGA mode surface, and not a - * ModeX surface. (This flag will never be set in combination with the - * DDSCAPS_MODEX flag). - */ -#define DDSCAPS_STANDARDVGAMODE 0x40000000l - -/* - * Indicates that this surface will be an optimized surface. This flag is - * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface - * will be created without any underlying video memory until loaded. - */ -#define DDSCAPS_OPTIMIZED 0x80000000l - - - -/* - * This bit is reserved - */ -#define DDSCAPS2_RESERVED4 0x00000002L -#define DDSCAPS2_HARDWAREDEINTERLACE 0x00000000L - -/* - * Indicates to the driver that this surface will be locked very frequently - * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap - * set must also have DDSCAPS_TEXTURE. This cap cannot be used with - * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE. - */ -#define DDSCAPS2_HINTDYNAMIC 0x00000004L - -/* - * Indicates to the driver that this surface can be re-ordered/retiled on - * load. This operation will not change the size of the texture. It is - * relatively fast and symmetrical, since the application may lock these - * bits (although it will take a performance hit when doing so). Surfaces - * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be - * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE. - */ -#define DDSCAPS2_HINTSTATIC 0x00000008L - -/* - * Indicates that the client would like this texture surface to be managed by the - * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have - * DDSCAPS_TEXTURE set. - */ -#define DDSCAPS2_TEXTUREMANAGE 0x00000010L - -/* - * These bits are reserved for internal use */ -#define DDSCAPS2_RESERVED1 0x00000020L -#define DDSCAPS2_RESERVED2 0x00000040L - -/* - * Indicates to the driver that this surface will never be locked again. - * The driver is free to optimize this surface via retiling and actual compression. - * All calls to Lock() or Blts from this surface will fail. Surfaces with this - * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with - * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC. - */ -#define DDSCAPS2_OPAQUE 0x00000080L - -/* - * Applications should set this bit at CreateSurface time to indicate that they - * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set. - */ -#define DDSCAPS2_HINTANTIALIASING 0x00000100L - - -/* - * This flag is used at CreateSurface time to indicate that this set of - * surfaces is a cubic environment map - */ -#define DDSCAPS2_CUBEMAP 0x00000200L - -/* - * These flags preform two functions: - * - At CreateSurface time, they define which of the six cube faces are - * required by the application. - * - After creation, each face in the cubemap will have exactly one of these - * bits set. - */ -#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400L -#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800L -#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000L -#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000L -#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000L -#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000L - -/* - * This macro may be used to specify all faces of a cube map at CreateSurface time - */ -#define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX |\ - DDSCAPS2_CUBEMAP_NEGATIVEX |\ - DDSCAPS2_CUBEMAP_POSITIVEY |\ - DDSCAPS2_CUBEMAP_NEGATIVEY |\ - DDSCAPS2_CUBEMAP_POSITIVEZ |\ - DDSCAPS2_CUBEMAP_NEGATIVEZ ) - - -/* - * This flag is an additional flag which is present on mipmap sublevels from DX7 onwards - * It enables easier use of GetAttachedSurface rather than EnumAttachedSurfaces for surface - * constructs such as Cube Maps, wherein there are more than one mipmap surface attached - * to the root surface. - * This caps bit is ignored by CreateSurface - */ -#define DDSCAPS2_MIPMAPSUBLEVEL 0x00010000L - -/* This flag indicates that the texture should be managed by D3D only */ -#define DDSCAPS2_D3DTEXTUREMANAGE 0x00020000L - -/* This flag indicates that the managed surface can be safely lost */ -#define DDSCAPS2_DONOTPERSIST 0x00040000L - -/* indicates that this surface is part of a stereo flipping chain */ -#define DDSCAPS2_STEREOSURFACELEFT 0x00080000L - - -/* - * Indicates that the surface is a volume. - * Can be combined with DDSCAPS_MIPMAP to indicate a multi-level volume - */ -#define DDSCAPS2_VOLUME 0x00200000L - -/* - * Indicates that the surface may be locked multiple times by the application. - * This cap cannot be used with DDSCAPS2_OPAQUE. - */ -#define DDSCAPS2_NOTUSERLOCKABLE 0x00400000L - -/* - * Indicates that the vertex buffer data can be used to render points and - * point sprites. - */ -#define DDSCAPS2_POINTS 0x00800000L - -/* - * Indicates that the vertex buffer data can be used to render rt pactches. - */ -#define DDSCAPS2_RTPATCHES 0x01000000L - -/* - * Indicates that the vertex buffer data can be used to render n patches. - */ -#define DDSCAPS2_NPATCHES 0x02000000L - -/* - * This bit is reserved for internal use - */ -#define DDSCAPS2_RESERVED3 0x04000000L - - -/* - * Indicates that the contents of the backbuffer do not have to be preserved - * the contents of the backbuffer after they are presented. - */ -#define DDSCAPS2_DISCARDBACKBUFFER 0x10000000L - -/* - * Indicates that all surfaces in this creation chain should be given an alpha channel. - * This flag will be set on primary surface chains that may have no explicit pixel format - * (and thus take on the format of the current display mode). - * The driver should infer that all these surfaces have a format having an alpha channel. - * (e.g. assume D3DFMT_A8R8G8B8 if the display mode is x888.) - */ -#define DDSCAPS2_ENABLEALPHACHANNEL 0x20000000L - -/* - * Indicates that all surfaces in this creation chain is extended primary surface format. - * This flag will be set on extended primary surface chains that always have explicit pixel - * format and the pixel format is typically GDI (Graphics Device Interface) couldn't handle, - * thus only used with fullscreen application. (e.g. D3DFMT_A2R10G10B10 format) - */ -#define DDSCAPS2_EXTENDEDFORMATPRIMARY 0x40000000L - -/* - * Indicates that all surfaces in this creation chain is additional primary surface. - * This flag will be set on primary surface chains which must present on the adapter - * id provided on dwCaps4. Typically this will be used to create secondary primary surface - * on DualView display adapter. - */ -#define DDSCAPS2_ADDITIONALPRIMARY 0x80000000L - -/* - * This is a mask that indicates the set of bits that may be set - * at createsurface time to indicate number of samples per pixel - * when multisampling - */ -#define DDSCAPS3_MULTISAMPLE_MASK 0x0000001FL - -/* - * This is a mask that indicates the set of bits that may be set - * at createsurface time to indicate the quality level of rendering - * for the current number of samples per pixel - */ -#define DDSCAPS3_MULTISAMPLE_QUALITY_MASK 0x000000E0L -#define DDSCAPS3_MULTISAMPLE_QUALITY_SHIFT 5 - -/* - * This bit is reserved for internal use - */ -#define DDSCAPS3_RESERVED1 0x00000100L - -/* - * This bit is reserved for internal use - */ -#define DDSCAPS3_RESERVED2 0x00000200L - -/* - * This indicates whether this surface has light-weight miplevels - */ -#define DDSCAPS3_LIGHTWEIGHTMIPMAP 0x00000400L - -/* - * This indicates that the mipsublevels for this surface are auto-generated - */ -#define DDSCAPS3_AUTOGENMIPMAP 0x00000800L - -/* - * This indicates that the mipsublevels for this surface are auto-generated - */ -#define DDSCAPS3_DMAP 0x00001000L - - - /**************************************************************************** - * - * DIRECTDRAW DRIVER CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Display hardware has 3D acceleration. - */ -#define DDCAPS_3D 0x00000001l - -/* - * Indicates that DirectDraw will support only dest rectangles that are aligned - * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively. - * READ ONLY. - */ -#define DDCAPS_ALIGNBOUNDARYDEST 0x00000002l - -/* - * Indicates that DirectDraw will support only source rectangles whose sizes in - * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively. READ ONLY. - */ -#define DDCAPS_ALIGNSIZEDEST 0x00000004l -/* - * Indicates that DirectDraw will support only source rectangles that are aligned - * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively. - * READ ONLY. - */ -#define DDCAPS_ALIGNBOUNDARYSRC 0x00000008l - -/* - * Indicates that DirectDraw will support only source rectangles whose sizes in - * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively. READ ONLY. - */ -#define DDCAPS_ALIGNSIZESRC 0x00000010l - -/* - * Indicates that DirectDraw will create video memory surfaces that have a stride - * alignment equal to DIRECTDRAWCAPS.dwAlignStride. READ ONLY. - */ -#define DDCAPS_ALIGNSTRIDE 0x00000020l - -/* - * Display hardware is capable of blt operations. - */ -#define DDCAPS_BLT 0x00000040l - -/* - * Display hardware is capable of asynchronous blt operations. - */ -#define DDCAPS_BLTQUEUE 0x00000080l - -/* - * Display hardware is capable of color space conversions during the blt operation. - */ -#define DDCAPS_BLTFOURCC 0x00000100l - -/* - * Display hardware is capable of stretching during blt operations. - */ -#define DDCAPS_BLTSTRETCH 0x00000200l - -/* - * Display hardware is shared with GDI. - */ -#define DDCAPS_GDI 0x00000400l - -/* - * Display hardware can overlay. - */ -#define DDCAPS_OVERLAY 0x00000800l - -/* - * Set if display hardware supports overlays but can not clip them. - */ -#define DDCAPS_OVERLAYCANTCLIP 0x00001000l - -/* - * Indicates that overlay hardware is capable of color space conversions during - * the overlay operation. - */ -#define DDCAPS_OVERLAYFOURCC 0x00002000l - -/* - * Indicates that stretching can be done by the overlay hardware. - */ -#define DDCAPS_OVERLAYSTRETCH 0x00004000l - -/* - * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces - * other than the primary surface. - */ -#define DDCAPS_PALETTE 0x00008000l - -/* - * Indicates that palette changes can be syncd with the veritcal refresh. - */ -#define DDCAPS_PALETTEVSYNC 0x00010000l - -/* - * Display hardware can return the current scan line. - */ -#define DDCAPS_READSCANLINE 0x00020000l - - -/* - * This flag used to bo DDCAPS_STEREOVIEW, which is now obsolete - */ -#define DDCAPS_RESERVED1 0x00040000l - -/* - * Display hardware is capable of generating a vertical blank interrupt. - */ -#define DDCAPS_VBI 0x00080000l - -/* - * Supports the use of z buffers with blt operations. - */ -#define DDCAPS_ZBLTS 0x00100000l - -/* - * Supports Z Ordering of overlays. - */ -#define DDCAPS_ZOVERLAYS 0x00200000l - -/* - * Supports color key - */ -#define DDCAPS_COLORKEY 0x00400000l - -/* - * Supports alpha surfaces - */ -#define DDCAPS_ALPHA 0x00800000l - -/* - * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set) - */ -#define DDCAPS_COLORKEYHWASSIST 0x01000000l - -/* - * no hardware support at all - */ -#define DDCAPS_NOHARDWARE 0x02000000l - -/* - * Display hardware is capable of color fill with bltter - */ -#define DDCAPS_BLTCOLORFILL 0x04000000l - -/* - * Display hardware is bank switched, and potentially very slow at - * random access to VRAM. - */ -#define DDCAPS_BANKSWITCHED 0x08000000l - -/* - * Display hardware is capable of depth filling Z-buffers with bltter - */ -#define DDCAPS_BLTDEPTHFILL 0x10000000l - -/* - * Display hardware is capable of clipping while bltting. - */ -#define DDCAPS_CANCLIP 0x20000000l - -/* - * Display hardware is capable of clipping while stretch bltting. - */ -#define DDCAPS_CANCLIPSTRETCHED 0x40000000l - -/* - * Display hardware is capable of bltting to or from system memory - */ -#define DDCAPS_CANBLTSYSMEM 0x80000000l - - - /**************************************************************************** - * - * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2) - * - ****************************************************************************/ - -/* - * Display hardware is certified - */ -#define DDCAPS2_CERTIFIED 0x00000001l - -/* - * Driver cannot interleave 2D operations (lock and blt) to surfaces with - * Direct3D rendering operations between calls to BeginScene() and EndScene() - */ -#define DDCAPS2_NO2DDURING3DSCENE 0x00000002l - -/* - * Display hardware contains a video port - */ -#define DDCAPS2_VIDEOPORT 0x00000004l - -/* - * The overlay can be automatically flipped according to the video port - * VSYNCs, providing automatic doubled buffered display of video port - * data using an overlay - */ -#define DDCAPS2_AUTOFLIPOVERLAY 0x00000008l - -/* - * Overlay can display each field of interlaced data individually while - * it is interleaved in memory without causing jittery artifacts. - */ -#define DDCAPS2_CANBOBINTERLEAVED 0x00000010l - -/* - * Overlay can display each field of interlaced data individually while - * it is not interleaved in memory without causing jittery artifacts. - */ -#define DDCAPS2_CANBOBNONINTERLEAVED 0x00000020l - -/* - * The overlay surface contains color controls (brightness, sharpness, etc.) - */ -#define DDCAPS2_COLORCONTROLOVERLAY 0x00000040l - -/* - * The primary surface contains color controls (gamma, etc.) - */ -#define DDCAPS2_COLORCONTROLPRIMARY 0x00000080l - -/* - * RGBZ -> RGB supported for 16:16 RGB:Z - */ -#define DDCAPS2_CANDROPZ16BIT 0x00000100l - -/* - * Driver supports non-local video memory. - */ -#define DDCAPS2_NONLOCALVIDMEM 0x00000200l - -/* - * Dirver supports non-local video memory but has different capabilities for - * non-local video memory surfaces. If this bit is set then so must - * DDCAPS2_NONLOCALVIDMEM. - */ -#define DDCAPS2_NONLOCALVIDMEMCAPS 0x00000400l - -/* - * Driver neither requires nor prefers surfaces to be pagelocked when performing - * blts involving system memory surfaces - */ -#define DDCAPS2_NOPAGELOCKREQUIRED 0x00000800l - -/* - * Driver can create surfaces which are wider than the primary surface - */ -#define DDCAPS2_WIDESURFACES 0x00001000l - -/* - * Driver supports bob without using a video port by handling the - * DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip. - */ -#define DDCAPS2_CANFLIPODDEVEN 0x00002000l - -/* - * Driver supports bob using hardware - */ -#define DDCAPS2_CANBOBHARDWARE 0x00004000l - -/* - * Driver supports bltting any FOURCC surface to another surface of the same FOURCC - */ -#define DDCAPS2_COPYFOURCC 0x00008000l - - -/* - * Driver supports loadable gamma ramps for the primary surface - */ -#define DDCAPS2_PRIMARYGAMMA 0x00020000l - -/* - * Driver can render in windowed mode. - */ -#define DDCAPS2_CANRENDERWINDOWED 0x00080000l - -/* - * A calibrator is available to adjust the gamma ramp according to the - * physical display properties so that the result will be identical on - * all calibrated systems. - */ -#define DDCAPS2_CANCALIBRATEGAMMA 0x00100000l - -/* - * Indicates that the driver will respond to DDFLIP_INTERVALn flags - */ -#define DDCAPS2_FLIPINTERVAL 0x00200000l - -/* - * Indicates that the driver will respond to DDFLIP_NOVSYNC - */ -#define DDCAPS2_FLIPNOVSYNC 0x00400000l - -/* - * Driver supports management of video memory, if this flag is ON, - * driver manages the texture if requested with DDSCAPS2_TEXTUREMANAGE on - * DirectX manages the texture if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on - */ -#define DDCAPS2_CANMANAGETEXTURE 0x00800000l - -/* - * The Direct3D texture manager uses this cap to decide whether to put managed - * surfaces in non-local video memory. If the cap is set, the texture manager will - * put managed surfaces in non-local vidmem. Drivers that cannot texture from - * local vidmem SHOULD NOT set this cap. - */ -#define DDCAPS2_TEXMANINNONLOCALVIDMEM 0x01000000l - -/* - * Indicates that the driver supports DX7 type of stereo in at least one mode (which may - * not necessarily be the current mode). Applications should use IDirectDraw7 (or higher) - * ::EnumDisplayModes and check the DDSURFACEDESC.ddsCaps.dwCaps2 field for the presence of - * DDSCAPS2_STEREOSURFACELEFT to check if a particular mode supports stereo. The application - * can also use IDirectDraw7(or higher)::GetDisplayMode to check the current mode. - */ -#define DDCAPS2_STEREO 0x02000000L - -/* - * This caps bit is intended for internal DirectDraw use. - * -It is only valid if DDCAPS2_NONLOCALVIDMEMCAPS is set. - * -If this bit is set, then DDCAPS_CANBLTSYSMEM MUST be set by the driver (and - * all the assoicated system memory blt caps must be correct). - * -It implies that the system->video blt caps in DDCAPS also apply to system to - * nonlocal blts. I.e. the dwSVBCaps, dwSVBCKeyCaps, dwSVBFXCaps and dwSVBRops - * members of DDCAPS (DDCORECAPS) are filled in correctly. - * -Any blt from system to nonlocal memory that matches these caps bits will - * be passed to the driver. - * - * NOTE: This is intended to enable the driver itself to do efficient reordering - * of textures. This is NOT meant to imply that hardware can write into AGP memory. - * This operation is not currently supported. - */ -#define DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL 0x04000000L - -/* - * was DDCAPS2_PUREHAL - */ -#define DDCAPS2_RESERVED1 0x08000000L - -/* - * Driver supports management of video memory, if this flag is ON, - * driver manages the resource if requested with DDSCAPS2_TEXTUREMANAGE on - * DirectX manages the resource if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on - */ -#define DDCAPS2_CANMANAGERESOURCE 0x10000000L - -/* - * Driver supports dynamic textures. This will allow the application to set - * D3DUSAGE_DYNAMIC (DDSCAPS2_HINTDYNAMIC for drivers) at texture create time. - * Video memory dynamic textures WILL be lockable by applications. It is - * expected that these locks will be very efficient (which implies that the - * driver should always maintain a linear copy, a pointer to which can be - * quickly handed out to the application). - */ -#define DDCAPS2_DYNAMICTEXTURES 0x20000000L - -/* - * Driver supports auto-generation of mipmaps. - */ -#define DDCAPS2_CANAUTOGENMIPMAP 0x40000000L - - -/**************************************************************************** - * - * DIRECTDRAW FX ALPHA CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Supports alpha blending around the edge of a source color keyed surface. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAEDGEBLEND 0x00000001l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value becomes - * more opaque as the alpha value increases. (0 is transparent.) - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAPIXELS 0x00000002l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value - * becomes more transparent as the alpha value increases. (0 is opaque.) - * This flag can only be set if DDCAPS_ALPHA is set. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAPIXELSNEG 0x00000004l - -/* - * Supports alpha only surfaces. The bit depth of an alpha only surface can be - * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases. - * (0 is transparent.) - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHASURFACES 0x00000008l - -/* - * The depth of the alpha channel data can range can be 1,2,4, or 8. - * The NEG suffix indicates that this alpha channel becomes more transparent - * as the alpha value increases. (0 is opaque.) This flag can only be set if - * DDCAPS_ALPHA is set. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHASURFACESNEG 0x00000010l - -/* - * Supports alpha blending around the edge of a source color keyed surface. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND 0x00000020l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value becomes - * more opaque as the alpha value increases. (0 is transparent.) - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAPIXELS 0x00000040l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value - * becomes more transparent as the alpha value increases. (0 is opaque.) - * This flag can only be set if DDCAPS_ALPHA is set. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG 0x00000080l - -/* - * Supports alpha only surfaces. The bit depth of an alpha only surface can be - * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases. - * (0 is transparent.) - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHASURFACES 0x00000100l - -/* - * The depth of the alpha channel data can range can be 1,2,4, or 8. - * The NEG suffix indicates that this alpha channel becomes more transparent - * as the alpha value increases. (0 is opaque.) This flag can only be set if - * DDCAPS_ALPHA is set. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG 0x00000200l - -#if DIRECTDRAW_VERSION < 0x0600 -#endif //DIRECTDRAW_VERSION - - -/**************************************************************************** - * - * DIRECTDRAW FX CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Uses arithmetic operations to stretch and shrink surfaces during blt - * rather than pixel doubling techniques. Along the Y axis. - */ -#define DDFXCAPS_BLTARITHSTRETCHY 0x00000020l - -/* - * Uses arithmetic operations to stretch during blt - * rather than pixel doubling techniques. Along the Y axis. Only - * works for x1, x2, etc. - */ -#define DDFXCAPS_BLTARITHSTRETCHYN 0x00000010l - -/* - * Supports mirroring left to right in blt. - */ -#define DDFXCAPS_BLTMIRRORLEFTRIGHT 0x00000040l - -/* - * Supports mirroring top to bottom in blt. - */ -#define DDFXCAPS_BLTMIRRORUPDOWN 0x00000080l - -/* - * Supports arbitrary rotation for blts. - */ -#define DDFXCAPS_BLTROTATION 0x00000100l - -/* - * Supports 90 degree rotations for blts. - */ -#define DDFXCAPS_BLTROTATION90 0x00000200l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKX 0x00000400l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKXN 0x00000800l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * y axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKY 0x00001000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the y axis (vertical direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKYN 0x00002000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHX 0x00004000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHXN 0x00008000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * y axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHY 0x00010000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the y axis (vertical direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHYN 0x00020000l - -/* - * Uses arithmetic operations to stretch and shrink surfaces during - * overlay rather than pixel doubling techniques. Along the Y axis - * for overlays. - */ -#define DDFXCAPS_OVERLAYARITHSTRETCHY 0x00040000l - -/* - * Uses arithmetic operations to stretch surfaces during - * overlay rather than pixel doubling techniques. Along the Y axis - * for overlays. Only works for x1, x2, etc. - */ -#define DDFXCAPS_OVERLAYARITHSTRETCHYN 0x00000008l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKX 0x00080000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKXN 0x00100000l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * y axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKY 0x00200000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the y axis (vertical direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKYN 0x00400000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHX 0x00800000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHXN 0x01000000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * y axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHY 0x02000000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the y axis (vertical direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHYN 0x04000000l - -/* - * DirectDraw supports mirroring of overlays across the vertical axis - */ -#define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000l - -/* - * DirectDraw supports mirroring of overlays across the horizontal axis - */ -#define DDFXCAPS_OVERLAYMIRRORUPDOWN 0x10000000l - -/* - * DirectDraw supports deinterlacing of overlay surfaces - */ -#define DDFXCAPS_OVERLAYDEINTERLACE 0x20000000l - -/* - * Driver can do alpha blending for blits. - */ -#define DDFXCAPS_BLTALPHA 0x00000001l - - -/* - * Driver can do surface-reconstruction filtering for warped blits. - */ -#define DDFXCAPS_BLTFILTER DDFXCAPS_BLTARITHSTRETCHY - -/* - * Driver can do alpha blending for overlays. - */ -#define DDFXCAPS_OVERLAYALPHA 0x00000004l - - -/* - * Driver can do surface-reconstruction filtering for warped overlays. - */ -#define DDFXCAPS_OVERLAYFILTER DDFXCAPS_OVERLAYARITHSTRETCHY - -/**************************************************************************** - * - * DIRECTDRAW STEREO VIEW CAPABILITIES - * - ****************************************************************************/ - -/* - * This flag used to be DDSVCAPS_ENIGMA, which is now obsolete - */ - -#define DDSVCAPS_RESERVED1 0x00000001l - -/* - * This flag used to be DDSVCAPS_FLICKER, which is now obsolete - */ -#define DDSVCAPS_RESERVED2 0x00000002l - -/* - * This flag used to be DDSVCAPS_REDBLUE, which is now obsolete - */ -#define DDSVCAPS_RESERVED3 0x00000004l - -/* - * This flag used to be DDSVCAPS_SPLIT, which is now obsolete - */ -#define DDSVCAPS_RESERVED4 0x00000008l - -/* - * The stereo view is accomplished with switching technology - */ - -#define DDSVCAPS_STEREOSEQUENTIAL 0x00000010L - - - -/**************************************************************************** - * - * DIRECTDRAWPALETTE CAPABILITIES - * - ****************************************************************************/ - -/* - * Index is 4 bits. There are sixteen color entries in the palette table. - */ -#define DDPCAPS_4BIT 0x00000001l - -/* - * Index is onto a 8 bit color index. This field is only valid with the - * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target - * surface is in 8bpp. Each color entry is one byte long and is an index - * into destination surface's 8bpp palette. - */ -#define DDPCAPS_8BITENTRIES 0x00000002l - -/* - * Index is 8 bits. There are 256 color entries in the palette table. - */ -#define DDPCAPS_8BIT 0x00000004l - -/* - * Indicates that this DIRECTDRAWPALETTE should use the palette color array - * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE - * object. - * This flag is obsolete. DirectDraw always initializes the color array from - * the lpDDColorArray parameter. The definition remains for source-level - * compatibility. - */ -#define DDPCAPS_INITIALIZE 0x00000000l - -/* - * This palette is the one attached to the primary surface. Changing this - * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified - * and supported. - */ -#define DDPCAPS_PRIMARYSURFACE 0x00000010l - -/* - * This palette is the one attached to the primary surface left. Changing - * this table has immediate effect on the display for the left eye unless - * DDPSETPAL_VSYNC is specified and supported. - */ -#define DDPCAPS_PRIMARYSURFACELEFT 0x00000020l - -/* - * This palette can have all 256 entries defined - */ -#define DDPCAPS_ALLOW256 0x00000040l - -/* - * This palette can have modifications to it synced with the monitors - * refresh rate. - */ -#define DDPCAPS_VSYNC 0x00000080l - -/* - * Index is 1 bit. There are two color entries in the palette table. - */ -#define DDPCAPS_1BIT 0x00000100l - -/* - * Index is 2 bit. There are four color entries in the palette table. - */ -#define DDPCAPS_2BIT 0x00000200l - -/* - * The peFlags member of PALETTEENTRY denotes an 8 bit alpha value - */ -#define DDPCAPS_ALPHA 0x00000400l - - -/**************************************************************************** - * - * DIRECTDRAWPALETTE SETENTRY CONSTANTS - * - ****************************************************************************/ - - -/**************************************************************************** - * - * DIRECTDRAWPALETTE GETENTRY CONSTANTS - * - ****************************************************************************/ - -/* 0 is the only legal value */ - -/**************************************************************************** - * - * DIRECTDRAWSURFACE SETPRIVATEDATA CONSTANTS - * - ****************************************************************************/ - -/* - * The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData - * must be set to sizeof(IUnknown*). DirectDraw will call AddRef through this - * pointer and Release when the private data is destroyed. This includes when - * the surface or palette is destroyed before such priovate data is destroyed. - */ -#define DDSPD_IUNKNOWNPOINTER 0x00000001L - -/* - * Private data is only valid for the current state of the object, - * as determined by the uniqueness value. - */ -#define DDSPD_VOLATILE 0x00000002L - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE SETPALETTE CONSTANTS - * - ****************************************************************************/ - - -/**************************************************************************** - * - * DIRECTDRAW BITDEPTH CONSTANTS - * - * NOTE: These are only used to indicate supported bit depths. These - * are flags only, they are not to be used as an actual bit depth. The - * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual - * bit depths in a surface or for changing the display mode. - * - ****************************************************************************/ - -/* - * 1 bit per pixel. - */ -#define DDBD_1 0x00004000l - -/* - * 2 bits per pixel. - */ -#define DDBD_2 0x00002000l - -/* - * 4 bits per pixel. - */ -#define DDBD_4 0x00001000l - -/* - * 8 bits per pixel. - */ -#define DDBD_8 0x00000800l - -/* - * 16 bits per pixel. - */ -#define DDBD_16 0x00000400l - -/* - * 24 bits per pixel. - */ -#define DDBD_24 0X00000200l - -/* - * 32 bits per pixel. - */ -#define DDBD_32 0x00000100l - -/**************************************************************************** - * - * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS - * - ****************************************************************************/ - -/* - * Set if the structure contains a color space. Not set if the structure - * contains a single color key. - */ -#define DDCKEY_COLORSPACE 0x00000001l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a destination color key for blt operations. - */ -#define DDCKEY_DESTBLT 0x00000002l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a destination color key for overlay operations. - */ -#define DDCKEY_DESTOVERLAY 0x00000004l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a source color key for blt operations. - */ -#define DDCKEY_SRCBLT 0x00000008l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a source color key for overlay operations. - */ -#define DDCKEY_SRCOVERLAY 0x00000010l - - -/**************************************************************************** - * - * DIRECTDRAW COLOR KEY CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Supports transparent blting using a color key to identify the replaceable - * bits of the destination surface for RGB colors. - */ -#define DDCKEYCAPS_DESTBLT 0x00000001l - -/* - * Supports transparent blting using a color space to identify the replaceable - * bits of the destination surface for RGB colors. - */ -#define DDCKEYCAPS_DESTBLTCLRSPACE 0x00000002l - -/* - * Supports transparent blting using a color space to identify the replaceable - * bits of the destination surface for YUV colors. - */ -#define DDCKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004l - -/* - * Supports transparent blting using a color key to identify the replaceable - * bits of the destination surface for YUV colors. - */ -#define DDCKEYCAPS_DESTBLTYUV 0x00000008l - -/* - * Supports overlaying using colorkeying of the replaceable bits of the surface - * being overlayed for RGB colors. - */ -#define DDCKEYCAPS_DESTOVERLAY 0x00000010l - -/* - * Supports a color space as the color key for the destination for RGB colors. - */ -#define DDCKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020l - -/* - * Supports a color space as the color key for the destination for YUV colors. - */ -#define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040l - -/* - * Supports only one active destination color key value for visible overlay - * surfaces. - */ -#define DDCKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080l - -/* - * Supports overlaying using colorkeying of the replaceable bits of the - * surface being overlayed for YUV colors. - */ -#define DDCKEYCAPS_DESTOVERLAYYUV 0x00000100l - -/* - * Supports transparent blting using the color key for the source with - * this surface for RGB colors. - */ -#define DDCKEYCAPS_SRCBLT 0x00000200l - -/* - * Supports transparent blting using a color space for the source with - * this surface for RGB colors. - */ -#define DDCKEYCAPS_SRCBLTCLRSPACE 0x00000400l - -/* - * Supports transparent blting using a color space for the source with - * this surface for YUV colors. - */ -#define DDCKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800l - -/* - * Supports transparent blting using the color key for the source with - * this surface for YUV colors. - */ -#define DDCKEYCAPS_SRCBLTYUV 0x00001000l - -/* - * Supports overlays using the color key for the source with this - * overlay surface for RGB colors. - */ -#define DDCKEYCAPS_SRCOVERLAY 0x00002000l - -/* - * Supports overlays using a color space as the source color key for - * the overlay surface for RGB colors. - */ -#define DDCKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000l - -/* - * Supports overlays using a color space as the source color key for - * the overlay surface for YUV colors. - */ -#define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000l - -/* - * Supports only one active source color key value for visible - * overlay surfaces. - */ -#define DDCKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000l - -/* - * Supports overlays using the color key for the source with this - * overlay surface for YUV colors. - */ -#define DDCKEYCAPS_SRCOVERLAYYUV 0x00020000l - -/* - * there are no bandwidth trade-offs for using colorkey with an overlay - */ -#define DDCKEYCAPS_NOCOSTOVERLAY 0x00040000l - - -/**************************************************************************** - * - * DIRECTDRAW PIXELFORMAT FLAGS - * - ****************************************************************************/ - -/* - * The surface has alpha channel information in the pixel format. - */ -#define DDPF_ALPHAPIXELS 0x00000001l - -/* - * The pixel format contains alpha only information - */ -#define DDPF_ALPHA 0x00000002l - -/* - * The FourCC code is valid. - */ -#define DDPF_FOURCC 0x00000004l - -/* - * The surface is 4-bit color indexed. - */ -#define DDPF_PALETTEINDEXED4 0x00000008l - -/* - * The surface is indexed into a palette which stores indices - * into the destination surface's 8-bit palette. - */ -#define DDPF_PALETTEINDEXEDTO8 0x00000010l - -/* - * The surface is 8-bit color indexed. - */ -#define DDPF_PALETTEINDEXED8 0x00000020l - -/* - * The RGB data in the pixel format structure is valid. - */ -#define DDPF_RGB 0x00000040l - -/* - * The surface will accept pixel data in the format specified - * and compress it during the write. - */ -#define DDPF_COMPRESSED 0x00000080l - -/* - * The surface will accept RGB data and translate it during - * the write to YUV data. The format of the data to be written - * will be contained in the pixel format structure. The DDPF_RGB - * flag will be set. - */ -#define DDPF_RGBTOYUV 0x00000100l - -/* - * pixel format is YUV - YUV data in pixel format struct is valid - */ -#define DDPF_YUV 0x00000200l - -/* - * pixel format is a z buffer only surface - */ -#define DDPF_ZBUFFER 0x00000400l - -/* - * The surface is 1-bit color indexed. - */ -#define DDPF_PALETTEINDEXED1 0x00000800l - -/* - * The surface is 2-bit color indexed. - */ -#define DDPF_PALETTEINDEXED2 0x00001000l - -/* - * The surface contains Z information in the pixels - */ -#define DDPF_ZPIXELS 0x00002000l - -/* - * The surface contains stencil information along with Z - */ -#define DDPF_STENCILBUFFER 0x00004000l - -/* - * Premultiplied alpha format -- the color components have been - * premultiplied by the alpha component. - */ -#define DDPF_ALPHAPREMULT 0x00008000l - - -/* - * Luminance data in the pixel format is valid. - * Use this flag for luminance-only or luminance+alpha surfaces, - * the bit depth is then ddpf.dwLuminanceBitCount. - */ -#define DDPF_LUMINANCE 0x00020000l - -/* - * Luminance data in the pixel format is valid. - * Use this flag when hanging luminance off bumpmap surfaces, - * the bit mask for the luminance portion of the pixel is then - * ddpf.dwBumpLuminanceBitMask - */ -#define DDPF_BUMPLUMINANCE 0x00040000l - -/* - * Bump map dUdV data in the pixel format is valid. - */ -#define DDPF_BUMPDUDV 0x00080000l - - -/*=========================================================================== - * - * - * DIRECTDRAW CALLBACK FLAGS - * - * - *==========================================================================*/ - -/**************************************************************************** - * - * DIRECTDRAW ENUMSURFACES FLAGS - * - ****************************************************************************/ - -/* - * Enumerate all of the surfaces that meet the search criterion. - */ -#define DDENUMSURFACES_ALL 0x00000001l - -/* - * A search hit is a surface that matches the surface description. - */ -#define DDENUMSURFACES_MATCH 0x00000002l - -/* - * A search hit is a surface that does not match the surface description. - */ -#define DDENUMSURFACES_NOMATCH 0x00000004l - -/* - * Enumerate the first surface that can be created which meets the search criterion. - */ -#define DDENUMSURFACES_CANBECREATED 0x00000008l - -/* - * Enumerate the surfaces that already exist that meet the search criterion. - */ -#define DDENUMSURFACES_DOESEXIST 0x00000010l - - -/**************************************************************************** - * - * DIRECTDRAW SETDISPLAYMODE FLAGS - * - ****************************************************************************/ - -/* - * The desired mode is a standard VGA mode - */ -#define DDSDM_STANDARDVGAMODE 0x00000001l - - -/**************************************************************************** - * - * DIRECTDRAW ENUMDISPLAYMODES FLAGS - * - ****************************************************************************/ - -/* - * Enumerate Modes with different refresh rates. EnumDisplayModes guarantees - * that a particular mode will be enumerated only once. This flag specifies whether - * the refresh rate is taken into account when determining if a mode is unique. - */ -#define DDEDM_REFRESHRATES 0x00000001l - -/* - * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA - * modes such as mode 0x13 in addition to the usual ModeX modes (which are always - * enumerated if the application has previously called SetCooperativeLevel with the - * DDSCL_ALLOWMODEX flag set). - */ -#define DDEDM_STANDARDVGAMODES 0x00000002L - - -/**************************************************************************** - * - * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS - * - ****************************************************************************/ - -/* - * Exclusive mode owner will be responsible for the entire primary surface. - * GDI can be ignored. used with DD - */ -#define DDSCL_FULLSCREEN 0x00000001l - -/* - * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode - */ -#define DDSCL_ALLOWREBOOT 0x00000002l - -/* - * prevents DDRAW from modifying the application window. - * prevents DDRAW from minimize/restore the application window on activation. - */ -#define DDSCL_NOWINDOWCHANGES 0x00000004l - -/* - * app wants to work as a regular Windows application - */ -#define DDSCL_NORMAL 0x00000008l - -/* - * app wants exclusive access - */ -#define DDSCL_EXCLUSIVE 0x00000010l - - -/* - * app can deal with non-windows display modes - */ -#define DDSCL_ALLOWMODEX 0x00000040l - -/* - * this window will receive the focus messages - */ -#define DDSCL_SETFOCUSWINDOW 0x00000080l - -/* - * this window is associated with the DDRAW object and will - * cover the screen in fullscreen mode - */ -#define DDSCL_SETDEVICEWINDOW 0x00000100l - -/* - * app wants DDRAW to create a window to be associated with the - * DDRAW object - */ -#define DDSCL_CREATEDEVICEWINDOW 0x00000200l - -/* - * App explicitly asks DDRAW/D3D to be multithread safe. This makes D3D - * take the global crtisec more frequently. - */ -#define DDSCL_MULTITHREADED 0x00000400l - -/* - * App specifies that it would like to keep the FPU set up for optimal Direct3D - * performance (single precision and exceptions disabled) so Direct3D - * does not need to explicitly set the FPU each time. This is assumed by - * default in DirectX 7. See also DDSCL_FPUPRESERVE - */ -#define DDSCL_FPUSETUP 0x00000800l - -/* - * App specifies that it needs either double precision FPU or FPU exceptions - * enabled. This makes Direct3D explicitly set the FPU state eah time it is - * called. Setting the flag will reduce Direct3D performance. The flag is - * assumed by default in DirectX 6 and earlier. See also DDSCL_FPUSETUP - */ -#define DDSCL_FPUPRESERVE 0x00001000l - - -/**************************************************************************** - * - * DIRECTDRAW BLT FLAGS - * - ****************************************************************************/ - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the destination surface as the alpha channel for this blt. - */ -#define DDBLT_ALPHADEST 0x00000001l - -/* - * Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel - * for the destination surface for this blt. - */ -#define DDBLT_ALPHADESTCONSTOVERRIDE 0x00000002l - -/* - * The NEG suffix indicates that the destination surface becomes more - * transparent as the alpha value increases. (0 is opaque) - */ -#define DDBLT_ALPHADESTNEG 0x00000004l - -/* - * Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha - * channel for the destination for this blt. - */ -#define DDBLT_ALPHADESTSURFACEOVERRIDE 0x00000008l - -/* - * Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel - * for the edges of the image that border the color key colors. - */ -#define DDBLT_ALPHAEDGEBLEND 0x00000010l - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the source surface as the alpha channel for this blt. - */ -#define DDBLT_ALPHASRC 0x00000020l - -/* - * Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel - * for the source for this blt. - */ -#define DDBLT_ALPHASRCCONSTOVERRIDE 0x00000040l - -/* - * The NEG suffix indicates that the source surface becomes more transparent - * as the alpha value increases. (0 is opaque) - */ -#define DDBLT_ALPHASRCNEG 0x00000080l - -/* - * Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel - * for the source for this blt. - */ -#define DDBLT_ALPHASRCSURFACEOVERRIDE 0x00000100l - -/* - * Do this blt asynchronously through the FIFO in the order received. If - * there is no room in the hardware FIFO fail the call. - */ -#define DDBLT_ASYNC 0x00000200l - -/* - * Uses the dwFillColor field in the DDBLTFX structure as the RGB color - * to fill the destination rectangle on the destination surface with. - */ -#define DDBLT_COLORFILL 0x00000400l - -/* - * Uses the dwDDFX field in the DDBLTFX structure to specify the effects - * to use for the blt. - */ -#define DDBLT_DDFX 0x00000800l - -/* - * Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS - * that are not part of the Win32 API. - */ -#define DDBLT_DDROPS 0x00001000l - -/* - * Use the color key associated with the destination surface. - */ -#define DDBLT_KEYDEST 0x00002000l - -/* - * Use the dckDestColorkey field in the DDBLTFX structure as the color key - * for the destination surface. - */ -#define DDBLT_KEYDESTOVERRIDE 0x00004000l - -/* - * Use the color key associated with the source surface. - */ -#define DDBLT_KEYSRC 0x00008000l - -/* - * Use the dckSrcColorkey field in the DDBLTFX structure as the color key - * for the source surface. - */ -#define DDBLT_KEYSRCOVERRIDE 0x00010000l - -/* - * Use the dwROP field in the DDBLTFX structure for the raster operation - * for this blt. These ROPs are the same as the ones defined in the Win32 API. - */ -#define DDBLT_ROP 0x00020000l - -/* - * Use the dwRotationAngle field in the DDBLTFX structure as the angle - * (specified in 1/100th of a degree) to rotate the surface. - */ -#define DDBLT_ROTATIONANGLE 0x00040000l - -/* - * Z-buffered blt using the z-buffers attached to the source and destination - * surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the - * z-buffer opcode. - */ -#define DDBLT_ZBUFFER 0x00080000l - -/* - * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field - * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively - * for the destination. - */ -#define DDBLT_ZBUFFERDESTCONSTOVERRIDE 0x00100000l - -/* - * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode - * field in the DDBLTFX structure as the z-buffer and z-buffer opcode - * respectively for the destination. - */ -#define DDBLT_ZBUFFERDESTOVERRIDE 0x00200000l - -/* - * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field - * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively - * for the source. - */ -#define DDBLT_ZBUFFERSRCCONSTOVERRIDE 0x00400000l - -/* - * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode - * field in the DDBLTFX structure as the z-buffer and z-buffer opcode - * respectively for the source. - */ -#define DDBLT_ZBUFFERSRCOVERRIDE 0x00800000l - -/* - * wait until the device is ready to handle the blt - * this will cause blt to not return DDERR_WASSTILLDRAWING - */ -#define DDBLT_WAIT 0x01000000l - -/* - * Uses the dwFillDepth field in the DDBLTFX structure as the depth value - * to fill the destination rectangle on the destination Z-buffer surface - * with. - */ -#define DDBLT_DEPTHFILL 0x02000000l - - -/* - * Return immediately (with DDERR_WASSTILLDRAWING) if the device is not - * ready to schedule the blt at the time Blt() is called. - */ -#define DDBLT_DONOTWAIT 0x08000000l - -/* - * These flags indicate a presentation blt (i.e. a blt - * that moves surface contents from an offscreen back buffer to the primary - * surface). The driver is not allowed to "queue" more than three such blts. - * The "end" of the presentation blt is indicated, since the - * blt may be clipped, in which case the runtime will call the driver with - * several blts. All blts (even if not clipped) are tagged with DDBLT_PRESENTATION - * and the last (even if not clipped) additionally with DDBLT_LAST_PRESENTATION. - * Thus the true rule is that the driver must not schedule a DDBLT_PRESENTATION - * blt if there are 3 or more DDBLT_PRESENTLAST blts in the hardware pipe. - * If there are such blts in the pipe, the driver should return DDERR_WASSTILLDRAWING - * until the oldest queued DDBLT_LAST_PRESENTATION blts has been retired (i.e. the - * pixels have been actually written to the primary surface). Once the oldest blt - * has been retired, the driver is free to schedule the current blt. - * The goal is to provide a mechanism whereby the device's hardware queue never - * gets more than 3 frames ahead of the frames being generated by the application. - * When excessive queueing occurs, applications become unusable because the application - * visibly lags user input, and such problems make windowed interactive applications impossible. - * Some drivers may not have sufficient knowledge of their hardware's FIFO to know - * when a certain blt has been retired. Such drivers should code cautiously, and - * simply not allow any frames to be queued at all. DDBLT_LAST_PRESENTATION should cause - * such drivers to return DDERR_WASSTILLDRAWING until the accelerator is completely - * finished- exactly as if the application had called Lock on the source surface - * before calling Blt. - * In other words, the driver is allowed and encouraged to - * generate as much latency as it can, but never more than 3 frames worth. - * Implementation detail: Drivers should count blts against the SOURCE surface, not - * against the primary surface. This enables multiple parallel windowed application - * to function more optimally. - * This flag is passed only to DX8 or higher drivers. - * - * APPLICATIONS DO NOT SET THESE FLAGS. THEY ARE SET BY THE DIRECTDRAW RUNTIME. - * - */ -#define DDBLT_PRESENTATION 0x10000000l -#define DDBLT_LAST_PRESENTATION 0x20000000l - -/* - * If DDBLT_EXTENDED_FLAGS is set, then the driver should re-interpret - * other flags according to the definitions that follow. - * For example, bit 0 (0x00000001L) means DDBLT_ALPHADEST, unless - * DDBLT_EXTENDED_FLAGS is also set, in which case bit 0 means - * DDBLT_EXTENDED_LINEAR_CONTENT. - * Only DirectX9 and higher drivers will be given extended blt flags. - * Only flags explicitly mentioned here should be re-interpreted. - * All other flags retain their original meanings. - * - * List of re-interpreted flags: - * - * Bit Hex value New meaning old meaning - * --------------------------------------------------------------- - * 2 0x00000004 DDBLT_EXTENDED_LINEAR_CONTENT DDBLT_ALPHADESTNEG - * 4 0x00000010 DDBLT_EXTENDED_PRESENTATION_STRETCHFACTOR DDBLT_ALPHAEDGEBLEND - * - * - * NOTE: APPLICATIONS SHOULD NOT SET THIS FLAG. THIS FLAG IS INTENDED - * FOR USE BY THE DIRECT3D RUNTIME. - */ -#define DDBLT_EXTENDED_FLAGS 0x40000000l - -/* - * EXTENDED FLAG. SEE DEFINITION OF DDBLT_EXTENDED_FLAGS. - * This flag indidcates that the source surface contains content in a - * linear color space. The driver may perform gamma correction to the - * desktop color space (i.e. sRGB, gamma 2.2) as part of this blt. - * If the device can perform such a conversion as part of the copy, - * the driver should also set D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION - * - * NOTE: APPLICATIONS SHOULD NOT SET THIS FLAG. THIS FLAG IS INTENDED - * FOR USE BY THE DIRECT3D RUNTIME. Use IDirect3DSwapChain9::Present - * and specify D3DPRESENT_LINEAR_CONTENT in order to use this functionality. - */ -#define DDBLT_EXTENDED_LINEAR_CONTENT 0x00000004l - - -/**************************************************************************** - * - * BLTFAST FLAGS - * - ****************************************************************************/ - -#define DDBLTFAST_NOCOLORKEY 0x00000000 -#define DDBLTFAST_SRCCOLORKEY 0x00000001 -#define DDBLTFAST_DESTCOLORKEY 0x00000002 -#define DDBLTFAST_WAIT 0x00000010 -#define DDBLTFAST_DONOTWAIT 0x00000020 - -/**************************************************************************** - * - * FLIP FLAGS - * - ****************************************************************************/ - -#define DDFLIP_WAIT 0x00000001L - -/* - * Indicates that the target surface contains the even field of video data. - * This flag is only valid with an overlay surface. - */ -#define DDFLIP_EVEN 0x00000002L - -/* - * Indicates that the target surface contains the odd field of video data. - * This flag is only valid with an overlay surface. - */ -#define DDFLIP_ODD 0x00000004L - -/* - * Causes DirectDraw to perform the physical flip immediately and return - * to the application. Typically, what was the front buffer but is now the back - * buffer will still be visible (depending on timing) until the next vertical - * retrace. Subsequent operations involving the two flipped surfaces will - * not check to see if the physical flip has finished (i.e. will not return - * DDERR_WASSTILLDRAWING for that reason (but may for other reasons)). - * This allows an application to perform Flips at a higher frequency than the - * monitor refresh rate, but may introduce visible artifacts. - * Only effective if DDCAPS2_FLIPNOVSYNC is set. If that bit is not set, - * DDFLIP_NOVSYNC has no effect. - */ -#define DDFLIP_NOVSYNC 0x00000008L - - -/* - * Flip Interval Flags. These flags indicate how many vertical retraces to wait between - * each flip. The default is one. DirectDraw will return DDERR_WASSTILLDRAWING for each - * surface involved in the flip until the specified number of vertical retraces has - * ocurred. Only effective if DDCAPS2_FLIPINTERVAL is set. If that bit is not set, - * DDFLIP_INTERVALn has no effect. - */ - -/* - * DirectDraw will flip on every other vertical sync - */ -#define DDFLIP_INTERVAL2 0x02000000L - - -/* - * DirectDraw will flip on every third vertical sync - */ -#define DDFLIP_INTERVAL3 0x03000000L - - -/* - * DirectDraw will flip on every fourth vertical sync - */ -#define DDFLIP_INTERVAL4 0x04000000L - -/* - * DirectDraw will flip and display a main stereo surface - */ -#define DDFLIP_STEREO 0x00000010L - -/* - * On IDirectDrawSurface7 and higher interfaces, the default is DDFLIP_WAIT. If you wish - * to override the default and use time when the accelerator is busy (as denoted by - * the DDERR_WASSTILLDRAWING return code) then use DDFLIP_DONOTWAIT. - */ -#define DDFLIP_DONOTWAIT 0x00000020L - - -/**************************************************************************** - * - * DIRECTDRAW SURFACE OVERLAY FLAGS - * - ****************************************************************************/ - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the destination surface as the alpha channel for the - * destination overlay. - */ -#define DDOVER_ALPHADEST 0x00000001l - -/* - * Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the - * destination alpha channel for this overlay. - */ -#define DDOVER_ALPHADESTCONSTOVERRIDE 0x00000002l - -/* - * The NEG suffix indicates that the destination surface becomes more - * transparent as the alpha value increases. - */ -#define DDOVER_ALPHADESTNEG 0x00000004l - -/* - * Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha - * channel destination for this overlay. - */ -#define DDOVER_ALPHADESTSURFACEOVERRIDE 0x00000008l - -/* - * Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha - * channel for the edges of the image that border the color key colors. - */ -#define DDOVER_ALPHAEDGEBLEND 0x00000010l - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the source surface as the source alpha channel for this overlay. - */ -#define DDOVER_ALPHASRC 0x00000020l - -/* - * Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source - * alpha channel for this overlay. - */ -#define DDOVER_ALPHASRCCONSTOVERRIDE 0x00000040l - -/* - * The NEG suffix indicates that the source surface becomes more transparent - * as the alpha value increases. - */ -#define DDOVER_ALPHASRCNEG 0x00000080l - -/* - * Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel - * source for this overlay. - */ -#define DDOVER_ALPHASRCSURFACEOVERRIDE 0x00000100l - -/* - * Turn this overlay off. - */ -#define DDOVER_HIDE 0x00000200l - -/* - * Use the color key associated with the destination surface. - */ -#define DDOVER_KEYDEST 0x00000400l - -/* - * Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key - * for the destination surface - */ -#define DDOVER_KEYDESTOVERRIDE 0x00000800l - -/* - * Use the color key associated with the source surface. - */ -#define DDOVER_KEYSRC 0x00001000l - -/* - * Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key - * for the source surface. - */ -#define DDOVER_KEYSRCOVERRIDE 0x00002000l - -/* - * Turn this overlay on. - */ -#define DDOVER_SHOW 0x00004000l - -/* - * Add a dirty rect to an emulated overlayed surface. - */ -#define DDOVER_ADDDIRTYRECT 0x00008000l - -/* - * Redraw all dirty rects on an emulated overlayed surface. - */ -#define DDOVER_REFRESHDIRTYRECTS 0x00010000l - -/* - * Redraw the entire surface on an emulated overlayed surface. - */ -#define DDOVER_REFRESHALL 0x00020000l - - -/* - * Use the overlay FX flags to define special overlay FX - */ -#define DDOVER_DDFX 0x00080000l - -/* - * Autoflip the overlay when ever the video port autoflips - */ -#define DDOVER_AUTOFLIP 0x00100000l - -/* - * Display each field of video port data individually without - * causing any jittery artifacts - */ -#define DDOVER_BOB 0x00200000l - -/* - * Indicates that bob/weave decisions should not be overridden by other - * interfaces. - */ -#define DDOVER_OVERRIDEBOBWEAVE 0x00400000l - -/* - * Indicates that the surface memory is composed of interleaved fields. - */ -#define DDOVER_INTERLEAVED 0x00800000l - -/* - * Indicates that bob will be performed using hardware rather than - * software or emulated. - */ -#define DDOVER_BOBHARDWARE 0x01000000l - -/* - * Indicates that overlay FX structure contains valid ARGB scaling factors. - */ -#define DDOVER_ARGBSCALEFACTORS 0x02000000l - -/* - * Indicates that ARGB scaling factors can be degraded to fit driver capabilities. - */ -#define DDOVER_DEGRADEARGBSCALING 0x04000000l - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE LOCK FLAGS - * - ****************************************************************************/ - -/* - * The default. Set to indicate that Lock should return a valid memory pointer - * to the top of the specified rectangle. If no rectangle is specified then a - * pointer to the top of the surface is returned. - */ -#define DDLOCK_SURFACEMEMORYPTR 0x00000000L // default - -/* - * Set to indicate that Lock should wait until it can obtain a valid memory - * pointer before returning. If this bit is set, Lock will never return - * DDERR_WASSTILLDRAWING. - */ -#define DDLOCK_WAIT 0x00000001L - -/* - * Set if an event handle is being passed to Lock. Lock will trigger the event - * when it can return the surface memory pointer requested. - */ -#define DDLOCK_EVENT 0x00000002L - -/* - * Indicates that the surface being locked will only be read from. - */ -#define DDLOCK_READONLY 0x00000010L - -/* - * Indicates that the surface being locked will only be written to - */ -#define DDLOCK_WRITEONLY 0x00000020L - - -/* - * Indicates that a system wide lock should not be taken when this surface - * is locked. This has several advantages (cursor responsiveness, ability - * to call more Windows functions, easier debugging) when locking video - * memory surfaces. However, an application specifying this flag must - * comply with a number of conditions documented in the help file. - * Furthermore, this flag cannot be specified when locking the primary. - */ -#define DDLOCK_NOSYSLOCK 0x00000800L - -/* - * Used only with Direct3D Vertex Buffer Locks. Indicates that no vertices - * that were referred to in Draw*PrimtiveVB calls since the start of the - * frame (or the last lock without this flag) will be modified during the - * lock. This can be useful when one is only appending data to the vertex - * buffer - */ -#define DDLOCK_NOOVERWRITE 0x00001000L - -/* - * Indicates that no assumptions will be made about the contents of the - * surface or vertex buffer during this lock. - * This enables two things: - * - Direct3D or the driver may provide an alternative memory - * area as the vertex buffer. This is useful when one plans to clear the - * contents of the vertex buffer and fill in new data. - * - Drivers sometimes store surface data in a re-ordered format. - * When the application locks the surface, the driver is forced to un-re-order - * the surface data before allowing the application to see the surface contents. - * This flag is a hint to the driver that it can skip the un-re-ordering process - * since the application plans to overwrite every single pixel in the surface - * or locked rectangle (and so erase any un-re-ordered pixels anyway). - * Applications should always set this flag when they intend to overwrite the entire - * surface or locked rectangle. - */ -#define DDLOCK_DISCARDCONTENTS 0x00002000L - /* - * DDLOCK_OKTOSWAP is an older, less informative name for DDLOCK_DISCARDCONTENTS - */ -#define DDLOCK_OKTOSWAP 0x00002000L - -/* - * On IDirectDrawSurface7 and higher interfaces, the default is DDLOCK_WAIT. If you wish - * to override the default and use time when the accelerator is busy (as denoted by - * the DDERR_WASSTILLDRAWING return code) then use DDLOCK_DONOTWAIT. - */ -#define DDLOCK_DONOTWAIT 0x00004000L - -/* - * This indicates volume texture lock with front and back specified. - */ -#define DDLOCK_HASVOLUMETEXTUREBOXRECT 0x00008000L - -/* - * This indicates that the driver should not update dirty rect information for this lock. - */ -#define DDLOCK_NODIRTYUPDATE 0x00010000L - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE PAGELOCK FLAGS - * - ****************************************************************************/ - -/* - * No flags defined at present - */ - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS - * - ****************************************************************************/ - -/* - * No flags defined at present - */ - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE BLT FX FLAGS - * - ****************************************************************************/ - -/* - * If stretching, use arithmetic stretching along the Y axis for this blt. - */ -#define DDBLTFX_ARITHSTRETCHY 0x00000001l - -/* - * Do this blt mirroring the surface left to right. Spin the - * surface around its y-axis. - */ -#define DDBLTFX_MIRRORLEFTRIGHT 0x00000002l - -/* - * Do this blt mirroring the surface up and down. Spin the surface - * around its x-axis. - */ -#define DDBLTFX_MIRRORUPDOWN 0x00000004l - -/* - * Schedule this blt to avoid tearing. - */ -#define DDBLTFX_NOTEARING 0x00000008l - -/* - * Do this blt rotating the surface one hundred and eighty degrees. - */ -#define DDBLTFX_ROTATE180 0x00000010l - -/* - * Do this blt rotating the surface two hundred and seventy degrees. - */ -#define DDBLTFX_ROTATE270 0x00000020l - -/* - * Do this blt rotating the surface ninety degrees. - */ -#define DDBLTFX_ROTATE90 0x00000040l - -/* - * Do this z blt using dwZBufferLow and dwZBufferHigh as range values - * specified to limit the bits copied from the source surface. - */ -#define DDBLTFX_ZBUFFERRANGE 0x00000080l - -/* - * Do this z blt adding the dwZBufferBaseDest to each of the sources z values - * before comparing it with the desting z values. - */ -#define DDBLTFX_ZBUFFERBASEDEST 0x00000100l - -/**************************************************************************** - * - * DIRECTDRAWSURFACE OVERLAY FX FLAGS - * - ****************************************************************************/ - -/* - * If stretching, use arithmetic stretching along the Y axis for this overlay. - */ -#define DDOVERFX_ARITHSTRETCHY 0x00000001l - -/* - * Mirror the overlay across the vertical axis - */ -#define DDOVERFX_MIRRORLEFTRIGHT 0x00000002l - -/* - * Mirror the overlay across the horizontal axis - */ -#define DDOVERFX_MIRRORUPDOWN 0x00000004l - -/* - * Deinterlace the overlay, if possible - */ -#define DDOVERFX_DEINTERLACE 0x00000008l - - -/**************************************************************************** - * - * DIRECTDRAW WAITFORVERTICALBLANK FLAGS - * - ****************************************************************************/ - -/* - * return when the vertical blank interval begins - */ -#define DDWAITVB_BLOCKBEGIN 0x00000001l - -/* - * set up an event to trigger when the vertical blank begins - */ -#define DDWAITVB_BLOCKBEGINEVENT 0x00000002l - -/* - * return when the vertical blank interval ends and display begins - */ -#define DDWAITVB_BLOCKEND 0x00000004l - -/**************************************************************************** - * - * DIRECTDRAW GETFLIPSTATUS FLAGS - * - ****************************************************************************/ - -/* - * is it OK to flip now? - */ -#define DDGFS_CANFLIP 0x00000001l - -/* - * is the last flip finished? - */ -#define DDGFS_ISFLIPDONE 0x00000002l - -/**************************************************************************** - * - * DIRECTDRAW GETBLTSTATUS FLAGS - * - ****************************************************************************/ - -/* - * is it OK to blt now? - */ -#define DDGBS_CANBLT 0x00000001l - -/* - * is the blt to the surface finished? - */ -#define DDGBS_ISBLTDONE 0x00000002l - - -/**************************************************************************** - * - * DIRECTDRAW ENUMOVERLAYZORDER FLAGS - * - ****************************************************************************/ - -/* - * Enumerate overlays back to front. - */ -#define DDENUMOVERLAYZ_BACKTOFRONT 0x00000000l - -/* - * Enumerate overlays front to back - */ -#define DDENUMOVERLAYZ_FRONTTOBACK 0x00000001l - -/**************************************************************************** - * - * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS - * - ****************************************************************************/ - -/* - * Send overlay to front - */ -#define DDOVERZ_SENDTOFRONT 0x00000000l - -/* - * Send overlay to back - */ -#define DDOVERZ_SENDTOBACK 0x00000001l - -/* - * Move Overlay forward - */ -#define DDOVERZ_MOVEFORWARD 0x00000002l - -/* - * Move Overlay backward - */ -#define DDOVERZ_MOVEBACKWARD 0x00000003l - -/* - * Move Overlay in front of relative surface - */ -#define DDOVERZ_INSERTINFRONTOF 0x00000004l - -/* - * Move Overlay in back of relative surface - */ -#define DDOVERZ_INSERTINBACKOF 0x00000005l - - -/**************************************************************************** - * - * DIRECTDRAW SETGAMMARAMP FLAGS - * - ****************************************************************************/ - -/* - * Request calibrator to adjust the gamma ramp according to the physical - * properties of the display so that the result should appear identical - * on all systems. - */ -#define DDSGR_CALIBRATE 0x00000001L - - -/**************************************************************************** - * - * DIRECTDRAW STARTMODETEST FLAGS - * - ****************************************************************************/ - -/* - * Indicates that the mode being tested has passed - */ -#define DDSMT_ISTESTREQUIRED 0x00000001L - - -/**************************************************************************** - * - * DIRECTDRAW EVALUATEMODE FLAGS - * - ****************************************************************************/ - -/* - * Indicates that the mode being tested has passed - */ -#define DDEM_MODEPASSED 0x00000001L - -/* - * Indicates that the mode being tested has failed - */ -#define DDEM_MODEFAILED 0x00000002L - - -/*=========================================================================== - * - * - * DIRECTDRAW RETURN CODES - * - * The return values from DirectDraw Commands and Surface that return an HRESULT - * are codes from DirectDraw concerning the results of the action - * requested by DirectDraw. - * - *==========================================================================*/ - -/* - * Status is OK - * - * Issued by: DirectDraw Commands and all callbacks - */ -#define DD_OK S_OK -#define DD_FALSE S_FALSE - -/**************************************************************************** - * - * DIRECTDRAW ENUMCALLBACK RETURN VALUES - * - * EnumCallback returns are used to control the flow of the DIRECTDRAW and - * DIRECTDRAWSURFACE object enumerations. They can only be returned by - * enumeration callback routines. - * - ****************************************************************************/ - -/* - * stop the enumeration - */ -#define DDENUMRET_CANCEL 0 - -/* - * continue the enumeration - */ -#define DDENUMRET_OK 1 - -/**************************************************************************** - * - * DIRECTDRAW ERRORS - * - * Errors are represented by negative values and cannot be combined. - * - ****************************************************************************/ - -/* - * This object is already initialized - */ -#define DDERR_ALREADYINITIALIZED MAKE_DDHRESULT( 5 ) - -/* - * This surface can not be attached to the requested surface. - */ -#define DDERR_CANNOTATTACHSURFACE MAKE_DDHRESULT( 10 ) - -/* - * This surface can not be detached from the requested surface. - */ -#define DDERR_CANNOTDETACHSURFACE MAKE_DDHRESULT( 20 ) - -/* - * Support is currently not available. - */ -#define DDERR_CURRENTLYNOTAVAIL MAKE_DDHRESULT( 40 ) - -/* - * An exception was encountered while performing the requested operation - */ -#define DDERR_EXCEPTION MAKE_DDHRESULT( 55 ) - -/* - * Generic failure. - */ -#define DDERR_GENERIC E_FAIL - -/* - * Height of rectangle provided is not a multiple of reqd alignment - */ -#define DDERR_HEIGHTALIGN MAKE_DDHRESULT( 90 ) - -/* - * Unable to match primary surface creation request with existing - * primary surface. - */ -#define DDERR_INCOMPATIBLEPRIMARY MAKE_DDHRESULT( 95 ) - -/* - * One or more of the caps bits passed to the callback are incorrect. - */ -#define DDERR_INVALIDCAPS MAKE_DDHRESULT( 100 ) - -/* - * DirectDraw does not support provided Cliplist. - */ -#define DDERR_INVALIDCLIPLIST MAKE_DDHRESULT( 110 ) - -/* - * DirectDraw does not support the requested mode - */ -#define DDERR_INVALIDMODE MAKE_DDHRESULT( 120 ) - -/* - * DirectDraw received a pointer that was an invalid DIRECTDRAW object. - */ -#define DDERR_INVALIDOBJECT MAKE_DDHRESULT( 130 ) - -/* - * One or more of the parameters passed to the callback function are - * incorrect. - */ -#define DDERR_INVALIDPARAMS E_INVALIDARG - -/* - * pixel format was invalid as specified - */ -#define DDERR_INVALIDPIXELFORMAT MAKE_DDHRESULT( 145 ) - -/* - * Rectangle provided was invalid. - */ -#define DDERR_INVALIDRECT MAKE_DDHRESULT( 150 ) - -/* - * Operation could not be carried out because one or more surfaces are locked - */ -#define DDERR_LOCKEDSURFACES MAKE_DDHRESULT( 160 ) - -/* - * There is no 3D present. - */ -#define DDERR_NO3D MAKE_DDHRESULT( 170 ) - -/* - * Operation could not be carried out because there is no alpha accleration - * hardware present or available. - */ -#define DDERR_NOALPHAHW MAKE_DDHRESULT( 180 ) - -/* - * Operation could not be carried out because there is no stereo - * hardware present or available. - */ -#define DDERR_NOSTEREOHARDWARE MAKE_DDHRESULT( 181 ) - -/* - * Operation could not be carried out because there is no hardware - * present which supports stereo surfaces - */ -#define DDERR_NOSURFACELEFT MAKE_DDHRESULT( 182 ) - - - -/* - * no clip list available - */ -#define DDERR_NOCLIPLIST MAKE_DDHRESULT( 205 ) - -/* - * Operation could not be carried out because there is no color conversion - * hardware present or available. - */ -#define DDERR_NOCOLORCONVHW MAKE_DDHRESULT( 210 ) - -/* - * Create function called without DirectDraw object method SetCooperativeLevel - * being called. - */ -#define DDERR_NOCOOPERATIVELEVELSET MAKE_DDHRESULT( 212 ) - -/* - * Surface doesn't currently have a color key - */ -#define DDERR_NOCOLORKEY MAKE_DDHRESULT( 215 ) - -/* - * Operation could not be carried out because there is no hardware support - * of the dest color key. - */ -#define DDERR_NOCOLORKEYHW MAKE_DDHRESULT( 220 ) - -/* - * No DirectDraw support possible with current display driver - */ -#define DDERR_NODIRECTDRAWSUPPORT MAKE_DDHRESULT( 222 ) - -/* - * Operation requires the application to have exclusive mode but the - * application does not have exclusive mode. - */ -#define DDERR_NOEXCLUSIVEMODE MAKE_DDHRESULT( 225 ) - -/* - * Flipping visible surfaces is not supported. - */ -#define DDERR_NOFLIPHW MAKE_DDHRESULT( 230 ) - -/* - * There is no GDI present. - */ -#define DDERR_NOGDI MAKE_DDHRESULT( 240 ) - -/* - * Operation could not be carried out because there is no hardware present - * or available. - */ -#define DDERR_NOMIRRORHW MAKE_DDHRESULT( 250 ) - -/* - * Requested item was not found - */ -#define DDERR_NOTFOUND MAKE_DDHRESULT( 255 ) - -/* - * Operation could not be carried out because there is no overlay hardware - * present or available. - */ -#define DDERR_NOOVERLAYHW MAKE_DDHRESULT( 260 ) - -/* - * Operation could not be carried out because the source and destination - * rectangles are on the same surface and overlap each other. - */ -#define DDERR_OVERLAPPINGRECTS MAKE_DDHRESULT( 270 ) - -/* - * Operation could not be carried out because there is no appropriate raster - * op hardware present or available. - */ -#define DDERR_NORASTEROPHW MAKE_DDHRESULT( 280 ) - -/* - * Operation could not be carried out because there is no rotation hardware - * present or available. - */ -#define DDERR_NOROTATIONHW MAKE_DDHRESULT( 290 ) - -/* - * Operation could not be carried out because there is no hardware support - * for stretching - */ -#define DDERR_NOSTRETCHHW MAKE_DDHRESULT( 310 ) - -/* - * DirectDrawSurface is not in 4 bit color palette and the requested operation - * requires 4 bit color palette. - */ -#define DDERR_NOT4BITCOLOR MAKE_DDHRESULT( 316 ) - -/* - * DirectDrawSurface is not in 4 bit color index palette and the requested - * operation requires 4 bit color index palette. - */ -#define DDERR_NOT4BITCOLORINDEX MAKE_DDHRESULT( 317 ) - -/* - * DirectDraw Surface is not in 8 bit color mode and the requested operation - * requires 8 bit color. - */ -#define DDERR_NOT8BITCOLOR MAKE_DDHRESULT( 320 ) - -/* - * Operation could not be carried out because there is no texture mapping - * hardware present or available. - */ -#define DDERR_NOTEXTUREHW MAKE_DDHRESULT( 330 ) - -/* - * Operation could not be carried out because there is no hardware support - * for vertical blank synchronized operations. - */ -#define DDERR_NOVSYNCHW MAKE_DDHRESULT( 335 ) - -/* - * Operation could not be carried out because there is no hardware support - * for zbuffer blting. - */ -#define DDERR_NOZBUFFERHW MAKE_DDHRESULT( 340 ) - -/* - * Overlay surfaces could not be z layered based on their BltOrder because - * the hardware does not support z layering of overlays. - */ -#define DDERR_NOZOVERLAYHW MAKE_DDHRESULT( 350 ) - -/* - * The hardware needed for the requested operation has already been - * allocated. - */ -#define DDERR_OUTOFCAPS MAKE_DDHRESULT( 360 ) - -/* - * DirectDraw does not have enough memory to perform the operation. - */ -#define DDERR_OUTOFMEMORY E_OUTOFMEMORY - -/* - * DirectDraw does not have enough memory to perform the operation. - */ -#define DDERR_OUTOFVIDEOMEMORY MAKE_DDHRESULT( 380 ) - -/* - * hardware does not support clipped overlays - */ -#define DDERR_OVERLAYCANTCLIP MAKE_DDHRESULT( 382 ) - -/* - * Can only have ony color key active at one time for overlays - */ -#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE MAKE_DDHRESULT( 384 ) - -/* - * Access to this palette is being refused because the palette is already - * locked by another thread. - */ -#define DDERR_PALETTEBUSY MAKE_DDHRESULT( 387 ) - -/* - * No src color key specified for this operation. - */ -#define DDERR_COLORKEYNOTSET MAKE_DDHRESULT( 400 ) - -/* - * This surface is already attached to the surface it is being attached to. - */ -#define DDERR_SURFACEALREADYATTACHED MAKE_DDHRESULT( 410 ) - -/* - * This surface is already a dependency of the surface it is being made a - * dependency of. - */ -#define DDERR_SURFACEALREADYDEPENDENT MAKE_DDHRESULT( 420 ) - -/* - * Access to this surface is being refused because the surface is already - * locked by another thread. - */ -#define DDERR_SURFACEBUSY MAKE_DDHRESULT( 430 ) - -/* - * Access to this surface is being refused because no driver exists - * which can supply a pointer to the surface. - * This is most likely to happen when attempting to lock the primary - * surface when no DCI provider is present. - * Will also happen on attempts to lock an optimized surface. - */ -#define DDERR_CANTLOCKSURFACE MAKE_DDHRESULT( 435 ) - -/* - * Access to Surface refused because Surface is obscured. - */ -#define DDERR_SURFACEISOBSCURED MAKE_DDHRESULT( 440 ) - -/* - * Access to this surface is being refused because the surface is gone. - * The DIRECTDRAWSURFACE object representing this surface should - * have Restore called on it. - */ -#define DDERR_SURFACELOST MAKE_DDHRESULT( 450 ) - -/* - * The requested surface is not attached. - */ -#define DDERR_SURFACENOTATTACHED MAKE_DDHRESULT( 460 ) - -/* - * Height requested by DirectDraw is too large. - */ -#define DDERR_TOOBIGHEIGHT MAKE_DDHRESULT( 470 ) - -/* - * Size requested by DirectDraw is too large -- The individual height and - * width are OK. - */ -#define DDERR_TOOBIGSIZE MAKE_DDHRESULT( 480 ) - -/* - * Width requested by DirectDraw is too large. - */ -#define DDERR_TOOBIGWIDTH MAKE_DDHRESULT( 490 ) - -/* - * Action not supported. - */ -#define DDERR_UNSUPPORTED E_NOTIMPL - -/* - * Pixel format requested is unsupported by DirectDraw - */ -#define DDERR_UNSUPPORTEDFORMAT MAKE_DDHRESULT( 510 ) - -/* - * Bitmask in the pixel format requested is unsupported by DirectDraw - */ -#define DDERR_UNSUPPORTEDMASK MAKE_DDHRESULT( 520 ) - -/* - * The specified stream contains invalid data - */ -#define DDERR_INVALIDSTREAM MAKE_DDHRESULT( 521 ) - -/* - * vertical blank is in progress - */ -#define DDERR_VERTICALBLANKINPROGRESS MAKE_DDHRESULT( 537 ) - -/* - * Informs DirectDraw that the previous Blt which is transfering information - * to or from this Surface is incomplete. - */ -#define DDERR_WASSTILLDRAWING MAKE_DDHRESULT( 540 ) - - -/* - * The specified surface type requires specification of the COMPLEX flag - */ -#define DDERR_DDSCAPSCOMPLEXREQUIRED MAKE_DDHRESULT( 542 ) - - -/* - * Rectangle provided was not horizontally aligned on reqd. boundary - */ -#define DDERR_XALIGN MAKE_DDHRESULT( 560 ) - -/* - * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver - * identifier. - */ -#define DDERR_INVALIDDIRECTDRAWGUID MAKE_DDHRESULT( 561 ) - -/* - * A DirectDraw object representing this driver has already been created - * for this process. - */ -#define DDERR_DIRECTDRAWALREADYCREATED MAKE_DDHRESULT( 562 ) - -/* - * A hardware only DirectDraw object creation was attempted but the driver - * did not support any hardware. - */ -#define DDERR_NODIRECTDRAWHW MAKE_DDHRESULT( 563 ) - -/* - * this process already has created a primary surface - */ -#define DDERR_PRIMARYSURFACEALREADYEXISTS MAKE_DDHRESULT( 564 ) - -/* - * software emulation not available. - */ -#define DDERR_NOEMULATION MAKE_DDHRESULT( 565 ) - -/* - * region passed to Clipper::GetClipList is too small. - */ -#define DDERR_REGIONTOOSMALL MAKE_DDHRESULT( 566 ) - -/* - * an attempt was made to set a clip list for a clipper objec that - * is already monitoring an hwnd. - */ -#define DDERR_CLIPPERISUSINGHWND MAKE_DDHRESULT( 567 ) - -/* - * No clipper object attached to surface object - */ -#define DDERR_NOCLIPPERATTACHED MAKE_DDHRESULT( 568 ) - -/* - * Clipper notification requires an HWND or - * no HWND has previously been set as the CooperativeLevel HWND. - */ -#define DDERR_NOHWND MAKE_DDHRESULT( 569 ) - -/* - * HWND used by DirectDraw CooperativeLevel has been subclassed, - * this prevents DirectDraw from restoring state. - */ -#define DDERR_HWNDSUBCLASSED MAKE_DDHRESULT( 570 ) - -/* - * The CooperativeLevel HWND has already been set. - * It can not be reset while the process has surfaces or palettes created. - */ -#define DDERR_HWNDALREADYSET MAKE_DDHRESULT( 571 ) - -/* - * No palette object attached to this surface. - */ -#define DDERR_NOPALETTEATTACHED MAKE_DDHRESULT( 572 ) - -/* - * No hardware support for 16 or 256 color palettes. - */ -#define DDERR_NOPALETTEHW MAKE_DDHRESULT( 573 ) - -/* - * If a clipper object is attached to the source surface passed into a - * BltFast call. - */ -#define DDERR_BLTFASTCANTCLIP MAKE_DDHRESULT( 574 ) - -/* - * No blter. - */ -#define DDERR_NOBLTHW MAKE_DDHRESULT( 575 ) - -/* - * No DirectDraw ROP hardware. - */ -#define DDERR_NODDROPSHW MAKE_DDHRESULT( 576 ) - -/* - * returned when GetOverlayPosition is called on a hidden overlay - */ -#define DDERR_OVERLAYNOTVISIBLE MAKE_DDHRESULT( 577 ) - -/* - * returned when GetOverlayPosition is called on a overlay that UpdateOverlay - * has never been called on to establish a destionation. - */ -#define DDERR_NOOVERLAYDEST MAKE_DDHRESULT( 578 ) - -/* - * returned when the position of the overlay on the destionation is no longer - * legal for that destionation. - */ -#define DDERR_INVALIDPOSITION MAKE_DDHRESULT( 579 ) - -/* - * returned when an overlay member is called for a non-overlay surface - */ -#define DDERR_NOTAOVERLAYSURFACE MAKE_DDHRESULT( 580 ) - -/* - * An attempt was made to set the cooperative level when it was already - * set to exclusive. - */ -#define DDERR_EXCLUSIVEMODEALREADYSET MAKE_DDHRESULT( 581 ) - -/* - * An attempt has been made to flip a surface that is not flippable. - */ -#define DDERR_NOTFLIPPABLE MAKE_DDHRESULT( 582 ) - -/* - * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly - * created. - */ -#define DDERR_CANTDUPLICATE MAKE_DDHRESULT( 583 ) - -/* - * Surface was not locked. An attempt to unlock a surface that was not - * locked at all, or by this process, has been attempted. - */ -#define DDERR_NOTLOCKED MAKE_DDHRESULT( 584 ) - -/* - * Windows can not create any more DCs, or a DC was requested for a paltte-indexed - * surface when the surface had no palette AND the display mode was not palette-indexed - * (in this case DirectDraw cannot select a proper palette into the DC) - */ -#define DDERR_CANTCREATEDC MAKE_DDHRESULT( 585 ) - -/* - * No DC was ever created for this surface. - */ -#define DDERR_NODC MAKE_DDHRESULT( 586 ) - -/* - * This surface can not be restored because it was created in a different - * mode. - */ -#define DDERR_WRONGMODE MAKE_DDHRESULT( 587 ) - -/* - * This surface can not be restored because it is an implicitly created - * surface. - */ -#define DDERR_IMPLICITLYCREATED MAKE_DDHRESULT( 588 ) - -/* - * The surface being used is not a palette-based surface - */ -#define DDERR_NOTPALETTIZED MAKE_DDHRESULT( 589 ) - - -/* - * The display is currently in an unsupported mode - */ -#define DDERR_UNSUPPORTEDMODE MAKE_DDHRESULT( 590 ) - -/* - * Operation could not be carried out because there is no mip-map - * texture mapping hardware present or available. - */ -#define DDERR_NOMIPMAPHW MAKE_DDHRESULT( 591 ) - -/* - * The requested action could not be performed because the surface was of - * the wrong type. - */ -#define DDERR_INVALIDSURFACETYPE MAKE_DDHRESULT( 592 ) - - -/* - * Device does not support optimized surfaces, therefore no video memory optimized surfaces - */ -#define DDERR_NOOPTIMIZEHW MAKE_DDHRESULT( 600 ) - -/* - * Surface is an optimized surface, but has not yet been allocated any memory - */ -#define DDERR_NOTLOADED MAKE_DDHRESULT( 601 ) - -/* - * Attempt was made to create or set a device window without first setting - * the focus window - */ -#define DDERR_NOFOCUSWINDOW MAKE_DDHRESULT( 602 ) - -/* - * Attempt was made to set a palette on a mipmap sublevel - */ -#define DDERR_NOTONMIPMAPSUBLEVEL MAKE_DDHRESULT( 603 ) - -/* - * A DC has already been returned for this surface. Only one DC can be - * retrieved per surface. - */ -#define DDERR_DCALREADYCREATED MAKE_DDHRESULT( 620 ) - -/* - * An attempt was made to allocate non-local video memory from a device - * that does not support non-local video memory. - */ -#define DDERR_NONONLOCALVIDMEM MAKE_DDHRESULT( 630 ) - -/* - * The attempt to page lock a surface failed. - */ -#define DDERR_CANTPAGELOCK MAKE_DDHRESULT( 640 ) - - -/* - * The attempt to page unlock a surface failed. - */ -#define DDERR_CANTPAGEUNLOCK MAKE_DDHRESULT( 660 ) - -/* - * An attempt was made to page unlock a surface with no outstanding page locks. - */ -#define DDERR_NOTPAGELOCKED MAKE_DDHRESULT( 680 ) - -/* - * There is more data available than the specified buffer size could hold - */ -#define DDERR_MOREDATA MAKE_DDHRESULT( 690 ) - -/* - * The data has expired and is therefore no longer valid. - */ -#define DDERR_EXPIRED MAKE_DDHRESULT( 691 ) - -/* - * The mode test has finished executing. - */ -#define DDERR_TESTFINISHED MAKE_DDHRESULT( 692 ) - -/* - * The mode test has switched to a new mode. - */ -#define DDERR_NEWMODE MAKE_DDHRESULT( 693 ) - -/* - * D3D has not yet been initialized. - */ -#define DDERR_D3DNOTINITIALIZED MAKE_DDHRESULT( 694 ) - -/* - * The video port is not active - */ -#define DDERR_VIDEONOTACTIVE MAKE_DDHRESULT( 695 ) - -/* - * The monitor does not have EDID data. - */ -#define DDERR_NOMONITORINFORMATION MAKE_DDHRESULT( 696 ) - -/* - * The driver does not enumerate display mode refresh rates. - */ -#define DDERR_NODRIVERSUPPORT MAKE_DDHRESULT( 697 ) - -/* - * Surfaces created by one direct draw device cannot be used directly by - * another direct draw device. - */ -#define DDERR_DEVICEDOESNTOWNSURFACE MAKE_DDHRESULT( 699 ) - - - -/* - * An attempt was made to invoke an interface member of a DirectDraw object - * created by CoCreateInstance() before it was initialized. - */ -#define DDERR_NOTINITIALIZED CO_E_NOTINITIALIZED - - -/* Alpha bit depth constants */ - - -#ifdef __cplusplus -}; -#endif - -#ifdef ENABLE_NAMELESS_UNION_PRAGMA -#pragma warning(default:4201) -#endif - -#endif //__DDRAW_INCLUDED__ - - diff --git a/RenderDll/Dx9Sdk/Include/dinput.h b/RenderDll/Dx9Sdk/Include/dinput.h new file mode 100644 index 0000000..5aac256 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/dinput.h @@ -0,0 +1,4417 @@ +/**************************************************************************** + * + * Copyright (C) 1996-2000 Microsoft Corporation. All Rights Reserved. + * + * File: dinput.h + * Content: DirectInput include file + * + ****************************************************************************/ + +#ifndef __DINPUT_INCLUDED__ +#define __DINPUT_INCLUDED__ + +#ifndef DIJ_RINGZERO + +#ifdef _WIN32 +#define COM_NO_WINDOWS_H +#include +#endif + +#endif /* DIJ_RINGZERO */ + +#ifdef __cplusplus +extern "C" { +#endif + + + + + +/* + * To build applications for older versions of DirectInput + * + * #define DIRECTINPUT_VERSION [ 0x0300 | 0x0500 | 0x0700 ] + * + * before #include . By default, #include + * will produce a DirectX 8-compatible header file. + * + */ + +#define DIRECTINPUT_HEADER_VERSION 0x0800 +#ifndef DIRECTINPUT_VERSION +#define DIRECTINPUT_VERSION DIRECTINPUT_HEADER_VERSION +#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800") +#endif + +#ifndef DIJ_RINGZERO + +/**************************************************************************** + * + * Class IDs + * + ****************************************************************************/ + +DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(CLSID_DirectInputDevice, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +DEFINE_GUID(CLSID_DirectInput8, 0x25E609E4,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(CLSID_DirectInputDevice8,0x25E609E5,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +/**************************************************************************** + * + * Interfaces + * + ****************************************************************************/ + +DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInput7A, 0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); +DEFINE_GUID(IID_IDirectInput7W, 0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); +DEFINE_GUID(IID_IDirectInput8A, 0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00); +DEFINE_GUID(IID_IDirectInput8W, 0xBF798031,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00); +DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputDevice2A,0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputDevice2W,0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputDevice7A,0x57D7C6BC,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); +DEFINE_GUID(IID_IDirectInputDevice7W,0x57D7C6BD,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); +DEFINE_GUID(IID_IDirectInputDevice8A,0x54D41080,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79); +DEFINE_GUID(IID_IDirectInputDevice8W,0x54D41081,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79); +DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); + +/**************************************************************************** + * + * Predefined object types + * + ****************************************************************************/ + +DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_RxAxis, 0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_RyAxis, 0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_RzAxis, 0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_Slider, 0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +DEFINE_GUID(GUID_Button, 0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +DEFINE_GUID(GUID_Unknown, 0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +/**************************************************************************** + * + * Predefined product GUIDs + * + ****************************************************************************/ + +DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_SysKeyboard,0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_Joystick ,0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_SysMouseEm, 0x6F1D2B80,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_SysMouseEm2,0x6F1D2B81,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_SysKeyboardEm, 0x6F1D2B82,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_SysKeyboardEm2,0x6F1D2B83,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +/**************************************************************************** + * + * Predefined force feedback effects + * + ****************************************************************************/ + +DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); + +#endif /* DIJ_RINGZERO */ + +/**************************************************************************** + * + * Interfaces and Structures... + * + ****************************************************************************/ + +#if(DIRECTINPUT_VERSION >= 0x0500) + +/**************************************************************************** + * + * IDirectInputEffect + * + ****************************************************************************/ + +#define DIEFT_ALL 0x00000000 + +#define DIEFT_CONSTANTFORCE 0x00000001 +#define DIEFT_RAMPFORCE 0x00000002 +#define DIEFT_PERIODIC 0x00000003 +#define DIEFT_CONDITION 0x00000004 +#define DIEFT_CUSTOMFORCE 0x00000005 +#define DIEFT_HARDWARE 0x000000FF +#define DIEFT_FFATTACK 0x00000200 +#define DIEFT_FFFADE 0x00000400 +#define DIEFT_SATURATION 0x00000800 +#define DIEFT_POSNEGCOEFFICIENTS 0x00001000 +#define DIEFT_POSNEGSATURATION 0x00002000 +#define DIEFT_DEADBAND 0x00004000 +#define DIEFT_STARTDELAY 0x00008000 +#define DIEFT_GETTYPE(n) LOBYTE(n) + +#define DI_DEGREES 100 +#define DI_FFNOMINALMAX 10000 +#define DI_SECONDS 1000000 + +typedef struct DICONSTANTFORCE { + LONG lMagnitude; +} DICONSTANTFORCE, *LPDICONSTANTFORCE; +typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE; + +typedef struct DIRAMPFORCE { + LONG lStart; + LONG lEnd; +} DIRAMPFORCE, *LPDIRAMPFORCE; +typedef const DIRAMPFORCE *LPCDIRAMPFORCE; + +typedef struct DIPERIODIC { + DWORD dwMagnitude; + LONG lOffset; + DWORD dwPhase; + DWORD dwPeriod; +} DIPERIODIC, *LPDIPERIODIC; +typedef const DIPERIODIC *LPCDIPERIODIC; + +typedef struct DICONDITION { + LONG lOffset; + LONG lPositiveCoefficient; + LONG lNegativeCoefficient; + DWORD dwPositiveSaturation; + DWORD dwNegativeSaturation; + LONG lDeadBand; +} DICONDITION, *LPDICONDITION; +typedef const DICONDITION *LPCDICONDITION; + +typedef struct DICUSTOMFORCE { + DWORD cChannels; + DWORD dwSamplePeriod; + DWORD cSamples; + LPLONG rglForceData; +} DICUSTOMFORCE, *LPDICUSTOMFORCE; +typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE; + + +typedef struct DIENVELOPE { + DWORD dwSize; /* sizeof(DIENVELOPE) */ + DWORD dwAttackLevel; + DWORD dwAttackTime; /* Microseconds */ + DWORD dwFadeLevel; + DWORD dwFadeTime; /* Microseconds */ +} DIENVELOPE, *LPDIENVELOPE; +typedef const DIENVELOPE *LPCDIENVELOPE; + + +/* This structure is defined for DirectX 5.0 compatibility */ +typedef struct DIEFFECT_DX5 { + DWORD dwSize; /* sizeof(DIEFFECT_DX5) */ + DWORD dwFlags; /* DIEFF_* */ + DWORD dwDuration; /* Microseconds */ + DWORD dwSamplePeriod; /* Microseconds */ + DWORD dwGain; + DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */ + DWORD dwTriggerRepeatInterval; /* Microseconds */ + DWORD cAxes; /* Number of axes */ + LPDWORD rgdwAxes; /* Array of axes */ + LPLONG rglDirection; /* Array of directions */ + LPDIENVELOPE lpEnvelope; /* Optional */ + DWORD cbTypeSpecificParams; /* Size of params */ + LPVOID lpvTypeSpecificParams; /* Pointer to params */ +} DIEFFECT_DX5, *LPDIEFFECT_DX5; +typedef const DIEFFECT_DX5 *LPCDIEFFECT_DX5; + +typedef struct DIEFFECT { + DWORD dwSize; /* sizeof(DIEFFECT) */ + DWORD dwFlags; /* DIEFF_* */ + DWORD dwDuration; /* Microseconds */ + DWORD dwSamplePeriod; /* Microseconds */ + DWORD dwGain; + DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */ + DWORD dwTriggerRepeatInterval; /* Microseconds */ + DWORD cAxes; /* Number of axes */ + LPDWORD rgdwAxes; /* Array of axes */ + LPLONG rglDirection; /* Array of directions */ + LPDIENVELOPE lpEnvelope; /* Optional */ + DWORD cbTypeSpecificParams; /* Size of params */ + LPVOID lpvTypeSpecificParams; /* Pointer to params */ +#if(DIRECTINPUT_VERSION >= 0x0600) + DWORD dwStartDelay; /* Microseconds */ +#endif /* DIRECTINPUT_VERSION >= 0x0600 */ +} DIEFFECT, *LPDIEFFECT; +typedef DIEFFECT DIEFFECT_DX6; +typedef LPDIEFFECT LPDIEFFECT_DX6; +typedef const DIEFFECT *LPCDIEFFECT; + + +#if(DIRECTINPUT_VERSION >= 0x0700) +#ifndef DIJ_RINGZERO +typedef struct DIFILEEFFECT{ + DWORD dwSize; + GUID GuidEffect; + LPCDIEFFECT lpDiEffect; + CHAR szFriendlyName[MAX_PATH]; +}DIFILEEFFECT, *LPDIFILEEFFECT; +typedef const DIFILEEFFECT *LPCDIFILEEFFECT; +typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID); +#endif /* DIJ_RINGZERO */ +#endif /* DIRECTINPUT_VERSION >= 0x0700 */ + +#define DIEFF_OBJECTIDS 0x00000001 +#define DIEFF_OBJECTOFFSETS 0x00000002 +#define DIEFF_CARTESIAN 0x00000010 +#define DIEFF_POLAR 0x00000020 +#define DIEFF_SPHERICAL 0x00000040 + +#define DIEP_DURATION 0x00000001 +#define DIEP_SAMPLEPERIOD 0x00000002 +#define DIEP_GAIN 0x00000004 +#define DIEP_TRIGGERBUTTON 0x00000008 +#define DIEP_TRIGGERREPEATINTERVAL 0x00000010 +#define DIEP_AXES 0x00000020 +#define DIEP_DIRECTION 0x00000040 +#define DIEP_ENVELOPE 0x00000080 +#define DIEP_TYPESPECIFICPARAMS 0x00000100 +#if(DIRECTINPUT_VERSION >= 0x0600) +#define DIEP_STARTDELAY 0x00000200 +#define DIEP_ALLPARAMS_DX5 0x000001FF +#define DIEP_ALLPARAMS 0x000003FF +#else /* DIRECTINPUT_VERSION < 0x0600 */ +#define DIEP_ALLPARAMS 0x000001FF +#endif /* DIRECTINPUT_VERSION < 0x0600 */ +#define DIEP_START 0x20000000 +#define DIEP_NORESTART 0x40000000 +#define DIEP_NODOWNLOAD 0x80000000 +#define DIEB_NOTRIGGER 0xFFFFFFFF + +#define DIES_SOLO 0x00000001 +#define DIES_NODOWNLOAD 0x80000000 + +#define DIEGES_PLAYING 0x00000001 +#define DIEGES_EMULATED 0x00000002 + +typedef struct DIEFFESCAPE { + DWORD dwSize; + DWORD dwCommand; + LPVOID lpvInBuffer; + DWORD cbInBuffer; + LPVOID lpvOutBuffer; + DWORD cbOutBuffer; +} DIEFFESCAPE, *LPDIEFFESCAPE; + +#ifndef DIJ_RINGZERO + +#undef INTERFACE +#define INTERFACE IDirectInputEffect + +DECLARE_INTERFACE_(IDirectInputEffect, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputEffect methods ***/ + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE; + STDMETHOD(GetParameters)(THIS_ LPDIEFFECT,DWORD) PURE; + STDMETHOD(SetParameters)(THIS_ LPCDIEFFECT,DWORD) PURE; + STDMETHOD(Start)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(Stop)(THIS) PURE; + STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE; + STDMETHOD(Download)(THIS) PURE; + STDMETHOD(Unload)(THIS) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; +}; + +typedef struct IDirectInputEffect *LPDIRECTINPUTEFFECT; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputEffect_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputEffect_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputEffect_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputEffect_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectInputEffect_GetEffectGuid(p,a) (p)->lpVtbl->GetEffectGuid(p,a) +#define IDirectInputEffect_GetParameters(p,a,b) (p)->lpVtbl->GetParameters(p,a,b) +#define IDirectInputEffect_SetParameters(p,a,b) (p)->lpVtbl->SetParameters(p,a,b) +#define IDirectInputEffect_Start(p,a,b) (p)->lpVtbl->Start(p,a,b) +#define IDirectInputEffect_Stop(p) (p)->lpVtbl->Stop(p) +#define IDirectInputEffect_GetEffectStatus(p,a) (p)->lpVtbl->GetEffectStatus(p,a) +#define IDirectInputEffect_Download(p) (p)->lpVtbl->Download(p) +#define IDirectInputEffect_Unload(p) (p)->lpVtbl->Unload(p) +#define IDirectInputEffect_Escape(p,a) (p)->lpVtbl->Escape(p,a) +#else +#define IDirectInputEffect_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputEffect_AddRef(p) (p)->AddRef() +#define IDirectInputEffect_Release(p) (p)->Release() +#define IDirectInputEffect_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectInputEffect_GetEffectGuid(p,a) (p)->GetEffectGuid(a) +#define IDirectInputEffect_GetParameters(p,a,b) (p)->GetParameters(a,b) +#define IDirectInputEffect_SetParameters(p,a,b) (p)->SetParameters(a,b) +#define IDirectInputEffect_Start(p,a,b) (p)->Start(a,b) +#define IDirectInputEffect_Stop(p) (p)->Stop() +#define IDirectInputEffect_GetEffectStatus(p,a) (p)->GetEffectStatus(a) +#define IDirectInputEffect_Download(p) (p)->Download() +#define IDirectInputEffect_Unload(p) (p)->Unload() +#define IDirectInputEffect_Escape(p,a) (p)->Escape(a) +#endif + +#endif /* DIJ_RINGZERO */ + +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +/**************************************************************************** + * + * IDirectInputDevice + * + ****************************************************************************/ + +#if DIRECTINPUT_VERSION <= 0x700 +#define DIDEVTYPE_DEVICE 1 +#define DIDEVTYPE_MOUSE 2 +#define DIDEVTYPE_KEYBOARD 3 +#define DIDEVTYPE_JOYSTICK 4 + +#else +#define DI8DEVCLASS_ALL 0 +#define DI8DEVCLASS_DEVICE 1 +#define DI8DEVCLASS_POINTER 2 +#define DI8DEVCLASS_KEYBOARD 3 +#define DI8DEVCLASS_GAMECTRL 4 + +#define DI8DEVTYPE_DEVICE 0x11 +#define DI8DEVTYPE_MOUSE 0x12 +#define DI8DEVTYPE_KEYBOARD 0x13 +#define DI8DEVTYPE_JOYSTICK 0x14 +#define DI8DEVTYPE_GAMEPAD 0x15 +#define DI8DEVTYPE_DRIVING 0x16 +#define DI8DEVTYPE_FLIGHT 0x17 +#define DI8DEVTYPE_1STPERSON 0x18 +#define DI8DEVTYPE_DEVICECTRL 0x19 +#define DI8DEVTYPE_SCREENPOINTER 0x1A +#define DI8DEVTYPE_REMOTE 0x1B +#define DI8DEVTYPE_SUPPLEMENTAL 0x1C +#endif /* DIRECTINPUT_VERSION <= 0x700 */ + +#define DIDEVTYPE_HID 0x00010000 + +#if DIRECTINPUT_VERSION <= 0x700 +#define DIDEVTYPEMOUSE_UNKNOWN 1 +#define DIDEVTYPEMOUSE_TRADITIONAL 2 +#define DIDEVTYPEMOUSE_FINGERSTICK 3 +#define DIDEVTYPEMOUSE_TOUCHPAD 4 +#define DIDEVTYPEMOUSE_TRACKBALL 5 + +#define DIDEVTYPEKEYBOARD_UNKNOWN 0 +#define DIDEVTYPEKEYBOARD_PCXT 1 +#define DIDEVTYPEKEYBOARD_OLIVETTI 2 +#define DIDEVTYPEKEYBOARD_PCAT 3 +#define DIDEVTYPEKEYBOARD_PCENH 4 +#define DIDEVTYPEKEYBOARD_NOKIA1050 5 +#define DIDEVTYPEKEYBOARD_NOKIA9140 6 +#define DIDEVTYPEKEYBOARD_NEC98 7 +#define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8 +#define DIDEVTYPEKEYBOARD_NEC98106 9 +#define DIDEVTYPEKEYBOARD_JAPAN106 10 +#define DIDEVTYPEKEYBOARD_JAPANAX 11 +#define DIDEVTYPEKEYBOARD_J3100 12 + +#define DIDEVTYPEJOYSTICK_UNKNOWN 1 +#define DIDEVTYPEJOYSTICK_TRADITIONAL 2 +#define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3 +#define DIDEVTYPEJOYSTICK_GAMEPAD 4 +#define DIDEVTYPEJOYSTICK_RUDDER 5 +#define DIDEVTYPEJOYSTICK_WHEEL 6 +#define DIDEVTYPEJOYSTICK_HEADTRACKER 7 + +#else +#define DI8DEVTYPEMOUSE_UNKNOWN 1 +#define DI8DEVTYPEMOUSE_TRADITIONAL 2 +#define DI8DEVTYPEMOUSE_FINGERSTICK 3 +#define DI8DEVTYPEMOUSE_TOUCHPAD 4 +#define DI8DEVTYPEMOUSE_TRACKBALL 5 +#define DI8DEVTYPEMOUSE_ABSOLUTE 6 + +#define DI8DEVTYPEKEYBOARD_UNKNOWN 0 +#define DI8DEVTYPEKEYBOARD_PCXT 1 +#define DI8DEVTYPEKEYBOARD_OLIVETTI 2 +#define DI8DEVTYPEKEYBOARD_PCAT 3 +#define DI8DEVTYPEKEYBOARD_PCENH 4 +#define DI8DEVTYPEKEYBOARD_NOKIA1050 5 +#define DI8DEVTYPEKEYBOARD_NOKIA9140 6 +#define DI8DEVTYPEKEYBOARD_NEC98 7 +#define DI8DEVTYPEKEYBOARD_NEC98LAPTOP 8 +#define DI8DEVTYPEKEYBOARD_NEC98106 9 +#define DI8DEVTYPEKEYBOARD_JAPAN106 10 +#define DI8DEVTYPEKEYBOARD_JAPANAX 11 +#define DI8DEVTYPEKEYBOARD_J3100 12 + +#define DI8DEVTYPE_LIMITEDGAMESUBTYPE 1 + +#define DI8DEVTYPEJOYSTICK_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE +#define DI8DEVTYPEJOYSTICK_STANDARD 2 + +#define DI8DEVTYPEGAMEPAD_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE +#define DI8DEVTYPEGAMEPAD_STANDARD 2 +#define DI8DEVTYPEGAMEPAD_TILT 3 + +#define DI8DEVTYPEDRIVING_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE +#define DI8DEVTYPEDRIVING_COMBINEDPEDALS 2 +#define DI8DEVTYPEDRIVING_DUALPEDALS 3 +#define DI8DEVTYPEDRIVING_THREEPEDALS 4 +#define DI8DEVTYPEDRIVING_HANDHELD 5 + +#define DI8DEVTYPEFLIGHT_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE +#define DI8DEVTYPEFLIGHT_STICK 2 +#define DI8DEVTYPEFLIGHT_YOKE 3 +#define DI8DEVTYPEFLIGHT_RC 4 + +#define DI8DEVTYPE1STPERSON_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE +#define DI8DEVTYPE1STPERSON_UNKNOWN 2 +#define DI8DEVTYPE1STPERSON_SIXDOF 3 +#define DI8DEVTYPE1STPERSON_SHOOTER 4 + +#define DI8DEVTYPESCREENPTR_UNKNOWN 2 +#define DI8DEVTYPESCREENPTR_LIGHTGUN 3 +#define DI8DEVTYPESCREENPTR_LIGHTPEN 4 +#define DI8DEVTYPESCREENPTR_TOUCH 5 + +#define DI8DEVTYPEREMOTE_UNKNOWN 2 + +#define DI8DEVTYPEDEVICECTRL_UNKNOWN 2 +#define DI8DEVTYPEDEVICECTRL_COMMSSELECTION 3 +#define DI8DEVTYPEDEVICECTRL_COMMSSELECTION_HARDWIRED 4 + +#define DI8DEVTYPESUPPLEMENTAL_UNKNOWN 2 +#define DI8DEVTYPESUPPLEMENTAL_2NDHANDCONTROLLER 3 +#define DI8DEVTYPESUPPLEMENTAL_HEADTRACKER 4 +#define DI8DEVTYPESUPPLEMENTAL_HANDTRACKER 5 +#define DI8DEVTYPESUPPLEMENTAL_SHIFTSTICKGATE 6 +#define DI8DEVTYPESUPPLEMENTAL_SHIFTER 7 +#define DI8DEVTYPESUPPLEMENTAL_THROTTLE 8 +#define DI8DEVTYPESUPPLEMENTAL_SPLITTHROTTLE 9 +#define DI8DEVTYPESUPPLEMENTAL_COMBINEDPEDALS 10 +#define DI8DEVTYPESUPPLEMENTAL_DUALPEDALS 11 +#define DI8DEVTYPESUPPLEMENTAL_THREEPEDALS 12 +#define DI8DEVTYPESUPPLEMENTAL_RUDDERPEDALS 13 +#endif /* DIRECTINPUT_VERSION <= 0x700 */ + +#define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType) +#define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType) + +#if(DIRECTINPUT_VERSION >= 0x0500) +/* This structure is defined for DirectX 3.0 compatibility */ +typedef struct DIDEVCAPS_DX3 { + DWORD dwSize; + DWORD dwFlags; + DWORD dwDevType; + DWORD dwAxes; + DWORD dwButtons; + DWORD dwPOVs; +} DIDEVCAPS_DX3, *LPDIDEVCAPS_DX3; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +typedef struct DIDEVCAPS { + DWORD dwSize; + DWORD dwFlags; + DWORD dwDevType; + DWORD dwAxes; + DWORD dwButtons; + DWORD dwPOVs; +#if(DIRECTINPUT_VERSION >= 0x0500) + DWORD dwFFSamplePeriod; + DWORD dwFFMinTimeResolution; + DWORD dwFirmwareRevision; + DWORD dwHardwareRevision; + DWORD dwFFDriverVersion; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +} DIDEVCAPS, *LPDIDEVCAPS; + +#define DIDC_ATTACHED 0x00000001 +#define DIDC_POLLEDDEVICE 0x00000002 +#define DIDC_EMULATED 0x00000004 +#define DIDC_POLLEDDATAFORMAT 0x00000008 +#if(DIRECTINPUT_VERSION >= 0x0500) +#define DIDC_FORCEFEEDBACK 0x00000100 +#define DIDC_FFATTACK 0x00000200 +#define DIDC_FFFADE 0x00000400 +#define DIDC_SATURATION 0x00000800 +#define DIDC_POSNEGCOEFFICIENTS 0x00001000 +#define DIDC_POSNEGSATURATION 0x00002000 +#define DIDC_DEADBAND 0x00004000 +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +#define DIDC_STARTDELAY 0x00008000 +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIDC_ALIAS 0x00010000 +#define DIDC_PHANTOM 0x00020000 +#endif /* DIRECTINPUT_VERSION >= 0x050a */ +#if(DIRECTINPUT_VERSION >= 0x0800) +#define DIDC_HIDDEN 0x00040000 +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#define DIDFT_ALL 0x00000000 + +#define DIDFT_RELAXIS 0x00000001 +#define DIDFT_ABSAXIS 0x00000002 +#define DIDFT_AXIS 0x00000003 + +#define DIDFT_PSHBUTTON 0x00000004 +#define DIDFT_TGLBUTTON 0x00000008 +#define DIDFT_BUTTON 0x0000000C + +#define DIDFT_POV 0x00000010 +#define DIDFT_COLLECTION 0x00000040 +#define DIDFT_NODATA 0x00000080 + +#define DIDFT_ANYINSTANCE 0x00FFFF00 +#define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE +#define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8) +#define DIDFT_GETTYPE(n) LOBYTE(n) +#define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8) +#define DIDFT_FFACTUATOR 0x01000000 +#define DIDFT_FFEFFECTTRIGGER 0x02000000 +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIDFT_OUTPUT 0x10000000 +#define DIDFT_VENDORDEFINED 0x04000000 +#define DIDFT_ALIAS 0x08000000 +#endif /* DIRECTINPUT_VERSION >= 0x050a */ +#ifndef DIDFT_OPTIONAL +#define DIDFT_OPTIONAL 0x80000000 +#endif + +#define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8) +#define DIDFT_NOCOLLECTION 0x00FFFF00 + +#ifndef DIJ_RINGZERO + +typedef struct _DIOBJECTDATAFORMAT { + const GUID *pguid; + DWORD dwOfs; + DWORD dwType; + DWORD dwFlags; +} DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT; +typedef const DIOBJECTDATAFORMAT *LPCDIOBJECTDATAFORMAT; + +typedef struct _DIDATAFORMAT { + DWORD dwSize; + DWORD dwObjSize; + DWORD dwFlags; + DWORD dwDataSize; + DWORD dwNumObjs; + LPDIOBJECTDATAFORMAT rgodf; +} DIDATAFORMAT, *LPDIDATAFORMAT; +typedef const DIDATAFORMAT *LPCDIDATAFORMAT; + +#define DIDF_ABSAXIS 0x00000001 +#define DIDF_RELAXIS 0x00000002 + +#ifdef __cplusplus +extern "C" { +#endif +extern const DIDATAFORMAT c_dfDIMouse; + +#if(DIRECTINPUT_VERSION >= 0x0700) +extern const DIDATAFORMAT c_dfDIMouse2; +#endif /* DIRECTINPUT_VERSION >= 0x0700 */ + +extern const DIDATAFORMAT c_dfDIKeyboard; + +#if(DIRECTINPUT_VERSION >= 0x0500) +extern const DIDATAFORMAT c_dfDIJoystick; +extern const DIDATAFORMAT c_dfDIJoystick2; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +#ifdef __cplusplus +}; +#endif + + +#if DIRECTINPUT_VERSION > 0x0700 + +typedef struct _DIACTIONA { + UINT_PTR uAppData; + DWORD dwSemantic; + OPTIONAL DWORD dwFlags; + OPTIONAL union { + LPCSTR lptszActionName; + UINT uResIdString; + }; + OPTIONAL GUID guidInstance; + OPTIONAL DWORD dwObjID; + OPTIONAL DWORD dwHow; +} DIACTIONA, *LPDIACTIONA ; +typedef struct _DIACTIONW { + UINT_PTR uAppData; + DWORD dwSemantic; + OPTIONAL DWORD dwFlags; + OPTIONAL union { + LPCWSTR lptszActionName; + UINT uResIdString; + }; + OPTIONAL GUID guidInstance; + OPTIONAL DWORD dwObjID; + OPTIONAL DWORD dwHow; +} DIACTIONW, *LPDIACTIONW ; +#ifdef UNICODE +typedef DIACTIONW DIACTION; +typedef LPDIACTIONW LPDIACTION; +#else +typedef DIACTIONA DIACTION; +typedef LPDIACTIONA LPDIACTION; +#endif // UNICODE + +typedef const DIACTIONA *LPCDIACTIONA; +typedef const DIACTIONW *LPCDIACTIONW; +#ifdef UNICODE +typedef DIACTIONW DIACTION; +typedef LPCDIACTIONW LPCDIACTION; +#else +typedef DIACTIONA DIACTION; +typedef LPCDIACTIONA LPCDIACTION; +#endif // UNICODE +typedef const DIACTION *LPCDIACTION; + + +#define DIA_FORCEFEEDBACK 0x00000001 +#define DIA_APPMAPPED 0x00000002 +#define DIA_APPNOMAP 0x00000004 +#define DIA_NORANGE 0x00000008 +#define DIA_APPFIXED 0x00000010 + +#define DIAH_UNMAPPED 0x00000000 +#define DIAH_USERCONFIG 0x00000001 +#define DIAH_APPREQUESTED 0x00000002 +#define DIAH_HWAPP 0x00000004 +#define DIAH_HWDEFAULT 0x00000008 +#define DIAH_DEFAULT 0x00000020 +#define DIAH_ERROR 0x80000000 + +typedef struct _DIACTIONFORMATA { + DWORD dwSize; + DWORD dwActionSize; + DWORD dwDataSize; + DWORD dwNumActions; + LPDIACTIONA rgoAction; + GUID guidActionMap; + DWORD dwGenre; + DWORD dwBufferSize; + OPTIONAL LONG lAxisMin; + OPTIONAL LONG lAxisMax; + OPTIONAL HINSTANCE hInstString; + FILETIME ftTimeStamp; + DWORD dwCRC; + CHAR tszActionMap[MAX_PATH]; +} DIACTIONFORMATA, *LPDIACTIONFORMATA; +typedef struct _DIACTIONFORMATW { + DWORD dwSize; + DWORD dwActionSize; + DWORD dwDataSize; + DWORD dwNumActions; + LPDIACTIONW rgoAction; + GUID guidActionMap; + DWORD dwGenre; + DWORD dwBufferSize; + OPTIONAL LONG lAxisMin; + OPTIONAL LONG lAxisMax; + OPTIONAL HINSTANCE hInstString; + FILETIME ftTimeStamp; + DWORD dwCRC; + WCHAR tszActionMap[MAX_PATH]; +} DIACTIONFORMATW, *LPDIACTIONFORMATW; +#ifdef UNICODE +typedef DIACTIONFORMATW DIACTIONFORMAT; +typedef LPDIACTIONFORMATW LPDIACTIONFORMAT; +#else +typedef DIACTIONFORMATA DIACTIONFORMAT; +typedef LPDIACTIONFORMATA LPDIACTIONFORMAT; +#endif // UNICODE +typedef const DIACTIONFORMATA *LPCDIACTIONFORMATA; +typedef const DIACTIONFORMATW *LPCDIACTIONFORMATW; +#ifdef UNICODE +typedef DIACTIONFORMATW DIACTIONFORMAT; +typedef LPCDIACTIONFORMATW LPCDIACTIONFORMAT; +#else +typedef DIACTIONFORMATA DIACTIONFORMAT; +typedef LPCDIACTIONFORMATA LPCDIACTIONFORMAT; +#endif // UNICODE +typedef const DIACTIONFORMAT *LPCDIACTIONFORMAT; + +#define DIAFTS_NEWDEVICELOW 0xFFFFFFFF +#define DIAFTS_NEWDEVICEHIGH 0xFFFFFFFF +#define DIAFTS_UNUSEDDEVICELOW 0x00000000 +#define DIAFTS_UNUSEDDEVICEHIGH 0x00000000 + +#define DIDBAM_DEFAULT 0x00000000 +#define DIDBAM_PRESERVE 0x00000001 +#define DIDBAM_INITIALIZE 0x00000002 +#define DIDBAM_HWDEFAULTS 0x00000004 + +#define DIDSAM_DEFAULT 0x00000000 +#define DIDSAM_NOUSER 0x00000001 +#define DIDSAM_FORCESAVE 0x00000002 + +#define DICD_DEFAULT 0x00000000 +#define DICD_EDIT 0x00000001 + +/* + * The following definition is normally defined in d3dtypes.h + */ +#ifndef D3DCOLOR_DEFINED +typedef DWORD D3DCOLOR; +#define D3DCOLOR_DEFINED +#endif + +typedef struct _DICOLORSET{ + DWORD dwSize; + D3DCOLOR cTextFore; + D3DCOLOR cTextHighlight; + D3DCOLOR cCalloutLine; + D3DCOLOR cCalloutHighlight; + D3DCOLOR cBorder; + D3DCOLOR cControlFill; + D3DCOLOR cHighlightFill; + D3DCOLOR cAreaFill; +} DICOLORSET, *LPDICOLORSET; +typedef const DICOLORSET *LPCDICOLORSET; + + +typedef struct _DICONFIGUREDEVICESPARAMSA{ + DWORD dwSize; + DWORD dwcUsers; + LPSTR lptszUserNames; + DWORD dwcFormats; + LPDIACTIONFORMATA lprgFormats; + HWND hwnd; + DICOLORSET dics; + IUnknown FAR * lpUnkDDSTarget; +} DICONFIGUREDEVICESPARAMSA, *LPDICONFIGUREDEVICESPARAMSA; +typedef struct _DICONFIGUREDEVICESPARAMSW{ + DWORD dwSize; + DWORD dwcUsers; + LPWSTR lptszUserNames; + DWORD dwcFormats; + LPDIACTIONFORMATW lprgFormats; + HWND hwnd; + DICOLORSET dics; + IUnknown FAR * lpUnkDDSTarget; +} DICONFIGUREDEVICESPARAMSW, *LPDICONFIGUREDEVICESPARAMSW; +#ifdef UNICODE +typedef DICONFIGUREDEVICESPARAMSW DICONFIGUREDEVICESPARAMS; +typedef LPDICONFIGUREDEVICESPARAMSW LPDICONFIGUREDEVICESPARAMS; +#else +typedef DICONFIGUREDEVICESPARAMSA DICONFIGUREDEVICESPARAMS; +typedef LPDICONFIGUREDEVICESPARAMSA LPDICONFIGUREDEVICESPARAMS; +#endif // UNICODE +typedef const DICONFIGUREDEVICESPARAMSA *LPCDICONFIGUREDEVICESPARAMSA; +typedef const DICONFIGUREDEVICESPARAMSW *LPCDICONFIGUREDEVICESPARAMSW; +#ifdef UNICODE +typedef DICONFIGUREDEVICESPARAMSW DICONFIGUREDEVICESPARAMS; +typedef LPCDICONFIGUREDEVICESPARAMSW LPCDICONFIGUREDEVICESPARAMS; +#else +typedef DICONFIGUREDEVICESPARAMSA DICONFIGUREDEVICESPARAMS; +typedef LPCDICONFIGUREDEVICESPARAMSA LPCDICONFIGUREDEVICESPARAMS; +#endif // UNICODE +typedef const DICONFIGUREDEVICESPARAMS *LPCDICONFIGUREDEVICESPARAMS; + + +#define DIDIFT_CONFIGURATION 0x00000001 +#define DIDIFT_OVERLAY 0x00000002 + +#define DIDAL_CENTERED 0x00000000 +#define DIDAL_LEFTALIGNED 0x00000001 +#define DIDAL_RIGHTALIGNED 0x00000002 +#define DIDAL_MIDDLE 0x00000000 +#define DIDAL_TOPALIGNED 0x00000004 +#define DIDAL_BOTTOMALIGNED 0x00000008 + +typedef struct _DIDEVICEIMAGEINFOA { + CHAR tszImagePath[MAX_PATH]; + DWORD dwFlags; + // These are valid if DIDIFT_OVERLAY is present in dwFlags. + DWORD dwViewID; + RECT rcOverlay; + DWORD dwObjID; + DWORD dwcValidPts; + POINT rgptCalloutLine[5]; + RECT rcCalloutRect; + DWORD dwTextAlign; +} DIDEVICEIMAGEINFOA, *LPDIDEVICEIMAGEINFOA; +typedef struct _DIDEVICEIMAGEINFOW { + WCHAR tszImagePath[MAX_PATH]; + DWORD dwFlags; + // These are valid if DIDIFT_OVERLAY is present in dwFlags. + DWORD dwViewID; + RECT rcOverlay; + DWORD dwObjID; + DWORD dwcValidPts; + POINT rgptCalloutLine[5]; + RECT rcCalloutRect; + DWORD dwTextAlign; +} DIDEVICEIMAGEINFOW, *LPDIDEVICEIMAGEINFOW; +#ifdef UNICODE +typedef DIDEVICEIMAGEINFOW DIDEVICEIMAGEINFO; +typedef LPDIDEVICEIMAGEINFOW LPDIDEVICEIMAGEINFO; +#else +typedef DIDEVICEIMAGEINFOA DIDEVICEIMAGEINFO; +typedef LPDIDEVICEIMAGEINFOA LPDIDEVICEIMAGEINFO; +#endif // UNICODE +typedef const DIDEVICEIMAGEINFOA *LPCDIDEVICEIMAGEINFOA; +typedef const DIDEVICEIMAGEINFOW *LPCDIDEVICEIMAGEINFOW; +#ifdef UNICODE +typedef DIDEVICEIMAGEINFOW DIDEVICEIMAGEINFO; +typedef LPCDIDEVICEIMAGEINFOW LPCDIDEVICEIMAGEINFO; +#else +typedef DIDEVICEIMAGEINFOA DIDEVICEIMAGEINFO; +typedef LPCDIDEVICEIMAGEINFOA LPCDIDEVICEIMAGEINFO; +#endif // UNICODE +typedef const DIDEVICEIMAGEINFO *LPCDIDEVICEIMAGEINFO; + +typedef struct _DIDEVICEIMAGEINFOHEADERA { + DWORD dwSize; + DWORD dwSizeImageInfo; + DWORD dwcViews; + DWORD dwcButtons; + DWORD dwcAxes; + DWORD dwcPOVs; + DWORD dwBufferSize; + DWORD dwBufferUsed; + LPDIDEVICEIMAGEINFOA lprgImageInfoArray; +} DIDEVICEIMAGEINFOHEADERA, *LPDIDEVICEIMAGEINFOHEADERA; +typedef struct _DIDEVICEIMAGEINFOHEADERW { + DWORD dwSize; + DWORD dwSizeImageInfo; + DWORD dwcViews; + DWORD dwcButtons; + DWORD dwcAxes; + DWORD dwcPOVs; + DWORD dwBufferSize; + DWORD dwBufferUsed; + LPDIDEVICEIMAGEINFOW lprgImageInfoArray; +} DIDEVICEIMAGEINFOHEADERW, *LPDIDEVICEIMAGEINFOHEADERW; +#ifdef UNICODE +typedef DIDEVICEIMAGEINFOHEADERW DIDEVICEIMAGEINFOHEADER; +typedef LPDIDEVICEIMAGEINFOHEADERW LPDIDEVICEIMAGEINFOHEADER; +#else +typedef DIDEVICEIMAGEINFOHEADERA DIDEVICEIMAGEINFOHEADER; +typedef LPDIDEVICEIMAGEINFOHEADERA LPDIDEVICEIMAGEINFOHEADER; +#endif // UNICODE +typedef const DIDEVICEIMAGEINFOHEADERA *LPCDIDEVICEIMAGEINFOHEADERA; +typedef const DIDEVICEIMAGEINFOHEADERW *LPCDIDEVICEIMAGEINFOHEADERW; +#ifdef UNICODE +typedef DIDEVICEIMAGEINFOHEADERW DIDEVICEIMAGEINFOHEADER; +typedef LPCDIDEVICEIMAGEINFOHEADERW LPCDIDEVICEIMAGEINFOHEADER; +#else +typedef DIDEVICEIMAGEINFOHEADERA DIDEVICEIMAGEINFOHEADER; +typedef LPCDIDEVICEIMAGEINFOHEADERA LPCDIDEVICEIMAGEINFOHEADER; +#endif // UNICODE +typedef const DIDEVICEIMAGEINFOHEADER *LPCDIDEVICEIMAGEINFOHEADER; + +#endif /* DIRECTINPUT_VERSION > 0x0700 */ + +#if(DIRECTINPUT_VERSION >= 0x0500) +/* These structures are defined for DirectX 3.0 compatibility */ + +typedef struct DIDEVICEOBJECTINSTANCE_DX3A { + DWORD dwSize; + GUID guidType; + DWORD dwOfs; + DWORD dwType; + DWORD dwFlags; + CHAR tszName[MAX_PATH]; +} DIDEVICEOBJECTINSTANCE_DX3A, *LPDIDEVICEOBJECTINSTANCE_DX3A; +typedef struct DIDEVICEOBJECTINSTANCE_DX3W { + DWORD dwSize; + GUID guidType; + DWORD dwOfs; + DWORD dwType; + DWORD dwFlags; + WCHAR tszName[MAX_PATH]; +} DIDEVICEOBJECTINSTANCE_DX3W, *LPDIDEVICEOBJECTINSTANCE_DX3W; +#ifdef UNICODE +typedef DIDEVICEOBJECTINSTANCE_DX3W DIDEVICEOBJECTINSTANCE_DX3; +typedef LPDIDEVICEOBJECTINSTANCE_DX3W LPDIDEVICEOBJECTINSTANCE_DX3; +#else +typedef DIDEVICEOBJECTINSTANCE_DX3A DIDEVICEOBJECTINSTANCE_DX3; +typedef LPDIDEVICEOBJECTINSTANCE_DX3A LPDIDEVICEOBJECTINSTANCE_DX3; +#endif // UNICODE +typedef const DIDEVICEOBJECTINSTANCE_DX3A *LPCDIDEVICEOBJECTINSTANCE_DX3A; +typedef const DIDEVICEOBJECTINSTANCE_DX3W *LPCDIDEVICEOBJECTINSTANCE_DX3W; +typedef const DIDEVICEOBJECTINSTANCE_DX3 *LPCDIDEVICEOBJECTINSTANCE_DX3; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +typedef struct DIDEVICEOBJECTINSTANCEA { + DWORD dwSize; + GUID guidType; + DWORD dwOfs; + DWORD dwType; + DWORD dwFlags; + CHAR tszName[MAX_PATH]; +#if(DIRECTINPUT_VERSION >= 0x0500) + DWORD dwFFMaxForce; + DWORD dwFFForceResolution; + WORD wCollectionNumber; + WORD wDesignatorIndex; + WORD wUsagePage; + WORD wUsage; + DWORD dwDimension; + WORD wExponent; + WORD wReportId; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +} DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA; +typedef struct DIDEVICEOBJECTINSTANCEW { + DWORD dwSize; + GUID guidType; + DWORD dwOfs; + DWORD dwType; + DWORD dwFlags; + WCHAR tszName[MAX_PATH]; +#if(DIRECTINPUT_VERSION >= 0x0500) + DWORD dwFFMaxForce; + DWORD dwFFForceResolution; + WORD wCollectionNumber; + WORD wDesignatorIndex; + WORD wUsagePage; + WORD wUsage; + DWORD dwDimension; + WORD wExponent; + WORD wReportId; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +} DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW; +#ifdef UNICODE +typedef DIDEVICEOBJECTINSTANCEW DIDEVICEOBJECTINSTANCE; +typedef LPDIDEVICEOBJECTINSTANCEW LPDIDEVICEOBJECTINSTANCE; +#else +typedef DIDEVICEOBJECTINSTANCEA DIDEVICEOBJECTINSTANCE; +typedef LPDIDEVICEOBJECTINSTANCEA LPDIDEVICEOBJECTINSTANCE; +#endif // UNICODE +typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA; +typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW; +typedef const DIDEVICEOBJECTINSTANCE *LPCDIDEVICEOBJECTINSTANCE; + +typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA, LPVOID); +typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW, LPVOID); +#ifdef UNICODE +#define LPDIENUMDEVICEOBJECTSCALLBACK LPDIENUMDEVICEOBJECTSCALLBACKW +#else +#define LPDIENUMDEVICEOBJECTSCALLBACK LPDIENUMDEVICEOBJECTSCALLBACKA +#endif // !UNICODE + +#if(DIRECTINPUT_VERSION >= 0x0500) +#define DIDOI_FFACTUATOR 0x00000001 +#define DIDOI_FFEFFECTTRIGGER 0x00000002 +#define DIDOI_POLLED 0x00008000 +#define DIDOI_ASPECTPOSITION 0x00000100 +#define DIDOI_ASPECTVELOCITY 0x00000200 +#define DIDOI_ASPECTACCEL 0x00000300 +#define DIDOI_ASPECTFORCE 0x00000400 +#define DIDOI_ASPECTMASK 0x00000F00 +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIDOI_GUIDISUSAGE 0x00010000 +#endif /* DIRECTINPUT_VERSION >= 0x050a */ + +typedef struct DIPROPHEADER { + DWORD dwSize; + DWORD dwHeaderSize; + DWORD dwObj; + DWORD dwHow; +} DIPROPHEADER, *LPDIPROPHEADER; +typedef const DIPROPHEADER *LPCDIPROPHEADER; + +#define DIPH_DEVICE 0 +#define DIPH_BYOFFSET 1 +#define DIPH_BYID 2 +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIPH_BYUSAGE 3 +#endif /* DIRECTINPUT_VERSION >= 0x050a */ + +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIMAKEUSAGEDWORD(UsagePage, Usage) \ + (DWORD)MAKELONG(Usage, UsagePage) +#endif /* DIRECTINPUT_VERSION >= 0x050a */ + +typedef struct DIPROPDWORD { + DIPROPHEADER diph; + DWORD dwData; +} DIPROPDWORD, *LPDIPROPDWORD; +typedef const DIPROPDWORD *LPCDIPROPDWORD; + +#if(DIRECTINPUT_VERSION >= 0x0800) +typedef struct DIPROPPOINTER { + DIPROPHEADER diph; + UINT_PTR uData; +} DIPROPPOINTER, *LPDIPROPPOINTER; +typedef const DIPROPPOINTER *LPCDIPROPPOINTER; +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +typedef struct DIPROPRANGE { + DIPROPHEADER diph; + LONG lMin; + LONG lMax; +} DIPROPRANGE, *LPDIPROPRANGE; +typedef const DIPROPRANGE *LPCDIPROPRANGE; + +#define DIPROPRANGE_NOMIN ((LONG)0x80000000) +#define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF) + +#if(DIRECTINPUT_VERSION >= 0x050a) +typedef struct DIPROPCAL { + DIPROPHEADER diph; + LONG lMin; + LONG lCenter; + LONG lMax; +} DIPROPCAL, *LPDIPROPCAL; +typedef const DIPROPCAL *LPCDIPROPCAL; + +typedef struct DIPROPCALPOV { + DIPROPHEADER diph; + LONG lMin[5]; + LONG lMax[5]; +} DIPROPCALPOV, *LPDIPROPCALPOV; +typedef const DIPROPCALPOV *LPCDIPROPCALPOV; + +typedef struct DIPROPGUIDANDPATH { + DIPROPHEADER diph; + GUID guidClass; + WCHAR wszPath[MAX_PATH]; +} DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH; +typedef const DIPROPGUIDANDPATH *LPCDIPROPGUIDANDPATH; + +typedef struct DIPROPSTRING { + DIPROPHEADER diph; + WCHAR wsz[MAX_PATH]; +} DIPROPSTRING, *LPDIPROPSTRING; +typedef const DIPROPSTRING *LPCDIPROPSTRING; + +#endif /* DIRECTINPUT_VERSION >= 0x050a */ + +#if(DIRECTINPUT_VERSION >= 0x0800) +#define MAXCPOINTSNUM 8 + +typedef struct _CPOINT +{ + LONG lP; // raw value + DWORD dwLog; // logical_value / max_logical_value * 10000 +} CPOINT, *PCPOINT; + +typedef struct DIPROPCPOINTS { + DIPROPHEADER diph; + DWORD dwCPointsNum; + CPOINT cp[MAXCPOINTSNUM]; +} DIPROPCPOINTS, *LPDIPROPCPOINTS; +typedef const DIPROPCPOINTS *LPCDIPROPCPOINTS; +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + + +#ifdef __cplusplus +#define MAKEDIPROP(prop) (*(const GUID *)(prop)) +#else +#define MAKEDIPROP(prop) ((REFGUID)(prop)) +#endif + +#define DIPROP_BUFFERSIZE MAKEDIPROP(1) + +#define DIPROP_AXISMODE MAKEDIPROP(2) + +#define DIPROPAXISMODE_ABS 0 +#define DIPROPAXISMODE_REL 1 + +#define DIPROP_GRANULARITY MAKEDIPROP(3) + +#define DIPROP_RANGE MAKEDIPROP(4) + +#define DIPROP_DEADZONE MAKEDIPROP(5) + +#define DIPROP_SATURATION MAKEDIPROP(6) + +#define DIPROP_FFGAIN MAKEDIPROP(7) + +#define DIPROP_FFLOAD MAKEDIPROP(8) + +#define DIPROP_AUTOCENTER MAKEDIPROP(9) + +#define DIPROPAUTOCENTER_OFF 0 +#define DIPROPAUTOCENTER_ON 1 + +#define DIPROP_CALIBRATIONMODE MAKEDIPROP(10) + +#define DIPROPCALIBRATIONMODE_COOKED 0 +#define DIPROPCALIBRATIONMODE_RAW 1 + +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIPROP_CALIBRATION MAKEDIPROP(11) + +#define DIPROP_GUIDANDPATH MAKEDIPROP(12) + +#define DIPROP_INSTANCENAME MAKEDIPROP(13) + +#define DIPROP_PRODUCTNAME MAKEDIPROP(14) +#endif /* DIRECTINPUT_VERSION >= 0x050a */ + +#if(DIRECTINPUT_VERSION >= 0x05b2) +#define DIPROP_JOYSTICKID MAKEDIPROP(15) + +#define DIPROP_GETPORTDISPLAYNAME MAKEDIPROP(16) + +#endif /* DIRECTINPUT_VERSION >= 0x05b2 */ + +#if(DIRECTINPUT_VERSION >= 0x0700) +#define DIPROP_PHYSICALRANGE MAKEDIPROP(18) + +#define DIPROP_LOGICALRANGE MAKEDIPROP(19) +#endif /* DIRECTINPUT_VERSION >= 0x0700 */ + +#if(DIRECTINPUT_VERSION >= 0x0800) +#define DIPROP_KEYNAME MAKEDIPROP(20) + +#define DIPROP_CPOINTS MAKEDIPROP(21) + +#define DIPROP_APPDATA MAKEDIPROP(22) + +#define DIPROP_SCANCODE MAKEDIPROP(23) + +#define DIPROP_VIDPID MAKEDIPROP(24) + +#define DIPROP_USERNAME MAKEDIPROP(25) + +#define DIPROP_TYPENAME MAKEDIPROP(26) +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + + +typedef struct DIDEVICEOBJECTDATA_DX3 { + DWORD dwOfs; + DWORD dwData; + DWORD dwTimeStamp; + DWORD dwSequence; +} DIDEVICEOBJECTDATA_DX3, *LPDIDEVICEOBJECTDATA_DX3; +typedef const DIDEVICEOBJECTDATA_DX3 *LPCDIDEVICEOBJECTDATA_DX; + +typedef struct DIDEVICEOBJECTDATA { + DWORD dwOfs; + DWORD dwData; + DWORD dwTimeStamp; + DWORD dwSequence; +#if(DIRECTINPUT_VERSION >= 0x0800) + UINT_PTR uAppData; +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ +} DIDEVICEOBJECTDATA, *LPDIDEVICEOBJECTDATA; +typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA; + +#define DIGDD_PEEK 0x00000001 + +#define DISEQUENCE_COMPARE(dwSequence1, cmp, dwSequence2) \ + ((int)((dwSequence1) - (dwSequence2)) cmp 0) +#define DISCL_EXCLUSIVE 0x00000001 +#define DISCL_NONEXCLUSIVE 0x00000002 +#define DISCL_FOREGROUND 0x00000004 +#define DISCL_BACKGROUND 0x00000008 +#define DISCL_NOWINKEY 0x00000010 + +#if(DIRECTINPUT_VERSION >= 0x0500) +/* These structures are defined for DirectX 3.0 compatibility */ + +typedef struct DIDEVICEINSTANCE_DX3A { + DWORD dwSize; + GUID guidInstance; + GUID guidProduct; + DWORD dwDevType; + CHAR tszInstanceName[MAX_PATH]; + CHAR tszProductName[MAX_PATH]; +} DIDEVICEINSTANCE_DX3A, *LPDIDEVICEINSTANCE_DX3A; +typedef struct DIDEVICEINSTANCE_DX3W { + DWORD dwSize; + GUID guidInstance; + GUID guidProduct; + DWORD dwDevType; + WCHAR tszInstanceName[MAX_PATH]; + WCHAR tszProductName[MAX_PATH]; +} DIDEVICEINSTANCE_DX3W, *LPDIDEVICEINSTANCE_DX3W; +#ifdef UNICODE +typedef DIDEVICEINSTANCE_DX3W DIDEVICEINSTANCE_DX3; +typedef LPDIDEVICEINSTANCE_DX3W LPDIDEVICEINSTANCE_DX3; +#else +typedef DIDEVICEINSTANCE_DX3A DIDEVICEINSTANCE_DX3; +typedef LPDIDEVICEINSTANCE_DX3A LPDIDEVICEINSTANCE_DX3; +#endif // UNICODE +typedef const DIDEVICEINSTANCE_DX3A *LPCDIDEVICEINSTANCE_DX3A; +typedef const DIDEVICEINSTANCE_DX3W *LPCDIDEVICEINSTANCE_DX3W; +typedef const DIDEVICEINSTANCE_DX3 *LPCDIDEVICEINSTANCE_DX3; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +typedef struct DIDEVICEINSTANCEA { + DWORD dwSize; + GUID guidInstance; + GUID guidProduct; + DWORD dwDevType; + CHAR tszInstanceName[MAX_PATH]; + CHAR tszProductName[MAX_PATH]; +#if(DIRECTINPUT_VERSION >= 0x0500) + GUID guidFFDriver; + WORD wUsagePage; + WORD wUsage; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +} DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA; +typedef struct DIDEVICEINSTANCEW { + DWORD dwSize; + GUID guidInstance; + GUID guidProduct; + DWORD dwDevType; + WCHAR tszInstanceName[MAX_PATH]; + WCHAR tszProductName[MAX_PATH]; +#if(DIRECTINPUT_VERSION >= 0x0500) + GUID guidFFDriver; + WORD wUsagePage; + WORD wUsage; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +} DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW; +#ifdef UNICODE +typedef DIDEVICEINSTANCEW DIDEVICEINSTANCE; +typedef LPDIDEVICEINSTANCEW LPDIDEVICEINSTANCE; +#else +typedef DIDEVICEINSTANCEA DIDEVICEINSTANCE; +typedef LPDIDEVICEINSTANCEA LPDIDEVICEINSTANCE; +#endif // UNICODE + +typedef const DIDEVICEINSTANCEA *LPCDIDEVICEINSTANCEA; +typedef const DIDEVICEINSTANCEW *LPCDIDEVICEINSTANCEW; +#ifdef UNICODE +typedef DIDEVICEINSTANCEW DIDEVICEINSTANCE; +typedef LPCDIDEVICEINSTANCEW LPCDIDEVICEINSTANCE; +#else +typedef DIDEVICEINSTANCEA DIDEVICEINSTANCE; +typedef LPCDIDEVICEINSTANCEA LPCDIDEVICEINSTANCE; +#endif // UNICODE +typedef const DIDEVICEINSTANCE *LPCDIDEVICEINSTANCE; + +#undef INTERFACE +#define INTERFACE IDirectInputDeviceW + +DECLARE_INTERFACE_(IDirectInputDeviceW, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDeviceW methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; +}; + +typedef struct IDirectInputDeviceW *LPDIRECTINPUTDEVICEW; + +#undef INTERFACE +#define INTERFACE IDirectInputDeviceA + +DECLARE_INTERFACE_(IDirectInputDeviceA, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDeviceA methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; +}; + +typedef struct IDirectInputDeviceA *LPDIRECTINPUTDEVICEA; + +#ifdef UNICODE +#define IID_IDirectInputDevice IID_IDirectInputDeviceW +#define IDirectInputDevice IDirectInputDeviceW +#define IDirectInputDeviceVtbl IDirectInputDeviceWVtbl +#else +#define IID_IDirectInputDevice IID_IDirectInputDeviceA +#define IDirectInputDevice IDirectInputDeviceA +#define IDirectInputDeviceVtbl IDirectInputDeviceAVtbl +#endif +typedef struct IDirectInputDevice *LPDIRECTINPUTDEVICE; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputDevice_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputDevice_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) +#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) +#define IDirectInputDevice_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) +#define IDirectInputDevice_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) +#define IDirectInputDevice_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputDevice_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) +#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) +#define IDirectInputDevice_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) +#define IDirectInputDevice_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) +#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) +#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) +#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInputDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#else +#define IDirectInputDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputDevice_AddRef(p) (p)->AddRef() +#define IDirectInputDevice_Release(p) (p)->Release() +#define IDirectInputDevice_GetCapabilities(p,a) (p)->GetCapabilities(a) +#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) +#define IDirectInputDevice_GetProperty(p,a,b) (p)->GetProperty(a,b) +#define IDirectInputDevice_SetProperty(p,a,b) (p)->SetProperty(a,b) +#define IDirectInputDevice_Acquire(p) (p)->Acquire() +#define IDirectInputDevice_Unacquire(p) (p)->Unacquire() +#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) +#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) +#define IDirectInputDevice_SetDataFormat(p,a) (p)->SetDataFormat(a) +#define IDirectInputDevice_SetEventNotification(p,a) (p)->SetEventNotification(a) +#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) +#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) +#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInputDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#endif + +#endif /* DIJ_RINGZERO */ + + +#if(DIRECTINPUT_VERSION >= 0x0500) + +#define DISFFC_RESET 0x00000001 +#define DISFFC_STOPALL 0x00000002 +#define DISFFC_PAUSE 0x00000004 +#define DISFFC_CONTINUE 0x00000008 +#define DISFFC_SETACTUATORSON 0x00000010 +#define DISFFC_SETACTUATORSOFF 0x00000020 + +#define DIGFFS_EMPTY 0x00000001 +#define DIGFFS_STOPPED 0x00000002 +#define DIGFFS_PAUSED 0x00000004 +#define DIGFFS_ACTUATORSON 0x00000010 +#define DIGFFS_ACTUATORSOFF 0x00000020 +#define DIGFFS_POWERON 0x00000040 +#define DIGFFS_POWEROFF 0x00000080 +#define DIGFFS_SAFETYSWITCHON 0x00000100 +#define DIGFFS_SAFETYSWITCHOFF 0x00000200 +#define DIGFFS_USERFFSWITCHON 0x00000400 +#define DIGFFS_USERFFSWITCHOFF 0x00000800 +#define DIGFFS_DEVICELOST 0x80000000 + +#ifndef DIJ_RINGZERO + +typedef struct DIEFFECTINFOA { + DWORD dwSize; + GUID guid; + DWORD dwEffType; + DWORD dwStaticParams; + DWORD dwDynamicParams; + CHAR tszName[MAX_PATH]; +} DIEFFECTINFOA, *LPDIEFFECTINFOA; +typedef struct DIEFFECTINFOW { + DWORD dwSize; + GUID guid; + DWORD dwEffType; + DWORD dwStaticParams; + DWORD dwDynamicParams; + WCHAR tszName[MAX_PATH]; +} DIEFFECTINFOW, *LPDIEFFECTINFOW; +#ifdef UNICODE +typedef DIEFFECTINFOW DIEFFECTINFO; +typedef LPDIEFFECTINFOW LPDIEFFECTINFO; +#else +typedef DIEFFECTINFOA DIEFFECTINFO; +typedef LPDIEFFECTINFOA LPDIEFFECTINFO; +#endif // UNICODE +typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA; +typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW; +typedef const DIEFFECTINFO *LPCDIEFFECTINFO; + +#define DISDD_CONTINUE 0x00000001 + +typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID); +typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID); +#ifdef UNICODE +#define LPDIENUMEFFECTSCALLBACK LPDIENUMEFFECTSCALLBACKW +#else +#define LPDIENUMEFFECTSCALLBACK LPDIENUMEFFECTSCALLBACKA +#endif // !UNICODE +typedef BOOL (FAR PASCAL * LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID); + +#undef INTERFACE +#define INTERFACE IDirectInputDevice2W + +DECLARE_INTERFACE_(IDirectInputDevice2W, IDirectInputDeviceW) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDeviceW methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + + /*** IDirectInputDevice2W methods ***/ + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; +}; + +typedef struct IDirectInputDevice2W *LPDIRECTINPUTDEVICE2W; + +#undef INTERFACE +#define INTERFACE IDirectInputDevice2A + +DECLARE_INTERFACE_(IDirectInputDevice2A, IDirectInputDeviceA) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDeviceA methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + + /*** IDirectInputDevice2A methods ***/ + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; +}; + +typedef struct IDirectInputDevice2A *LPDIRECTINPUTDEVICE2A; + +#ifdef UNICODE +#define IID_IDirectInputDevice2 IID_IDirectInputDevice2W +#define IDirectInputDevice2 IDirectInputDevice2W +#define IDirectInputDevice2Vtbl IDirectInputDevice2WVtbl +#else +#define IID_IDirectInputDevice2 IID_IDirectInputDevice2A +#define IDirectInputDevice2 IDirectInputDevice2A +#define IDirectInputDevice2Vtbl IDirectInputDevice2AVtbl +#endif +typedef struct IDirectInputDevice2 *LPDIRECTINPUTDEVICE2; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputDevice2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputDevice2_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputDevice2_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) +#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) +#define IDirectInputDevice2_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) +#define IDirectInputDevice2_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) +#define IDirectInputDevice2_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputDevice2_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) +#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) +#define IDirectInputDevice2_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) +#define IDirectInputDevice2_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) +#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) +#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) +#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) +#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) +#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) +#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) +#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) +#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) +#define IDirectInputDevice2_Escape(p,a) (p)->lpVtbl->Escape(p,a) +#define IDirectInputDevice2_Poll(p) (p)->lpVtbl->Poll(p) +#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) +#else +#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputDevice2_AddRef(p) (p)->AddRef() +#define IDirectInputDevice2_Release(p) (p)->Release() +#define IDirectInputDevice2_GetCapabilities(p,a) (p)->GetCapabilities(a) +#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) +#define IDirectInputDevice2_GetProperty(p,a,b) (p)->GetProperty(a,b) +#define IDirectInputDevice2_SetProperty(p,a,b) (p)->SetProperty(a,b) +#define IDirectInputDevice2_Acquire(p) (p)->Acquire() +#define IDirectInputDevice2_Unacquire(p) (p)->Unacquire() +#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) +#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) +#define IDirectInputDevice2_SetDataFormat(p,a) (p)->SetDataFormat(a) +#define IDirectInputDevice2_SetEventNotification(p,a) (p)->SetEventNotification(a) +#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) +#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) +#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) +#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) +#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) +#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) +#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) +#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) +#define IDirectInputDevice2_Escape(p,a) (p)->Escape(a) +#define IDirectInputDevice2_Poll(p) (p)->Poll() +#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) +#endif + +#endif /* DIJ_RINGZERO */ + +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +#if(DIRECTINPUT_VERSION >= 0x0700) +#define DIFEF_DEFAULT 0x00000000 +#define DIFEF_INCLUDENONSTANDARD 0x00000001 +#define DIFEF_MODIFYIFNEEDED 0x00000010 + +#ifndef DIJ_RINGZERO + +#undef INTERFACE +#define INTERFACE IDirectInputDevice7W + +DECLARE_INTERFACE_(IDirectInputDevice7W, IDirectInputDevice2W) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDevice2W methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + + /*** IDirectInputDevice7W methods ***/ + STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE; +}; + +typedef struct IDirectInputDevice7W *LPDIRECTINPUTDEVICE7W; + +#undef INTERFACE +#define INTERFACE IDirectInputDevice7A + +DECLARE_INTERFACE_(IDirectInputDevice7A, IDirectInputDevice2A) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDevice2A methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + + /*** IDirectInputDevice7A methods ***/ + STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE; +}; + +typedef struct IDirectInputDevice7A *LPDIRECTINPUTDEVICE7A; + +#ifdef UNICODE +#define IID_IDirectInputDevice7 IID_IDirectInputDevice7W +#define IDirectInputDevice7 IDirectInputDevice7W +#define IDirectInputDevice7Vtbl IDirectInputDevice7WVtbl +#else +#define IID_IDirectInputDevice7 IID_IDirectInputDevice7A +#define IDirectInputDevice7 IDirectInputDevice7A +#define IDirectInputDevice7Vtbl IDirectInputDevice7AVtbl +#endif +typedef struct IDirectInputDevice7 *LPDIRECTINPUTDEVICE7; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputDevice7_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputDevice7_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputDevice7_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) +#define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) +#define IDirectInputDevice7_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) +#define IDirectInputDevice7_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) +#define IDirectInputDevice7_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputDevice7_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) +#define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) +#define IDirectInputDevice7_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) +#define IDirectInputDevice7_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) +#define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) +#define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) +#define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInputDevice7_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) +#define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) +#define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) +#define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) +#define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) +#define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) +#define IDirectInputDevice7_Escape(p,a) (p)->lpVtbl->Escape(p,a) +#define IDirectInputDevice7_Poll(p) (p)->lpVtbl->Poll(p) +#define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) +#define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d) +#define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d) +#else +#define IDirectInputDevice7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputDevice7_AddRef(p) (p)->AddRef() +#define IDirectInputDevice7_Release(p) (p)->Release() +#define IDirectInputDevice7_GetCapabilities(p,a) (p)->GetCapabilities(a) +#define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) +#define IDirectInputDevice7_GetProperty(p,a,b) (p)->GetProperty(a,b) +#define IDirectInputDevice7_SetProperty(p,a,b) (p)->SetProperty(a,b) +#define IDirectInputDevice7_Acquire(p) (p)->Acquire() +#define IDirectInputDevice7_Unacquire(p) (p)->Unacquire() +#define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) +#define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) +#define IDirectInputDevice7_SetDataFormat(p,a) (p)->SetDataFormat(a) +#define IDirectInputDevice7_SetEventNotification(p,a) (p)->SetEventNotification(a) +#define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) +#define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) +#define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInputDevice7_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) +#define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) +#define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) +#define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) +#define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) +#define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) +#define IDirectInputDevice7_Escape(p,a) (p)->Escape(a) +#define IDirectInputDevice7_Poll(p) (p)->Poll() +#define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) +#define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d) +#define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d) +#endif + +#endif /* DIJ_RINGZERO */ + +#endif /* DIRECTINPUT_VERSION >= 0x0700 */ + +#if(DIRECTINPUT_VERSION >= 0x0800) + +#ifndef DIJ_RINGZERO + +#undef INTERFACE +#define INTERFACE IDirectInputDevice8W + +DECLARE_INTERFACE_(IDirectInputDevice8W, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDevice8W methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE; + STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATW,LPCWSTR,DWORD) PURE; + STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATW,LPCWSTR,DWORD) PURE; + STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERW) PURE; +}; + +typedef struct IDirectInputDevice8W *LPDIRECTINPUTDEVICE8W; + +#undef INTERFACE +#define INTERFACE IDirectInputDevice8A + +DECLARE_INTERFACE_(IDirectInputDevice8A, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDevice8A methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE; + STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATA,LPCSTR,DWORD) PURE; + STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATA,LPCSTR,DWORD) PURE; + STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERA) PURE; +}; + +typedef struct IDirectInputDevice8A *LPDIRECTINPUTDEVICE8A; + +#ifdef UNICODE +#define IID_IDirectInputDevice8 IID_IDirectInputDevice8W +#define IDirectInputDevice8 IDirectInputDevice8W +#define IDirectInputDevice8Vtbl IDirectInputDevice8WVtbl +#else +#define IID_IDirectInputDevice8 IID_IDirectInputDevice8A +#define IDirectInputDevice8 IDirectInputDevice8A +#define IDirectInputDevice8Vtbl IDirectInputDevice8AVtbl +#endif +typedef struct IDirectInputDevice8 *LPDIRECTINPUTDEVICE8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputDevice8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputDevice8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputDevice8_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) +#define IDirectInputDevice8_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) +#define IDirectInputDevice8_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) +#define IDirectInputDevice8_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) +#define IDirectInputDevice8_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputDevice8_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputDevice8_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) +#define IDirectInputDevice8_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) +#define IDirectInputDevice8_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) +#define IDirectInputDevice8_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) +#define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputDevice8_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) +#define IDirectInputDevice8_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) +#define IDirectInputDevice8_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInputDevice8_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectInputDevice8_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) +#define IDirectInputDevice8_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) +#define IDirectInputDevice8_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) +#define IDirectInputDevice8_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) +#define IDirectInputDevice8_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) +#define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) +#define IDirectInputDevice8_Escape(p,a) (p)->lpVtbl->Escape(p,a) +#define IDirectInputDevice8_Poll(p) (p)->lpVtbl->Poll(p) +#define IDirectInputDevice8_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) +#define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d) +#define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d) +#define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->lpVtbl->BuildActionMap(p,a,b,c) +#define IDirectInputDevice8_SetActionMap(p,a,b,c) (p)->lpVtbl->SetActionMap(p,a,b,c) +#define IDirectInputDevice8_GetImageInfo(p,a) (p)->lpVtbl->GetImageInfo(p,a) +#else +#define IDirectInputDevice8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputDevice8_AddRef(p) (p)->AddRef() +#define IDirectInputDevice8_Release(p) (p)->Release() +#define IDirectInputDevice8_GetCapabilities(p,a) (p)->GetCapabilities(a) +#define IDirectInputDevice8_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) +#define IDirectInputDevice8_GetProperty(p,a,b) (p)->GetProperty(a,b) +#define IDirectInputDevice8_SetProperty(p,a,b) (p)->SetProperty(a,b) +#define IDirectInputDevice8_Acquire(p) (p)->Acquire() +#define IDirectInputDevice8_Unacquire(p) (p)->Unacquire() +#define IDirectInputDevice8_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) +#define IDirectInputDevice8_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) +#define IDirectInputDevice8_SetDataFormat(p,a) (p)->SetDataFormat(a) +#define IDirectInputDevice8_SetEventNotification(p,a) (p)->SetEventNotification(a) +#define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputDevice8_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) +#define IDirectInputDevice8_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) +#define IDirectInputDevice8_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInputDevice8_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectInputDevice8_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) +#define IDirectInputDevice8_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) +#define IDirectInputDevice8_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) +#define IDirectInputDevice8_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) +#define IDirectInputDevice8_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) +#define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) +#define IDirectInputDevice8_Escape(p,a) (p)->Escape(a) +#define IDirectInputDevice8_Poll(p) (p)->Poll() +#define IDirectInputDevice8_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) +#define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d) +#define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d) +#define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->BuildActionMap(a,b,c) +#define IDirectInputDevice8_SetActionMap(p,a,b,c) (p)->SetActionMap(a,b,c) +#define IDirectInputDevice8_GetImageInfo(p,a) (p)->GetImageInfo(a) +#endif + +#endif /* DIJ_RINGZERO */ + +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +/**************************************************************************** + * + * Mouse + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +typedef struct _DIMOUSESTATE { + LONG lX; + LONG lY; + LONG lZ; + BYTE rgbButtons[4]; +} DIMOUSESTATE, *LPDIMOUSESTATE; + +#if DIRECTINPUT_VERSION >= 0x0700 +typedef struct _DIMOUSESTATE2 { + LONG lX; + LONG lY; + LONG lZ; + BYTE rgbButtons[8]; +} DIMOUSESTATE2, *LPDIMOUSESTATE2; +#endif + + +#define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX) +#define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY) +#define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ) +#define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0) +#define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1) +#define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2) +#define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3) +#if (DIRECTINPUT_VERSION >= 0x0700) +#define DIMOFS_BUTTON4 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 4) +#define DIMOFS_BUTTON5 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 5) +#define DIMOFS_BUTTON6 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 6) +#define DIMOFS_BUTTON7 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 7) +#endif +#endif /* DIJ_RINGZERO */ + +/**************************************************************************** + * + * Keyboard + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +/**************************************************************************** + * + * DirectInput keyboard scan codes + * + ****************************************************************************/ +#define DIK_ESCAPE 0x01 +#define DIK_1 0x02 +#define DIK_2 0x03 +#define DIK_3 0x04 +#define DIK_4 0x05 +#define DIK_5 0x06 +#define DIK_6 0x07 +#define DIK_7 0x08 +#define DIK_8 0x09 +#define DIK_9 0x0A +#define DIK_0 0x0B +#define DIK_MINUS 0x0C /* - on main keyboard */ +#define DIK_EQUALS 0x0D +#define DIK_BACK 0x0E /* backspace */ +#define DIK_TAB 0x0F +#define DIK_Q 0x10 +#define DIK_W 0x11 +#define DIK_E 0x12 +#define DIK_R 0x13 +#define DIK_T 0x14 +#define DIK_Y 0x15 +#define DIK_U 0x16 +#define DIK_I 0x17 +#define DIK_O 0x18 +#define DIK_P 0x19 +#define DIK_LBRACKET 0x1A +#define DIK_RBRACKET 0x1B +#define DIK_RETURN 0x1C /* Enter on main keyboard */ +#define DIK_LCONTROL 0x1D +#define DIK_A 0x1E +#define DIK_S 0x1F +#define DIK_D 0x20 +#define DIK_F 0x21 +#define DIK_G 0x22 +#define DIK_H 0x23 +#define DIK_J 0x24 +#define DIK_K 0x25 +#define DIK_L 0x26 +#define DIK_SEMICOLON 0x27 +#define DIK_APOSTROPHE 0x28 +#define DIK_GRAVE 0x29 /* accent grave */ +#define DIK_LSHIFT 0x2A +#define DIK_BACKSLASH 0x2B +#define DIK_Z 0x2C +#define DIK_X 0x2D +#define DIK_C 0x2E +#define DIK_V 0x2F +#define DIK_B 0x30 +#define DIK_N 0x31 +#define DIK_M 0x32 +#define DIK_COMMA 0x33 +#define DIK_PERIOD 0x34 /* . on main keyboard */ +#define DIK_SLASH 0x35 /* / on main keyboard */ +#define DIK_RSHIFT 0x36 +#define DIK_MULTIPLY 0x37 /* * on numeric keypad */ +#define DIK_LMENU 0x38 /* left Alt */ +#define DIK_SPACE 0x39 +#define DIK_CAPITAL 0x3A +#define DIK_F1 0x3B +#define DIK_F2 0x3C +#define DIK_F3 0x3D +#define DIK_F4 0x3E +#define DIK_F5 0x3F +#define DIK_F6 0x40 +#define DIK_F7 0x41 +#define DIK_F8 0x42 +#define DIK_F9 0x43 +#define DIK_F10 0x44 +#define DIK_NUMLOCK 0x45 +#define DIK_SCROLL 0x46 /* Scroll Lock */ +#define DIK_NUMPAD7 0x47 +#define DIK_NUMPAD8 0x48 +#define DIK_NUMPAD9 0x49 +#define DIK_SUBTRACT 0x4A /* - on numeric keypad */ +#define DIK_NUMPAD4 0x4B +#define DIK_NUMPAD5 0x4C +#define DIK_NUMPAD6 0x4D +#define DIK_ADD 0x4E /* + on numeric keypad */ +#define DIK_NUMPAD1 0x4F +#define DIK_NUMPAD2 0x50 +#define DIK_NUMPAD3 0x51 +#define DIK_NUMPAD0 0x52 +#define DIK_DECIMAL 0x53 /* . on numeric keypad */ +#define DIK_OEM_102 0x56 /* <> or \| on RT 102-key keyboard (Non-U.S.) */ +#define DIK_F11 0x57 +#define DIK_F12 0x58 +#define DIK_F13 0x64 /* (NEC PC98) */ +#define DIK_F14 0x65 /* (NEC PC98) */ +#define DIK_F15 0x66 /* (NEC PC98) */ +#define DIK_KANA 0x70 /* (Japanese keyboard) */ +#define DIK_ABNT_C1 0x73 /* /? on Brazilian keyboard */ +#define DIK_CONVERT 0x79 /* (Japanese keyboard) */ +#define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */ +#define DIK_YEN 0x7D /* (Japanese keyboard) */ +#define DIK_ABNT_C2 0x7E /* Numpad . on Brazilian keyboard */ +#define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */ +#define DIK_PREVTRACK 0x90 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */ +#define DIK_AT 0x91 /* (NEC PC98) */ +#define DIK_COLON 0x92 /* (NEC PC98) */ +#define DIK_UNDERLINE 0x93 /* (NEC PC98) */ +#define DIK_KANJI 0x94 /* (Japanese keyboard) */ +#define DIK_STOP 0x95 /* (NEC PC98) */ +#define DIK_AX 0x96 /* (Japan AX) */ +#define DIK_UNLABELED 0x97 /* (J3100) */ +#define DIK_NEXTTRACK 0x99 /* Next Track */ +#define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */ +#define DIK_RCONTROL 0x9D +#define DIK_MUTE 0xA0 /* Mute */ +#define DIK_CALCULATOR 0xA1 /* Calculator */ +#define DIK_PLAYPAUSE 0xA2 /* Play / Pause */ +#define DIK_MEDIASTOP 0xA4 /* Media Stop */ +#define DIK_VOLUMEDOWN 0xAE /* Volume - */ +#define DIK_VOLUMEUP 0xB0 /* Volume + */ +#define DIK_WEBHOME 0xB2 /* Web home */ +#define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */ +#define DIK_DIVIDE 0xB5 /* / on numeric keypad */ +#define DIK_SYSRQ 0xB7 +#define DIK_RMENU 0xB8 /* right Alt */ +#define DIK_PAUSE 0xC5 /* Pause */ +#define DIK_HOME 0xC7 /* Home on arrow keypad */ +#define DIK_UP 0xC8 /* UpArrow on arrow keypad */ +#define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */ +#define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */ +#define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */ +#define DIK_END 0xCF /* End on arrow keypad */ +#define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */ +#define DIK_NEXT 0xD1 /* PgDn on arrow keypad */ +#define DIK_INSERT 0xD2 /* Insert on arrow keypad */ +#define DIK_DELETE 0xD3 /* Delete on arrow keypad */ +#define DIK_LWIN 0xDB /* Left Windows key */ +#define DIK_RWIN 0xDC /* Right Windows key */ +#define DIK_APPS 0xDD /* AppMenu key */ +#define DIK_POWER 0xDE /* System Power */ +#define DIK_SLEEP 0xDF /* System Sleep */ +#define DIK_WAKE 0xE3 /* System Wake */ +#define DIK_WEBSEARCH 0xE5 /* Web Search */ +#define DIK_WEBFAVORITES 0xE6 /* Web Favorites */ +#define DIK_WEBREFRESH 0xE7 /* Web Refresh */ +#define DIK_WEBSTOP 0xE8 /* Web Stop */ +#define DIK_WEBFORWARD 0xE9 /* Web Forward */ +#define DIK_WEBBACK 0xEA /* Web Back */ +#define DIK_MYCOMPUTER 0xEB /* My Computer */ +#define DIK_MAIL 0xEC /* Mail */ +#define DIK_MEDIASELECT 0xED /* Media Select */ + +/* + * Alternate names for keys, to facilitate transition from DOS. + */ +#define DIK_BACKSPACE DIK_BACK /* backspace */ +#define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */ +#define DIK_LALT DIK_LMENU /* left Alt */ +#define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */ +#define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */ +#define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */ +#define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */ +#define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */ +#define DIK_RALT DIK_RMENU /* right Alt */ +#define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */ +#define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */ +#define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */ +#define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */ +#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */ +#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */ + +/* + * Alternate names for keys originally not used on US keyboards. + */ +#define DIK_CIRCUMFLEX DIK_PREVTRACK /* Japanese keyboard */ + +#endif /* DIJ_RINGZERO */ + +/**************************************************************************** + * + * Joystick + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +typedef struct DIJOYSTATE { + LONG lX; /* x-axis position */ + LONG lY; /* y-axis position */ + LONG lZ; /* z-axis position */ + LONG lRx; /* x-axis rotation */ + LONG lRy; /* y-axis rotation */ + LONG lRz; /* z-axis rotation */ + LONG rglSlider[2]; /* extra axes positions */ + DWORD rgdwPOV[4]; /* POV directions */ + BYTE rgbButtons[32]; /* 32 buttons */ +} DIJOYSTATE, *LPDIJOYSTATE; + +typedef struct DIJOYSTATE2 { + LONG lX; /* x-axis position */ + LONG lY; /* y-axis position */ + LONG lZ; /* z-axis position */ + LONG lRx; /* x-axis rotation */ + LONG lRy; /* y-axis rotation */ + LONG lRz; /* z-axis rotation */ + LONG rglSlider[2]; /* extra axes positions */ + DWORD rgdwPOV[4]; /* POV directions */ + BYTE rgbButtons[128]; /* 128 buttons */ + LONG lVX; /* x-axis velocity */ + LONG lVY; /* y-axis velocity */ + LONG lVZ; /* z-axis velocity */ + LONG lVRx; /* x-axis angular velocity */ + LONG lVRy; /* y-axis angular velocity */ + LONG lVRz; /* z-axis angular velocity */ + LONG rglVSlider[2]; /* extra axes velocities */ + LONG lAX; /* x-axis acceleration */ + LONG lAY; /* y-axis acceleration */ + LONG lAZ; /* z-axis acceleration */ + LONG lARx; /* x-axis angular acceleration */ + LONG lARy; /* y-axis angular acceleration */ + LONG lARz; /* z-axis angular acceleration */ + LONG rglASlider[2]; /* extra axes accelerations */ + LONG lFX; /* x-axis force */ + LONG lFY; /* y-axis force */ + LONG lFZ; /* z-axis force */ + LONG lFRx; /* x-axis torque */ + LONG lFRy; /* y-axis torque */ + LONG lFRz; /* z-axis torque */ + LONG rglFSlider[2]; /* extra axes forces */ +} DIJOYSTATE2, *LPDIJOYSTATE2; + +#define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX) +#define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY) +#define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ) +#define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx) +#define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy) +#define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz) +#define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \ + (n) * sizeof(LONG)) +#define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \ + (n) * sizeof(DWORD)) +#define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n)) +#define DIJOFS_BUTTON0 DIJOFS_BUTTON(0) +#define DIJOFS_BUTTON1 DIJOFS_BUTTON(1) +#define DIJOFS_BUTTON2 DIJOFS_BUTTON(2) +#define DIJOFS_BUTTON3 DIJOFS_BUTTON(3) +#define DIJOFS_BUTTON4 DIJOFS_BUTTON(4) +#define DIJOFS_BUTTON5 DIJOFS_BUTTON(5) +#define DIJOFS_BUTTON6 DIJOFS_BUTTON(6) +#define DIJOFS_BUTTON7 DIJOFS_BUTTON(7) +#define DIJOFS_BUTTON8 DIJOFS_BUTTON(8) +#define DIJOFS_BUTTON9 DIJOFS_BUTTON(9) +#define DIJOFS_BUTTON10 DIJOFS_BUTTON(10) +#define DIJOFS_BUTTON11 DIJOFS_BUTTON(11) +#define DIJOFS_BUTTON12 DIJOFS_BUTTON(12) +#define DIJOFS_BUTTON13 DIJOFS_BUTTON(13) +#define DIJOFS_BUTTON14 DIJOFS_BUTTON(14) +#define DIJOFS_BUTTON15 DIJOFS_BUTTON(15) +#define DIJOFS_BUTTON16 DIJOFS_BUTTON(16) +#define DIJOFS_BUTTON17 DIJOFS_BUTTON(17) +#define DIJOFS_BUTTON18 DIJOFS_BUTTON(18) +#define DIJOFS_BUTTON19 DIJOFS_BUTTON(19) +#define DIJOFS_BUTTON20 DIJOFS_BUTTON(20) +#define DIJOFS_BUTTON21 DIJOFS_BUTTON(21) +#define DIJOFS_BUTTON22 DIJOFS_BUTTON(22) +#define DIJOFS_BUTTON23 DIJOFS_BUTTON(23) +#define DIJOFS_BUTTON24 DIJOFS_BUTTON(24) +#define DIJOFS_BUTTON25 DIJOFS_BUTTON(25) +#define DIJOFS_BUTTON26 DIJOFS_BUTTON(26) +#define DIJOFS_BUTTON27 DIJOFS_BUTTON(27) +#define DIJOFS_BUTTON28 DIJOFS_BUTTON(28) +#define DIJOFS_BUTTON29 DIJOFS_BUTTON(29) +#define DIJOFS_BUTTON30 DIJOFS_BUTTON(30) +#define DIJOFS_BUTTON31 DIJOFS_BUTTON(31) + + +#endif /* DIJ_RINGZERO */ + +/**************************************************************************** + * + * IDirectInput + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +#define DIENUM_STOP 0 +#define DIENUM_CONTINUE 1 + +typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA, LPVOID); +typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW, LPVOID); +#ifdef UNICODE +#define LPDIENUMDEVICESCALLBACK LPDIENUMDEVICESCALLBACKW +#else +#define LPDIENUMDEVICESCALLBACK LPDIENUMDEVICESCALLBACKA +#endif // !UNICODE +typedef BOOL (FAR PASCAL * LPDICONFIGUREDEVICESCALLBACK)(IUnknown FAR *, LPVOID); + +#define DIEDFL_ALLDEVICES 0x00000000 +#define DIEDFL_ATTACHEDONLY 0x00000001 +#if(DIRECTINPUT_VERSION >= 0x0500) +#define DIEDFL_FORCEFEEDBACK 0x00000100 +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIEDFL_INCLUDEALIASES 0x00010000 +#define DIEDFL_INCLUDEPHANTOMS 0x00020000 +#endif /* DIRECTINPUT_VERSION >= 0x050a */ +#if(DIRECTINPUT_VERSION >= 0x0800) +#define DIEDFL_INCLUDEHIDDEN 0x00040000 +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + + +#if(DIRECTINPUT_VERSION >= 0x0800) +typedef BOOL (FAR PASCAL * LPDIENUMDEVICESBYSEMANTICSCBA)(LPCDIDEVICEINSTANCEA, LPDIRECTINPUTDEVICE8A, DWORD, DWORD, LPVOID); +typedef BOOL (FAR PASCAL * LPDIENUMDEVICESBYSEMANTICSCBW)(LPCDIDEVICEINSTANCEW, LPDIRECTINPUTDEVICE8W, DWORD, DWORD, LPVOID); +#ifdef UNICODE +#define LPDIENUMDEVICESBYSEMANTICSCB LPDIENUMDEVICESBYSEMANTICSCBW +#else +#define LPDIENUMDEVICESBYSEMANTICSCB LPDIENUMDEVICESBYSEMANTICSCBA +#endif // !UNICODE +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#if(DIRECTINPUT_VERSION >= 0x0800) +#define DIEDBS_MAPPEDPRI1 0x00000001 +#define DIEDBS_MAPPEDPRI2 0x00000002 +#define DIEDBS_RECENTDEVICE 0x00000010 +#define DIEDBS_NEWDEVICE 0x00000020 +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#if(DIRECTINPUT_VERSION >= 0x0800) +#define DIEDBSFL_ATTACHEDONLY 0x00000000 +#define DIEDBSFL_THISUSER 0x00000010 +#define DIEDBSFL_FORCEFEEDBACK DIEDFL_FORCEFEEDBACK +#define DIEDBSFL_AVAILABLEDEVICES 0x00001000 +#define DIEDBSFL_MULTIMICEKEYBOARDS 0x00002000 +#define DIEDBSFL_NONGAMINGDEVICES 0x00004000 +#define DIEDBSFL_VALID 0x00007110 +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#undef INTERFACE +#define INTERFACE IDirectInputW + +DECLARE_INTERFACE_(IDirectInputW, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputW methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; +}; + +typedef struct IDirectInputW *LPDIRECTINPUTW; + +#undef INTERFACE +#define INTERFACE IDirectInputA + +DECLARE_INTERFACE_(IDirectInputA, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputA methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; +}; + +typedef struct IDirectInputA *LPDIRECTINPUTA; + +#ifdef UNICODE +#define IID_IDirectInput IID_IDirectInputW +#define IDirectInput IDirectInputW +#define IDirectInputVtbl IDirectInputWVtbl +#else +#define IID_IDirectInput IID_IDirectInputA +#define IDirectInput IDirectInputA +#define IDirectInputVtbl IDirectInputAVtbl +#endif +typedef struct IDirectInput *LPDIRECTINPUT; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInput_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInput_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInput_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInput_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) +#define IDirectInput_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) +#define IDirectInput_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInput_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#else +#define IDirectInput_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInput_AddRef(p) (p)->AddRef() +#define IDirectInput_Release(p) (p)->Release() +#define IDirectInput_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) +#define IDirectInput_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) +#define IDirectInput_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInput_Initialize(p,a,b) (p)->Initialize(a,b) +#endif + +#undef INTERFACE +#define INTERFACE IDirectInput2W + +DECLARE_INTERFACE_(IDirectInput2W, IDirectInputW) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputW methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + + /*** IDirectInput2W methods ***/ + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE; +}; + +typedef struct IDirectInput2W *LPDIRECTINPUT2W; + +#undef INTERFACE +#define INTERFACE IDirectInput2A + +DECLARE_INTERFACE_(IDirectInput2A, IDirectInputA) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputA methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + + /*** IDirectInput2A methods ***/ + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE; +}; + +typedef struct IDirectInput2A *LPDIRECTINPUT2A; + +#ifdef UNICODE +#define IID_IDirectInput2 IID_IDirectInput2W +#define IDirectInput2 IDirectInput2W +#define IDirectInput2Vtbl IDirectInput2WVtbl +#else +#define IID_IDirectInput2 IID_IDirectInput2A +#define IDirectInput2 IDirectInput2A +#define IDirectInput2Vtbl IDirectInput2AVtbl +#endif +typedef struct IDirectInput2 *LPDIRECTINPUT2; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInput2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInput2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInput2_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInput2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) +#define IDirectInput2_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) +#define IDirectInput2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInput2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectInput2_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) +#else +#define IDirectInput2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInput2_AddRef(p) (p)->AddRef() +#define IDirectInput2_Release(p) (p)->Release() +#define IDirectInput2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) +#define IDirectInput2_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) +#define IDirectInput2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInput2_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectInput2_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c) +#endif + + +#undef INTERFACE +#define INTERFACE IDirectInput7W + +DECLARE_INTERFACE_(IDirectInput7W, IDirectInput2W) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInput2W methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE; + + /*** IDirectInput7W methods ***/ + STDMETHOD(CreateDeviceEx)(THIS_ REFGUID,REFIID,LPVOID *,LPUNKNOWN) PURE; +}; + +typedef struct IDirectInput7W *LPDIRECTINPUT7W; + +#undef INTERFACE +#define INTERFACE IDirectInput7A + +DECLARE_INTERFACE_(IDirectInput7A, IDirectInput2A) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInput2A methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE; + + /*** IDirectInput7A methods ***/ + STDMETHOD(CreateDeviceEx)(THIS_ REFGUID,REFIID,LPVOID *,LPUNKNOWN) PURE; +}; + +typedef struct IDirectInput7A *LPDIRECTINPUT7A; + +#ifdef UNICODE +#define IID_IDirectInput7 IID_IDirectInput7W +#define IDirectInput7 IDirectInput7W +#define IDirectInput7Vtbl IDirectInput7WVtbl +#else +#define IID_IDirectInput7 IID_IDirectInput7A +#define IDirectInput7 IDirectInput7A +#define IDirectInput7Vtbl IDirectInput7AVtbl +#endif +typedef struct IDirectInput7 *LPDIRECTINPUT7; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInput7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInput7_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInput7_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInput7_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) +#define IDirectInput7_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) +#define IDirectInput7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInput7_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectInput7_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) +#define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d) +#else +#define IDirectInput7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInput7_AddRef(p) (p)->AddRef() +#define IDirectInput7_Release(p) (p)->Release() +#define IDirectInput7_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) +#define IDirectInput7_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) +#define IDirectInput7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInput7_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectInput7_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c) +#define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->CreateDeviceEx(a,b,c,d) +#endif + +#if(DIRECTINPUT_VERSION >= 0x0800) +#undef INTERFACE +#define INTERFACE IDirectInput8W + +DECLARE_INTERFACE_(IDirectInput8W, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInput8W methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICE8W *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE; + STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCWSTR,LPDIACTIONFORMATW,LPDIENUMDEVICESBYSEMANTICSCBW,LPVOID,DWORD) PURE; + STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK,LPDICONFIGUREDEVICESPARAMSW,DWORD,LPVOID) PURE; +}; + +typedef struct IDirectInput8W *LPDIRECTINPUT8W; + +#undef INTERFACE +#define INTERFACE IDirectInput8A + +DECLARE_INTERFACE_(IDirectInput8A, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInput8A methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICE8A *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE; + STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCSTR,LPDIACTIONFORMATA,LPDIENUMDEVICESBYSEMANTICSCBA,LPVOID,DWORD) PURE; + STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK,LPDICONFIGUREDEVICESPARAMSA,DWORD,LPVOID) PURE; +}; + +typedef struct IDirectInput8A *LPDIRECTINPUT8A; + +#ifdef UNICODE +#define IID_IDirectInput8 IID_IDirectInput8W +#define IDirectInput8 IDirectInput8W +#define IDirectInput8Vtbl IDirectInput8WVtbl +#else +#define IID_IDirectInput8 IID_IDirectInput8A +#define IDirectInput8 IDirectInput8A +#define IDirectInput8Vtbl IDirectInput8AVtbl +#endif +typedef struct IDirectInput8 *LPDIRECTINPUT8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInput8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInput8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInput8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInput8_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirectInput8_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) +#define IDirectInput8_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) +#define IDirectInput8_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInput8_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectInput8_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) +#define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->lpVtbl->EnumDevicesBySemantics(p,a,b,c,d,e) +#define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->lpVtbl->ConfigureDevices(p,a,b,c,d) +#else +#define IDirectInput8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInput8_AddRef(p) (p)->AddRef() +#define IDirectInput8_Release(p) (p)->Release() +#define IDirectInput8_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirectInput8_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) +#define IDirectInput8_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) +#define IDirectInput8_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInput8_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectInput8_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c) +#define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->EnumDevicesBySemantics(a,b,c,d,e) +#define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->ConfigureDevices(a,b,c,d) +#endif +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#if DIRECTINPUT_VERSION > 0x0700 + +extern HRESULT WINAPI DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter); + +#else +extern HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter); +extern HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter); +#ifdef UNICODE +#define DirectInputCreate DirectInputCreateW +#else +#define DirectInputCreate DirectInputCreateA +#endif // !UNICODE + +extern HRESULT WINAPI DirectInputCreateEx(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter); + +#endif /* DIRECTINPUT_VERSION > 0x700 */ + +#endif /* DIJ_RINGZERO */ + + +/**************************************************************************** + * + * Return Codes + * + ****************************************************************************/ + +/* + * The operation completed successfully. + */ +#define DI_OK S_OK + +/* + * The device exists but is not currently attached. + */ +#define DI_NOTATTACHED S_FALSE + +/* + * The device buffer overflowed. Some input was lost. + */ +#define DI_BUFFEROVERFLOW S_FALSE + +/* + * The change in device properties had no effect. + */ +#define DI_PROPNOEFFECT S_FALSE + +/* + * The operation had no effect. + */ +#define DI_NOEFFECT S_FALSE + +/* + * The device is a polled device. As a result, device buffering + * will not collect any data and event notifications will not be + * signalled until GetDeviceState is called. + */ +#define DI_POLLEDDEVICE ((HRESULT)0x00000002L) + +/* + * The parameters of the effect were successfully updated by + * IDirectInputEffect::SetParameters, but the effect was not + * downloaded because the device is not exclusively acquired + * or because the DIEP_NODOWNLOAD flag was passed. + */ +#define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L) + +/* + * The parameters of the effect were successfully updated by + * IDirectInputEffect::SetParameters, but in order to change + * the parameters, the effect needed to be restarted. + */ +#define DI_EFFECTRESTARTED ((HRESULT)0x00000004L) + +/* + * The parameters of the effect were successfully updated by + * IDirectInputEffect::SetParameters, but some of them were + * beyond the capabilities of the device and were truncated. + */ +#define DI_TRUNCATED ((HRESULT)0x00000008L) + +/* + * The settings have been successfully applied but could not be + * persisted. + */ +#define DI_SETTINGSNOTSAVED ((HRESULT)0x0000000BL) + +/* + * Equal to DI_EFFECTRESTARTED | DI_TRUNCATED. + */ +#define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL) + +/* + * A SUCCESS code indicating that settings cannot be modified. + */ +#define DI_WRITEPROTECT ((HRESULT)0x00000013L) + +/* + * The application requires a newer version of DirectInput. + */ +#define DIERR_OLDDIRECTINPUTVERSION \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION) + +/* + * The application was written for an unsupported prerelease version + * of DirectInput. + */ +#define DIERR_BETADIRECTINPUTVERSION \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP) + +/* + * The object could not be created due to an incompatible driver version + * or mismatched or incomplete driver components. + */ +#define DIERR_BADDRIVERVER \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL) + +/* + * The device or device instance or effect is not registered with DirectInput. + */ +#define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG + +/* + * The requested object does not exist. + */ +#define DIERR_NOTFOUND \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) + +/* + * The requested object does not exist. + */ +#define DIERR_OBJECTNOTFOUND \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) + +/* + * An invalid parameter was passed to the returning function, + * or the object was not in a state that admitted the function + * to be called. + */ +#define DIERR_INVALIDPARAM E_INVALIDARG + +/* + * The specified interface is not supported by the object + */ +#define DIERR_NOINTERFACE E_NOINTERFACE + +/* + * An undetermined error occured inside the DInput subsystem + */ +#define DIERR_GENERIC E_FAIL + +/* + * The DInput subsystem couldn't allocate sufficient memory to complete the + * caller's request. + */ +#define DIERR_OUTOFMEMORY E_OUTOFMEMORY + +/* + * The function called is not supported at this time + */ +#define DIERR_UNSUPPORTED E_NOTIMPL + +/* + * This object has not been initialized + */ +#define DIERR_NOTINITIALIZED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY) + +/* + * This object is already initialized + */ +#define DIERR_ALREADYINITIALIZED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED) + +/* + * This object does not support aggregation + */ +#define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION + +/* + * Another app has a higher priority level, preventing this call from + * succeeding. + */ +#define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED + +/* + * Access to the device has been lost. It must be re-acquired. + */ +#define DIERR_INPUTLOST \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT) + +/* + * The operation cannot be performed while the device is acquired. + */ +#define DIERR_ACQUIRED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY) + +/* + * The operation cannot be performed unless the device is acquired. + */ +#define DIERR_NOTACQUIRED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS) + +/* + * The specified property cannot be changed. + */ +#define DIERR_READONLY E_ACCESSDENIED + +/* + * The device already has an event notification associated with it. + */ +#define DIERR_HANDLEEXISTS E_ACCESSDENIED + +/* + * Data is not yet available. + */ +#ifndef E_PENDING +#define E_PENDING 0x8000000AL +#endif + +/* + * Unable to IDirectInputJoyConfig_Acquire because the user + * does not have sufficient privileges to change the joystick + * configuration. + */ +#define DIERR_INSUFFICIENTPRIVS 0x80040200L + +/* + * The device is full. + */ +#define DIERR_DEVICEFULL 0x80040201L + +/* + * Not all the requested information fit into the buffer. + */ +#define DIERR_MOREDATA 0x80040202L + +/* + * The effect is not downloaded. + */ +#define DIERR_NOTDOWNLOADED 0x80040203L + +/* + * The device cannot be reinitialized because there are still effects + * attached to it. + */ +#define DIERR_HASEFFECTS 0x80040204L + +/* + * The operation cannot be performed unless the device is acquired + * in DISCL_EXCLUSIVE mode. + */ +#define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L + +/* + * The effect could not be downloaded because essential information + * is missing. For example, no axes have been associated with the + * effect, or no type-specific information has been created. + */ +#define DIERR_INCOMPLETEEFFECT 0x80040206L + +/* + * Attempted to read buffered device data from a device that is + * not buffered. + */ +#define DIERR_NOTBUFFERED 0x80040207L + +/* + * An attempt was made to modify parameters of an effect while it is + * playing. Not all hardware devices support altering the parameters + * of an effect while it is playing. + */ +#define DIERR_EFFECTPLAYING 0x80040208L + +/* + * The operation could not be completed because the device is not + * plugged in. + */ +#define DIERR_UNPLUGGED 0x80040209L + +/* + * SendDeviceData failed because more information was requested + * to be sent than can be sent to the device. Some devices have + * restrictions on how much data can be sent to them. (For example, + * there might be a limit on the number of buttons that can be + * pressed at once.) + */ +#define DIERR_REPORTFULL 0x8004020AL + + +/* + * A mapper file function failed because reading or writing the user or IHV + * settings file failed. + */ +#define DIERR_MAPFILEFAIL 0x8004020BL + + +/*--- DINPUT Mapper Definitions: New for Dx8 ---*/ + + +/*--- Keyboard + Physical Keyboard Device ---*/ + +#define DIKEYBOARD_ESCAPE 0x81000401 +#define DIKEYBOARD_1 0x81000402 +#define DIKEYBOARD_2 0x81000403 +#define DIKEYBOARD_3 0x81000404 +#define DIKEYBOARD_4 0x81000405 +#define DIKEYBOARD_5 0x81000406 +#define DIKEYBOARD_6 0x81000407 +#define DIKEYBOARD_7 0x81000408 +#define DIKEYBOARD_8 0x81000409 +#define DIKEYBOARD_9 0x8100040A +#define DIKEYBOARD_0 0x8100040B +#define DIKEYBOARD_MINUS 0x8100040C /* - on main keyboard */ +#define DIKEYBOARD_EQUALS 0x8100040D +#define DIKEYBOARD_BACK 0x8100040E /* backspace */ +#define DIKEYBOARD_TAB 0x8100040F +#define DIKEYBOARD_Q 0x81000410 +#define DIKEYBOARD_W 0x81000411 +#define DIKEYBOARD_E 0x81000412 +#define DIKEYBOARD_R 0x81000413 +#define DIKEYBOARD_T 0x81000414 +#define DIKEYBOARD_Y 0x81000415 +#define DIKEYBOARD_U 0x81000416 +#define DIKEYBOARD_I 0x81000417 +#define DIKEYBOARD_O 0x81000418 +#define DIKEYBOARD_P 0x81000419 +#define DIKEYBOARD_LBRACKET 0x8100041A +#define DIKEYBOARD_RBRACKET 0x8100041B +#define DIKEYBOARD_RETURN 0x8100041C /* Enter on main keyboard */ +#define DIKEYBOARD_LCONTROL 0x8100041D +#define DIKEYBOARD_A 0x8100041E +#define DIKEYBOARD_S 0x8100041F +#define DIKEYBOARD_D 0x81000420 +#define DIKEYBOARD_F 0x81000421 +#define DIKEYBOARD_G 0x81000422 +#define DIKEYBOARD_H 0x81000423 +#define DIKEYBOARD_J 0x81000424 +#define DIKEYBOARD_K 0x81000425 +#define DIKEYBOARD_L 0x81000426 +#define DIKEYBOARD_SEMICOLON 0x81000427 +#define DIKEYBOARD_APOSTROPHE 0x81000428 +#define DIKEYBOARD_GRAVE 0x81000429 /* accent grave */ +#define DIKEYBOARD_LSHIFT 0x8100042A +#define DIKEYBOARD_BACKSLASH 0x8100042B +#define DIKEYBOARD_Z 0x8100042C +#define DIKEYBOARD_X 0x8100042D +#define DIKEYBOARD_C 0x8100042E +#define DIKEYBOARD_V 0x8100042F +#define DIKEYBOARD_B 0x81000430 +#define DIKEYBOARD_N 0x81000431 +#define DIKEYBOARD_M 0x81000432 +#define DIKEYBOARD_COMMA 0x81000433 +#define DIKEYBOARD_PERIOD 0x81000434 /* . on main keyboard */ +#define DIKEYBOARD_SLASH 0x81000435 /* / on main keyboard */ +#define DIKEYBOARD_RSHIFT 0x81000436 +#define DIKEYBOARD_MULTIPLY 0x81000437 /* * on numeric keypad */ +#define DIKEYBOARD_LMENU 0x81000438 /* left Alt */ +#define DIKEYBOARD_SPACE 0x81000439 +#define DIKEYBOARD_CAPITAL 0x8100043A +#define DIKEYBOARD_F1 0x8100043B +#define DIKEYBOARD_F2 0x8100043C +#define DIKEYBOARD_F3 0x8100043D +#define DIKEYBOARD_F4 0x8100043E +#define DIKEYBOARD_F5 0x8100043F +#define DIKEYBOARD_F6 0x81000440 +#define DIKEYBOARD_F7 0x81000441 +#define DIKEYBOARD_F8 0x81000442 +#define DIKEYBOARD_F9 0x81000443 +#define DIKEYBOARD_F10 0x81000444 +#define DIKEYBOARD_NUMLOCK 0x81000445 +#define DIKEYBOARD_SCROLL 0x81000446 /* Scroll Lock */ +#define DIKEYBOARD_NUMPAD7 0x81000447 +#define DIKEYBOARD_NUMPAD8 0x81000448 +#define DIKEYBOARD_NUMPAD9 0x81000449 +#define DIKEYBOARD_SUBTRACT 0x8100044A /* - on numeric keypad */ +#define DIKEYBOARD_NUMPAD4 0x8100044B +#define DIKEYBOARD_NUMPAD5 0x8100044C +#define DIKEYBOARD_NUMPAD6 0x8100044D +#define DIKEYBOARD_ADD 0x8100044E /* + on numeric keypad */ +#define DIKEYBOARD_NUMPAD1 0x8100044F +#define DIKEYBOARD_NUMPAD2 0x81000450 +#define DIKEYBOARD_NUMPAD3 0x81000451 +#define DIKEYBOARD_NUMPAD0 0x81000452 +#define DIKEYBOARD_DECIMAL 0x81000453 /* . on numeric keypad */ +#define DIKEYBOARD_OEM_102 0x81000456 /* <> or \| on RT 102-key keyboard (Non-U.S.) */ +#define DIKEYBOARD_F11 0x81000457 +#define DIKEYBOARD_F12 0x81000458 +#define DIKEYBOARD_F13 0x81000464 /* (NEC PC98) */ +#define DIKEYBOARD_F14 0x81000465 /* (NEC PC98) */ +#define DIKEYBOARD_F15 0x81000466 /* (NEC PC98) */ +#define DIKEYBOARD_KANA 0x81000470 /* (Japanese keyboard) */ +#define DIKEYBOARD_ABNT_C1 0x81000473 /* /? on Brazilian keyboard */ +#define DIKEYBOARD_CONVERT 0x81000479 /* (Japanese keyboard) */ +#define DIKEYBOARD_NOCONVERT 0x8100047B /* (Japanese keyboard) */ +#define DIKEYBOARD_YEN 0x8100047D /* (Japanese keyboard) */ +#define DIKEYBOARD_ABNT_C2 0x8100047E /* Numpad . on Brazilian keyboard */ +#define DIKEYBOARD_NUMPADEQUALS 0x8100048D /* = on numeric keypad (NEC PC98) */ +#define DIKEYBOARD_PREVTRACK 0x81000490 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */ +#define DIKEYBOARD_AT 0x81000491 /* (NEC PC98) */ +#define DIKEYBOARD_COLON 0x81000492 /* (NEC PC98) */ +#define DIKEYBOARD_UNDERLINE 0x81000493 /* (NEC PC98) */ +#define DIKEYBOARD_KANJI 0x81000494 /* (Japanese keyboard) */ +#define DIKEYBOARD_STOP 0x81000495 /* (NEC PC98) */ +#define DIKEYBOARD_AX 0x81000496 /* (Japan AX) */ +#define DIKEYBOARD_UNLABELED 0x81000497 /* (J3100) */ +#define DIKEYBOARD_NEXTTRACK 0x81000499 /* Next Track */ +#define DIKEYBOARD_NUMPADENTER 0x8100049C /* Enter on numeric keypad */ +#define DIKEYBOARD_RCONTROL 0x8100049D +#define DIKEYBOARD_MUTE 0x810004A0 /* Mute */ +#define DIKEYBOARD_CALCULATOR 0x810004A1 /* Calculator */ +#define DIKEYBOARD_PLAYPAUSE 0x810004A2 /* Play / Pause */ +#define DIKEYBOARD_MEDIASTOP 0x810004A4 /* Media Stop */ +#define DIKEYBOARD_VOLUMEDOWN 0x810004AE /* Volume - */ +#define DIKEYBOARD_VOLUMEUP 0x810004B0 /* Volume + */ +#define DIKEYBOARD_WEBHOME 0x810004B2 /* Web home */ +#define DIKEYBOARD_NUMPADCOMMA 0x810004B3 /* , on numeric keypad (NEC PC98) */ +#define DIKEYBOARD_DIVIDE 0x810004B5 /* / on numeric keypad */ +#define DIKEYBOARD_SYSRQ 0x810004B7 +#define DIKEYBOARD_RMENU 0x810004B8 /* right Alt */ +#define DIKEYBOARD_PAUSE 0x810004C5 /* Pause */ +#define DIKEYBOARD_HOME 0x810004C7 /* Home on arrow keypad */ +#define DIKEYBOARD_UP 0x810004C8 /* UpArrow on arrow keypad */ +#define DIKEYBOARD_PRIOR 0x810004C9 /* PgUp on arrow keypad */ +#define DIKEYBOARD_LEFT 0x810004CB /* LeftArrow on arrow keypad */ +#define DIKEYBOARD_RIGHT 0x810004CD /* RightArrow on arrow keypad */ +#define DIKEYBOARD_END 0x810004CF /* End on arrow keypad */ +#define DIKEYBOARD_DOWN 0x810004D0 /* DownArrow on arrow keypad */ +#define DIKEYBOARD_NEXT 0x810004D1 /* PgDn on arrow keypad */ +#define DIKEYBOARD_INSERT 0x810004D2 /* Insert on arrow keypad */ +#define DIKEYBOARD_DELETE 0x810004D3 /* Delete on arrow keypad */ +#define DIKEYBOARD_LWIN 0x810004DB /* Left Windows key */ +#define DIKEYBOARD_RWIN 0x810004DC /* Right Windows key */ +#define DIKEYBOARD_APPS 0x810004DD /* AppMenu key */ +#define DIKEYBOARD_POWER 0x810004DE /* System Power */ +#define DIKEYBOARD_SLEEP 0x810004DF /* System Sleep */ +#define DIKEYBOARD_WAKE 0x810004E3 /* System Wake */ +#define DIKEYBOARD_WEBSEARCH 0x810004E5 /* Web Search */ +#define DIKEYBOARD_WEBFAVORITES 0x810004E6 /* Web Favorites */ +#define DIKEYBOARD_WEBREFRESH 0x810004E7 /* Web Refresh */ +#define DIKEYBOARD_WEBSTOP 0x810004E8 /* Web Stop */ +#define DIKEYBOARD_WEBFORWARD 0x810004E9 /* Web Forward */ +#define DIKEYBOARD_WEBBACK 0x810004EA /* Web Back */ +#define DIKEYBOARD_MYCOMPUTER 0x810004EB /* My Computer */ +#define DIKEYBOARD_MAIL 0x810004EC /* Mail */ +#define DIKEYBOARD_MEDIASELECT 0x810004ED /* Media Select */ + + +/*--- MOUSE + Physical Mouse Device ---*/ + +#define DIMOUSE_XAXISAB (0x82000200 |DIMOFS_X ) /* X Axis-absolute: Some mice natively report absolute coordinates */ +#define DIMOUSE_YAXISAB (0x82000200 |DIMOFS_Y ) /* Y Axis-absolute: Some mice natively report absolute coordinates */ +#define DIMOUSE_XAXIS (0x82000300 |DIMOFS_X ) /* X Axis */ +#define DIMOUSE_YAXIS (0x82000300 |DIMOFS_Y ) /* Y Axis */ +#define DIMOUSE_WHEEL (0x82000300 |DIMOFS_Z ) /* Z Axis */ +#define DIMOUSE_BUTTON0 (0x82000400 |DIMOFS_BUTTON0) /* Button 0 */ +#define DIMOUSE_BUTTON1 (0x82000400 |DIMOFS_BUTTON1) /* Button 1 */ +#define DIMOUSE_BUTTON2 (0x82000400 |DIMOFS_BUTTON2) /* Button 2 */ +#define DIMOUSE_BUTTON3 (0x82000400 |DIMOFS_BUTTON3) /* Button 3 */ +#define DIMOUSE_BUTTON4 (0x82000400 |DIMOFS_BUTTON4) /* Button 4 */ +#define DIMOUSE_BUTTON5 (0x82000400 |DIMOFS_BUTTON5) /* Button 5 */ +#define DIMOUSE_BUTTON6 (0x82000400 |DIMOFS_BUTTON6) /* Button 6 */ +#define DIMOUSE_BUTTON7 (0x82000400 |DIMOFS_BUTTON7) /* Button 7 */ + + +/*--- VOICE + Physical Dplay Voice Device ---*/ + +#define DIVOICE_CHANNEL1 0x83000401 +#define DIVOICE_CHANNEL2 0x83000402 +#define DIVOICE_CHANNEL3 0x83000403 +#define DIVOICE_CHANNEL4 0x83000404 +#define DIVOICE_CHANNEL5 0x83000405 +#define DIVOICE_CHANNEL6 0x83000406 +#define DIVOICE_CHANNEL7 0x83000407 +#define DIVOICE_CHANNEL8 0x83000408 +#define DIVOICE_TEAM 0x83000409 +#define DIVOICE_ALL 0x8300040A +#define DIVOICE_RECORDMUTE 0x8300040B +#define DIVOICE_PLAYBACKMUTE 0x8300040C +#define DIVOICE_TRANSMIT 0x8300040D + +#define DIVOICE_VOICECOMMAND 0x83000410 + + +/*--- Driving Simulator - Racing + Vehicle control is primary objective ---*/ +#define DIVIRTUAL_DRIVING_RACE 0x01000000 +#define DIAXIS_DRIVINGR_STEER 0x01008A01 /* Steering */ +#define DIAXIS_DRIVINGR_ACCELERATE 0x01039202 /* Accelerate */ +#define DIAXIS_DRIVINGR_BRAKE 0x01041203 /* Brake-Axis */ +#define DIBUTTON_DRIVINGR_SHIFTUP 0x01000C01 /* Shift to next higher gear */ +#define DIBUTTON_DRIVINGR_SHIFTDOWN 0x01000C02 /* Shift to next lower gear */ +#define DIBUTTON_DRIVINGR_VIEW 0x01001C03 /* Cycle through view options */ +#define DIBUTTON_DRIVINGR_MENU 0x010004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIAXIS_DRIVINGR_ACCEL_AND_BRAKE 0x01014A04 /* Some devices combine accelerate and brake in a single axis */ +#define DIHATSWITCH_DRIVINGR_GLANCE 0x01004601 /* Look around */ +#define DIBUTTON_DRIVINGR_BRAKE 0x01004C04 /* Brake-button */ +#define DIBUTTON_DRIVINGR_DASHBOARD 0x01004405 /* Select next dashboard option */ +#define DIBUTTON_DRIVINGR_AIDS 0x01004406 /* Driver correction aids */ +#define DIBUTTON_DRIVINGR_MAP 0x01004407 /* Display Driving Map */ +#define DIBUTTON_DRIVINGR_BOOST 0x01004408 /* Turbo Boost */ +#define DIBUTTON_DRIVINGR_PIT 0x01004409 /* Pit stop notification */ +#define DIBUTTON_DRIVINGR_ACCELERATE_LINK 0x0103D4E0 /* Fallback Accelerate button */ +#define DIBUTTON_DRIVINGR_STEER_LEFT_LINK 0x0100CCE4 /* Fallback Steer Left button */ +#define DIBUTTON_DRIVINGR_STEER_RIGHT_LINK 0x0100CCEC /* Fallback Steer Right button */ +#define DIBUTTON_DRIVINGR_GLANCE_LEFT_LINK 0x0107C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_DRIVINGR_GLANCE_RIGHT_LINK 0x0107C4EC /* Fallback Glance Right button */ +#define DIBUTTON_DRIVINGR_DEVICE 0x010044FE /* Show input device and controls */ +#define DIBUTTON_DRIVINGR_PAUSE 0x010044FC /* Start / Pause / Restart game */ + +/*--- Driving Simulator - Combat + Combat from within a vehicle is primary objective ---*/ +#define DIVIRTUAL_DRIVING_COMBAT 0x02000000 +#define DIAXIS_DRIVINGC_STEER 0x02008A01 /* Steering */ +#define DIAXIS_DRIVINGC_ACCELERATE 0x02039202 /* Accelerate */ +#define DIAXIS_DRIVINGC_BRAKE 0x02041203 /* Brake-axis */ +#define DIBUTTON_DRIVINGC_FIRE 0x02000C01 /* Fire */ +#define DIBUTTON_DRIVINGC_WEAPONS 0x02000C02 /* Select next weapon */ +#define DIBUTTON_DRIVINGC_TARGET 0x02000C03 /* Select next available target */ +#define DIBUTTON_DRIVINGC_MENU 0x020004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIAXIS_DRIVINGC_ACCEL_AND_BRAKE 0x02014A04 /* Some devices combine accelerate and brake in a single axis */ +#define DIHATSWITCH_DRIVINGC_GLANCE 0x02004601 /* Look around */ +#define DIBUTTON_DRIVINGC_SHIFTUP 0x02004C04 /* Shift to next higher gear */ +#define DIBUTTON_DRIVINGC_SHIFTDOWN 0x02004C05 /* Shift to next lower gear */ +#define DIBUTTON_DRIVINGC_DASHBOARD 0x02004406 /* Select next dashboard option */ +#define DIBUTTON_DRIVINGC_AIDS 0x02004407 /* Driver correction aids */ +#define DIBUTTON_DRIVINGC_BRAKE 0x02004C08 /* Brake-button */ +#define DIBUTTON_DRIVINGC_FIRESECONDARY 0x02004C09 /* Alternative fire button */ +#define DIBUTTON_DRIVINGC_ACCELERATE_LINK 0x0203D4E0 /* Fallback Accelerate button */ +#define DIBUTTON_DRIVINGC_STEER_LEFT_LINK 0x0200CCE4 /* Fallback Steer Left button */ +#define DIBUTTON_DRIVINGC_STEER_RIGHT_LINK 0x0200CCEC /* Fallback Steer Right button */ +#define DIBUTTON_DRIVINGC_GLANCE_LEFT_LINK 0x0207C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_DRIVINGC_GLANCE_RIGHT_LINK 0x0207C4EC /* Fallback Glance Right button */ +#define DIBUTTON_DRIVINGC_DEVICE 0x020044FE /* Show input device and controls */ +#define DIBUTTON_DRIVINGC_PAUSE 0x020044FC /* Start / Pause / Restart game */ + +/*--- Driving Simulator - Tank + Combat from withing a tank is primary objective ---*/ +#define DIVIRTUAL_DRIVING_TANK 0x03000000 +#define DIAXIS_DRIVINGT_STEER 0x03008A01 /* Turn tank left / right */ +#define DIAXIS_DRIVINGT_BARREL 0x03010202 /* Raise / lower barrel */ +#define DIAXIS_DRIVINGT_ACCELERATE 0x03039203 /* Accelerate */ +#define DIAXIS_DRIVINGT_ROTATE 0x03020204 /* Turn barrel left / right */ +#define DIBUTTON_DRIVINGT_FIRE 0x03000C01 /* Fire */ +#define DIBUTTON_DRIVINGT_WEAPONS 0x03000C02 /* Select next weapon */ +#define DIBUTTON_DRIVINGT_TARGET 0x03000C03 /* Selects next available target */ +#define DIBUTTON_DRIVINGT_MENU 0x030004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_DRIVINGT_GLANCE 0x03004601 /* Look around */ +#define DIAXIS_DRIVINGT_BRAKE 0x03045205 /* Brake-axis */ +#define DIAXIS_DRIVINGT_ACCEL_AND_BRAKE 0x03014A06 /* Some devices combine accelerate and brake in a single axis */ +#define DIBUTTON_DRIVINGT_VIEW 0x03005C04 /* Cycle through view options */ +#define DIBUTTON_DRIVINGT_DASHBOARD 0x03005C05 /* Select next dashboard option */ +#define DIBUTTON_DRIVINGT_BRAKE 0x03004C06 /* Brake-button */ +#define DIBUTTON_DRIVINGT_FIRESECONDARY 0x03004C07 /* Alternative fire button */ +#define DIBUTTON_DRIVINGT_ACCELERATE_LINK 0x0303D4E0 /* Fallback Accelerate button */ +#define DIBUTTON_DRIVINGT_STEER_LEFT_LINK 0x0300CCE4 /* Fallback Steer Left button */ +#define DIBUTTON_DRIVINGT_STEER_RIGHT_LINK 0x0300CCEC /* Fallback Steer Right button */ +#define DIBUTTON_DRIVINGT_BARREL_UP_LINK 0x030144E0 /* Fallback Barrel up button */ +#define DIBUTTON_DRIVINGT_BARREL_DOWN_LINK 0x030144E8 /* Fallback Barrel down button */ +#define DIBUTTON_DRIVINGT_ROTATE_LEFT_LINK 0x030244E4 /* Fallback Rotate left button */ +#define DIBUTTON_DRIVINGT_ROTATE_RIGHT_LINK 0x030244EC /* Fallback Rotate right button */ +#define DIBUTTON_DRIVINGT_GLANCE_LEFT_LINK 0x0307C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_DRIVINGT_GLANCE_RIGHT_LINK 0x0307C4EC /* Fallback Glance Right button */ +#define DIBUTTON_DRIVINGT_DEVICE 0x030044FE /* Show input device and controls */ +#define DIBUTTON_DRIVINGT_PAUSE 0x030044FC /* Start / Pause / Restart game */ + +/*--- Flight Simulator - Civilian + Plane control is the primary objective ---*/ +#define DIVIRTUAL_FLYING_CIVILIAN 0x04000000 +#define DIAXIS_FLYINGC_BANK 0x04008A01 /* Roll ship left / right */ +#define DIAXIS_FLYINGC_PITCH 0x04010A02 /* Nose up / down */ +#define DIAXIS_FLYINGC_THROTTLE 0x04039203 /* Throttle */ +#define DIBUTTON_FLYINGC_VIEW 0x04002401 /* Cycle through view options */ +#define DIBUTTON_FLYINGC_DISPLAY 0x04002402 /* Select next dashboard / heads up display option */ +#define DIBUTTON_FLYINGC_GEAR 0x04002C03 /* Gear up / down */ +#define DIBUTTON_FLYINGC_MENU 0x040004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_FLYINGC_GLANCE 0x04004601 /* Look around */ +#define DIAXIS_FLYINGC_BRAKE 0x04046A04 /* Apply Brake */ +#define DIAXIS_FLYINGC_RUDDER 0x04025205 /* Yaw ship left/right */ +#define DIAXIS_FLYINGC_FLAPS 0x04055A06 /* Flaps */ +#define DIBUTTON_FLYINGC_FLAPSUP 0x04006404 /* Increment stepping up until fully retracted */ +#define DIBUTTON_FLYINGC_FLAPSDOWN 0x04006405 /* Decrement stepping down until fully extended */ +#define DIBUTTON_FLYINGC_BRAKE_LINK 0x04046CE0 /* Fallback brake button */ +#define DIBUTTON_FLYINGC_FASTER_LINK 0x0403D4E0 /* Fallback throttle up button */ +#define DIBUTTON_FLYINGC_SLOWER_LINK 0x0403D4E8 /* Fallback throttle down button */ +#define DIBUTTON_FLYINGC_GLANCE_LEFT_LINK 0x0407C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_FLYINGC_GLANCE_RIGHT_LINK 0x0407C4EC /* Fallback Glance Right button */ +#define DIBUTTON_FLYINGC_GLANCE_UP_LINK 0x0407C4E0 /* Fallback Glance Up button */ +#define DIBUTTON_FLYINGC_GLANCE_DOWN_LINK 0x0407C4E8 /* Fallback Glance Down button */ +#define DIBUTTON_FLYINGC_DEVICE 0x040044FE /* Show input device and controls */ +#define DIBUTTON_FLYINGC_PAUSE 0x040044FC /* Start / Pause / Restart game */ + +/*--- Flight Simulator - Military + Aerial combat is the primary objective ---*/ +#define DIVIRTUAL_FLYING_MILITARY 0x05000000 +#define DIAXIS_FLYINGM_BANK 0x05008A01 /* Bank - Roll ship left / right */ +#define DIAXIS_FLYINGM_PITCH 0x05010A02 /* Pitch - Nose up / down */ +#define DIAXIS_FLYINGM_THROTTLE 0x05039203 /* Throttle - faster / slower */ +#define DIBUTTON_FLYINGM_FIRE 0x05000C01 /* Fire */ +#define DIBUTTON_FLYINGM_WEAPONS 0x05000C02 /* Select next weapon */ +#define DIBUTTON_FLYINGM_TARGET 0x05000C03 /* Selects next available target */ +#define DIBUTTON_FLYINGM_MENU 0x050004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_FLYINGM_GLANCE 0x05004601 /* Look around */ +#define DIBUTTON_FLYINGM_COUNTER 0x05005C04 /* Activate counter measures */ +#define DIAXIS_FLYINGM_RUDDER 0x05024A04 /* Rudder - Yaw ship left/right */ +#define DIAXIS_FLYINGM_BRAKE 0x05046205 /* Brake-axis */ +#define DIBUTTON_FLYINGM_VIEW 0x05006405 /* Cycle through view options */ +#define DIBUTTON_FLYINGM_DISPLAY 0x05006406 /* Select next dashboard option */ +#define DIAXIS_FLYINGM_FLAPS 0x05055206 /* Flaps */ +#define DIBUTTON_FLYINGM_FLAPSUP 0x05005407 /* Increment stepping up until fully retracted */ +#define DIBUTTON_FLYINGM_FLAPSDOWN 0x05005408 /* Decrement stepping down until fully extended */ +#define DIBUTTON_FLYINGM_FIRESECONDARY 0x05004C09 /* Alternative fire button */ +#define DIBUTTON_FLYINGM_GEAR 0x0500640A /* Gear up / down */ +#define DIBUTTON_FLYINGM_BRAKE_LINK 0x050464E0 /* Fallback brake button */ +#define DIBUTTON_FLYINGM_FASTER_LINK 0x0503D4E0 /* Fallback throttle up button */ +#define DIBUTTON_FLYINGM_SLOWER_LINK 0x0503D4E8 /* Fallback throttle down button */ +#define DIBUTTON_FLYINGM_GLANCE_LEFT_LINK 0x0507C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_FLYINGM_GLANCE_RIGHT_LINK 0x0507C4EC /* Fallback Glance Right button */ +#define DIBUTTON_FLYINGM_GLANCE_UP_LINK 0x0507C4E0 /* Fallback Glance Up button */ +#define DIBUTTON_FLYINGM_GLANCE_DOWN_LINK 0x0507C4E8 /* Fallback Glance Down button */ +#define DIBUTTON_FLYINGM_DEVICE 0x050044FE /* Show input device and controls */ +#define DIBUTTON_FLYINGM_PAUSE 0x050044FC /* Start / Pause / Restart game */ + +/*--- Flight Simulator - Combat Helicopter + Combat from helicopter is primary objective ---*/ +#define DIVIRTUAL_FLYING_HELICOPTER 0x06000000 +#define DIAXIS_FLYINGH_BANK 0x06008A01 /* Bank - Roll ship left / right */ +#define DIAXIS_FLYINGH_PITCH 0x06010A02 /* Pitch - Nose up / down */ +#define DIAXIS_FLYINGH_COLLECTIVE 0x06018A03 /* Collective - Blade pitch/power */ +#define DIBUTTON_FLYINGH_FIRE 0x06001401 /* Fire */ +#define DIBUTTON_FLYINGH_WEAPONS 0x06001402 /* Select next weapon */ +#define DIBUTTON_FLYINGH_TARGET 0x06001403 /* Selects next available target */ +#define DIBUTTON_FLYINGH_MENU 0x060004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_FLYINGH_GLANCE 0x06004601 /* Look around */ +#define DIAXIS_FLYINGH_TORQUE 0x06025A04 /* Torque - Rotate ship around left / right axis */ +#define DIAXIS_FLYINGH_THROTTLE 0x0603DA05 /* Throttle */ +#define DIBUTTON_FLYINGH_COUNTER 0x06005404 /* Activate counter measures */ +#define DIBUTTON_FLYINGH_VIEW 0x06006405 /* Cycle through view options */ +#define DIBUTTON_FLYINGH_GEAR 0x06006406 /* Gear up / down */ +#define DIBUTTON_FLYINGH_FIRESECONDARY 0x06004C07 /* Alternative fire button */ +#define DIBUTTON_FLYINGH_FASTER_LINK 0x0603DCE0 /* Fallback throttle up button */ +#define DIBUTTON_FLYINGH_SLOWER_LINK 0x0603DCE8 /* Fallback throttle down button */ +#define DIBUTTON_FLYINGH_GLANCE_LEFT_LINK 0x0607C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_FLYINGH_GLANCE_RIGHT_LINK 0x0607C4EC /* Fallback Glance Right button */ +#define DIBUTTON_FLYINGH_GLANCE_UP_LINK 0x0607C4E0 /* Fallback Glance Up button */ +#define DIBUTTON_FLYINGH_GLANCE_DOWN_LINK 0x0607C4E8 /* Fallback Glance Down button */ +#define DIBUTTON_FLYINGH_DEVICE 0x060044FE /* Show input device and controls */ +#define DIBUTTON_FLYINGH_PAUSE 0x060044FC /* Start / Pause / Restart game */ + +/*--- Space Simulator - Combat + Space Simulator with weapons ---*/ +#define DIVIRTUAL_SPACESIM 0x07000000 +#define DIAXIS_SPACESIM_LATERAL 0x07008201 /* Move ship left / right */ +#define DIAXIS_SPACESIM_MOVE 0x07010202 /* Move ship forward/backward */ +#define DIAXIS_SPACESIM_THROTTLE 0x07038203 /* Throttle - Engine speed */ +#define DIBUTTON_SPACESIM_FIRE 0x07000401 /* Fire */ +#define DIBUTTON_SPACESIM_WEAPONS 0x07000402 /* Select next weapon */ +#define DIBUTTON_SPACESIM_TARGET 0x07000403 /* Selects next available target */ +#define DIBUTTON_SPACESIM_MENU 0x070004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_SPACESIM_GLANCE 0x07004601 /* Look around */ +#define DIAXIS_SPACESIM_CLIMB 0x0701C204 /* Climb - Pitch ship up/down */ +#define DIAXIS_SPACESIM_ROTATE 0x07024205 /* Rotate - Turn ship left/right */ +#define DIBUTTON_SPACESIM_VIEW 0x07004404 /* Cycle through view options */ +#define DIBUTTON_SPACESIM_DISPLAY 0x07004405 /* Select next dashboard / heads up display option */ +#define DIBUTTON_SPACESIM_RAISE 0x07004406 /* Raise ship while maintaining current pitch */ +#define DIBUTTON_SPACESIM_LOWER 0x07004407 /* Lower ship while maintaining current pitch */ +#define DIBUTTON_SPACESIM_GEAR 0x07004408 /* Gear up / down */ +#define DIBUTTON_SPACESIM_FIRESECONDARY 0x07004409 /* Alternative fire button */ +#define DIBUTTON_SPACESIM_LEFT_LINK 0x0700C4E4 /* Fallback move left button */ +#define DIBUTTON_SPACESIM_RIGHT_LINK 0x0700C4EC /* Fallback move right button */ +#define DIBUTTON_SPACESIM_FORWARD_LINK 0x070144E0 /* Fallback move forward button */ +#define DIBUTTON_SPACESIM_BACKWARD_LINK 0x070144E8 /* Fallback move backwards button */ +#define DIBUTTON_SPACESIM_FASTER_LINK 0x0703C4E0 /* Fallback throttle up button */ +#define DIBUTTON_SPACESIM_SLOWER_LINK 0x0703C4E8 /* Fallback throttle down button */ +#define DIBUTTON_SPACESIM_TURN_LEFT_LINK 0x070244E4 /* Fallback turn left button */ +#define DIBUTTON_SPACESIM_TURN_RIGHT_LINK 0x070244EC /* Fallback turn right button */ +#define DIBUTTON_SPACESIM_GLANCE_LEFT_LINK 0x0707C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_SPACESIM_GLANCE_RIGHT_LINK 0x0707C4EC /* Fallback Glance Right button */ +#define DIBUTTON_SPACESIM_GLANCE_UP_LINK 0x0707C4E0 /* Fallback Glance Up button */ +#define DIBUTTON_SPACESIM_GLANCE_DOWN_LINK 0x0707C4E8 /* Fallback Glance Down button */ +#define DIBUTTON_SPACESIM_DEVICE 0x070044FE /* Show input device and controls */ +#define DIBUTTON_SPACESIM_PAUSE 0x070044FC /* Start / Pause / Restart game */ + +/*--- Fighting - First Person + Hand to Hand combat is primary objective ---*/ +#define DIVIRTUAL_FIGHTING_HAND2HAND 0x08000000 +#define DIAXIS_FIGHTINGH_LATERAL 0x08008201 /* Sidestep left/right */ +#define DIAXIS_FIGHTINGH_MOVE 0x08010202 /* Move forward/backward */ +#define DIBUTTON_FIGHTINGH_PUNCH 0x08000401 /* Punch */ +#define DIBUTTON_FIGHTINGH_KICK 0x08000402 /* Kick */ +#define DIBUTTON_FIGHTINGH_BLOCK 0x08000403 /* Block */ +#define DIBUTTON_FIGHTINGH_CROUCH 0x08000404 /* Crouch */ +#define DIBUTTON_FIGHTINGH_JUMP 0x08000405 /* Jump */ +#define DIBUTTON_FIGHTINGH_SPECIAL1 0x08000406 /* Apply first special move */ +#define DIBUTTON_FIGHTINGH_SPECIAL2 0x08000407 /* Apply second special move */ +#define DIBUTTON_FIGHTINGH_MENU 0x080004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_FIGHTINGH_SELECT 0x08004408 /* Select special move */ +#define DIHATSWITCH_FIGHTINGH_SLIDE 0x08004601 /* Look around */ +#define DIBUTTON_FIGHTINGH_DISPLAY 0x08004409 /* Shows next on-screen display option */ +#define DIAXIS_FIGHTINGH_ROTATE 0x08024203 /* Rotate - Turn body left/right */ +#define DIBUTTON_FIGHTINGH_DODGE 0x0800440A /* Dodge */ +#define DIBUTTON_FIGHTINGH_LEFT_LINK 0x0800C4E4 /* Fallback left sidestep button */ +#define DIBUTTON_FIGHTINGH_RIGHT_LINK 0x0800C4EC /* Fallback right sidestep button */ +#define DIBUTTON_FIGHTINGH_FORWARD_LINK 0x080144E0 /* Fallback forward button */ +#define DIBUTTON_FIGHTINGH_BACKWARD_LINK 0x080144E8 /* Fallback backward button */ +#define DIBUTTON_FIGHTINGH_DEVICE 0x080044FE /* Show input device and controls */ +#define DIBUTTON_FIGHTINGH_PAUSE 0x080044FC /* Start / Pause / Restart game */ + +/*--- Fighting - First Person Shooting + Navigation and combat are primary objectives ---*/ +#define DIVIRTUAL_FIGHTING_FPS 0x09000000 +#define DIAXIS_FPS_ROTATE 0x09008201 /* Rotate character left/right */ +#define DIAXIS_FPS_MOVE 0x09010202 /* Move forward/backward */ +#define DIBUTTON_FPS_FIRE 0x09000401 /* Fire */ +#define DIBUTTON_FPS_WEAPONS 0x09000402 /* Select next weapon */ +#define DIBUTTON_FPS_APPLY 0x09000403 /* Use item */ +#define DIBUTTON_FPS_SELECT 0x09000404 /* Select next inventory item */ +#define DIBUTTON_FPS_CROUCH 0x09000405 /* Crouch/ climb down/ swim down */ +#define DIBUTTON_FPS_JUMP 0x09000406 /* Jump/ climb up/ swim up */ +#define DIAXIS_FPS_LOOKUPDOWN 0x09018203 /* Look up / down */ +#define DIBUTTON_FPS_STRAFE 0x09000407 /* Enable strafing while active */ +#define DIBUTTON_FPS_MENU 0x090004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_FPS_GLANCE 0x09004601 /* Look around */ +#define DIBUTTON_FPS_DISPLAY 0x09004408 /* Shows next on-screen display option/ map */ +#define DIAXIS_FPS_SIDESTEP 0x09024204 /* Sidestep */ +#define DIBUTTON_FPS_DODGE 0x09004409 /* Dodge */ +#define DIBUTTON_FPS_GLANCEL 0x0900440A /* Glance Left */ +#define DIBUTTON_FPS_GLANCER 0x0900440B /* Glance Right */ +#define DIBUTTON_FPS_FIRESECONDARY 0x0900440C /* Alternative fire button */ +#define DIBUTTON_FPS_ROTATE_LEFT_LINK 0x0900C4E4 /* Fallback rotate left button */ +#define DIBUTTON_FPS_ROTATE_RIGHT_LINK 0x0900C4EC /* Fallback rotate right button */ +#define DIBUTTON_FPS_FORWARD_LINK 0x090144E0 /* Fallback forward button */ +#define DIBUTTON_FPS_BACKWARD_LINK 0x090144E8 /* Fallback backward button */ +#define DIBUTTON_FPS_GLANCE_UP_LINK 0x0901C4E0 /* Fallback look up button */ +#define DIBUTTON_FPS_GLANCE_DOWN_LINK 0x0901C4E8 /* Fallback look down button */ +#define DIBUTTON_FPS_STEP_LEFT_LINK 0x090244E4 /* Fallback step left button */ +#define DIBUTTON_FPS_STEP_RIGHT_LINK 0x090244EC /* Fallback step right button */ +#define DIBUTTON_FPS_DEVICE 0x090044FE /* Show input device and controls */ +#define DIBUTTON_FPS_PAUSE 0x090044FC /* Start / Pause / Restart game */ + +/*--- Fighting - Third Person action + Perspective of camera is behind the main character ---*/ +#define DIVIRTUAL_FIGHTING_THIRDPERSON 0x0A000000 +#define DIAXIS_TPS_TURN 0x0A020201 /* Turn left/right */ +#define DIAXIS_TPS_MOVE 0x0A010202 /* Move forward/backward */ +#define DIBUTTON_TPS_RUN 0x0A000401 /* Run or walk toggle switch */ +#define DIBUTTON_TPS_ACTION 0x0A000402 /* Action Button */ +#define DIBUTTON_TPS_SELECT 0x0A000403 /* Select next weapon */ +#define DIBUTTON_TPS_USE 0x0A000404 /* Use inventory item currently selected */ +#define DIBUTTON_TPS_JUMP 0x0A000405 /* Character Jumps */ +#define DIBUTTON_TPS_MENU 0x0A0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_TPS_GLANCE 0x0A004601 /* Look around */ +#define DIBUTTON_TPS_VIEW 0x0A004406 /* Select camera view */ +#define DIBUTTON_TPS_STEPLEFT 0x0A004407 /* Character takes a left step */ +#define DIBUTTON_TPS_STEPRIGHT 0x0A004408 /* Character takes a right step */ +#define DIAXIS_TPS_STEP 0x0A00C203 /* Character steps left/right */ +#define DIBUTTON_TPS_DODGE 0x0A004409 /* Character dodges or ducks */ +#define DIBUTTON_TPS_INVENTORY 0x0A00440A /* Cycle through inventory */ +#define DIBUTTON_TPS_TURN_LEFT_LINK 0x0A0244E4 /* Fallback turn left button */ +#define DIBUTTON_TPS_TURN_RIGHT_LINK 0x0A0244EC /* Fallback turn right button */ +#define DIBUTTON_TPS_FORWARD_LINK 0x0A0144E0 /* Fallback forward button */ +#define DIBUTTON_TPS_BACKWARD_LINK 0x0A0144E8 /* Fallback backward button */ +#define DIBUTTON_TPS_GLANCE_UP_LINK 0x0A07C4E0 /* Fallback look up button */ +#define DIBUTTON_TPS_GLANCE_DOWN_LINK 0x0A07C4E8 /* Fallback look down button */ +#define DIBUTTON_TPS_GLANCE_LEFT_LINK 0x0A07C4E4 /* Fallback glance up button */ +#define DIBUTTON_TPS_GLANCE_RIGHT_LINK 0x0A07C4EC /* Fallback glance right button */ +#define DIBUTTON_TPS_DEVICE 0x0A0044FE /* Show input device and controls */ +#define DIBUTTON_TPS_PAUSE 0x0A0044FC /* Start / Pause / Restart game */ + +/*--- Strategy - Role Playing + Navigation and problem solving are primary actions ---*/ +#define DIVIRTUAL_STRATEGY_ROLEPLAYING 0x0B000000 +#define DIAXIS_STRATEGYR_LATERAL 0x0B008201 /* sidestep - left/right */ +#define DIAXIS_STRATEGYR_MOVE 0x0B010202 /* move forward/backward */ +#define DIBUTTON_STRATEGYR_GET 0x0B000401 /* Acquire item */ +#define DIBUTTON_STRATEGYR_APPLY 0x0B000402 /* Use selected item */ +#define DIBUTTON_STRATEGYR_SELECT 0x0B000403 /* Select nextitem */ +#define DIBUTTON_STRATEGYR_ATTACK 0x0B000404 /* Attack */ +#define DIBUTTON_STRATEGYR_CAST 0x0B000405 /* Cast Spell */ +#define DIBUTTON_STRATEGYR_CROUCH 0x0B000406 /* Crouch */ +#define DIBUTTON_STRATEGYR_JUMP 0x0B000407 /* Jump */ +#define DIBUTTON_STRATEGYR_MENU 0x0B0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_STRATEGYR_GLANCE 0x0B004601 /* Look around */ +#define DIBUTTON_STRATEGYR_MAP 0x0B004408 /* Cycle through map options */ +#define DIBUTTON_STRATEGYR_DISPLAY 0x0B004409 /* Shows next on-screen display option */ +#define DIAXIS_STRATEGYR_ROTATE 0x0B024203 /* Turn body left/right */ +#define DIBUTTON_STRATEGYR_LEFT_LINK 0x0B00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_STRATEGYR_RIGHT_LINK 0x0B00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_STRATEGYR_FORWARD_LINK 0x0B0144E0 /* Fallback move forward button */ +#define DIBUTTON_STRATEGYR_BACK_LINK 0x0B0144E8 /* Fallback move backward button */ +#define DIBUTTON_STRATEGYR_ROTATE_LEFT_LINK 0x0B0244E4 /* Fallback turn body left button */ +#define DIBUTTON_STRATEGYR_ROTATE_RIGHT_LINK 0x0B0244EC /* Fallback turn body right button */ +#define DIBUTTON_STRATEGYR_DEVICE 0x0B0044FE /* Show input device and controls */ +#define DIBUTTON_STRATEGYR_PAUSE 0x0B0044FC /* Start / Pause / Restart game */ + +/*--- Strategy - Turn based + Navigation and problem solving are primary actions ---*/ +#define DIVIRTUAL_STRATEGY_TURN 0x0C000000 +#define DIAXIS_STRATEGYT_LATERAL 0x0C008201 /* Sidestep left/right */ +#define DIAXIS_STRATEGYT_MOVE 0x0C010202 /* Move forward/backwards */ +#define DIBUTTON_STRATEGYT_SELECT 0x0C000401 /* Select unit or object */ +#define DIBUTTON_STRATEGYT_INSTRUCT 0x0C000402 /* Cycle through instructions */ +#define DIBUTTON_STRATEGYT_APPLY 0x0C000403 /* Apply selected instruction */ +#define DIBUTTON_STRATEGYT_TEAM 0x0C000404 /* Select next team / cycle through all */ +#define DIBUTTON_STRATEGYT_TURN 0x0C000405 /* Indicate turn over */ +#define DIBUTTON_STRATEGYT_MENU 0x0C0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_STRATEGYT_ZOOM 0x0C004406 /* Zoom - in / out */ +#define DIBUTTON_STRATEGYT_MAP 0x0C004407 /* cycle through map options */ +#define DIBUTTON_STRATEGYT_DISPLAY 0x0C004408 /* shows next on-screen display options */ +#define DIBUTTON_STRATEGYT_LEFT_LINK 0x0C00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_STRATEGYT_RIGHT_LINK 0x0C00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_STRATEGYT_FORWARD_LINK 0x0C0144E0 /* Fallback move forward button */ +#define DIBUTTON_STRATEGYT_BACK_LINK 0x0C0144E8 /* Fallback move back button */ +#define DIBUTTON_STRATEGYT_DEVICE 0x0C0044FE /* Show input device and controls */ +#define DIBUTTON_STRATEGYT_PAUSE 0x0C0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Hunting + Hunting ---*/ +#define DIVIRTUAL_SPORTS_HUNTING 0x0D000000 +#define DIAXIS_HUNTING_LATERAL 0x0D008201 /* sidestep left/right */ +#define DIAXIS_HUNTING_MOVE 0x0D010202 /* move forward/backwards */ +#define DIBUTTON_HUNTING_FIRE 0x0D000401 /* Fire selected weapon */ +#define DIBUTTON_HUNTING_AIM 0x0D000402 /* Select aim/move */ +#define DIBUTTON_HUNTING_WEAPON 0x0D000403 /* Select next weapon */ +#define DIBUTTON_HUNTING_BINOCULAR 0x0D000404 /* Look through Binoculars */ +#define DIBUTTON_HUNTING_CALL 0x0D000405 /* Make animal call */ +#define DIBUTTON_HUNTING_MAP 0x0D000406 /* View Map */ +#define DIBUTTON_HUNTING_SPECIAL 0x0D000407 /* Special game operation */ +#define DIBUTTON_HUNTING_MENU 0x0D0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_HUNTING_GLANCE 0x0D004601 /* Look around */ +#define DIBUTTON_HUNTING_DISPLAY 0x0D004408 /* show next on-screen display option */ +#define DIAXIS_HUNTING_ROTATE 0x0D024203 /* Turn body left/right */ +#define DIBUTTON_HUNTING_CROUCH 0x0D004409 /* Crouch/ Climb / Swim down */ +#define DIBUTTON_HUNTING_JUMP 0x0D00440A /* Jump/ Climb up / Swim up */ +#define DIBUTTON_HUNTING_FIRESECONDARY 0x0D00440B /* Alternative fire button */ +#define DIBUTTON_HUNTING_LEFT_LINK 0x0D00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_HUNTING_RIGHT_LINK 0x0D00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_HUNTING_FORWARD_LINK 0x0D0144E0 /* Fallback move forward button */ +#define DIBUTTON_HUNTING_BACK_LINK 0x0D0144E8 /* Fallback move back button */ +#define DIBUTTON_HUNTING_ROTATE_LEFT_LINK 0x0D0244E4 /* Fallback turn body left button */ +#define DIBUTTON_HUNTING_ROTATE_RIGHT_LINK 0x0D0244EC /* Fallback turn body right button */ +#define DIBUTTON_HUNTING_DEVICE 0x0D0044FE /* Show input device and controls */ +#define DIBUTTON_HUNTING_PAUSE 0x0D0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Fishing + Catching Fish is primary objective ---*/ +#define DIVIRTUAL_SPORTS_FISHING 0x0E000000 +#define DIAXIS_FISHING_LATERAL 0x0E008201 /* sidestep left/right */ +#define DIAXIS_FISHING_MOVE 0x0E010202 /* move forward/backwards */ +#define DIBUTTON_FISHING_CAST 0x0E000401 /* Cast line */ +#define DIBUTTON_FISHING_TYPE 0x0E000402 /* Select cast type */ +#define DIBUTTON_FISHING_BINOCULAR 0x0E000403 /* Look through Binocular */ +#define DIBUTTON_FISHING_BAIT 0x0E000404 /* Select type of Bait */ +#define DIBUTTON_FISHING_MAP 0x0E000405 /* View Map */ +#define DIBUTTON_FISHING_MENU 0x0E0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_FISHING_GLANCE 0x0E004601 /* Look around */ +#define DIBUTTON_FISHING_DISPLAY 0x0E004406 /* Show next on-screen display option */ +#define DIAXIS_FISHING_ROTATE 0x0E024203 /* Turn character left / right */ +#define DIBUTTON_FISHING_CROUCH 0x0E004407 /* Crouch/ Climb / Swim down */ +#define DIBUTTON_FISHING_JUMP 0x0E004408 /* Jump/ Climb up / Swim up */ +#define DIBUTTON_FISHING_LEFT_LINK 0x0E00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_FISHING_RIGHT_LINK 0x0E00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_FISHING_FORWARD_LINK 0x0E0144E0 /* Fallback move forward button */ +#define DIBUTTON_FISHING_BACK_LINK 0x0E0144E8 /* Fallback move back button */ +#define DIBUTTON_FISHING_ROTATE_LEFT_LINK 0x0E0244E4 /* Fallback turn body left button */ +#define DIBUTTON_FISHING_ROTATE_RIGHT_LINK 0x0E0244EC /* Fallback turn body right button */ +#define DIBUTTON_FISHING_DEVICE 0x0E0044FE /* Show input device and controls */ +#define DIBUTTON_FISHING_PAUSE 0x0E0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Baseball - Batting + Batter control is primary objective ---*/ +#define DIVIRTUAL_SPORTS_BASEBALL_BAT 0x0F000000 +#define DIAXIS_BASEBALLB_LATERAL 0x0F008201 /* Aim left / right */ +#define DIAXIS_BASEBALLB_MOVE 0x0F010202 /* Aim up / down */ +#define DIBUTTON_BASEBALLB_SELECT 0x0F000401 /* cycle through swing options */ +#define DIBUTTON_BASEBALLB_NORMAL 0x0F000402 /* normal swing */ +#define DIBUTTON_BASEBALLB_POWER 0x0F000403 /* swing for the fence */ +#define DIBUTTON_BASEBALLB_BUNT 0x0F000404 /* bunt */ +#define DIBUTTON_BASEBALLB_STEAL 0x0F000405 /* Base runner attempts to steal a base */ +#define DIBUTTON_BASEBALLB_BURST 0x0F000406 /* Base runner invokes burst of speed */ +#define DIBUTTON_BASEBALLB_SLIDE 0x0F000407 /* Base runner slides into base */ +#define DIBUTTON_BASEBALLB_CONTACT 0x0F000408 /* Contact swing */ +#define DIBUTTON_BASEBALLB_MENU 0x0F0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_BASEBALLB_NOSTEAL 0x0F004409 /* Base runner goes back to a base */ +#define DIBUTTON_BASEBALLB_BOX 0x0F00440A /* Enter or exit batting box */ +#define DIBUTTON_BASEBALLB_LEFT_LINK 0x0F00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_BASEBALLB_RIGHT_LINK 0x0F00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_BASEBALLB_FORWARD_LINK 0x0F0144E0 /* Fallback move forward button */ +#define DIBUTTON_BASEBALLB_BACK_LINK 0x0F0144E8 /* Fallback move back button */ +#define DIBUTTON_BASEBALLB_DEVICE 0x0F0044FE /* Show input device and controls */ +#define DIBUTTON_BASEBALLB_PAUSE 0x0F0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Baseball - Pitching + Pitcher control is primary objective ---*/ +#define DIVIRTUAL_SPORTS_BASEBALL_PITCH 0x10000000 +#define DIAXIS_BASEBALLP_LATERAL 0x10008201 /* Aim left / right */ +#define DIAXIS_BASEBALLP_MOVE 0x10010202 /* Aim up / down */ +#define DIBUTTON_BASEBALLP_SELECT 0x10000401 /* cycle through pitch selections */ +#define DIBUTTON_BASEBALLP_PITCH 0x10000402 /* throw pitch */ +#define DIBUTTON_BASEBALLP_BASE 0x10000403 /* select base to throw to */ +#define DIBUTTON_BASEBALLP_THROW 0x10000404 /* throw to base */ +#define DIBUTTON_BASEBALLP_FAKE 0x10000405 /* Fake a throw to a base */ +#define DIBUTTON_BASEBALLP_MENU 0x100004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_BASEBALLP_WALK 0x10004406 /* Throw intentional walk / pitch out */ +#define DIBUTTON_BASEBALLP_LOOK 0x10004407 /* Look at runners on bases */ +#define DIBUTTON_BASEBALLP_LEFT_LINK 0x1000C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_BASEBALLP_RIGHT_LINK 0x1000C4EC /* Fallback sidestep right button */ +#define DIBUTTON_BASEBALLP_FORWARD_LINK 0x100144E0 /* Fallback move forward button */ +#define DIBUTTON_BASEBALLP_BACK_LINK 0x100144E8 /* Fallback move back button */ +#define DIBUTTON_BASEBALLP_DEVICE 0x100044FE /* Show input device and controls */ +#define DIBUTTON_BASEBALLP_PAUSE 0x100044FC /* Start / Pause / Restart game */ + +/*--- Sports - Baseball - Fielding + Fielder control is primary objective ---*/ +#define DIVIRTUAL_SPORTS_BASEBALL_FIELD 0x11000000 +#define DIAXIS_BASEBALLF_LATERAL 0x11008201 /* Aim left / right */ +#define DIAXIS_BASEBALLF_MOVE 0x11010202 /* Aim up / down */ +#define DIBUTTON_BASEBALLF_NEAREST 0x11000401 /* Switch to fielder nearest to the ball */ +#define DIBUTTON_BASEBALLF_THROW1 0x11000402 /* Make conservative throw */ +#define DIBUTTON_BASEBALLF_THROW2 0x11000403 /* Make aggressive throw */ +#define DIBUTTON_BASEBALLF_BURST 0x11000404 /* Invoke burst of speed */ +#define DIBUTTON_BASEBALLF_JUMP 0x11000405 /* Jump to catch ball */ +#define DIBUTTON_BASEBALLF_DIVE 0x11000406 /* Dive to catch ball */ +#define DIBUTTON_BASEBALLF_MENU 0x110004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_BASEBALLF_SHIFTIN 0x11004407 /* Shift the infield positioning */ +#define DIBUTTON_BASEBALLF_SHIFTOUT 0x11004408 /* Shift the outfield positioning */ +#define DIBUTTON_BASEBALLF_AIM_LEFT_LINK 0x1100C4E4 /* Fallback aim left button */ +#define DIBUTTON_BASEBALLF_AIM_RIGHT_LINK 0x1100C4EC /* Fallback aim right button */ +#define DIBUTTON_BASEBALLF_FORWARD_LINK 0x110144E0 /* Fallback move forward button */ +#define DIBUTTON_BASEBALLF_BACK_LINK 0x110144E8 /* Fallback move back button */ +#define DIBUTTON_BASEBALLF_DEVICE 0x110044FE /* Show input device and controls */ +#define DIBUTTON_BASEBALLF_PAUSE 0x110044FC /* Start / Pause / Restart game */ + +/*--- Sports - Basketball - Offense + Offense ---*/ +#define DIVIRTUAL_SPORTS_BASKETBALL_OFFENSE 0x12000000 +#define DIAXIS_BBALLO_LATERAL 0x12008201 /* left / right */ +#define DIAXIS_BBALLO_MOVE 0x12010202 /* up / down */ +#define DIBUTTON_BBALLO_SHOOT 0x12000401 /* shoot basket */ +#define DIBUTTON_BBALLO_DUNK 0x12000402 /* dunk basket */ +#define DIBUTTON_BBALLO_PASS 0x12000403 /* throw pass */ +#define DIBUTTON_BBALLO_FAKE 0x12000404 /* fake shot or pass */ +#define DIBUTTON_BBALLO_SPECIAL 0x12000405 /* apply special move */ +#define DIBUTTON_BBALLO_PLAYER 0x12000406 /* select next player */ +#define DIBUTTON_BBALLO_BURST 0x12000407 /* invoke burst */ +#define DIBUTTON_BBALLO_CALL 0x12000408 /* call for ball / pass to me */ +#define DIBUTTON_BBALLO_MENU 0x120004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_BBALLO_GLANCE 0x12004601 /* scroll view */ +#define DIBUTTON_BBALLO_SCREEN 0x12004409 /* Call for screen */ +#define DIBUTTON_BBALLO_PLAY 0x1200440A /* Call for specific offensive play */ +#define DIBUTTON_BBALLO_JAB 0x1200440B /* Initiate fake drive to basket */ +#define DIBUTTON_BBALLO_POST 0x1200440C /* Perform post move */ +#define DIBUTTON_BBALLO_TIMEOUT 0x1200440D /* Time Out */ +#define DIBUTTON_BBALLO_SUBSTITUTE 0x1200440E /* substitute one player for another */ +#define DIBUTTON_BBALLO_LEFT_LINK 0x1200C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_BBALLO_RIGHT_LINK 0x1200C4EC /* Fallback sidestep right button */ +#define DIBUTTON_BBALLO_FORWARD_LINK 0x120144E0 /* Fallback move forward button */ +#define DIBUTTON_BBALLO_BACK_LINK 0x120144E8 /* Fallback move back button */ +#define DIBUTTON_BBALLO_DEVICE 0x120044FE /* Show input device and controls */ +#define DIBUTTON_BBALLO_PAUSE 0x120044FC /* Start / Pause / Restart game */ + +/*--- Sports - Basketball - Defense + Defense ---*/ +#define DIVIRTUAL_SPORTS_BASKETBALL_DEFENSE 0x13000000 +#define DIAXIS_BBALLD_LATERAL 0x13008201 /* left / right */ +#define DIAXIS_BBALLD_MOVE 0x13010202 /* up / down */ +#define DIBUTTON_BBALLD_JUMP 0x13000401 /* jump to block shot */ +#define DIBUTTON_BBALLD_STEAL 0x13000402 /* attempt to steal ball */ +#define DIBUTTON_BBALLD_FAKE 0x13000403 /* fake block or steal */ +#define DIBUTTON_BBALLD_SPECIAL 0x13000404 /* apply special move */ +#define DIBUTTON_BBALLD_PLAYER 0x13000405 /* select next player */ +#define DIBUTTON_BBALLD_BURST 0x13000406 /* invoke burst */ +#define DIBUTTON_BBALLD_PLAY 0x13000407 /* call for specific defensive play */ +#define DIBUTTON_BBALLD_MENU 0x130004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_BBALLD_GLANCE 0x13004601 /* scroll view */ +#define DIBUTTON_BBALLD_TIMEOUT 0x13004408 /* Time Out */ +#define DIBUTTON_BBALLD_SUBSTITUTE 0x13004409 /* substitute one player for another */ +#define DIBUTTON_BBALLD_LEFT_LINK 0x1300C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_BBALLD_RIGHT_LINK 0x1300C4EC /* Fallback sidestep right button */ +#define DIBUTTON_BBALLD_FORWARD_LINK 0x130144E0 /* Fallback move forward button */ +#define DIBUTTON_BBALLD_BACK_LINK 0x130144E8 /* Fallback move back button */ +#define DIBUTTON_BBALLD_DEVICE 0x130044FE /* Show input device and controls */ +#define DIBUTTON_BBALLD_PAUSE 0x130044FC /* Start / Pause / Restart game */ + +/*--- Sports - Football - Play + Play selection ---*/ +#define DIVIRTUAL_SPORTS_FOOTBALL_FIELD 0x14000000 +#define DIBUTTON_FOOTBALLP_PLAY 0x14000401 /* cycle through available plays */ +#define DIBUTTON_FOOTBALLP_SELECT 0x14000402 /* select play */ +#define DIBUTTON_FOOTBALLP_HELP 0x14000403 /* Bring up pop-up help */ +#define DIBUTTON_FOOTBALLP_MENU 0x140004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_FOOTBALLP_DEVICE 0x140044FE /* Show input device and controls */ +#define DIBUTTON_FOOTBALLP_PAUSE 0x140044FC /* Start / Pause / Restart game */ + +/*--- Sports - Football - QB + Offense: Quarterback / Kicker ---*/ +#define DIVIRTUAL_SPORTS_FOOTBALL_QBCK 0x15000000 +#define DIAXIS_FOOTBALLQ_LATERAL 0x15008201 /* Move / Aim: left / right */ +#define DIAXIS_FOOTBALLQ_MOVE 0x15010202 /* Move / Aim: up / down */ +#define DIBUTTON_FOOTBALLQ_SELECT 0x15000401 /* Select */ +#define DIBUTTON_FOOTBALLQ_SNAP 0x15000402 /* snap ball - start play */ +#define DIBUTTON_FOOTBALLQ_JUMP 0x15000403 /* jump over defender */ +#define DIBUTTON_FOOTBALLQ_SLIDE 0x15000404 /* Dive/Slide */ +#define DIBUTTON_FOOTBALLQ_PASS 0x15000405 /* throws pass to receiver */ +#define DIBUTTON_FOOTBALLQ_FAKE 0x15000406 /* pump fake pass or fake kick */ +#define DIBUTTON_FOOTBALLQ_MENU 0x150004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_FOOTBALLQ_FAKESNAP 0x15004407 /* Fake snap */ +#define DIBUTTON_FOOTBALLQ_MOTION 0x15004408 /* Send receivers in motion */ +#define DIBUTTON_FOOTBALLQ_AUDIBLE 0x15004409 /* Change offensive play at line of scrimmage */ +#define DIBUTTON_FOOTBALLQ_LEFT_LINK 0x1500C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_FOOTBALLQ_RIGHT_LINK 0x1500C4EC /* Fallback sidestep right button */ +#define DIBUTTON_FOOTBALLQ_FORWARD_LINK 0x150144E0 /* Fallback move forward button */ +#define DIBUTTON_FOOTBALLQ_BACK_LINK 0x150144E8 /* Fallback move back button */ +#define DIBUTTON_FOOTBALLQ_DEVICE 0x150044FE /* Show input device and controls */ +#define DIBUTTON_FOOTBALLQ_PAUSE 0x150044FC /* Start / Pause / Restart game */ + +/*--- Sports - Football - Offense + Offense - Runner ---*/ +#define DIVIRTUAL_SPORTS_FOOTBALL_OFFENSE 0x16000000 +#define DIAXIS_FOOTBALLO_LATERAL 0x16008201 /* Move / Aim: left / right */ +#define DIAXIS_FOOTBALLO_MOVE 0x16010202 /* Move / Aim: up / down */ +#define DIBUTTON_FOOTBALLO_JUMP 0x16000401 /* jump or hurdle over defender */ +#define DIBUTTON_FOOTBALLO_LEFTARM 0x16000402 /* holds out left arm */ +#define DIBUTTON_FOOTBALLO_RIGHTARM 0x16000403 /* holds out right arm */ +#define DIBUTTON_FOOTBALLO_THROW 0x16000404 /* throw pass or lateral ball to another runner */ +#define DIBUTTON_FOOTBALLO_SPIN 0x16000405 /* Spin to avoid defenders */ +#define DIBUTTON_FOOTBALLO_MENU 0x160004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_FOOTBALLO_JUKE 0x16004406 /* Use special move to avoid defenders */ +#define DIBUTTON_FOOTBALLO_SHOULDER 0x16004407 /* Lower shoulder to run over defenders */ +#define DIBUTTON_FOOTBALLO_TURBO 0x16004408 /* Speed burst past defenders */ +#define DIBUTTON_FOOTBALLO_DIVE 0x16004409 /* Dive over defenders */ +#define DIBUTTON_FOOTBALLO_ZOOM 0x1600440A /* Zoom view in / out */ +#define DIBUTTON_FOOTBALLO_SUBSTITUTE 0x1600440B /* substitute one player for another */ +#define DIBUTTON_FOOTBALLO_LEFT_LINK 0x1600C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_FOOTBALLO_RIGHT_LINK 0x1600C4EC /* Fallback sidestep right button */ +#define DIBUTTON_FOOTBALLO_FORWARD_LINK 0x160144E0 /* Fallback move forward button */ +#define DIBUTTON_FOOTBALLO_BACK_LINK 0x160144E8 /* Fallback move back button */ +#define DIBUTTON_FOOTBALLO_DEVICE 0x160044FE /* Show input device and controls */ +#define DIBUTTON_FOOTBALLO_PAUSE 0x160044FC /* Start / Pause / Restart game */ + +/*--- Sports - Football - Defense + Defense ---*/ +#define DIVIRTUAL_SPORTS_FOOTBALL_DEFENSE 0x17000000 +#define DIAXIS_FOOTBALLD_LATERAL 0x17008201 /* Move / Aim: left / right */ +#define DIAXIS_FOOTBALLD_MOVE 0x17010202 /* Move / Aim: up / down */ +#define DIBUTTON_FOOTBALLD_PLAY 0x17000401 /* cycle through available plays */ +#define DIBUTTON_FOOTBALLD_SELECT 0x17000402 /* select player closest to the ball */ +#define DIBUTTON_FOOTBALLD_JUMP 0x17000403 /* jump to intercept or block */ +#define DIBUTTON_FOOTBALLD_TACKLE 0x17000404 /* tackler runner */ +#define DIBUTTON_FOOTBALLD_FAKE 0x17000405 /* hold down to fake tackle or intercept */ +#define DIBUTTON_FOOTBALLD_SUPERTACKLE 0x17000406 /* Initiate special tackle */ +#define DIBUTTON_FOOTBALLD_MENU 0x170004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_FOOTBALLD_SPIN 0x17004407 /* Spin to beat offensive line */ +#define DIBUTTON_FOOTBALLD_SWIM 0x17004408 /* Swim to beat the offensive line */ +#define DIBUTTON_FOOTBALLD_BULLRUSH 0x17004409 /* Bull rush the offensive line */ +#define DIBUTTON_FOOTBALLD_RIP 0x1700440A /* Rip the offensive line */ +#define DIBUTTON_FOOTBALLD_AUDIBLE 0x1700440B /* Change defensive play at the line of scrimmage */ +#define DIBUTTON_FOOTBALLD_ZOOM 0x1700440C /* Zoom view in / out */ +#define DIBUTTON_FOOTBALLD_SUBSTITUTE 0x1700440D /* substitute one player for another */ +#define DIBUTTON_FOOTBALLD_LEFT_LINK 0x1700C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_FOOTBALLD_RIGHT_LINK 0x1700C4EC /* Fallback sidestep right button */ +#define DIBUTTON_FOOTBALLD_FORWARD_LINK 0x170144E0 /* Fallback move forward button */ +#define DIBUTTON_FOOTBALLD_BACK_LINK 0x170144E8 /* Fallback move back button */ +#define DIBUTTON_FOOTBALLD_DEVICE 0x170044FE /* Show input device and controls */ +#define DIBUTTON_FOOTBALLD_PAUSE 0x170044FC /* Start / Pause / Restart game */ + +/*--- Sports - Golf + ---*/ +#define DIVIRTUAL_SPORTS_GOLF 0x18000000 +#define DIAXIS_GOLF_LATERAL 0x18008201 /* Move / Aim: left / right */ +#define DIAXIS_GOLF_MOVE 0x18010202 /* Move / Aim: up / down */ +#define DIBUTTON_GOLF_SWING 0x18000401 /* swing club */ +#define DIBUTTON_GOLF_SELECT 0x18000402 /* cycle between: club / swing strength / ball arc / ball spin */ +#define DIBUTTON_GOLF_UP 0x18000403 /* increase selection */ +#define DIBUTTON_GOLF_DOWN 0x18000404 /* decrease selection */ +#define DIBUTTON_GOLF_TERRAIN 0x18000405 /* shows terrain detail */ +#define DIBUTTON_GOLF_FLYBY 0x18000406 /* view the hole via a flyby */ +#define DIBUTTON_GOLF_MENU 0x180004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_GOLF_SCROLL 0x18004601 /* scroll view */ +#define DIBUTTON_GOLF_ZOOM 0x18004407 /* Zoom view in / out */ +#define DIBUTTON_GOLF_TIMEOUT 0x18004408 /* Call for time out */ +#define DIBUTTON_GOLF_SUBSTITUTE 0x18004409 /* substitute one player for another */ +#define DIBUTTON_GOLF_LEFT_LINK 0x1800C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_GOLF_RIGHT_LINK 0x1800C4EC /* Fallback sidestep right button */ +#define DIBUTTON_GOLF_FORWARD_LINK 0x180144E0 /* Fallback move forward button */ +#define DIBUTTON_GOLF_BACK_LINK 0x180144E8 /* Fallback move back button */ +#define DIBUTTON_GOLF_DEVICE 0x180044FE /* Show input device and controls */ +#define DIBUTTON_GOLF_PAUSE 0x180044FC /* Start / Pause / Restart game */ + +/*--- Sports - Hockey - Offense + Offense ---*/ +#define DIVIRTUAL_SPORTS_HOCKEY_OFFENSE 0x19000000 +#define DIAXIS_HOCKEYO_LATERAL 0x19008201 /* Move / Aim: left / right */ +#define DIAXIS_HOCKEYO_MOVE 0x19010202 /* Move / Aim: up / down */ +#define DIBUTTON_HOCKEYO_SHOOT 0x19000401 /* Shoot */ +#define DIBUTTON_HOCKEYO_PASS 0x19000402 /* pass the puck */ +#define DIBUTTON_HOCKEYO_BURST 0x19000403 /* invoke speed burst */ +#define DIBUTTON_HOCKEYO_SPECIAL 0x19000404 /* invoke special move */ +#define DIBUTTON_HOCKEYO_FAKE 0x19000405 /* hold down to fake pass or kick */ +#define DIBUTTON_HOCKEYO_MENU 0x190004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_HOCKEYO_SCROLL 0x19004601 /* scroll view */ +#define DIBUTTON_HOCKEYO_ZOOM 0x19004406 /* Zoom view in / out */ +#define DIBUTTON_HOCKEYO_STRATEGY 0x19004407 /* Invoke coaching menu for strategy help */ +#define DIBUTTON_HOCKEYO_TIMEOUT 0x19004408 /* Call for time out */ +#define DIBUTTON_HOCKEYO_SUBSTITUTE 0x19004409 /* substitute one player for another */ +#define DIBUTTON_HOCKEYO_LEFT_LINK 0x1900C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_HOCKEYO_RIGHT_LINK 0x1900C4EC /* Fallback sidestep right button */ +#define DIBUTTON_HOCKEYO_FORWARD_LINK 0x190144E0 /* Fallback move forward button */ +#define DIBUTTON_HOCKEYO_BACK_LINK 0x190144E8 /* Fallback move back button */ +#define DIBUTTON_HOCKEYO_DEVICE 0x190044FE /* Show input device and controls */ +#define DIBUTTON_HOCKEYO_PAUSE 0x190044FC /* Start / Pause / Restart game */ + +/*--- Sports - Hockey - Defense + Defense ---*/ +#define DIVIRTUAL_SPORTS_HOCKEY_DEFENSE 0x1A000000 +#define DIAXIS_HOCKEYD_LATERAL 0x1A008201 /* Move / Aim: left / right */ +#define DIAXIS_HOCKEYD_MOVE 0x1A010202 /* Move / Aim: up / down */ +#define DIBUTTON_HOCKEYD_PLAYER 0x1A000401 /* control player closest to the puck */ +#define DIBUTTON_HOCKEYD_STEAL 0x1A000402 /* attempt steal */ +#define DIBUTTON_HOCKEYD_BURST 0x1A000403 /* speed burst or body check */ +#define DIBUTTON_HOCKEYD_BLOCK 0x1A000404 /* block puck */ +#define DIBUTTON_HOCKEYD_FAKE 0x1A000405 /* hold down to fake tackle or intercept */ +#define DIBUTTON_HOCKEYD_MENU 0x1A0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_HOCKEYD_SCROLL 0x1A004601 /* scroll view */ +#define DIBUTTON_HOCKEYD_ZOOM 0x1A004406 /* Zoom view in / out */ +#define DIBUTTON_HOCKEYD_STRATEGY 0x1A004407 /* Invoke coaching menu for strategy help */ +#define DIBUTTON_HOCKEYD_TIMEOUT 0x1A004408 /* Call for time out */ +#define DIBUTTON_HOCKEYD_SUBSTITUTE 0x1A004409 /* substitute one player for another */ +#define DIBUTTON_HOCKEYD_LEFT_LINK 0x1A00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_HOCKEYD_RIGHT_LINK 0x1A00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_HOCKEYD_FORWARD_LINK 0x1A0144E0 /* Fallback move forward button */ +#define DIBUTTON_HOCKEYD_BACK_LINK 0x1A0144E8 /* Fallback move back button */ +#define DIBUTTON_HOCKEYD_DEVICE 0x1A0044FE /* Show input device and controls */ +#define DIBUTTON_HOCKEYD_PAUSE 0x1A0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Hockey - Goalie + Goal tending ---*/ +#define DIVIRTUAL_SPORTS_HOCKEY_GOALIE 0x1B000000 +#define DIAXIS_HOCKEYG_LATERAL 0x1B008201 /* Move / Aim: left / right */ +#define DIAXIS_HOCKEYG_MOVE 0x1B010202 /* Move / Aim: up / down */ +#define DIBUTTON_HOCKEYG_PASS 0x1B000401 /* pass puck */ +#define DIBUTTON_HOCKEYG_POKE 0x1B000402 /* poke / check / hack */ +#define DIBUTTON_HOCKEYG_STEAL 0x1B000403 /* attempt steal */ +#define DIBUTTON_HOCKEYG_BLOCK 0x1B000404 /* block puck */ +#define DIBUTTON_HOCKEYG_MENU 0x1B0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_HOCKEYG_SCROLL 0x1B004601 /* scroll view */ +#define DIBUTTON_HOCKEYG_ZOOM 0x1B004405 /* Zoom view in / out */ +#define DIBUTTON_HOCKEYG_STRATEGY 0x1B004406 /* Invoke coaching menu for strategy help */ +#define DIBUTTON_HOCKEYG_TIMEOUT 0x1B004407 /* Call for time out */ +#define DIBUTTON_HOCKEYG_SUBSTITUTE 0x1B004408 /* substitute one player for another */ +#define DIBUTTON_HOCKEYG_LEFT_LINK 0x1B00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_HOCKEYG_RIGHT_LINK 0x1B00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_HOCKEYG_FORWARD_LINK 0x1B0144E0 /* Fallback move forward button */ +#define DIBUTTON_HOCKEYG_BACK_LINK 0x1B0144E8 /* Fallback move back button */ +#define DIBUTTON_HOCKEYG_DEVICE 0x1B0044FE /* Show input device and controls */ +#define DIBUTTON_HOCKEYG_PAUSE 0x1B0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Mountain Biking + ---*/ +#define DIVIRTUAL_SPORTS_BIKING_MOUNTAIN 0x1C000000 +#define DIAXIS_BIKINGM_TURN 0x1C008201 /* left / right */ +#define DIAXIS_BIKINGM_PEDAL 0x1C010202 /* Pedal faster / slower / brake */ +#define DIBUTTON_BIKINGM_JUMP 0x1C000401 /* jump over obstacle */ +#define DIBUTTON_BIKINGM_CAMERA 0x1C000402 /* switch camera view */ +#define DIBUTTON_BIKINGM_SPECIAL1 0x1C000403 /* perform first special move */ +#define DIBUTTON_BIKINGM_SELECT 0x1C000404 /* Select */ +#define DIBUTTON_BIKINGM_SPECIAL2 0x1C000405 /* perform second special move */ +#define DIBUTTON_BIKINGM_MENU 0x1C0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_BIKINGM_SCROLL 0x1C004601 /* scroll view */ +#define DIBUTTON_BIKINGM_ZOOM 0x1C004406 /* Zoom view in / out */ +#define DIAXIS_BIKINGM_BRAKE 0x1C044203 /* Brake axis */ +#define DIBUTTON_BIKINGM_LEFT_LINK 0x1C00C4E4 /* Fallback turn left button */ +#define DIBUTTON_BIKINGM_RIGHT_LINK 0x1C00C4EC /* Fallback turn right button */ +#define DIBUTTON_BIKINGM_FASTER_LINK 0x1C0144E0 /* Fallback pedal faster button */ +#define DIBUTTON_BIKINGM_SLOWER_LINK 0x1C0144E8 /* Fallback pedal slower button */ +#define DIBUTTON_BIKINGM_BRAKE_BUTTON_LINK 0x1C0444E8 /* Fallback brake button */ +#define DIBUTTON_BIKINGM_DEVICE 0x1C0044FE /* Show input device and controls */ +#define DIBUTTON_BIKINGM_PAUSE 0x1C0044FC /* Start / Pause / Restart game */ + +/*--- Sports: Skiing / Snowboarding / Skateboarding + ---*/ +#define DIVIRTUAL_SPORTS_SKIING 0x1D000000 +#define DIAXIS_SKIING_TURN 0x1D008201 /* left / right */ +#define DIAXIS_SKIING_SPEED 0x1D010202 /* faster / slower */ +#define DIBUTTON_SKIING_JUMP 0x1D000401 /* Jump */ +#define DIBUTTON_SKIING_CROUCH 0x1D000402 /* crouch down */ +#define DIBUTTON_SKIING_CAMERA 0x1D000403 /* switch camera view */ +#define DIBUTTON_SKIING_SPECIAL1 0x1D000404 /* perform first special move */ +#define DIBUTTON_SKIING_SELECT 0x1D000405 /* Select */ +#define DIBUTTON_SKIING_SPECIAL2 0x1D000406 /* perform second special move */ +#define DIBUTTON_SKIING_MENU 0x1D0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_SKIING_GLANCE 0x1D004601 /* scroll view */ +#define DIBUTTON_SKIING_ZOOM 0x1D004407 /* Zoom view in / out */ +#define DIBUTTON_SKIING_LEFT_LINK 0x1D00C4E4 /* Fallback turn left button */ +#define DIBUTTON_SKIING_RIGHT_LINK 0x1D00C4EC /* Fallback turn right button */ +#define DIBUTTON_SKIING_FASTER_LINK 0x1D0144E0 /* Fallback increase speed button */ +#define DIBUTTON_SKIING_SLOWER_LINK 0x1D0144E8 /* Fallback decrease speed button */ +#define DIBUTTON_SKIING_DEVICE 0x1D0044FE /* Show input device and controls */ +#define DIBUTTON_SKIING_PAUSE 0x1D0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Soccer - Offense + Offense ---*/ +#define DIVIRTUAL_SPORTS_SOCCER_OFFENSE 0x1E000000 +#define DIAXIS_SOCCERO_LATERAL 0x1E008201 /* Move / Aim: left / right */ +#define DIAXIS_SOCCERO_MOVE 0x1E010202 /* Move / Aim: up / down */ +#define DIAXIS_SOCCERO_BEND 0x1E018203 /* Bend to soccer shot/pass */ +#define DIBUTTON_SOCCERO_SHOOT 0x1E000401 /* Shoot the ball */ +#define DIBUTTON_SOCCERO_PASS 0x1E000402 /* Pass */ +#define DIBUTTON_SOCCERO_FAKE 0x1E000403 /* Fake */ +#define DIBUTTON_SOCCERO_PLAYER 0x1E000404 /* Select next player */ +#define DIBUTTON_SOCCERO_SPECIAL1 0x1E000405 /* Apply special move */ +#define DIBUTTON_SOCCERO_SELECT 0x1E000406 /* Select special move */ +#define DIBUTTON_SOCCERO_MENU 0x1E0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_SOCCERO_GLANCE 0x1E004601 /* scroll view */ +#define DIBUTTON_SOCCERO_SUBSTITUTE 0x1E004407 /* Substitute one player for another */ +#define DIBUTTON_SOCCERO_SHOOTLOW 0x1E004408 /* Shoot the ball low */ +#define DIBUTTON_SOCCERO_SHOOTHIGH 0x1E004409 /* Shoot the ball high */ +#define DIBUTTON_SOCCERO_PASSTHRU 0x1E00440A /* Make a thru pass */ +#define DIBUTTON_SOCCERO_SPRINT 0x1E00440B /* Sprint / turbo boost */ +#define DIBUTTON_SOCCERO_CONTROL 0x1E00440C /* Obtain control of the ball */ +#define DIBUTTON_SOCCERO_HEAD 0x1E00440D /* Attempt to head the ball */ +#define DIBUTTON_SOCCERO_LEFT_LINK 0x1E00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_SOCCERO_RIGHT_LINK 0x1E00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_SOCCERO_FORWARD_LINK 0x1E0144E0 /* Fallback move forward button */ +#define DIBUTTON_SOCCERO_BACK_LINK 0x1E0144E8 /* Fallback move back button */ +#define DIBUTTON_SOCCERO_DEVICE 0x1E0044FE /* Show input device and controls */ +#define DIBUTTON_SOCCERO_PAUSE 0x1E0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Soccer - Defense + Defense ---*/ +#define DIVIRTUAL_SPORTS_SOCCER_DEFENSE 0x1F000000 +#define DIAXIS_SOCCERD_LATERAL 0x1F008201 /* Move / Aim: left / right */ +#define DIAXIS_SOCCERD_MOVE 0x1F010202 /* Move / Aim: up / down */ +#define DIBUTTON_SOCCERD_BLOCK 0x1F000401 /* Attempt to block shot */ +#define DIBUTTON_SOCCERD_STEAL 0x1F000402 /* Attempt to steal ball */ +#define DIBUTTON_SOCCERD_FAKE 0x1F000403 /* Fake a block or a steal */ +#define DIBUTTON_SOCCERD_PLAYER 0x1F000404 /* Select next player */ +#define DIBUTTON_SOCCERD_SPECIAL 0x1F000405 /* Apply special move */ +#define DIBUTTON_SOCCERD_SELECT 0x1F000406 /* Select special move */ +#define DIBUTTON_SOCCERD_SLIDE 0x1F000407 /* Attempt a slide tackle */ +#define DIBUTTON_SOCCERD_MENU 0x1F0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_SOCCERD_GLANCE 0x1F004601 /* scroll view */ +#define DIBUTTON_SOCCERD_FOUL 0x1F004408 /* Initiate a foul / hard-foul */ +#define DIBUTTON_SOCCERD_HEAD 0x1F004409 /* Attempt a Header */ +#define DIBUTTON_SOCCERD_CLEAR 0x1F00440A /* Attempt to clear the ball down the field */ +#define DIBUTTON_SOCCERD_GOALIECHARGE 0x1F00440B /* Make the goalie charge out of the box */ +#define DIBUTTON_SOCCERD_SUBSTITUTE 0x1F00440C /* Substitute one player for another */ +#define DIBUTTON_SOCCERD_LEFT_LINK 0x1F00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_SOCCERD_RIGHT_LINK 0x1F00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_SOCCERD_FORWARD_LINK 0x1F0144E0 /* Fallback move forward button */ +#define DIBUTTON_SOCCERD_BACK_LINK 0x1F0144E8 /* Fallback move back button */ +#define DIBUTTON_SOCCERD_DEVICE 0x1F0044FE /* Show input device and controls */ +#define DIBUTTON_SOCCERD_PAUSE 0x1F0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Racquet + Tennis - Table-Tennis - Squash ---*/ +#define DIVIRTUAL_SPORTS_RACQUET 0x20000000 +#define DIAXIS_RACQUET_LATERAL 0x20008201 /* Move / Aim: left / right */ +#define DIAXIS_RACQUET_MOVE 0x20010202 /* Move / Aim: up / down */ +#define DIBUTTON_RACQUET_SWING 0x20000401 /* Swing racquet */ +#define DIBUTTON_RACQUET_BACKSWING 0x20000402 /* Swing backhand */ +#define DIBUTTON_RACQUET_SMASH 0x20000403 /* Smash shot */ +#define DIBUTTON_RACQUET_SPECIAL 0x20000404 /* Special shot */ +#define DIBUTTON_RACQUET_SELECT 0x20000405 /* Select special shot */ +#define DIBUTTON_RACQUET_MENU 0x200004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_RACQUET_GLANCE 0x20004601 /* scroll view */ +#define DIBUTTON_RACQUET_TIMEOUT 0x20004406 /* Call for time out */ +#define DIBUTTON_RACQUET_SUBSTITUTE 0x20004407 /* Substitute one player for another */ +#define DIBUTTON_RACQUET_LEFT_LINK 0x2000C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_RACQUET_RIGHT_LINK 0x2000C4EC /* Fallback sidestep right button */ +#define DIBUTTON_RACQUET_FORWARD_LINK 0x200144E0 /* Fallback move forward button */ +#define DIBUTTON_RACQUET_BACK_LINK 0x200144E8 /* Fallback move back button */ +#define DIBUTTON_RACQUET_DEVICE 0x200044FE /* Show input device and controls */ +#define DIBUTTON_RACQUET_PAUSE 0x200044FC /* Start / Pause / Restart game */ + +/*--- Arcade- 2D + Side to Side movement ---*/ +#define DIVIRTUAL_ARCADE_SIDE2SIDE 0x21000000 +#define DIAXIS_ARCADES_LATERAL 0x21008201 /* left / right */ +#define DIAXIS_ARCADES_MOVE 0x21010202 /* up / down */ +#define DIBUTTON_ARCADES_THROW 0x21000401 /* throw object */ +#define DIBUTTON_ARCADES_CARRY 0x21000402 /* carry object */ +#define DIBUTTON_ARCADES_ATTACK 0x21000403 /* attack */ +#define DIBUTTON_ARCADES_SPECIAL 0x21000404 /* apply special move */ +#define DIBUTTON_ARCADES_SELECT 0x21000405 /* select special move */ +#define DIBUTTON_ARCADES_MENU 0x210004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_ARCADES_VIEW 0x21004601 /* scroll view left / right / up / down */ +#define DIBUTTON_ARCADES_LEFT_LINK 0x2100C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_ARCADES_RIGHT_LINK 0x2100C4EC /* Fallback sidestep right button */ +#define DIBUTTON_ARCADES_FORWARD_LINK 0x210144E0 /* Fallback move forward button */ +#define DIBUTTON_ARCADES_BACK_LINK 0x210144E8 /* Fallback move back button */ +#define DIBUTTON_ARCADES_VIEW_UP_LINK 0x2107C4E0 /* Fallback scroll view up button */ +#define DIBUTTON_ARCADES_VIEW_DOWN_LINK 0x2107C4E8 /* Fallback scroll view down button */ +#define DIBUTTON_ARCADES_VIEW_LEFT_LINK 0x2107C4E4 /* Fallback scroll view left button */ +#define DIBUTTON_ARCADES_VIEW_RIGHT_LINK 0x2107C4EC /* Fallback scroll view right button */ +#define DIBUTTON_ARCADES_DEVICE 0x210044FE /* Show input device and controls */ +#define DIBUTTON_ARCADES_PAUSE 0x210044FC /* Start / Pause / Restart game */ + +/*--- Arcade - Platform Game + Character moves around on screen ---*/ +#define DIVIRTUAL_ARCADE_PLATFORM 0x22000000 +#define DIAXIS_ARCADEP_LATERAL 0x22008201 /* Left / right */ +#define DIAXIS_ARCADEP_MOVE 0x22010202 /* Up / down */ +#define DIBUTTON_ARCADEP_JUMP 0x22000401 /* Jump */ +#define DIBUTTON_ARCADEP_FIRE 0x22000402 /* Fire */ +#define DIBUTTON_ARCADEP_CROUCH 0x22000403 /* Crouch */ +#define DIBUTTON_ARCADEP_SPECIAL 0x22000404 /* Apply special move */ +#define DIBUTTON_ARCADEP_SELECT 0x22000405 /* Select special move */ +#define DIBUTTON_ARCADEP_MENU 0x220004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_ARCADEP_VIEW 0x22004601 /* Scroll view */ +#define DIBUTTON_ARCADEP_FIRESECONDARY 0x22004406 /* Alternative fire button */ +#define DIBUTTON_ARCADEP_LEFT_LINK 0x2200C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_ARCADEP_RIGHT_LINK 0x2200C4EC /* Fallback sidestep right button */ +#define DIBUTTON_ARCADEP_FORWARD_LINK 0x220144E0 /* Fallback move forward button */ +#define DIBUTTON_ARCADEP_BACK_LINK 0x220144E8 /* Fallback move back button */ +#define DIBUTTON_ARCADEP_VIEW_UP_LINK 0x2207C4E0 /* Fallback scroll view up button */ +#define DIBUTTON_ARCADEP_VIEW_DOWN_LINK 0x2207C4E8 /* Fallback scroll view down button */ +#define DIBUTTON_ARCADEP_VIEW_LEFT_LINK 0x2207C4E4 /* Fallback scroll view left button */ +#define DIBUTTON_ARCADEP_VIEW_RIGHT_LINK 0x2207C4EC /* Fallback scroll view right button */ +#define DIBUTTON_ARCADEP_DEVICE 0x220044FE /* Show input device and controls */ +#define DIBUTTON_ARCADEP_PAUSE 0x220044FC /* Start / Pause / Restart game */ + +/*--- CAD - 2D Object Control + Controls to select and move objects in 2D ---*/ +#define DIVIRTUAL_CAD_2DCONTROL 0x23000000 +#define DIAXIS_2DCONTROL_LATERAL 0x23008201 /* Move view left / right */ +#define DIAXIS_2DCONTROL_MOVE 0x23010202 /* Move view up / down */ +#define DIAXIS_2DCONTROL_INOUT 0x23018203 /* Zoom - in / out */ +#define DIBUTTON_2DCONTROL_SELECT 0x23000401 /* Select Object */ +#define DIBUTTON_2DCONTROL_SPECIAL1 0x23000402 /* Do first special operation */ +#define DIBUTTON_2DCONTROL_SPECIAL 0x23000403 /* Select special operation */ +#define DIBUTTON_2DCONTROL_SPECIAL2 0x23000404 /* Do second special operation */ +#define DIBUTTON_2DCONTROL_MENU 0x230004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_2DCONTROL_HATSWITCH 0x23004601 /* Hat switch */ +#define DIAXIS_2DCONTROL_ROTATEZ 0x23024204 /* Rotate view clockwise / counterclockwise */ +#define DIBUTTON_2DCONTROL_DISPLAY 0x23004405 /* Shows next on-screen display options */ +#define DIBUTTON_2DCONTROL_DEVICE 0x230044FE /* Show input device and controls */ +#define DIBUTTON_2DCONTROL_PAUSE 0x230044FC /* Start / Pause / Restart game */ + +/*--- CAD - 3D object control + Controls to select and move objects within a 3D environment ---*/ +#define DIVIRTUAL_CAD_3DCONTROL 0x24000000 +#define DIAXIS_3DCONTROL_LATERAL 0x24008201 /* Move view left / right */ +#define DIAXIS_3DCONTROL_MOVE 0x24010202 /* Move view up / down */ +#define DIAXIS_3DCONTROL_INOUT 0x24018203 /* Zoom - in / out */ +#define DIBUTTON_3DCONTROL_SELECT 0x24000401 /* Select Object */ +#define DIBUTTON_3DCONTROL_SPECIAL1 0x24000402 /* Do first special operation */ +#define DIBUTTON_3DCONTROL_SPECIAL 0x24000403 /* Select special operation */ +#define DIBUTTON_3DCONTROL_SPECIAL2 0x24000404 /* Do second special operation */ +#define DIBUTTON_3DCONTROL_MENU 0x240004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_3DCONTROL_HATSWITCH 0x24004601 /* Hat switch */ +#define DIAXIS_3DCONTROL_ROTATEX 0x24034204 /* Rotate view forward or up / backward or down */ +#define DIAXIS_3DCONTROL_ROTATEY 0x2402C205 /* Rotate view clockwise / counterclockwise */ +#define DIAXIS_3DCONTROL_ROTATEZ 0x24024206 /* Rotate view left / right */ +#define DIBUTTON_3DCONTROL_DISPLAY 0x24004405 /* Show next on-screen display options */ +#define DIBUTTON_3DCONTROL_DEVICE 0x240044FE /* Show input device and controls */ +#define DIBUTTON_3DCONTROL_PAUSE 0x240044FC /* Start / Pause / Restart game */ + +/*--- CAD - 3D Navigation - Fly through + Controls for 3D modeling ---*/ +#define DIVIRTUAL_CAD_FLYBY 0x25000000 +#define DIAXIS_CADF_LATERAL 0x25008201 /* move view left / right */ +#define DIAXIS_CADF_MOVE 0x25010202 /* move view up / down */ +#define DIAXIS_CADF_INOUT 0x25018203 /* in / out */ +#define DIBUTTON_CADF_SELECT 0x25000401 /* Select Object */ +#define DIBUTTON_CADF_SPECIAL1 0x25000402 /* do first special operation */ +#define DIBUTTON_CADF_SPECIAL 0x25000403 /* Select special operation */ +#define DIBUTTON_CADF_SPECIAL2 0x25000404 /* do second special operation */ +#define DIBUTTON_CADF_MENU 0x250004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_CADF_HATSWITCH 0x25004601 /* Hat switch */ +#define DIAXIS_CADF_ROTATEX 0x25034204 /* Rotate view forward or up / backward or down */ +#define DIAXIS_CADF_ROTATEY 0x2502C205 /* Rotate view clockwise / counterclockwise */ +#define DIAXIS_CADF_ROTATEZ 0x25024206 /* Rotate view left / right */ +#define DIBUTTON_CADF_DISPLAY 0x25004405 /* shows next on-screen display options */ +#define DIBUTTON_CADF_DEVICE 0x250044FE /* Show input device and controls */ +#define DIBUTTON_CADF_PAUSE 0x250044FC /* Start / Pause / Restart game */ + +/*--- CAD - 3D Model Control + Controls for 3D modeling ---*/ +#define DIVIRTUAL_CAD_MODEL 0x26000000 +#define DIAXIS_CADM_LATERAL 0x26008201 /* move view left / right */ +#define DIAXIS_CADM_MOVE 0x26010202 /* move view up / down */ +#define DIAXIS_CADM_INOUT 0x26018203 /* in / out */ +#define DIBUTTON_CADM_SELECT 0x26000401 /* Select Object */ +#define DIBUTTON_CADM_SPECIAL1 0x26000402 /* do first special operation */ +#define DIBUTTON_CADM_SPECIAL 0x26000403 /* Select special operation */ +#define DIBUTTON_CADM_SPECIAL2 0x26000404 /* do second special operation */ +#define DIBUTTON_CADM_MENU 0x260004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_CADM_HATSWITCH 0x26004601 /* Hat switch */ +#define DIAXIS_CADM_ROTATEX 0x26034204 /* Rotate view forward or up / backward or down */ +#define DIAXIS_CADM_ROTATEY 0x2602C205 /* Rotate view clockwise / counterclockwise */ +#define DIAXIS_CADM_ROTATEZ 0x26024206 /* Rotate view left / right */ +#define DIBUTTON_CADM_DISPLAY 0x26004405 /* shows next on-screen display options */ +#define DIBUTTON_CADM_DEVICE 0x260044FE /* Show input device and controls */ +#define DIBUTTON_CADM_PAUSE 0x260044FC /* Start / Pause / Restart game */ + +/*--- Control - Media Equipment + Remote ---*/ +#define DIVIRTUAL_REMOTE_CONTROL 0x27000000 +#define DIAXIS_REMOTE_SLIDER 0x27050201 /* Slider for adjustment: volume / color / bass / etc */ +#define DIBUTTON_REMOTE_MUTE 0x27000401 /* Set volume on current device to zero */ +#define DIBUTTON_REMOTE_SELECT 0x27000402 /* Next/previous: channel/ track / chapter / picture / station */ +#define DIBUTTON_REMOTE_PLAY 0x27002403 /* Start or pause entertainment on current device */ +#define DIBUTTON_REMOTE_CUE 0x27002404 /* Move through current media */ +#define DIBUTTON_REMOTE_REVIEW 0x27002405 /* Move through current media */ +#define DIBUTTON_REMOTE_CHANGE 0x27002406 /* Select next device */ +#define DIBUTTON_REMOTE_RECORD 0x27002407 /* Start recording the current media */ +#define DIBUTTON_REMOTE_MENU 0x270004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIAXIS_REMOTE_SLIDER2 0x27054202 /* Slider for adjustment: volume */ +#define DIBUTTON_REMOTE_TV 0x27005C08 /* Select TV */ +#define DIBUTTON_REMOTE_CABLE 0x27005C09 /* Select cable box */ +#define DIBUTTON_REMOTE_CD 0x27005C0A /* Select CD player */ +#define DIBUTTON_REMOTE_VCR 0x27005C0B /* Select VCR */ +#define DIBUTTON_REMOTE_TUNER 0x27005C0C /* Select tuner */ +#define DIBUTTON_REMOTE_DVD 0x27005C0D /* Select DVD player */ +#define DIBUTTON_REMOTE_ADJUST 0x27005C0E /* Enter device adjustment menu */ +#define DIBUTTON_REMOTE_DIGIT0 0x2700540F /* Digit 0 */ +#define DIBUTTON_REMOTE_DIGIT1 0x27005410 /* Digit 1 */ +#define DIBUTTON_REMOTE_DIGIT2 0x27005411 /* Digit 2 */ +#define DIBUTTON_REMOTE_DIGIT3 0x27005412 /* Digit 3 */ +#define DIBUTTON_REMOTE_DIGIT4 0x27005413 /* Digit 4 */ +#define DIBUTTON_REMOTE_DIGIT5 0x27005414 /* Digit 5 */ +#define DIBUTTON_REMOTE_DIGIT6 0x27005415 /* Digit 6 */ +#define DIBUTTON_REMOTE_DIGIT7 0x27005416 /* Digit 7 */ +#define DIBUTTON_REMOTE_DIGIT8 0x27005417 /* Digit 8 */ +#define DIBUTTON_REMOTE_DIGIT9 0x27005418 /* Digit 9 */ +#define DIBUTTON_REMOTE_DEVICE 0x270044FE /* Show input device and controls */ +#define DIBUTTON_REMOTE_PAUSE 0x270044FC /* Start / Pause / Restart game */ + +/*--- Control- Web + Help or Browser ---*/ +#define DIVIRTUAL_BROWSER_CONTROL 0x28000000 +#define DIAXIS_BROWSER_LATERAL 0x28008201 /* Move on screen pointer */ +#define DIAXIS_BROWSER_MOVE 0x28010202 /* Move on screen pointer */ +#define DIBUTTON_BROWSER_SELECT 0x28000401 /* Select current item */ +#define DIAXIS_BROWSER_VIEW 0x28018203 /* Move view up/down */ +#define DIBUTTON_BROWSER_REFRESH 0x28000402 /* Refresh */ +#define DIBUTTON_BROWSER_MENU 0x280004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_BROWSER_SEARCH 0x28004403 /* Use search tool */ +#define DIBUTTON_BROWSER_STOP 0x28004404 /* Cease current update */ +#define DIBUTTON_BROWSER_HOME 0x28004405 /* Go directly to "home" location */ +#define DIBUTTON_BROWSER_FAVORITES 0x28004406 /* Mark current site as favorite */ +#define DIBUTTON_BROWSER_NEXT 0x28004407 /* Select Next page */ +#define DIBUTTON_BROWSER_PREVIOUS 0x28004408 /* Select Previous page */ +#define DIBUTTON_BROWSER_HISTORY 0x28004409 /* Show/Hide History */ +#define DIBUTTON_BROWSER_PRINT 0x2800440A /* Print current page */ +#define DIBUTTON_BROWSER_DEVICE 0x280044FE /* Show input device and controls */ +#define DIBUTTON_BROWSER_PAUSE 0x280044FC /* Start / Pause / Restart game */ + +/*--- Driving Simulator - Giant Walking Robot + Walking tank with weapons ---*/ +#define DIVIRTUAL_DRIVING_MECHA 0x29000000 +#define DIAXIS_MECHA_STEER 0x29008201 /* Turns mecha left/right */ +#define DIAXIS_MECHA_TORSO 0x29010202 /* Tilts torso forward/backward */ +#define DIAXIS_MECHA_ROTATE 0x29020203 /* Turns torso left/right */ +#define DIAXIS_MECHA_THROTTLE 0x29038204 /* Engine Speed */ +#define DIBUTTON_MECHA_FIRE 0x29000401 /* Fire */ +#define DIBUTTON_MECHA_WEAPONS 0x29000402 /* Select next weapon group */ +#define DIBUTTON_MECHA_TARGET 0x29000403 /* Select closest enemy available target */ +#define DIBUTTON_MECHA_REVERSE 0x29000404 /* Toggles throttle in/out of reverse */ +#define DIBUTTON_MECHA_ZOOM 0x29000405 /* Zoom in/out targeting reticule */ +#define DIBUTTON_MECHA_JUMP 0x29000406 /* Fires jump jets */ +#define DIBUTTON_MECHA_MENU 0x290004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_MECHA_CENTER 0x29004407 /* Center torso to legs */ +#define DIHATSWITCH_MECHA_GLANCE 0x29004601 /* Look around */ +#define DIBUTTON_MECHA_VIEW 0x29004408 /* Cycle through view options */ +#define DIBUTTON_MECHA_FIRESECONDARY 0x29004409 /* Alternative fire button */ +#define DIBUTTON_MECHA_LEFT_LINK 0x2900C4E4 /* Fallback steer left button */ +#define DIBUTTON_MECHA_RIGHT_LINK 0x2900C4EC /* Fallback steer right button */ +#define DIBUTTON_MECHA_FORWARD_LINK 0x290144E0 /* Fallback tilt torso forward button */ +#define DIBUTTON_MECHA_BACK_LINK 0x290144E8 /* Fallback tilt toroso backward button */ +#define DIBUTTON_MECHA_ROTATE_LEFT_LINK 0x290244E4 /* Fallback rotate toroso right button */ +#define DIBUTTON_MECHA_ROTATE_RIGHT_LINK 0x290244EC /* Fallback rotate torso left button */ +#define DIBUTTON_MECHA_FASTER_LINK 0x2903C4E0 /* Fallback increase engine speed */ +#define DIBUTTON_MECHA_SLOWER_LINK 0x2903C4E8 /* Fallback decrease engine speed */ +#define DIBUTTON_MECHA_DEVICE 0x290044FE /* Show input device and controls */ +#define DIBUTTON_MECHA_PAUSE 0x290044FC /* Start / Pause / Restart game */ + +/* + * "ANY" semantics can be used as a last resort to get mappings for actions + * that match nothing in the chosen virtual genre. These semantics will be + * mapped at a lower priority that virtual genre semantics. Also, hardware + * vendors will not be able to provide sensible mappings for these unless + * they provide application specific mappings. + */ +#define DIAXIS_ANY_X_1 0xFF00C201 +#define DIAXIS_ANY_X_2 0xFF00C202 +#define DIAXIS_ANY_Y_1 0xFF014201 +#define DIAXIS_ANY_Y_2 0xFF014202 +#define DIAXIS_ANY_Z_1 0xFF01C201 +#define DIAXIS_ANY_Z_2 0xFF01C202 +#define DIAXIS_ANY_R_1 0xFF024201 +#define DIAXIS_ANY_R_2 0xFF024202 +#define DIAXIS_ANY_U_1 0xFF02C201 +#define DIAXIS_ANY_U_2 0xFF02C202 +#define DIAXIS_ANY_V_1 0xFF034201 +#define DIAXIS_ANY_V_2 0xFF034202 +#define DIAXIS_ANY_A_1 0xFF03C201 +#define DIAXIS_ANY_A_2 0xFF03C202 +#define DIAXIS_ANY_B_1 0xFF044201 +#define DIAXIS_ANY_B_2 0xFF044202 +#define DIAXIS_ANY_C_1 0xFF04C201 +#define DIAXIS_ANY_C_2 0xFF04C202 +#define DIAXIS_ANY_S_1 0xFF054201 +#define DIAXIS_ANY_S_2 0xFF054202 + +#define DIAXIS_ANY_1 0xFF004201 +#define DIAXIS_ANY_2 0xFF004202 +#define DIAXIS_ANY_3 0xFF004203 +#define DIAXIS_ANY_4 0xFF004204 + +#define DIPOV_ANY_1 0xFF004601 +#define DIPOV_ANY_2 0xFF004602 +#define DIPOV_ANY_3 0xFF004603 +#define DIPOV_ANY_4 0xFF004604 + +#define DIBUTTON_ANY(instance) ( 0xFF004400 | instance ) + + +#ifdef __cplusplus +}; +#endif + +#endif /* __DINPUT_INCLUDED__ */ + +/**************************************************************************** + * + * Definitions for non-IDirectInput (VJoyD) features defined more recently + * than the current sdk files + * + ****************************************************************************/ + +#ifdef _INC_MMSYSTEM +#ifndef MMNOJOY + +#ifndef __VJOYDX_INCLUDED__ +#define __VJOYDX_INCLUDED__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Flag to indicate that the dwReserved2 field of the JOYINFOEX structure + * contains mini-driver specific data to be passed by VJoyD to the mini- + * driver instead of doing a poll. + */ +#define JOY_PASSDRIVERDATA 0x10000000l + +/* + * Informs the joystick driver that the configuration has been changed + * and should be reloaded from the registery. + * dwFlags is reserved and should be set to zero + */ +WINMMAPI MMRESULT WINAPI joyConfigChanged( DWORD dwFlags ); + +#ifndef DIJ_RINGZERO +/* + * Invoke the joystick control panel directly, using the passed window handle + * as the parent of the dialog. This API is only supported for compatibility + * purposes; new applications should use the RunControlPanel method of a + * device interface for a game controller. + * The API is called by using the function pointer returned by + * GetProcAddress( hCPL, TEXT("ShowJoyCPL") ) where hCPL is a HMODULE returned + * by LoadLibrary( TEXT("joy.cpl") ). The typedef is provided to allow + * declaration and casting of an appropriately typed variable. + */ +void WINAPI ShowJoyCPL( HWND hWnd ); +typedef void (WINAPI* LPFNSHOWJOYCPL)( HWND hWnd ); +#endif /* DIJ_RINGZERO */ + + +/* + * Hardware Setting indicating that the device is a headtracker + */ +#define JOY_HWS_ISHEADTRACKER 0x02000000l + +/* + * Hardware Setting indicating that the VxD is used to replace + * the standard analog polling + */ +#define JOY_HWS_ISGAMEPORTDRIVER 0x04000000l + +/* + * Hardware Setting indicating that the driver needs a standard + * gameport in order to communicate with the device. + */ +#define JOY_HWS_ISANALOGPORTDRIVER 0x08000000l + +/* + * Hardware Setting indicating that VJoyD should not load this + * driver, it will be loaded externally and will register with + * VJoyD of it's own accord. + */ +#define JOY_HWS_AUTOLOAD 0x10000000l + +/* + * Hardware Setting indicating that the driver acquires any + * resources needed without needing a devnode through VJoyD. + */ +#define JOY_HWS_NODEVNODE 0x20000000l + + +/* + * Hardware Setting indicating that the device is a gameport bus + */ +#define JOY_HWS_ISGAMEPORTBUS 0x80000000l +#define JOY_HWS_GAMEPORTBUSBUSY 0x00000001l + +/* + * Usage Setting indicating that the settings are volatile and + * should be removed if still present on a reboot. + */ +#define JOY_US_VOLATILE 0x00000008L + +#ifdef __cplusplus +}; +#endif + +#endif /* __VJOYDX_INCLUDED__ */ + +#endif /* not MMNOJOY */ +#endif /* _INC_MMSYSTEM */ + +/**************************************************************************** + * + * Definitions for non-IDirectInput (VJoyD) features defined more recently + * than the current ddk files + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +#ifdef _INC_MMDDK +#ifndef MMNOJOYDEV + +#ifndef __VJOYDXD_INCLUDED__ +#define __VJOYDXD_INCLUDED__ +/* + * Poll type in which the do_other field of the JOYOEMPOLLDATA + * structure contains mini-driver specific data passed from an app. + */ +#define JOY_OEMPOLL_PASSDRIVERDATA 7 + +#endif /* __VJOYDXD_INCLUDED__ */ + +#endif /* not MMNOJOYDEV */ +#endif /* _INC_MMDDK */ + +#endif /* DIJ_RINGZERO */ + diff --git a/RenderDll/Dx9Sdk/Include/dinputd.h b/RenderDll/Dx9Sdk/Include/dinputd.h new file mode 100644 index 0000000..f534353 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/dinputd.h @@ -0,0 +1,755 @@ +/**************************************************************************** + * + * Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved. + * + * File: dinputd.h + * Content: DirectInput include file for device driver implementors + * + ****************************************************************************/ +#ifndef __DINPUTD_INCLUDED__ +#define __DINPUTD_INCLUDED__ + +#ifndef DIRECTINPUT_VERSION +#define DIRECTINPUT_VERSION 0x0800 +#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800") +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************************************************** + * + * Interfaces + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38); + +DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c); + +#endif /* DIJ_RINGZERO */ + + +/**************************************************************************** + * + * IDirectInputEffectDriver + * + ****************************************************************************/ + +typedef struct DIOBJECTATTRIBUTES { + DWORD dwFlags; + WORD wUsagePage; + WORD wUsage; +} DIOBJECTATTRIBUTES, *LPDIOBJECTATTRIBUTES; +typedef const DIOBJECTATTRIBUTES *LPCDIOBJECTATTRIBUTES; + +typedef struct DIFFOBJECTATTRIBUTES { + DWORD dwFFMaxForce; + DWORD dwFFForceResolution; +} DIFFOBJECTATTRIBUTES, *LPDIFFOBJECTATTRIBUTES; +typedef const DIFFOBJECTATTRIBUTES *LPCDIFFOBJECTATTRIBUTES; + +typedef struct DIOBJECTCALIBRATION { + LONG lMin; + LONG lCenter; + LONG lMax; +} DIOBJECTCALIBRATION, *LPDIOBJECTCALIBRATION; +typedef const DIOBJECTCALIBRATION *LPCDIOBJECTCALIBRATION; + +typedef struct DIPOVCALIBRATION { + LONG lMin[5]; + LONG lMax[5]; +} DIPOVCALIBRATION, *LPDIPOVCALIBRATION; +typedef const DIPOVCALIBRATION *LPCDIPOVCALIBRATION; + +typedef struct DIEFFECTATTRIBUTES { + DWORD dwEffectId; + DWORD dwEffType; + DWORD dwStaticParams; + DWORD dwDynamicParams; + DWORD dwCoords; +} DIEFFECTATTRIBUTES, *LPDIEFFECTATTRIBUTES; +typedef const DIEFFECTATTRIBUTES *LPCDIEFFECTATTRIBUTES; + +typedef struct DIFFDEVICEATTRIBUTES { + DWORD dwFlags; + DWORD dwFFSamplePeriod; + DWORD dwFFMinTimeResolution; +} DIFFDEVICEATTRIBUTES, *LPDIFFDEVICEATTRIBUTES; +typedef const DIFFDEVICEATTRIBUTES *LPCDIFFDEVICEATTRIBUTES; + +typedef struct DIDRIVERVERSIONS { + DWORD dwSize; + DWORD dwFirmwareRevision; + DWORD dwHardwareRevision; + DWORD dwFFDriverVersion; +} DIDRIVERVERSIONS, *LPDIDRIVERVERSIONS; +typedef const DIDRIVERVERSIONS *LPCDIDRIVERVERSIONS; + +typedef struct DIDEVICESTATE { + DWORD dwSize; + DWORD dwState; + DWORD dwLoad; +} DIDEVICESTATE, *LPDIDEVICESTATE; + +#define DEV_STS_EFFECT_RUNNING DIEGES_PLAYING + +#ifndef DIJ_RINGZERO + +typedef struct DIHIDFFINITINFO { + DWORD dwSize; + LPWSTR pwszDeviceInterface; + GUID GuidInstance; +} DIHIDFFINITINFO, *LPDIHIDFFINITINFO; + +#undef INTERFACE +#define INTERFACE IDirectInputEffectDriver + +DECLARE_INTERFACE_(IDirectInputEffectDriver, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputEffectDriver methods ***/ + STDMETHOD(DeviceID)(THIS_ DWORD,DWORD,DWORD,DWORD,LPVOID) PURE; + STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE; + STDMETHOD(Escape)(THIS_ DWORD,DWORD,LPDIEFFESCAPE) PURE; + STDMETHOD(SetGain)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ DWORD,LPDIDEVICESTATE) PURE; + STDMETHOD(DownloadEffect)(THIS_ DWORD,DWORD,LPDWORD,LPCDIEFFECT,DWORD) PURE; + STDMETHOD(DestroyEffect)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(StartEffect)(THIS_ DWORD,DWORD,DWORD,DWORD) PURE; + STDMETHOD(StopEffect)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(GetEffectStatus)(THIS_ DWORD,DWORD,LPDWORD) PURE; +}; + +typedef struct IDirectInputEffectDriver *LPDIRECTINPUTEFFECTDRIVER; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputEffectDriver_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputEffectDriver_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->lpVtbl->DeviceID(p,a,b,c,d,e) +#define IDirectInputEffectDriver_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a) +#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->lpVtbl->Escape(p,a,b,c) +#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->lpVtbl->SetGain(p,a,b) +#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->lpVtbl->SendForceFeedbackCommand(p,a,b) +#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->lpVtbl->GetForceFeedbackState(p,a,b) +#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->lpVtbl->DownloadEffect(p,a,b,c,d,e) +#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->lpVtbl->DestroyEffect(p,a,b) +#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->lpVtbl->StartEffect(p,a,b,c,d) +#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->lpVtbl->StopEffect(p,a,b) +#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->lpVtbl->GetEffectStatus(p,a,b,c) +#else +#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputEffectDriver_AddRef(p) (p)->AddRef() +#define IDirectInputEffectDriver_Release(p) (p)->Release() +#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->DeviceID(a,b,c,d,e) +#define IDirectInputEffectDriver_GetVersions(p,a) (p)->GetVersions(a) +#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->Escape(a,b,c) +#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->SetGain(a,b) +#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->SendForceFeedbackCommand(a,b) +#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->GetForceFeedbackState(a,b) +#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->DownloadEffect(a,b,c,d,e) +#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->DestroyEffect(a,b) +#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->StartEffect(a,b,c,d) +#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->StopEffect(a,b) +#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->GetEffectStatus(a,b,c) +#endif + + +#endif /* DIJ_RINGZERO */ + + +/**************************************************************************** + * + * IDirectInputJoyConfig + * + ****************************************************************************/ + +/**************************************************************************** + * + * Definitions copied from the DDK + * + ****************************************************************************/ + +#ifndef JOY_HW_NONE + +/* pre-defined joystick types */ +#define JOY_HW_NONE 0 +#define JOY_HW_CUSTOM 1 +#define JOY_HW_2A_2B_GENERIC 2 +#define JOY_HW_2A_4B_GENERIC 3 +#define JOY_HW_2B_GAMEPAD 4 +#define JOY_HW_2B_FLIGHTYOKE 5 +#define JOY_HW_2B_FLIGHTYOKETHROTTLE 6 +#define JOY_HW_3A_2B_GENERIC 7 +#define JOY_HW_3A_4B_GENERIC 8 +#define JOY_HW_4B_GAMEPAD 9 +#define JOY_HW_4B_FLIGHTYOKE 10 +#define JOY_HW_4B_FLIGHTYOKETHROTTLE 11 +#define JOY_HW_TWO_2A_2B_WITH_Y 12 +#define JOY_HW_LASTENTRY 13 + + +/* calibration flags */ +#define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */ +#define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */ +#define JOY_ISCAL_R 0x00000004l /* R is calibrated */ +#define JOY_ISCAL_U 0x00000008l /* U is calibrated */ +#define JOY_ISCAL_V 0x00000010l /* V is calibrated */ +#define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */ + +/* point of view constants */ +#define JOY_POV_NUMDIRS 4 +#define JOY_POVVAL_FORWARD 0 +#define JOY_POVVAL_BACKWARD 1 +#define JOY_POVVAL_LEFT 2 +#define JOY_POVVAL_RIGHT 3 + +/* Specific settings for joystick hardware */ +#define JOY_HWS_HASZ 0x00000001l /* has Z info? */ +#define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */ +#define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */ +#define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */ +#define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */ +#define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */ +#define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */ +/* X defaults to J1 X axis */ +#define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */ +#define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */ +#define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */ +/* Y defaults to J1 Y axis */ +#define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */ +#define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */ +#define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */ +/* Z defaults to J2 Y axis */ +#define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */ +#define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */ +#define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */ +/* POV defaults to J2 Y axis, if it is not button based */ +#define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */ +#define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */ +#define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */ +/* R defaults to J2 X axis */ +#define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */ +#define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */ +#define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */ +#define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */ +/* U & V for future hardware */ +#define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */ +#define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */ + +/* Usage settings */ +#define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */ +#define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */ +#define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */ + +/* reserved for future use -> as link to next possible dword */ +#define JOY_US_RESERVED 0x80000000l /* reserved */ + + +/* Settings for TypeInfo Flags1 */ +#define JOYTYPE_ZEROGAMEENUMOEMDATA 0x00000001l /* Zero GameEnum's OEM data field */ +#define JOYTYPE_NOAUTODETECTGAMEPORT 0x00000002l /* Device does not support Autodetect gameport*/ +#define JOYTYPE_NOHIDDIRECT 0x00000004l /* Do not use HID directly for this device */ +#define JOYTYPE_ANALOGCOMPAT 0x00000008l /* Expose the analog compatible ID */ +#define JOYTYPE_DEFAULTPROPSHEET 0x80000000l /* CPL overrides custom property sheet */ + +/* Settings for TypeInfo Flags2 */ +#define JOYTYPE_DEVICEHIDE 0x00010000l /* Hide unclassified devices */ +#define JOYTYPE_MOUSEHIDE 0x00020000l /* Hide mice */ +#define JOYTYPE_KEYBHIDE 0x00040000l /* Hide keyboards */ +#define JOYTYPE_GAMEHIDE 0x00080000l /* Hide game controllers */ +#define JOYTYPE_HIDEACTIVE 0x00100000l /* Hide flags are active */ +#define JOYTYPE_INFOMASK 0x00E00000l /* Mask for type specific info */ +#define JOYTYPE_INFODEFAULT 0x00000000l /* Use default axis mappings */ +#define JOYTYPE_INFOYYPEDALS 0x00200000l /* Use Y as a combined pedals axis */ +#define JOYTYPE_INFOZYPEDALS 0x00400000l /* Use Z for accelerate, Y for brake */ +#define JOYTYPE_INFOYRPEDALS 0x00600000l /* Use Y for accelerate, R for brake */ +#define JOYTYPE_INFOZRPEDALS 0x00800000l /* Use Z for accelerate, R for brake */ +#define JOYTYPE_INFOZISSLIDER 0x00200000l /* Use Z as a slider */ +#define JOYTYPE_INFOZISZ 0x00400000l /* Use Z as Z axis */ +#define JOYTYPE_ENABLEINPUTREPORT 0x01000000l /* Enable initial input reports */ + +/* struct for storing x,y, z, and rudder values */ +typedef struct joypos_tag { + DWORD dwX; + DWORD dwY; + DWORD dwZ; + DWORD dwR; + DWORD dwU; + DWORD dwV; +} JOYPOS, FAR *LPJOYPOS; + +/* struct for storing ranges */ +typedef struct joyrange_tag { + JOYPOS jpMin; + JOYPOS jpMax; + JOYPOS jpCenter; +} JOYRANGE,FAR *LPJOYRANGE; + +/* + * dwTimeout - value at which to timeout joystick polling + * jrvRanges - range of values app wants returned for axes + * jpDeadZone - area around center to be considered + * as "dead". specified as a percentage + * (0-100). Only X & Y handled by system driver + */ +typedef struct joyreguservalues_tag { + DWORD dwTimeOut; + JOYRANGE jrvRanges; + JOYPOS jpDeadZone; +} JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES; + +typedef struct joyreghwsettings_tag { + DWORD dwFlags; + DWORD dwNumButtons; +} JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS; + +/* range of values returned by the hardware (filled in by calibration) */ +/* + * jrvHardware - values returned by hardware + * dwPOVValues - POV values returned by hardware + * dwCalFlags - what has been calibrated + */ +typedef struct joyreghwvalues_tag { + JOYRANGE jrvHardware; + DWORD dwPOVValues[JOY_POV_NUMDIRS]; + DWORD dwCalFlags; +} JOYREGHWVALUES, FAR *LPJOYREGHWVALUES; + +/* hardware configuration */ +/* + * hws - hardware settings + * dwUsageSettings - usage settings + * hwv - values returned by hardware + * dwType - type of joystick + * dwReserved - reserved for OEM drivers + */ +typedef struct joyreghwconfig_tag { + JOYREGHWSETTINGS hws; + DWORD dwUsageSettings; + JOYREGHWVALUES hwv; + DWORD dwType; + DWORD dwReserved; +} JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG; + +/* joystick calibration info structure */ +typedef struct joycalibrate_tag { + UINT wXbase; + UINT wXdelta; + UINT wYbase; + UINT wYdelta; + UINT wZbase; + UINT wZdelta; +} JOYCALIBRATE; +typedef JOYCALIBRATE FAR *LPJOYCALIBRATE; + +#endif + +#ifndef DIJ_RINGZERO + +#define MAX_JOYSTRING 256 +typedef BOOL (FAR PASCAL * LPDIJOYTYPECALLBACK)(LPCWSTR, LPVOID); + +#ifndef MAX_JOYSTICKOEMVXDNAME +#define MAX_JOYSTICKOEMVXDNAME 260 +#endif + +#define DITC_REGHWSETTINGS 0x00000001 +#define DITC_CLSIDCONFIG 0x00000002 +#define DITC_DISPLAYNAME 0x00000004 +#define DITC_CALLOUT 0x00000008 +#define DITC_HARDWAREID 0x00000010 +#define DITC_FLAGS1 0x00000020 +#define DITC_FLAGS2 0x00000040 +#define DITC_MAPFILE 0x00000080 + + + +/* This structure is defined for DirectX 5.0 compatibility */ + +typedef struct DIJOYTYPEINFO_DX5 { + DWORD dwSize; + JOYREGHWSETTINGS hws; + CLSID clsidConfig; + WCHAR wszDisplayName[MAX_JOYSTRING]; + WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME]; +} DIJOYTYPEINFO_DX5, *LPDIJOYTYPEINFO_DX5; +typedef const DIJOYTYPEINFO_DX5 *LPCDIJOYTYPEINFO_DX5; + +/* This structure is defined for DirectX 6.1 compatibility */ +typedef struct DIJOYTYPEINFO_DX6 { + DWORD dwSize; + JOYREGHWSETTINGS hws; + CLSID clsidConfig; + WCHAR wszDisplayName[MAX_JOYSTRING]; + WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME]; + WCHAR wszHardwareId[MAX_JOYSTRING]; + DWORD dwFlags1; +} DIJOYTYPEINFO_DX6, *LPDIJOYTYPEINFO_DX6; +typedef const DIJOYTYPEINFO_DX6 *LPCDIJOYTYPEINFO_DX6; + +typedef struct DIJOYTYPEINFO { + DWORD dwSize; + JOYREGHWSETTINGS hws; + CLSID clsidConfig; + WCHAR wszDisplayName[MAX_JOYSTRING]; + WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME]; +#if(DIRECTINPUT_VERSION >= 0x05b2) + WCHAR wszHardwareId[MAX_JOYSTRING]; + DWORD dwFlags1; +#if(DIRECTINPUT_VERSION >= 0x0800) + DWORD dwFlags2; + WCHAR wszMapFile[MAX_JOYSTRING]; +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ +#endif /* DIRECTINPUT_VERSION >= 0x05b2 */ +} DIJOYTYPEINFO, *LPDIJOYTYPEINFO; +typedef const DIJOYTYPEINFO *LPCDIJOYTYPEINFO; +#define DIJC_GUIDINSTANCE 0x00000001 +#define DIJC_REGHWCONFIGTYPE 0x00000002 +#define DIJC_GAIN 0x00000004 +#define DIJC_CALLOUT 0x00000008 +#define DIJC_WDMGAMEPORT 0x00000010 + +/* This structure is defined for DirectX 5.0 compatibility */ + +typedef struct DIJOYCONFIG_DX5 { + DWORD dwSize; + GUID guidInstance; + JOYREGHWCONFIG hwc; + DWORD dwGain; + WCHAR wszType[MAX_JOYSTRING]; + WCHAR wszCallout[MAX_JOYSTRING]; +} DIJOYCONFIG_DX5, *LPDIJOYCONFIG_DX5; +typedef const DIJOYCONFIG_DX5 *LPCDIJOYCONFIG_DX5; + +typedef struct DIJOYCONFIG { + DWORD dwSize; + GUID guidInstance; + JOYREGHWCONFIG hwc; + DWORD dwGain; + WCHAR wszType[MAX_JOYSTRING]; + WCHAR wszCallout[MAX_JOYSTRING]; +#if(DIRECTINPUT_VERSION >= 0x05b2) + GUID guidGameport; +#endif /* DIRECTINPUT_VERSION >= 0x05b2 */ + } DIJOYCONFIG, *LPDIJOYCONFIG; +typedef const DIJOYCONFIG *LPCDIJOYCONFIG; + + +#define DIJU_USERVALUES 0x00000001 +#define DIJU_GLOBALDRIVER 0x00000002 +#define DIJU_GAMEPORTEMULATOR 0x00000004 + +typedef struct DIJOYUSERVALUES { + DWORD dwSize; + JOYREGUSERVALUES ruv; + WCHAR wszGlobalDriver[MAX_JOYSTRING]; + WCHAR wszGameportEmulator[MAX_JOYSTRING]; +} DIJOYUSERVALUES, *LPDIJOYUSERVALUES; +typedef const DIJOYUSERVALUES *LPCDIJOYUSERVALUES; + +DEFINE_GUID(GUID_KeyboardClass, 0x4D36E96B,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18); +DEFINE_GUID(GUID_MediaClass, 0x4D36E96C,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18); +DEFINE_GUID(GUID_MouseClass, 0x4D36E96F,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18); +DEFINE_GUID(GUID_HIDClass, 0x745A17A0,0x74D3,0x11D0,0xB6,0xFE,0x00,0xA0,0xC9,0x0F,0x57,0xDA); + +#undef INTERFACE +#define INTERFACE IDirectInputJoyConfig + +DECLARE_INTERFACE_(IDirectInputJoyConfig, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputJoyConfig methods ***/ + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(SendNotify)(THIS) PURE; + STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE; + STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE; + STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD) PURE; + STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE; + STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE; + STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE; + STDMETHOD(DeleteConfig)(THIS_ UINT) PURE; + STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE; + STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE; + STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE; + STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE; + STDMETHOD(OpenConfigKey)(THIS_ UINT,DWORD,PHKEY) PURE; +}; + +typedef struct IDirectInputJoyConfig *LPDIRECTINPUTJOYCONFIG; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputJoyConfig_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputJoyConfig_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputJoyConfig_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputJoyConfig_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputJoyConfig_SendNotify(p) (p)->lpVtbl->SendNotify(p) +#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b) +#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c) +#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->lpVtbl->SetTypeInfo(p,a,b,c) +#define IDirectInputJoyConfig_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a) +#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c) +#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c) +#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a) +#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b) +#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b) +#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b) +#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c) +#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->lpVtbl->OpenConfigKey(p,a,b,c) +#else +#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputJoyConfig_AddRef(p) (p)->AddRef() +#define IDirectInputJoyConfig_Release(p) (p)->Release() +#define IDirectInputJoyConfig_Acquire(p) (p)->Acquire() +#define IDirectInputJoyConfig_Unacquire(p) (p)->Unacquire() +#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputJoyConfig_SendNotify(p) (p)->SendNotify() +#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->EnumTypes(a,b) +#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c) +#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->SetTypeInfo(a,b,c) +#define IDirectInputJoyConfig_DeleteType(p,a) (p)->DeleteType(a) +#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c) +#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c) +#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->DeleteConfig(a) +#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->GetUserValues(a,b) +#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->SetUserValues(a,b) +#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b) +#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c) +#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->OpenConfigKey(a,b,c) +#endif + +#endif /* DIJ_RINGZERO */ + +#if(DIRECTINPUT_VERSION >= 0x0800) + +#ifndef DIJ_RINGZERO + +#undef INTERFACE +#define INTERFACE IDirectInputJoyConfig8 + +DECLARE_INTERFACE_(IDirectInputJoyConfig8, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputJoyConfig8 methods ***/ + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(SendNotify)(THIS) PURE; + STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE; + STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE; + STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD,LPWSTR) PURE; + STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE; + STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE; + STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE; + STDMETHOD(DeleteConfig)(THIS_ UINT) PURE; + STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE; + STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE; + STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE; + STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE; + STDMETHOD(OpenAppStatusKey)(THIS_ PHKEY) PURE; +}; + +typedef struct IDirectInputJoyConfig8 *LPDIRECTINPUTJOYCONFIG8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputJoyConfig8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputJoyConfig8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputJoyConfig8_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputJoyConfig8_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputJoyConfig8_SendNotify(p) (p)->lpVtbl->SendNotify(p) +#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b) +#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c) +#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->lpVtbl->SetTypeInfo(p,a,b,c,d) +#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a) +#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c) +#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c) +#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a) +#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b) +#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b) +#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b) +#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c) +#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->lpVtbl->OpenAppStatusKey(p,a) +#else +#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputJoyConfig8_AddRef(p) (p)->AddRef() +#define IDirectInputJoyConfig8_Release(p) (p)->Release() +#define IDirectInputJoyConfig8_Acquire(p) (p)->Acquire() +#define IDirectInputJoyConfig8_Unacquire(p) (p)->Unacquire() +#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputJoyConfig8_SendNotify(p) (p)->SendNotify() +#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->EnumTypes(a,b) +#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c) +#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->SetTypeInfo(a,b,c,d) +#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->DeleteType(a) +#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c) +#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c) +#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->DeleteConfig(a) +#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->GetUserValues(a,b) +#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->SetUserValues(a,b) +#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b) +#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c) +#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->OpenAppStatusKey(a) +#endif + +#endif /* DIJ_RINGZERO */ + +/**************************************************************************** + * + * Notification Messages + * + ****************************************************************************/ + +/* RegisterWindowMessage with this to get DirectInput notification messages */ +#define DIRECTINPUT_NOTIFICATION_MSGSTRINGA "DIRECTINPUT_NOTIFICATION_MSGSTRING" +#define DIRECTINPUT_NOTIFICATION_MSGSTRINGW L"DIRECTINPUT_NOTIFICATION_MSGSTRING" + +#ifdef UNICODE +#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGW +#else +#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGA +#endif + +#define DIMSGWP_NEWAPPSTART 0x00000001 +#define DIMSGWP_DX8APPSTART 0x00000002 +#define DIMSGWP_DX8MAPPERAPPSTART 0x00000003 + +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#define DIAPPIDFLAG_NOTIME 0x00000001 +#define DIAPPIDFLAG_NOSIZE 0x00000002 + +#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGA "AppIdFlag" +#define DIRECTINPUT_REGSTR_KEY_LASTAPPA "MostRecentApplication" +#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA "MostRecentMapperApplication" +#define DIRECTINPUT_REGSTR_VAL_VERSIONA "Version" +#define DIRECTINPUT_REGSTR_VAL_NAMEA "Name" +#define DIRECTINPUT_REGSTR_VAL_IDA "Id" +#define DIRECTINPUT_REGSTR_VAL_MAPPERA "UsesMapper" +#define DIRECTINPUT_REGSTR_VAL_LASTSTARTA "MostRecentStart" + +#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGW L"AppIdFlag" +#define DIRECTINPUT_REGSTR_KEY_LASTAPPW L"MostRecentApplication" +#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW L"MostRecentMapperApplication" +#define DIRECTINPUT_REGSTR_VAL_VERSIONW L"Version" +#define DIRECTINPUT_REGSTR_VAL_NAMEW L"Name" +#define DIRECTINPUT_REGSTR_VAL_IDW L"Id" +#define DIRECTINPUT_REGSTR_VAL_MAPPERW L"UsesMapper" +#define DIRECTINPUT_REGSTR_VAL_LASTSTARTW L"MostRecentStart" + +#ifdef UNICODE +#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGW +#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPW +#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW +#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONW +#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEW +#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDW +#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERW +#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTW +#else +#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGA +#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPA +#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA +#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONA +#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEA +#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDA +#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERA +#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTA +#endif + + +/**************************************************************************** + * + * Return Codes + * + ****************************************************************************/ + +#define DIERR_NOMOREITEMS \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NO_MORE_ITEMS) + +/* + * Device driver-specific codes. + */ + +#define DIERR_DRIVERFIRST 0x80040300L +#define DIERR_DRIVERLAST 0x800403FFL + +/* + * Unless the specific driver has been precisely identified, no meaning + * should be attributed to these values other than that the driver + * originated the error. However, to illustrate the types of error that + * may be causing the failure, the PID force feedback driver distributed + * with DirectX 7 could return the following errors: + * + * DIERR_DRIVERFIRST + 1 + * The requested usage was not found. + * DIERR_DRIVERFIRST + 2 + * The parameter block couldn't be downloaded to the device. + * DIERR_DRIVERFIRST + 3 + * PID initialization failed. + * DIERR_DRIVERFIRST + 4 + * The provided values couldn't be scaled. + */ + + +/* + * Device installer errors. + */ + +/* + * Registry entry or DLL for class installer invalid + * or class installer not found. + */ +#define DIERR_INVALIDCLASSINSTALLER 0x80040400L + +/* + * The user cancelled the install operation. + */ +#define DIERR_CANCELLED 0x80040401L + +/* + * The INF file for the selected device could not be + * found or is invalid or is damaged. + */ +#define DIERR_BADINF 0x80040402L + +/**************************************************************************** + * + * Map files + * + ****************************************************************************/ + +/* + * Delete particular data from default map file. + */ +#define DIDIFT_DELETE 0x01000000 + +#ifdef __cplusplus +}; +#endif + +#endif /* __DINPUTD_INCLUDED__ */ diff --git a/RenderDll/Dx9Sdk/Include/dsconf.h b/RenderDll/Dx9Sdk/Include/dsconf.h new file mode 100644 index 0000000..018f65a --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/dsconf.h @@ -0,0 +1,195 @@ +/*==========================================================================; + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: dsconf.h + * Content: DirectSound configuration interface include file + * + **************************************************************************/ + +#ifndef __DSCONF_INCLUDED__ +#define __DSCONF_INCLUDED__ + +#ifndef __DSOUND_INCLUDED__ +#error dsound.h not included +#endif // __DSOUND_INCLUDED__ + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + + +// DirectSound Private Component GUID {11AB3EC0-25EC-11d1-A4D8-00C04FC28ACA} +DEFINE_GUID(CLSID_DirectSoundPrivate, 0x11ab3ec0, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + + +// +// DirectSound Device Properties {84624F82-25EC-11d1-A4D8-00C04FC28ACA} +// + +DEFINE_GUID(DSPROPSETID_DirectSoundDevice, 0x84624f82, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + +typedef enum +{ + DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A = 1, + DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 = 2, + DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 = 3, + DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W = 4, + DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A = 5, + DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W = 6, + DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A = 7, + DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W = 8, +} DSPROPERTY_DIRECTSOUNDDEVICE; + +#if DIRECTSOUND_VERSION >= 0x0700 +#ifdef UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W +#else // UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A +#endif // UNICODE +#else // DIRECTSOUND_VERSION >= 0x0700 +#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 +#endif // DIRECTSOUND_VERSION >= 0x0700 + +typedef enum +{ + DIRECTSOUNDDEVICE_TYPE_EMULATED, + DIRECTSOUNDDEVICE_TYPE_VXD, + DIRECTSOUNDDEVICE_TYPE_WDM +} DIRECTSOUNDDEVICE_TYPE; + +typedef enum +{ + DIRECTSOUNDDEVICE_DATAFLOW_RENDER, + DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE +} DIRECTSOUNDDEVICE_DATAFLOW; + + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA +{ + LPSTR DeviceName; // waveIn/waveOut device name + DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut) + GUID DeviceId; // DirectSound device id +} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA; + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA +{ + LPWSTR DeviceName; // waveIn/waveOut device name + DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut) + GUID DeviceId; // DirectSound device id +} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA; + +#ifdef UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA +#else // UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA +#endif // UNICODE + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA +{ + GUID DeviceId; // DirectSound device id + CHAR DescriptionA[0x100]; // Device description (ANSI) + WCHAR DescriptionW[0x100]; // Device description (Unicode) + CHAR ModuleA[MAX_PATH]; // Device driver module (ANSI) + WCHAR ModuleW[MAX_PATH]; // Device driver module (Unicode) + DIRECTSOUNDDEVICE_TYPE Type; // Device type + DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow + ULONG WaveDeviceId; // Wave device id + ULONG Devnode; // Devnode (or DevInst) +} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA; + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA +{ + DIRECTSOUNDDEVICE_TYPE Type; // Device type + DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow + GUID DeviceId; // DirectSound device id + LPSTR Description; // Device description + LPSTR Module; // Device driver module + LPSTR Interface; // Device interface + ULONG WaveDeviceId; // Wave device id +} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA; + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA +{ + DIRECTSOUNDDEVICE_TYPE Type; // Device type + DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow + GUID DeviceId; // DirectSound device id + LPWSTR Description; // Device description + LPWSTR Module; // Device driver module + LPWSTR Interface; // Device interface + ULONG WaveDeviceId; // Wave device id +} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA; + +#if DIRECTSOUND_VERSION >= 0x0700 +#ifdef UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA +#else // UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA +#endif // UNICODE +#else // DIRECTSOUND_VERSION >= 0x0700 +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA +#endif // DIRECTSOUND_VERSION >= 0x0700 + +typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, LPVOID); +typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, LPVOID); +typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, LPVOID); + +#if DIRECTSOUND_VERSION >= 0x0700 +#ifdef UNICODE +#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW +#else // UNICODE +#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA +#endif // UNICODE +#else // DIRECTSOUND_VERSION >= 0x0700 +#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1 +#endif // DIRECTSOUND_VERSION >= 0x0700 + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA +{ + LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1 Callback; // Callback function pointer + LPVOID Context; // Callback function context argument +} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA; + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA +{ + LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA Callback; // Callback function pointer + LPVOID Context; // Callback function context argument +} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA; + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA +{ + LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW Callback; // Callback function pointer + LPVOID Context; // Callback function context argument +} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA; + +#if DIRECTSOUND_VERSION >= 0x0700 +#ifdef UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA +#else // UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA +#endif // UNICODE +#else // DIRECTSOUND_VERSION >= 0x0700 +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA +#endif // DIRECTSOUND_VERSION >= 0x0700 + + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // __DSCONF_INCLUDED__ + diff --git a/RenderDll/Dx9Sdk/Include/dsetup.h b/RenderDll/Dx9Sdk/Include/dsetup.h new file mode 100644 index 0000000..ebada13 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/dsetup.h @@ -0,0 +1,283 @@ +/*========================================================================== + * + * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. + * + * File: dsetup.h + * Content: DirectXSetup, error codes and flags + ***************************************************************************/ + +#ifndef __DSETUP_H__ +#define __DSETUP_H__ + +#include // windows stuff + +#ifdef __cplusplus +extern "C" { +#endif + +#define FOURCC_VERS mmioFOURCC('v','e','r','s') + +// DSETUP Error Codes, must remain compatible with previous setup. +#define DSETUPERR_SUCCESS_RESTART 1 +#define DSETUPERR_SUCCESS 0 +#define DSETUPERR_BADWINDOWSVERSION -1 +#define DSETUPERR_SOURCEFILENOTFOUND -2 +#define DSETUPERR_NOCOPY -5 +#define DSETUPERR_OUTOFDISKSPACE -6 +#define DSETUPERR_CANTFINDINF -7 +#define DSETUPERR_CANTFINDDIR -8 +#define DSETUPERR_INTERNAL -9 +#define DSETUPERR_UNKNOWNOS -11 +#define DSETUPERR_NEWERVERSION -14 +#define DSETUPERR_NOTADMIN -15 +#define DSETUPERR_UNSUPPORTEDPROCESSOR -16 +#define DSETUPERR_MISSINGCAB_MANAGEDDX -17 +#define DSETUPERR_NODOTNETFRAMEWORKINSTALLED -18 +#define DSETUPERR_CABDOWNLOADFAIL -19 +#define DSETUPERR_DXCOMPONENTFILEINUSE -20 +#define DSETUPERR_UNTRUSTEDCABINETFILE -21 + +// DSETUP flags. DirectX 5.0 apps should use these flags only. +#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */ +#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */ +#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */ +#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV) +#define DSETUP_MANAGEDDX 0x00004000 /* OBSOLETE. install managed DirectX */ +#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */ + +// These OBSOLETE flags are here for compatibility with pre-DX5 apps only. +// They are present to allow DX3 apps to be recompiled with DX5 and still work. +// DO NOT USE THEM for DX5. They will go away in future DX releases. +#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */ +#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */ +#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */ +#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */ +#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */ +#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */ +#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */ +#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */ +#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */ +#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */ +#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */ + + + +//****************************************************************** +// DirectX Setup Callback mechanism +//****************************************************************** + +// DSETUP Message Info Codes, passed to callback as Reason parameter. +#define DSETUP_CB_MSG_NOMESSAGE 0 +#define DSETUP_CB_MSG_INTERNAL_ERROR 10 +#define DSETUP_CB_MSG_BEGIN_INSTALL 13 +#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14 +#define DSETUP_CB_MSG_PROGRESS 18 +#define DSETUP_CB_MSG_WARNING_DISABLED_COMPONENT 19 + + + + + + +typedef struct _DSETUP_CB_PROGRESS +{ + DWORD dwPhase; + DWORD dwInPhaseMaximum; + DWORD dwInPhaseProgress; + DWORD dwOverallMaximum; + DWORD dwOverallProgress; +} DSETUP_CB_PROGRESS; + + +enum _DSETUP_CB_PROGRESS_PHASE +{ + DSETUP_INITIALIZING, + DSETUP_EXTRACTING, + DSETUP_COPYING, + DSETUP_FINALIZING +}; + + +#ifdef _WIN32 +// +// Data Structures +// +#ifndef UNICODE_ONLY + +typedef struct _DIRECTXREGISTERAPPA { + DWORD dwSize; + DWORD dwFlags; + LPSTR lpszApplicationName; + LPGUID lpGUID; + LPSTR lpszFilename; + LPSTR lpszCommandLine; + LPSTR lpszPath; + LPSTR lpszCurrentDirectory; +} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA; + +typedef struct _DIRECTXREGISTERAPP2A { + DWORD dwSize; + DWORD dwFlags; + LPSTR lpszApplicationName; + LPGUID lpGUID; + LPSTR lpszFilename; + LPSTR lpszCommandLine; + LPSTR lpszPath; + LPSTR lpszCurrentDirectory; + LPSTR lpszLauncherName; +} DIRECTXREGISTERAPP2A, *PDIRECTXREGISTERAPP2A, *LPDIRECTXREGISTERAPP2A; + +#endif //!UNICODE_ONLY +#ifndef ANSI_ONLY + +typedef struct _DIRECTXREGISTERAPPW { + DWORD dwSize; + DWORD dwFlags; + LPWSTR lpszApplicationName; + LPGUID lpGUID; + LPWSTR lpszFilename; + LPWSTR lpszCommandLine; + LPWSTR lpszPath; + LPWSTR lpszCurrentDirectory; +} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW; + +typedef struct _DIRECTXREGISTERAPP2W { + DWORD dwSize; + DWORD dwFlags; + LPWSTR lpszApplicationName; + LPGUID lpGUID; + LPWSTR lpszFilename; + LPWSTR lpszCommandLine; + LPWSTR lpszPath; + LPWSTR lpszCurrentDirectory; + LPWSTR lpszLauncherName; +} DIRECTXREGISTERAPP2W, *PDIRECTXREGISTERAPP2W, *LPDIRECTXREGISTERAPP2W; +#endif //!ANSI_ONLY +#ifdef UNICODE +typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP; +typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP; +typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP; +typedef DIRECTXREGISTERAPP2W DIRECTXREGISTERAPP2; +typedef PDIRECTXREGISTERAPP2W PDIRECTXREGISTERAPP2; +typedef LPDIRECTXREGISTERAPP2W LPDIRECTXREGISTERAPP2; +#else +typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP; +typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP; +typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP; +typedef DIRECTXREGISTERAPP2A DIRECTXREGISTERAPP2; +typedef PDIRECTXREGISTERAPP2A PDIRECTXREGISTERAPP2; +typedef LPDIRECTXREGISTERAPP2A LPDIRECTXREGISTERAPP2; +#endif // UNICODE + + +// +// API +// + +#ifndef UNICODE_ONLY +INT +WINAPI +DirectXSetupA( + HWND hWnd, + __in_opt LPSTR lpszRootPath, + DWORD dwFlags + ); +#endif //!UNICODE_ONLY +#ifndef ANSI_ONLY +INT +WINAPI +DirectXSetupW( + HWND hWnd, + __in_opt LPWSTR lpszRootPath, + DWORD dwFlags + ); +#endif //!ANSI_ONLY +#ifdef UNICODE +#define DirectXSetup DirectXSetupW +#else +#define DirectXSetup DirectXSetupA +#endif // !UNICODE + +#ifndef UNICODE_ONLY +INT +WINAPI +DirectXRegisterApplicationA( + HWND hWnd, + LPVOID lpDXRegApp + ); +#endif //!UNICODE_ONLY +#ifndef ANSI_ONLY +INT +WINAPI +DirectXRegisterApplicationW( + HWND hWnd, + LPVOID lpDXRegApp + ); +#endif //!ANSI_ONLY +#ifdef UNICODE +#define DirectXRegisterApplication DirectXRegisterApplicationW +#else +#define DirectXRegisterApplication DirectXRegisterApplicationA +#endif // !UNICODE + +INT +WINAPI +DirectXUnRegisterApplication( + HWND hWnd, + LPGUID lpGUID + ); + +// +// Function Pointers +// +#ifdef UNICODE +typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD); +typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID); +#else +typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD); +typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID); +#endif // UNICODE + +typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason, + DWORD MsgType, /* Same as flags to MessageBox */ + LPSTR szMessage, + LPSTR szName, + void *pInfo); + +INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback); +INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion); +INT WINAPI DirectXSetupShowEULA(HWND hWndParent); +#ifndef UNICODE_ONLY +UINT +WINAPI +DirectXSetupGetEULAA( + __out_ecount(cchEULA) LPSTR lpszEULA, + UINT cchEULA, + WORD LangID + ); +#endif //!UNICODE_ONLY +#ifndef ANSI_ONLY +UINT +WINAPI +DirectXSetupGetEULAW( + __out_ecount(cchEULA) LPWSTR lpszEULA, + UINT cchEULA, + WORD LangID + ); +#endif //!ANSI_ONLY +#ifdef UNICODE +#define DirectXSetupGetEULA DirectXSetupGetEULAW +typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPWSTR, UINT, WORD); +#else +#define DirectXSetupGetEULA DirectXSetupGetEULAA +typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPSTR, UINT, WORD); +#endif // !UNICODE + +#endif // WIN32 + + +#ifdef __cplusplus +}; +#endif + +#endif diff --git a/RenderDll/Dx9Sdk/Include/dsound.h b/RenderDll/Dx9Sdk/Include/dsound.h new file mode 100644 index 0000000..34e4c30 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/dsound.h @@ -0,0 +1,2385 @@ +/*==========================================================================; + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: dsound.h + * Content: DirectSound include file + * + **************************************************************************/ + +#define COM_NO_WINDOWS_H +#include +#include +#include + +#ifndef DIRECTSOUND_VERSION + +#if (NTDDI_VERSION < NTDDI_WINXP) /* Windows 2000 */ +#define DIRECTSOUND_VERSION 0x0700 /* Version 7.0 */ +#elif (NTDDI_VERSION < NTDDI_WINXPSP2 || NTDDI_VERSION == NTDDI_WS03) /* Windows XP and SP1, or Windows Server 2003 */ +#define DIRECTSOUND_VERSION 0x0800 /* Version 8.0 */ +#else /* Windows XP SP2 and higher, Windows Server 2003 SP1 and higher, Longhorn, or higher */ +#define DIRECTSOUND_VERSION 0x0900 /* Version 9.0 */ +#endif + +#endif // DIRECTSOUND_VERSION + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +#ifndef __DSOUND_INCLUDED__ +#define __DSOUND_INCLUDED__ + +/* Type definitions shared with Direct3D */ + +#ifndef DX_SHARED_DEFINES + +typedef float D3DVALUE, *LPD3DVALUE; + +#ifndef D3DCOLOR_DEFINED +typedef DWORD D3DCOLOR; +#define D3DCOLOR_DEFINED +#endif + +#ifndef LPD3DCOLOR_DEFINED +typedef DWORD *LPD3DCOLOR; +#define LPD3DCOLOR_DEFINED +#endif + +#ifndef D3DVECTOR_DEFINED +typedef struct _D3DVECTOR { + float x; + float y; + float z; +} D3DVECTOR; +#define D3DVECTOR_DEFINED +#endif + +#ifndef LPD3DVECTOR_DEFINED +typedef D3DVECTOR *LPD3DVECTOR; +#define LPD3DVECTOR_DEFINED +#endif + +#define DX_SHARED_DEFINES +#endif // DX_SHARED_DEFINES + +#define _FACDS 0x878 /* DirectSound's facility code */ +#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code) + +// DirectSound Component GUID {47D4D946-62E8-11CF-93BC-444553540000} +DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); + +// DirectSound 8.0 Component GUID {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B} +DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b); + +// DirectSound Capture Component GUID {B0210780-89CD-11D0-AF08-00A0C925CD16} +DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +// DirectSound 8.0 Capture Component GUID {E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1} +DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1); + +// DirectSound Full Duplex Component GUID {FEA4300C-7959-4147-B26A-2377B9E7A91D} +DEFINE_GUID(CLSID_DirectSoundFullDuplex, 0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d); + + +// DirectSound default playback device GUID {DEF00000-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultPlayback, 0xdef00000, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + +// DirectSound default capture device GUID {DEF00001-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultCapture, 0xdef00001, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + +// DirectSound default device for voice playback {DEF00002-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultVoicePlayback, 0xdef00002, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + +// DirectSound default device for voice capture {DEF00003-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xdef00003, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + + +// +// Forward declarations for interfaces. +// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined +// + +#ifdef __cplusplus +struct IDirectSound; +struct IDirectSoundBuffer; +struct IDirectSound3DListener; +struct IDirectSound3DBuffer; +struct IDirectSoundCapture; +struct IDirectSoundCaptureBuffer; +struct IDirectSoundNotify; +#endif // __cplusplus + +// +// DirectSound 8.0 interfaces. +// + +#if DIRECTSOUND_VERSION >= 0x0800 + +#ifdef __cplusplus +struct IDirectSound8; +struct IDirectSoundBuffer8; +struct IDirectSoundCaptureBuffer8; +struct IDirectSoundFXGargle; +struct IDirectSoundFXChorus; +struct IDirectSoundFXFlanger; +struct IDirectSoundFXEcho; +struct IDirectSoundFXDistortion; +struct IDirectSoundFXCompressor; +struct IDirectSoundFXParamEq; +struct IDirectSoundFXWavesReverb; +struct IDirectSoundFXI3DL2Reverb; +struct IDirectSoundCaptureFXAec; +struct IDirectSoundCaptureFXNoiseSuppress; +struct IDirectSoundFullDuplex; +#endif // __cplusplus + +// IDirectSound8, IDirectSoundBuffer8 and IDirectSoundCaptureBuffer8 are the +// only DirectSound 7.0 interfaces with changed functionality in version 8.0. +// The other level 8 interfaces as equivalent to their level 7 counterparts: + +#define IDirectSoundCapture8 IDirectSoundCapture +#define IDirectSound3DListener8 IDirectSound3DListener +#define IDirectSound3DBuffer8 IDirectSound3DBuffer +#define IDirectSoundNotify8 IDirectSoundNotify +#define IDirectSoundFXGargle8 IDirectSoundFXGargle +#define IDirectSoundFXChorus8 IDirectSoundFXChorus +#define IDirectSoundFXFlanger8 IDirectSoundFXFlanger +#define IDirectSoundFXEcho8 IDirectSoundFXEcho +#define IDirectSoundFXDistortion8 IDirectSoundFXDistortion +#define IDirectSoundFXCompressor8 IDirectSoundFXCompressor +#define IDirectSoundFXParamEq8 IDirectSoundFXParamEq +#define IDirectSoundFXWavesReverb8 IDirectSoundFXWavesReverb +#define IDirectSoundFXI3DL2Reverb8 IDirectSoundFXI3DL2Reverb +#define IDirectSoundCaptureFXAec8 IDirectSoundCaptureFXAec +#define IDirectSoundCaptureFXNoiseSuppress8 IDirectSoundCaptureFXNoiseSuppress +#define IDirectSoundFullDuplex8 IDirectSoundFullDuplex + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +typedef struct IDirectSound *LPDIRECTSOUND; +typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER; +typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER; +typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER; +typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE; +typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER; +typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY; + +#if DIRECTSOUND_VERSION >= 0x0800 + +typedef struct IDirectSoundFXGargle *LPDIRECTSOUNDFXGARGLE; +typedef struct IDirectSoundFXChorus *LPDIRECTSOUNDFXCHORUS; +typedef struct IDirectSoundFXFlanger *LPDIRECTSOUNDFXFLANGER; +typedef struct IDirectSoundFXEcho *LPDIRECTSOUNDFXECHO; +typedef struct IDirectSoundFXDistortion *LPDIRECTSOUNDFXDISTORTION; +typedef struct IDirectSoundFXCompressor *LPDIRECTSOUNDFXCOMPRESSOR; +typedef struct IDirectSoundFXParamEq *LPDIRECTSOUNDFXPARAMEQ; +typedef struct IDirectSoundFXWavesReverb *LPDIRECTSOUNDFXWAVESREVERB; +typedef struct IDirectSoundFXI3DL2Reverb *LPDIRECTSOUNDFXI3DL2REVERB; +typedef struct IDirectSoundCaptureFXAec *LPDIRECTSOUNDCAPTUREFXAEC; +typedef struct IDirectSoundCaptureFXNoiseSuppress *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS; +typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX; + +typedef struct IDirectSound8 *LPDIRECTSOUND8; +typedef struct IDirectSoundBuffer8 *LPDIRECTSOUNDBUFFER8; +typedef struct IDirectSound3DListener8 *LPDIRECTSOUND3DLISTENER8; +typedef struct IDirectSound3DBuffer8 *LPDIRECTSOUND3DBUFFER8; +typedef struct IDirectSoundCapture8 *LPDIRECTSOUNDCAPTURE8; +typedef struct IDirectSoundCaptureBuffer8 *LPDIRECTSOUNDCAPTUREBUFFER8; +typedef struct IDirectSoundNotify8 *LPDIRECTSOUNDNOTIFY8; +typedef struct IDirectSoundFXGargle8 *LPDIRECTSOUNDFXGARGLE8; +typedef struct IDirectSoundFXChorus8 *LPDIRECTSOUNDFXCHORUS8; +typedef struct IDirectSoundFXFlanger8 *LPDIRECTSOUNDFXFLANGER8; +typedef struct IDirectSoundFXEcho8 *LPDIRECTSOUNDFXECHO8; +typedef struct IDirectSoundFXDistortion8 *LPDIRECTSOUNDFXDISTORTION8; +typedef struct IDirectSoundFXCompressor8 *LPDIRECTSOUNDFXCOMPRESSOR8; +typedef struct IDirectSoundFXParamEq8 *LPDIRECTSOUNDFXPARAMEQ8; +typedef struct IDirectSoundFXWavesReverb8 *LPDIRECTSOUNDFXWAVESREVERB8; +typedef struct IDirectSoundFXI3DL2Reverb8 *LPDIRECTSOUNDFXI3DL2REVERB8; +typedef struct IDirectSoundCaptureFXAec8 *LPDIRECTSOUNDCAPTUREFXAEC8; +typedef struct IDirectSoundCaptureFXNoiseSuppress8 *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS8; +typedef struct IDirectSoundFullDuplex8 *LPDIRECTSOUNDFULLDUPLEX8; + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IID definitions for the unchanged DirectSound 8.0 interfaces +// + +#if DIRECTSOUND_VERSION >= 0x0800 + +#define IID_IDirectSoundCapture8 IID_IDirectSoundCapture +#define IID_IDirectSound3DListener8 IID_IDirectSound3DListener +#define IID_IDirectSound3DBuffer8 IID_IDirectSound3DBuffer +#define IID_IDirectSoundNotify8 IID_IDirectSoundNotify +#define IID_IDirectSoundFXGargle8 IID_IDirectSoundFXGargle +#define IID_IDirectSoundFXChorus8 IID_IDirectSoundFXChorus +#define IID_IDirectSoundFXFlanger8 IID_IDirectSoundFXFlanger +#define IID_IDirectSoundFXEcho8 IID_IDirectSoundFXEcho +#define IID_IDirectSoundFXDistortion8 IID_IDirectSoundFXDistortion +#define IID_IDirectSoundFXCompressor8 IID_IDirectSoundFXCompressor +#define IID_IDirectSoundFXParamEq8 IID_IDirectSoundFXParamEq +#define IID_IDirectSoundFXWavesReverb8 IID_IDirectSoundFXWavesReverb +#define IID_IDirectSoundFXI3DL2Reverb8 IID_IDirectSoundFXI3DL2Reverb +#define IID_IDirectSoundCaptureFXAec8 IID_IDirectSoundCaptureFXAec +#define IID_IDirectSoundCaptureFXNoiseSuppress8 IID_IDirectSoundCaptureFXNoiseSuppress +#define IID_IDirectSoundFullDuplex8 IID_IDirectSoundFullDuplex + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// Compatibility typedefs +// + +#ifndef _LPCWAVEFORMATEX_DEFINED +#define _LPCWAVEFORMATEX_DEFINED +typedef const WAVEFORMATEX *LPCWAVEFORMATEX; +#endif // _LPCWAVEFORMATEX_DEFINED + +#ifndef __LPCGUID_DEFINED__ +#define __LPCGUID_DEFINED__ +typedef const GUID *LPCGUID; +#endif // __LPCGUID_DEFINED__ + +typedef LPDIRECTSOUND *LPLPDIRECTSOUND; +typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER; +typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER; +typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER; +typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE; +typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER; +typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY; + +#if DIRECTSOUND_VERSION >= 0x0800 +typedef LPDIRECTSOUND8 *LPLPDIRECTSOUND8; +typedef LPDIRECTSOUNDBUFFER8 *LPLPDIRECTSOUNDBUFFER8; +typedef LPDIRECTSOUNDCAPTURE8 *LPLPDIRECTSOUNDCAPTURE8; +typedef LPDIRECTSOUNDCAPTUREBUFFER8 *LPLPDIRECTSOUNDCAPTUREBUFFER8; +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// Structures +// + +typedef struct _DSCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwMinSecondarySampleRate; + DWORD dwMaxSecondarySampleRate; + DWORD dwPrimaryBuffers; + DWORD dwMaxHwMixingAllBuffers; + DWORD dwMaxHwMixingStaticBuffers; + DWORD dwMaxHwMixingStreamingBuffers; + DWORD dwFreeHwMixingAllBuffers; + DWORD dwFreeHwMixingStaticBuffers; + DWORD dwFreeHwMixingStreamingBuffers; + DWORD dwMaxHw3DAllBuffers; + DWORD dwMaxHw3DStaticBuffers; + DWORD dwMaxHw3DStreamingBuffers; + DWORD dwFreeHw3DAllBuffers; + DWORD dwFreeHw3DStaticBuffers; + DWORD dwFreeHw3DStreamingBuffers; + DWORD dwTotalHwMemBytes; + DWORD dwFreeHwMemBytes; + DWORD dwMaxContigFreeHwMemBytes; + DWORD dwUnlockTransferRateHwBuffers; + DWORD dwPlayCpuOverheadSwBuffers; + DWORD dwReserved1; + DWORD dwReserved2; +} DSCAPS, *LPDSCAPS; + +typedef const DSCAPS *LPCDSCAPS; + +typedef struct _DSBCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwUnlockTransferRate; + DWORD dwPlayCpuOverhead; +} DSBCAPS, *LPDSBCAPS; + +typedef const DSBCAPS *LPCDSBCAPS; + +#if DIRECTSOUND_VERSION >= 0x0800 + + typedef struct _DSEFFECTDESC + { + DWORD dwSize; + DWORD dwFlags; + GUID guidDSFXClass; + DWORD_PTR dwReserved1; + DWORD_PTR dwReserved2; + } DSEFFECTDESC, *LPDSEFFECTDESC; + typedef const DSEFFECTDESC *LPCDSEFFECTDESC; + + #define DSFX_LOCHARDWARE 0x00000001 + #define DSFX_LOCSOFTWARE 0x00000002 + + enum + { + DSFXR_PRESENT, // 0 + DSFXR_LOCHARDWARE, // 1 + DSFXR_LOCSOFTWARE, // 2 + DSFXR_UNALLOCATED, // 3 + DSFXR_FAILED, // 4 + DSFXR_UNKNOWN, // 5 + DSFXR_SENDLOOP // 6 + }; + + typedef struct _DSCEFFECTDESC + { + DWORD dwSize; + DWORD dwFlags; + GUID guidDSCFXClass; + GUID guidDSCFXInstance; + DWORD dwReserved1; + DWORD dwReserved2; + } DSCEFFECTDESC, *LPDSCEFFECTDESC; + typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC; + + #define DSCFX_LOCHARDWARE 0x00000001 + #define DSCFX_LOCSOFTWARE 0x00000002 + + #define DSCFXR_LOCHARDWARE 0x00000010 + #define DSCFXR_LOCSOFTWARE 0x00000020 + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +typedef struct _DSBUFFERDESC +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +#if DIRECTSOUND_VERSION >= 0x0700 + GUID guid3DAlgorithm; +#endif +} DSBUFFERDESC, *LPDSBUFFERDESC; + +typedef const DSBUFFERDESC *LPCDSBUFFERDESC; + +// Older version of this structure: + +typedef struct _DSBUFFERDESC1 +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +} DSBUFFERDESC1, *LPDSBUFFERDESC1; + +typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1; + +typedef struct _DS3DBUFFER +{ + DWORD dwSize; + D3DVECTOR vPosition; + D3DVECTOR vVelocity; + DWORD dwInsideConeAngle; + DWORD dwOutsideConeAngle; + D3DVECTOR vConeOrientation; + LONG lConeOutsideVolume; + D3DVALUE flMinDistance; + D3DVALUE flMaxDistance; + DWORD dwMode; +} DS3DBUFFER, *LPDS3DBUFFER; + +typedef const DS3DBUFFER *LPCDS3DBUFFER; + +typedef struct _DS3DLISTENER +{ + DWORD dwSize; + D3DVECTOR vPosition; + D3DVECTOR vVelocity; + D3DVECTOR vOrientFront; + D3DVECTOR vOrientTop; + D3DVALUE flDistanceFactor; + D3DVALUE flRolloffFactor; + D3DVALUE flDopplerFactor; +} DS3DLISTENER, *LPDS3DLISTENER; + +typedef const DS3DLISTENER *LPCDS3DLISTENER; + +typedef struct _DSCCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwFormats; + DWORD dwChannels; +} DSCCAPS, *LPDSCCAPS; + +typedef const DSCCAPS *LPCDSCCAPS; + +typedef struct _DSCBUFFERDESC1 +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +} DSCBUFFERDESC1, *LPDSCBUFFERDESC1; + +typedef struct _DSCBUFFERDESC +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +#if DIRECTSOUND_VERSION >= 0x0800 + DWORD dwFXCount; + LPDSCEFFECTDESC lpDSCFXDesc; +#endif +} DSCBUFFERDESC, *LPDSCBUFFERDESC; + +typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC; + +typedef struct _DSCBCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; +} DSCBCAPS, *LPDSCBCAPS; + +typedef const DSCBCAPS *LPCDSCBCAPS; + +typedef struct _DSBPOSITIONNOTIFY +{ + DWORD dwOffset; + HANDLE hEventNotify; +} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY; + +typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY; + +// +// DirectSound API +// + +typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID); +typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID); + +extern HRESULT WINAPI DirectSoundCreate(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUND *ppDS, __null LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundEnumerateA(__in LPDSENUMCALLBACKA pDSEnumCallback, __in_opt LPVOID pContext); +extern HRESULT WINAPI DirectSoundEnumerateW(__in LPDSENUMCALLBACKW pDSEnumCallback, __in_opt LPVOID pContext); + +extern HRESULT WINAPI DirectSoundCaptureCreate(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUNDCAPTURE *ppDSC, __null LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundCaptureEnumerateA(__in LPDSENUMCALLBACKA pDSEnumCallback, __in_opt LPVOID pContext); +extern HRESULT WINAPI DirectSoundCaptureEnumerateW(__in LPDSENUMCALLBACKW pDSEnumCallback, __in_opt LPVOID pContext); + +#if DIRECTSOUND_VERSION >= 0x0800 +extern HRESULT WINAPI DirectSoundCreate8(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUND8 *ppDS8, __null LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundCaptureCreate8(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUNDCAPTURE8 *ppDSC8, __null LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundFullDuplexCreate +( + __in_opt LPCGUID pcGuidCaptureDevice, + __in_opt LPCGUID pcGuidRenderDevice, + __in LPCDSCBUFFERDESC pcDSCBufferDesc, + __in LPCDSBUFFERDESC pcDSBufferDesc, + HWND hWnd, + DWORD dwLevel, + __deref_out LPDIRECTSOUNDFULLDUPLEX* ppDSFD, + __deref_out LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, + __deref_out LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, + __null LPUNKNOWN pUnkOuter +); +#define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate + +extern HRESULT WINAPI GetDeviceID(__in_opt LPCGUID pGuidSrc, __out LPGUID pGuidDest); +#endif // DIRECTSOUND_VERSION >= 0x0800 + +#ifdef UNICODE +#define LPDSENUMCALLBACK LPDSENUMCALLBACKW +#define DirectSoundEnumerate DirectSoundEnumerateW +#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW +#else // UNICODE +#define LPDSENUMCALLBACK LPDSENUMCALLBACKA +#define DirectSoundEnumerate DirectSoundEnumerateA +#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA +#endif // UNICODE + +// +// IUnknown +// + +#if !defined(__cplusplus) || defined(CINTERFACE) +#ifndef IUnknown_QueryInterface +#define IUnknown_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#endif // IUnknown_QueryInterface +#ifndef IUnknown_AddRef +#define IUnknown_AddRef(p) (p)->lpVtbl->AddRef(p) +#endif // IUnknown_AddRef +#ifndef IUnknown_Release +#define IUnknown_Release(p) (p)->lpVtbl->Release(p) +#endif // IUnknown_Release +#else // !defined(__cplusplus) || defined(CINTERFACE) +#ifndef IUnknown_QueryInterface +#define IUnknown_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#endif // IUnknown_QueryInterface +#ifndef IUnknown_AddRef +#define IUnknown_AddRef(p) (p)->AddRef() +#endif // IUnknown_AddRef +#ifndef IUnknown_Release +#define IUnknown_Release(p) (p)->Release() +#endif // IUnknown_Release +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#ifndef __IReferenceClock_INTERFACE_DEFINED__ +#define __IReferenceClock_INTERFACE_DEFINED__ + +typedef LONGLONG REFERENCE_TIME; +typedef REFERENCE_TIME *LPREFERENCE_TIME; + +DEFINE_GUID(IID_IReferenceClock, 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); + +#undef INTERFACE +#define INTERFACE IReferenceClock + +DECLARE_INTERFACE_(IReferenceClock, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IReferenceClock methods + STDMETHOD(GetTime) (THIS_ __out REFERENCE_TIME *pTime) PURE; + STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime, + HANDLE hEvent, __out LPDWORD pdwAdviseCookie) PURE; + STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime, + HANDLE hSemaphore, __out LPDWORD pdwAdviseCookie) PURE; + STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE; +}; + +#endif // __IReferenceClock_INTERFACE_DEFINED__ + +#ifndef IReferenceClock_QueryInterface + +#define IReferenceClock_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IReferenceClock_AddRef(p) IUnknown_AddRef(p) +#define IReferenceClock_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IReferenceClock_GetTime(p,a) (p)->lpVtbl->GetTime(p,a) +#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->lpVtbl->AdviseTime(p,a,b,c,d) +#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->lpVtbl->AdvisePeriodic(p,a,b,c,d) +#define IReferenceClock_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IReferenceClock_GetTime(p,a) (p)->GetTime(a) +#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->AdviseTime(a,b,c,d) +#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->AdvisePeriodic(a,b,c,d) +#define IReferenceClock_Unadvise(p,a) (p)->Unadvise(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // IReferenceClock_QueryInterface + +// +// IDirectSound +// + +DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSound + +DECLARE_INTERFACE_(IDirectSound, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound methods + STDMETHOD(CreateSoundBuffer) (THIS_ __in LPCDSBUFFERDESC pcDSBufferDesc, __deref_out LPDIRECTSOUNDBUFFER *ppDSBuffer, __null LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(GetCaps) (THIS_ __out LPDSCAPS pDSCaps) PURE; + STDMETHOD(DuplicateSoundBuffer) (THIS_ __in LPDIRECTSOUNDBUFFER pDSBufferOriginal, __deref_out LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE; + STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE; + STDMETHOD(Compact) (THIS) PURE; + STDMETHOD(GetSpeakerConfig) (THIS_ __out LPDWORD pdwSpeakerConfig) PURE; + STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE; + STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE; +}; + +#define IDirectSound_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSound_AddRef(p) IUnknown_AddRef(p) +#define IDirectSound_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c) +#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b) +#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p) +#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a) +#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b) +#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c) +#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b) +#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectSound_Compact(p) (p)->Compact() +#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a) +#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b) +#define IDirectSound_Initialize(p,a) (p)->Initialize(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSound8 +// + +DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93, 0xF395, 0x4834, 0x9E, 0xF6, 0x7F, 0xA9, 0x9D, 0xE5, 0x09, 0x66); + +#undef INTERFACE +#define INTERFACE IDirectSound8 + +DECLARE_INTERFACE_(IDirectSound8, IDirectSound) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound methods + STDMETHOD(CreateSoundBuffer) (THIS_ __in LPCDSBUFFERDESC pcDSBufferDesc, __out LPDIRECTSOUNDBUFFER *ppDSBuffer, __null LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(GetCaps) (THIS_ __out LPDSCAPS pDSCaps) PURE; + STDMETHOD(DuplicateSoundBuffer) (THIS_ __in LPDIRECTSOUNDBUFFER pDSBufferOriginal, __out LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE; + STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE; + STDMETHOD(Compact) (THIS) PURE; + STDMETHOD(GetSpeakerConfig) (THIS_ __out LPDWORD pdwSpeakerConfig) PURE; + STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE; + STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE; + + // IDirectSound8 methods + STDMETHOD(VerifyCertification) (THIS_ __out LPDWORD pdwCertified) PURE; +}; + +#define IDirectSound8_QueryInterface(p,a,b) IDirectSound_QueryInterface(p,a,b) +#define IDirectSound8_AddRef(p) IDirectSound_AddRef(p) +#define IDirectSound8_Release(p) IDirectSound_Release(p) +#define IDirectSound8_CreateSoundBuffer(p,a,b,c) IDirectSound_CreateSoundBuffer(p,a,b,c) +#define IDirectSound8_GetCaps(p,a) IDirectSound_GetCaps(p,a) +#define IDirectSound8_DuplicateSoundBuffer(p,a,b) IDirectSound_DuplicateSoundBuffer(p,a,b) +#define IDirectSound8_SetCooperativeLevel(p,a,b) IDirectSound_SetCooperativeLevel(p,a,b) +#define IDirectSound8_Compact(p) IDirectSound_Compact(p) +#define IDirectSound8_GetSpeakerConfig(p,a) IDirectSound_GetSpeakerConfig(p,a) +#define IDirectSound8_SetSpeakerConfig(p,a) IDirectSound_SetSpeakerConfig(p,a) +#define IDirectSound8_Initialize(p,a) IDirectSound_Initialize(p,a) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound8_VerifyCertification(p,a) (p)->lpVtbl->VerifyCertification(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound8_VerifyCertification(p,a) (p)->VerifyCertification(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundBuffer +// + +DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSoundBuffer + +DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundBuffer methods + STDMETHOD(GetCaps) (THIS_ __out LPDSBCAPS pDSBufferCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCurrentPlayCursor, __out_opt LPDWORD pdwCurrentWriteCursor) PURE; + STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetVolume) (THIS_ __out LPLONG plVolume) PURE; + STDMETHOD(GetPan) (THIS_ __out LPLONG plPan) PURE; + STDMETHOD(GetFrequency) (THIS_ __out LPDWORD pdwFrequency) PURE; + STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUND pDirectSound, __in LPCDSBUFFERDESC pcDSBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, + __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, + __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE; + STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE; + STDMETHOD(SetFormat) (THIS_ __in LPCWAVEFORMATEX pcfxFormat) PURE; + STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE; + STDMETHOD(SetPan) (THIS_ LONG lPan) PURE; + STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, + __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; + STDMETHOD(Restore) (THIS) PURE; +}; + +#define IDirectSoundBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundBuffer_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundBuffer_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b) +#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) +#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a) +#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a) +#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a) +#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) +#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c) +#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a) +#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a) +#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a) +#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a) +#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a) +#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p) +#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) +#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b) +#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c) +#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a) +#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a) +#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a) +#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a) +#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g) +#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c) +#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a) +#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a) +#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a) +#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a) +#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a) +#define IDirectSoundBuffer_Stop(p) (p)->Stop() +#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d) +#define IDirectSoundBuffer_Restore(p) (p)->Restore() +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundBuffer8 +// + +DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825a449, 0x7524, 0x4d82, 0x92, 0x0f, 0x50, 0xe3, 0x6a, 0xb3, 0xab, 0x1e); + +#undef INTERFACE +#define INTERFACE IDirectSoundBuffer8 + +DECLARE_INTERFACE_(IDirectSoundBuffer8, IDirectSoundBuffer) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundBuffer methods + STDMETHOD(GetCaps) (THIS_ __out LPDSBCAPS pDSBufferCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCurrentPlayCursor, __out_opt LPDWORD pdwCurrentWriteCursor) PURE; + STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetVolume) (THIS_ __out LPLONG plVolume) PURE; + STDMETHOD(GetPan) (THIS_ __out LPLONG plPan) PURE; + STDMETHOD(GetFrequency) (THIS_ __out LPDWORD pdwFrequency) PURE; + STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUND pDirectSound, __in LPCDSBUFFERDESC pcDSBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, + __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, + __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE; + STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE; + STDMETHOD(SetFormat) (THIS_ __in LPCWAVEFORMATEX pcfxFormat) PURE; + STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE; + STDMETHOD(SetPan) (THIS_ LONG lPan) PURE; + STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, + __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; + STDMETHOD(Restore) (THIS) PURE; + + // IDirectSoundBuffer8 methods + STDMETHOD(SetFX) (THIS_ DWORD dwEffectsCount, __in_ecount_opt(dwEffectsCount) LPDSEFFECTDESC pDSFXDesc, __out_ecount_opt(dwEffectsCount) LPDWORD pdwResultCodes) PURE; + STDMETHOD(AcquireResources) (THIS_ DWORD dwFlags, DWORD dwEffectsCount, __out_ecount(dwEffectsCount) LPDWORD pdwResultCodes) PURE; + STDMETHOD(GetObjectInPath) (THIS_ __in REFGUID rguidObject, DWORD dwIndex, __in REFGUID rguidInterface, __deref_out LPVOID *ppObject) PURE; +}; + +// Special GUID meaning "select all objects" for use in GetObjectInPath() +DEFINE_GUID(GUID_All_Objects, 0xaa114de5, 0xc262, 0x4169, 0xa1, 0xc8, 0x23, 0xd6, 0x98, 0xcc, 0x73, 0xb5); + +#define IDirectSoundBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundBuffer8_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundBuffer8_Release(p) IUnknown_Release(p) + +#define IDirectSoundBuffer8_GetCaps(p,a) IDirectSoundBuffer_GetCaps(p,a) +#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b) IDirectSoundBuffer_GetCurrentPosition(p,a,b) +#define IDirectSoundBuffer8_GetFormat(p,a,b,c) IDirectSoundBuffer_GetFormat(p,a,b,c) +#define IDirectSoundBuffer8_GetVolume(p,a) IDirectSoundBuffer_GetVolume(p,a) +#define IDirectSoundBuffer8_GetPan(p,a) IDirectSoundBuffer_GetPan(p,a) +#define IDirectSoundBuffer8_GetFrequency(p,a) IDirectSoundBuffer_GetFrequency(p,a) +#define IDirectSoundBuffer8_GetStatus(p,a) IDirectSoundBuffer_GetStatus(p,a) +#define IDirectSoundBuffer8_Initialize(p,a,b) IDirectSoundBuffer_Initialize(p,a,b) +#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundBuffer8_Play(p,a,b,c) IDirectSoundBuffer_Play(p,a,b,c) +#define IDirectSoundBuffer8_SetCurrentPosition(p,a) IDirectSoundBuffer_SetCurrentPosition(p,a) +#define IDirectSoundBuffer8_SetFormat(p,a) IDirectSoundBuffer_SetFormat(p,a) +#define IDirectSoundBuffer8_SetVolume(p,a) IDirectSoundBuffer_SetVolume(p,a) +#define IDirectSoundBuffer8_SetPan(p,a) IDirectSoundBuffer_SetPan(p,a) +#define IDirectSoundBuffer8_SetFrequency(p,a) IDirectSoundBuffer_SetFrequency(p,a) +#define IDirectSoundBuffer8_Stop(p) IDirectSoundBuffer_Stop(p) +#define IDirectSoundBuffer8_Unlock(p,a,b,c,d) IDirectSoundBuffer_Unlock(p,a,b,c,d) +#define IDirectSoundBuffer8_Restore(p) IDirectSoundBuffer_Restore(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->lpVtbl->SetFX(p,a,b,c) +#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->lpVtbl->AcquireResources(p,a,b,c) +#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->SetFX(a,b,c) +#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->AcquireResources(a,b,c) +#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSound3DListener +// + +DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSound3DListener + +DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound3DListener methods + STDMETHOD(GetAllParameters) (THIS_ __out LPDS3DLISTENER pListener) PURE; + STDMETHOD(GetDistanceFactor) (THIS_ __out D3DVALUE* pflDistanceFactor) PURE; + STDMETHOD(GetDopplerFactor) (THIS_ __out D3DVALUE* pflDopplerFactor) PURE; + STDMETHOD(GetOrientation) (THIS_ __out D3DVECTOR* pvOrientFront, __out D3DVECTOR* pvOrientTop) PURE; + STDMETHOD(GetPosition) (THIS_ __out D3DVECTOR* pvPosition) PURE; + STDMETHOD(GetRolloffFactor) (THIS_ __out D3DVALUE* pflRolloffFactor) PURE; + STDMETHOD(GetVelocity) (THIS_ __out D3DVECTOR* pvVelocity) PURE; + STDMETHOD(SetAllParameters) (THIS_ __in LPCDS3DLISTENER pcListener, DWORD dwApply) PURE; + STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE; + STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE; + STDMETHOD(SetOrientation) (THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, + D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE; + STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE; + STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(CommitDeferredSettings) (THIS) PURE; +}; + +#define IDirectSound3DListener_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSound3DListener_AddRef(p) IUnknown_AddRef(p) +#define IDirectSound3DListener_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a) +#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a) +#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b) +#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a) +#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a) +#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a) +#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b) +#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b) +#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b) +#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g) +#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) +#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b) +#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d) +#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a) +#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a) +#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a) +#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b) +#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a) +#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a) +#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a) +#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b) +#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b) +#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b) +#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g) +#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) +#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b) +#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d) +#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings() +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSound3DBuffer +// + +DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSound3DBuffer + +DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound3DBuffer methods + STDMETHOD(GetAllParameters) (THIS_ __out LPDS3DBUFFER pDs3dBuffer) PURE; + STDMETHOD(GetConeAngles) (THIS_ __out LPDWORD pdwInsideConeAngle, __out LPDWORD pdwOutsideConeAngle) PURE; + STDMETHOD(GetConeOrientation) (THIS_ __out D3DVECTOR* pvOrientation) PURE; + STDMETHOD(GetConeOutsideVolume) (THIS_ __out LPLONG plConeOutsideVolume) PURE; + STDMETHOD(GetMaxDistance) (THIS_ __out D3DVALUE* pflMaxDistance) PURE; + STDMETHOD(GetMinDistance) (THIS_ __out D3DVALUE* pflMinDistance) PURE; + STDMETHOD(GetMode) (THIS_ __out LPDWORD pdwMode) PURE; + STDMETHOD(GetPosition) (THIS_ __out D3DVECTOR* pvPosition) PURE; + STDMETHOD(GetVelocity) (THIS_ __out D3DVECTOR* pvVelocity) PURE; + STDMETHOD(SetAllParameters) (THIS_ __in LPCDS3DBUFFER pcDs3dBuffer, DWORD dwApply) PURE; + STDMETHOD(SetConeAngles) (THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE; + STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(SetConeOutsideVolume) (THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE; + STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE; + STDMETHOD(SetMinDistance) (THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE; + STDMETHOD(SetMode) (THIS_ DWORD dwMode, DWORD dwApply) PURE; + STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; +}; + +#define IDirectSound3DBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSound3DBuffer_AddRef(p) IUnknown_AddRef(p) +#define IDirectSound3DBuffer_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b) +#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a) +#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a) +#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a) +#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a) +#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a) +#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a) +#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a) +#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b) +#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c) +#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d) +#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->lpVtbl->SetConeOutsideVolume(p,a,b) +#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) +#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b) +#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b) +#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b) +#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a) +#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b) +#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a) +#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a) +#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a) +#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a) +#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a) +#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a) +#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a) +#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b) +#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c) +#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d) +#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->SetConeOutsideVolume(a,b) +#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) +#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b) +#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b) +#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b) +#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundCapture +// + +DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +#undef INTERFACE +#define INTERFACE IDirectSoundCapture + +DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCapture methods + STDMETHOD(CreateCaptureBuffer) (THIS_ __in LPCDSCBUFFERDESC pcDSCBufferDesc, __deref_out LPDIRECTSOUNDCAPTUREBUFFER *ppDSCBuffer, __null LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(GetCaps) (THIS_ __out LPDSCCAPS pDSCCaps) PURE; + STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE; +}; + +#define IDirectSoundCapture_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCapture_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCapture_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c) +#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c) +#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundCaptureBuffer +// + +DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureBuffer + +DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureBuffer methods + STDMETHOD(GetCaps) (THIS_ __out LPDSCBCAPS pDSCBCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCapturePosition, __out_opt LPDWORD pdwReadPosition) PURE; + STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUNDCAPTURE pDirectSoundCapture, __in LPCDSCBUFFERDESC pcDSCBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, + __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, + __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, + __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; +}; + +#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureBuffer_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureBuffer_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b) +#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) +#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) +#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a) +#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p) +#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b) +#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c) +#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a) +#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g) +#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a) +#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop() +#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundCaptureBuffer8 +// + +DEFINE_GUID(IID_IDirectSoundCaptureBuffer8, 0x990df4, 0xdbb, 0x4872, 0x83, 0x3e, 0x6d, 0x30, 0x3e, 0x80, 0xae, 0xb6); + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureBuffer8 + +DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8, IDirectSoundCaptureBuffer) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureBuffer methods + STDMETHOD(GetCaps) (THIS_ __out LPDSCBCAPS pDSCBCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCapturePosition, __out_opt LPDWORD pdwReadPosition) PURE; + STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUNDCAPTURE pDirectSoundCapture, __in LPCDSCBUFFERDESC pcDSCBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, + __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, + __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, + __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; + + // IDirectSoundCaptureBuffer8 methods + STDMETHOD(GetObjectInPath) (THIS_ __in REFGUID rguidObject, DWORD dwIndex, __in REFGUID rguidInterface, __deref_out LPVOID *ppObject) PURE; + STDMETHOD(GetFXStatus) (DWORD dwEffectsCount, __out_ecount(dwEffectsCount) LPDWORD pdwFXStatus) PURE; +}; + +#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureBuffer8_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureBuffer8_Release(p) IUnknown_Release(p) + +#define IDirectSoundCaptureBuffer8_GetCaps(p,a) IDirectSoundCaptureBuffer_GetCaps(p,a) +#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b) IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) +#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c) IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) +#define IDirectSoundCaptureBuffer8_GetStatus(p,a) IDirectSoundCaptureBuffer_GetStatus(p,a) +#define IDirectSoundCaptureBuffer8_Initialize(p,a,b) IDirectSoundCaptureBuffer_Initialize(p,a,b) +#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundCaptureBuffer8_Start(p,a) IDirectSoundCaptureBuffer_Start(p,a) +#define IDirectSoundCaptureBuffer8_Stop(p) IDirectSoundCaptureBuffer_Stop(p)) +#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d) IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d) +#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->lpVtbl->GetFXStatus(p,a,b) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d) +#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->GetFXStatus(a,b) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundNotify +// + +DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +#undef INTERFACE +#define INTERFACE IDirectSoundNotify + +DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundNotify methods + STDMETHOD(SetNotificationPositions) (THIS_ DWORD dwPositionNotifies, __in_ecount(dwPositionNotifies) LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE; +}; + +#define IDirectSoundNotify_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundNotify_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundNotify_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IKsPropertySet +// + +#ifndef _IKsPropertySet_ +#define _IKsPropertySet_ + +#ifdef __cplusplus +// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined +struct IKsPropertySet; +#endif // __cplusplus + +typedef struct IKsPropertySet *LPKSPROPERTYSET; + +#define KSPROPERTY_SUPPORT_GET 0x00000001 +#define KSPROPERTY_SUPPORT_SET 0x00000002 + +DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93); + +#undef INTERFACE +#define INTERFACE IKsPropertySet + +DECLARE_INTERFACE_(IKsPropertySet, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IKsPropertySet methods + STDMETHOD(Get) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __in_bcount(ulInstanceLength) LPVOID pInstanceData, ULONG ulInstanceLength, + __out_bcount(ulDataLength) LPVOID pPropertyData, ULONG ulDataLength, __out PULONG pulBytesReturned) PURE; + STDMETHOD(Set) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __in_bcount(ulInstanceLength) LPVOID pInstanceData, ULONG ulInstanceLength, + __in_bcount(ulDataLength) LPVOID pPropertyData, ULONG ulDataLength) PURE; + STDMETHOD(QuerySupport) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __out PULONG pulTypeSupport) PURE; +}; + +#define IKsPropertySet_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IKsPropertySet_AddRef(p) IUnknown_AddRef(p) +#define IKsPropertySet_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g) +#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f) +#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g) +#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f) +#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // _IKsPropertySet_ + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundFXGargle +// + +DEFINE_GUID(IID_IDirectSoundFXGargle, 0xd616f352, 0xd622, 0x11ce, 0xaa, 0xc5, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3); + +typedef struct _DSFXGargle +{ + DWORD dwRateHz; // Rate of modulation in hz + DWORD dwWaveShape; // DSFXGARGLE_WAVE_xxx +} DSFXGargle, *LPDSFXGargle; + +#define DSFXGARGLE_WAVE_TRIANGLE 0 +#define DSFXGARGLE_WAVE_SQUARE 1 + +typedef const DSFXGargle *LPCDSFXGargle; + +#define DSFXGARGLE_RATEHZ_MIN 1 +#define DSFXGARGLE_RATEHZ_MAX 1000 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXGargle + +DECLARE_INTERFACE_(IDirectSoundFXGargle, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXGargle methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXGargle pcDsFxGargle) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXGargle pDsFxGargle) PURE; +}; + +#define IDirectSoundFXGargle_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXGargle_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXGargle_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXChorus +// + +DEFINE_GUID(IID_IDirectSoundFXChorus, 0x880842e3, 0x145f, 0x43e6, 0xa9, 0x34, 0xa7, 0x18, 0x06, 0xe5, 0x05, 0x47); + +typedef struct _DSFXChorus +{ + FLOAT fWetDryMix; + FLOAT fDepth; + FLOAT fFeedback; + FLOAT fFrequency; + LONG lWaveform; // LFO shape; DSFXCHORUS_WAVE_xxx + FLOAT fDelay; + LONG lPhase; +} DSFXChorus, *LPDSFXChorus; + +typedef const DSFXChorus *LPCDSFXChorus; + +#define DSFXCHORUS_WAVE_TRIANGLE 0 +#define DSFXCHORUS_WAVE_SIN 1 + +#define DSFXCHORUS_WETDRYMIX_MIN 0.0f +#define DSFXCHORUS_WETDRYMIX_MAX 100.0f +#define DSFXCHORUS_DEPTH_MIN 0.0f +#define DSFXCHORUS_DEPTH_MAX 100.0f +#define DSFXCHORUS_FEEDBACK_MIN -99.0f +#define DSFXCHORUS_FEEDBACK_MAX 99.0f +#define DSFXCHORUS_FREQUENCY_MIN 0.0f +#define DSFXCHORUS_FREQUENCY_MAX 10.0f +#define DSFXCHORUS_DELAY_MIN 0.0f +#define DSFXCHORUS_DELAY_MAX 20.0f +#define DSFXCHORUS_PHASE_MIN 0 +#define DSFXCHORUS_PHASE_MAX 4 + +#define DSFXCHORUS_PHASE_NEG_180 0 +#define DSFXCHORUS_PHASE_NEG_90 1 +#define DSFXCHORUS_PHASE_ZERO 2 +#define DSFXCHORUS_PHASE_90 3 +#define DSFXCHORUS_PHASE_180 4 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXChorus + +DECLARE_INTERFACE_(IDirectSoundFXChorus, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXChorus methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXChorus pcDsFxChorus) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXChorus pDsFxChorus) PURE; +}; + +#define IDirectSoundFXChorus_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXChorus_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXChorus_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXFlanger +// + +DEFINE_GUID(IID_IDirectSoundFXFlanger, 0x903e9878, 0x2c92, 0x4072, 0x9b, 0x2c, 0xea, 0x68, 0xf5, 0x39, 0x67, 0x83); + +typedef struct _DSFXFlanger +{ + FLOAT fWetDryMix; + FLOAT fDepth; + FLOAT fFeedback; + FLOAT fFrequency; + LONG lWaveform; + FLOAT fDelay; + LONG lPhase; +} DSFXFlanger, *LPDSFXFlanger; + +typedef const DSFXFlanger *LPCDSFXFlanger; + +#define DSFXFLANGER_WAVE_TRIANGLE 0 +#define DSFXFLANGER_WAVE_SIN 1 + +#define DSFXFLANGER_WETDRYMIX_MIN 0.0f +#define DSFXFLANGER_WETDRYMIX_MAX 100.0f +#define DSFXFLANGER_FREQUENCY_MIN 0.0f +#define DSFXFLANGER_FREQUENCY_MAX 10.0f +#define DSFXFLANGER_DEPTH_MIN 0.0f +#define DSFXFLANGER_DEPTH_MAX 100.0f +#define DSFXFLANGER_PHASE_MIN 0 +#define DSFXFLANGER_PHASE_MAX 4 +#define DSFXFLANGER_FEEDBACK_MIN -99.0f +#define DSFXFLANGER_FEEDBACK_MAX 99.0f +#define DSFXFLANGER_DELAY_MIN 0.0f +#define DSFXFLANGER_DELAY_MAX 4.0f + +#define DSFXFLANGER_PHASE_NEG_180 0 +#define DSFXFLANGER_PHASE_NEG_90 1 +#define DSFXFLANGER_PHASE_ZERO 2 +#define DSFXFLANGER_PHASE_90 3 +#define DSFXFLANGER_PHASE_180 4 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXFlanger + +DECLARE_INTERFACE_(IDirectSoundFXFlanger, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXFlanger methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXFlanger pcDsFxFlanger) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXFlanger pDsFxFlanger) PURE; +}; + +#define IDirectSoundFXFlanger_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXFlanger_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXFlanger_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXEcho +// + +DEFINE_GUID(IID_IDirectSoundFXEcho, 0x8bd28edf, 0x50db, 0x4e92, 0xa2, 0xbd, 0x44, 0x54, 0x88, 0xd1, 0xed, 0x42); + +typedef struct _DSFXEcho +{ + FLOAT fWetDryMix; + FLOAT fFeedback; + FLOAT fLeftDelay; + FLOAT fRightDelay; + LONG lPanDelay; +} DSFXEcho, *LPDSFXEcho; + +typedef const DSFXEcho *LPCDSFXEcho; + +#define DSFXECHO_WETDRYMIX_MIN 0.0f +#define DSFXECHO_WETDRYMIX_MAX 100.0f +#define DSFXECHO_FEEDBACK_MIN 0.0f +#define DSFXECHO_FEEDBACK_MAX 100.0f +#define DSFXECHO_LEFTDELAY_MIN 1.0f +#define DSFXECHO_LEFTDELAY_MAX 2000.0f +#define DSFXECHO_RIGHTDELAY_MIN 1.0f +#define DSFXECHO_RIGHTDELAY_MAX 2000.0f +#define DSFXECHO_PANDELAY_MIN 0 +#define DSFXECHO_PANDELAY_MAX 1 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXEcho + +DECLARE_INTERFACE_(IDirectSoundFXEcho, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXEcho methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXEcho pcDsFxEcho) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXEcho pDsFxEcho) PURE; +}; + +#define IDirectSoundFXEcho_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXEcho_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXEcho_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXDistortion +// + +DEFINE_GUID(IID_IDirectSoundFXDistortion, 0x8ecf4326, 0x455f, 0x4d8b, 0xbd, 0xa9, 0x8d, 0x5d, 0x3e, 0x9e, 0x3e, 0x0b); + +typedef struct _DSFXDistortion +{ + FLOAT fGain; + FLOAT fEdge; + FLOAT fPostEQCenterFrequency; + FLOAT fPostEQBandwidth; + FLOAT fPreLowpassCutoff; +} DSFXDistortion, *LPDSFXDistortion; + +typedef const DSFXDistortion *LPCDSFXDistortion; + +#define DSFXDISTORTION_GAIN_MIN -60.0f +#define DSFXDISTORTION_GAIN_MAX 0.0f +#define DSFXDISTORTION_EDGE_MIN 0.0f +#define DSFXDISTORTION_EDGE_MAX 100.0f +#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN 100.0f +#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX 8000.0f +#define DSFXDISTORTION_POSTEQBANDWIDTH_MIN 100.0f +#define DSFXDISTORTION_POSTEQBANDWIDTH_MAX 8000.0f +#define DSFXDISTORTION_PRELOWPASSCUTOFF_MIN 100.0f +#define DSFXDISTORTION_PRELOWPASSCUTOFF_MAX 8000.0f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXDistortion + +DECLARE_INTERFACE_(IDirectSoundFXDistortion, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXDistortion methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXDistortion pcDsFxDistortion) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXDistortion pDsFxDistortion) PURE; +}; + +#define IDirectSoundFXDistortion_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXDistortion_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXDistortion_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXCompressor +// + +DEFINE_GUID(IID_IDirectSoundFXCompressor, 0x4bbd1154, 0x62f6, 0x4e2c, 0xa1, 0x5c, 0xd3, 0xb6, 0xc4, 0x17, 0xf7, 0xa0); + +typedef struct _DSFXCompressor +{ + FLOAT fGain; + FLOAT fAttack; + FLOAT fRelease; + FLOAT fThreshold; + FLOAT fRatio; + FLOAT fPredelay; +} DSFXCompressor, *LPDSFXCompressor; + +typedef const DSFXCompressor *LPCDSFXCompressor; + +#define DSFXCOMPRESSOR_GAIN_MIN -60.0f +#define DSFXCOMPRESSOR_GAIN_MAX 60.0f +#define DSFXCOMPRESSOR_ATTACK_MIN 0.01f +#define DSFXCOMPRESSOR_ATTACK_MAX 500.0f +#define DSFXCOMPRESSOR_RELEASE_MIN 50.0f +#define DSFXCOMPRESSOR_RELEASE_MAX 3000.0f +#define DSFXCOMPRESSOR_THRESHOLD_MIN -60.0f +#define DSFXCOMPRESSOR_THRESHOLD_MAX 0.0f +#define DSFXCOMPRESSOR_RATIO_MIN 1.0f +#define DSFXCOMPRESSOR_RATIO_MAX 100.0f +#define DSFXCOMPRESSOR_PREDELAY_MIN 0.0f +#define DSFXCOMPRESSOR_PREDELAY_MAX 4.0f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXCompressor + +DECLARE_INTERFACE_(IDirectSoundFXCompressor, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXCompressor methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXCompressor pcDsFxCompressor) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXCompressor pDsFxCompressor) PURE; +}; + +#define IDirectSoundFXCompressor_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXCompressor_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXCompressor_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXParamEq +// + +DEFINE_GUID(IID_IDirectSoundFXParamEq, 0xc03ca9fe, 0xfe90, 0x4204, 0x80, 0x78, 0x82, 0x33, 0x4c, 0xd1, 0x77, 0xda); + +typedef struct _DSFXParamEq +{ + FLOAT fCenter; + FLOAT fBandwidth; + FLOAT fGain; +} DSFXParamEq, *LPDSFXParamEq; + +typedef const DSFXParamEq *LPCDSFXParamEq; + +#define DSFXPARAMEQ_CENTER_MIN 80.0f +#define DSFXPARAMEQ_CENTER_MAX 16000.0f +#define DSFXPARAMEQ_BANDWIDTH_MIN 1.0f +#define DSFXPARAMEQ_BANDWIDTH_MAX 36.0f +#define DSFXPARAMEQ_GAIN_MIN -15.0f +#define DSFXPARAMEQ_GAIN_MAX 15.0f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXParamEq + +DECLARE_INTERFACE_(IDirectSoundFXParamEq, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXParamEq methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXParamEq pcDsFxParamEq) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXParamEq pDsFxParamEq) PURE; +}; + +#define IDirectSoundFXParamEq_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXParamEq_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXParamEq_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXI3DL2Reverb +// + +DEFINE_GUID(IID_IDirectSoundFXI3DL2Reverb, 0x4b166a6a, 0x0d66, 0x43f3, 0x80, 0xe3, 0xee, 0x62, 0x80, 0xde, 0xe1, 0xa4); + +typedef struct _DSFXI3DL2Reverb +{ + LONG lRoom; // [-10000, 0] default: -1000 mB + LONG lRoomHF; // [-10000, 0] default: 0 mB + FLOAT flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 + FLOAT flDecayTime; // [0.1, 20.0] default: 1.49s + FLOAT flDecayHFRatio; // [0.1, 2.0] default: 0.83 + LONG lReflections; // [-10000, 1000] default: -2602 mB + FLOAT flReflectionsDelay; // [0.0, 0.3] default: 0.007 s + LONG lReverb; // [-10000, 2000] default: 200 mB + FLOAT flReverbDelay; // [0.0, 0.1] default: 0.011 s + FLOAT flDiffusion; // [0.0, 100.0] default: 100.0 % + FLOAT flDensity; // [0.0, 100.0] default: 100.0 % + FLOAT flHFReference; // [20.0, 20000.0] default: 5000.0 Hz +} DSFXI3DL2Reverb, *LPDSFXI3DL2Reverb; + +typedef const DSFXI3DL2Reverb *LPCDSFXI3DL2Reverb; + +#define DSFX_I3DL2REVERB_ROOM_MIN (-10000) +#define DSFX_I3DL2REVERB_ROOM_MAX 0 +#define DSFX_I3DL2REVERB_ROOM_DEFAULT (-1000) + +#define DSFX_I3DL2REVERB_ROOMHF_MIN (-10000) +#define DSFX_I3DL2REVERB_ROOMHF_MAX 0 +#define DSFX_I3DL2REVERB_ROOMHF_DEFAULT (-100) + +#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN 0.0f +#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX 10.0f +#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT 0.0f + +#define DSFX_I3DL2REVERB_DECAYTIME_MIN 0.1f +#define DSFX_I3DL2REVERB_DECAYTIME_MAX 20.0f +#define DSFX_I3DL2REVERB_DECAYTIME_DEFAULT 1.49f + +#define DSFX_I3DL2REVERB_DECAYHFRATIO_MIN 0.1f +#define DSFX_I3DL2REVERB_DECAYHFRATIO_MAX 2.0f +#define DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT 0.83f + +#define DSFX_I3DL2REVERB_REFLECTIONS_MIN (-10000) +#define DSFX_I3DL2REVERB_REFLECTIONS_MAX 1000 +#define DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT (-2602) + +#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN 0.0f +#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX 0.3f +#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT 0.007f + +#define DSFX_I3DL2REVERB_REVERB_MIN (-10000) +#define DSFX_I3DL2REVERB_REVERB_MAX 2000 +#define DSFX_I3DL2REVERB_REVERB_DEFAULT (200) + +#define DSFX_I3DL2REVERB_REVERBDELAY_MIN 0.0f +#define DSFX_I3DL2REVERB_REVERBDELAY_MAX 0.1f +#define DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT 0.011f + +#define DSFX_I3DL2REVERB_DIFFUSION_MIN 0.0f +#define DSFX_I3DL2REVERB_DIFFUSION_MAX 100.0f +#define DSFX_I3DL2REVERB_DIFFUSION_DEFAULT 100.0f + +#define DSFX_I3DL2REVERB_DENSITY_MIN 0.0f +#define DSFX_I3DL2REVERB_DENSITY_MAX 100.0f +#define DSFX_I3DL2REVERB_DENSITY_DEFAULT 100.0f + +#define DSFX_I3DL2REVERB_HFREFERENCE_MIN 20.0f +#define DSFX_I3DL2REVERB_HFREFERENCE_MAX 20000.0f +#define DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT 5000.0f + +#define DSFX_I3DL2REVERB_QUALITY_MIN 0 +#define DSFX_I3DL2REVERB_QUALITY_MAX 3 +#define DSFX_I3DL2REVERB_QUALITY_DEFAULT 2 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXI3DL2Reverb + +DECLARE_INTERFACE_(IDirectSoundFXI3DL2Reverb, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXI3DL2Reverb methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXI3DL2Reverb pcDsFxI3DL2Reverb) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXI3DL2Reverb pDsFxI3DL2Reverb) PURE; + STDMETHOD(SetPreset) (THIS_ DWORD dwPreset) PURE; + STDMETHOD(GetPreset) (THIS_ __out LPDWORD pdwPreset) PURE; + STDMETHOD(SetQuality) (THIS_ LONG lQuality) PURE; + STDMETHOD(GetQuality) (THIS_ __out LONG *plQuality) PURE; +}; + +#define IDirectSoundFXI3DL2Reverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXI3DL2Reverb_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXI3DL2Reverb_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->lpVtbl->SetPreset(p,a) +#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->lpVtbl->GetPreset(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->GetAllParameters(a) +#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->SetPreset(a) +#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->GetPreset(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXWavesReverb +// + +DEFINE_GUID(IID_IDirectSoundFXWavesReverb,0x46858c3a,0x0dc6,0x45e3,0xb7,0x60,0xd4,0xee,0xf1,0x6c,0xb3,0x25); + +typedef struct _DSFXWavesReverb +{ + FLOAT fInGain; // [-96.0,0.0] default: 0.0 dB + FLOAT fReverbMix; // [-96.0,0.0] default: 0.0 db + FLOAT fReverbTime; // [0.001,3000.0] default: 1000.0 ms + FLOAT fHighFreqRTRatio; // [0.001,0.999] default: 0.001 +} DSFXWavesReverb, *LPDSFXWavesReverb; + +typedef const DSFXWavesReverb *LPCDSFXWavesReverb; + +#define DSFX_WAVESREVERB_INGAIN_MIN -96.0f +#define DSFX_WAVESREVERB_INGAIN_MAX 0.0f +#define DSFX_WAVESREVERB_INGAIN_DEFAULT 0.0f +#define DSFX_WAVESREVERB_REVERBMIX_MIN -96.0f +#define DSFX_WAVESREVERB_REVERBMIX_MAX 0.0f +#define DSFX_WAVESREVERB_REVERBMIX_DEFAULT 0.0f +#define DSFX_WAVESREVERB_REVERBTIME_MIN 0.001f +#define DSFX_WAVESREVERB_REVERBTIME_MAX 3000.0f +#define DSFX_WAVESREVERB_REVERBTIME_DEFAULT 1000.0f +#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN 0.001f +#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX 0.999f +#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT 0.001f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXWavesReverb + +DECLARE_INTERFACE_(IDirectSoundFXWavesReverb, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXWavesReverb methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXWavesReverb pcDsFxWavesReverb) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXWavesReverb pDsFxWavesReverb) PURE; +}; + +#define IDirectSoundFXWavesReverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXWavesReverb_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXWavesReverb_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundCaptureFXAec +// + +DEFINE_GUID(IID_IDirectSoundCaptureFXAec, 0xad74143d, 0x903d, 0x4ab7, 0x80, 0x66, 0x28, 0xd3, 0x63, 0x03, 0x6d, 0x65); + +typedef struct _DSCFXAec +{ + BOOL fEnable; + BOOL fNoiseFill; + DWORD dwMode; +} DSCFXAec, *LPDSCFXAec; + +typedef const DSCFXAec *LPCDSCFXAec; + +// These match the AEC_MODE_* constants in the DDK's ksmedia.h file +#define DSCFX_AEC_MODE_PASS_THROUGH 0x0 +#define DSCFX_AEC_MODE_HALF_DUPLEX 0x1 +#define DSCFX_AEC_MODE_FULL_DUPLEX 0x2 + +// These match the AEC_STATUS_* constants in ksmedia.h +#define DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED 0x0 +#define DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED 0x1 +#define DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED 0x2 +#define DSCFX_AEC_STATUS_CURRENTLY_CONVERGED 0x8 + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureFXAec + +DECLARE_INTERFACE_(IDirectSoundCaptureFXAec, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureFXAec methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSCFXAec pDscFxAec) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSCFXAec pDscFxAec) PURE; + STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; + STDMETHOD(Reset) (THIS) PURE; +}; + +#define IDirectSoundCaptureFXAec_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureFXAec_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureFXAec_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + + +// +// IDirectSoundCaptureFXNoiseSuppress +// + +DEFINE_GUID(IID_IDirectSoundCaptureFXNoiseSuppress, 0xed311e41, 0xfbae, 0x4175, 0x96, 0x25, 0xcd, 0x8, 0x54, 0xf6, 0x93, 0xca); + +typedef struct _DSCFXNoiseSuppress +{ + BOOL fEnable; +} DSCFXNoiseSuppress, *LPDSCFXNoiseSuppress; + +typedef const DSCFXNoiseSuppress *LPCDSCFXNoiseSuppress; + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureFXNoiseSuppress + +DECLARE_INTERFACE_(IDirectSoundCaptureFXNoiseSuppress, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureFXNoiseSuppress methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSCFXNoiseSuppress pcDscFxNoiseSuppress) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSCFXNoiseSuppress pDscFxNoiseSuppress) PURE; + STDMETHOD(Reset) (THIS) PURE; +}; + +#define IDirectSoundCaptureFXNoiseSuppress_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureFXNoiseSuppress_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureFXNoiseSuppress_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + + +// +// IDirectSoundFullDuplex +// + +#ifndef _IDirectSoundFullDuplex_ +#define _IDirectSoundFullDuplex_ + +#ifdef __cplusplus +// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined +struct IDirectSoundFullDuplex; +#endif // __cplusplus + +typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX; + +DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xedcb4c7a, 0xdaab, 0x4216, 0xa4, 0x2e, 0x6c, 0x50, 0x59, 0x6d, 0xdc, 0x1d); + +#undef INTERFACE +#define INTERFACE IDirectSoundFullDuplex + +DECLARE_INTERFACE_(IDirectSoundFullDuplex, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFullDuplex methods + STDMETHOD(Initialize) (THIS_ __in LPCGUID pCaptureGuid, __in LPCGUID pRenderGuid, __in LPCDSCBUFFERDESC lpDscBufferDesc, __in LPCDSBUFFERDESC lpDsBufferDesc, HWND hWnd, DWORD dwLevel, + __deref_out LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8, __deref_out LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE; +}; + +#define IDirectSoundFullDuplex_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFullDuplex_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFullDuplex_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->Initialize(a,b,c,d,e,f,g,h) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // _IDirectSoundFullDuplex_ + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// Return Codes +// + +// The function completed successfully +#define DS_OK S_OK + +// The call succeeded, but we had to substitute the 3D algorithm +#define DS_NO_VIRTUALIZATION MAKE_HRESULT(0, _FACDS, 10) + +// The call failed because resources (such as a priority level) +// were already being used by another caller +#define DSERR_ALLOCATED MAKE_DSHRESULT(10) + +// The control (vol, pan, etc.) requested by the caller is not available +#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30) + +// An invalid parameter was passed to the returning function +#define DSERR_INVALIDPARAM E_INVALIDARG + +// This call is not valid for the current state of this object +#define DSERR_INVALIDCALL MAKE_DSHRESULT(50) + +// An undetermined error occurred inside the DirectSound subsystem +#define DSERR_GENERIC E_FAIL + +// The caller does not have the priority level required for the function to +// succeed +#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70) + +// Not enough free memory is available to complete the operation +#define DSERR_OUTOFMEMORY E_OUTOFMEMORY + +// The specified WAVE format is not supported +#define DSERR_BADFORMAT MAKE_DSHRESULT(100) + +// The function called is not supported at this time +#define DSERR_UNSUPPORTED E_NOTIMPL + +// No sound driver is available for use +#define DSERR_NODRIVER MAKE_DSHRESULT(120) + +// This object is already initialized +#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130) + +// This object does not support aggregation +#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION + +// The buffer memory has been lost, and must be restored +#define DSERR_BUFFERLOST MAKE_DSHRESULT(150) + +// Another app has a higher priority level, preventing this call from +// succeeding +#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160) + +// This object has not been initialized +#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170) + +// The requested COM interface is not available +#define DSERR_NOINTERFACE E_NOINTERFACE + +// Access is denied +#define DSERR_ACCESSDENIED E_ACCESSDENIED + +// Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds +#define DSERR_BUFFERTOOSMALL MAKE_DSHRESULT(180) + +// Attempt to use DirectSound 8 functionality on an older DirectSound object +#define DSERR_DS8_REQUIRED MAKE_DSHRESULT(190) + +// A circular loop of send effects was detected +#define DSERR_SENDLOOP MAKE_DSHRESULT(200) + +// The GUID specified in an audiopath file does not match a valid MIXIN buffer +#define DSERR_BADSENDBUFFERGUID MAKE_DSHRESULT(210) + +// The object requested was not found (numerically equal to DMUS_E_NOT_FOUND) +#define DSERR_OBJECTNOTFOUND MAKE_DSHRESULT(4449) + +// The effects requested could not be found on the system, or they were found +// but in the wrong order, or in the wrong hardware/software locations. +#define DSERR_FXUNAVAILABLE MAKE_DSHRESULT(220) + +// +// Flags +// + +#define DSCAPS_PRIMARYMONO 0x00000001 +#define DSCAPS_PRIMARYSTEREO 0x00000002 +#define DSCAPS_PRIMARY8BIT 0x00000004 +#define DSCAPS_PRIMARY16BIT 0x00000008 +#define DSCAPS_CONTINUOUSRATE 0x00000010 +#define DSCAPS_EMULDRIVER 0x00000020 +#define DSCAPS_CERTIFIED 0x00000040 +#define DSCAPS_SECONDARYMONO 0x00000100 +#define DSCAPS_SECONDARYSTEREO 0x00000200 +#define DSCAPS_SECONDARY8BIT 0x00000400 +#define DSCAPS_SECONDARY16BIT 0x00000800 + +#define DSSCL_NORMAL 0x00000001 +#define DSSCL_PRIORITY 0x00000002 +#define DSSCL_EXCLUSIVE 0x00000003 +#define DSSCL_WRITEPRIMARY 0x00000004 + +#define DSSPEAKER_DIRECTOUT 0x00000000 +#define DSSPEAKER_HEADPHONE 0x00000001 +#define DSSPEAKER_MONO 0x00000002 +#define DSSPEAKER_QUAD 0x00000003 +#define DSSPEAKER_STEREO 0x00000004 +#define DSSPEAKER_SURROUND 0x00000005 +#define DSSPEAKER_5POINT1 0x00000006 // obsolete 5.1 setting +#define DSSPEAKER_7POINT1 0x00000007 // obsolete 7.1 setting +#define DSSPEAKER_7POINT1_SURROUND 0x00000008 // correct 7.1 Home Theater setting +#define DSSPEAKER_5POINT1_SURROUND 0x00000009 // correct 5.1 setting +#define DSSPEAKER_7POINT1_WIDE DSSPEAKER_7POINT1 +#define DSSPEAKER_5POINT1_BACK DSSPEAKER_5POINT1 + +#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees +#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees +#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees +#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees + +#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16)) +#define DSSPEAKER_CONFIG(a) ((BYTE)(a)) +#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF)) + +#define DSBCAPS_PRIMARYBUFFER 0x00000001 +#define DSBCAPS_STATIC 0x00000002 +#define DSBCAPS_LOCHARDWARE 0x00000004 +#define DSBCAPS_LOCSOFTWARE 0x00000008 +#define DSBCAPS_CTRL3D 0x00000010 +#define DSBCAPS_CTRLFREQUENCY 0x00000020 +#define DSBCAPS_CTRLPAN 0x00000040 +#define DSBCAPS_CTRLVOLUME 0x00000080 +#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100 +#define DSBCAPS_CTRLFX 0x00000200 +#define DSBCAPS_STICKYFOCUS 0x00004000 +#define DSBCAPS_GLOBALFOCUS 0x00008000 +#define DSBCAPS_GETCURRENTPOSITION2 0x00010000 +#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000 +#define DSBCAPS_LOCDEFER 0x00040000 +#define DSBCAPS_TRUEPLAYPOSITION 0x00080000 + +#define DSBPLAY_LOOPING 0x00000001 +#define DSBPLAY_LOCHARDWARE 0x00000002 +#define DSBPLAY_LOCSOFTWARE 0x00000004 +#define DSBPLAY_TERMINATEBY_TIME 0x00000008 +#define DSBPLAY_TERMINATEBY_DISTANCE 0x000000010 +#define DSBPLAY_TERMINATEBY_PRIORITY 0x000000020 + +#define DSBSTATUS_PLAYING 0x00000001 +#define DSBSTATUS_BUFFERLOST 0x00000002 +#define DSBSTATUS_LOOPING 0x00000004 +#define DSBSTATUS_LOCHARDWARE 0x00000008 +#define DSBSTATUS_LOCSOFTWARE 0x00000010 +#define DSBSTATUS_TERMINATED 0x00000020 + +#define DSBLOCK_FROMWRITECURSOR 0x00000001 +#define DSBLOCK_ENTIREBUFFER 0x00000002 + +#define DSBFREQUENCY_ORIGINAL 0 +#define DSBFREQUENCY_MIN 100 +#if DIRECTSOUND_VERSION >= 0x0900 +#define DSBFREQUENCY_MAX 200000 +#else +#define DSBFREQUENCY_MAX 100000 +#endif + +#define DSBPAN_LEFT -10000 +#define DSBPAN_CENTER 0 +#define DSBPAN_RIGHT 10000 + +#define DSBVOLUME_MIN -10000 +#define DSBVOLUME_MAX 0 + +#define DSBSIZE_MIN 4 +#define DSBSIZE_MAX 0x0FFFFFFF +#define DSBSIZE_FX_MIN 150 // NOTE: Milliseconds, not bytes + +#define DSBNOTIFICATIONS_MAX 100000UL + +#define DS3DMODE_NORMAL 0x00000000 +#define DS3DMODE_HEADRELATIVE 0x00000001 +#define DS3DMODE_DISABLE 0x00000002 + +#define DS3D_IMMEDIATE 0x00000000 +#define DS3D_DEFERRED 0x00000001 + +#define DS3D_MINDISTANCEFACTOR FLT_MIN +#define DS3D_MAXDISTANCEFACTOR FLT_MAX +#define DS3D_DEFAULTDISTANCEFACTOR 1.0f + +#define DS3D_MINROLLOFFFACTOR 0.0f +#define DS3D_MAXROLLOFFFACTOR 10.0f +#define DS3D_DEFAULTROLLOFFFACTOR 1.0f + +#define DS3D_MINDOPPLERFACTOR 0.0f +#define DS3D_MAXDOPPLERFACTOR 10.0f +#define DS3D_DEFAULTDOPPLERFACTOR 1.0f + +#define DS3D_DEFAULTMINDISTANCE 1.0f +#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f + +#define DS3D_MINCONEANGLE 0 +#define DS3D_MAXCONEANGLE 360 +#define DS3D_DEFAULTCONEANGLE 360 + +#define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX + +// IDirectSoundCapture attributes + +#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER +#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED +#define DSCCAPS_MULTIPLECAPTURE 0x00000001 + +// IDirectSoundCaptureBuffer attributes + +#define DSCBCAPS_WAVEMAPPED 0x80000000 +#if DIRECTSOUND_VERSION >= 0x0800 +#define DSCBCAPS_CTRLFX 0x00000200 +#endif + +#define DSCBLOCK_ENTIREBUFFER 0x00000001 + +#define DSCBSTATUS_CAPTURING 0x00000001 +#define DSCBSTATUS_LOOPING 0x00000002 + +#define DSCBSTART_LOOPING 0x00000001 + +#define DSBPN_OFFSETSTOP 0xFFFFFFFF + +#define DS_CERTIFIED 0x00000000 +#define DS_UNCERTIFIED 0x00000001 + +// +// Flags for the I3DL2 effects +// + +// +// I3DL2 Material Presets +// + +enum +{ + DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW, + DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW, + DSFX_I3DL2_MATERIAL_PRESET_THINDOOR, + DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR, + DSFX_I3DL2_MATERIAL_PRESET_WOODWALL, + DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL, + DSFX_I3DL2_MATERIAL_PRESET_STONEWALL, + DSFX_I3DL2_MATERIAL_PRESET_CURTAIN +}; + +#define I3DL2_MATERIAL_PRESET_SINGLEWINDOW -2800,0.71f +#define I3DL2_MATERIAL_PRESET_DOUBLEWINDOW -5000,0.40f +#define I3DL2_MATERIAL_PRESET_THINDOOR -1800,0.66f +#define I3DL2_MATERIAL_PRESET_THICKDOOR -4400,0.64f +#define I3DL2_MATERIAL_PRESET_WOODWALL -4000,0.50f +#define I3DL2_MATERIAL_PRESET_BRICKWALL -5000,0.60f +#define I3DL2_MATERIAL_PRESET_STONEWALL -6000,0.68f +#define I3DL2_MATERIAL_PRESET_CURTAIN -1200,0.15f + +enum +{ + DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT, + DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC, + DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL, + DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM, + DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL, + DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE, + DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA, + DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR, + DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY, + DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY, + DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR, + DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY, + DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST, + DSFX_I3DL2_ENVIRONMENT_PRESET_CITY, + DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS, + DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY, + DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN, + DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT, + DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE, + DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER, + DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL, + DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL, + DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE +}; + +// +// I3DL2 Reverberation Presets Values +// + +#define I3DL2_ENVIRONMENT_PRESET_DEFAULT -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_GENERIC -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PADDEDCELL -1000,-6000, 0.0f, 0.17f, 0.10f, -1204, 0.001f, 207, 0.002f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_ROOM -1000, -454, 0.0f, 0.40f, 0.83f, -1646, 0.002f, 53, 0.003f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_BATHROOM -1000,-1200, 0.0f, 1.49f, 0.54f, -370, 0.007f, 1030, 0.011f, 100.0f, 60.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_LIVINGROOM -1000,-6000, 0.0f, 0.50f, 0.10f, -1376, 0.003f, -1104, 0.004f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_STONEROOM -1000, -300, 0.0f, 2.31f, 0.64f, -711, 0.012f, 83, 0.017f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_AUDITORIUM -1000, -476, 0.0f, 4.32f, 0.59f, -789, 0.020f, -289, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CONCERTHALL -1000, -500, 0.0f, 3.92f, 0.70f, -1230, 0.020f, -2, 0.029f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CAVE -1000, 0, 0.0f, 2.91f, 1.30f, -602, 0.015f, -302, 0.022f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_ARENA -1000, -698, 0.0f, 7.24f, 0.33f, -1166, 0.020f, 16, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_HANGAR -1000,-1000, 0.0f,10.05f, 0.23f, -602, 0.020f, 198, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY -1000,-4000, 0.0f, 0.30f, 0.10f, -1831, 0.002f, -1630, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_HALLWAY -1000, -300, 0.0f, 1.49f, 0.59f, -1219, 0.007f, 441, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR -1000, -237, 0.0f, 2.70f, 0.79f, -1214, 0.013f, 395, 0.020f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_ALLEY -1000, -270, 0.0f, 1.49f, 0.86f, -1204, 0.007f, -4, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_FOREST -1000,-3300, 0.0f, 1.49f, 0.54f, -2560, 0.162f, -613, 0.088f, 79.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CITY -1000, -800, 0.0f, 1.49f, 0.67f, -2273, 0.007f, -2217, 0.011f, 50.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_MOUNTAINS -1000,-2500, 0.0f, 1.49f, 0.21f, -2780, 0.300f, -2014, 0.100f, 27.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_QUARRY -1000,-1000, 0.0f, 1.49f, 0.83f,-10000, 0.061f, 500, 0.025f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PLAIN -1000,-2000, 0.0f, 1.49f, 0.50f, -2466, 0.179f, -2514, 0.100f, 21.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PARKINGLOT -1000, 0, 0.0f, 1.65f, 1.50f, -1363, 0.008f, -1153, 0.012f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_SEWERPIPE -1000,-1000, 0.0f, 2.81f, 0.14f, 429, 0.014f, 648, 0.021f, 80.0f, 60.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_UNDERWATER -1000,-4000, 0.0f, 1.49f, 0.10f, -449, 0.007f, 1700, 0.011f, 100.0f, 100.0f, 5000.0f + +// +// Examples simulating 'musical' reverb presets +// +// Name Decay time Description +// Small Room 1.1s A small size room with a length of 5m or so. +// Medium Room 1.3s A medium size room with a length of 10m or so. +// Large Room 1.5s A large size room suitable for live performances. +// Medium Hall 1.8s A medium size concert hall. +// Large Hall 1.8s A large size concert hall suitable for a full orchestra. +// Plate 1.3s A plate reverb simulation. +// + +#define I3DL2_ENVIRONMENT_PRESET_SMALLROOM -1000, -600, 0.0f, 1.10f, 0.83f, -400, 0.005f, 500, 0.010f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM -1000, -600, 0.0f, 1.30f, 0.83f, -1000, 0.010f, -200, 0.020f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_LARGEROOM -1000, -600, 0.0f, 1.50f, 0.83f, -1600, 0.020f, -1000, 0.040f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL -1000, -600, 0.0f, 1.80f, 0.70f, -1300, 0.015f, -800, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_LARGEHALL -1000, -600, 0.0f, 1.80f, 0.70f, -2000, 0.030f, -1400, 0.060f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PLATE -1000, -200, 0.0f, 1.30f, 0.90f, 0, 0.002f, 0, 0.010f, 100.0f, 75.0f, 5000.0f + +// +// DirectSound3D Algorithms +// + +// Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000} +#define DS3DALG_DEFAULT GUID_NULL + +// No virtualization (Pan3D) {C241333F-1C1B-11d2-94F5-00C04FC28ACA} +DEFINE_GUID(DS3DALG_NO_VIRTUALIZATION, 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + +// High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA} +DEFINE_GUID(DS3DALG_HRTF_FULL, 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + +// Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA} +DEFINE_GUID(DS3DALG_HRTF_LIGHT, 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// DirectSound Internal Effect Algorithms +// + + +// Gargle {DAFD8210-5711-4B91-9FE3-F75B7AE279BF} +DEFINE_GUID(GUID_DSFX_STANDARD_GARGLE, 0xdafd8210, 0x5711, 0x4b91, 0x9f, 0xe3, 0xf7, 0x5b, 0x7a, 0xe2, 0x79, 0xbf); + +// Chorus {EFE6629C-81F7-4281-BD91-C9D604A95AF6} +DEFINE_GUID(GUID_DSFX_STANDARD_CHORUS, 0xefe6629c, 0x81f7, 0x4281, 0xbd, 0x91, 0xc9, 0xd6, 0x04, 0xa9, 0x5a, 0xf6); + +// Flanger {EFCA3D92-DFD8-4672-A603-7420894BAD98} +DEFINE_GUID(GUID_DSFX_STANDARD_FLANGER, 0xefca3d92, 0xdfd8, 0x4672, 0xa6, 0x03, 0x74, 0x20, 0x89, 0x4b, 0xad, 0x98); + +// Echo/Delay {EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D} +DEFINE_GUID(GUID_DSFX_STANDARD_ECHO, 0xef3e932c, 0xd40b, 0x4f51, 0x8c, 0xcf, 0x3f, 0x98, 0xf1, 0xb2, 0x9d, 0x5d); + +// Distortion {EF114C90-CD1D-484E-96E5-09CFAF912A21} +DEFINE_GUID(GUID_DSFX_STANDARD_DISTORTION, 0xef114c90, 0xcd1d, 0x484e, 0x96, 0xe5, 0x09, 0xcf, 0xaf, 0x91, 0x2a, 0x21); + +// Compressor/Limiter {EF011F79-4000-406D-87AF-BFFB3FC39D57} +DEFINE_GUID(GUID_DSFX_STANDARD_COMPRESSOR, 0xef011f79, 0x4000, 0x406d, 0x87, 0xaf, 0xbf, 0xfb, 0x3f, 0xc3, 0x9d, 0x57); + +// Parametric Equalization {120CED89-3BF4-4173-A132-3CB406CF3231} +DEFINE_GUID(GUID_DSFX_STANDARD_PARAMEQ, 0x120ced89, 0x3bf4, 0x4173, 0xa1, 0x32, 0x3c, 0xb4, 0x06, 0xcf, 0x32, 0x31); + +// I3DL2 Environmental Reverberation: Reverb (Listener) Effect {EF985E71-D5C7-42D4-BA4D-2D073E2E96F4} +DEFINE_GUID(GUID_DSFX_STANDARD_I3DL2REVERB, 0xef985e71, 0xd5c7, 0x42d4, 0xba, 0x4d, 0x2d, 0x07, 0x3e, 0x2e, 0x96, 0xf4); + +// Waves Reverberation {87FC0268-9A55-4360-95AA-004A1D9DE26C} +DEFINE_GUID(GUID_DSFX_WAVES_REVERB, 0x87fc0268, 0x9a55, 0x4360, 0x95, 0xaa, 0x00, 0x4a, 0x1d, 0x9d, 0xe2, 0x6c); + +// +// DirectSound Capture Effect Algorithms +// + + +// Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1} +// Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h +DEFINE_GUID(GUID_DSCFX_CLASS_AEC, 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1); + +// Microsoft AEC {CDEBB919-379A-488a-8765-F53CFD36DE40} +DEFINE_GUID(GUID_DSCFX_MS_AEC, 0xcdebb919, 0x379a, 0x488a, 0x87, 0x65, 0xf5, 0x3c, 0xfd, 0x36, 0xde, 0x40); + +// System AEC {1C22C56D-9879-4f5b-A389-27996DDC2810} +DEFINE_GUID(GUID_DSCFX_SYSTEM_AEC, 0x1c22c56d, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10); + +// Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5} +// Matches KSNODETYPE_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h +DEFINE_GUID(GUID_DSCFX_CLASS_NS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5); + +// Microsoft Noise Suppresion {11C5C73B-66E9-4ba1-A0BA-E814C6EED92D} +DEFINE_GUID(GUID_DSCFX_MS_NS, 0x11c5c73b, 0x66e9, 0x4ba1, 0xa0, 0xba, 0xe8, 0x14, 0xc6, 0xee, 0xd9, 0x2d); + +// System Noise Suppresion {5AB0882E-7274-4516-877D-4EEE99BA4FD0} +DEFINE_GUID(GUID_DSCFX_SYSTEM_NS, 0x5ab0882e, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0); + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +#endif // __DSOUND_INCLUDED__ + + + +#ifdef __cplusplus +}; +#endif // __cplusplus + diff --git a/RenderDll/Dx9Sdk/Include/DxDiag.h b/RenderDll/Dx9Sdk/Include/dxdiag.h similarity index 100% rename from RenderDll/Dx9Sdk/Include/DxDiag.h rename to RenderDll/Dx9Sdk/Include/dxdiag.h diff --git a/RenderDll/Dx9Sdk/Include/dxfile.h b/RenderDll/Dx9Sdk/Include/dxfile.h new file mode 100644 index 0000000..74e80e5 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/dxfile.h @@ -0,0 +1,239 @@ +/*************************************************************************** + * + * Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved. + * + * File: dxfile.h + * + * Content: DirectX File public header file + * + ***************************************************************************/ + +#ifndef __DXFILE_H__ +#define __DXFILE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef DWORD DXFILEFORMAT; + +#define DXFILEFORMAT_BINARY 0 +#define DXFILEFORMAT_TEXT 1 +#define DXFILEFORMAT_COMPRESSED 2 + +typedef DWORD DXFILELOADOPTIONS; + +#define DXFILELOAD_FROMFILE 0x00L +#define DXFILELOAD_FROMRESOURCE 0x01L +#define DXFILELOAD_FROMMEMORY 0x02L +#define DXFILELOAD_FROMSTREAM 0x04L +#define DXFILELOAD_FROMURL 0x08L + +typedef struct _DXFILELOADRESOURCE { + HMODULE hModule; + LPCTSTR lpName; + LPCTSTR lpType; +}DXFILELOADRESOURCE, *LPDXFILELOADRESOURCE; + +typedef struct _DXFILELOADMEMORY { + LPVOID lpMemory; + DWORD dSize; +}DXFILELOADMEMORY, *LPDXFILELOADMEMORY; + +/* + * DirectX File object types. + */ + +#ifndef WIN_TYPES +#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype +#endif + +WIN_TYPES(IDirectXFile, DIRECTXFILE); +WIN_TYPES(IDirectXFileEnumObject, DIRECTXFILEENUMOBJECT); +WIN_TYPES(IDirectXFileSaveObject, DIRECTXFILESAVEOBJECT); +WIN_TYPES(IDirectXFileObject, DIRECTXFILEOBJECT); +WIN_TYPES(IDirectXFileData, DIRECTXFILEDATA); +WIN_TYPES(IDirectXFileDataReference, DIRECTXFILEDATAREFERENCE); +WIN_TYPES(IDirectXFileBinary, DIRECTXFILEBINARY); + +/* + * API for creating IDirectXFile interface. + */ + +STDAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile); + +/* + * The methods for IUnknown + */ + +#define IUNKNOWN_METHODS(kind) \ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \ + STDMETHOD_(ULONG, AddRef) (THIS) kind; \ + STDMETHOD_(ULONG, Release) (THIS) kind + +/* + * The methods for IDirectXFileObject + */ + +#define IDIRECTXFILEOBJECT_METHODS(kind) \ + STDMETHOD(GetName) (THIS_ LPSTR, LPDWORD) kind; \ + STDMETHOD(GetId) (THIS_ LPGUID) kind + +/* + * DirectX File interfaces. + */ + +#undef INTERFACE +#define INTERFACE IDirectXFile + +DECLARE_INTERFACE_(IDirectXFile, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + STDMETHOD(CreateEnumObject) (THIS_ LPVOID, DXFILELOADOPTIONS, + LPDIRECTXFILEENUMOBJECT *) PURE; + STDMETHOD(CreateSaveObject) (THIS_ LPCSTR, DXFILEFORMAT, + LPDIRECTXFILESAVEOBJECT *) PURE; + STDMETHOD(RegisterTemplates) (THIS_ LPVOID, DWORD) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectXFileEnumObject + +DECLARE_INTERFACE_(IDirectXFileEnumObject, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + STDMETHOD(GetNextDataObject) (THIS_ LPDIRECTXFILEDATA *) PURE; + STDMETHOD(GetDataObjectById) (THIS_ REFGUID, LPDIRECTXFILEDATA *) PURE; + STDMETHOD(GetDataObjectByName) (THIS_ LPCSTR, LPDIRECTXFILEDATA *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectXFileSaveObject + +DECLARE_INTERFACE_(IDirectXFileSaveObject, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + STDMETHOD(SaveTemplates) (THIS_ DWORD, const GUID **) PURE; + STDMETHOD(CreateDataObject) (THIS_ REFGUID, LPCSTR, const GUID *, + DWORD, LPVOID, LPDIRECTXFILEDATA *) PURE; + STDMETHOD(SaveData) (THIS_ LPDIRECTXFILEDATA) PURE; +}; + + +#undef INTERFACE +#define INTERFACE IDirectXFileObject + +DECLARE_INTERFACE_(IDirectXFileObject, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + IDIRECTXFILEOBJECT_METHODS(PURE); +}; + +#undef INTERFACE +#define INTERFACE IDirectXFileData + +DECLARE_INTERFACE_(IDirectXFileData, IDirectXFileObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECTXFILEOBJECT_METHODS(PURE); + + STDMETHOD(GetData) (THIS_ LPCSTR, DWORD *, void **) PURE; + STDMETHOD(GetType) (THIS_ const GUID **) PURE; + STDMETHOD(GetNextObject) (THIS_ LPDIRECTXFILEOBJECT *) PURE; + STDMETHOD(AddDataObject) (THIS_ LPDIRECTXFILEDATA) PURE; + STDMETHOD(AddDataReference) (THIS_ LPCSTR, const GUID *) PURE; + STDMETHOD(AddBinaryObject) (THIS_ LPCSTR, const GUID *, LPCSTR, LPVOID, DWORD) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectXFileDataReference + +DECLARE_INTERFACE_(IDirectXFileDataReference, IDirectXFileObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECTXFILEOBJECT_METHODS(PURE); + + STDMETHOD(Resolve) (THIS_ LPDIRECTXFILEDATA *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectXFileBinary + +DECLARE_INTERFACE_(IDirectXFileBinary, IDirectXFileObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECTXFILEOBJECT_METHODS(PURE); + + STDMETHOD(GetSize) (THIS_ DWORD *) PURE; + STDMETHOD(GetMimeType) (THIS_ LPCSTR *) PURE; + STDMETHOD(Read) (THIS_ LPVOID, DWORD, LPDWORD) PURE; +}; + +/* + * DirectXFile Object Class Id (for CoCreateInstance()) + */ + +DEFINE_GUID(CLSID_CDirectXFile, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); + +/* + * DirectX File Interface GUIDs. + */ + +DEFINE_GUID(IID_IDirectXFile, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileEnumObject, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileSaveObject, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileObject, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileData, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileDataReference, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileBinary, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* + * DirectX File Header template's GUID. + */ + +DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + + +/* + * DirectX File errors. + */ + +#define _FACDD 0x876 +#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) + +#define DXFILE_OK 0 + +#define DXFILEERR_BADOBJECT MAKE_DDHRESULT(850) +#define DXFILEERR_BADVALUE MAKE_DDHRESULT(851) +#define DXFILEERR_BADTYPE MAKE_DDHRESULT(852) +#define DXFILEERR_BADSTREAMHANDLE MAKE_DDHRESULT(853) +#define DXFILEERR_BADALLOC MAKE_DDHRESULT(854) +#define DXFILEERR_NOTFOUND MAKE_DDHRESULT(855) +#define DXFILEERR_NOTDONEYET MAKE_DDHRESULT(856) +#define DXFILEERR_FILENOTFOUND MAKE_DDHRESULT(857) +#define DXFILEERR_RESOURCENOTFOUND MAKE_DDHRESULT(858) +#define DXFILEERR_URLNOTFOUND MAKE_DDHRESULT(859) +#define DXFILEERR_BADRESOURCE MAKE_DDHRESULT(860) +#define DXFILEERR_BADFILETYPE MAKE_DDHRESULT(861) +#define DXFILEERR_BADFILEVERSION MAKE_DDHRESULT(862) +#define DXFILEERR_BADFILEFLOATSIZE MAKE_DDHRESULT(863) +#define DXFILEERR_BADFILECOMPRESSIONTYPE MAKE_DDHRESULT(864) +#define DXFILEERR_BADFILE MAKE_DDHRESULT(865) +#define DXFILEERR_PARSEERROR MAKE_DDHRESULT(866) +#define DXFILEERR_NOTEMPLATE MAKE_DDHRESULT(867) +#define DXFILEERR_BADARRAYSIZE MAKE_DDHRESULT(868) +#define DXFILEERR_BADDATAREFERENCE MAKE_DDHRESULT(869) +#define DXFILEERR_INTERNALERROR MAKE_DDHRESULT(870) +#define DXFILEERR_NOMOREOBJECTS MAKE_DDHRESULT(871) +#define DXFILEERR_BADINTRINSICS MAKE_DDHRESULT(872) +#define DXFILEERR_NOMORESTREAMHANDLES MAKE_DDHRESULT(873) +#define DXFILEERR_NOMOREDATA MAKE_DDHRESULT(874) +#define DXFILEERR_BADCACHEFILE MAKE_DDHRESULT(875) +#define DXFILEERR_NOINTERNET MAKE_DDHRESULT(876) + + +#ifdef __cplusplus +}; +#endif + +#endif /* _DXFILE_H_ */ diff --git a/RenderDll/Dx9Sdk/Include/dxsdkver.h b/RenderDll/Dx9Sdk/Include/dxsdkver.h new file mode 100644 index 0000000..7d88bbb --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/dxsdkver.h @@ -0,0 +1,18 @@ +/*==========================================================================; + * + * + * File: dxsdkver.h + * Content: DirectX SDK Version Include File + * + ****************************************************************************/ + +#ifndef _DXSDKVER_H_ +#define _DXSDKVER_H_ + +#define _DXSDK_PRODUCT_MAJOR 9 +#define _DXSDK_PRODUCT_MINOR 29 +#define _DXSDK_BUILD_MAJOR 1962 +#define _DXSDK_BUILD_MINOR 0 + +#endif // _DXSDKVER_H_ + diff --git a/RenderDll/Dx9Sdk/Include/gameux.h b/RenderDll/Dx9Sdk/Include/gameux.h new file mode 100644 index 0000000..19e2f95 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/gameux.h @@ -0,0 +1,719 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0550 */ +/* Compiler settings for gameux.idl: + Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0550 + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __gameux_h__ +#define __gameux_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IGameExplorer_FWD_DEFINED__ +#define __IGameExplorer_FWD_DEFINED__ +typedef interface IGameExplorer IGameExplorer; +#endif /* __IGameExplorer_FWD_DEFINED__ */ + + +#ifndef __IGameStatistics_FWD_DEFINED__ +#define __IGameStatistics_FWD_DEFINED__ +typedef interface IGameStatistics IGameStatistics; +#endif /* __IGameStatistics_FWD_DEFINED__ */ + + +#ifndef __IGameStatisticsMgr_FWD_DEFINED__ +#define __IGameStatisticsMgr_FWD_DEFINED__ +typedef interface IGameStatisticsMgr IGameStatisticsMgr; +#endif /* __IGameStatisticsMgr_FWD_DEFINED__ */ + + +#ifndef __IGameExplorer2_FWD_DEFINED__ +#define __IGameExplorer2_FWD_DEFINED__ +typedef interface IGameExplorer2 IGameExplorer2; +#endif /* __IGameExplorer2_FWD_DEFINED__ */ + + +#ifndef __GameExplorer_FWD_DEFINED__ +#define __GameExplorer_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class GameExplorer GameExplorer; +#else +typedef struct GameExplorer GameExplorer; +#endif /* __cplusplus */ + +#endif /* __GameExplorer_FWD_DEFINED__ */ + + +#ifndef __GameStatistics_FWD_DEFINED__ +#define __GameStatistics_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class GameStatistics GameStatistics; +#else +typedef struct GameStatistics GameStatistics; +#endif /* __cplusplus */ + +#endif /* __GameStatistics_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "shobjidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_gameux_0000_0000 */ +/* [local] */ + +#define ID_GDF_XML __GDF_XML +#define ID_GDF_THUMBNAIL __GDF_THUMBNAIL +#define ID_ICON_ICO __ICON_ICO +#define ID_GDF_XML_STR L"__GDF_XML" +#define ID_GDF_THUMBNAIL_STR L"__GDF_THUMBNAIL" +typedef /* [v1_enum] */ +enum GAME_INSTALL_SCOPE + { GIS_NOT_INSTALLED = 1, + GIS_CURRENT_USER = 2, + GIS_ALL_USERS = 3 + } GAME_INSTALL_SCOPE; + + + +extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_s_ifspec; + +#ifndef __IGameExplorer_INTERFACE_DEFINED__ +#define __IGameExplorer_INTERFACE_DEFINED__ + +/* interface IGameExplorer */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IGameExplorer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("E7B2FB72-D728-49B3-A5F2-18EBF5F1349E") + IGameExplorer : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddGame( + /* [in] */ __RPC__in BSTR bstrGDFBinaryPath, + /* [in] */ __RPC__in BSTR bstrGameInstallDirectory, + /* [in] */ GAME_INSTALL_SCOPE installScope, + /* [out][in] */ __RPC__inout GUID *pguidInstanceID) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGame( + /* [in] */ GUID guidInstanceID) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UpdateGame( + /* [in] */ GUID guidInstanceID) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VerifyAccess( + /* [in] */ __RPC__in BSTR bstrGDFBinaryPath, + /* [out] */ __RPC__out BOOL *pfHasAccess) = 0; + + }; + +#else /* C style interface */ + + typedef struct IGameExplorerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + __RPC__in IGameExplorer * This, + /* [in] */ __RPC__in REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + __RPC__in IGameExplorer * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + __RPC__in IGameExplorer * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AddGame )( + __RPC__in IGameExplorer * This, + /* [in] */ __RPC__in BSTR bstrGDFBinaryPath, + /* [in] */ __RPC__in BSTR bstrGameInstallDirectory, + /* [in] */ GAME_INSTALL_SCOPE installScope, + /* [out][in] */ __RPC__inout GUID *pguidInstanceID); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGame )( + __RPC__in IGameExplorer * This, + /* [in] */ GUID guidInstanceID); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UpdateGame )( + __RPC__in IGameExplorer * This, + /* [in] */ GUID guidInstanceID); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VerifyAccess )( + __RPC__in IGameExplorer * This, + /* [in] */ __RPC__in BSTR bstrGDFBinaryPath, + /* [out] */ __RPC__out BOOL *pfHasAccess); + + END_INTERFACE + } IGameExplorerVtbl; + + interface IGameExplorer + { + CONST_VTBL struct IGameExplorerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IGameExplorer_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IGameExplorer_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IGameExplorer_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IGameExplorer_AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) \ + ( (This)->lpVtbl -> AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) ) + +#define IGameExplorer_RemoveGame(This,guidInstanceID) \ + ( (This)->lpVtbl -> RemoveGame(This,guidInstanceID) ) + +#define IGameExplorer_UpdateGame(This,guidInstanceID) \ + ( (This)->lpVtbl -> UpdateGame(This,guidInstanceID) ) + +#define IGameExplorer_VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) \ + ( (This)->lpVtbl -> VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IGameExplorer_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_gameux_0000_0001 */ +/* [local] */ + +typedef /* [v1_enum] */ +enum GAMESTATS_OPEN_TYPE + { GAMESTATS_OPEN_OPENORCREATE = 0, + GAMESTATS_OPEN_OPENONLY = 1 + } GAMESTATS_OPEN_TYPE; + +typedef /* [v1_enum] */ +enum GAMESTATS_OPEN_RESULT + { GAMESTATS_OPEN_CREATED = 0, + GAMESTATS_OPEN_OPENED = 1 + } GAMESTATS_OPEN_RESULT; + + + +extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0001_v0_0_s_ifspec; + +#ifndef __IGameStatistics_INTERFACE_DEFINED__ +#define __IGameStatistics_INTERFACE_DEFINED__ + +/* interface IGameStatistics */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IGameStatistics; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3887C9CA-04A0-42ae-BC4C-5FA6C7721145") + IGameStatistics : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxCategoryLength( + /* [retval][out] */ __RPC__out UINT *cch) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxNameLength( + /* [retval][out] */ __RPC__out UINT *cch) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxValueLength( + /* [retval][out] */ __RPC__out UINT *cch) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxCategories( + /* [retval][out] */ __RPC__out WORD *pMax) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxStatsPerCategory( + /* [retval][out] */ __RPC__out WORD *pMax) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCategoryTitle( + /* [in] */ WORD categoryIndex, + /* [string][in] */ __RPC__in_string LPCWSTR title) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCategoryTitle( + /* [in] */ WORD categoryIndex, + /* [retval][string][out] */ __RPC__deref_out_opt_string LPWSTR *pTitle) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStatistic( + /* [in] */ WORD categoryIndex, + /* [in] */ WORD statIndex, + /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pName, + /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pValue) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStatistic( + /* [in] */ WORD categoryIndex, + /* [in] */ WORD statIndex, + /* [string][in] */ __RPC__in_string LPCWSTR name, + /* [string][in] */ __RPC__in_string LPCWSTR value) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Save( + /* [in] */ BOOL trackChanges) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetLastPlayedCategory( + /* [in] */ UINT categoryIndex) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLastPlayedCategory( + /* [retval][out] */ __RPC__out UINT *pCategoryIndex) = 0; + + }; + +#else /* C style interface */ + + typedef struct IGameStatisticsVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + __RPC__in IGameStatistics * This, + /* [in] */ __RPC__in REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + __RPC__in IGameStatistics * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + __RPC__in IGameStatistics * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxCategoryLength )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out UINT *cch); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxNameLength )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out UINT *cch); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxValueLength )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out UINT *cch); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxCategories )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out WORD *pMax); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxStatsPerCategory )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out WORD *pMax); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCategoryTitle )( + __RPC__in IGameStatistics * This, + /* [in] */ WORD categoryIndex, + /* [string][in] */ __RPC__in_string LPCWSTR title); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCategoryTitle )( + __RPC__in IGameStatistics * This, + /* [in] */ WORD categoryIndex, + /* [retval][string][out] */ __RPC__deref_out_opt_string LPWSTR *pTitle); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStatistic )( + __RPC__in IGameStatistics * This, + /* [in] */ WORD categoryIndex, + /* [in] */ WORD statIndex, + /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pName, + /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pValue); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStatistic )( + __RPC__in IGameStatistics * This, + /* [in] */ WORD categoryIndex, + /* [in] */ WORD statIndex, + /* [string][in] */ __RPC__in_string LPCWSTR name, + /* [string][in] */ __RPC__in_string LPCWSTR value); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Save )( + __RPC__in IGameStatistics * This, + /* [in] */ BOOL trackChanges); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetLastPlayedCategory )( + __RPC__in IGameStatistics * This, + /* [in] */ UINT categoryIndex); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetLastPlayedCategory )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out UINT *pCategoryIndex); + + END_INTERFACE + } IGameStatisticsVtbl; + + interface IGameStatistics + { + CONST_VTBL struct IGameStatisticsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IGameStatistics_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IGameStatistics_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IGameStatistics_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IGameStatistics_GetMaxCategoryLength(This,cch) \ + ( (This)->lpVtbl -> GetMaxCategoryLength(This,cch) ) + +#define IGameStatistics_GetMaxNameLength(This,cch) \ + ( (This)->lpVtbl -> GetMaxNameLength(This,cch) ) + +#define IGameStatistics_GetMaxValueLength(This,cch) \ + ( (This)->lpVtbl -> GetMaxValueLength(This,cch) ) + +#define IGameStatistics_GetMaxCategories(This,pMax) \ + ( (This)->lpVtbl -> GetMaxCategories(This,pMax) ) + +#define IGameStatistics_GetMaxStatsPerCategory(This,pMax) \ + ( (This)->lpVtbl -> GetMaxStatsPerCategory(This,pMax) ) + +#define IGameStatistics_SetCategoryTitle(This,categoryIndex,title) \ + ( (This)->lpVtbl -> SetCategoryTitle(This,categoryIndex,title) ) + +#define IGameStatistics_GetCategoryTitle(This,categoryIndex,pTitle) \ + ( (This)->lpVtbl -> GetCategoryTitle(This,categoryIndex,pTitle) ) + +#define IGameStatistics_GetStatistic(This,categoryIndex,statIndex,pName,pValue) \ + ( (This)->lpVtbl -> GetStatistic(This,categoryIndex,statIndex,pName,pValue) ) + +#define IGameStatistics_SetStatistic(This,categoryIndex,statIndex,name,value) \ + ( (This)->lpVtbl -> SetStatistic(This,categoryIndex,statIndex,name,value) ) + +#define IGameStatistics_Save(This,trackChanges) \ + ( (This)->lpVtbl -> Save(This,trackChanges) ) + +#define IGameStatistics_SetLastPlayedCategory(This,categoryIndex) \ + ( (This)->lpVtbl -> SetLastPlayedCategory(This,categoryIndex) ) + +#define IGameStatistics_GetLastPlayedCategory(This,pCategoryIndex) \ + ( (This)->lpVtbl -> GetLastPlayedCategory(This,pCategoryIndex) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IGameStatistics_INTERFACE_DEFINED__ */ + + +#ifndef __IGameStatisticsMgr_INTERFACE_DEFINED__ +#define __IGameStatisticsMgr_INTERFACE_DEFINED__ + +/* interface IGameStatisticsMgr */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IGameStatisticsMgr; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("AFF3EA11-E70E-407d-95DD-35E612C41CE2") + IGameStatisticsMgr : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGameStatistics( + /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath, + /* [in] */ GAMESTATS_OPEN_TYPE openType, + /* [out] */ __RPC__out GAMESTATS_OPEN_RESULT *pOpenResult, + /* [retval][out] */ __RPC__deref_out_opt IGameStatistics **ppiStats) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGameStatistics( + /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath) = 0; + + }; + +#else /* C style interface */ + + typedef struct IGameStatisticsMgrVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + __RPC__in IGameStatisticsMgr * This, + /* [in] */ __RPC__in REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + __RPC__in IGameStatisticsMgr * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + __RPC__in IGameStatisticsMgr * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGameStatistics )( + __RPC__in IGameStatisticsMgr * This, + /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath, + /* [in] */ GAMESTATS_OPEN_TYPE openType, + /* [out] */ __RPC__out GAMESTATS_OPEN_RESULT *pOpenResult, + /* [retval][out] */ __RPC__deref_out_opt IGameStatistics **ppiStats); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGameStatistics )( + __RPC__in IGameStatisticsMgr * This, + /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath); + + END_INTERFACE + } IGameStatisticsMgrVtbl; + + interface IGameStatisticsMgr + { + CONST_VTBL struct IGameStatisticsMgrVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IGameStatisticsMgr_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IGameStatisticsMgr_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IGameStatisticsMgr_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IGameStatisticsMgr_GetGameStatistics(This,GDFBinaryPath,openType,pOpenResult,ppiStats) \ + ( (This)->lpVtbl -> GetGameStatistics(This,GDFBinaryPath,openType,pOpenResult,ppiStats) ) + +#define IGameStatisticsMgr_RemoveGameStatistics(This,GDFBinaryPath) \ + ( (This)->lpVtbl -> RemoveGameStatistics(This,GDFBinaryPath) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IGameStatisticsMgr_INTERFACE_DEFINED__ */ + + +#ifndef __IGameExplorer2_INTERFACE_DEFINED__ +#define __IGameExplorer2_INTERFACE_DEFINED__ + +/* interface IGameExplorer2 */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IGameExplorer2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("86874AA7-A1ED-450d-A7EB-B89E20B2FFF3") + IGameExplorer2 : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE InstallGame( + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath, + /* [unique][in] */ __RPC__in_opt LPCWSTR installDirectory, + /* [in] */ GAME_INSTALL_SCOPE installScope) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UninstallGame( + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckAccess( + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath, + /* [retval][out] */ __RPC__out BOOL *pHasAccess) = 0; + + }; + +#else /* C style interface */ + + typedef struct IGameExplorer2Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + __RPC__in IGameExplorer2 * This, + /* [in] */ __RPC__in REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + __RPC__in IGameExplorer2 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + __RPC__in IGameExplorer2 * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *InstallGame )( + __RPC__in IGameExplorer2 * This, + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath, + /* [unique][in] */ __RPC__in_opt LPCWSTR installDirectory, + /* [in] */ GAME_INSTALL_SCOPE installScope); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UninstallGame )( + __RPC__in IGameExplorer2 * This, + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CheckAccess )( + __RPC__in IGameExplorer2 * This, + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath, + /* [retval][out] */ __RPC__out BOOL *pHasAccess); + + END_INTERFACE + } IGameExplorer2Vtbl; + + interface IGameExplorer2 + { + CONST_VTBL struct IGameExplorer2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IGameExplorer2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IGameExplorer2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IGameExplorer2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IGameExplorer2_InstallGame(This,binaryGDFPath,installDirectory,installScope) \ + ( (This)->lpVtbl -> InstallGame(This,binaryGDFPath,installDirectory,installScope) ) + +#define IGameExplorer2_UninstallGame(This,binaryGDFPath) \ + ( (This)->lpVtbl -> UninstallGame(This,binaryGDFPath) ) + +#define IGameExplorer2_CheckAccess(This,binaryGDFPath,pHasAccess) \ + ( (This)->lpVtbl -> CheckAccess(This,binaryGDFPath,pHasAccess) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IGameExplorer2_INTERFACE_DEFINED__ */ + + + +#ifndef __gameuxLib_LIBRARY_DEFINED__ +#define __gameuxLib_LIBRARY_DEFINED__ + +/* library gameuxLib */ +/* [helpstring][version][uuid] */ + + +EXTERN_C const IID LIBID_gameuxLib; + +EXTERN_C const CLSID CLSID_GameExplorer; + +#ifdef __cplusplus + +class DECLSPEC_UUID("9A5EA990-3034-4D6F-9128-01F3C61022BC") +GameExplorer; +#endif + +EXTERN_C const CLSID CLSID_GameStatistics; + +#ifdef __cplusplus + +class DECLSPEC_UUID("DBC85A2C-C0DC-4961-B6E2-D28B62C11AD4") +GameStatistics; +#endif +#endif /* __gameuxLib_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); + +unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + + diff --git a/RenderDll/Dx9Sdk/Include/rmxfguid.h b/RenderDll/Dx9Sdk/Include/rmxfguid.h new file mode 100644 index 0000000..d3326cc --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/rmxfguid.h @@ -0,0 +1,223 @@ +/*************************************************************************** + * + * Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved. + * + * File: rmxfguid.h + * + * Content: Defines GUIDs of D3DRM's templates. + * + ***************************************************************************/ + +#ifndef __RMXFGUID_H_ +#define __RMXFGUID_H_ + +/* {2B957100-9E9A-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMInfo, +0x2b957100, 0x9e9a, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB44-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMMesh, +0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB5E-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMVector, +0x3d82ab5e, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB5F-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMMeshFace, +0x3d82ab5f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB4D-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMMaterial, +0x3d82ab4d, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {35FF44E1-6C7C-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialArray, +0x35ff44e1, 0x6c7c, 0x11cf, 0x8F, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {3D82AB46-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMFrame, +0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {F6F23F41-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMFrameTransformMatrix, +0xf6f23f41, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F6F23F42-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMeshMaterialList, +0xf6f23f42, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F6F23F40-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMeshTextureCoords, +0xf6f23f40, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F6F23F43-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMeshNormals, +0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F6F23F44-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMCoords2d, +0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F6F23F45-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMatrix4x4, +0xf6f23f45, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {3D82AB4F-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMAnimation, +0x3d82ab4f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB50-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMAnimationSet, +0x3d82ab50, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {10DD46A8-775B-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMAnimationKey, +0x10dd46a8, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {10DD46A9-775B-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMFloatKeys, +0x10dd46a9, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {01411840-7786-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialAmbientColor, +0x01411840, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {01411841-7786-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialDiffuseColor, +0x01411841, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {01411842-7786-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialSpecularColor, +0x01411842, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {D3E16E80-7835-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialEmissiveColor, +0xd3e16e80, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {01411843-7786-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialPower, +0x01411843, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {35FF44E0-6C7C-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMColorRGBA, +0x35ff44e0, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {D3E16E81-7835-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMColorRGB, +0xd3e16e81, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {A42790E0-7810-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMGuid, +0xa42790e0, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {A42790E1-7810-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMTextureFilename, +0xa42790e1, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {A42790E2-7810-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMTextureReference, +0xa42790e2, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {1630B820-7842-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMIndexedColor, +0x1630b820, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {1630B821-7842-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMeshVertexColors, +0x1630b821, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {4885AE60-78E8-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialWrap, +0x4885ae60, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {537DA6A0-CA37-11d0-941C-0080C80CFA7B} */ +DEFINE_GUID(TID_D3DRMBoolean, +0x537da6a0, 0xca37, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); + +/* {ED1EC5C0-C0A8-11d0-941C-0080C80CFA7B} */ +DEFINE_GUID(TID_D3DRMMeshFaceWraps, +0xed1ec5c0, 0xc0a8, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); + +/* {4885AE63-78E8-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMBoolean2d, +0x4885ae63, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F406B180-7B3B-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMTimedFloatKeys, +0xf406b180, 0x7b3b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {E2BF56C0-840F-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMAnimationOptions, +0xe2bf56c0, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {E2BF56C1-840F-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMFramePosition, +0xe2bf56c1, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {E2BF56C2-840F-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMFrameVelocity, +0xe2bf56c2, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {E2BF56C3-840F-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMFrameRotation, +0xe2bf56c3, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {3D82AB4A-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMLight, +0x3d82ab4a, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB51-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMCamera, +0x3d82ab51, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {E5745280-B24F-11cf-9DD5-00AA00A71A2F} */ +DEFINE_GUID(TID_D3DRMAppData, +0xe5745280, 0xb24f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); + +/* {AED22740-B31F-11cf-9DD5-00AA00A71A2F} */ +DEFINE_GUID(TID_D3DRMLightUmbra, +0xaed22740, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); + +/* {AED22742-B31F-11cf-9DD5-00AA00A71A2F} */ +DEFINE_GUID(TID_D3DRMLightRange, +0xaed22742, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); + +/* {AED22741-B31F-11cf-9DD5-00AA00A71A2F} */ +DEFINE_GUID(TID_D3DRMLightPenumbra, +0xaed22741, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); + +/* {A8A98BA0-C5E5-11cf-B941-0080C80CFA7B} */ +DEFINE_GUID(TID_D3DRMLightAttenuation, +0xa8a98ba0, 0xc5e5, 0x11cf, 0xb9, 0x41, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); + +/* {3A23EEA0-94B1-11d0-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMInlineData, +0x3a23eea0, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3A23EEA1-94B1-11d0-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMUrl, +0x3a23eea1, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {8A63C360-997D-11d0-941C-0080C80CFA7B} */ +DEFINE_GUID(TID_D3DRMProgressiveMesh, +0x8A63C360, 0x997D, 0x11d0, 0x94, 0x1C, 0x0, 0x80, 0xC8, 0x0C, 0xFA, 0x7B); + +/* {98116AA0-BDBA-11d1-82C0-00A0C9697271} */ +DEFINE_GUID(TID_D3DRMExternalVisual, +0x98116AA0, 0xBDBA, 0x11d1, 0x82, 0xC0, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x71); + +/* {7F0F21E0-BFE1-11d1-82C0-00A0C9697271} */ +DEFINE_GUID(TID_D3DRMStringProperty, +0x7f0f21e0, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71); + +/* {7F0F21E1-BFE1-11d1-82C0-00A0C9697271} */ +DEFINE_GUID(TID_D3DRMPropertyBag, +0x7f0f21e1, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71); + +// {7F5D5EA0-D53A-11d1-82C0-00A0C9697271} +DEFINE_GUID(TID_D3DRMRightHanded, +0x7f5d5ea0, 0xd53a, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71); + +#endif /* __RMXFGUID_H_ */ + diff --git a/RenderDll/Dx9Sdk/Include/rmxftmpl.h b/RenderDll/Dx9Sdk/Include/rmxftmpl.h new file mode 100644 index 0000000..e0018d0 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/rmxftmpl.h @@ -0,0 +1,339 @@ +/* D3DRM XFile templates in binary form */ + +#ifndef _RMXFTMPL_H_ +#define _RMXFTMPL_H_ + +unsigned char D3DRM_XTEMPLATES[] = { + 0x78, 0x6f, 0x66, 0x20, 0x30, 0x33, 0x30, 0x32, 0x62, + 0x69, 0x6e, 0x20, 0x30, 0x30, 0x36, 0x34, 0x1f, 0, 0x1, + 0, 0x6, 0, 0, 0, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0xa, 0, 0x5, 0, 0x43, 0xab, 0x82, 0x3d, 0xda, + 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, + 0x33, 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x6d, + 0x61, 0x6a, 0x6f, 0x72, 0x14, 0, 0x28, 0, 0x1, 0, + 0x5, 0, 0, 0, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x14, + 0, 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x66, + 0x6c, 0x61, 0x67, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0xa, 0, 0x5, 0, 0x5e, 0xab, 0x82, 0x3d, + 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, + 0xe4, 0x33, 0x2a, 0, 0x1, 0, 0x1, 0, 0, 0, + 0x78, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, 0, + 0, 0x79, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, + 0, 0, 0x7a, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, + 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64, + 0x73, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x44, 0x3f, 0xf2, + 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, + 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0, 0x1, 0, 0, + 0, 0x75, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, + 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, + 0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69, + 0x78, 0x34, 0x78, 0x34, 0xa, 0, 0x5, 0, 0x45, 0x3f, + 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, + 0x33, 0x35, 0x94, 0xa3, 0x34, 0, 0x2a, 0, 0x1, 0, + 0x6, 0, 0, 0, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, + 0xe, 0, 0x3, 0, 0x10, 0, 0, 0, 0xf, 0, + 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0, + 0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, + 0x41, 0xa, 0, 0x5, 0, 0xe0, 0x44, 0xff, 0x35, 0x7c, + 0x6c, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, + 0xa3, 0x2a, 0, 0x1, 0, 0x3, 0, 0, 0, 0x72, + 0x65, 0x64, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0, + 0, 0, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x14, 0, 0x2a, + 0, 0x1, 0, 0x4, 0, 0, 0, 0x62, 0x6c, 0x75, + 0x65, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0, 0, + 0, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x14, 0, 0xb, 0, + 0x1f, 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0xa, 0, 0x5, 0, + 0x81, 0x6e, 0xe1, 0xd3, 0x35, 0x78, 0xcf, 0x11, 0x8f, 0x52, + 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0, + 0x3, 0, 0, 0, 0x72, 0x65, 0x64, 0x14, 0, 0x2a, + 0, 0x1, 0, 0x5, 0, 0, 0, 0x67, 0x72, 0x65, + 0x65, 0x6e, 0x14, 0, 0x2a, 0, 0x1, 0, 0x4, 0, + 0, 0, 0x62, 0x6c, 0x75, 0x65, 0x14, 0, 0xb, 0, + 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, + 0xa, 0, 0x5, 0, 0x20, 0xb8, 0x30, 0x16, 0x42, 0x78, + 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, + 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x14, 0, 0x1, 0, 0x9, 0, 0, + 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, + 0x1, 0, 0xa, 0, 0, 0, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0xb, 0, + 0x1f, 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f, + 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0xa, 0, 0x5, 0, 0xa0, + 0xa6, 0x7d, 0x53, 0x37, 0xca, 0xd0, 0x11, 0x94, 0x1c, 0, + 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1, 0, 0x9, + 0, 0, 0, 0x74, 0x72, 0x75, 0x65, 0x66, 0x61, 0x6c, + 0x73, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, + 0x9, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, + 0x6e, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x63, 0xae, 0x85, + 0x48, 0xe8, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, + 0x35, 0x94, 0xa3, 0x1, 0, 0x7, 0, 0, 0, 0x42, + 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0, + 0, 0, 0x75, 0x14, 0, 0x1, 0, 0x7, 0, 0, + 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, + 0x1, 0, 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f, + 0, 0x1, 0, 0xc, 0, 0, 0, 0x4d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x57, 0x72, 0x61, 0x70, 0xa, + 0, 0x5, 0, 0x60, 0xae, 0x85, 0x48, 0xe8, 0x78, 0xcf, + 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1, + 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, + 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0, 0x75, 0x14, + 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f, + 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0, + 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0xf, + 0, 0, 0, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, + 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0xa, 0, + 0x5, 0, 0xe1, 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11, + 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x31, 0, + 0x1, 0, 0x8, 0, 0, 0, 0x66, 0x69, 0x6c, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0x8, 0, 0, 0, 0x4d, 0x61, 0x74, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0xa, 0, 0x5, 0, 0x4d, 0xab, + 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, + 0xaf, 0x71, 0xe4, 0x33, 0x1, 0, 0x9, 0, 0, 0, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, 0x1, + 0, 0x9, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x43, + 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x2a, 0, 0x1, 0, + 0x5, 0, 0, 0, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x14, + 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6c, + 0x6f, 0x72, 0x52, 0x47, 0x42, 0x1, 0, 0xd, 0, 0, + 0, 0x73, 0x70, 0x65, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x43, + 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x1, 0, 0x8, 0, + 0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, + 0x1, 0, 0xd, 0, 0, 0, 0x65, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14, + 0, 0xe, 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, + 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x8, 0, 0, + 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, 0xa, + 0, 0x5, 0, 0x5f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, + 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29, + 0, 0x1, 0, 0x12, 0, 0, 0, 0x6e, 0x46, 0x61, + 0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, + 0, 0x1, 0, 0x11, 0, 0, 0, 0x66, 0x61, 0x63, + 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, + 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, 0, 0x12, 0, + 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x56, 0x65, 0x72, + 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, + 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, + 0xd, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, + 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x73, 0xa, 0, 0x5, + 0, 0xc0, 0xc5, 0x1e, 0xed, 0xa8, 0xc0, 0xd0, 0x11, 0x94, + 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1, + 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, + 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x14, 0, 0x34, 0, 0x1, 0, 0x9, 0, 0, 0, + 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x32, 0x64, 0x1, + 0, 0xe, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x57, + 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0xe, + 0, 0x1, 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, + 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0x11, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, + 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, + 0x72, 0x64, 0x73, 0xa, 0, 0x5, 0, 0x40, 0x3f, 0xf2, + 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, + 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xe, 0, 0, + 0, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, + 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x14, 0, 0x34, 0, 0x1, + 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64, + 0x73, 0x32, 0x64, 0x1, 0, 0xd, 0, 0, 0, 0x74, + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72, + 0x64, 0x73, 0xe, 0, 0x1, 0, 0xe, 0, 0, 0, + 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, + 0x6f, 0x72, 0x64, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, + 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x4d, 0x65, + 0x73, 0x68, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x4c, 0x69, 0x73, 0x74, 0xa, 0, 0x5, 0, 0x42, 0x3f, + 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, + 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, 0, + 0, 0, 0x6e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x73, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, 0, + 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, 0, + 0x1, 0, 0xb, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xe, 0, 0x1, + 0, 0xc, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xf, 0, 0x14, + 0, 0xe, 0, 0x1, 0, 0x8, 0, 0, 0, 0x4d, + 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xf, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x4d, + 0x65, 0x73, 0x68, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, + 0xa, 0, 0x5, 0, 0x43, 0x3f, 0xf2, 0xf6, 0x86, 0x76, + 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, + 0x29, 0, 0x1, 0, 0x8, 0, 0, 0, 0x6e, 0x4e, + 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0, + 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x6f, + 0x72, 0x6d, 0x61, 0x6c, 0x73, 0xe, 0, 0x1, 0, 0x8, + 0, 0, 0, 0x6e, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, + 0x73, 0xf, 0, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, + 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x4e, 0x6f, + 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x1, + 0, 0x8, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, + 0x61, 0x63, 0x65, 0x1, 0, 0xb, 0, 0, 0, 0x66, + 0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, + 0xe, 0, 0x1, 0, 0xc, 0, 0, 0, 0x6e, 0x46, + 0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, + 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, + 0x10, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x56, 0x65, + 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, + 0xa, 0, 0x5, 0, 0x21, 0xb8, 0x30, 0x16, 0x42, 0x78, + 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, + 0x29, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e, 0x56, + 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, + 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0xc, 0, 0, + 0, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x1, 0, 0xc, 0, 0, 0, 0x76, + 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, + 0x73, 0xe, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e, + 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0x4, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, + 0xa, 0, 0x5, 0, 0x44, 0xab, 0x82, 0x3d, 0xda, 0x62, + 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, + 0x29, 0, 0x1, 0, 0x9, 0, 0, 0, 0x6e, 0x56, + 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, + 0, 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x1, 0, 0x8, 0, 0, 0, 0x76, + 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, + 0, 0x9, 0, 0, 0, 0x6e, 0x56, 0x65, 0x72, 0x74, + 0x69, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0x29, 0, + 0x1, 0, 0x6, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, + 0x65, 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0x8, 0, + 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, + 0x1, 0, 0x5, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, + 0x73, 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x6e, + 0x46, 0x61, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xe, + 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0x14, 0, 0, 0, 0x46, + 0x72, 0x61, 0x6d, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x6f, 0x72, 0x6d, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0xa, + 0, 0x5, 0, 0x41, 0x3f, 0xf2, 0xf6, 0x86, 0x76, 0xcf, + 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1, + 0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69, + 0x78, 0x34, 0x78, 0x34, 0x1, 0, 0xb, 0, 0, 0, + 0x66, 0x72, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, + 0x78, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x5, + 0, 0, 0, 0x46, 0x72, 0x61, 0x6d, 0x65, 0xa, 0, + 0x5, 0, 0x46, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, + 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe, 0, + 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, 0, + 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0, 0x46, 0x6c, + 0x6f, 0x61, 0x74, 0x4b, 0x65, 0x79, 0x73, 0xa, 0, 0x5, + 0, 0xa9, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11, 0x8f, + 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, + 0, 0x7, 0, 0, 0, 0x6e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x14, 0, 0x34, 0, 0x2a, 0, 0x1, 0, + 0x6, 0, 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0xe, 0, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54, + 0x69, 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, + 0x65, 0x79, 0x73, 0xa, 0, 0x5, 0, 0x80, 0xb1, 0x6, + 0xf4, 0x3b, 0x7b, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, + 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x4, 0, 0, + 0, 0x74, 0x69, 0x6d, 0x65, 0x14, 0, 0x1, 0, 0x9, + 0, 0, 0, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65, + 0x79, 0x73, 0x1, 0, 0x6, 0, 0, 0, 0x74, 0x66, + 0x6b, 0x65, 0x79, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0xc, 0, 0, 0, 0x41, 0x6e, 0x69, 0x6d, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0xa, 0, + 0x5, 0, 0xa8, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11, + 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, + 0x1, 0, 0x7, 0, 0, 0, 0x6b, 0x65, 0x79, 0x54, + 0x79, 0x70, 0x65, 0x14, 0, 0x29, 0, 0x1, 0, 0x5, + 0, 0, 0, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x14, 0, + 0x34, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54, 0x69, + 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65, + 0x79, 0x73, 0x1, 0, 0x4, 0, 0, 0, 0x6b, 0x65, + 0x79, 0x73, 0xe, 0, 0x1, 0, 0x5, 0, 0, 0, + 0x6e, 0x4b, 0x65, 0x79, 0x73, 0xf, 0, 0x14, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x41, + 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa, 0, 0x5, 0, 0xc0, + 0x56, 0xbf, 0xe2, 0xf, 0x84, 0xcf, 0x11, 0x8f, 0x52, 0, + 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, + 0, 0, 0, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, + 0x73, 0x65, 0x64, 0x14, 0, 0x29, 0, 0x1, 0, 0xf, + 0, 0, 0, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x14, 0, + 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0, + 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa, + 0, 0x5, 0, 0x4f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, + 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe, + 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x41, + 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x74, 0xa, 0, 0x5, 0, 0x50, 0xab, 0x82, 0x3d, 0xda, + 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, + 0x33, 0xe, 0, 0x1, 0, 0x9, 0, 0, 0, 0x41, + 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xf, 0, + 0xb, 0, 0x1f, 0, 0x1, 0, 0xa, 0, 0, 0, + 0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, + 0xa, 0, 0x5, 0, 0xa0, 0xee, 0x23, 0x3a, 0xb1, 0x94, + 0xd0, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, + 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x42, 0x49, + 0x4e, 0x41, 0x52, 0x59, 0xf, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72, 0x6c, 0xa, + 0, 0x5, 0, 0xa1, 0xee, 0x23, 0x3a, 0xb1, 0x94, 0xd0, + 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29, + 0, 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72, + 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x31, 0, 0x1, 0, + 0x4, 0, 0, 0, 0x75, 0x72, 0x6c, 0x73, 0xe, 0, + 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72, 0x6c, + 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, + 0, 0xf, 0, 0, 0, 0x50, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x68, + 0xa, 0, 0x5, 0, 0x60, 0xc3, 0x63, 0x8a, 0x7d, 0x99, + 0xd0, 0x11, 0x94, 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, + 0xe, 0, 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72, + 0x6c, 0x13, 0, 0x1, 0, 0xa, 0, 0, 0, 0x49, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0xf, + 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x4, 0, 0, + 0, 0x47, 0x75, 0x69, 0x64, 0xa, 0, 0x5, 0, 0xe0, + 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0, + 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x5, + 0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x31, 0x14, 0, + 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x64, 0x61, + 0x74, 0x61, 0x32, 0x14, 0, 0x28, 0, 0x1, 0, 0x5, + 0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x33, 0x14, 0, + 0x34, 0, 0x2d, 0, 0x1, 0, 0x5, 0, 0, 0, + 0x64, 0x61, 0x74, 0x61, 0x34, 0xe, 0, 0x3, 0, 0x8, + 0, 0, 0, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, + 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x79, 0xa, 0, 0x5, 0, 0xe0, 0x21, 0xf, 0x7f, 0xe1, + 0xbf, 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, + 0x71, 0x31, 0, 0x1, 0, 0x3, 0, 0, 0, 0x6b, + 0x65, 0x79, 0x14, 0, 0x31, 0, 0x1, 0, 0x5, 0, + 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x14, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x50, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x42, 0x61, 0x67, + 0xa, 0, 0x5, 0, 0xe1, 0x21, 0xf, 0x7f, 0xe1, 0xbf, + 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, + 0xe, 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0, + 0xe, 0, 0, 0, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, 0x61, 0x6c, 0xa, 0, + 0x5, 0, 0xa0, 0x6a, 0x11, 0x98, 0xba, 0xbd, 0xd1, 0x11, + 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x1, 0, + 0x4, 0, 0, 0, 0x47, 0x75, 0x69, 0x64, 0x1, 0, + 0x12, 0, 0, 0, 0x67, 0x75, 0x69, 0x64, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, + 0x61, 0x6c, 0x14, 0, 0xe, 0, 0x12, 0, 0x12, 0, + 0x12, 0, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0, + 0xb, 0, 0, 0, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48, + 0x61, 0x6e, 0x64, 0x65, 0x64, 0xa, 0, 0x5, 0, 0xa0, + 0x5e, 0x5d, 0x7f, 0x3a, 0xd5, 0xd1, 0x11, 0x82, 0xc0, 0, + 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x29, 0, 0x1, 0, 0xc, + 0, 0, 0, 0x62, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48, + 0x61, 0x6e, 0x64, 0x65, 0x64, 0x14, 0, 0xb, 0 +}; + +#define D3DRM_XTEMPLATE_BYTES 3278 + +#endif /* _RMXFTMPL_H_ */ diff --git a/RenderDll/Dx9Sdk/Include/rpcsal.h b/RenderDll/Dx9Sdk/Include/rpcsal.h new file mode 100644 index 0000000..484ddc9 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/rpcsal.h @@ -0,0 +1,499 @@ +/****************************************************************\ +* * +* rpcsal.h - markers for documenting the semantics of RPC APIs * +* * +* Version 1.0 * +* * +* Copyright (c) 2004 Microsoft Corporation. All rights reserved. * +* * +\****************************************************************/ + +// ------------------------------------------------------------------------------- +// Introduction +// +// rpcsal.h provides a set of annotations to describe how RPC functions use their +// parameters - the assumptions it makes about them, adn the guarantees it makes +// upon finishing. These annotations are similar to those found in specstrings.h, +// but are designed to be used by the MIDL compiler when it generates annotations +// enabled header files. +// +// IDL authors do not need to annotate their functions declarations. The MIDL compiler +// will interpret the IDL directives and use one of the annotations contained +// in this header. This documentation is intended to help those trying to understand +// the MIDL-generated header files or those who maintain their own copies of these files. +// +// ------------------------------------------------------------------------------- +// Differences between rpcsal.h and specstrings.h +// +// There are a few important differences between the annotations found in rpcsal.h and +// those in specstrings.h: +// +// 1. [in] parameters are not marked as read-only. They may be used for scratch space +// at the server and changes will not affect the client. +// 2. String versions of each macro alleviates the need for a special type definition +// +// ------------------------------------------------------------------------------- +// Interpreting RPC Annotations +// +// These annotations are interpreted precisely in the same way as those in specstrings.h. +// Please refer to that header for information related to general usage in annotations. +// +// To construct an RPC annotation, concatenate the appropriate value from each category +// along with a leading __RPC_. A typical annotation looks like "__RPC__in_string". +// +// |----------------------------------------------------------------------------------| +// | RPC Annotations | +// |------------|------------|---------|--------|----------|----------|---------------| +// | Level | Usage | Size | Output | Optional | String | Parameters | +// |------------|------------|---------|--------|----------|----------|---------------| +// | <> | <> | <> | <> | <> | <> | <> | +// | _deref | _in | _ecount | _full | _opt | _string | (size) | +// | _deref_opt | _out | _bcount | _part | | | (size,length) | +// | | _inout | | | | | | +// | | | | | | | | +// |------------|------------|---------|--------|----------|----------|---------------| +// +// Level: Describes the buffer pointer's level of indirection from the parameter or +// return value 'p'. +// +// <> : p is the buffer pointer. +// _deref : *p is the buffer pointer. p must not be NULL. +// _deref_opt : *p may be the buffer pointer. p may be NULL, in which case the rest of +// the annotation is ignored. +// +// Usage: Describes how the function uses the buffer. +// +// <> : The buffer is not accessed. If used on the return value or with _deref, the +// function will provide the buffer, and it will be uninitialized at exit. +// Otherwise, the caller must provide the buffer. This should only be used +// for alloc and free functions. +// _in : The function will only read from the buffer. The caller must provide the +// buffer and initialize it. Cannot be used with _deref. +// _out : The function will only write to the buffer. If used on the return value or +// with _deref, the function will provide the buffer and initialize it. +// Otherwise, the caller must provide the buffer, and the function will +// initialize it. +// _inout : The function may freely read from and write to the buffer. The caller must +// provide the buffer and initialize it. If used with _deref, the buffer may +// be reallocated by the function. +// +// Size: Describes the total size of the buffer. This may be less than the space actually +// allocated for the buffer, in which case it describes the accessible amount. +// +// <> : No buffer size is given. If the type specifies the buffer size (such as +// with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one +// element long. Must be used with _in, _out, or _inout. +// _ecount : The buffer size is an explicit element count. +// _bcount : The buffer size is an explicit byte count. +// +// Output: Describes how much of the buffer will be initialized by the function. For +// _inout buffers, this also describes how much is initialized at entry. Omit this +// category for _in buffers; they must be fully initialized by the caller. +// +// <> : The type specifies how much is initialized. For instance, a function initializing +// an LPWSTR must NULL-terminate the string. +// _full : The function initializes the entire buffer. +// _part : The function initializes part of the buffer, and explicitly indicates how much. +// +// Optional: Describes if the buffer itself is optional. +// +// <> : The pointer to the buffer must not be NULL. +// _opt : The pointer to the buffer might be NULL. It will be checked before being dereferenced. +// +// String: Describes if the buffer is NULL terminated +// +// <> : The buffer is not assumed to be NULL terminated +// _string : The buffer is assumed to be NULL terminated once it has been initialized +// +// Parameters: Gives explicit counts for the size and length of the buffer. +// +// <> : There is no explicit count. Use when neither _ecount nor _bcount is used. +// (size) : Only the buffer's total size is given. Use with _ecount or _bcount but not _part. +// (size,length) : The buffer's total size and initialized length are given. Use with _ecount_part +// and _bcount_part. +// +// Notes: +// +// 1. Specifying two buffer annotations on a single parameter results in unspecified behavior +// (e.g. __RPC__in_bcount(5) __RPC__out_bcount(6) +// +// 2. The size of the buffer and the amount that has been initialized are separate concepts. +// Specify the size using _ecount or _bcount. Specify the amount that is initialized using +// _full, _part, or _string. As a special case, a single element buffer does not need +// _ecount, _bcount, _full, or _part +// +// 3. The count may be less than the total size of the buffer in which case it describes the +// accessible portion. +// +// 4. "__RPC__opt" and "__RPC_deref" are not valid annotations. +// +// 5. The placement of _opt when using _deref is important: +// __RPC__deref_opt_... : Input may be NULL +// __RPC__deref_..._opt : Output may be NULL +// __RPC__deref_opt_..._opt : Both input and output may be NULL +// + +#pragma once + +#include + +#ifndef __RPCSAL_H_VERSION__ +#define __RPCSAL_H_VERSION__ ( 100 ) +#endif // __RPCSAL_H_VERSION__ + +#ifdef __REQUIRED_RPCSAL_H_VERSION__ + #if ( __RPCSAL_H_VERSION__ < __REQUIRED_RPCSAL_H_VERSION__ ) + #error incorrect version. Use the header that matches with the MIDL compiler. + #endif +#endif + + +#ifdef __cplusplus +extern "C" { +#endif // #ifdef __cplusplus + +#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_) + + +// [in] +#define __RPC__in __pre __valid +#define __RPC__in_string __RPC__in __pre __nullterminated +#define __RPC__in_ecount(size) __RPC__in __pre __elem_readableTo(size) +#define __RPC__in_ecount_full(size) __RPC__in_ecount(size) +#define __RPC__in_ecount_full_string(size) __RPC__in_ecount_full(size) __pre __nullterminated +#define __RPC__in_ecount_part(size, length) __RPC__in_ecount(length) __pre __elem_writableTo(size) +#define __RPC__in_ecount_full_opt(size) __RPC__in_ecount_full(size) __pre __exceptthat __maybenull +#define __RPC__in_ecount_full_opt_string(size) __RPC__in_ecount_full_opt(size) __pre __nullterminated +#define __RPC__in_ecount_part_opt(size, length) __RPC__in_ecount_part(size, length) __pre __exceptthat __maybenull +#define __RPC__in_xcount(size) __RPC__in __pre __elem_readableTo(size) +#define __RPC__in_xcount_full(size) __RPC__in_ecount(size) +#define __RPC__in_xcount_full_string(size) __RPC__in_ecount_full(size) __pre __nullterminated +#define __RPC__in_xcount_part(size, length) __RPC__in_ecount(length) __pre __elem_writableTo(size) +#define __RPC__in_xcount_full_opt(size) __RPC__in_ecount_full(size) __pre __exceptthat __maybenull +#define __RPC__in_xcount_full_opt_string(size) __RPC__in_ecount_full_opt(size) __pre __nullterminated +#define __RPC__in_xcount_part_opt(size, length) __RPC__in_ecount_part(size, length) __pre __exceptthat __maybenull + + +#define __RPC__deref_in __RPC__in __deref __notnull +#define __RPC__deref_in_string __RPC__in __pre __deref __nullterminated +#define __RPC__deref_in_opt __RPC__deref_in __deref __exceptthat __maybenull +#define __RPC__deref_in_opt_string __RPC__deref_in_opt __pre __deref __nullterminated +#define __RPC__deref_opt_in __RPC__in __exceptthat __maybenull +#define __RPC__deref_opt_in_string __RPC__deref_opt_in __pre __deref __nullterminated +#define __RPC__deref_opt_in_opt __RPC__deref_opt_in __pre __deref __exceptthat __maybenull +#define __RPC__deref_opt_in_opt_string __RPC__deref_opt_in_opt __pre __deref __nullterminated +#define __RPC__deref_in_ecount(size) __RPC__in __pre __deref __elem_readableTo(size) +#define __RPC__deref_in_ecount_part(size, length) __RPC__deref_in_ecount(size) __pre __deref __elem_readableTo(length) +#define __RPC__deref_in_ecount_full(size) __RPC__deref_in_ecount_part(size, size) +#define __RPC__deref_in_ecount_full_opt(size) __RPC__deref_in_ecount_full(size) __pre __deref __exceptthat __maybenull +#define __RPC__deref_in_ecount_full_opt_string(size) __RPC__deref_in_ecount_full_opt(size) __pre __deref __nullterminated +#define __RPC__deref_in_ecount_full_string(size) __RPC__deref_in_ecount_full(size) __pre __deref __nullterminated +#define __RPC__deref_in_ecount_opt(size) __RPC__deref_in_ecount(size) __pre __deref __exceptthat __maybenull +#define __RPC__deref_in_ecount_opt_string(size) __RPC__deref_in_ecount_opt(size) __pre __deref __nullterminated +#define __RPC__deref_in_ecount_part_opt(size, length) __RPC__deref_in_ecount_opt(size) __pre __deref __elem_readableTo(length) +#define __RPC__deref_in_xcount(size) __RPC__in __pre __deref __elem_readableTo(size) +#define __RPC__deref_in_xcount_part(size, length) __RPC__deref_in_ecount(size) __pre __deref __elem_readableTo(length) +#define __RPC__deref_in_xcount_full(size) __RPC__deref_in_ecount_part(size, size) +#define __RPC__deref_in_xcount_full_opt(size) __RPC__deref_in_ecount_full(size) __pre __deref __exceptthat __maybenull +#define __RPC__deref_in_xcount_full_opt_string(size) __RPC__deref_in_ecount_full_opt(size) __pre __deref __nullterminated +#define __RPC__deref_in_xcount_full_string(size) __RPC__deref_in_ecount_full(size) __pre __deref __nullterminated +#define __RPC__deref_in_xcount_opt(size) __RPC__deref_in_ecount(size) __pre __deref __exceptthat __maybenull +#define __RPC__deref_in_xcount_opt_string(size) __RPC__deref_in_ecount_opt(size) __pre __deref __nullterminated +#define __RPC__deref_in_xcount_part_opt(size, length) __RPC__deref_in_ecount_opt(size) __pre __deref __elem_readableTo(length) + +// [out] +#define __RPC__out __out +#define __RPC__out_ecount(size) __out_ecount(size) __post __elem_writableTo(size) +#define __RPC__out_ecount_string(size) __RPC__out_ecount(size) __post __nullterminated +#define __RPC__out_ecount_part(size, length) __RPC__out_ecount(size) __post __elem_readableTo(length) +#define __RPC__out_ecount_full(size) __RPC__out_ecount_part(size, size) +#define __RPC__out_ecount_full_string(size) __RPC__out_ecount_full(size) __post __nullterminated +#define __RPC__out_xcount(size) __out +#define __RPC__out_xcount_string(size) __RPC__out __post __nullterminated +#define __RPC__out_xcount_part(size, length) __RPC__out +#define __RPC__out_xcount_full(size) __RPC__out +#define __RPC__out_xcount_full_string(size) __RPC__out __post __nullterminated + +// [in,out] +#define __RPC__inout __inout +#define __RPC__inout_string __RPC__inout __pre __nullterminated __post __nullterminated +#define __RPC__inout_ecount(size) __inout_ecount(size) +#define __RPC__inout_ecount_part(size, length) __inout_ecount_part(size, length) +#define __RPC__inout_ecount_full(size) __RPC__inout_ecount_part(size, size) +#define __RPC__inout_ecount_full_string(size) __RPC__inout_ecount_full(size) __pre __nullterminated __post __nullterminated +#define __RPC__inout_xcount(size) __inout +#define __RPC__inout_xcount_part(size, length) __inout +#define __RPC__inout_xcount_full(size) __RPC__inout +#define __RPC__inout_xcount_full_string(size) __RPC__inout __pre __nullterminated __post __nullterminated + +// [in,unique] +#define __RPC__in_opt __RPC__in __pre __exceptthat __maybenull +#define __RPC__in_opt_string __RPC__in_opt __pre __nullterminated +#define __RPC__in_ecount_opt(size) __RPC__in_ecount(size) __pre __exceptthat __maybenull +#define __RPC__in_ecount_opt_string(size) __RPC__in_ecount_opt(size) __pre __nullterminated +#define __RPC__in_xcount_opt(size) __RPC__in_ecount(size) __pre __exceptthat __maybenull +#define __RPC__in_xcount_opt_string(size) __RPC__in_ecount_opt(size) __pre __nullterminated + +// [in,out,unique] +#define __RPC__inout_opt __inout_opt +#define __RPC__inout_opt_string __RPC__inout_opt __pre __nullterminated +#define __RPC__inout_ecount_opt(size) __inout_ecount_opt(size) +#define __RPC__inout_ecount_part_opt(size, length) __inout_ecount_part_opt(size, length) +#define __RPC__inout_ecount_full_opt(size) __RPC__inout_ecount_part_opt(size, size) +#define __RPC__inout_ecount_full_opt_string(size) __RPC__inout_ecount_full_opt(size) __pre __nullterminated __post __nullterminated +#define __RPC__inout_xcount_opt(size) __inout_opt +#define __RPC__inout_xcount_part_opt(size, length) __inout_opt +#define __RPC__inout_xcount_full_opt(size) __RPC__inout_opt +#define __RPC__inout_xcount_full_opt_string(size) __RPC__inout_opt __pre __nullterminated __post __nullterminated + +// [out] ** +#define __RPC__deref_out __deref_out +#define __RPC__deref_out_string __RPC__deref_out __post __deref __nullterminated +// Removed "__post __deref __exceptthat __maybenull" so return values from QueryInterface and the like can be trusted without an explicit NULL check. +// This is a temporary fix until midl.exe can be rev'd to produce more accurate annotations. +#define __RPC__deref_out_opt __RPC__deref_out +#define __RPC__deref_out_opt_string __RPC__deref_out_opt __post __deref __nullterminated __pre __deref __null +#define __RPC__deref_out_ecount(size) __deref_out_ecount(size) __post __deref __elem_writableTo(size) +#define __RPC__deref_out_ecount_part(size, length) __RPC__deref_out_ecount(size) __post __deref __elem_readableTo(length) +#define __RPC__deref_out_ecount_full(size) __RPC__deref_out_ecount_part(size,size) +#define __RPC__deref_out_ecount_full_string(size) __RPC__deref_out_ecount_full(size) __post __deref __nullterminated +#define __RPC__deref_out_xcount(size) __deref_out __post __deref +#define __RPC__deref_out_xcount_part(size, length) __RPC__deref_out __post __deref +#define __RPC__deref_out_xcount_full(size) __RPC__deref_out +#define __RPC__deref_out_xcount_full_string(size) __RPC__deref_out __post __deref __nullterminated + +// [in,out] **, second pointer decoration. +#define __RPC__deref_inout __deref_inout +#define __RPC__deref_inout_string __RPC__deref_inout __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_inout_opt __deref_inout_opt +#define __RPC__deref_inout_opt_string __RPC__deref_inout_opt __deref __nullterminated +#define __RPC__deref_inout_ecount_opt(size) __deref_inout_ecount_opt(size) +#define __RPC__deref_inout_ecount_part_opt(size, length) __deref_inout_ecount_part_opt(size , length) +#define __RPC__deref_inout_ecount_full_opt(size) __RPC__deref_inout_ecount_part_opt(size, size) +#define __RPC__deref_inout_ecount_full(size) __deref_inout_ecount_full(size) +#define __RPC__deref_inout_ecount_full_string(size) __RPC__deref_inout_ecount_full(size) __post __deref __nullterminated +#define __RPC__deref_inout_ecount_full_opt_string(size) __RPC__deref_inout_ecount_full_opt(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_inout_xcount_opt(size) __deref_inout_opt +#define __RPC__deref_inout_xcount_part_opt(size, length) __deref_inout_opt +#define __RPC__deref_inout_xcount_full_opt(size) __RPC__deref_inout_opt +#define __RPC__deref_inout_xcount_full(size) __deref_inout +#define __RPC__deref_inout_xcount_full_string(size) __RPC__deref_inout __post __deref __nullterminated +#define __RPC__deref_inout_xcount_full_opt_string(size) __RPC__deref_inout_opt __pre __deref __nullterminated __post __deref __nullterminated + + +// #define __RPC_out_opt out_opt is not allowed in rpc + +// [in,out,unique] +#define __RPC__deref_opt_inout __deref_opt_inout +#define __RPC__deref_opt_inout_ecount(size) __deref_opt_inout_ecount(size) +#define __RPC__deref_opt_inout_string __RPC__deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_opt_inout_ecount_part(size, length) __deref_opt_inout_ecount_part(size, length) +#define __RPC__deref_opt_inout_ecount_full(size) __deref_opt_inout_ecount_full(size) +#define __RPC__deref_opt_inout_ecount_full_string(size) __RPC__deref_opt_inout_ecount_full(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_opt_inout_xcount_part(size, length) __deref_opt_inout +#define __RPC__deref_opt_inout_xcount_full(size) __deref_opt_inout +#define __RPC__deref_opt_inout_xcount_full_string(size) __RPC__deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated + + +// We don't need to specify __pre __deref __exceptthat __maybenull : this is default behavior. While this might not hold in SAL 1.1 syntax, SAL team +// believes it's OK. We can revisit if SAL 1.1 can survive. +#define __RPC__deref_out_ecount_opt(size) __RPC__out_ecount(size) __post __deref __exceptthat __maybenull __pre __deref __null +#define __RPC__deref_out_ecount_part_opt(size, length) __RPC__deref_out_ecount_part(size, length) __post __deref __exceptthat __maybenull __pre __deref __null +#define __RPC__deref_out_ecount_full_opt(size) __RPC__deref_out_ecount_part_opt(size, size) __pre __deref __null +#define __RPC__deref_out_ecount_full_opt_string(size) __RPC__deref_out_ecount_part_opt(size, size) __post __deref __nullterminated __pre __deref __null +#define __RPC__deref_out_xcount_opt(size) __RPC__out __post __deref __exceptthat __maybenull __pre __deref __null +#define __RPC__deref_out_xcount_part_opt(size, length) __RPC__deref_out __post __deref __exceptthat __maybenull __pre __deref __null +#define __RPC__deref_out_xcount_full_opt(size) __RPC__deref_out_opt __pre __deref __null +#define __RPC__deref_out_xcount_full_opt_string(size) __RPC__deref_out_opt __post __deref __nullterminated __pre __deref __null + +#define __RPC__deref_opt_inout_opt __deref_opt_inout_opt +#define __RPC__deref_opt_inout_opt_string __RPC__deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_opt_inout_ecount_opt(size) __deref_opt_inout_ecount_opt(size) +#define __RPC__deref_opt_inout_ecount_part_opt(size, length) __deref_opt_inout_ecount_part_opt(size, length) +#define __RPC__deref_opt_inout_ecount_full_opt(size) __RPC__deref_opt_inout_ecount_part_opt(size, size) +#define __RPC__deref_opt_inout_ecount_full_opt_string(size) __RPC__deref_opt_inout_ecount_full_opt(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_opt_inout_xcount_opt(size) __deref_opt_inout_opt +#define __RPC__deref_opt_inout_xcount_part_opt(size, length) __deref_opt_inout_opt +#define __RPC__deref_opt_inout_xcount_full_opt(size) __RPC__deref_opt_inout_opt +#define __RPC__deref_opt_inout_xcount_full_opt_string(size) __RPC__deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated + +#define __RPC_full_pointer __maybenull +#define __RPC_unique_pointer __maybenull +#define __RPC_ref_pointer __notnull +#define __RPC_string __nullterminated + +#define __RPC__range(min,max) __range(min,max) +#define __RPC__in_range(min,max) __in_range(min,max) + +#else // not prefast + +#define __RPC__range(min,max) +#define __RPC__in_range(min,max) + +#define __RPC__in +#define __RPC__in_string +#define __RPC__in_opt_string +#define __RPC__in_ecount(size) +#define __RPC__in_ecount_full(size) +#define __RPC__in_ecount_full_string(size) +#define __RPC__in_ecount_part(size, length) +#define __RPC__in_ecount_full_opt(size) +#define __RPC__in_ecount_full_opt_string(size) +#define __RPC__inout_ecount_full_opt_string(size) +#define __RPC__in_ecount_part_opt(size, length) +#define __RPC__in_xcount(size) +#define __RPC__in_xcount_full(size) +#define __RPC__in_xcount_full_string(size) +#define __RPC__in_xcount_part(size, length) +#define __RPC__in_xcount_full_opt(size) +#define __RPC__in_xcount_full_opt_string(size) +#define __RPC__inout_xcount_full_opt_string(size) +#define __RPC__in_xcount_part_opt(size, length) + +#define __RPC__deref_in +#define __RPC__deref_in_string +#define __RPC__deref_in_opt +#define __RPC__deref_in_opt_string +#define __RPC__deref_opt_in +#define __RPC__deref_opt_in_string +#define __RPC__deref_opt_in_opt +#define __RPC__deref_opt_in_opt_string +#define __RPC__deref_in_ecount(size) +#define __RPC__deref_in_ecount_part(size, length) +#define __RPC__deref_in_ecount_full(size) +#define __RPC__deref_in_ecount_full_opt(size) +#define __RPC__deref_in_ecount_full_string(size) +#define __RPC__deref_in_ecount_full_opt_string(size) +#define __RPC__deref_in_ecount_opt(size) +#define __RPC__deref_in_ecount_opt_string(size) +#define __RPC__deref_in_ecount_part_opt(size, length) +#define __RPC__deref_in_xcount(size) +#define __RPC__deref_in_xcount_part(size, length) +#define __RPC__deref_in_xcount_full(size) +#define __RPC__deref_in_xcount_full_opt(size) +#define __RPC__deref_in_xcount_full_string(size) +#define __RPC__deref_in_xcount_full_opt_string(size) +#define __RPC__deref_in_xcount_opt(size) +#define __RPC__deref_in_xcount_opt_string(size) +#define __RPC__deref_in_xcount_part_opt(size, length) + +// [out] +#define __RPC__out +#define __RPC__out_ecount(size) +#define __RPC__out_ecount_part(size, length) +#define __RPC__out_ecount_full(size) +#define __RPC__out_ecount_full_string(size) +#define __RPC__out_xcount(size) +#define __RPC__out_xcount_part(size, length) +#define __RPC__out_xcount_full(size) +#define __RPC__out_xcount_full_string(size) + +// [in,out] +#define __RPC__inout +#define __RPC__inout_string +#define __RPC__opt_inout +#define __RPC__inout_ecount(size) +#define __RPC__inout_ecount_part(size, length) +#define __RPC__inout_ecount_full(size) +#define __RPC__inout_ecount_full_string(size) +#define __RPC__inout_xcount(size) +#define __RPC__inout_xcount_part(size, length) +#define __RPC__inout_xcount_full(size) +#define __RPC__inout_xcount_full_string(size) + +// [in,unique] +#define __RPC__in_opt +#define __RPC__in_ecount_opt(size) +#define __RPC__in_xcount_opt(size) + + +// [in,out,unique] +#define __RPC__inout_opt +#define __RPC__inout_opt_string +#define __RPC__inout_ecount_opt(size) +#define __RPC__inout_ecount_part_opt(size, length) +#define __RPC__inout_ecount_full_opt(size) +#define __RPC__inout_ecount_full_string(size) +#define __RPC__inout_xcount_opt(size) +#define __RPC__inout_xcount_part_opt(size, length) +#define __RPC__inout_xcount_full_opt(size) +#define __RPC__inout_xcount_full_string(size) + +// [out] ** +#define __RPC__deref_out +#define __RPC__deref_out_string +#define __RPC__deref_out_opt +#define __RPC__deref_out_opt_string +#define __RPC__deref_out_ecount(size) +#define __RPC__deref_out_ecount_part(size, length) +#define __RPC__deref_out_ecount_full(size) +#define __RPC__deref_out_ecount_full_string(size) +#define __RPC__deref_out_xcount(size) +#define __RPC__deref_out_xcount_part(size, length) +#define __RPC__deref_out_xcount_full(size) +#define __RPC__deref_out_xcount_full_string(size) + + +// [in,out] **, second pointer decoration. +#define __RPC__deref_inout +#define __RPC__deref_inout_string +#define __RPC__deref_inout_opt +#define __RPC__deref_inout_opt_string +#define __RPC__deref_inout_ecount_full(size) +#define __RPC__deref_inout_ecount_full_string(size) +#define __RPC__deref_inout_ecount_opt(size) +#define __RPC__deref_inout_ecount_part_opt(size, length) +#define __RPC__deref_inout_ecount_full_opt(size) +#define __RPC__deref_inout_ecount_full_opt_string(size) +#define __RPC__deref_inout_xcount_full(size) +#define __RPC__deref_inout_xcount_full_string(size) +#define __RPC__deref_inout_xcount_opt(size) +#define __RPC__deref_inout_xcount_part_opt(size, length) +#define __RPC__deref_inout_xcount_full_opt(size) +#define __RPC__deref_inout_xcount_full_opt_string(size) + +// #define __RPC_out_opt out_opt is not allowed in rpc + +// [in,out,unique] +#define __RPC__deref_opt_inout +#define __RPC__deref_opt_inout_string +#define __RPC__deref_opt_inout_ecount(size) +#define __RPC__deref_opt_inout_ecount_part(size, length) +#define __RPC__deref_opt_inout_ecount_full(size) +#define __RPC__deref_opt_inout_ecount_full_string(size) +#define __RPC__deref_opt_inout_xcount(size) +#define __RPC__deref_opt_inout_xcount_part(size, length) +#define __RPC__deref_opt_inout_xcount_full(size) +#define __RPC__deref_opt_inout_xcount_full_string(size) + +#define __RPC__deref_out_ecount_opt(size) +#define __RPC__deref_out_ecount_part_opt(size, length) +#define __RPC__deref_out_ecount_full_opt(size) +#define __RPC__deref_out_ecount_full_opt_string(size) +#define __RPC__deref_out_xcount_opt(size) +#define __RPC__deref_out_xcount_part_opt(size, length) +#define __RPC__deref_out_xcount_full_opt(size) +#define __RPC__deref_out_xcount_full_opt_string(size) + +#define __RPC__deref_opt_inout_opt +#define __RPC__deref_opt_inout_opt_string +#define __RPC__deref_opt_inout_ecount_opt(size) +#define __RPC__deref_opt_inout_ecount_part_opt(size, length) +#define __RPC__deref_opt_inout_ecount_full_opt(size) +#define __RPC__deref_opt_inout_ecount_full_opt_string(size) +#define __RPC__deref_opt_inout_xcount_opt(size) +#define __RPC__deref_opt_inout_xcount_part_opt(size, length) +#define __RPC__deref_opt_inout_xcount_full_opt(size) +#define __RPC__deref_opt_inout_xcount_full_opt_string(size) + +#define __RPC_full_pointer +#define __RPC_unique_pointer +#define __RPC_ref_pointer +#define __RPC_string + + +#endif + +#ifdef __cplusplus +} +#endif diff --git a/RenderDll/Dx9Sdk/Include/xact3.h b/RenderDll/Dx9Sdk/Include/xact3.h new file mode 100644 index 0000000..c27d563 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/xact3.h @@ -0,0 +1,1551 @@ +/************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * Module Name: + * + * xact3.h + * + * Abstract: + * + * XACT public interfaces, functions and data types + * + **************************************************************************/ + +#pragma once + +#ifndef _XACT3_H_ +#define _XACT3_H_ + +//------------------------------------------------------------------------------ +// XACT class and interface IDs (Version 3.7) +//------------------------------------------------------------------------------ +#ifndef _XBOX // XACT COM support only exists on Windows + #include // For DEFINE_CLSID, DEFINE_IID and DECLARE_INTERFACE + DEFINE_CLSID(XACTEngine, bcc782bc, 6492, 4c22, 8c, 35, f5, d7, 2f, e7, 3c, 6e); + DEFINE_CLSID(XACTAuditionEngine, 9ecdd80d, 0e81, 40d8, 89, 03, 2b, f7, b1, 31, ac, 43); + DEFINE_CLSID(XACTDebugEngine, 02860630, bf3b, 42a8, b1, 4e, 91, ed, a2, f5, 1e, a5); + DEFINE_IID(IXACT3Engine, b1ee676a, d9cd, 4d2a, 89, a8, fa, 53, eb, 9e, 48, 0b); +#endif + +// Ignore the rest of this header if only the GUID definitions were requested: +#ifndef GUID_DEFS_ONLY + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ + +#ifndef _XBOX + #include + #include + #include +#endif +#include +#include +#include + +//------------------------------------------------------------------------------ +// Forward Declarations +//------------------------------------------------------------------------------ + +typedef struct IXACT3SoundBank IXACT3SoundBank; +typedef struct IXACT3WaveBank IXACT3WaveBank; +typedef struct IXACT3Cue IXACT3Cue; +typedef struct IXACT3Wave IXACT3Wave; +typedef struct IXACT3Engine IXACT3Engine; +typedef struct XACT_NOTIFICATION XACT_NOTIFICATION; + + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +typedef WORD XACTINDEX; // All normal indices +typedef BYTE XACTNOTIFICATIONTYPE; // Notification type +typedef FLOAT XACTVARIABLEVALUE; // Variable value +typedef WORD XACTVARIABLEINDEX; // Variable index +typedef WORD XACTCATEGORY; // Sound category +typedef BYTE XACTCHANNEL; // Audio channel +typedef FLOAT XACTVOLUME; // Volume value +typedef LONG XACTTIME; // Time (in ms) +typedef SHORT XACTPITCH; // Pitch value +typedef BYTE XACTLOOPCOUNT; // For all loops / recurrences +typedef BYTE XACTVARIATIONWEIGHT; // Variation weight +typedef BYTE XACTPRIORITY; // Sound priority +typedef BYTE XACTINSTANCELIMIT; // Instance limitations + +//------------------------------------------------------------------------------ +// Standard win32 multimedia definitions +//------------------------------------------------------------------------------ +#ifndef WAVE_FORMAT_IEEE_FLOAT + #define WAVE_FORMAT_IEEE_FLOAT 0x0003 +#endif + +#ifndef WAVE_FORMAT_EXTENSIBLE + #define WAVE_FORMAT_EXTENSIBLE 0xFFFE +#endif + +#ifndef _WAVEFORMATEX_ +#define _WAVEFORMATEX_ + #pragma pack(push, 1) + typedef struct tWAVEFORMATEX + { + WORD wFormatTag; // format type + WORD nChannels; // number of channels (i.e. mono, stereo...) + DWORD nSamplesPerSec; // sample rate + DWORD nAvgBytesPerSec; // for buffer estimation + WORD nBlockAlign; // block size of data + WORD wBitsPerSample; // Number of bits per sample of mono data + WORD cbSize; // The count in bytes of the size of extra information (after cbSize) + + } WAVEFORMATEX, *PWAVEFORMATEX; + typedef WAVEFORMATEX NEAR *NPWAVEFORMATEX; + typedef WAVEFORMATEX FAR *LPWAVEFORMATEX; + #pragma pack(pop) +#endif + +#ifndef _WAVEFORMATEXTENSIBLE_ +#define _WAVEFORMATEXTENSIBLE_ + #pragma pack(push, 1) + typedef struct + { + WAVEFORMATEX Format; // WAVEFORMATEX data + + union + { + WORD wValidBitsPerSample; // Bits of precision + WORD wSamplesPerBlock; // Samples per block of audio data, valid if wBitsPerSample==0 + WORD wReserved; // Unused -- If neither applies, set to zero. + } Samples; + + DWORD dwChannelMask; // Speaker usage bitmask + GUID SubFormat; // Sub-format identifier + } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; + #pragma pack(pop) +#endif + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ +static const XACTTIME XACTTIME_MIN = LONG_MIN; +static const XACTTIME XACTTIME_MAX = LONG_MAX; // 24 days 20:31:23.647 +static const XACTTIME XACTTIME_INFINITE = LONG_MAX; +static const XACTINSTANCELIMIT XACTINSTANCELIMIT_INFINITE = 0xff; +static const XACTINSTANCELIMIT XACTINSTANCELIMIT_MIN = 0x00; // == 1 instance total (0 additional instances) +static const XACTINSTANCELIMIT XACTINSTANCELIMIT_MAX = 0xfe; // == 255 instances total (254 additional instances) +static const XACTINDEX XACTINDEX_MIN = 0x0; +static const XACTINDEX XACTINDEX_MAX = 0xfffe; +static const XACTINDEX XACTINDEX_INVALID = 0xffff; +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MIN = 0x00; +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MAX = 0xff; +static const XACTVARIABLEVALUE XACTVARIABLEVALUE_MIN = -FLT_MAX; +static const XACTVARIABLEVALUE XACTVARIABLEVALUE_MAX = FLT_MAX; +static const XACTVARIABLEINDEX XACTVARIABLEINDEX_MIN = 0x0000; +static const XACTVARIABLEINDEX XACTVARIABLEINDEX_MAX = 0xfffe; +static const XACTVARIABLEINDEX XACTVARIABLEINDEX_INVALID = 0xffff; +static const XACTCATEGORY XACTCATEGORY_MIN = 0x0; +static const XACTCATEGORY XACTCATEGORY_MAX = 0xfffe; +static const XACTCATEGORY XACTCATEGORY_INVALID = 0xffff; +static const XACTCHANNEL XACTCHANNEL_MIN = 0; +static const XACTCHANNEL XACTCHANNEL_MAX = 0xFF; +static const XACTPITCH XACTPITCH_MIN = -1200; // pitch change allowable per individual content field +static const XACTPITCH XACTPITCH_MAX = 1200; +static const XACTPITCH XACTPITCH_MIN_TOTAL = -2400; // total allowable pitch change, use with IXACTWave.SetPitch() +static const XACTPITCH XACTPITCH_MAX_TOTAL = 2400; +static const XACTVOLUME XACTVOLUME_MIN = 0.0f; +static const XACTVOLUME XACTVOLUME_MAX = 16777216.0f; // Maximum acceptable volume level (2^24) - matches XAudio2 max volume +static const XACTVARIABLEVALUE XACTPARAMETERVALUE_MIN = -FLT_MAX; +static const XACTVARIABLEVALUE XACTPARAMETERVALUE_MAX = FLT_MAX; +static const XACTLOOPCOUNT XACTLOOPCOUNT_MIN = 0x0; +static const XACTLOOPCOUNT XACTLOOPCOUNT_MAX = 0xfe; +static const XACTLOOPCOUNT XACTLOOPCOUNT_INFINITE = 0xff; +static const DWORD XACTWAVEALIGNMENT_MIN = 2048; +#ifdef _XBOX +static const BYTE XACTMAXOUTPUTVOICECOUNT = 3; +#endif // _XBOX + + +// ----------------------------------------------------------------------------- +// Cue friendly name length +// ----------------------------------------------------------------------------- +#define XACT_CUE_NAME_LENGTH 0xFF + +// ----------------------------------------------------------------------------- +// Current Content Tool Version +// ----------------------------------------------------------------------------- +#define XACT_CONTENT_VERSION 46 + +// ----------------------------------------------------------------------------- +// XACT Stop Flags +// ----------------------------------------------------------------------------- +static const DWORD XACT_FLAG_STOP_RELEASE = 0x00000000; // Stop with release envelope (or as authored), for looping waves this acts as break loop. +static const DWORD XACT_FLAG_STOP_IMMEDIATE = 0x00000001; // Stop immediately + +// ----------------------------------------------------------------------------- +// XACT Manage Data Flag - XACT will manage the lifetime of this data +// ----------------------------------------------------------------------------- +static const DWORD XACT_FLAG_MANAGEDATA = 0x00000001; + +// ----------------------------------------------------------------------------- +// XACT Content Preparation Flags +// ----------------------------------------------------------------------------- +static const DWORD XACT_FLAG_BACKGROUND_MUSIC = 0x00000002; // Marks the waves as background music. +static const DWORD XACT_FLAG_UNITS_MS = 0x00000004; // Indicates that the units passed in are in milliseconds. +static const DWORD XACT_FLAG_UNITS_SAMPLES = 0x00000008; // Indicates that the units passed in are in samples. + +// ----------------------------------------------------------------------------- +// XACT State flags +// ----------------------------------------------------------------------------- +static const DWORD XACT_STATE_CREATED = 0x00000001; // Created, but nothing else +static const DWORD XACT_STATE_PREPARING = 0x00000002; // In the middle of preparing +static const DWORD XACT_STATE_PREPARED = 0x00000004; // Prepared, but not yet played +static const DWORD XACT_STATE_PLAYING = 0x00000008; // Playing (though could be paused) +static const DWORD XACT_STATE_STOPPING = 0x00000010; // Stopping +static const DWORD XACT_STATE_STOPPED = 0x00000020; // Stopped +static const DWORD XACT_STATE_PAUSED = 0x00000040; // Paused (Can be combined with some of the other state flags above) +static const DWORD XACT_STATE_INUSE = 0x00000080; // Object is in use (used by wavebanks and soundbanks). +static const DWORD XACT_STATE_PREPAREFAILED = 0x80000000; // Object preparation failed. + +//------------------------------------------------------------------------------ +// XACT Parameters +//------------------------------------------------------------------------------ + +#define XACT_FLAG_GLOBAL_SETTINGS_MANAGEDATA XACT_FLAG_MANAGEDATA + +// ----------------------------------------------------------------------------- +// File IO Callbacks +// ----------------------------------------------------------------------------- +typedef BOOL (__stdcall * XACT_READFILE_CALLBACK)(__in HANDLE hFile, __out_bcount(nNumberOfBytesToRead) LPVOID lpBuffer, DWORD nNumberOfBytesToRead, __out LPDWORD lpNumberOfBytesRead, __inout LPOVERLAPPED lpOverlapped); +typedef BOOL (__stdcall * XACT_GETOVERLAPPEDRESULT_CALLBACK)(__in HANDLE hFile, __inout LPOVERLAPPED lpOverlapped, __out LPDWORD lpNumberOfBytesTransferred, BOOL bWait); + +typedef struct XACT_FILEIO_CALLBACKS +{ + XACT_READFILE_CALLBACK readFileCallback; + XACT_GETOVERLAPPEDRESULT_CALLBACK getOverlappedResultCallback; + +} XACT_FILEIO_CALLBACKS, *PXACT_FILEIO_CALLBACKS; +typedef const XACT_FILEIO_CALLBACKS *PCXACT_FILEIO_CALLBACKS; + +// ----------------------------------------------------------------------------- +// Notification Callback +// ----------------------------------------------------------------------------- +typedef void (__stdcall * XACT_NOTIFICATION_CALLBACK)(__in const XACT_NOTIFICATION* pNotification); + +#define XACT_RENDERER_ID_LENGTH 0xff // Maximum number of characters allowed in the renderer ID +#define XACT_RENDERER_NAME_LENGTH 0xff // Maximum number of characters allowed in the renderer display name. + +// ----------------------------------------------------------------------------- +// Renderer Details +// ----------------------------------------------------------------------------- +typedef struct XACT_RENDERER_DETAILS +{ + WCHAR rendererID[XACT_RENDERER_ID_LENGTH]; // The string ID for the rendering device. + WCHAR displayName[XACT_RENDERER_NAME_LENGTH]; // A friendly name suitable for display to a human. + BOOL defaultDevice; // Set to TRUE if this device is the primary audio device on the system. + +} XACT_RENDERER_DETAILS, *LPXACT_RENDERER_DETAILS; + +// ----------------------------------------------------------------------------- +// Engine Look-Ahead Time +// ----------------------------------------------------------------------------- +#define XACT_ENGINE_LOOKAHEAD_DEFAULT 250 // Default look-ahead time of 250ms can be used during XACT engine initialization. + +// ----------------------------------------------------------------------------- +// Runtime (engine) parameters +// ----------------------------------------------------------------------------- +typedef struct XACT_RUNTIME_PARAMETERS +{ + DWORD lookAheadTime; // Time in ms + void* pGlobalSettingsBuffer; // Buffer containing the global settings file + DWORD globalSettingsBufferSize; // Size of global settings buffer + DWORD globalSettingsFlags; // Flags for global settings + DWORD globalSettingsAllocAttributes; // Global settings buffer allocation attributes (see XMemAlloc) + XACT_FILEIO_CALLBACKS fileIOCallbacks; // File I/O callbacks + XACT_NOTIFICATION_CALLBACK fnNotificationCallback; // Callback that receives notifications. + PWSTR pRendererID; // Ptr to the ID for the audio renderer the engine should connect to. + IXAudio2* pXAudio2; // XAudio2 object to be used by the engine (NULL if one needs to be created) + IXAudio2MasteringVoice* pMasteringVoice; // Mastering voice to be used by the engine, if pXAudio2 is not NULL. + +} XACT_RUNTIME_PARAMETERS, *LPXACT_RUNTIME_PARAMETERS; +typedef const XACT_RUNTIME_PARAMETERS *LPCXACT_RUNTIME_PARAMETERS; + +//------------------------------------------------------------------------------ +// Streaming Parameters +//------------------------------------------------------------------------------ + +typedef struct XACT_STREAMING_PARAMETERS +{ + HANDLE file; // File handle associated with wavebank data + DWORD offset; // Offset within file of wavebank header (must be sector aligned) + DWORD flags; // Flags (none currently) + WORD packetSize; // Stream packet size (in sectors) to use for each stream (min = 2) + // number of sectors (DVD = 2048 bytes: 2 = 4096, 3 = 6144, 4 = 8192 etc.) + // optimal DVD size is a multiple of 16 (DVD block = 16 DVD sectors) + +} XACT_WAVEBANK_STREAMING_PARAMETERS, *LPXACT_WAVEBANK_STREAMING_PARAMETERS, XACT_STREAMING_PARAMETERS, *LPXACT_STREAMING_PARAMETERS; +typedef const XACT_STREAMING_PARAMETERS *LPCXACT_STREAMING_PARAMETERS; +typedef const XACT_WAVEBANK_STREAMING_PARAMETERS *LPCXACT_WAVEBANK_STREAMING_PARAMETERS; + +// Structure used to report cue properties back to the client. +typedef struct XACT_CUE_PROPERTIES +{ + CHAR friendlyName[XACT_CUE_NAME_LENGTH]; // Empty if the soundbank doesn't contain any friendly names + BOOL interactive; // TRUE if an IA cue; FALSE otherwise + XACTINDEX iaVariableIndex; // Only valid for IA cues; XACTINDEX_INVALID otherwise + XACTINDEX numVariations; // Number of variations in the cue + XACTINSTANCELIMIT maxInstances; // Number of maximum instances for this cue + XACTINSTANCELIMIT currentInstances; // Current active instances of this cue + +} XACT_CUE_PROPERTIES, *LPXACT_CUE_PROPERTIES; + +// Strucutre used to return the track properties. +typedef struct XACT_TRACK_PROPERTIES +{ + XACTTIME duration; // Duration of the track in ms + XACTINDEX numVariations; // Number of wave variations in the track + XACTCHANNEL numChannels; // Number of channels for the active wave variation on this track + XACTINDEX waveVariation; // Index of the active wave variation + XACTLOOPCOUNT loopCount; // Current loop count on this track + +} XACT_TRACK_PROPERTIES, *LPXACT_TRACK_PROPERTIES; + +// Structure used to return the properties of a variation. +typedef struct XACT_VARIATION_PROPERTIES +{ + XACTINDEX index; // Index of the variation in the cue's variation list + XACTVARIATIONWEIGHT weight; // Weight for the active variation. Valid only for complex cues + XACTVARIABLEVALUE iaVariableMin; // Valid only for IA cues + XACTVARIABLEVALUE iaVariableMax; // Valid only for IA cues + BOOL linger; // Valid only for IA cues + +} XACT_VARIATION_PROPERTIES, *LPXACT_VARIATION_PROPERTIES; + +// Structure used to return the properties of the sound referenced by a variation. +typedef struct XACT_SOUND_PROPERTIES +{ + XACTCATEGORY category; // Category this sound belongs to + BYTE priority; // Priority of this variation + XACTPITCH pitch; // Current pitch set on the active variation + XACTVOLUME volume; // Current volume set on the active variation + XACTINDEX numTracks; // Number of tracks in the active variation + XACT_TRACK_PROPERTIES arrTrackProperties[1]; // Array of active track properties (has numTracks number of elements) + +} XACT_SOUND_PROPERTIES, *LPXACT_SOUND_PROPERTIES; + +// Structure used to return the properties of the active variation and the sound referenced. +typedef struct XACT_SOUND_VARIATION_PROPERTIES +{ + XACT_VARIATION_PROPERTIES variationProperties;// Properties for this variation + XACT_SOUND_PROPERTIES soundProperties; // Proeprties for the sound referenced by this variation + +} XACT_SOUND_VARIATION_PROPERTIES, *LPXACT_SOUND_VARIATION_PROPERTIES; + +// Structure used to return the properties of an active cue instance. +typedef struct XACT_CUE_INSTANCE_PROPERTIES +{ + DWORD allocAttributes; // Buffer allocation attributes (see XMemAlloc) + XACT_CUE_PROPERTIES cueProperties; // Properties of the cue that are shared by all instances. + XACT_SOUND_VARIATION_PROPERTIES activeVariationProperties; // Properties if the currently active variation. + +} XACT_CUE_INSTANCE_PROPERTIES, *LPXACT_CUE_INSTANCE_PROPERTIES; + +// Structure used to return the common wave properties. +typedef struct XACT_WAVE_PROPERTIES +{ + char friendlyName[WAVEBANK_ENTRYNAME_LENGTH]; // Friendly name for the wave; empty if the wavebank doesn't contain friendly names. + WAVEBANKMINIWAVEFORMAT format; // Format for the wave. + DWORD durationInSamples; // Duration of the wave in units of one sample + WAVEBANKSAMPLEREGION loopRegion; // Loop region defined in samples. + BOOL streaming; // Set to TRUE if the wave is streaming; FALSE otherwise. + +} XACT_WAVE_PROPERTIES, *LPXACT_WAVE_PROPERTIES; +typedef const XACT_WAVE_PROPERTIES* LPCXACT_WAVE_PROPERTIES; + +// Structure used to return the properties specific to a wave instance. +typedef struct XACT_WAVE_INSTANCE_PROPERTIES +{ + XACT_WAVE_PROPERTIES properties; // Static properties common to all the wave instances. + BOOL backgroundMusic; // Set to TRUE if the wave is tagged as background music; FALSE otherwise. + +} XACT_WAVE_INSTANCE_PROPERTIES, *LPXACT_WAVE_INSTANCE_PROPERTIES; +typedef const XACT_WAVE_INSTANCE_PROPERTIES* LPCXACT_WAVE_INSTANCE_PROPERTIES; + +//------------------------------------------------------------------------------ +// Channel Mapping / Speaker Panning +//------------------------------------------------------------------------------ + +typedef struct XACTCHANNELMAPENTRY +{ + XACTCHANNEL InputChannel; + XACTCHANNEL OutputChannel; + XACTVOLUME Volume; + +} XACTCHANNELMAPENTRY, *LPXACTCHANNELMAPENTRY; +typedef const XACTCHANNELMAPENTRY *LPCXACTCHANNELMAPENTRY; + +typedef struct XACTCHANNELMAP +{ + XACTCHANNEL EntryCount; + XACTCHANNELMAPENTRY* paEntries; + +} XACTCHANNELMAP, *LPXACTCHANNELMAP; +typedef const XACTCHANNELMAP *LPCXACTCHANNELMAP; + +typedef struct XACTCHANNELVOLUMEENTRY +{ + XACTCHANNEL EntryIndex; + XACTVOLUME Volume; + +} XACTCHANNELVOLUMEENTRY, *LPXACTCHANNELVOLUMEENTRY; +typedef const XACTCHANNELVOLUMEENTRY *LPCXACTCHANNELVOLUMEENTRY; + +typedef struct XACTCHANNELVOLUME +{ + XACTCHANNEL EntryCount; + XACTCHANNELVOLUMEENTRY* paEntries; + +} XACTCHANNELVOLUME, *LPXACTCHANNELVOLUME; +typedef const XACTCHANNELVOLUME *LPCXACTCHANNELVOLUME; + +//------------------------------------------------------------------------------ +// Notifications +//------------------------------------------------------------------------------ + +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEPREPARED = 1; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEPLAY = 2; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUESTOP = 3; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEDESTROYED = 4; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MARKER = 5; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED = 6; // None, SoundBank +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED = 7; // None, WaveBank +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_LOCALVARIABLECHANGED = 8; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GLOBALVARIABLECHANGED = 9; // None +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GUICONNECTED = 10; // None +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GUIDISCONNECTED = 11; // None +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEPREPARED = 12; // None, WaveBank & wave index, wave instance. +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEPLAY = 13; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVESTOP = 14; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVELOOPED = 15; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEDESTROYED = 16; // None, WaveBank & wave index, wave instance. +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKPREPARED = 17; // None, WaveBank +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKSTREAMING_INVALIDCONTENT = 18; // None, WaveBank + +static const BYTE XACT_FLAG_NOTIFICATION_PERSIST = 0x01; + +// Pack the notification structures +#pragma pack(push, 1) + +// Notification description used for registering, un-registering and flushing notifications +typedef struct XACT_NOTIFICATION_DESCRIPTION +{ + XACTNOTIFICATIONTYPE type; // Notification type + BYTE flags; // Flags + IXACT3SoundBank* pSoundBank; // SoundBank instance + IXACT3WaveBank* pWaveBank; // WaveBank instance + IXACT3Cue* pCue; // Cue instance + IXACT3Wave* pWave; // Wave instance + XACTINDEX cueIndex; // Cue index + XACTINDEX waveIndex; // Wave index + PVOID pvContext; // User context (optional) + +} XACT_NOTIFICATION_DESCRIPTION, *LPXACT_NOTIFICATION_DESCRIPTION; +typedef const XACT_NOTIFICATION_DESCRIPTION *LPCXACT_NOTIFICATION_DESCRIPTION; + +// Notification structure for all XACTNOTIFICATIONTYPE_CUE* notifications +typedef struct XACT_NOTIFICATION_CUE +{ + XACTINDEX cueIndex; // Cue index + IXACT3SoundBank* pSoundBank; // SoundBank instance + IXACT3Cue* pCue; // Cue instance + +} XACT_NOTIFICATION_CUE, *LPXACT_NOTIFICATION_CUE; +typedef const XACT_NOTIFICATION_CUE *LPCXACT_NOTIFICATION_CUE; + +// Notification structure for all XACTNOTIFICATIONTYPE_MARKER* notifications +typedef struct XACT_NOTIFICATION_MARKER +{ + XACTINDEX cueIndex; // Cue index + IXACT3SoundBank* pSoundBank; // SoundBank instance + IXACT3Cue* pCue; // Cue instance + DWORD marker; // Marker value + +} XACT_NOTIFICATION_MARKER, *LPXACT_NOTIFICATION_MARKER; +typedef const XACT_NOTIFICATION_MARKER *LPCXACT_NOTIFICATION_MARKER; + +// Notification structure for all XACTNOTIFICATIONTYPE_SOUNDBANK* notifications +typedef struct XACT_NOTIFICATION_SOUNDBANK +{ + IXACT3SoundBank* pSoundBank; // SoundBank instance + +} XACT_NOTIFICATION_SOUNDBANK, *LPXACT_NOTIFICATION_SOUNDBANK; +typedef const XACT_NOTIFICATION_SOUNDBANK *LPCXACT_NOTIFICATION_SOUNDBANK; + +// Notification structure for all XACTNOTIFICATIONTYPE_WAVEBANK* notifications +typedef struct XACT_NOTIFICATION_WAVEBANK +{ + IXACT3WaveBank* pWaveBank; // WaveBank instance + +} XACT_NOTIFICATION_WAVEBANK, *LPXACT_NOTIFICATION_WAVEBANK; +typedef const XACT_NOTIFICATION_WAVEBANK *LPCXACT_NOTIFICATION_WAVEBANK; + +// Notification structure for all XACTNOTIFICATIONTYPE_*VARIABLE* notifications +typedef struct XACT_NOTIFICATION_VARIABLE +{ + XACTINDEX cueIndex; // Cue index + IXACT3SoundBank* pSoundBank; // SoundBank instance + IXACT3Cue* pCue; // Cue instance + XACTVARIABLEINDEX variableIndex; // Variable index + XACTVARIABLEVALUE variableValue; // Variable value + BOOL local; // TRUE if a local variable + +} XACT_NOTIFICATION_VARIABLE, *LPXACT_NOTIFICATION_VARIABLE; +typedef const XACT_NOTIFICATION_VARIABLE *LPCXACT_NOTIFICATION_VARIABLE; + +// Notification structure for all XACTNOTIFICATIONTYPE_GUI* notifications +typedef struct XACT_NOTIFICATION_GUI +{ + DWORD reserved; // Reserved +} XACT_NOTIFICATION_GUI, *LPXACT_NOTIFICATION_GUI; +typedef const XACT_NOTIFICATION_GUI *LPCXACT_NOTIFICATION_GUI; + +// Notification structure for all XACTNOTIFICATIONTYPE_WAVE* notifications +typedef struct XACT_NOTIFICATION_WAVE +{ + IXACT3WaveBank* pWaveBank; // WaveBank + XACTINDEX waveIndex; // Wave index + XACTINDEX cueIndex; // Cue index + IXACT3SoundBank* pSoundBank; // SoundBank instance + IXACT3Cue* pCue; // Cue instance + IXACT3Wave* pWave; // Wave instance + +} XACT_NOTIFICATION_WAVE, *LPXACT_NOTIFICATION_WAVE; +typedef const XACT_NOTIFICATION_WAVE *LPCXACT_NOTIFICATION_WAVE; + +// General notification structure +typedef struct XACT_NOTIFICATION +{ + XACTNOTIFICATIONTYPE type; // Notification type + LONG timeStamp; // Timestamp of notification (milliseconds) + PVOID pvContext; // User context (optional) + union + { + XACT_NOTIFICATION_CUE cue; // XACTNOTIFICATIONTYPE_CUE* + XACT_NOTIFICATION_MARKER marker; // XACTNOTIFICATIONTYPE_MARKER* + XACT_NOTIFICATION_SOUNDBANK soundBank; // XACTNOTIFICATIONTYPE_SOUNDBANK* + XACT_NOTIFICATION_WAVEBANK waveBank; // XACTNOTIFICATIONTYPE_WAVEBANK* + XACT_NOTIFICATION_VARIABLE variable; // XACTNOTIFICATIONTYPE_VARIABLE* + XACT_NOTIFICATION_GUI gui; // XACTNOTIFICATIONTYPE_GUI* + XACT_NOTIFICATION_WAVE wave; // XACTNOTIFICATIONTYPE_WAVE* + }; + +} XACT_NOTIFICATION, *LPXACT_NOTIFICATION; +typedef const XACT_NOTIFICATION *LPCXACT_NOTIFICATION; + +#pragma pack(pop) + +//------------------------------------------------------------------------------ +// IXACT3SoundBank +//------------------------------------------------------------------------------ + +#define XACT_FLAG_SOUNDBANK_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE +#define XACT_SOUNDBANKSTATE_INUSE XACT_STATE_INUSE + +STDAPI_(XACTINDEX) IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName); +STDAPI IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues); +STDAPI IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties); +STDAPI IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue); +STDAPI IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue); +STDAPI IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags); +STDAPI IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank); +STDAPI IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState); + +#undef INTERFACE +#define INTERFACE IXACT3SoundBank + +DECLARE_INTERFACE(IXACT3SoundBank) +{ + STDMETHOD_(XACTINDEX, GetCueIndex)(THIS_ __in PCSTR szFriendlyName) PURE; + STDMETHOD(GetNumCues)(THIS_ __out XACTINDEX* pnNumCues) PURE; + STDMETHOD(GetCueProperties)(THIS_ XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties) PURE; + STDMETHOD(Prepare)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue) PURE; + STDMETHOD(Play)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue) PURE; + STDMETHOD(Stop)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags) PURE; + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank) +{ + return pSoundBank->Destroy(); +} + +__inline XACTINDEX __stdcall IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName) +{ + return pSoundBank->GetCueIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues) +{ + return pSoundBank->GetNumCues(pnNumCues); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties) +{ + return pSoundBank->GetCueProperties(nCueIndex, pProperties); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue) +{ + return pSoundBank->Prepare(nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue) +{ + return pSoundBank->Play(nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags) +{ + return pSoundBank->Stop(nCueIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState) +{ + return pSoundBank->GetState(pdwState); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank) +{ + return pSoundBank->lpVtbl->Destroy(pSoundBank); +} + +__inline XACTINDEX __stdcall IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName) +{ + return pSoundBank->lpVtbl->GetCueIndex(pSoundBank, szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues) +{ + return pSoundBank->lpVtbl->GetNumCues(pSoundBank, pnNumCues); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties) +{ + return pSoundBank->lpVtbl->GetCueProperties(pSoundBank, nCueIndex, pProperties); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue) +{ + return pSoundBank->lpVtbl->Prepare(pSoundBank, nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue) +{ + return pSoundBank->lpVtbl->Play(pSoundBank, nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags) +{ + return pSoundBank->lpVtbl->Stop(pSoundBank, nCueIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState) +{ + return pSoundBank->lpVtbl->GetState(pSoundBank, pdwState); +} + +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// IXACT3WaveBank +//------------------------------------------------------------------------------ +#define XACT_WAVEBANKSTATE_INUSE XACT_STATE_INUSE // Currently in-use +#define XACT_WAVEBANKSTATE_PREPARED XACT_STATE_PREPARED // Prepared +#define XACT_WAVEBANKSTATE_PREPAREFAILED XACT_STATE_PREPAREFAILED // Prepare failed. + + +STDAPI IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank); +STDAPI IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState); +STDAPI IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves); +STDAPI_(XACTINDEX) IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName); +STDAPI IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties); +STDAPI IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave); +STDAPI IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave); +STDAPI IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags); + +#undef INTERFACE +#define INTERFACE IXACT3WaveBank + +DECLARE_INTERFACE(IXACT3WaveBank) +{ + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(GetNumWaves)(THIS_ __out XACTINDEX* pnNumWaves) PURE; + STDMETHOD_(XACTINDEX, GetWaveIndex)(THIS_ __in PCSTR szFriendlyName) PURE; + STDMETHOD(GetWaveProperties)(THIS_ XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties) PURE; + STDMETHOD(Prepare)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE; + STDMETHOD(Play)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE; + STDMETHOD(Stop)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags) PURE; + STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank) +{ + return pWaveBank->Destroy(); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves) +{ + return pWaveBank->GetNumWaves(pnNumWaves); +} + +__inline XACTINDEX __stdcall IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName) +{ + return pWaveBank->GetWaveIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties) +{ + return pWaveBank->GetWaveProperties(nWaveIndex, pWaveProperties); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pWaveBank->Prepare(nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pWaveBank->Play(nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags) +{ + return pWaveBank->Stop(nWaveIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState) +{ + return pWaveBank->GetState(pdwState); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank) +{ + return pWaveBank->lpVtbl->Destroy(pWaveBank); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves) +{ + return pWaveBank->lpVtbl->GetNumWaves(pWaveBank, pnNumWaves); +} + +__inline XACTINDEX __stdcall IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName) +{ + return pWaveBank->lpVtbl->GetWaveIndex(pWaveBank, szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties) +{ + return pWaveBank->lpVtbl->GetWaveProperties(pWaveBank, nWaveIndex, pWaveProperties); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pWaveBank->lpVtbl->Prepare(pWaveBank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pWaveBank->lpVtbl->Play(pWaveBank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags) +{ + return pWaveBank->lpVtbl->Stop(pWaveBank, nWaveIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState) +{ + return pWaveBank->lpVtbl->GetState(pWaveBank, pdwState); +} +#endif // __cplusplus + + +//------------------------------------------------------------------------------ +// IXACT3Wave +//------------------------------------------------------------------------------ + +STDAPI IXACT3Wave_Destroy(__in IXACT3Wave* pWave); +STDAPI IXACT3Wave_Play(__in IXACT3Wave* pWave); +STDAPI IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags); +STDAPI IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause); +STDAPI IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState); +STDAPI IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch); +STDAPI IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume); +STDAPI IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients); +STDAPI IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties); + +#undef INTERFACE +#define INTERFACE IXACT3Wave + +DECLARE_INTERFACE(IXACT3Wave) +{ + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(Play)(THIS) PURE; + STDMETHOD(Stop)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(Pause)(THIS_ BOOL fPause) PURE; + STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE; + STDMETHOD(SetPitch)(THIS_ XACTPITCH pitch) PURE; + STDMETHOD(SetVolume)(THIS_ XACTVOLUME volume) PURE; + STDMETHOD(SetMatrixCoefficients)(THIS_ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) PURE; + STDMETHOD(GetProperties)(THIS_ __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACT3Wave_Destroy(__in IXACT3Wave* pWave) +{ + return pWave->Destroy(); +} + +__inline HRESULT __stdcall IXACT3Wave_Play(__in IXACT3Wave* pWave) +{ + return pWave->Play(); +} + +__inline HRESULT __stdcall IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags) +{ + return pWave->Stop(dwFlags); +} + +__inline HRESULT __stdcall IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause) +{ + return pWave->Pause(fPause); +} + +__inline HRESULT __stdcall IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState) +{ + return pWave->GetState(pdwState); +} + +__inline HRESULT __stdcall IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch) +{ + return pWave->SetPitch(pitch); +} + +__inline HRESULT __stdcall IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume) +{ + return pWave->SetVolume(volume); +} + +__inline HRESULT __stdcall IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) +{ + return pWave->SetMatrixCoefficients(uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline HRESULT __stdcall IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) +{ + return pWave->GetProperties(pProperties); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACT3Wave_Destroy(__in IXACT3Wave* pWave) +{ + return pWave->lpVtbl->Destroy(pWave); +} + +__inline HRESULT __stdcall IXACT3Wave_Play(__in IXACT3Wave* pWave) +{ + return pWave->lpVtbl->Play(pWave); +} + +__inline HRESULT __stdcall IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags) +{ + return pWave->lpVtbl->Stop(pWave, dwFlags); +} + +__inline HRESULT __stdcall IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause) +{ + return pWave->lpVtbl->Pause(pWave, fPause); +} + +__inline HRESULT __stdcall IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState) +{ + return pWave->lpVtbl->GetState(pWave, pdwState); +} + +__inline HRESULT __stdcall IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch) +{ + return pWave->lpVtbl->SetPitch(pWave, pitch); +} + +__inline HRESULT __stdcall IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume) +{ + return pWave->lpVtbl->SetVolume(pWave, volume); +} + +__inline HRESULT __stdcall IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) +{ + return pWave->lpVtbl->SetMatrixCoefficients(pWave, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline HRESULT __stdcall IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) +{ + return pWave->lpVtbl->GetProperties(pWave, pProperties); +} +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// IXACT3Cue +//------------------------------------------------------------------------------ + +// Cue Flags +#define XACT_FLAG_CUE_STOP_RELEASE XACT_FLAG_STOP_RELEASE +#define XACT_FLAG_CUE_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE + +// Mutually exclusive states +#define XACT_CUESTATE_CREATED XACT_STATE_CREATED // Created, but nothing else +#define XACT_CUESTATE_PREPARING XACT_STATE_PREPARING // In the middle of preparing +#define XACT_CUESTATE_PREPARED XACT_STATE_PREPARED // Prepared, but not yet played +#define XACT_CUESTATE_PLAYING XACT_STATE_PLAYING // Playing (though could be paused) +#define XACT_CUESTATE_STOPPING XACT_STATE_STOPPING // Stopping +#define XACT_CUESTATE_STOPPED XACT_STATE_STOPPED // Stopped +#define XACT_CUESTATE_PAUSED XACT_STATE_PAUSED // Paused (can be combined with other states) + +STDAPI IXACT3Cue_Destroy(__in IXACT3Cue* pCue); +STDAPI IXACT3Cue_Play(__in IXACT3Cue* pCue); +STDAPI IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags); +STDAPI IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState); +STDAPI IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue*, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients); +STDAPI_(XACTVARIABLEINDEX) IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName); +STDAPI IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue); +STDAPI IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue); +STDAPI IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause); +STDAPI IXACT3Cue_GetProperties(__in IXACT3Cue* pCue, __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties); +STDAPI IXACT3Cue_SetOutputVoices(__in IXACT3Cue* pCue, __in_opt const XAUDIO2_VOICE_SENDS* pSendList); +STDAPI IXACT3Cue_SetOutputVoiceMatrix(__in IXACT3Cue* pCue, __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix); + +#undef INTERFACE +#define INTERFACE IXACT3Cue + +DECLARE_INTERFACE(IXACT3Cue) +{ + STDMETHOD(Play)(THIS) PURE; + STDMETHOD(Stop)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE; + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(SetMatrixCoefficients)(THIS_ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) PURE; + STDMETHOD_(XACTVARIABLEINDEX, GetVariableIndex)(THIS_ __in PCSTR szFriendlyName) PURE; + STDMETHOD(SetVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) PURE; + STDMETHOD(GetVariable)(THIS_ XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) PURE; + STDMETHOD(Pause)(THIS_ BOOL fPause) PURE; + STDMETHOD(GetProperties)(THIS_ __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) PURE; + STDMETHOD(SetOutputVoices)(THIS_ __in_opt const XAUDIO2_VOICE_SENDS* pSendList) PURE; + STDMETHOD(SetOutputVoiceMatrix)(THIS_ __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACT3Cue_Play(__in IXACT3Cue* pCue) +{ + return pCue->Play(); +} + +__inline HRESULT __stdcall IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags) +{ + return pCue->Stop(dwFlags); +} + +__inline HRESULT __stdcall IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState) +{ + return pCue->GetState(pdwState); +} + +__inline HRESULT __stdcall IXACT3Cue_Destroy(__in IXACT3Cue* pCue) +{ + return pCue->Destroy(); +} + +__inline HRESULT __stdcall IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue* pCue, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) +{ + return pCue->SetMatrixCoefficients(uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline XACTVARIABLEINDEX __stdcall IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName) +{ + return pCue->GetVariableIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pCue->SetVariable(nIndex, nValue); +} + +__inline HRESULT __stdcall IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* pnValue) +{ + return pCue->GetVariable(nIndex, pnValue); +} + +__inline HRESULT __stdcall IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause) +{ + return pCue->Pause(fPause); +} + +__inline HRESULT __stdcall IXACT3Cue_GetProperties(__in IXACT3Cue* pCue, __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) +{ + return pCue->GetProperties(ppProperties); +} + +__inline HRESULT __stdcall IXACT3Cue_SetOutputVoices(__in IXACT3Cue* pCue, __in_opt const XAUDIO2_VOICE_SENDS* pSendList) +{ + return pCue->SetOutputVoices(pSendList); +} + +__inline HRESULT __stdcall IXACT3Cue_SetOutputVoiceMatrix(__in IXACT3Cue* pCue, __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix) +{ + return pCue->SetOutputVoiceMatrix(pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACT3Cue_Play(__in IXACT3Cue* pCue) +{ + return pCue->lpVtbl->Play(pCue); +} + +__inline HRESULT __stdcall IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags) +{ + return pCue->lpVtbl->Stop(pCue, dwFlags); +} + +__inline HRESULT __stdcall IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState) +{ + return pCue->lpVtbl->GetState(pCue, pdwState); +} + +__inline HRESULT __stdcall IXACT3Cue_Destroy(__in IXACT3Cue* pCue) +{ + return pCue->lpVtbl->Destroy(pCue); +} + +__inline HRESULT __stdcall IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue* pCue, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) +{ + return pCue->lpVtbl->SetMatrixCoefficients(pCue, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline XACTVARIABLEINDEX __stdcall IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName) +{ + return pCue->lpVtbl->GetVariableIndex(pCue, szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pCue->lpVtbl->SetVariable(pCue, nIndex, nValue); +} + +__inline HRESULT __stdcall IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* pnValue) +{ + return pCue->lpVtbl->GetVariable(pCue, nIndex, pnValue); +} + +__inline HRESULT __stdcall IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause) +{ + return pCue->lpVtbl->Pause(pCue, fPause); +} + +__inline HRESULT __stdcall IXACT3Cue_GetProperties(__in IXACT3Cue* pCue, __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) +{ + return pCue->lpVtbl->GetProperties(pCue, ppProperties); +} + +__inline HRESULT __stdcall IXACT3Cue_SetOutputVoices(__in IXACT3Cue* pCue, __in_opt const XAUDIO2_VOICE_SENDS* pSendList) +{ + return pCue->lpVtbl->SetOutputVoices(pSendList); +} + +__inline HRESULT __stdcall IXACT3Cue_SetOutputVoiceMatrix(__in IXACT3Cue* pCue, __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix) +{ + return pCue->lpVtbl->SetOutputVoiceMatrix(pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix); +} + +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// IXACT3Engine +//------------------------------------------------------------------------------ + +// Engine flags +#define XACT_FLAG_ENGINE_CREATE_MANAGEDATA XACT_FLAG_MANAGEDATA +#define XACT_FLAG_ENGINE_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE + +STDAPI_(ULONG) IXACT3Engine_AddRef(__in IXACT3Engine* pEngine); +STDAPI_(ULONG) IXACT3Engine_Release(__in IXACT3Engine* pEngine); +STDAPI IXACT3Engine_GetRendererCount(__in IXACT3Engine* pEngine, __out XACTINDEX* pnRendererCount); +STDAPI IXACT3Engine_GetRendererDetails(__in IXACT3Engine* pEngine, XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails); +STDAPI IXACT3Engine_GetFinalMixFormat(__in IXACT3Engine* pEngine, __out WAVEFORMATEXTENSIBLE* pFinalMixFormat); +STDAPI IXACT3Engine_Initialize(__in IXACT3Engine* pEngine, __in const XACT_RUNTIME_PARAMETERS* pParams); +STDAPI IXACT3Engine_ShutDown(__in IXACT3Engine* pEngine); +STDAPI IXACT3Engine_DoWork(__in IXACT3Engine* pEngine); +STDAPI IXACT3Engine_CreateSoundBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank); +STDAPI IXACT3Engine_CreateInMemoryWaveBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank); +STDAPI IXACT3Engine_CreateStreamingWaveBank(__in IXACT3Engine* pEngine, __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank); +STDAPI IXACT3Engine_PrepareWave(__in IXACT3Engine* pEngine, DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave); +STDAPI IXACT3Engine_PrepareInMemoryWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave); +STDAPI IXACT3Engine_PrepareStreamingWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave); +STDAPI IXACT3Engine_RegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc); +STDAPI IXACT3Engine_UnRegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc); +STDAPI_(XACTCATEGORY) IXACT3Engine_GetCategory(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName); +STDAPI IXACT3Engine_Stop(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags); +STDAPI IXACT3Engine_SetVolume(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume); +STDAPI IXACT3Engine_Pause(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, BOOL fPause); +STDAPI_(XACTVARIABLEINDEX) IXACT3Engine_GetGlobalVariableIndex(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName); +STDAPI IXACT3Engine_SetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue); +STDAPI IXACT3Engine_GetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* pnValue); + +#undef INTERFACE +#define INTERFACE IXACT3Engine + +#ifdef _XBOX +DECLARE_INTERFACE(IXACT3Engine) +{ +#else +DECLARE_INTERFACE_(IXACT3Engine, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ __in REFIID riid, __deref_out void** ppvObj) PURE; +#endif + + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetRendererCount)(THIS_ __out XACTINDEX* pnRendererCount) PURE; + STDMETHOD(GetRendererDetails)(THIS_ XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails) PURE; + + STDMETHOD(GetFinalMixFormat)(THIS_ __out WAVEFORMATEXTENSIBLE* pFinalMixFormat) PURE; + STDMETHOD(Initialize)(THIS_ __in const XACT_RUNTIME_PARAMETERS* pParams) PURE; + STDMETHOD(ShutDown)(THIS) PURE; + + STDMETHOD(DoWork)(THIS) PURE; + + STDMETHOD(CreateSoundBank)(THIS_ __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank) PURE; + STDMETHOD(CreateInMemoryWaveBank)(THIS_ __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank) PURE; + STDMETHOD(CreateStreamingWaveBank)(THIS_ __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank) PURE; + + STDMETHOD(PrepareWave)(THIS_ DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE; + STDMETHOD(PrepareInMemoryWave)(THIS_ DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE; + STDMETHOD(PrepareStreamingWave)(THIS_ DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE; + + STDMETHOD(RegisterNotification)(THIS_ __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) PURE; + STDMETHOD(UnRegisterNotification)(THIS_ __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) PURE; + + STDMETHOD_(XACTCATEGORY, GetCategory)(THIS_ __in PCSTR szFriendlyName) PURE; + STDMETHOD(Stop)(THIS_ XACTCATEGORY nCategory, DWORD dwFlags) PURE; + STDMETHOD(SetVolume)(THIS_ XACTCATEGORY nCategory, XACTVOLUME nVolume) PURE; + STDMETHOD(Pause)(THIS_ XACTCATEGORY nCategory, BOOL fPause) PURE; + + STDMETHOD_(XACTVARIABLEINDEX, GetGlobalVariableIndex)(THIS_ __in PCSTR szFriendlyName) PURE; + STDMETHOD(SetGlobalVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) PURE; + STDMETHOD(GetGlobalVariable)(THIS_ XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) PURE; +}; + +#ifdef __cplusplus + +__inline ULONG __stdcall IXACT3Engine_AddRef(__in IXACT3Engine* pEngine) +{ + return pEngine->AddRef(); +} + +__inline ULONG __stdcall IXACT3Engine_Release(__in IXACT3Engine* pEngine) +{ + return pEngine->Release(); +} + +__inline HRESULT __stdcall IXACT3Engine_GetRendererCount(__in IXACT3Engine* pEngine, __out XACTINDEX* pnRendererCount) +{ + return pEngine->GetRendererCount(pnRendererCount); +} + +__inline HRESULT __stdcall IXACT3Engine_GetRendererDetails(__in IXACT3Engine* pEngine, XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails) +{ + return pEngine->GetRendererDetails(nRendererIndex, pRendererDetails); +} + +__inline HRESULT __stdcall IXACT3Engine_GetFinalMixFormat(__in IXACT3Engine* pEngine, __out WAVEFORMATEXTENSIBLE* pFinalMixFormat) +{ + return pEngine->GetFinalMixFormat(pFinalMixFormat); +} + +__inline HRESULT __stdcall IXACT3Engine_Initialize(__in IXACT3Engine* pEngine, __in const XACT_RUNTIME_PARAMETERS* pParams) +{ + return pEngine->Initialize(pParams); +} + +__inline HRESULT __stdcall IXACT3Engine_ShutDown(__in IXACT3Engine* pEngine) +{ + return pEngine->ShutDown(); +} + +__inline HRESULT __stdcall IXACT3Engine_DoWork(__in IXACT3Engine* pEngine) +{ + return pEngine->DoWork(); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateSoundBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank) +{ + return pEngine->CreateSoundBank(pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppSoundBank); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateInMemoryWaveBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank) +{ + return pEngine->CreateInMemoryWaveBank(pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppWaveBank); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateStreamingWaveBank(__in IXACT3Engine* pEngine, __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank) +{ + return pEngine->CreateStreamingWaveBank(pParms, ppWaveBank); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareWave(__in IXACT3Engine* pEngine, DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->PrepareWave(dwFlags, szWavePath, wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareInMemoryWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->PrepareInMemoryWave(dwFlags, entry, pdwSeekTable, pbWaveData, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareStreamingWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->PrepareStreamingWave(dwFlags, entry, streamingParams, dwAlignment, pdwSeekTable, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3Engine_RegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->RegisterNotification(pNotificationDesc); +} + +__inline HRESULT __stdcall IXACT3Engine_UnRegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->UnRegisterNotification(pNotificationDesc); +} + +__inline XACTCATEGORY __stdcall IXACT3Engine_GetCategory(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName) +{ + return pEngine->GetCategory(szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Engine_Stop(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags) +{ + return pEngine->Stop(nCategory, dwFlags); +} + +__inline HRESULT __stdcall IXACT3Engine_SetVolume(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume) +{ + return pEngine->SetVolume(nCategory, nVolume); +} + +__inline HRESULT __stdcall IXACT3Engine_Pause(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, BOOL fPause) +{ + return pEngine->Pause(nCategory, fPause); +} + +__inline XACTVARIABLEINDEX __stdcall IXACT3Engine_GetGlobalVariableIndex(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName) +{ + return pEngine->GetGlobalVariableIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Engine_SetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pEngine->SetGlobalVariable(nIndex, nValue); +} + +__inline HRESULT __stdcall IXACT3Engine_GetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) +{ + return pEngine->GetGlobalVariable(nIndex, nValue); +} + +#else // __cplusplus + +__inline ULONG __stdcall IXACT3Engine_AddRef(__in IXACT3Engine* pEngine) +{ + return pEngine->lpVtbl->AddRef(pEngine); +} + +__inline ULONG __stdcall IXACT3Engine_Release(__in IXACT3Engine* pEngine) +{ + return pEngine->lpVtbl->Release(pEngine); +} + +__inline HRESULT __stdcall IXACT3Engine_GetRendererCount(__in IXACT3Engine* pEngine, __out XACTINDEX* pnRendererCount) +{ + return pEngine->lpVtbl->GetRendererCount(pEngine, pnRendererCount); +} + +__inline HRESULT __stdcall IXACT3Engine_GetRendererDetails(__in IXACT3Engine* pEngine, XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails) +{ + return pEngine->lpVtbl->GetRendererDetails(pEngine, nRendererIndex, pRendererDetails); +} + +__inline HRESULT __stdcall IXACT3Engine_GetFinalMixFormat(__in IXACT3Engine* pEngine, __out WAVEFORMATEXTENSIBLE* pFinalMixFormat) +{ + return pEngine->lpVtbl->GetFinalMixFormat(pEngine, pFinalMixFormat); +} + +__inline HRESULT __stdcall IXACT3Engine_Initialize(__in IXACT3Engine* pEngine, __in const XACT_RUNTIME_PARAMETERS* pParams) +{ + return pEngine->lpVtbl->Initialize(pEngine, pParams); +} + +__inline HRESULT __stdcall IXACT3Engine_ShutDown(__in IXACT3Engine* pEngine) +{ + return pEngine->lpVtbl->ShutDown(pEngine); +} + +__inline HRESULT __stdcall IXACT3Engine_DoWork(__in IXACT3Engine* pEngine) +{ + return pEngine->lpVtbl->DoWork(pEngine); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateSoundBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank) +{ + return pEngine->lpVtbl->CreateSoundBank(pEngine, pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppSoundBank); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateInMemoryWaveBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank) +{ + return pEngine->lpVtbl->CreateInMemoryWaveBank(pEngine, pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppWaveBank); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateStreamingWaveBank(__in IXACT3Engine* pEngine, __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank) +{ + return pEngine->lpVtbl->CreateStreamingWaveBank(pEngine, pParms, ppWaveBank); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareWave(__in IXACT3Engine* pEngine, DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->lpVtbl->PrepareWave(pEngine, dwFlags, szWavePath, wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareInMemoryWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->lpVtbl->PrepareInMemoryWave(pEngine, dwFlags, entry, pdwSeekTable, pbWaveData, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareStreamingWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->lpVtbl->PrepareStreamingWave(pEngine, dwFlags, entry, streamingParams, dwAlignment, pdwSeekTable, dwPlayOffset, nLoopCount, ppWave); +} + + +__inline HRESULT __stdcall IXACT3Engine_RegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->lpVtbl->RegisterNotification(pEngine, pNotificationDesc); +} + +__inline HRESULT __stdcall IXACT3Engine_UnRegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->lpVtbl->UnRegisterNotification(pEngine, pNotificationDesc); +} + +__inline XACTCATEGORY __stdcall IXACT3Engine_GetCategory(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName) +{ + return pEngine->lpVtbl->GetCategory(pEngine, szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Engine_Stop(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags) +{ + return pEngine->lpVtbl->Stop(pEngine, nCategory, dwFlags); +} + +__inline HRESULT __stdcall IXACT3Engine_SetVolume(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume) +{ + return pEngine->lpVtbl->SetVolume(pEngine, nCategory, nVolume); +} + +__inline HRESULT __stdcall IXACT3Engine_Pause(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, BOOL fPause) +{ + return pEngine->lpVtbl->Pause(pEngine, nCategory, fPause); +} + +__inline XACTVARIABLEINDEX __stdcall IXACT3Engine_GetGlobalVariableIndex(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName) +{ + return pEngine->lpVtbl->GetGlobalVariableIndex(pEngine, szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Engine_SetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pEngine->lpVtbl->SetGlobalVariable(pEngine, nIndex, nValue); +} + +__inline HRESULT __stdcall IXACT3Engine_GetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) +{ + return pEngine->lpVtbl->GetGlobalVariable(pEngine, nIndex, nValue); +} + +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// Create Engine +//------------------------------------------------------------------------------ + +// Flags used only in XACT3CreateEngine below. These flags are valid but ignored +// when building for Xbox 360; to enable auditioning on that platform you must +// link explicitly to an auditioning version of the XACT static library. +static const DWORD XACT_FLAG_API_AUDITION_MODE = 0x00000001; +static const DWORD XACT_FLAG_API_DEBUG_MODE = 0x00000002; + +#ifdef _XBOX + +STDAPI XACT3CreateEngine(DWORD dwCreationFlags, __deref_out IXACT3Engine** ppEngine); + +#else // #ifdef _XBOX + +#define XACT_DEBUGENGINE_REGISTRY_KEY TEXT("Software\\Microsoft\\XACT") +#define XACT_DEBUGENGINE_REGISTRY_VALUE TEXT("DebugEngine") + + +#ifdef __cplusplus + +__inline HRESULT __stdcall XACT3CreateEngine(DWORD dwCreationFlags, __deref_out IXACT3Engine** ppEngine) +{ + HRESULT hr; + HKEY key; + DWORD data; + DWORD type = REG_DWORD; + DWORD dataSize = sizeof(DWORD); + BOOL debug = (dwCreationFlags & XACT_FLAG_API_DEBUG_MODE) ? TRUE : FALSE; + BOOL audition = (dwCreationFlags & XACT_FLAG_API_AUDITION_MODE) ? TRUE : FALSE; + + // If neither the debug nor audition flags are set, see if the debug registry key is set + if(!debug && !audition && + (RegOpenKeyEx(HKEY_LOCAL_MACHINE, XACT_DEBUGENGINE_REGISTRY_KEY, 0, KEY_READ, &key) == ERROR_SUCCESS)) + { + if(RegQueryValueEx(key, XACT_DEBUGENGINE_REGISTRY_VALUE, NULL, &type, (LPBYTE)&data, &dataSize) == ERROR_SUCCESS) + { + if(data) + { + debug = TRUE; + } + } + RegCloseKey(key); + } + + // Priority order: Audition, Debug, Retail + hr = CoCreateInstance(audition ? __uuidof(XACTAuditionEngine) + : (debug ? __uuidof(XACTDebugEngine) : __uuidof(XACTEngine)), + NULL, CLSCTX_INPROC_SERVER, __uuidof(IXACT3Engine), (void**)ppEngine); + + // If debug engine does not exist fallback to retail version + if(FAILED(hr) && debug && !audition) + { + hr = CoCreateInstance(__uuidof(XACTEngine), NULL, CLSCTX_INPROC_SERVER, __uuidof(IXACT3Engine), (void**)ppEngine); + } + + return hr; +} + +#else // #ifdef __cplusplus + +__inline HRESULT __stdcall XACT3CreateEngine(DWORD dwCreationFlags, __deref_out IXACT3Engine** ppEngine) +{ + HRESULT hr; + HKEY key; + DWORD data; + DWORD type = REG_DWORD; + DWORD dataSize = sizeof(DWORD); + BOOL debug = (dwCreationFlags & XACT_FLAG_API_DEBUG_MODE) ? TRUE : FALSE; + BOOL audition = (dwCreationFlags & XACT_FLAG_API_AUDITION_MODE) ? TRUE : FALSE; + + // If neither the debug nor audition flags are set, see if the debug registry key is set + if(!debug && !audition && + (RegOpenKeyEx(HKEY_LOCAL_MACHINE, XACT_DEBUGENGINE_REGISTRY_KEY, 0, KEY_READ, &key) == ERROR_SUCCESS)) + { + if(RegQueryValueEx(key, XACT_DEBUGENGINE_REGISTRY_VALUE, NULL, &type, (LPBYTE)&data, &dataSize) == ERROR_SUCCESS) + { + if(data) + { + debug = TRUE; + } + } + RegCloseKey(key); + } + + // Priority order: Audition, Debug, Retail + hr = CoCreateInstance(audition ? &CLSID_XACTAuditionEngine + : (debug ? &CLSID_XACTDebugEngine : &CLSID_XACTEngine), + NULL, CLSCTX_INPROC_SERVER, &IID_IXACT3Engine, (void**)ppEngine); + + // If debug engine does not exist fallback to retail version + if(FAILED(hr) && debug && !audition) + { + hr = CoCreateInstance(&CLSID_XACTEngine, NULL, CLSCTX_INPROC_SERVER, &IID_IXACT3Engine, (void**)ppEngine); + } + + return hr; +} + +#endif // #ifdef __cplusplus + +#endif // #ifdef _XBOX + +//------------------------------------------------------------------------------ +// XACT specific error codes +//------------------------------------------------------------------------------ + +#define FACILITY_XACTENGINE 0xAC7 +#define XACTENGINEERROR(n) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XACTENGINE, n) + +#define XACTENGINE_E_OUTOFMEMORY E_OUTOFMEMORY // Out of memory +#define XACTENGINE_E_INVALIDARG E_INVALIDARG // Invalid arg +#define XACTENGINE_E_NOTIMPL E_NOTIMPL // Not implemented +#define XACTENGINE_E_FAIL E_FAIL // Unknown error + +#define XACTENGINE_E_ALREADYINITIALIZED XACTENGINEERROR(0x001) // The engine is already initialized +#define XACTENGINE_E_NOTINITIALIZED XACTENGINEERROR(0x002) // The engine has not been initialized +#define XACTENGINE_E_EXPIRED XACTENGINEERROR(0x003) // The engine has expired (demo or pre-release version) +#define XACTENGINE_E_NONOTIFICATIONCALLBACK XACTENGINEERROR(0x004) // No notification callback +#define XACTENGINE_E_NOTIFICATIONREGISTERED XACTENGINEERROR(0x005) // Notification already registered +#define XACTENGINE_E_INVALIDUSAGE XACTENGINEERROR(0x006) // Invalid usage +#define XACTENGINE_E_INVALIDDATA XACTENGINEERROR(0x007) // Invalid data +#define XACTENGINE_E_INSTANCELIMITFAILTOPLAY XACTENGINEERROR(0x008) // Fail to play due to instance limit +#define XACTENGINE_E_NOGLOBALSETTINGS XACTENGINEERROR(0x009) // Global Settings not loaded +#define XACTENGINE_E_INVALIDVARIABLEINDEX XACTENGINEERROR(0x00a) // Invalid variable index +#define XACTENGINE_E_INVALIDCATEGORY XACTENGINEERROR(0x00b) // Invalid category +#define XACTENGINE_E_INVALIDCUEINDEX XACTENGINEERROR(0x00c) // Invalid cue index +#define XACTENGINE_E_INVALIDWAVEINDEX XACTENGINEERROR(0x00d) // Invalid wave index +#define XACTENGINE_E_INVALIDTRACKINDEX XACTENGINEERROR(0x00e) // Invalid track index +#define XACTENGINE_E_INVALIDSOUNDOFFSETORINDEX XACTENGINEERROR(0x00f) // Invalid sound offset or index +#define XACTENGINE_E_READFILE XACTENGINEERROR(0x010) // Error reading a file +#define XACTENGINE_E_UNKNOWNEVENT XACTENGINEERROR(0x011) // Unknown event type +#define XACTENGINE_E_INCALLBACK XACTENGINEERROR(0x012) // Invalid call of method of function from callback +#define XACTENGINE_E_NOWAVEBANK XACTENGINEERROR(0x013) // No wavebank exists for desired operation +#define XACTENGINE_E_SELECTVARIATION XACTENGINEERROR(0x014) // Unable to select a variation +#define XACTENGINE_E_MULTIPLEAUDITIONENGINES XACTENGINEERROR(0x015) // There can be only one audition engine +#define XACTENGINE_E_WAVEBANKNOTPREPARED XACTENGINEERROR(0x016) // The wavebank is not prepared +#define XACTENGINE_E_NORENDERER XACTENGINEERROR(0x017) // No audio device found on. +#define XACTENGINE_E_INVALIDENTRYCOUNT XACTENGINEERROR(0x018) // Invalid entry count for channel maps +#define XACTENGINE_E_SEEKTIMEBEYONDCUEEND XACTENGINEERROR(0x019) // Time offset for seeking is beyond the cue end. +#define XACTENGINE_E_SEEKTIMEBEYONDWAVEEND XACTENGINEERROR(0x01a) // Time offset for seeking is beyond the wave end. +#define XACTENGINE_E_NOFRIENDLYNAMES XACTENGINEERROR(0x01b) // Friendly names are not included in the bank. + +#define XACTENGINE_E_AUDITION_WRITEFILE XACTENGINEERROR(0x101) // Error writing a file during auditioning +#define XACTENGINE_E_AUDITION_NOSOUNDBANK XACTENGINEERROR(0x102) // Missing a soundbank +#define XACTENGINE_E_AUDITION_INVALIDRPCINDEX XACTENGINEERROR(0x103) // Missing an RPC curve +#define XACTENGINE_E_AUDITION_MISSINGDATA XACTENGINEERROR(0x104) // Missing data for an audition command +#define XACTENGINE_E_AUDITION_UNKNOWNCOMMAND XACTENGINEERROR(0x105) // Unknown command +#define XACTENGINE_E_AUDITION_INVALIDDSPINDEX XACTENGINEERROR(0x106) // Missing a DSP parameter +#define XACTENGINE_E_AUDITION_MISSINGWAVE XACTENGINEERROR(0x107) // Wave does not exist in auditioned wavebank +#define XACTENGINE_E_AUDITION_CREATEDIRECTORYFAILED XACTENGINEERROR(0x108) // Failed to create a directory for streaming wavebank data +#define XACTENGINE_E_AUDITION_INVALIDSESSION XACTENGINEERROR(0x109) // Invalid audition session + +#endif // #ifndef GUID_DEFS_ONLY + +#endif // #ifndef _XACT3_H_ diff --git a/RenderDll/Dx9Sdk/Include/xact3d3.h b/RenderDll/Dx9Sdk/Include/xact3d3.h new file mode 100644 index 0000000..f17e1e5 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/xact3d3.h @@ -0,0 +1,275 @@ +/*-========================================================================-_ + | - XACT3D3 - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |VERSION: 0.1 MODEL: Unmanaged User-mode | + |CONTRACT: N / A EXCEPT: No Exceptions | + |PARENT: N / A MINREQ: Win2000, Xbox360 | + |PROJECT: XACT3D DIALECT: MS Visual C++ 7.0 | + |>------------------------------------------------------------------------<| + | DUTY: XACT 3D support | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. See X3DAudio.h for information regarding X3DAudio types. */ + + +#ifndef __XACT3D3_H__ +#define __XACT3D3_H__ + +//---------------------------------------------------// + #include + #include + + #pragma warning(push) + #pragma warning(disable: 4701) // disable "local variable may be used without having been initialized" compile warning + + // Supported speaker positions, represented as azimuth angles. + // + // Here's a picture of the azimuth angles for the 8 cardinal points, + // seen from above. The emitter's base position is at the origin 0. + // + // FRONT + // | 0 <-- azimuth + // | + // 7pi/4 \ | / pi/4 + // \ | / + // LEFT \|/ RIGHT + // 3pi/2-------0-------pi/2 + // /|\ + // / | \ + // 5pi/4 / | \ 3pi/4 + // | + // | pi + // BACK + // + #define LEFT_AZIMUTH (3*X3DAUDIO_PI/2) + #define RIGHT_AZIMUTH (X3DAUDIO_PI/2) + #define FRONT_LEFT_AZIMUTH (7*X3DAUDIO_PI/4) + #define FRONT_RIGHT_AZIMUTH (X3DAUDIO_PI/4) + #define FRONT_CENTER_AZIMUTH 0.0f + #define LOW_FREQUENCY_AZIMUTH X3DAUDIO_2PI + #define BACK_LEFT_AZIMUTH (5*X3DAUDIO_PI/4) + #define BACK_RIGHT_AZIMUTH (3*X3DAUDIO_PI/4) + #define BACK_CENTER_AZIMUTH X3DAUDIO_PI + #define FRONT_LEFT_OF_CENTER_AZIMUTH (15*X3DAUDIO_PI/8) + #define FRONT_RIGHT_OF_CENTER_AZIMUTH (X3DAUDIO_PI/8) + + +//-----------------------------------------------------// + // Supported emitter channel layouts: + static const float aStereoLayout[] = + { + LEFT_AZIMUTH, + RIGHT_AZIMUTH + }; + static const float a2Point1Layout[] = + { + LEFT_AZIMUTH, + RIGHT_AZIMUTH, + LOW_FREQUENCY_AZIMUTH + }; + static const float aQuadLayout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH + }; + static const float a4Point1Layout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH + }; + static const float a5Point1Layout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + FRONT_CENTER_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH + }; + static const float a7Point1Layout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + FRONT_CENTER_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH, + LEFT_AZIMUTH, + RIGHT_AZIMUTH + }; + + +//-------------------------------------------------------// + //// + // DESCRIPTION: + // Initializes the 3D API's: + // + // REMARKS: + // This method only needs to be called once. + // X3DAudio will be initialized such that its speaker channel mask + // matches the format of the given XACT engine's final mix. + // + // PARAMETERS: + // pEngine - [in] XACT engine + // X3DInstance - [out] X3DAudio instance handle + // + // RETURN VALUE: + // HResult error code + //// + EXTERN_C HRESULT inline XACT3DInitialize (__in IXACT3Engine* pEngine, __in X3DAUDIO_HANDLE X3DInstance) + { + HRESULT hr = S_OK; + if (pEngine == NULL) { + hr = E_POINTER; + } + + XACTVARIABLEVALUE nSpeedOfSound; + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactSpeedOfSoundID = pEngine->GetGlobalVariableIndex("SpeedOfSound"); + hr = pEngine->GetGlobalVariable(xactSpeedOfSoundID, &nSpeedOfSound); + } + + if (SUCCEEDED(hr)) { + WAVEFORMATEXTENSIBLE wfxFinalMixFormat; + hr = pEngine->GetFinalMixFormat(&wfxFinalMixFormat); + if (SUCCEEDED(hr)) { + X3DAudioInitialize(wfxFinalMixFormat.dwChannelMask, nSpeedOfSound, X3DInstance); + } + } + return hr; + } + + + //// + // DESCRIPTION: + // Calculates DSP settings with respect to 3D parameters: + // + // REMARKS: + // Note the following flags are always specified for XACT3D calculation: + // X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE + // + // This means the caller must set at least the following fields: + // X3DAUDIO_LISTENER.OrientFront + // X3DAUDIO_LISTENER.OrientTop + // X3DAUDIO_LISTENER.Position + // X3DAUDIO_LISTENER.Velocity + // + // X3DAUDIO_EMITTER.OrientFront + // X3DAUDIO_EMITTER.OrientTop, if emitter is multi-channel + // X3DAUDIO_EMITTER.Position + // X3DAUDIO_EMITTER.Velocity + // X3DAUDIO_EMITTER.InnerRadius + // X3DAUDIO_EMITTER.InnerRadiusAngle + // X3DAUDIO_EMITTER.ChannelCount + // X3DAUDIO_EMITTER.CurveDistanceScaler + // X3DAUDIO_EMITTER.DopplerScaler + // + // X3DAUDIO_DSP_SETTINGS.pMatrixCoefficients, the caller need only allocate space for SrcChannelCount*DstChannelCount elements + // X3DAUDIO_DSP_SETTINGS.SrcChannelCount + // X3DAUDIO_DSP_SETTINGS.DstChannelCount + // + // If X3DAUDIO_EMITTER.pChannelAzimuths is left NULL for multi-channel emitters, + // a default channel radius and channel azimuth array will be applied below. + // Distance curves such as X3DAUDIO_EMITTER.pVolumeCurve should be + // left NULL as XACT's native RPCs will be used to define DSP behaviour + // with respect to normalized distance. + // + // See X3DAudio.h for information regarding X3DAudio types. + // + // PARAMETERS: + // X3DInstance - [in] X3DAudio instance handle, returned from XACT3DInitialize() + // pListener - [in] point of 3D audio reception + // pEmitter - [in] 3D audio source + // pDSPSettings - [out] receives calculation results, applied to an XACT cue via XACT3DApply() + // + // RETURN VALUE: + // HResult error code + //// + EXTERN_C HRESULT inline XACT3DCalculate (__in X3DAUDIO_HANDLE X3DInstance, __in const X3DAUDIO_LISTENER* pListener, __inout X3DAUDIO_EMITTER* pEmitter, __inout X3DAUDIO_DSP_SETTINGS* pDSPSettings) + { + HRESULT hr = S_OK; + if (pListener == NULL || pEmitter == NULL || pDSPSettings == NULL) { + hr = E_POINTER; + } + + if (SUCCEEDED(hr)) { + if (pEmitter->ChannelCount > 1 && pEmitter->pChannelAzimuths == NULL) { + pEmitter->ChannelRadius = 1.0f; + + switch (pEmitter->ChannelCount) { + case 2: pEmitter->pChannelAzimuths = (float*)&aStereoLayout[0]; break; + case 3: pEmitter->pChannelAzimuths = (float*)&a2Point1Layout[0]; break; + case 4: pEmitter->pChannelAzimuths = (float*)&aQuadLayout[0]; break; + case 5: pEmitter->pChannelAzimuths = (float*)&a4Point1Layout[0]; break; + case 6: pEmitter->pChannelAzimuths = (float*)&a5Point1Layout[0]; break; + case 8: pEmitter->pChannelAzimuths = (float*)&a7Point1Layout[0]; break; + default: hr = E_FAIL; break; + } + } + } + + if (SUCCEEDED(hr)) { + static X3DAUDIO_DISTANCE_CURVE_POINT DefaultCurvePoints[2] = { 0.0f, 1.0f, 1.0f, 1.0f }; + static X3DAUDIO_DISTANCE_CURVE DefaultCurve = { (X3DAUDIO_DISTANCE_CURVE_POINT*)&DefaultCurvePoints[0], 2 }; + if (pEmitter->pVolumeCurve == NULL) { + pEmitter->pVolumeCurve = &DefaultCurve; + } + if (pEmitter->pLFECurve == NULL) { + pEmitter->pLFECurve = &DefaultCurve; + } + + X3DAudioCalculate(X3DInstance, pListener, pEmitter, (X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE), pDSPSettings); + } + + return hr; + } + + + //// + // DESCRIPTION: + // Applies results from a call to XACT3DCalculate() to a cue. + // + // PARAMETERS: + // pDSPSettings - [in] calculation results generated by XACT3DCalculate() + // pCue - [in] cue to which to apply pDSPSettings + // + // RETURN VALUE: + // HResult error code + //// + EXTERN_C HRESULT inline XACT3DApply (__in const X3DAUDIO_DSP_SETTINGS* pDSPSettings, __in IXACT3Cue* pCue) + { + HRESULT hr = S_OK; + if (pDSPSettings == NULL || pCue == NULL) { + hr = E_POINTER; + } + + if (SUCCEEDED(hr)) { + hr = pCue->SetMatrixCoefficients(pDSPSettings->SrcChannelCount, pDSPSettings->DstChannelCount, pDSPSettings->pMatrixCoefficients); + } + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactDistanceID = pCue->GetVariableIndex("Distance"); + hr = pCue->SetVariable(xactDistanceID, pDSPSettings->EmitterToListenerDistance); + } + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactDopplerID = pCue->GetVariableIndex("DopplerPitchScalar"); + hr = pCue->SetVariable(xactDopplerID, pDSPSettings->DopplerFactor); + } + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactOrientationID = pCue->GetVariableIndex("OrientationAngle"); + hr = pCue->SetVariable(xactOrientationID, pDSPSettings->EmitterToListenerAngle * (180.0f / X3DAUDIO_PI)); + } + + return hr; + } + + + #pragma warning(pop) + +#endif // __XACT3D3_H__ +//---------------------------------<-EOF->----------------------------------// diff --git a/RenderDll/Dx9Sdk/Include/xact3wb.h b/RenderDll/Dx9Sdk/Include/xact3wb.h new file mode 100644 index 0000000..521667b --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/xact3wb.h @@ -0,0 +1,598 @@ +/*************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: xact3wb.h + * Content: XACT 3 wave bank definitions. + * + ****************************************************************************/ + +#ifndef __XACT3WB_H__ +#define __XACT3WB_H__ + +#ifdef _XBOX +# include +#else +# include +#endif + +#include +#include + +#pragma warning(push) +#pragma warning(disable:4201) +#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int + +#pragma pack(push, 1) +#if !defined(_X86_) + #define XACTUNALIGNED __unaligned +#else + #define XACTUNALIGNED +#endif + +#ifdef _M_PPCBE +#pragma bitfield_order(push, lsb_to_msb) +#endif + +#define WAVEBANK_HEADER_SIGNATURE 'DNBW' // WaveBank RIFF chunk signature +#define WAVEBANK_HEADER_VERSION 44 // Current wavebank file version + +#define WAVEBANK_BANKNAME_LENGTH 64 // Wave bank friendly name length, in characters +#define WAVEBANK_ENTRYNAME_LENGTH 64 // Wave bank entry friendly name length, in characters + +#define WAVEBANK_MAX_DATA_SEGMENT_SIZE 0xFFFFFFFF // Maximum wave bank data segment size, in bytes +#define WAVEBANK_MAX_COMPACT_DATA_SEGMENT_SIZE 0x001FFFFF // Maximum compact wave bank data segment size, in bytes + +typedef DWORD WAVEBANKOFFSET; + +// +// Bank flags +// + +#define WAVEBANK_TYPE_BUFFER 0x00000000 // In-memory buffer +#define WAVEBANK_TYPE_STREAMING 0x00000001 // Streaming +#define WAVEBANK_TYPE_MASK 0x00000001 + +#define WAVEBANK_FLAGS_ENTRYNAMES 0x00010000 // Bank includes entry names +#define WAVEBANK_FLAGS_COMPACT 0x00020000 // Bank uses compact format +#define WAVEBANK_FLAGS_SYNC_DISABLED 0x00040000 // Bank is disabled for audition sync +#define WAVEBANK_FLAGS_SEEKTABLES 0x00080000 // Bank includes seek tables. +#define WAVEBANK_FLAGS_MASK 0x000F0000 + +// +// Entry flags +// + +#define WAVEBANKENTRY_FLAGS_READAHEAD 0x00000001 // Enable stream read-ahead +#define WAVEBANKENTRY_FLAGS_LOOPCACHE 0x00000002 // One or more looping sounds use this wave +#define WAVEBANKENTRY_FLAGS_REMOVELOOPTAIL 0x00000004 // Remove data after the end of the loop region +#define WAVEBANKENTRY_FLAGS_IGNORELOOP 0x00000008 // Used internally when the loop region can't be used +#define WAVEBANKENTRY_FLAGS_MASK 0x00000008 + +// +// Entry wave format identifiers +// + +#define WAVEBANKMINIFORMAT_TAG_PCM 0x0 // PCM data +#define WAVEBANKMINIFORMAT_TAG_XMA 0x1 // XMA data +#define WAVEBANKMINIFORMAT_TAG_ADPCM 0x2 // ADPCM data +#define WAVEBANKMINIFORMAT_TAG_WMA 0x3 // WMA data + +#define WAVEBANKMINIFORMAT_BITDEPTH_8 0x0 // 8-bit data (PCM only) +#define WAVEBANKMINIFORMAT_BITDEPTH_16 0x1 // 16-bit data (PCM only) + +// +// Arbitrary fixed sizes +// +#define WAVEBANKENTRY_XMASTREAMS_MAX 3 // enough for 5.1 channel audio +#define WAVEBANKENTRY_XMACHANNELS_MAX 6 // enough for 5.1 channel audio (cf. XAUDIOCHANNEL_SOURCEMAX) + +// +// DVD data sizes +// + +#define WAVEBANK_DVD_SECTOR_SIZE 2048 +#define WAVEBANK_DVD_BLOCK_SIZE (WAVEBANK_DVD_SECTOR_SIZE * 16) + +// +// Bank alignment presets +// + +#define WAVEBANK_ALIGNMENT_MIN 4 // Minimum alignment +#define WAVEBANK_ALIGNMENT_DVD WAVEBANK_DVD_SECTOR_SIZE // DVD-optimized alignment + +// +// Wave bank segment identifiers +// + +typedef enum WAVEBANKSEGIDX +{ + WAVEBANK_SEGIDX_BANKDATA = 0, // Bank data + WAVEBANK_SEGIDX_ENTRYMETADATA, // Entry meta-data + WAVEBANK_SEGIDX_SEEKTABLES, // Storage for seek tables for the encoded waves. + WAVEBANK_SEGIDX_ENTRYNAMES, // Entry friendly names + WAVEBANK_SEGIDX_ENTRYWAVEDATA, // Entry wave data + WAVEBANK_SEGIDX_COUNT +} WAVEBANKSEGIDX, *LPWAVEBANKSEGIDX; + +typedef const WAVEBANKSEGIDX *LPCWAVEBANKSEGIDX; + +// +// Endianness +// + +#ifdef __cplusplus + +namespace XACTWaveBank +{ + __inline void SwapBytes(XACTUNALIGNED DWORD &dw) + { + +#ifdef _X86_ + + __asm + { + mov edi, dw + mov eax, [edi] + bswap eax + mov [edi], eax + } + +#else // _X86_ + + dw = _byteswap_ulong(dw); + +#endif // _X86_ + + } + + __inline void SwapBytes(XACTUNALIGNED WORD &w) + { + +#ifdef _X86_ + + __asm + { + mov edi, w + mov ax, [edi] + xchg ah, al + mov [edi], ax + } + +#else // _X86_ + + w = _byteswap_ushort(w); + +#endif // _X86_ + + } + +} + +#endif // __cplusplus + +// +// Wave bank region in bytes. +// + +typedef struct WAVEBANKREGION +{ + DWORD dwOffset; // Region offset, in bytes. + DWORD dwLength; // Region length, in bytes. + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwOffset); + XACTWaveBank::SwapBytes(dwLength); + } + +#endif // __cplusplus + +} WAVEBANKREGION, *LPWAVEBANKREGION; + +typedef const WAVEBANKREGION *LPCWAVEBANKREGION; + + +// +// Wave bank region in samples. +// + +typedef struct WAVEBANKSAMPLEREGION +{ + DWORD dwStartSample; // Start sample for the region. + DWORD dwTotalSamples; // Region length in samples. + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwStartSample); + XACTWaveBank::SwapBytes(dwTotalSamples); + } + +#endif // __cplusplus + +} WAVEBANKSAMPLEREGION, *LPWAVEBANKSAMPLEREGION; + +typedef const WAVEBANKSAMPLEREGION *LPCWAVEBANKSAMPLEREGION; + + +// +// Wave bank file header +// + +typedef struct WAVEBANKHEADER +{ + DWORD dwSignature; // File signature + DWORD dwVersion; // Version of the tool that created the file + DWORD dwHeaderVersion; // Version of the file format + WAVEBANKREGION Segments[WAVEBANK_SEGIDX_COUNT]; // Segment lookup table + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwSignature); + XACTWaveBank::SwapBytes(dwVersion); + XACTWaveBank::SwapBytes(dwHeaderVersion); + + for(int i = 0; i < WAVEBANK_SEGIDX_COUNT; i++) + { + Segments[i].SwapBytes(); + } + } + +#endif // __cplusplus + +} WAVEBANKHEADER, *LPWAVEBANKHEADER; + +typedef const WAVEBANKHEADER *LPCWAVEBANKHEADER; + +// +// Table for converting WMA Average Bytes per Second values to the WAVEBANKMINIWAVEFORMAT wBlockAlign field +// NOTE: There can be a max of 8 values in the table. +// + +#define MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES 7 + +static const DWORD aWMAAvgBytesPerSec[] = +{ + 12000, + 24000, + 4000, + 6000, + 8000, + 20000, + 2500 +}; +// bitrate = entry * 8 + +// +// Table for converting WMA Block Align values to the WAVEBANKMINIWAVEFORMAT wBlockAlign field +// NOTE: There can be a max of 32 values in the table. +// + +#define MAX_WMA_BLOCK_ALIGN_ENTRIES 17 + +static const DWORD aWMABlockAlign[] = +{ + 929, + 1487, + 1280, + 2230, + 8917, + 8192, + 4459, + 5945, + 2304, + 1536, + 1485, + 1008, + 2731, + 4096, + 6827, + 5462, + 1280 +}; + +struct WAVEBANKENTRY; + +// +// Entry compressed data format +// + +typedef union WAVEBANKMINIWAVEFORMAT +{ + struct + { + DWORD wFormatTag : 2; // Format tag + DWORD nChannels : 3; // Channel count (1 - 6) + DWORD nSamplesPerSec : 18; // Sampling rate + DWORD wBlockAlign : 8; // Block alignment. For WMA, lower 6 bits block alignment index, upper 2 bits bytes-per-second index. + DWORD wBitsPerSample : 1; // Bits per sample (8 vs. 16, PCM only); WMAudio2/WMAudio3 (for WMA) + }; + + DWORD dwValue; + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwValue); + } + + WORD BitsPerSample() const + { + if (wFormatTag == WAVEBANKMINIFORMAT_TAG_XMA) + return XMA_OUTPUT_SAMPLE_BITS; // First, because most common on Xbox 360 + if (wFormatTag == WAVEBANKMINIFORMAT_TAG_WMA) + return 16; + if (wFormatTag == WAVEBANKMINIFORMAT_TAG_ADPCM) + return 4; // MSADPCM_BITS_PER_SAMPLE == 4 + + // wFormatTag must be WAVEBANKMINIFORMAT_TAG_PCM (2 bits can only represent 4 different values) + return (wBitsPerSample == WAVEBANKMINIFORMAT_BITDEPTH_16) ? 16 : 8; + } + + #define ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET 22 + DWORD BlockAlign() const + { + DWORD dwReturn = 0; + + switch (wFormatTag) + { + case WAVEBANKMINIFORMAT_TAG_PCM: + dwReturn = wBlockAlign; + break; + + case WAVEBANKMINIFORMAT_TAG_XMA: + dwReturn = nChannels * XMA_OUTPUT_SAMPLE_BITS / 8; + break; + + case WAVEBANKMINIFORMAT_TAG_ADPCM: + dwReturn = (wBlockAlign + ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET) * nChannels; + break; + + case WAVEBANKMINIFORMAT_TAG_WMA: + { + DWORD dwBlockAlignIndex = wBlockAlign & 0x1F; + if (dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES) + dwReturn = aWMABlockAlign[dwBlockAlignIndex]; + } + break; + } + + return dwReturn; + } + + DWORD AvgBytesPerSec() const + { + DWORD dwReturn = 0; + + switch (wFormatTag) + { + case WAVEBANKMINIFORMAT_TAG_PCM: + case WAVEBANKMINIFORMAT_TAG_XMA: + dwReturn = nSamplesPerSec * wBlockAlign; + break; + + case WAVEBANKMINIFORMAT_TAG_ADPCM: + { + DWORD blockAlign = BlockAlign(); + DWORD samplesPerAdpcmBlock = AdpcmSamplesPerBlock(); + dwReturn = blockAlign * nSamplesPerSec / samplesPerAdpcmBlock; + } + break; + + case WAVEBANKMINIFORMAT_TAG_WMA: + { + DWORD dwBytesPerSecIndex = wBlockAlign >> 5; + if (dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES) + dwReturn = aWMAAvgBytesPerSec[dwBytesPerSecIndex]; + } + break; + } + + return dwReturn; + } + + DWORD EncodeWMABlockAlign(DWORD dwBlockAlign, DWORD dwAvgBytesPerSec) const + { + DWORD dwReturn = 0; + DWORD dwBlockAlignIndex = 0; + DWORD dwBytesPerSecIndex = 0; + + for (; dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES && dwBlockAlign != aWMABlockAlign[dwBlockAlignIndex]; dwBlockAlignIndex++); + + if (dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES) + { + for (; dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES && dwAvgBytesPerSec != aWMAAvgBytesPerSec[dwBytesPerSecIndex]; dwBytesPerSecIndex++); + + if (dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES) + { + dwReturn = dwBlockAlignIndex | (dwBytesPerSecIndex << 5); + } + } + + return dwReturn; + } + + + void XMA2FillFormatEx(XMA2WAVEFORMATEX *fmt, WORD blockCount, const struct WAVEBANKENTRY* entry) const; + + DWORD AdpcmSamplesPerBlock() const + { + DWORD nBlockAlign = (wBlockAlign + ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET) * nChannels; + return nBlockAlign * 2 / (DWORD)nChannels - 12; + } + + void AdpcmFillCoefficientTable(ADPCMWAVEFORMAT *fmt) const + { + // These are fixed since we are always using MS ADPCM + fmt->wNumCoef = 7; /* MSADPCM_NUM_COEFFICIENTS */ + + static ADPCMCOEFSET aCoef[7] = { { 256, 0}, {512, -256}, {0,0}, {192,64}, {240,0}, {460, -208}, {392,-232} }; + memcpy( &fmt->aCoef, aCoef, sizeof(aCoef) ); + } + +#endif // __cplusplus + +} WAVEBANKMINIWAVEFORMAT, *LPWAVEBANKMINIWAVEFORMAT; + +typedef const WAVEBANKMINIWAVEFORMAT *LPCWAVEBANKMINIWAVEFORMAT; + +// +// Entry meta-data +// + +typedef struct WAVEBANKENTRY +{ + union + { + struct + { + // Entry flags + DWORD dwFlags : 4; + + // Duration of the wave, in units of one sample. + // For instance, a ten second long wave sampled + // at 48KHz would have a duration of 480,000. + // This value is not affected by the number of + // channels, the number of bits per sample, or the + // compression format of the wave. + DWORD Duration : 28; + }; + DWORD dwFlagsAndDuration; + }; + + WAVEBANKMINIWAVEFORMAT Format; // Entry format. + WAVEBANKREGION PlayRegion; // Region within the wave data segment that contains this entry. + WAVEBANKSAMPLEREGION LoopRegion; // Region within the wave data (in samples) that should loop. + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwFlagsAndDuration); + Format.SwapBytes(); + PlayRegion.SwapBytes(); + LoopRegion.SwapBytes(); + } + +#endif // __cplusplus + +} WAVEBANKENTRY, *LPWAVEBANKENTRY; + +typedef const WAVEBANKENTRY *LPCWAVEBANKENTRY; + +// +// Compact entry meta-data +// + +typedef struct WAVEBANKENTRYCOMPACT +{ + DWORD dwOffset : 21; // Data offset, in sectors + DWORD dwLengthDeviation : 11; // Data length deviation, in bytes + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(*(LPDWORD)this); + } + +#endif // __cplusplus + +} WAVEBANKENTRYCOMPACT, *LPWAVEBANKENTRYCOMPACT; + +typedef const WAVEBANKENTRYCOMPACT *LPCWAVEBANKENTRYCOMPACT; + +// +// Bank data segment +// + +typedef struct WAVEBANKDATA +{ + DWORD dwFlags; // Bank flags + DWORD dwEntryCount; // Number of entries in the bank + CHAR szBankName[WAVEBANK_BANKNAME_LENGTH]; // Bank friendly name + DWORD dwEntryMetaDataElementSize; // Size of each entry meta-data element, in bytes + DWORD dwEntryNameElementSize; // Size of each entry name element, in bytes + DWORD dwAlignment; // Entry alignment, in bytes + WAVEBANKMINIWAVEFORMAT CompactFormat; // Format data for compact bank + FILETIME BuildTime; // Build timestamp + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwFlags); + XACTWaveBank::SwapBytes(dwEntryCount); + XACTWaveBank::SwapBytes(dwEntryMetaDataElementSize); + XACTWaveBank::SwapBytes(dwEntryNameElementSize); + XACTWaveBank::SwapBytes(dwAlignment); + CompactFormat.SwapBytes(); + XACTWaveBank::SwapBytes(BuildTime.dwLowDateTime); + XACTWaveBank::SwapBytes(BuildTime.dwHighDateTime); + } + +#endif // __cplusplus + +} WAVEBANKDATA, *LPWAVEBANKDATA; + +typedef const WAVEBANKDATA *LPCWAVEBANKDATA; + +inline void WAVEBANKMINIWAVEFORMAT::XMA2FillFormatEx(XMA2WAVEFORMATEX *fmt, WORD blockCount, const WAVEBANKENTRY* entry) const +{ + // Note caller is responsbile for filling out fmt->wfx with other helper functions. + + fmt->NumStreams = (WORD)( (nChannels + 1) / 2 ); + + switch (nChannels) + { + case 1: fmt->ChannelMask = SPEAKER_MONO; break; + case 2: fmt->ChannelMask = SPEAKER_STEREO; break; + case 3: fmt->ChannelMask = SPEAKER_2POINT1; break; + case 4: fmt->ChannelMask = SPEAKER_QUAD; break; + case 5: fmt->ChannelMask = SPEAKER_4POINT1; break; + case 6: fmt->ChannelMask = SPEAKER_5POINT1; break; + case 7: fmt->ChannelMask = SPEAKER_5POINT1 | SPEAKER_BACK_CENTER; break; + case 8: fmt->ChannelMask = SPEAKER_7POINT1; break; + default: fmt->ChannelMask = 0; break; + } + + fmt->SamplesEncoded = entry->Duration; + fmt->BytesPerBlock = 65536; /* XACT_FIXED_XMA_BLOCK_SIZE */ + + fmt->PlayBegin = entry->PlayRegion.dwOffset; + fmt->PlayLength = entry->PlayRegion.dwLength; + + if (entry->LoopRegion.dwTotalSamples > 0) + { + fmt->LoopBegin = entry->LoopRegion.dwStartSample; + fmt->LoopLength = entry->LoopRegion.dwTotalSamples; + fmt->LoopCount = 0xff; /* XACTLOOPCOUNT_INFINITE */ + } + else + { + fmt->LoopBegin = 0; + fmt->LoopLength = 0; + fmt->LoopCount = 0; + } + + fmt->EncoderVersion = 4; // XMAENCODER_VERSION_XMA2 + + fmt->BlockCount = blockCount; +} + +#ifdef _M_PPCBE +#pragma bitfield_order(pop) +#endif + +#pragma warning(pop) +#pragma pack(pop) + +#endif // __XACTWB_H__ + diff --git a/RenderDll/Dx9Sdk/Include/xma2defs.h b/RenderDll/Dx9Sdk/Include/xma2defs.h new file mode 100644 index 0000000..13a4306 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/xma2defs.h @@ -0,0 +1,718 @@ +/*************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: xma2defs.h + * Content: Constants, data types and functions for XMA2 compressed audio. + * + ***************************************************************************/ + +#ifndef __XMA2DEFS_INCLUDED__ +#define __XMA2DEFS_INCLUDED__ + +#include // Markers for documenting API semantics +#include // For S_OK, E_FAIL +#include // Basic data types and constants for audio work + + +/*************************************************************************** + * Overview + ***************************************************************************/ + +// A typical XMA2 file contains these RIFF chunks: +// +// 'fmt' or 'XMA2' chunk (or both): A description of the XMA data's structure +// and characteristics (length, channels, sample rate, loops, block size, etc). +// +// 'seek' chunk: A seek table to help navigate the XMA data. +// +// 'data' chunk: The encoded XMA2 data. +// +// The encoded XMA2 data is structured as a set of BLOCKS, which contain PACKETS, +// which contain FRAMES, which contain SUBFRAMES (roughly speaking). The frames +// in a file may also be divided into several subsets, called STREAMS. +// +// FRAME: A variable-sized segment of XMA data that decodes to exactly 512 mono +// or stereo PCM samples. This is the smallest unit of XMA data that can +// be decoded in isolation. Frames are an arbitrary number of bits in +// length, and need not be byte-aligned. See "XMA frame structure" below. +// +// SUBFRAME: A region of bits in an XMA frame that decodes to 128 mono or stereo +// samples. The XMA decoder cannot decode a subframe in isolation; it needs +// a whole frame to work with. However, it can begin emitting the frame's +// decoded samples at any one of the four subframe boundaries. Subframes +// can be addressed for seeking and looping purposes. +// +// PACKET: A 2Kb region containing a 32-bit header and some XMA frames. Frames +// can (and usually do) span packets. A packet's header includes the offset +// in bits of the first frame that begins within that packet. All of the +// frames that begin in a given packet belong to the same "stream" (see the +// Multichannel Audio section below). +// +// STREAM: A set of packets within an XMA file that all contain data for the +// same mono or stereo component of a PCM file with more than two channels. +// The packets comprising a given stream may be interleaved with each other +// more or less arbitrarily; see Multichannel Audio. +// +// BLOCK: An array of XMA packets; or, to break it down differently, a series of +// consecutive XMA frames, padded at the end with reserved data. A block +// must contain at least one 2Kb packet per stream, and it can hold up to +// 4095 packets (8190Kb), but its size is typically in the 32Kb-128Kb range. +// (The size chosen involves a trade-off between memory use and efficiency +// of reading from permanent storage.) +// +// XMA frames do not span blocks, so a block is guaranteed to begin with a +// set of complete frames, one per stream. Also, a block in a multi-stream +// XMA2 file always contains the same number of samples for each stream; +// see Multichannel Audio. +// +// The 'data' chunk in an XMA2 file is an array of XMA2WAVEFORMAT.BlockCount XMA +// blocks, all the same size (as specified in XMA2WAVEFORMAT.BlockSizeInBytes) +// except for the last one, which may be shorter. + + +// MULTICHANNEL AUDIO: the XMA decoder can only decode raw XMA data into either +// mono or stereo PCM data. In order to encode a 6-channel file (say), the file +// must be deinterleaved into 3 stereo streams that are encoded independently, +// producing 3 encoded XMA data streams. Then the packets in these 3 streams +// are interleaved to produce a single XMA2 file, and some information is added +// to the file so that the original 6-channel audio can be reconstructed at +// decode time. This works using the concept of an XMA stream (see above). +// +// The frames for all the streams in an XMA file are interleaved in an arbitrary +// order. To locate a frame that belongs to a given stream in a given XMA block, +// you must examine the first few packets in the block. Here (and only here) the +// packets are guaranteed to be presented in stream order, so that all frames +// beginning in packet 0 belong to stream 0 (the first stereo pair), etc. +// +// (This means that when decoding multi-stream XMA files, only entire XMA blocks +// should be submitted to the decoder; otherwise it cannot know which frames +// belong to which stream.) +// +// Once you have one frame that belongs to a given stream, you can find the next +// one by looking at the frame's 'NextFrameOffsetBits' value (which is stored in +// its first 15 bits; see XMAFRAME below). The GetXmaFrameBitPosition function +// uses this technique. + + +// SEEKING IN XMA2 FILES: Here is some pseudocode to find the byte position and +// subframe in an XMA2 file which will contain sample S when decoded. +// +// 1. Traverse the seek table to find the XMA2 block containing sample S. The +// seek table is an array of big-endian DWORDs, one per block in the file. +// The Nth DWORD is the total number of PCM samples that would be obtained +// by decoding the entire XMA file up to the end of block N. Hence, the +// block we want is the first one whose seek table entry is greater than S. +// (See the GetXmaBlockContainingSample helper function.) +// +// 2. Calculate which frame F within the block found above contains sample S. +// Since each frame decodes to 512 samples, this is straightforward. The +// first frame in the block produces samples X to X + 512, where X is the +// seek table entry for the prior block. So F is (S - X) / 512. +// +// 3. Find the bit offset within the block where frame F starts. Since frames +// are variable-sized, this can only be done by traversing all the frames in +// the block until we reach frame F. (See GetXmaFrameBitPosition.) +// +// 4. Frame F has four 128-sample subframes. To find the subframe containing S, +// we can use the formula (S % 512) / 128. +// +// In the case of multi-stream XMA files, sample S is a multichannel sample with +// parts coming from several frames, one per stream. To find all these frames, +// steps 2-4 need to be repeated for each stream N, using the knowledge that the +// first packets in a block are presented in stream order. The frame traversal +// in step 3 must be started at the first frame in the Nth packet of the block, +// which will be the first frame for stream N. (And the packet header will tell +// you the first frame's start position within the packet.) +// +// Step 1 can be performed using the GetXmaBlockContainingSample function below, +// and steps 2-4 by calling GetXmaDecodePositionForSample once for each stream. + + + +/*************************************************************************** + * XMA constants + ***************************************************************************/ + +// Size of the PCM samples produced by the XMA decoder +#define XMA_OUTPUT_SAMPLE_BYTES 2u +#define XMA_OUTPUT_SAMPLE_BITS (XMA_OUTPUT_SAMPLE_BYTES * 8u) + +// Size of an XMA packet +#define XMA_BYTES_PER_PACKET 2048u +#define XMA_BITS_PER_PACKET (XMA_BYTES_PER_PACKET * 8u) + +// Size of an XMA packet header +#define XMA_PACKET_HEADER_BYTES 4u +#define XMA_PACKET_HEADER_BITS (XMA_PACKET_HEADER_BYTES * 8u) + +// Sample blocks in a decoded XMA frame +#define XMA_SAMPLES_PER_FRAME 512u + +// Sample blocks in a decoded XMA subframe +#define XMA_SAMPLES_PER_SUBFRAME 128u + +// Maximum encoded data that can be submitted to the XMA decoder at a time +#define XMA_READBUFFER_MAX_PACKETS 4095u +#define XMA_READBUFFER_MAX_BYTES (XMA_READBUFFER_MAX_PACKETS * XMA_BYTES_PER_PACKET) + +// Maximum size allowed for the XMA decoder's output buffers +#define XMA_WRITEBUFFER_MAX_BYTES (31u * 256u) + +// Required byte alignment of the XMA decoder's output buffers +#define XMA_WRITEBUFFER_BYTE_ALIGNMENT 256u + +// Decode chunk sizes for the XMA_PLAYBACK_INIT.subframesToDecode field +#define XMA_MIN_SUBFRAMES_TO_DECODE 1u +#define XMA_MAX_SUBFRAMES_TO_DECODE 8u +#define XMA_OPTIMAL_SUBFRAMES_TO_DECODE 4u + +// LoopCount<255 means finite repetitions; LoopCount=255 means infinite looping +#define XMA_MAX_LOOPCOUNT 254u +#define XMA_INFINITE_LOOP 255u + + + +/*************************************************************************** + * XMA format structures + ***************************************************************************/ + +// The currently recommended way to express format information for XMA2 files +// is the XMA2WAVEFORMATEX structure. This structure is fully compliant with +// the WAVEFORMATEX standard and contains all the information needed to parse +// and manage XMA2 files in a compact way. + +#define WAVE_FORMAT_XMA2 0x166 + +typedef struct XMA2WAVEFORMATEX +{ + WAVEFORMATEX wfx; + // Meaning of the WAVEFORMATEX fields here: + // wFormatTag; // Audio format type; always WAVE_FORMAT_XMA2 + // nChannels; // Channel count of the decoded audio + // nSamplesPerSec; // Sample rate of the decoded audio + // nAvgBytesPerSec; // Used internally by the XMA encoder + // nBlockAlign; // Decoded sample size; channels * wBitsPerSample / 8 + // wBitsPerSample; // Bits per decoded mono sample; always 16 for XMA + // cbSize; // Size in bytes of the rest of this structure (34) + + WORD NumStreams; // Number of audio streams (1 or 2 channels each) + DWORD ChannelMask; // Spatial positions of the channels in this file, + // stored as SPEAKER_xxx values (see audiodefs.h) + DWORD SamplesEncoded; // Total number of PCM samples the file decodes to + DWORD BytesPerBlock; // XMA block size (but the last one may be shorter) + DWORD PlayBegin; // First valid sample in the decoded audio + DWORD PlayLength; // Length of the valid part of the decoded audio + DWORD LoopBegin; // Beginning of the loop region in decoded sample terms + DWORD LoopLength; // Length of the loop region in decoded sample terms + BYTE LoopCount; // Number of loop repetitions; 255 = infinite + BYTE EncoderVersion; // Version of XMA encoder that generated the file + WORD BlockCount; // XMA blocks in file (and entries in its seek table) +} XMA2WAVEFORMATEX, *PXMA2WAVEFORMATEX; + + +// The legacy XMA format structures are described here for reference, but they +// should not be used in new content. XMAWAVEFORMAT was the structure used in +// XMA version 1 files. XMA2WAVEFORMAT was used in early XMA2 files; it is not +// placed in the usual 'fmt' RIFF chunk but in its own 'XMA2' chunk. + +#ifndef WAVE_FORMAT_XMA +#define WAVE_FORMAT_XMA 0x0165 + +// Values used in the ChannelMask fields below. Similar to the SPEAKER_xxx +// values defined in audiodefs.h, but modified to fit in a single byte. +#ifndef XMA_SPEAKER_LEFT + #define XMA_SPEAKER_LEFT 0x01 + #define XMA_SPEAKER_RIGHT 0x02 + #define XMA_SPEAKER_CENTER 0x04 + #define XMA_SPEAKER_LFE 0x08 + #define XMA_SPEAKER_LEFT_SURROUND 0x10 + #define XMA_SPEAKER_RIGHT_SURROUND 0x20 + #define XMA_SPEAKER_LEFT_BACK 0x40 + #define XMA_SPEAKER_RIGHT_BACK 0x80 +#endif + + +// Used in XMAWAVEFORMAT for per-stream data +typedef struct XMASTREAMFORMAT +{ + DWORD PsuedoBytesPerSec; // Used by the XMA encoder (typo preserved for legacy reasons) + DWORD SampleRate; // The stream's decoded sample rate (in XMA2 files, + // this is the same for all streams in the file). + DWORD LoopStart; // Bit offset of the frame containing the loop start + // point, relative to the beginning of the stream. + DWORD LoopEnd; // Bit offset of the frame containing the loop end. + BYTE SubframeData; // Two 4-bit numbers specifying the exact location of + // the loop points within the frames that contain them. + // SubframeEnd: Subframe of the loop end frame where + // the loop ends. Ranges from 0 to 3. + // SubframeSkip: Subframes to skip in the start frame to + // reach the loop. Ranges from 0 to 4. + BYTE Channels; // Number of channels in the stream (1 or 2) + WORD ChannelMask; // Spatial positions of the channels in the stream +} XMASTREAMFORMAT; + +// Legacy XMA1 format structure +typedef struct XMAWAVEFORMAT +{ + WORD FormatTag; // Audio format type (always WAVE_FORMAT_XMA) + WORD BitsPerSample; // Bit depth (currently required to be 16) + WORD EncodeOptions; // Options for XMA encoder/decoder + WORD LargestSkip; // Largest skip used in interleaving streams + WORD NumStreams; // Number of interleaved audio streams + BYTE LoopCount; // Number of loop repetitions; 255 = infinite + BYTE Version; // XMA encoder version that generated the file. + // Always 3 or higher for XMA2 files. + XMASTREAMFORMAT XmaStreams[1]; // Per-stream format information; the actual + // array length is in the NumStreams field. +} XMAWAVEFORMAT; + + +// Used in XMA2WAVEFORMAT for per-stream data +typedef struct XMA2STREAMFORMAT +{ + BYTE Channels; // Number of channels in the stream (1 or 2) + BYTE RESERVED; // Reserved for future use + WORD ChannelMask; // Spatial positions of the channels in the stream +} XMA2STREAMFORMAT; + +// Legacy XMA2 format structure (big-endian byte ordering) +typedef struct XMA2WAVEFORMAT +{ + BYTE Version; // XMA encoder version that generated the file. + // Always 3 or higher for XMA2 files. + BYTE NumStreams; // Number of interleaved audio streams + BYTE RESERVED; // Reserved for future use + BYTE LoopCount; // Number of loop repetitions; 255 = infinite + DWORD LoopBegin; // Loop begin point, in samples + DWORD LoopEnd; // Loop end point, in samples + DWORD SampleRate; // The file's decoded sample rate + DWORD EncodeOptions; // Options for the XMA encoder/decoder + DWORD PsuedoBytesPerSec; // Used internally by the XMA encoder + DWORD BlockSizeInBytes; // Size in bytes of this file's XMA blocks (except + // possibly the last one). Always a multiple of + // 2Kb, since XMA blocks are arrays of 2Kb packets. + DWORD SamplesEncoded; // Total number of PCM samples encoded in this file + DWORD SamplesInSource; // Actual number of PCM samples in the source + // material used to generate this file + DWORD BlockCount; // Number of XMA blocks in this file (and hence + // also the number of entries in its seek table) + XMA2STREAMFORMAT Streams[1]; // Per-stream format information; the actual + // array length is in the NumStreams field. +} XMA2WAVEFORMAT; + +#endif // #ifndef WAVE_FORMAT_XMA + + + +/*************************************************************************** + * XMA packet structure (in big-endian form) + ***************************************************************************/ + +typedef struct XMA2PACKET +{ + int FrameCount : 6; // Number of XMA frames that begin in this packet + int FrameOffsetInBits : 15; // Bit of XmaData where the first complete frame begins + int PacketMetaData : 3; // Metadata stored in the packet (always 1 for XMA2) + int PacketSkipCount : 8; // How many packets belonging to other streams must be + // skipped to find the next packet belonging to this one + BYTE XmaData[XMA_BYTES_PER_PACKET - sizeof(DWORD)]; // XMA encoded data +} XMA2PACKET; + +// E.g. if the first DWORD of a packet is 0x30107902: +// +// 001100 000001000001111 001 00000010 +// | | | |____ Skip 2 packets to find the next one for this stream +// | | |___________ XMA2 signature (always 001) +// | |_____________________ First frame starts 527 bits into packet +// |________________________________ Packet contains 12 frames + + +// Helper functions to extract the fields above from an XMA packet. (Note that +// the bitfields cannot be read directly on little-endian architectures such as +// the Intel x86, as they are laid out in big-endian form.) + +__inline DWORD GetXmaPacketFrameCount(__in_bcount(1) const BYTE* pPacket) +{ + return (DWORD)(pPacket[0] >> 2); +} + +__inline DWORD GetXmaPacketFirstFrameOffsetInBits(__in_bcount(3) const BYTE* pPacket) +{ + return ((DWORD)(pPacket[0] & 0x3) << 13) | + ((DWORD)(pPacket[1]) << 5) | + ((DWORD)(pPacket[2]) >> 3); +} + +__inline DWORD GetXmaPacketMetadata(__in_bcount(3) const BYTE* pPacket) +{ + return (DWORD)(pPacket[2] & 0x7); +} + +__inline DWORD GetXmaPacketSkipCount(__in_bcount(4) const BYTE* pPacket) +{ + return (DWORD)(pPacket[3]); +} + + + +/*************************************************************************** + * XMA frame structure + ***************************************************************************/ + +// There is no way to represent the XMA frame as a C struct, since it is a +// variable-sized string of bits that need not be stored at a byte-aligned +// position in memory. This is the layout: +// +// XMAFRAME +// { +// LengthInBits: A 15-bit number representing the length of this frame. +// XmaData: Encoded XMA data; its size in bits is (LengthInBits - 15). +// } + +// Size in bits of the frame's initial LengthInBits field +#define XMA_BITS_IN_FRAME_LENGTH_FIELD 15 + +// Special LengthInBits value that marks an invalid final frame +#define XMA_FINAL_FRAME_MARKER 0x7FFF + + + +/*************************************************************************** + * XMA helper functions + ***************************************************************************/ + +// We define a local ASSERT macro to equal the global one if it exists. +// You can define XMA2DEFS_ASSERT in advance to override this default. +#ifndef XMA2DEFS_ASSERT + #ifdef ASSERT + #define XMA2DEFS_ASSERT ASSERT + #else + #define XMA2DEFS_ASSERT(a) /* No-op by default */ + #endif +#endif + + +// GetXmaBlockContainingSample: Use a given seek table to find the XMA block +// containing a given decoded sample. Note that the seek table entries in an +// XMA file are stored in big-endian form and may need to be converted prior +// to calling this function. + +__inline HRESULT GetXmaBlockContainingSample +( + DWORD nBlockCount, // Blocks in the file (= seek table entries) + __in_ecount(nBlockCount) const DWORD* pSeekTable, // Pointer to the seek table data + DWORD nDesiredSample, // Decoded sample to locate + __out DWORD* pnBlockContainingSample, // Index of the block containing the sample + __out DWORD* pnSampleOffsetWithinBlock // Position of the sample in this block +) +{ + DWORD nPreviousTotalSamples = 0; + DWORD nBlock; + DWORD nTotalSamplesSoFar; + + XMA2DEFS_ASSERT(pSeekTable); + XMA2DEFS_ASSERT(pnBlockContainingSample); + XMA2DEFS_ASSERT(pnSampleOffsetWithinBlock); + + for (nBlock = 0; nBlock < nBlockCount; ++nBlock) + { + nTotalSamplesSoFar = pSeekTable[nBlock]; + if (nTotalSamplesSoFar > nDesiredSample) + { + *pnBlockContainingSample = nBlock; + *pnSampleOffsetWithinBlock = nDesiredSample - nPreviousTotalSamples; + return S_OK; + } + nPreviousTotalSamples = nTotalSamplesSoFar; + } + + return E_FAIL; +} + + +// GetXmaFrameLengthInBits: Reads a given frame's LengthInBits field. + +__inline DWORD GetXmaFrameLengthInBits +( + __in_bcount(nBitPosition / 8 + 3) + __in const BYTE* pPacket, // Pointer to XMA packet[s] containing the frame + DWORD nBitPosition // Bit offset of the frame within this packet +) +{ + DWORD nRegion; + DWORD nBytePosition = nBitPosition / 8; + DWORD nBitOffset = nBitPosition % 8; + + if (nBitOffset < 2) // Only need to read 2 bytes (and might not be safe to read more) + { + nRegion = (DWORD)(pPacket[nBytePosition+0]) << 8 | + (DWORD)(pPacket[nBytePosition+1]); + return (nRegion >> (1 - nBitOffset)) & 0x7FFF; // Last 15 bits + } + else // Need to read 3 bytes + { + nRegion = (DWORD)(pPacket[nBytePosition+0]) << 16 | + (DWORD)(pPacket[nBytePosition+1]) << 8 | + (DWORD)(pPacket[nBytePosition+2]); + return (nRegion >> (9 - nBitOffset)) & 0x7FFF; // Last 15 bits + } +} + + +// GetXmaFrameBitPosition: Calculates the bit offset of a given frame within +// an XMA block or set of blocks. Returns 0 on failure. + +__inline DWORD GetXmaFrameBitPosition +( + __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s] + DWORD nXmaDataBytes, // Size of pXmaData in bytes + DWORD nStreamIndex, // Stream within which to seek + DWORD nDesiredFrame // Frame sought +) +{ + const BYTE* pCurrentPacket; + DWORD nPacketsExamined = 0; + DWORD nFrameCountSoFar = 0; + DWORD nFramesToSkip; + DWORD nFrameBitOffset; + + XMA2DEFS_ASSERT(pXmaData); + XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0); + + // Get the first XMA packet belonging to the desired stream, relying on the + // fact that the first packets for each stream are in consecutive order at + // the beginning of an XMA block. + + pCurrentPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET; + for (;;) + { + // If we have exceeded the size of the XMA data, return failure + if (pCurrentPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes) + { + return 0; + } + + // If the current packet contains the frame we are looking for... + if (nFrameCountSoFar + GetXmaPacketFrameCount(pCurrentPacket) > nDesiredFrame) + { + // See how many frames in this packet we need to skip to get to it + XMA2DEFS_ASSERT(nDesiredFrame >= nFrameCountSoFar); + nFramesToSkip = nDesiredFrame - nFrameCountSoFar; + + // Get the bit offset of the first frame in this packet + nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pCurrentPacket); + + // Advance nFrameBitOffset to the frame of interest + while (nFramesToSkip--) + { + nFrameBitOffset += GetXmaFrameLengthInBits(pCurrentPacket, nFrameBitOffset); + } + + // The bit offset to return is the number of bits from pXmaData to + // pCurrentPacket plus the bit offset of the frame of interest + return (DWORD)(pCurrentPacket - pXmaData) * 8 + nFrameBitOffset; + } + + // If we haven't found the right packet yet, advance our counters + ++nPacketsExamined; + nFrameCountSoFar += GetXmaPacketFrameCount(pCurrentPacket); + + // And skip to the next packet belonging to the same stream + pCurrentPacket += XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pCurrentPacket) + 1); + } +} + + +// GetLastXmaFrameBitPosition: Calculates the bit offset of the last complete +// frame in an XMA block or set of blocks. + +__inline DWORD GetLastXmaFrameBitPosition +( + __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s] + DWORD nXmaDataBytes, // Size of pXmaData in bytes + DWORD nStreamIndex // Stream within which to seek +) +{ + const BYTE* pLastPacket; + DWORD nBytesToNextPacket; + DWORD nFrameBitOffset; + DWORD nFramesInLastPacket; + + XMA2DEFS_ASSERT(pXmaData); + XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0); + XMA2DEFS_ASSERT(nXmaDataBytes >= XMA_BYTES_PER_PACKET * (nStreamIndex + 1)); + + // Get the first XMA packet belonging to the desired stream, relying on the + // fact that the first packets for each stream are in consecutive order at + // the beginning of an XMA block. + pLastPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET; + + // Search for the last packet belonging to the desired stream + for (;;) + { + nBytesToNextPacket = XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pLastPacket) + 1); + XMA2DEFS_ASSERT(nBytesToNextPacket); + if (pLastPacket + nBytesToNextPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes) + { + break; // The next packet would extend beyond the end of pXmaData + } + pLastPacket += nBytesToNextPacket; + } + + // The last packet can sometimes have no seekable frames, in which case we + // have to use the previous one + if (GetXmaPacketFrameCount(pLastPacket) == 0) + { + pLastPacket -= nBytesToNextPacket; + } + + // Found the last packet. Get the bit offset of its first frame. + nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pLastPacket); + + // Traverse frames until we reach the last one + nFramesInLastPacket = GetXmaPacketFrameCount(pLastPacket); + while (--nFramesInLastPacket) + { + nFrameBitOffset += GetXmaFrameLengthInBits(pLastPacket, nFrameBitOffset); + } + + // The bit offset to return is the number of bits from pXmaData to + // pLastPacket plus the offset of the last frame in this packet. + return (DWORD)(pLastPacket - pXmaData) * 8 + nFrameBitOffset; +} + + +// GetXmaDecodePositionForSample: Obtains the information needed to make the +// decoder generate audio starting at a given sample position relative to the +// beginning of the given XMA block: the bit offset of the appropriate frame, +// and the right subframe within that frame. This data can be passed directly +// to the XMAPlaybackSetDecodePosition function. + +__inline HRESULT GetXmaDecodePositionForSample +( + __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s] + DWORD nXmaDataBytes, // Size of pXmaData in bytes + DWORD nStreamIndex, // Stream within which to seek + DWORD nDesiredSample, // Sample sought + __out DWORD* pnBitOffset, // Returns the bit offset within pXmaData of + // the frame containing the sample sought + __out DWORD* pnSubFrame // Returns the subframe containing the sample +) +{ + DWORD nDesiredFrame = nDesiredSample / XMA_SAMPLES_PER_FRAME; + DWORD nSubFrame = (nDesiredSample % XMA_SAMPLES_PER_FRAME) / XMA_SAMPLES_PER_SUBFRAME; + DWORD nBitOffset = GetXmaFrameBitPosition(pXmaData, nXmaDataBytes, nStreamIndex, nDesiredFrame); + + XMA2DEFS_ASSERT(pnBitOffset); + XMA2DEFS_ASSERT(pnSubFrame); + + if (nBitOffset) + { + *pnBitOffset = nBitOffset; + *pnSubFrame = nSubFrame; + return S_OK; + } + else + { + return E_FAIL; + } +} + + +// GetXmaSampleRate: Obtains the legal XMA sample rate (24, 32, 44.1 or 48Khz) +// corresponding to a generic sample rate. + +__inline DWORD GetXmaSampleRate(DWORD dwGeneralRate) +{ + DWORD dwXmaRate = 48000; // Default XMA rate for all rates above 44100Hz + + if (dwGeneralRate <= 24000) dwXmaRate = 24000; + else if (dwGeneralRate <= 32000) dwXmaRate = 32000; + else if (dwGeneralRate <= 44100) dwXmaRate = 44100; + + return dwXmaRate; +} + + +// Functions to convert between WAVEFORMATEXTENSIBLE channel masks (combinations +// of the SPEAKER_xxx flags defined in audiodefs.h) and XMA channel masks (which +// are limited to eight possible speaker positions: left, right, center, low +// frequency, side left, side right, back left and back right). + +__inline DWORD GetStandardChannelMaskFromXmaMask(BYTE bXmaMask) +{ + DWORD dwStandardMask = 0; + + if (bXmaMask & XMA_SPEAKER_LEFT) dwStandardMask |= SPEAKER_FRONT_LEFT; + if (bXmaMask & XMA_SPEAKER_RIGHT) dwStandardMask |= SPEAKER_FRONT_RIGHT; + if (bXmaMask & XMA_SPEAKER_CENTER) dwStandardMask |= SPEAKER_FRONT_CENTER; + if (bXmaMask & XMA_SPEAKER_LFE) dwStandardMask |= SPEAKER_LOW_FREQUENCY; + if (bXmaMask & XMA_SPEAKER_LEFT_SURROUND) dwStandardMask |= SPEAKER_SIDE_LEFT; + if (bXmaMask & XMA_SPEAKER_RIGHT_SURROUND) dwStandardMask |= SPEAKER_SIDE_RIGHT; + if (bXmaMask & XMA_SPEAKER_LEFT_BACK) dwStandardMask |= SPEAKER_BACK_LEFT; + if (bXmaMask & XMA_SPEAKER_RIGHT_BACK) dwStandardMask |= SPEAKER_BACK_RIGHT; + + return dwStandardMask; +} + +__inline BYTE GetXmaChannelMaskFromStandardMask(DWORD dwStandardMask) +{ + BYTE bXmaMask = 0; + + if (dwStandardMask & SPEAKER_FRONT_LEFT) bXmaMask |= XMA_SPEAKER_LEFT; + if (dwStandardMask & SPEAKER_FRONT_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT; + if (dwStandardMask & SPEAKER_FRONT_CENTER) bXmaMask |= XMA_SPEAKER_CENTER; + if (dwStandardMask & SPEAKER_LOW_FREQUENCY) bXmaMask |= XMA_SPEAKER_LFE; + if (dwStandardMask & SPEAKER_SIDE_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_SURROUND; + if (dwStandardMask & SPEAKER_SIDE_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_SURROUND; + if (dwStandardMask & SPEAKER_BACK_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_BACK; + if (dwStandardMask & SPEAKER_BACK_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_BACK; + + return bXmaMask; +} + + +// LocalizeXma2Format: Modifies a XMA2WAVEFORMATEX structure in place to comply +// with the current platform's byte-ordering rules (little- or big-endian). + +__inline HRESULT LocalizeXma2Format(__inout XMA2WAVEFORMATEX* pXma2Format) +{ + #define XMASWAP2BYTES(n) ((WORD)(((n) >> 8) | (((n) & 0xff) << 8))) + #define XMASWAP4BYTES(n) ((DWORD)((n) >> 24 | (n) << 24 | ((n) & 0xff00) << 8 | ((n) & 0xff0000) >> 8)) + + if (pXma2Format->wfx.wFormatTag == WAVE_FORMAT_XMA2) + { + return S_OK; + } + else if (XMASWAP2BYTES(pXma2Format->wfx.wFormatTag) == WAVE_FORMAT_XMA2) + { + pXma2Format->wfx.wFormatTag = XMASWAP2BYTES(pXma2Format->wfx.wFormatTag); + pXma2Format->wfx.nChannels = XMASWAP2BYTES(pXma2Format->wfx.nChannels); + pXma2Format->wfx.nSamplesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nSamplesPerSec); + pXma2Format->wfx.nAvgBytesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nAvgBytesPerSec); + pXma2Format->wfx.nBlockAlign = XMASWAP2BYTES(pXma2Format->wfx.nBlockAlign); + pXma2Format->wfx.wBitsPerSample = XMASWAP2BYTES(pXma2Format->wfx.wBitsPerSample); + pXma2Format->wfx.cbSize = XMASWAP2BYTES(pXma2Format->wfx.cbSize); + pXma2Format->NumStreams = XMASWAP2BYTES(pXma2Format->NumStreams); + pXma2Format->ChannelMask = XMASWAP4BYTES(pXma2Format->ChannelMask); + pXma2Format->SamplesEncoded = XMASWAP4BYTES(pXma2Format->SamplesEncoded); + pXma2Format->BytesPerBlock = XMASWAP4BYTES(pXma2Format->BytesPerBlock); + pXma2Format->PlayBegin = XMASWAP4BYTES(pXma2Format->PlayBegin); + pXma2Format->PlayLength = XMASWAP4BYTES(pXma2Format->PlayLength); + pXma2Format->LoopBegin = XMASWAP4BYTES(pXma2Format->LoopBegin); + pXma2Format->LoopLength = XMASWAP4BYTES(pXma2Format->LoopLength); + pXma2Format->BlockCount = XMASWAP2BYTES(pXma2Format->BlockCount); + return S_OK; + } + else + { + return E_FAIL; // Not a recognizable XMA2 format + } + + #undef XMASWAP2BYTES + #undef XMASWAP4BYTES +} + + +#endif // #ifndef __XMA2DEFS_INCLUDED__ diff --git a/RenderDll/Dx9Sdk/Include/xnamath.h b/RenderDll/Dx9Sdk/Include/xnamath.h new file mode 100644 index 0000000..daaba0b --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/xnamath.h @@ -0,0 +1,2938 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xnamath.h + +Abstract: + + XNA math library for Windows and Xbox 360 +--*/ + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#ifndef __XNAMATH_H__ +#define __XNAMATH_H__ + +#ifdef __XBOXMATH_H__ +#error XNAMATH and XBOXMATH are incompatible in the same compilation module. Use one or the other. +#endif + +#define XNAMATH_VERSION 203 + +#if !defined(_XM_X64_) && !defined(_XM_X86_) +#if defined(_M_AMD64) || defined(_AMD64_) +#define _XM_X64_ +#elif defined(_M_IX86) || defined(_X86_) +#define _XM_X86_ +#endif +#endif + +#if !defined(_XM_BIGENDIAN_) && !defined(_XM_LITTLEENDIAN_) +#if defined(_XM_X64_) || defined(_XM_X86_) +#define _XM_LITTLEENDIAN_ +#elif defined(_XBOX_VER) +#define _XM_BIGENDIAN_ +#else +#error xnamath.h only supports x86, x64, or XBox 360 targets +#endif +#endif + +#if defined(_XM_X86_) || defined(_XM_X64_) +#define _XM_SSE_INTRINSICS_ +#if !defined(__cplusplus) && !defined(_XM_NO_INTRINSICS_) +#error xnamath.h only supports C compliation for Xbox 360 targets and no intrinsics cases for x86/x64 +#endif +#elif defined(_XBOX_VER) +#if !defined(__VMX128_SUPPORTED) && !defined(_XM_NO_INTRINSICS_) +#error xnamath.h requires VMX128 compiler support for XBOX 360 +#endif // !__VMX128_SUPPORTED && !_XM_NO_INTRINSICS_ +#define _XM_VMX128_INTRINSICS_ +#else +#error xnamath.h only supports x86, x64, or XBox 360 targets +#endif + + +#if defined(_XM_SSE_INTRINSICS_) +#ifndef _XM_NO_INTRINSICS_ +#include +#include +#endif +#elif defined(_XM_VMX128_INTRINSICS_) +#error This version of xnamath.h is for Windows use only +#endif + +#if defined(_XM_SSE_INTRINSICS_) +#pragma warning(push) +#pragma warning(disable:4985) +#endif +#include +#if defined(_XM_SSE_INTRINSICS_) +#pragma warning(pop) +#endif + +#include + +#if !defined(XMINLINE) +#if !defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#define XMINLINE __inline +#else +#define XMINLINE __forceinline +#endif +#endif + +#if !defined(XMFINLINE) +#define XMFINLINE __forceinline +#endif + +#if !defined(XMDEBUG) +#if defined(_DEBUG) +#define XMDEBUG +#endif +#endif // !XMDEBUG + +#if !defined(XMASSERT) +#if defined(_PREFAST_) +#define XMASSERT(Expression) __analysis_assume((Expression)) +#elif defined(XMDEBUG) // !_PREFAST_ +#define XMASSERT(Expression) ((VOID)((Expression) || (XMAssert(#Expression, __FILE__, __LINE__), 0))) +#else // !XMDEBUG +#define XMASSERT(Expression) ((VOID)0) +#endif // !XMDEBUG +#endif // !XMASSERT + +#if !defined(XM_NO_ALIGNMENT) +#define _DECLSPEC_ALIGN_16_ __declspec(align(16)) +#else +#define _DECLSPEC_ALIGN_16_ +#endif + + +#if defined(_MSC_VER) && (_MSC_VER<1500) && (_MSC_VER>=1400) +#define _XM_ISVS2005_ +#endif + +/**************************************************************************** + * + * Constant definitions + * + ****************************************************************************/ + +#define XM_PI 3.141592654f +#define XM_2PI 6.283185307f +#define XM_1DIVPI 0.318309886f +#define XM_1DIV2PI 0.159154943f +#define XM_PIDIV2 1.570796327f +#define XM_PIDIV4 0.785398163f + +#define XM_SELECT_0 0x00000000 +#define XM_SELECT_1 0xFFFFFFFF + +#define XM_PERMUTE_0X 0x00010203 +#define XM_PERMUTE_0Y 0x04050607 +#define XM_PERMUTE_0Z 0x08090A0B +#define XM_PERMUTE_0W 0x0C0D0E0F +#define XM_PERMUTE_1X 0x10111213 +#define XM_PERMUTE_1Y 0x14151617 +#define XM_PERMUTE_1Z 0x18191A1B +#define XM_PERMUTE_1W 0x1C1D1E1F + +#define XM_CRMASK_CR6 0x000000F0 +#define XM_CRMASK_CR6TRUE 0x00000080 +#define XM_CRMASK_CR6FALSE 0x00000020 +#define XM_CRMASK_CR6BOUNDS XM_CRMASK_CR6FALSE + +#define XM_CACHE_LINE_SIZE 64 + +/**************************************************************************** + * + * Macros + * + ****************************************************************************/ + +// Unit conversion + +XMFINLINE FLOAT XMConvertToRadians(FLOAT fDegrees) { return fDegrees * (XM_PI / 180.0f); } +XMFINLINE FLOAT XMConvertToDegrees(FLOAT fRadians) { return fRadians * (180.0f / XM_PI); } + +// Condition register evaluation proceeding a recording (Rc) comparison + +#define XMComparisonAllTrue(CR) (((CR) & XM_CRMASK_CR6TRUE) == XM_CRMASK_CR6TRUE) +#define XMComparisonAnyTrue(CR) (((CR) & XM_CRMASK_CR6FALSE) != XM_CRMASK_CR6FALSE) +#define XMComparisonAllFalse(CR) (((CR) & XM_CRMASK_CR6FALSE) == XM_CRMASK_CR6FALSE) +#define XMComparisonAnyFalse(CR) (((CR) & XM_CRMASK_CR6TRUE) != XM_CRMASK_CR6TRUE) +#define XMComparisonMixed(CR) (((CR) & XM_CRMASK_CR6) == 0) +#define XMComparisonAllInBounds(CR) (((CR) & XM_CRMASK_CR6BOUNDS) == XM_CRMASK_CR6BOUNDS) +#define XMComparisonAnyOutOfBounds(CR) (((CR) & XM_CRMASK_CR6BOUNDS) != XM_CRMASK_CR6BOUNDS) + + +#define XMMin(a, b) (((a) < (b)) ? (a) : (b)) +#define XMMax(a, b) (((a) > (b)) ? (a) : (b)) + +/**************************************************************************** + * + * Data types + * + ****************************************************************************/ + +#pragma warning(push) +#pragma warning(disable:4201 4365 4324) + +#if !defined (_XM_X86_) && !defined(_XM_X64_) +#pragma bitfield_order(push) +#pragma bitfield_order(lsb_to_msb) +#endif // !_XM_X86_ && !_XM_X64_ + +#if defined(_XM_NO_INTRINSICS_) && !defined(_XBOX_VER) +// The __vector4 structure is an intrinsic on Xbox but must be separately defined +// for x86/x64 +typedef struct __vector4 +{ + union + { + float vector4_f32[4]; + unsigned int vector4_u32[4]; +#ifndef XM_STRICT_VECTOR4 + struct + { + FLOAT x; + FLOAT y; + FLOAT z; + FLOAT w; + }; + FLOAT v[4]; + UINT u[4]; +#endif // !XM_STRICT_VECTOR4 + }; +} __vector4; +#endif // _XM_NO_INTRINSICS_ + +#if (defined (_XM_X86_) || defined(_XM_X64_)) && defined(_XM_NO_INTRINSICS_) +typedef UINT __vector4i[4]; +#else +typedef __declspec(align(16)) UINT __vector4i[4]; +#endif + +// Vector intrinsic: Four 32 bit floating point components aligned on a 16 byte +// boundary and mapped to hardware vector registers +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +typedef __m128 XMVECTOR; +#else +typedef __vector4 XMVECTOR; +#endif + +// Conversion types for constants +typedef _DECLSPEC_ALIGN_16_ struct XMVECTORF32 { + union { + float f[4]; + XMVECTOR v; + }; + +#if defined(__cplusplus) + inline operator XMVECTOR() const { return v; } +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const { return reinterpret_cast(&v)[0]; } + inline operator __m128d() const { return reinterpret_cast(&v)[0]; } +#endif +#endif // __cplusplus +} XMVECTORF32; + +typedef _DECLSPEC_ALIGN_16_ struct XMVECTORI32 { + union { + INT i[4]; + XMVECTOR v; + }; +#if defined(__cplusplus) + inline operator XMVECTOR() const { return v; } +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const { return reinterpret_cast(&v)[0]; } + inline operator __m128d() const { return reinterpret_cast(&v)[0]; } +#endif +#endif // __cplusplus +} XMVECTORI32; + +typedef _DECLSPEC_ALIGN_16_ struct XMVECTORU8 { + union { + BYTE u[16]; + XMVECTOR v; + }; +#if defined(__cplusplus) + inline operator XMVECTOR() const { return v; } +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const { return reinterpret_cast(&v)[0]; } + inline operator __m128d() const { return reinterpret_cast(&v)[0]; } +#endif +#endif // __cplusplus +} XMVECTORU8; + +typedef _DECLSPEC_ALIGN_16_ struct XMVECTORU32 { + union { + UINT u[4]; + XMVECTOR v; + }; +#if defined(__cplusplus) + inline operator XMVECTOR() const { return v; } +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const { return reinterpret_cast(&v)[0]; } + inline operator __m128d() const { return reinterpret_cast(&v)[0]; } +#endif +#endif // __cplusplus +} XMVECTORU32; + +// Fix-up for (1st-3rd) XMVECTOR parameters that are pass-in-register for x86 and Xbox 360, but not for other targets +#if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +typedef const XMVECTOR FXMVECTOR; +#elif defined(_XM_X86_) && !defined(_XM_NO_INTRINSICS_) +typedef const XMVECTOR FXMVECTOR; +#elif defined(__cplusplus) +typedef const XMVECTOR& FXMVECTOR; +#else +typedef const XMVECTOR FXMVECTOR; +#endif + +// Fix-up for (4th+) XMVECTOR parameters to pass in-register for Xbox 360 and by reference otherwise +#if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +typedef const XMVECTOR CXMVECTOR; +#elif defined(__cplusplus) +typedef const XMVECTOR& CXMVECTOR; +#else +typedef const XMVECTOR CXMVECTOR; +#endif + +// Vector operators +#if defined(__cplusplus) && !defined(XM_NO_OPERATOR_OVERLOADS) + +XMVECTOR operator+ (FXMVECTOR V); +XMVECTOR operator- (FXMVECTOR V); + +XMVECTOR& operator+= (XMVECTOR& V1, FXMVECTOR V2); +XMVECTOR& operator-= (XMVECTOR& V1, FXMVECTOR V2); +XMVECTOR& operator*= (XMVECTOR& V1, FXMVECTOR V2); +XMVECTOR& operator/= (XMVECTOR& V1, FXMVECTOR V2); +XMVECTOR& operator*= (XMVECTOR& V, FLOAT S); +XMVECTOR& operator/= (XMVECTOR& V, FLOAT S); + +XMVECTOR operator+ (FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR operator- (FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR operator* (FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR operator/ (FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR operator* (FXMVECTOR V, FLOAT S); +XMVECTOR operator* (FLOAT S, FXMVECTOR V); +XMVECTOR operator/ (FXMVECTOR V, FLOAT S); + +#endif // __cplusplus && !XM_NO_OPERATOR_OVERLOADS + +// Matrix type: Sixteen 32 bit floating point components aligned on a +// 16 byte boundary and mapped to four hardware vector registers +#if (defined(_XM_X86_) || defined(_XM_X64_)) && defined(_XM_NO_INTRINSICS_) +typedef struct _XMMATRIX +#else +typedef _DECLSPEC_ALIGN_16_ struct _XMMATRIX +#endif +{ + union + { + XMVECTOR r[4]; + struct + { + FLOAT _11, _12, _13, _14; + FLOAT _21, _22, _23, _24; + FLOAT _31, _32, _33, _34; + FLOAT _41, _42, _43, _44; + }; + FLOAT m[4][4]; + }; + +#ifdef __cplusplus + + _XMMATRIX() {}; + _XMMATRIX(FXMVECTOR R0, FXMVECTOR R1, FXMVECTOR R2, CXMVECTOR R3); + _XMMATRIX(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33); + _XMMATRIX(CONST FLOAT *pArray); + + FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; } + FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; } + + _XMMATRIX& operator= (CONST _XMMATRIX& M); + +#ifndef XM_NO_OPERATOR_OVERLOADS + _XMMATRIX& operator*= (CONST _XMMATRIX& M); + _XMMATRIX operator* (CONST _XMMATRIX& M) CONST; +#endif // !XM_NO_OPERATOR_OVERLOADS + +#endif // __cplusplus + +} XMMATRIX; + +// Fix-up for XMMATRIX parameters to pass in-register on Xbox 360, by reference otherwise +#if defined(_XM_VMX128_INTRINSICS_) +typedef const XMMATRIX CXMMATRIX; +#elif defined(__cplusplus) +typedef const XMMATRIX& CXMMATRIX; +#else +typedef const XMMATRIX CXMMATRIX; +#endif + +// 16 bit floating point number consisting of a sign bit, a 5 bit biased +// exponent, and a 10 bit mantissa +//typedef WORD HALF; +typedef USHORT HALF; + +// 2D Vector; 32 bit floating point components +typedef struct _XMFLOAT2 +{ + FLOAT x; + FLOAT y; + +#ifdef __cplusplus + + _XMFLOAT2() {}; + _XMFLOAT2(FLOAT _x, FLOAT _y) : x(_x), y(_y) {}; + _XMFLOAT2(CONST FLOAT *pArray); + + _XMFLOAT2& operator= (CONST _XMFLOAT2& Float2); + +#endif // __cplusplus + +} XMFLOAT2; + +// 2D Vector; 32 bit floating point components aligned on a 16 byte boundary +#ifdef __cplusplus +__declspec(align(16)) struct XMFLOAT2A : public XMFLOAT2 +{ + XMFLOAT2A() : XMFLOAT2() {}; + XMFLOAT2A(FLOAT _x, FLOAT _y) : XMFLOAT2(_x, _y) {}; + XMFLOAT2A(CONST FLOAT *pArray) : XMFLOAT2(pArray) {}; + + XMFLOAT2A& operator= (CONST XMFLOAT2A& Float2); +}; +#else +typedef __declspec(align(16)) XMFLOAT2 XMFLOAT2A; +#endif // __cplusplus + +// 2D Vector; 16 bit floating point components +typedef struct _XMHALF2 +{ + HALF x; + HALF y; + +#ifdef __cplusplus + + _XMHALF2() {}; + _XMHALF2(HALF _x, HALF _y) : x(_x), y(_y) {}; + _XMHALF2(CONST HALF *pArray); + _XMHALF2(FLOAT _x, FLOAT _y); + _XMHALF2(CONST FLOAT *pArray); + + _XMHALF2& operator= (CONST _XMHALF2& Half2); + +#endif // __cplusplus + +} XMHALF2; + +// 2D Vector; 16 bit signed normalized integer components +typedef struct _XMSHORTN2 +{ + SHORT x; + SHORT y; + +#ifdef __cplusplus + + _XMSHORTN2() {}; + _XMSHORTN2(SHORT _x, SHORT _y) : x(_x), y(_y) {}; + _XMSHORTN2(CONST SHORT *pArray); + _XMSHORTN2(FLOAT _x, FLOAT _y); + _XMSHORTN2(CONST FLOAT *pArray); + + _XMSHORTN2& operator= (CONST _XMSHORTN2& ShortN2); + +#endif // __cplusplus + +} XMSHORTN2; + +// 2D Vector; 16 bit signed integer components +typedef struct _XMSHORT2 +{ + SHORT x; + SHORT y; + +#ifdef __cplusplus + + _XMSHORT2() {}; + _XMSHORT2(SHORT _x, SHORT _y) : x(_x), y(_y) {}; + _XMSHORT2(CONST SHORT *pArray); + _XMSHORT2(FLOAT _x, FLOAT _y); + _XMSHORT2(CONST FLOAT *pArray); + + _XMSHORT2& operator= (CONST _XMSHORT2& Short2); + +#endif // __cplusplus + +} XMSHORT2; + +// 2D Vector; 16 bit unsigned normalized integer components +typedef struct _XMUSHORTN2 +{ + USHORT x; + USHORT y; + +#ifdef __cplusplus + + _XMUSHORTN2() {}; + _XMUSHORTN2(USHORT _x, USHORT _y) : x(_x), y(_y) {}; + _XMUSHORTN2(CONST USHORT *pArray); + _XMUSHORTN2(FLOAT _x, FLOAT _y); + _XMUSHORTN2(CONST FLOAT *pArray); + + _XMUSHORTN2& operator= (CONST _XMUSHORTN2& UShortN2); + +#endif // __cplusplus + +} XMUSHORTN2; + +// 2D Vector; 16 bit unsigned integer components +typedef struct _XMUSHORT2 +{ + USHORT x; + USHORT y; + +#ifdef __cplusplus + + _XMUSHORT2() {}; + _XMUSHORT2(USHORT _x, USHORT _y) : x(_x), y(_y) {}; + _XMUSHORT2(CONST USHORT *pArray); + _XMUSHORT2(FLOAT _x, FLOAT _y); + _XMUSHORT2(CONST FLOAT *pArray); + + _XMUSHORT2& operator= (CONST _XMUSHORT2& UShort2); + +#endif // __cplusplus + +} XMUSHORT2; + +// 3D Vector; 32 bit floating point components +typedef struct _XMFLOAT3 +{ + FLOAT x; + FLOAT y; + FLOAT z; + +#ifdef __cplusplus + + _XMFLOAT3() {}; + _XMFLOAT3(FLOAT _x, FLOAT _y, FLOAT _z) : x(_x), y(_y), z(_z) {}; + _XMFLOAT3(CONST FLOAT *pArray); + + _XMFLOAT3& operator= (CONST _XMFLOAT3& Float3); + +#endif // __cplusplus + +} XMFLOAT3; + +// 3D Vector; 32 bit floating point components aligned on a 16 byte boundary +#ifdef __cplusplus +__declspec(align(16)) struct XMFLOAT3A : public XMFLOAT3 +{ + XMFLOAT3A() : XMFLOAT3() {}; + XMFLOAT3A(FLOAT _x, FLOAT _y, FLOAT _z) : XMFLOAT3(_x, _y, _z) {}; + XMFLOAT3A(CONST FLOAT *pArray) : XMFLOAT3(pArray) {}; + + XMFLOAT3A& operator= (CONST XMFLOAT3A& Float3); +}; +#else +typedef __declspec(align(16)) XMFLOAT3 XMFLOAT3A; +#endif // __cplusplus + +// 3D Vector; 11-11-10 bit normalized components packed into a 32 bit integer +// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit signed, +// normalized integer for the z component and 11 bit signed, normalized +// integers for the x and y components. The z component is stored in the +// most significant bits and the x component in the least significant bits +// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0] +typedef struct _XMHENDN3 +{ + union + { + struct + { + INT x : 11; // -1023/1023 to 1023/1023 + INT y : 11; // -1023/1023 to 1023/1023 + INT z : 10; // -511/511 to 511/511 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMHENDN3() {}; + _XMHENDN3(UINT Packed) : v(Packed) {}; + _XMHENDN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMHENDN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMHENDN3& operator= (CONST _XMHENDN3& HenDN3); + _XMHENDN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMHENDN3; + +// 3D Vector; 11-11-10 bit components packed into a 32 bit integer +// The 3D Vector is packed into 32 bits as follows: a 10 bit signed, +// integer for the z component and 11 bit signed integers for the +// x and y components. The z component is stored in the +// most significant bits and the x component in the least significant bits +// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0] +typedef struct _XMHEND3 +{ + union + { + struct + { + INT x : 11; // -1023 to 1023 + INT y : 11; // -1023 to 1023 + INT z : 10; // -511 to 511 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMHEND3() {}; + _XMHEND3(UINT Packed) : v(Packed) {}; + _XMHEND3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMHEND3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMHEND3& operator= (CONST _XMHEND3& HenD3); + _XMHEND3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMHEND3; + +// 3D Vector; 11-11-10 bit normalized components packed into a 32 bit integer +// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit unsigned, +// normalized integer for the z component and 11 bit unsigned, normalized +// integers for the x and y components. The z component is stored in the +// most significant bits and the x component in the least significant bits +// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0] +typedef struct _XMUHENDN3 +{ + union + { + struct + { + UINT x : 11; // 0/2047 to 2047/2047 + UINT y : 11; // 0/2047 to 2047/2047 + UINT z : 10; // 0/1023 to 1023/1023 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUHENDN3() {}; + _XMUHENDN3(UINT Packed) : v(Packed) {}; + _XMUHENDN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMUHENDN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUHENDN3& operator= (CONST _XMUHENDN3& UHenDN3); + _XMUHENDN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUHENDN3; + +// 3D Vector; 11-11-10 bit components packed into a 32 bit integer +// The 3D Vector is packed into 32 bits as follows: a 10 bit unsigned +// integer for the z component and 11 bit unsigned integers +// for the x and y components. The z component is stored in the +// most significant bits and the x component in the least significant bits +// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0] +typedef struct _XMUHEND3 +{ + union + { + struct + { + UINT x : 11; // 0 to 2047 + UINT y : 11; // 0 to 2047 + UINT z : 10; // 0 to 1023 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUHEND3() {}; + _XMUHEND3(UINT Packed) : v(Packed) {}; + _XMUHEND3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMUHEND3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUHEND3& operator= (CONST _XMUHEND3& UHenD3); + _XMUHEND3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUHEND3; + +// 3D Vector; 10-11-11 bit normalized components packed into a 32 bit integer +// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit signed, +// normalized integer for the x component and 11 bit signed, normalized +// integers for the y and z components. The z component is stored in the +// most significant bits and the x component in the least significant bits +// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMDHENN3 +{ + union + { + struct + { + INT x : 10; // -511/511 to 511/511 + INT y : 11; // -1023/1023 to 1023/1023 + INT z : 11; // -1023/1023 to 1023/1023 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMDHENN3() {}; + _XMDHENN3(UINT Packed) : v(Packed) {}; + _XMDHENN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMDHENN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMDHENN3& operator= (CONST _XMDHENN3& DHenN3); + _XMDHENN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMDHENN3; + +// 3D Vector; 10-11-11 bit components packed into a 32 bit integer +// The 3D Vector is packed into 32 bits as follows: a 10 bit signed, +// integer for the x component and 11 bit signed integers for the +// y and z components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMDHEN3 +{ + union + { + struct + { + INT x : 10; // -511 to 511 + INT y : 11; // -1023 to 1023 + INT z : 11; // -1023 to 1023 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMDHEN3() {}; + _XMDHEN3(UINT Packed) : v(Packed) {}; + _XMDHEN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMDHEN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMDHEN3& operator= (CONST _XMDHEN3& DHen3); + _XMDHEN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMDHEN3; + +// 3D Vector; 10-11-11 bit normalized components packed into a 32 bit integer +// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit unsigned, +// normalized integer for the x component and 11 bit unsigned, normalized +// integers for the y and z components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMUDHENN3 +{ + union + { + struct + { + UINT x : 10; // 0/1023 to 1023/1023 + UINT y : 11; // 0/2047 to 2047/2047 + UINT z : 11; // 0/2047 to 2047/2047 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUDHENN3() {}; + _XMUDHENN3(UINT Packed) : v(Packed) {}; + _XMUDHENN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMUDHENN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUDHENN3& operator= (CONST _XMUDHENN3& UDHenN3); + _XMUDHENN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUDHENN3; + +// 3D Vector; 10-11-11 bit components packed into a 32 bit integer +// The 3D Vector is packed into 32 bits as follows: a 10 bit unsigned, +// integer for the x component and 11 bit unsigned integers +// for the y and z components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMUDHEN3 +{ + union + { + struct + { + UINT x : 10; // 0 to 1023 + UINT y : 11; // 0 to 2047 + UINT z : 11; // 0 to 2047 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUDHEN3() {}; + _XMUDHEN3(UINT Packed) : v(Packed) {}; + _XMUDHEN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMUDHEN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUDHEN3& operator= (CONST _XMUDHEN3& UDHen3); + _XMUDHEN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUDHEN3; + +// 3D vector: 5/6/5 unsigned integer components +typedef struct _XMU565 +{ + union + { + struct + { + USHORT x : 5; + USHORT y : 6; + USHORT z : 5; + }; + USHORT v; + }; + +#ifdef __cplusplus + + _XMU565() {}; + _XMU565(USHORT Packed) : v(Packed) {}; + _XMU565(CHAR _x, CHAR _y, CHAR _z) : x(_x), y(_y), z(_z) {}; + _XMU565(CONST CHAR *pArray); + _XMU565(FLOAT _x, FLOAT _y, FLOAT _z); + _XMU565(CONST FLOAT *pArray); + + operator USHORT () { return v; } + + _XMU565& operator= (CONST _XMU565& U565); + _XMU565& operator= (CONST USHORT Packed); + +#endif // __cplusplus + +} XMU565; + +// 3D vector: 11/11/10 floating-point components +// The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent +// and 6-bit mantissa for x component, a 5-bit biased exponent and +// 6-bit mantissa for y component, a 5-bit biased exponent and a 5-bit +// mantissa for z. The z component is stored in the most significant bits +// and the x component in the least significant bits. No sign bits so +// all partial-precision numbers are positive. +// (Z10Y11X11): [32] ZZZZZzzz zzzYYYYY yyyyyyXX XXXxxxxx [0] +typedef struct _XMFLOAT3PK +{ + union + { + struct + { + UINT xm : 6; + UINT xe : 5; + UINT ym : 6; + UINT ye : 5; + UINT zm : 5; + UINT ze : 5; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMFLOAT3PK() {}; + _XMFLOAT3PK(UINT Packed) : v(Packed) {}; + _XMFLOAT3PK(FLOAT _x, FLOAT _y, FLOAT _z); + _XMFLOAT3PK(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMFLOAT3PK& operator= (CONST _XMFLOAT3PK& float3pk); + _XMFLOAT3PK& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMFLOAT3PK; + +// 3D vector: 9/9/9 floating-point components with shared 5-bit exponent +// The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent +// with 9-bit mantissa for the x, y, and z component. The shared exponent +// is stored in the most significant bits and the x component mantissa is in +// the least significant bits. No sign bits so all partial-precision numbers +// are positive. +// (E5Z9Y9X9): [32] EEEEEzzz zzzzzzyy yyyyyyyx xxxxxxxx [0] +typedef struct _XMFLOAT3SE +{ + union + { + struct + { + UINT xm : 9; + UINT ym : 9; + UINT zm : 9; + UINT e : 5; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMFLOAT3SE() {}; + _XMFLOAT3SE(UINT Packed) : v(Packed) {}; + _XMFLOAT3SE(FLOAT _x, FLOAT _y, FLOAT _z); + _XMFLOAT3SE(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMFLOAT3SE& operator= (CONST _XMFLOAT3SE& float3se); + _XMFLOAT3SE& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMFLOAT3SE; + +// 4D Vector; 32 bit floating point components +typedef struct _XMFLOAT4 +{ + FLOAT x; + FLOAT y; + FLOAT z; + FLOAT w; + +#ifdef __cplusplus + + _XMFLOAT4() {}; + _XMFLOAT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMFLOAT4(CONST FLOAT *pArray); + + _XMFLOAT4& operator= (CONST _XMFLOAT4& Float4); + +#endif // __cplusplus + +} XMFLOAT4; + +// 4D Vector; 32 bit floating point components aligned on a 16 byte boundary +#ifdef __cplusplus +__declspec(align(16)) struct XMFLOAT4A : public XMFLOAT4 +{ + XMFLOAT4A() : XMFLOAT4() {}; + XMFLOAT4A(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w) : XMFLOAT4(_x, _y, _z, _w) {}; + XMFLOAT4A(CONST FLOAT *pArray) : XMFLOAT4(pArray) {}; + + XMFLOAT4A& operator= (CONST XMFLOAT4A& Float4); +}; +#else +typedef __declspec(align(16)) XMFLOAT4 XMFLOAT4A; +#endif // __cplusplus + +// 4D Vector; 16 bit floating point components +typedef struct _XMHALF4 +{ + HALF x; + HALF y; + HALF z; + HALF w; + +#ifdef __cplusplus + + _XMHALF4() {}; + _XMHALF4(HALF _x, HALF _y, HALF _z, HALF _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMHALF4(CONST HALF *pArray); + _XMHALF4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMHALF4(CONST FLOAT *pArray); + + _XMHALF4& operator= (CONST _XMHALF4& Half4); + +#endif // __cplusplus + +} XMHALF4; + +// 4D Vector; 16 bit signed normalized integer components +typedef struct _XMSHORTN4 +{ + SHORT x; + SHORT y; + SHORT z; + SHORT w; + +#ifdef __cplusplus + + _XMSHORTN4() {}; + _XMSHORTN4(SHORT _x, SHORT _y, SHORT _z, SHORT _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMSHORTN4(CONST SHORT *pArray); + _XMSHORTN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMSHORTN4(CONST FLOAT *pArray); + + _XMSHORTN4& operator= (CONST _XMSHORTN4& ShortN4); + +#endif // __cplusplus + +} XMSHORTN4; + +// 4D Vector; 16 bit signed integer components +typedef struct _XMSHORT4 +{ + SHORT x; + SHORT y; + SHORT z; + SHORT w; + +#ifdef __cplusplus + + _XMSHORT4() {}; + _XMSHORT4(SHORT _x, SHORT _y, SHORT _z, SHORT _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMSHORT4(CONST SHORT *pArray); + _XMSHORT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMSHORT4(CONST FLOAT *pArray); + + _XMSHORT4& operator= (CONST _XMSHORT4& Short4); + +#endif // __cplusplus + +} XMSHORT4; + +// 4D Vector; 16 bit unsigned normalized integer components +typedef struct _XMUSHORTN4 +{ + USHORT x; + USHORT y; + USHORT z; + USHORT w; + +#ifdef __cplusplus + + _XMUSHORTN4() {}; + _XMUSHORTN4(USHORT _x, USHORT _y, USHORT _z, USHORT _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMUSHORTN4(CONST USHORT *pArray); + _XMUSHORTN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUSHORTN4(CONST FLOAT *pArray); + + _XMUSHORTN4& operator= (CONST _XMUSHORTN4& UShortN4); + +#endif // __cplusplus + +} XMUSHORTN4; + +// 4D Vector; 16 bit unsigned integer components +typedef struct _XMUSHORT4 +{ + USHORT x; + USHORT y; + USHORT z; + USHORT w; + +#ifdef __cplusplus + + _XMUSHORT4() {}; + _XMUSHORT4(USHORT _x, USHORT _y, USHORT _z, USHORT _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMUSHORT4(CONST USHORT *pArray); + _XMUSHORT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUSHORT4(CONST FLOAT *pArray); + + _XMUSHORT4& operator= (CONST _XMUSHORT4& UShort4); + +#endif // __cplusplus + +} XMUSHORT4; + +// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, +// normalized integer for the w component and 10 bit signed, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMXDECN4 +{ + union + { + struct + { + INT x : 10; // -511/511 to 511/511 + INT y : 10; // -511/511 to 511/511 + INT z : 10; // -511/511 to 511/511 + UINT w : 2; // 0/3 to 3/3 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMXDECN4() {}; + _XMXDECN4(UINT Packed) : v(Packed) {}; + _XMXDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMXDECN4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMXDECN4& operator= (CONST _XMXDECN4& XDecN4); + _XMXDECN4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMXDECN4; + +// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned +// integer for the w component and 10 bit signed integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMXDEC4 +{ + union + { + struct + { + INT x : 10; // -511 to 511 + INT y : 10; // -511 to 511 + INT z : 10; // -511 to 511 + UINT w : 2; // 0 to 3 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMXDEC4() {}; + _XMXDEC4(UINT Packed) : v(Packed) {}; + _XMXDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMXDEC4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMXDEC4& operator= (CONST _XMXDEC4& XDec4); + _XMXDEC4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMXDEC4; + +// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit signed, +// normalized integer for the w component and 10 bit signed, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMDECN4 +{ + union + { + struct + { + INT x : 10; // -511/511 to 511/511 + INT y : 10; // -511/511 to 511/511 + INT z : 10; // -511/511 to 511/511 + INT w : 2; // -1/1 to 1/1 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMDECN4() {}; + _XMDECN4(UINT Packed) : v(Packed) {}; + _XMDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMDECN4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMDECN4& operator= (CONST _XMDECN4& DecN4); + _XMDECN4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMDECN4; + +// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer +// The 4D Vector is packed into 32 bits as follows: a 2 bit signed, +// integer for the w component and 10 bit signed integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMDEC4 +{ + union + { + struct + { + INT x : 10; // -511 to 511 + INT y : 10; // -511 to 511 + INT z : 10; // -511 to 511 + INT w : 2; // -1 to 1 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMDEC4() {}; + _XMDEC4(UINT Packed) : v(Packed) {}; + _XMDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMDEC4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMDEC4& operator= (CONST _XMDEC4& Dec4); + _XMDEC4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMDEC4; + +// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, +// normalized integer for the w component and 10 bit unsigned, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMUDECN4 +{ + union + { + struct + { + UINT x : 10; // 0/1023 to 1023/1023 + UINT y : 10; // 0/1023 to 1023/1023 + UINT z : 10; // 0/1023 to 1023/1023 + UINT w : 2; // 0/3 to 3/3 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUDECN4() {}; + _XMUDECN4(UINT Packed) : v(Packed) {}; + _XMUDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUDECN4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUDECN4& operator= (CONST _XMUDECN4& UDecN4); + _XMUDECN4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUDECN4; + +// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer +// The 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, +// integer for the w component and 10 bit unsigned integers +// for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMUDEC4 +{ + union + { + struct + { + UINT x : 10; // 0 to 1023 + UINT y : 10; // 0 to 1023 + UINT z : 10; // 0 to 1023 + UINT w : 2; // 0 to 3 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUDEC4() {}; + _XMUDEC4(UINT Packed) : v(Packed) {}; + _XMUDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUDEC4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUDEC4& operator= (CONST _XMUDEC4& UDec4); + _XMUDEC4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUDEC4; + +// 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer +// The normalized 4D Vector is packed into 64 bits as follows: a 4 bit unsigned, +// normalized integer for the w component and 20 bit signed, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMXICON4 +{ + union + { + struct + { + INT64 x : 20; // -524287/524287 to 524287/524287 + INT64 y : 20; // -524287/524287 to 524287/524287 + INT64 z : 20; // -524287/524287 to 524287/524287 + UINT64 w : 4; // 0/15 to 15/15 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMXICON4() {}; + _XMXICON4(UINT64 Packed) : v(Packed) {}; + _XMXICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMXICON4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMXICON4& operator= (CONST _XMXICON4& XIcoN4); + _XMXICON4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMXICON4; + +// 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer +// The 4D Vector is packed into 64 bits as follows: a 4 bit unsigned +// integer for the w component and 20 bit signed integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMXICO4 +{ + union + { + struct + { + INT64 x : 20; // -524287 to 524287 + INT64 y : 20; // -524287 to 524287 + INT64 z : 20; // -524287 to 524287 + UINT64 w : 4; // 0 to 15 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMXICO4() {}; + _XMXICO4(UINT64 Packed) : v(Packed) {}; + _XMXICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMXICO4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMXICO4& operator= (CONST _XMXICO4& XIco4); + _XMXICO4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMXICO4; + +// 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer +// The normalized 4D Vector is packed into 64 bits as follows: a 4 bit signed, +// normalized integer for the w component and 20 bit signed, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMICON4 +{ + union + { + struct + { + INT64 x : 20; // -524287/524287 to 524287/524287 + INT64 y : 20; // -524287/524287 to 524287/524287 + INT64 z : 20; // -524287/524287 to 524287/524287 + INT64 w : 4; // -7/7 to 7/7 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMICON4() {}; + _XMICON4(UINT64 Packed) : v(Packed) {}; + _XMICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMICON4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMICON4& operator= (CONST _XMICON4& IcoN4); + _XMICON4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMICON4; + +// 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer +// The 4D Vector is packed into 64 bits as follows: a 4 bit signed, +// integer for the w component and 20 bit signed integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMICO4 +{ + union + { + struct + { + INT64 x : 20; // -524287 to 524287 + INT64 y : 20; // -524287 to 524287 + INT64 z : 20; // -524287 to 524287 + INT64 w : 4; // -7 to 7 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMICO4() {}; + _XMICO4(UINT64 Packed) : v(Packed) {}; + _XMICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMICO4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMICO4& operator= (CONST _XMICO4& Ico4); + _XMICO4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMICO4; + +// 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer +// The normalized 4D Vector is packed into 64 bits as follows: a 4 bit unsigned, +// normalized integer for the w component and 20 bit unsigned, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMUICON4 +{ + union + { + struct + { + UINT64 x : 20; // 0/1048575 to 1048575/1048575 + UINT64 y : 20; // 0/1048575 to 1048575/1048575 + UINT64 z : 20; // 0/1048575 to 1048575/1048575 + UINT64 w : 4; // 0/15 to 15/15 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMUICON4() {}; + _XMUICON4(UINT64 Packed) : v(Packed) {}; + _XMUICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUICON4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMUICON4& operator= (CONST _XMUICON4& UIcoN4); + _XMUICON4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMUICON4; + +// 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer +// The 4D Vector is packed into 64 bits as follows: a 4 bit unsigned +// integer for the w component and 20 bit unsigned integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMUICO4 +{ + union + { + struct + { + UINT64 x : 20; // 0 to 1048575 + UINT64 y : 20; // 0 to 1048575 + UINT64 z : 20; // 0 to 1048575 + UINT64 w : 4; // 0 to 15 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMUICO4() {}; + _XMUICO4(UINT64 Packed) : v(Packed) {}; + _XMUICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUICO4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMUICO4& operator= (CONST _XMUICO4& UIco4); + _XMUICO4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMUICO4; + +// ARGB Color; 8-8-8-8 bit unsigned normalized integer components packed into +// a 32 bit integer. The normalized color is packed into 32 bits using 8 bit +// unsigned, normalized integers for the alpha, red, green, and blue components. +// The alpha component is stored in the most significant bits and the blue +// component in the least significant bits (A8R8G8B8): +// [32] aaaaaaaa rrrrrrrr gggggggg bbbbbbbb [0] +typedef struct _XMCOLOR +{ + union + { + struct + { + UINT b : 8; // Blue: 0/255 to 255/255 + UINT g : 8; // Green: 0/255 to 255/255 + UINT r : 8; // Red: 0/255 to 255/255 + UINT a : 8; // Alpha: 0/255 to 255/255 + }; + UINT c; + }; + +#ifdef __cplusplus + + _XMCOLOR() {}; + _XMCOLOR(UINT Color) : c(Color) {}; + _XMCOLOR(FLOAT _r, FLOAT _g, FLOAT _b, FLOAT _a); + _XMCOLOR(CONST FLOAT *pArray); + + operator UINT () { return c; } + + _XMCOLOR& operator= (CONST _XMCOLOR& Color); + _XMCOLOR& operator= (CONST UINT Color); + +#endif // __cplusplus + +} XMCOLOR; + +// 4D Vector; 8 bit signed normalized integer components +typedef struct _XMBYTEN4 +{ + union + { + struct + { + CHAR x; + CHAR y; + CHAR z; + CHAR w; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMBYTEN4() {}; + _XMBYTEN4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMBYTEN4(UINT Packed) : v(Packed) {}; + _XMBYTEN4(CONST CHAR *pArray); + _XMBYTEN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMBYTEN4(CONST FLOAT *pArray); + + _XMBYTEN4& operator= (CONST _XMBYTEN4& ByteN4); + +#endif // __cplusplus + +} XMBYTEN4; + +// 4D Vector; 8 bit signed integer components +typedef struct _XMBYTE4 +{ + union + { + struct + { + CHAR x; + CHAR y; + CHAR z; + CHAR w; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMBYTE4() {}; + _XMBYTE4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMBYTE4(UINT Packed) : v(Packed) {}; + _XMBYTE4(CONST CHAR *pArray); + _XMBYTE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMBYTE4(CONST FLOAT *pArray); + + _XMBYTE4& operator= (CONST _XMBYTE4& Byte4); + +#endif // __cplusplus + +} XMBYTE4; + +// 4D Vector; 8 bit unsigned normalized integer components +typedef struct _XMUBYTEN4 +{ + union + { + struct + { + BYTE x; + BYTE y; + BYTE z; + BYTE w; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUBYTEN4() {}; + _XMUBYTEN4(BYTE _x, BYTE _y, BYTE _z, BYTE _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMUBYTEN4(UINT Packed) : v(Packed) {}; + _XMUBYTEN4(CONST BYTE *pArray); + _XMUBYTEN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUBYTEN4(CONST FLOAT *pArray); + + _XMUBYTEN4& operator= (CONST _XMUBYTEN4& UByteN4); + +#endif // __cplusplus + +} XMUBYTEN4; + +// 4D Vector; 8 bit unsigned integer components +typedef struct _XMUBYTE4 +{ + union + { + struct + { + BYTE x; + BYTE y; + BYTE z; + BYTE w; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUBYTE4() {}; + _XMUBYTE4(BYTE _x, BYTE _y, BYTE _z, BYTE _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMUBYTE4(UINT Packed) : v(Packed) {}; + _XMUBYTE4(CONST BYTE *pArray); + _XMUBYTE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUBYTE4(CONST FLOAT *pArray); + + _XMUBYTE4& operator= (CONST _XMUBYTE4& UByte4); + +#endif // __cplusplus + +} XMUBYTE4; + +// 4D vector; 4 bit unsigned integer components +typedef struct _XMUNIBBLE4 +{ + union + { + struct + { + USHORT x : 4; + USHORT y : 4; + USHORT z : 4; + USHORT w : 4; + }; + USHORT v; + }; + +#ifdef __cplusplus + + _XMUNIBBLE4() {}; + _XMUNIBBLE4(USHORT Packed) : v(Packed) {}; + _XMUNIBBLE4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMUNIBBLE4(CONST CHAR *pArray); + _XMUNIBBLE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUNIBBLE4(CONST FLOAT *pArray); + + operator USHORT () { return v; } + + _XMUNIBBLE4& operator= (CONST _XMUNIBBLE4& UNibble4); + _XMUNIBBLE4& operator= (CONST USHORT Packed); + +#endif // __cplusplus + +} XMUNIBBLE4; + +// 4D vector: 5/5/5/1 unsigned integer components +typedef struct _XMU555 +{ + union + { + struct + { + USHORT x : 5; + USHORT y : 5; + USHORT z : 5; + USHORT w : 1; + }; + USHORT v; + }; + +#ifdef __cplusplus + + _XMU555() {}; + _XMU555(USHORT Packed) : v(Packed) {}; + _XMU555(CHAR _x, CHAR _y, CHAR _z, BOOL _w) : x(_x), y(_y), z(_z), w(_w ? 0x1 : 0) {}; + _XMU555(CONST CHAR *pArray, BOOL _w); + _XMU555(FLOAT _x, FLOAT _y, FLOAT _z, BOOL _w); + _XMU555(CONST FLOAT *pArray, BOOL _w); + + operator USHORT () { return v; } + + _XMU555& operator= (CONST _XMU555& U555); + _XMU555& operator= (CONST USHORT Packed); + +#endif // __cplusplus + +} XMU555; + +// 3x3 Matrix: 32 bit floating point components +typedef struct _XMFLOAT3X3 +{ + union + { + struct + { + FLOAT _11, _12, _13; + FLOAT _21, _22, _23; + FLOAT _31, _32, _33; + }; + FLOAT m[3][3]; + }; + +#ifdef __cplusplus + + _XMFLOAT3X3() {}; + _XMFLOAT3X3(FLOAT m00, FLOAT m01, FLOAT m02, + FLOAT m10, FLOAT m11, FLOAT m12, + FLOAT m20, FLOAT m21, FLOAT m22); + _XMFLOAT3X3(CONST FLOAT *pArray); + + FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; } + FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; } + + _XMFLOAT3X3& operator= (CONST _XMFLOAT3X3& Float3x3); + +#endif // __cplusplus + +} XMFLOAT3X3; + +// 4x3 Matrix: 32 bit floating point components +typedef struct _XMFLOAT4X3 +{ + union + { + struct + { + FLOAT _11, _12, _13; + FLOAT _21, _22, _23; + FLOAT _31, _32, _33; + FLOAT _41, _42, _43; + }; + FLOAT m[4][3]; + }; + +#ifdef __cplusplus + + _XMFLOAT4X3() {}; + _XMFLOAT4X3(FLOAT m00, FLOAT m01, FLOAT m02, + FLOAT m10, FLOAT m11, FLOAT m12, + FLOAT m20, FLOAT m21, FLOAT m22, + FLOAT m30, FLOAT m31, FLOAT m32); + _XMFLOAT4X3(CONST FLOAT *pArray); + + FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; } + FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; } + + _XMFLOAT4X3& operator= (CONST _XMFLOAT4X3& Float4x3); + +#endif // __cplusplus + +} XMFLOAT4X3; + +// 4x3 Matrix: 32 bit floating point components aligned on a 16 byte boundary +#ifdef __cplusplus +__declspec(align(16)) struct XMFLOAT4X3A : public XMFLOAT4X3 +{ + XMFLOAT4X3A() : XMFLOAT4X3() {}; + XMFLOAT4X3A(FLOAT m00, FLOAT m01, FLOAT m02, + FLOAT m10, FLOAT m11, FLOAT m12, + FLOAT m20, FLOAT m21, FLOAT m22, + FLOAT m30, FLOAT m31, FLOAT m32) : + XMFLOAT4X3(m00,m01,m02,m10,m11,m12,m20,m21,m22,m30,m31,m32) {}; + XMFLOAT4X3A(CONST FLOAT *pArray) : XMFLOAT4X3(pArray) {} + + FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; } + FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; } + + XMFLOAT4X3A& operator= (CONST XMFLOAT4X3A& Float4x3); +}; +#else +typedef __declspec(align(16)) XMFLOAT4X3 XMFLOAT4X3A; +#endif // __cplusplus + +// 4x4 Matrix: 32 bit floating point components +typedef struct _XMFLOAT4X4 +{ + union + { + struct + { + FLOAT _11, _12, _13, _14; + FLOAT _21, _22, _23, _24; + FLOAT _31, _32, _33, _34; + FLOAT _41, _42, _43, _44; + }; + FLOAT m[4][4]; + }; + +#ifdef __cplusplus + + _XMFLOAT4X4() {}; + _XMFLOAT4X4(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33); + _XMFLOAT4X4(CONST FLOAT *pArray); + + FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; } + FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; } + + _XMFLOAT4X4& operator= (CONST _XMFLOAT4X4& Float4x4); + +#endif // __cplusplus + +} XMFLOAT4X4; + +// 4x4 Matrix: 32 bit floating point components aligned on a 16 byte boundary +#ifdef __cplusplus +__declspec(align(16)) struct XMFLOAT4X4A : public XMFLOAT4X4 +{ + XMFLOAT4X4A() : XMFLOAT4X4() {}; + XMFLOAT4X4A(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33) + : XMFLOAT4X4(m00,m01,m02,m03,m10,m11,m12,m13,m20,m21,m22,m23,m30,m31,m32,m33) {}; + XMFLOAT4X4A(CONST FLOAT *pArray) : XMFLOAT4X4(pArray) {} + + FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; } + FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; } + + XMFLOAT4X4A& operator= (CONST XMFLOAT4X4A& Float4x4); +}; +#else +typedef __declspec(align(16)) XMFLOAT4X4 XMFLOAT4X4A; +#endif // __cplusplus + +#if !defined(_XM_X86_) && !defined(_XM_X64_) +#pragma bitfield_order(pop) +#endif // !_XM_X86_ && !_XM_X64_ + +#pragma warning(pop) + + +/**************************************************************************** + * + * Data conversion operations + * + ****************************************************************************/ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_) +#else +XMVECTOR XMConvertVectorIntToFloat(FXMVECTOR VInt, UINT DivExponent); +XMVECTOR XMConvertVectorFloatToInt(FXMVECTOR VFloat, UINT MulExponent); +XMVECTOR XMConvertVectorUIntToFloat(FXMVECTOR VUInt, UINT DivExponent); +XMVECTOR XMConvertVectorFloatToUInt(FXMVECTOR VFloat, UINT MulExponent); +#endif + +FLOAT XMConvertHalfToFloat(HALF Value); +FLOAT* XMConvertHalfToFloatStream(_Out_bytecap_x_(sizeof(FLOAT)+OutputStride*(HalfCount-1)) FLOAT* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(HALF)+InputStride*(HalfCount-1)) CONST HALF* pInputStream, + _In_ UINT InputStride, _In_ UINT HalfCount); +HALF XMConvertFloatToHalf(FLOAT Value); +HALF* XMConvertFloatToHalfStream(_Out_bytecap_x_(sizeof(HALF)+OutputStride*(FloatCount-1)) HALF* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(FLOAT)+InputStride*(FloatCount-1)) CONST FLOAT* pInputStream, + _In_ UINT InputStride, _In_ UINT FloatCount); + +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_) +#else +XMVECTOR XMVectorSetBinaryConstant(UINT C0, UINT C1, UINT C2, UINT C3); +XMVECTOR XMVectorSplatConstant(INT IntConstant, UINT DivExponent); +XMVECTOR XMVectorSplatConstantInt(INT IntConstant); +#endif + +/**************************************************************************** + * + * Load operations + * + ****************************************************************************/ + +XMVECTOR XMLoadInt(_In_ CONST UINT* pSource); +XMVECTOR XMLoadFloat(_In_ CONST FLOAT* pSource); + +XMVECTOR XMLoadInt2(_In_count_c_(2) CONST UINT* pSource); +XMVECTOR XMLoadInt2A(_In_count_c_(2) CONST UINT* PSource); +XMVECTOR XMLoadFloat2(_In_ CONST XMFLOAT2* pSource); +XMVECTOR XMLoadFloat2A(_In_ CONST XMFLOAT2A* pSource); +XMVECTOR XMLoadHalf2(_In_ CONST XMHALF2* pSource); +XMVECTOR XMLoadShortN2(_In_ CONST XMSHORTN2* pSource); +XMVECTOR XMLoadShort2(_In_ CONST XMSHORT2* pSource); +XMVECTOR XMLoadUShortN2(_In_ CONST XMUSHORTN2* pSource); +XMVECTOR XMLoadUShort2(_In_ CONST XMUSHORT2* pSource); + +XMVECTOR XMLoadInt3(_In_count_c_(3) CONST UINT* pSource); +XMVECTOR XMLoadInt3A(_In_count_c_(3) CONST UINT* pSource); +XMVECTOR XMLoadFloat3(_In_ CONST XMFLOAT3* pSource); +XMVECTOR XMLoadFloat3A(_In_ CONST XMFLOAT3A* pSource); +XMVECTOR XMLoadHenDN3(_In_ CONST XMHENDN3* pSource); +XMVECTOR XMLoadHenD3(_In_ CONST XMHEND3* pSource); +XMVECTOR XMLoadUHenDN3(_In_ CONST XMUHENDN3* pSource); +XMVECTOR XMLoadUHenD3(_In_ CONST XMUHEND3* pSource); +XMVECTOR XMLoadDHenN3(_In_ CONST XMDHENN3* pSource); +XMVECTOR XMLoadDHen3(_In_ CONST XMDHEN3* pSource); +XMVECTOR XMLoadUDHenN3(_In_ CONST XMUDHENN3* pSource); +XMVECTOR XMLoadUDHen3(_In_ CONST XMUDHEN3* pSource); +XMVECTOR XMLoadU565(_In_ CONST XMU565* pSource); +XMVECTOR XMLoadFloat3PK(_In_ CONST XMFLOAT3PK* pSource); +XMVECTOR XMLoadFloat3SE(_In_ CONST XMFLOAT3SE* pSource); + +XMVECTOR XMLoadInt4(_In_count_c_(4) CONST UINT* pSource); +XMVECTOR XMLoadInt4A(_In_count_c_(4) CONST UINT* pSource); +XMVECTOR XMLoadFloat4(_In_ CONST XMFLOAT4* pSource); +XMVECTOR XMLoadFloat4A(_In_ CONST XMFLOAT4A* pSource); +XMVECTOR XMLoadHalf4(_In_ CONST XMHALF4* pSource); +XMVECTOR XMLoadShortN4(_In_ CONST XMSHORTN4* pSource); +XMVECTOR XMLoadShort4(_In_ CONST XMSHORT4* pSource); +XMVECTOR XMLoadUShortN4(_In_ CONST XMUSHORTN4* pSource); +XMVECTOR XMLoadUShort4(_In_ CONST XMUSHORT4* pSource); +XMVECTOR XMLoadXIcoN4(_In_ CONST XMXICON4* pSource); +XMVECTOR XMLoadXIco4(_In_ CONST XMXICO4* pSource); +XMVECTOR XMLoadIcoN4(_In_ CONST XMICON4* pSource); +XMVECTOR XMLoadIco4(_In_ CONST XMICO4* pSource); +XMVECTOR XMLoadUIcoN4(_In_ CONST XMUICON4* pSource); +XMVECTOR XMLoadUIco4(_In_ CONST XMUICO4* pSource); +XMVECTOR XMLoadXDecN4(_In_ CONST XMXDECN4* pSource); +XMVECTOR XMLoadXDec4(_In_ CONST XMXDEC4* pSource); +XMVECTOR XMLoadDecN4(_In_ CONST XMDECN4* pSource); +XMVECTOR XMLoadDec4(_In_ CONST XMDEC4* pSource); +XMVECTOR XMLoadUDecN4(_In_ CONST XMUDECN4* pSource); +XMVECTOR XMLoadUDec4(_In_ CONST XMUDEC4* pSource); +XMVECTOR XMLoadByteN4(_In_ CONST XMBYTEN4* pSource); +XMVECTOR XMLoadByte4(_In_ CONST XMBYTE4* pSource); +XMVECTOR XMLoadUByteN4(_In_ CONST XMUBYTEN4* pSource); +XMVECTOR XMLoadUByte4(_In_ CONST XMUBYTE4* pSource); +XMVECTOR XMLoadUNibble4(_In_ CONST XMUNIBBLE4* pSource); +XMVECTOR XMLoadU555(_In_ CONST XMU555* pSource); +XMVECTOR XMLoadColor(_In_ CONST XMCOLOR* pSource); + +XMMATRIX XMLoadFloat3x3(_In_ CONST XMFLOAT3X3* pSource); +XMMATRIX XMLoadFloat4x3(_In_ CONST XMFLOAT4X3* pSource); +XMMATRIX XMLoadFloat4x3A(_In_ CONST XMFLOAT4X3A* pSource); +XMMATRIX XMLoadFloat4x4(_In_ CONST XMFLOAT4X4* pSource); +XMMATRIX XMLoadFloat4x4A(_In_ CONST XMFLOAT4X4A* pSource); + +/**************************************************************************** + * + * Store operations + * + ****************************************************************************/ + +VOID XMStoreInt(_Out_ UINT* pDestination, FXMVECTOR V); +VOID XMStoreFloat(_Out_ FLOAT* pDestination, FXMVECTOR V); + +VOID XMStoreInt2(_Out_cap_c_(2) UINT* pDestination, FXMVECTOR V); +VOID XMStoreInt2A(_Out_cap_c_(2) UINT* pDestination, FXMVECTOR V); +VOID XMStoreFloat2(_Out_ XMFLOAT2* pDestination, FXMVECTOR V); +VOID XMStoreFloat2A(_Out_ XMFLOAT2A* pDestination, FXMVECTOR V); +VOID XMStoreHalf2(_Out_ XMHALF2* pDestination, FXMVECTOR V); +VOID XMStoreShortN2(_Out_ XMSHORTN2* pDestination, FXMVECTOR V); +VOID XMStoreShort2(_Out_ XMSHORT2* pDestination, FXMVECTOR V); +VOID XMStoreUShortN2(_Out_ XMUSHORTN2* pDestination, FXMVECTOR V); +VOID XMStoreUShort2(_Out_ XMUSHORT2* pDestination, FXMVECTOR V); + +VOID XMStoreInt3(_Out_cap_c_(3) UINT* pDestination, FXMVECTOR V); +VOID XMStoreInt3A(_Out_cap_c_(3) UINT* pDestination, FXMVECTOR V); +VOID XMStoreFloat3(_Out_ XMFLOAT3* pDestination, FXMVECTOR V); +VOID XMStoreFloat3A(_Out_ XMFLOAT3A* pDestination, FXMVECTOR V); +VOID XMStoreHenDN3(_Out_ XMHENDN3* pDestination, FXMVECTOR V); +VOID XMStoreHenD3(_Out_ XMHEND3* pDestination, FXMVECTOR V); +VOID XMStoreUHenDN3(_Out_ XMUHENDN3* pDestination, FXMVECTOR V); +VOID XMStoreUHenD3(_Out_ XMUHEND3* pDestination, FXMVECTOR V); +VOID XMStoreDHenN3(_Out_ XMDHENN3* pDestination, FXMVECTOR V); +VOID XMStoreDHen3(_Out_ XMDHEN3* pDestination, FXMVECTOR V); +VOID XMStoreUDHenN3(_Out_ XMUDHENN3* pDestination, FXMVECTOR V); +VOID XMStoreUDHen3(_Out_ XMUDHEN3* pDestination, FXMVECTOR V); +VOID XMStoreU565(_Out_ XMU565* pDestination, FXMVECTOR V); +VOID XMStoreFloat3PK(_Out_ XMFLOAT3PK* pDestination, FXMVECTOR V); +VOID XMStoreFloat3SE(_Out_ XMFLOAT3SE* pDestination, FXMVECTOR V); + +VOID XMStoreInt4(_Out_cap_c_(4) UINT* pDestination, FXMVECTOR V); +VOID XMStoreInt4A(_Out_cap_c_(4) UINT* pDestination, FXMVECTOR V); +VOID XMStoreInt4NC(_Out_ UINT* pDestination, FXMVECTOR V); +VOID XMStoreFloat4(_Out_ XMFLOAT4* pDestination, FXMVECTOR V); +VOID XMStoreFloat4A(_Out_ XMFLOAT4A* pDestination, FXMVECTOR V); +VOID XMStoreFloat4NC(_Out_ XMFLOAT4* pDestination, FXMVECTOR V); +VOID XMStoreHalf4(_Out_ XMHALF4* pDestination, FXMVECTOR V); +VOID XMStoreShortN4(_Out_ XMSHORTN4* pDestination, FXMVECTOR V); +VOID XMStoreShort4(_Out_ XMSHORT4* pDestination, FXMVECTOR V); +VOID XMStoreUShortN4(_Out_ XMUSHORTN4* pDestination, FXMVECTOR V); +VOID XMStoreUShort4(_Out_ XMUSHORT4* pDestination, FXMVECTOR V); +VOID XMStoreXIcoN4(_Out_ XMXICON4* pDestination, FXMVECTOR V); +VOID XMStoreXIco4(_Out_ XMXICO4* pDestination, FXMVECTOR V); +VOID XMStoreIcoN4(_Out_ XMICON4* pDestination, FXMVECTOR V); +VOID XMStoreIco4(_Out_ XMICO4* pDestination, FXMVECTOR V); +VOID XMStoreUIcoN4(_Out_ XMUICON4* pDestination, FXMVECTOR V); +VOID XMStoreUIco4(_Out_ XMUICO4* pDestination, FXMVECTOR V); +VOID XMStoreXDecN4(_Out_ XMXDECN4* pDestination, FXMVECTOR V); +VOID XMStoreXDec4(_Out_ XMXDEC4* pDestination, FXMVECTOR V); +VOID XMStoreDecN4(_Out_ XMDECN4* pDestination, FXMVECTOR V); +VOID XMStoreDec4(_Out_ XMDEC4* pDestination, FXMVECTOR V); +VOID XMStoreUDecN4(_Out_ XMUDECN4* pDestination, FXMVECTOR V); +VOID XMStoreUDec4(_Out_ XMUDEC4* pDestination, FXMVECTOR V); +VOID XMStoreByteN4(_Out_ XMBYTEN4* pDestination, FXMVECTOR V); +VOID XMStoreByte4(_Out_ XMBYTE4* pDestination, FXMVECTOR V); +VOID XMStoreUByteN4(_Out_ XMUBYTEN4* pDestination, FXMVECTOR V); +VOID XMStoreUByte4(_Out_ XMUBYTE4* pDestination, FXMVECTOR V); +VOID XMStoreUNibble4(_Out_ XMUNIBBLE4* pDestination, FXMVECTOR V); +VOID XMStoreU555(_Out_ XMU555* pDestination, FXMVECTOR V); +VOID XMStoreColor(_Out_ XMCOLOR* pDestination, FXMVECTOR V); + +VOID XMStoreFloat3x3(_Out_ XMFLOAT3X3* pDestination, CXMMATRIX M); +VOID XMStoreFloat3x3NC(_Out_ XMFLOAT3X3* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x3(_Out_ XMFLOAT4X3* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x3A(_Out_ XMFLOAT4X3A* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x3NC(_Out_ XMFLOAT4X3* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x4(_Out_ XMFLOAT4X4* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x4A(_Out_ XMFLOAT4X4A* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x4NC(_Out_ XMFLOAT4X4* pDestination, CXMMATRIX M); + +/**************************************************************************** + * + * General vector operations + * + ****************************************************************************/ + +XMVECTOR XMVectorZero(); +XMVECTOR XMVectorSet(FLOAT x, FLOAT y, FLOAT z, FLOAT w); +XMVECTOR XMVectorSetInt(UINT x, UINT y, UINT z, UINT w); +XMVECTOR XMVectorReplicate(FLOAT Value); +XMVECTOR XMVectorReplicatePtr(_In_ CONST FLOAT *pValue); +XMVECTOR XMVectorReplicateInt(UINT Value); +XMVECTOR XMVectorReplicateIntPtr(_In_ CONST UINT *pValue); +XMVECTOR XMVectorTrueInt(); +XMVECTOR XMVectorFalseInt(); +XMVECTOR XMVectorSplatX(FXMVECTOR V); +XMVECTOR XMVectorSplatY(FXMVECTOR V); +XMVECTOR XMVectorSplatZ(FXMVECTOR V); +XMVECTOR XMVectorSplatW(FXMVECTOR V); +XMVECTOR XMVectorSplatOne(); +XMVECTOR XMVectorSplatInfinity(); +XMVECTOR XMVectorSplatQNaN(); +XMVECTOR XMVectorSplatEpsilon(); +XMVECTOR XMVectorSplatSignMask(); + +FLOAT XMVectorGetByIndex(FXMVECTOR V,UINT i); +FLOAT XMVectorGetX(FXMVECTOR V); +FLOAT XMVectorGetY(FXMVECTOR V); +FLOAT XMVectorGetZ(FXMVECTOR V); +FLOAT XMVectorGetW(FXMVECTOR V); + +VOID XMVectorGetByIndexPtr(_Out_ FLOAT *f, FXMVECTOR V, UINT i); +VOID XMVectorGetXPtr(_Out_ FLOAT *x, FXMVECTOR V); +VOID XMVectorGetYPtr(_Out_ FLOAT *y, FXMVECTOR V); +VOID XMVectorGetZPtr(_Out_ FLOAT *z, FXMVECTOR V); +VOID XMVectorGetWPtr(_Out_ FLOAT *w, FXMVECTOR V); + +UINT XMVectorGetIntByIndex(FXMVECTOR V,UINT i); +UINT XMVectorGetIntX(FXMVECTOR V); +UINT XMVectorGetIntY(FXMVECTOR V); +UINT XMVectorGetIntZ(FXMVECTOR V); +UINT XMVectorGetIntW(FXMVECTOR V); + +VOID XMVectorGetIntByIndexPtr(_Out_ UINT *x,FXMVECTOR V, UINT i); +VOID XMVectorGetIntXPtr(_Out_ UINT *x, FXMVECTOR V); +VOID XMVectorGetIntYPtr(_Out_ UINT *y, FXMVECTOR V); +VOID XMVectorGetIntZPtr(_Out_ UINT *z, FXMVECTOR V); +VOID XMVectorGetIntWPtr(_Out_ UINT *w, FXMVECTOR V); + +XMVECTOR XMVectorSetByIndex(FXMVECTOR V,FLOAT f,UINT i); +XMVECTOR XMVectorSetX(FXMVECTOR V, FLOAT x); +XMVECTOR XMVectorSetY(FXMVECTOR V, FLOAT y); +XMVECTOR XMVectorSetZ(FXMVECTOR V, FLOAT z); +XMVECTOR XMVectorSetW(FXMVECTOR V, FLOAT w); + +XMVECTOR XMVectorSetByIndexPtr(FXMVECTOR V, _In_ CONST FLOAT *f, UINT i); +XMVECTOR XMVectorSetXPtr(FXMVECTOR V, _In_ CONST FLOAT *x); +XMVECTOR XMVectorSetYPtr(FXMVECTOR V, _In_ CONST FLOAT *y); +XMVECTOR XMVectorSetZPtr(FXMVECTOR V, _In_ CONST FLOAT *z); +XMVECTOR XMVectorSetWPtr(FXMVECTOR V, _In_ CONST FLOAT *w); + +XMVECTOR XMVectorSetIntByIndex(FXMVECTOR V, UINT x,UINT i); +XMVECTOR XMVectorSetIntX(FXMVECTOR V, UINT x); +XMVECTOR XMVectorSetIntY(FXMVECTOR V, UINT y); +XMVECTOR XMVectorSetIntZ(FXMVECTOR V, UINT z); +XMVECTOR XMVectorSetIntW(FXMVECTOR V, UINT w); + +XMVECTOR XMVectorSetIntByIndexPtr(FXMVECTOR V, _In_ CONST UINT *x, UINT i); +XMVECTOR XMVectorSetIntXPtr(FXMVECTOR V, _In_ CONST UINT *x); +XMVECTOR XMVectorSetIntYPtr(FXMVECTOR V, _In_ CONST UINT *y); +XMVECTOR XMVectorSetIntZPtr(FXMVECTOR V, _In_ CONST UINT *z); +XMVECTOR XMVectorSetIntWPtr(FXMVECTOR V, _In_ CONST UINT *w); + +XMVECTOR XMVectorPermuteControl(UINT ElementIndex0, UINT ElementIndex1, UINT ElementIndex2, UINT ElementIndex3); +XMVECTOR XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Control); +XMVECTOR XMVectorSelectControl(UINT VectorIndex0, UINT VectorIndex1, UINT VectorIndex2, UINT VectorIndex3); +XMVECTOR XMVectorSelect(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Control); +XMVECTOR XMVectorMergeXY(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorMergeZW(FXMVECTOR V1, FXMVECTOR V2); + +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_) +#else +XMVECTOR XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, UINT Elements); +XMVECTOR XMVectorRotateLeft(FXMVECTOR V, UINT Elements); +XMVECTOR XMVectorRotateRight(FXMVECTOR V, UINT Elements); +XMVECTOR XMVectorSwizzle(FXMVECTOR V, UINT E0, UINT E1, UINT E2, UINT E3); +XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateElements, + UINT Select0, UINT Select1, UINT Select2, UINT Select3); +#endif + +XMVECTOR XMVectorEqual(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorEqualR(_Out_ UINT* pCR, FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorEqualInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorEqualIntR(_Out_ UINT* pCR, FXMVECTOR V, FXMVECTOR V2); +XMVECTOR XMVectorNearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon); +XMVECTOR XMVectorNotEqual(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorNotEqualInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorGreater(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorGreaterR(_Out_ UINT* pCR, FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorGreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorGreaterOrEqualR(_Out_ UINT* pCR, FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorLess(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorLessOrEqual(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorInBounds(FXMVECTOR V, FXMVECTOR Bounds); +XMVECTOR XMVectorInBoundsR(_Out_ UINT* pCR, FXMVECTOR V, FXMVECTOR Bounds); + +XMVECTOR XMVectorIsNaN(FXMVECTOR V); +XMVECTOR XMVectorIsInfinite(FXMVECTOR V); + +XMVECTOR XMVectorMin(FXMVECTOR V1,FXMVECTOR V2); +XMVECTOR XMVectorMax(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorRound(FXMVECTOR V); +XMVECTOR XMVectorTruncate(FXMVECTOR V); +XMVECTOR XMVectorFloor(FXMVECTOR V); +XMVECTOR XMVectorCeiling(FXMVECTOR V); +XMVECTOR XMVectorClamp(FXMVECTOR V, FXMVECTOR Min, FXMVECTOR Max); +XMVECTOR XMVectorSaturate(FXMVECTOR V); + +XMVECTOR XMVectorAndInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorAndCInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorOrInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorNorInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorXorInt(FXMVECTOR V1, FXMVECTOR V2); + +XMVECTOR XMVectorNegate(FXMVECTOR V); +XMVECTOR XMVectorAdd(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorAddAngles(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorSubtract(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorSubtractAngles(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorMultiply(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorMultiplyAdd(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3); +XMVECTOR XMVectorDivide(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorNegativeMultiplySubtract(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3); +XMVECTOR XMVectorScale(FXMVECTOR V, FLOAT ScaleFactor); +XMVECTOR XMVectorReciprocalEst(FXMVECTOR V); +XMVECTOR XMVectorReciprocal(FXMVECTOR V); +XMVECTOR XMVectorSqrtEst(FXMVECTOR V); +XMVECTOR XMVectorSqrt(FXMVECTOR V); +XMVECTOR XMVectorReciprocalSqrtEst(FXMVECTOR V); +XMVECTOR XMVectorReciprocalSqrt(FXMVECTOR V); +XMVECTOR XMVectorExpEst(FXMVECTOR V); +XMVECTOR XMVectorExp(FXMVECTOR V); +XMVECTOR XMVectorLogEst(FXMVECTOR V); +XMVECTOR XMVectorLog(FXMVECTOR V); +XMVECTOR XMVectorPowEst(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorPow(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorAbs(FXMVECTOR V); +XMVECTOR XMVectorMod(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorModAngles(FXMVECTOR Angles); +XMVECTOR XMVectorSin(FXMVECTOR V); +XMVECTOR XMVectorSinEst(FXMVECTOR V); +XMVECTOR XMVectorCos(FXMVECTOR V); +XMVECTOR XMVectorCosEst(FXMVECTOR V); +VOID XMVectorSinCos(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, FXMVECTOR V); +VOID XMVectorSinCosEst(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, FXMVECTOR V); +XMVECTOR XMVectorTan(FXMVECTOR V); +XMVECTOR XMVectorTanEst(FXMVECTOR V); +XMVECTOR XMVectorSinH(FXMVECTOR V); +XMVECTOR XMVectorSinHEst(FXMVECTOR V); +XMVECTOR XMVectorCosH(FXMVECTOR V); +XMVECTOR XMVectorCosHEst(FXMVECTOR V); +XMVECTOR XMVectorTanH(FXMVECTOR V); +XMVECTOR XMVectorTanHEst(FXMVECTOR V); +XMVECTOR XMVectorASin(FXMVECTOR V); +XMVECTOR XMVectorASinEst(FXMVECTOR V); +XMVECTOR XMVectorACos(FXMVECTOR V); +XMVECTOR XMVectorACosEst(FXMVECTOR V); +XMVECTOR XMVectorATan(FXMVECTOR V); +XMVECTOR XMVectorATanEst(FXMVECTOR V); +XMVECTOR XMVectorATan2(FXMVECTOR Y, FXMVECTOR X); +XMVECTOR XMVectorATan2Est(FXMVECTOR Y, FXMVECTOR X); +XMVECTOR XMVectorLerp(FXMVECTOR V0, FXMVECTOR V1, FLOAT t); +XMVECTOR XMVectorLerpV(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR T); +XMVECTOR XMVectorHermite(FXMVECTOR Position0, FXMVECTOR Tangent0, FXMVECTOR Position1, CXMVECTOR Tangent1, FLOAT t); +XMVECTOR XMVectorHermiteV(FXMVECTOR Position0, FXMVECTOR Tangent0, FXMVECTOR Position1, CXMVECTOR Tangent1, CXMVECTOR T); +XMVECTOR XMVectorCatmullRom(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR Position3, FLOAT t); +XMVECTOR XMVectorCatmullRomV(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR Position3, CXMVECTOR T); +XMVECTOR XMVectorBaryCentric(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, FLOAT f, FLOAT g); +XMVECTOR XMVectorBaryCentricV(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR F, CXMVECTOR G); + +/**************************************************************************** + * + * 2D vector operations + * + ****************************************************************************/ + + +BOOL XMVector2Equal(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector2EqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2EqualInt(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector2EqualIntR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon); +BOOL XMVector2NotEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2NotEqualInt(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2Greater(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector2GreaterR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector2GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2Less(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2LessOrEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2InBounds(FXMVECTOR V, FXMVECTOR Bounds); +UINT XMVector2InBoundsR(FXMVECTOR V, FXMVECTOR Bounds); + +BOOL XMVector2IsNaN(FXMVECTOR V); +BOOL XMVector2IsInfinite(FXMVECTOR V); + +XMVECTOR XMVector2Dot(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector2Cross(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector2LengthSq(FXMVECTOR V); +XMVECTOR XMVector2ReciprocalLengthEst(FXMVECTOR V); +XMVECTOR XMVector2ReciprocalLength(FXMVECTOR V); +XMVECTOR XMVector2LengthEst(FXMVECTOR V); +XMVECTOR XMVector2Length(FXMVECTOR V); +XMVECTOR XMVector2NormalizeEst(FXMVECTOR V); +XMVECTOR XMVector2Normalize(FXMVECTOR V); +XMVECTOR XMVector2ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax); +XMVECTOR XMVector2ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax); +XMVECTOR XMVector2Reflect(FXMVECTOR Incident, FXMVECTOR Normal); +XMVECTOR XMVector2Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex); +XMVECTOR XMVector2RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex); +XMVECTOR XMVector2Orthogonal(FXMVECTOR V); +XMVECTOR XMVector2AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector2AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector2AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector2LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LinePoint2, FXMVECTOR Point); +XMVECTOR XMVector2IntersectLine(FXMVECTOR Line1Point1, FXMVECTOR Line1Point2, FXMVECTOR Line2Point1, CXMVECTOR Line2Point2); +XMVECTOR XMVector2Transform(FXMVECTOR V, CXMMATRIX M); +XMFLOAT4* XMVector2TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M); +XMFLOAT4* XMVector2TransformStreamNC(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M); +XMVECTOR XMVector2TransformCoord(FXMVECTOR V, CXMMATRIX M); +XMFLOAT2* XMVector2TransformCoordStream(_Out_bytecap_x_(sizeof(XMFLOAT2)+OutputStride*(VectorCount-1)) XMFLOAT2* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M); +XMVECTOR XMVector2TransformNormal(FXMVECTOR V, CXMMATRIX M); +XMFLOAT2* XMVector2TransformNormalStream(_Out_bytecap_x_(sizeof(XMFLOAT2)+OutputStride*(VectorCount-1)) XMFLOAT2* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M); + +/**************************************************************************** + * + * 3D vector operations + * + ****************************************************************************/ + + +BOOL XMVector3Equal(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector3EqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3EqualInt(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector3EqualIntR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon); +BOOL XMVector3NotEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3NotEqualInt(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3Greater(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector3GreaterR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector3GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3Less(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3LessOrEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3InBounds(FXMVECTOR V, FXMVECTOR Bounds); +UINT XMVector3InBoundsR(FXMVECTOR V, FXMVECTOR Bounds); + +BOOL XMVector3IsNaN(FXMVECTOR V); +BOOL XMVector3IsInfinite(FXMVECTOR V); + +XMVECTOR XMVector3Dot(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector3Cross(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector3LengthSq(FXMVECTOR V); +XMVECTOR XMVector3ReciprocalLengthEst(FXMVECTOR V); +XMVECTOR XMVector3ReciprocalLength(FXMVECTOR V); +XMVECTOR XMVector3LengthEst(FXMVECTOR V); +XMVECTOR XMVector3Length(FXMVECTOR V); +XMVECTOR XMVector3NormalizeEst(FXMVECTOR V); +XMVECTOR XMVector3Normalize(FXMVECTOR V); +XMVECTOR XMVector3ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax); +XMVECTOR XMVector3ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax); +XMVECTOR XMVector3Reflect(FXMVECTOR Incident, FXMVECTOR Normal); +XMVECTOR XMVector3Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex); +XMVECTOR XMVector3RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex); +XMVECTOR XMVector3Orthogonal(FXMVECTOR V); +XMVECTOR XMVector3AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector3AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector3AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector3LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LinePoint2, FXMVECTOR Point); +VOID XMVector3ComponentsFromNormal(_Out_ XMVECTOR* pParallel, _Out_ XMVECTOR* pPerpendicular, FXMVECTOR V, FXMVECTOR Normal); +XMVECTOR XMVector3Rotate(FXMVECTOR V, FXMVECTOR RotationQuaternion); +XMVECTOR XMVector3InverseRotate(FXMVECTOR V, FXMVECTOR RotationQuaternion); +XMVECTOR XMVector3Transform(FXMVECTOR V, CXMMATRIX M); +XMFLOAT4* XMVector3TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M); +XMFLOAT4* XMVector3TransformStreamNC(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M); +XMVECTOR XMVector3TransformCoord(FXMVECTOR V, CXMMATRIX M); +XMFLOAT3* XMVector3TransformCoordStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M); +XMVECTOR XMVector3TransformNormal(FXMVECTOR V, CXMMATRIX M); +XMFLOAT3* XMVector3TransformNormalStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M); +XMVECTOR XMVector3Project(FXMVECTOR V, FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ, + CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World); +XMFLOAT3* XMVector3ProjectStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, + FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ, + CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World); +XMVECTOR XMVector3Unproject(FXMVECTOR V, FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ, + CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World); +XMFLOAT3* XMVector3UnprojectStream(_Out_bytecap_x_(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, + FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ, + CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World); + +/**************************************************************************** + * + * 4D vector operations + * + ****************************************************************************/ + +BOOL XMVector4Equal(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector4EqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4EqualInt(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector4EqualIntR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon); +BOOL XMVector4NotEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4NotEqualInt(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4Greater(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector4GreaterR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector4GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4Less(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4LessOrEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4InBounds(FXMVECTOR V, FXMVECTOR Bounds); +UINT XMVector4InBoundsR(FXMVECTOR V, FXMVECTOR Bounds); + +BOOL XMVector4IsNaN(FXMVECTOR V); +BOOL XMVector4IsInfinite(FXMVECTOR V); + +XMVECTOR XMVector4Dot(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector4Cross(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3); +XMVECTOR XMVector4LengthSq(FXMVECTOR V); +XMVECTOR XMVector4ReciprocalLengthEst(FXMVECTOR V); +XMVECTOR XMVector4ReciprocalLength(FXMVECTOR V); +XMVECTOR XMVector4LengthEst(FXMVECTOR V); +XMVECTOR XMVector4Length(FXMVECTOR V); +XMVECTOR XMVector4NormalizeEst(FXMVECTOR V); +XMVECTOR XMVector4Normalize(FXMVECTOR V); +XMVECTOR XMVector4ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax); +XMVECTOR XMVector4ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax); +XMVECTOR XMVector4Reflect(FXMVECTOR Incident, FXMVECTOR Normal); +XMVECTOR XMVector4Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex); +XMVECTOR XMVector4RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex); +XMVECTOR XMVector4Orthogonal(FXMVECTOR V); +XMVECTOR XMVector4AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector4AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector4AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector4Transform(FXMVECTOR V, CXMMATRIX M); +XMFLOAT4* XMVector4TransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT4)+InputStride*(VectorCount-1)) CONST XMFLOAT4* pInputStream, + _In_ UINT InputStride, _In_ UINT VectorCount, CXMMATRIX M); + +/**************************************************************************** + * + * Matrix operations + * + ****************************************************************************/ + +BOOL XMMatrixIsNaN(CXMMATRIX M); +BOOL XMMatrixIsInfinite(CXMMATRIX M); +BOOL XMMatrixIsIdentity(CXMMATRIX M); + +XMMATRIX XMMatrixMultiply(CXMMATRIX M1, CXMMATRIX M2); +XMMATRIX XMMatrixMultiplyTranspose(CXMMATRIX M1, CXMMATRIX M2); +XMMATRIX XMMatrixTranspose(CXMMATRIX M); +XMMATRIX XMMatrixInverse(_Out_ XMVECTOR* pDeterminant, CXMMATRIX M); +XMVECTOR XMMatrixDeterminant(CXMMATRIX M); +BOOL XMMatrixDecompose(_Out_ XMVECTOR *outScale, _Out_ XMVECTOR *outRotQuat, _Out_ XMVECTOR *outTrans, CXMMATRIX M); + +XMMATRIX XMMatrixIdentity(); +XMMATRIX XMMatrixSet(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33); +XMMATRIX XMMatrixTranslation(FLOAT OffsetX, FLOAT OffsetY, FLOAT OffsetZ); +XMMATRIX XMMatrixTranslationFromVector(FXMVECTOR Offset); +XMMATRIX XMMatrixScaling(FLOAT ScaleX, FLOAT ScaleY, FLOAT ScaleZ); +XMMATRIX XMMatrixScalingFromVector(FXMVECTOR Scale); +XMMATRIX XMMatrixRotationX(FLOAT Angle); +XMMATRIX XMMatrixRotationY(FLOAT Angle); +XMMATRIX XMMatrixRotationZ(FLOAT Angle); +XMMATRIX XMMatrixRotationRollPitchYaw(FLOAT Pitch, FLOAT Yaw, FLOAT Roll); +XMMATRIX XMMatrixRotationRollPitchYawFromVector(FXMVECTOR Angles); +XMMATRIX XMMatrixRotationNormal(FXMVECTOR NormalAxis, FLOAT Angle); +XMMATRIX XMMatrixRotationAxis(FXMVECTOR Axis, FLOAT Angle); +XMMATRIX XMMatrixRotationQuaternion(FXMVECTOR Quaternion); +XMMATRIX XMMatrixTransformation2D(FXMVECTOR ScalingOrigin, FLOAT ScalingOrientation, FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, FLOAT Rotation, CXMVECTOR Translation); +XMMATRIX XMMatrixTransformation(FXMVECTOR ScalingOrigin, FXMVECTOR ScalingOrientationQuaternion, FXMVECTOR Scaling, + CXMVECTOR RotationOrigin, CXMVECTOR RotationQuaternion, CXMVECTOR Translation); +XMMATRIX XMMatrixAffineTransformation2D(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FLOAT Rotation, FXMVECTOR Translation); +XMMATRIX XMMatrixAffineTransformation(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FXMVECTOR RotationQuaternion, CXMVECTOR Translation); +XMMATRIX XMMatrixReflect(FXMVECTOR ReflectionPlane); +XMMATRIX XMMatrixShadow(FXMVECTOR ShadowPlane, FXMVECTOR LightPosition); + +XMMATRIX XMMatrixLookAtLH(FXMVECTOR EyePosition, FXMVECTOR FocusPosition, FXMVECTOR UpDirection); +XMMATRIX XMMatrixLookAtRH(FXMVECTOR EyePosition, FXMVECTOR FocusPosition, FXMVECTOR UpDirection); +XMMATRIX XMMatrixLookToLH(FXMVECTOR EyePosition, FXMVECTOR EyeDirection, FXMVECTOR UpDirection); +XMMATRIX XMMatrixLookToRH(FXMVECTOR EyePosition, FXMVECTOR EyeDirection, FXMVECTOR UpDirection); +XMMATRIX XMMatrixPerspectiveLH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixPerspectiveRH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixPerspectiveFovLH(FLOAT FovAngleY, FLOAT AspectHByW, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixPerspectiveFovRH(FLOAT FovAngleY, FLOAT AspectHByW, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixPerspectiveOffCenterLH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixPerspectiveOffCenterRH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixOrthographicLH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixOrthographicRH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixOrthographicOffCenterLH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixOrthographicOffCenterRH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ); + +/**************************************************************************** + * + * Quaternion operations + * + ****************************************************************************/ + +BOOL XMQuaternionEqual(FXMVECTOR Q1, FXMVECTOR Q2); +BOOL XMQuaternionNotEqual(FXMVECTOR Q1, FXMVECTOR Q2); + +BOOL XMQuaternionIsNaN(FXMVECTOR Q); +BOOL XMQuaternionIsInfinite(FXMVECTOR Q); +BOOL XMQuaternionIsIdentity(FXMVECTOR Q); + +XMVECTOR XMQuaternionDot(FXMVECTOR Q1, FXMVECTOR Q2); +XMVECTOR XMQuaternionMultiply(FXMVECTOR Q1, FXMVECTOR Q2); +XMVECTOR XMQuaternionLengthSq(FXMVECTOR Q); +XMVECTOR XMQuaternionReciprocalLength(FXMVECTOR Q); +XMVECTOR XMQuaternionLength(FXMVECTOR Q); +XMVECTOR XMQuaternionNormalizeEst(FXMVECTOR Q); +XMVECTOR XMQuaternionNormalize(FXMVECTOR Q); +XMVECTOR XMQuaternionConjugate(FXMVECTOR Q); +XMVECTOR XMQuaternionInverse(FXMVECTOR Q); +XMVECTOR XMQuaternionLn(FXMVECTOR Q); +XMVECTOR XMQuaternionExp(FXMVECTOR Q); +XMVECTOR XMQuaternionSlerp(FXMVECTOR Q0, FXMVECTOR Q1, FLOAT t); +XMVECTOR XMQuaternionSlerpV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR T); +XMVECTOR XMQuaternionSquad(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3, FLOAT t); +XMVECTOR XMQuaternionSquadV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3, CXMVECTOR T); +VOID XMQuaternionSquadSetup(_Out_ XMVECTOR* pA, _Out_ XMVECTOR* pB, _Out_ XMVECTOR* pC, FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3); +XMVECTOR XMQuaternionBaryCentric(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, FLOAT f, FLOAT g); +XMVECTOR XMQuaternionBaryCentricV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR F, CXMVECTOR G); + +XMVECTOR XMQuaternionIdentity(); +XMVECTOR XMQuaternionRotationRollPitchYaw(FLOAT Pitch, FLOAT Yaw, FLOAT Roll); +XMVECTOR XMQuaternionRotationRollPitchYawFromVector(FXMVECTOR Angles); +XMVECTOR XMQuaternionRotationNormal(FXMVECTOR NormalAxis, FLOAT Angle); +XMVECTOR XMQuaternionRotationAxis(FXMVECTOR Axis, FLOAT Angle); +XMVECTOR XMQuaternionRotationMatrix(CXMMATRIX M); + +VOID XMQuaternionToAxisAngle(_Out_ XMVECTOR* pAxis, _Out_ FLOAT* pAngle, FXMVECTOR Q); + +/**************************************************************************** + * + * Plane operations + * + ****************************************************************************/ + +BOOL XMPlaneEqual(FXMVECTOR P1, FXMVECTOR P2); +BOOL XMPlaneNearEqual(FXMVECTOR P1, FXMVECTOR P2, FXMVECTOR Epsilon); +BOOL XMPlaneNotEqual(FXMVECTOR P1, FXMVECTOR P2); + +BOOL XMPlaneIsNaN(FXMVECTOR P); +BOOL XMPlaneIsInfinite(FXMVECTOR P); + +XMVECTOR XMPlaneDot(FXMVECTOR P, FXMVECTOR V); +XMVECTOR XMPlaneDotCoord(FXMVECTOR P, FXMVECTOR V); +XMVECTOR XMPlaneDotNormal(FXMVECTOR P, FXMVECTOR V); +XMVECTOR XMPlaneNormalizeEst(FXMVECTOR P); +XMVECTOR XMPlaneNormalize(FXMVECTOR P); +XMVECTOR XMPlaneIntersectLine(FXMVECTOR P, FXMVECTOR LinePoint1, FXMVECTOR LinePoint2); +VOID XMPlaneIntersectPlane(_Out_ XMVECTOR* pLinePoint1, _Out_ XMVECTOR* pLinePoint2, FXMVECTOR P1, FXMVECTOR P2); +XMVECTOR XMPlaneTransform(FXMVECTOR P, CXMMATRIX M); +XMFLOAT4* XMPlaneTransformStream(_Out_bytecap_x_(sizeof(XMFLOAT4)+OutputStride*(PlaneCount-1)) XMFLOAT4* pOutputStream, + _In_ UINT OutputStride, + _In_bytecount_x_(sizeof(XMFLOAT4)+InputStride*(PlaneCount-1)) CONST XMFLOAT4* pInputStream, + _In_ UINT InputStride, _In_ UINT PlaneCount, CXMMATRIX M); + +XMVECTOR XMPlaneFromPointNormal(FXMVECTOR Point, FXMVECTOR Normal); +XMVECTOR XMPlaneFromPoints(FXMVECTOR Point1, FXMVECTOR Point2, FXMVECTOR Point3); + +/**************************************************************************** + * + * Color operations + * + ****************************************************************************/ + +BOOL XMColorEqual(FXMVECTOR C1, FXMVECTOR C2); +BOOL XMColorNotEqual(FXMVECTOR C1, FXMVECTOR C2); +BOOL XMColorGreater(FXMVECTOR C1, FXMVECTOR C2); +BOOL XMColorGreaterOrEqual(FXMVECTOR C1, FXMVECTOR C2); +BOOL XMColorLess(FXMVECTOR C1, FXMVECTOR C2); +BOOL XMColorLessOrEqual(FXMVECTOR C1, FXMVECTOR C2); + +BOOL XMColorIsNaN(FXMVECTOR C); +BOOL XMColorIsInfinite(FXMVECTOR C); + +XMVECTOR XMColorNegative(FXMVECTOR C); +XMVECTOR XMColorModulate(FXMVECTOR C1, FXMVECTOR C2); +XMVECTOR XMColorAdjustSaturation(FXMVECTOR C, FLOAT Saturation); +XMVECTOR XMColorAdjustContrast(FXMVECTOR C, FLOAT Contrast); + +/**************************************************************************** + * + * Miscellaneous operations + * + ****************************************************************************/ + +BOOL XMVerifyCPUSupport(); + +VOID XMAssert(_In_z_ CONST CHAR* pExpression, _In_z_ CONST CHAR* pFileName, UINT LineNumber); + +XMVECTOR XMFresnelTerm(FXMVECTOR CosIncidentAngle, FXMVECTOR RefractionIndex); + +BOOL XMScalarNearEqual(FLOAT S1, FLOAT S2, FLOAT Epsilon); +FLOAT XMScalarModAngle(FLOAT Value); +FLOAT XMScalarSin(FLOAT Value); +FLOAT XMScalarCos(FLOAT Value); +VOID XMScalarSinCos(_Out_ FLOAT* pSin, _Out_ FLOAT* pCos, FLOAT Value); +FLOAT XMScalarASin(FLOAT Value); +FLOAT XMScalarACos(FLOAT Value); +FLOAT XMScalarSinEst(FLOAT Value); +FLOAT XMScalarCosEst(FLOAT Value); +VOID XMScalarSinCosEst(_Out_ FLOAT* pSin, _Out_ FLOAT* pCos, FLOAT Value); +FLOAT XMScalarASinEst(FLOAT Value); +FLOAT XMScalarACosEst(FLOAT Value); + +/**************************************************************************** + * + * Globals + * + ****************************************************************************/ + +// The purpose of the following global constants is to prevent redundant +// reloading of the constants when they are referenced by more than one +// separate inline math routine called within the same function. Declaring +// a constant locally within a routine is sufficient to prevent redundant +// reloads of that constant when that single routine is called multiple +// times in a function, but if the constant is used (and declared) in a +// separate math routine it would be reloaded. + +#define XMGLOBALCONST extern CONST __declspec(selectany) + +XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients0 = {1.0f, -0.166666667f, 8.333333333e-3f, -1.984126984e-4f}; +XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients1 = {2.755731922e-6f, -2.505210839e-8f, 1.605904384e-10f, -7.647163732e-13f}; +XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients2 = {2.811457254e-15f, -8.220635247e-18f, 1.957294106e-20f, -3.868170171e-23f}; +XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients0 = {1.0f, -0.5f, 4.166666667e-2f, -1.388888889e-3f}; +XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients1 = {2.480158730e-5f, -2.755731922e-7f, 2.087675699e-9f, -1.147074560e-11f}; +XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients2 = {4.779477332e-14f, -1.561920697e-16f, 4.110317623e-19f, -8.896791392e-22f}; +XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients0 = {1.0f, 0.333333333f, 0.133333333f, 5.396825397e-2f}; +XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients1 = {2.186948854e-2f, 8.863235530e-3f, 3.592128167e-3f, 1.455834485e-3f}; +XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients2 = {5.900274264e-4f, 2.391290764e-4f, 9.691537707e-5f, 3.927832950e-5f}; +XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients0 = {-0.05806367563904f, -0.41861972469416f, 0.22480114791621f, 2.17337241360606f}; +XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients1 = {0.61657275907170f, 4.29696498283455f, -1.18942822255452f, -6.53784832094831f}; +XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients2 = {-1.36926553863413f, -4.48179294237210f, 1.41810672941833f, 5.48179257935713f}; +XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients0 = {1.0f, 0.333333334f, 0.2f, 0.142857143f}; +XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients1 = {1.111111111e-1f, 9.090909091e-2f, 7.692307692e-2f, 6.666666667e-2f}; +XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients2 = {5.882352941e-2f, 5.263157895e-2f, 4.761904762e-2f, 4.347826087e-2f}; +XMGLOBALCONST XMVECTORF32 g_XMSinEstCoefficients = {1.0f, -1.66521856991541e-1f, 8.199913018755e-3f, -1.61475937228e-4f}; +XMGLOBALCONST XMVECTORF32 g_XMCosEstCoefficients = {1.0f, -4.95348008918096e-1f, 3.878259962881e-2f, -9.24587976263e-4f}; +XMGLOBALCONST XMVECTORF32 g_XMTanEstCoefficients = {2.484f, -1.954923183e-1f, 2.467401101f, XM_1DIVPI}; +XMGLOBALCONST XMVECTORF32 g_XMATanEstCoefficients = {7.689891418951e-1f, 1.104742493348f, 8.661844266006e-1f, XM_PIDIV2}; +XMGLOBALCONST XMVECTORF32 g_XMASinEstCoefficients = {-1.36178272886711f, 2.37949493464538f, -8.08228565650486e-1f, 2.78440142746736e-1f}; +XMGLOBALCONST XMVECTORF32 g_XMASinEstConstants = {1.00000011921f, XM_PIDIV2, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMPiConstants0 = {XM_PI, XM_2PI, XM_1DIVPI, XM_1DIV2PI}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR0 = {1.0f, 0.0f, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR1 = {0.0f, 1.0f, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR2 = {0.0f, 0.0f, 1.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR3 = {0.0f, 0.0f, 0.0f, 1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR0 = {-1.0f,0.0f, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR1 = {0.0f,-1.0f, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR2 = {0.0f, 0.0f,-1.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR3 = {0.0f, 0.0f, 0.0f,-1.0f}; +XMGLOBALCONST XMVECTORI32 g_XMNegativeZero = {0x80000000, 0x80000000, 0x80000000, 0x80000000}; +XMGLOBALCONST XMVECTORI32 g_XMNegate3 = {0x80000000, 0x80000000, 0x80000000, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMMask3 = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMMaskX = {0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMMaskY = {0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMMaskZ = {0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMMaskW = {0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF}; +XMGLOBALCONST XMVECTORF32 g_XMOne = { 1.0f, 1.0f, 1.0f, 1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMOne3 = { 1.0f, 1.0f, 1.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMZero = { 0.0f, 0.0f, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegativeOne = {-1.0f,-1.0f,-1.0f,-1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMOneHalf = { 0.5f, 0.5f, 0.5f, 0.5f}; +XMGLOBALCONST XMVECTORF32 g_XMNegativeOneHalf = {-0.5f,-0.5f,-0.5f,-0.5f}; +XMGLOBALCONST XMVECTORF32 g_XMNegativeTwoPi = {-XM_2PI, -XM_2PI, -XM_2PI, -XM_2PI}; +XMGLOBALCONST XMVECTORF32 g_XMNegativePi = {-XM_PI, -XM_PI, -XM_PI, -XM_PI}; +XMGLOBALCONST XMVECTORF32 g_XMHalfPi = {XM_PIDIV2, XM_PIDIV2, XM_PIDIV2, XM_PIDIV2}; +XMGLOBALCONST XMVECTORF32 g_XMPi = {XM_PI, XM_PI, XM_PI, XM_PI}; +XMGLOBALCONST XMVECTORF32 g_XMReciprocalPi = {XM_1DIVPI, XM_1DIVPI, XM_1DIVPI, XM_1DIVPI}; +XMGLOBALCONST XMVECTORF32 g_XMTwoPi = {XM_2PI, XM_2PI, XM_2PI, XM_2PI}; +XMGLOBALCONST XMVECTORF32 g_XMReciprocalTwoPi = {XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI}; +XMGLOBALCONST XMVECTORF32 g_XMEpsilon = {1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f}; +XMGLOBALCONST XMVECTORI32 g_XMInfinity = {0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000}; +XMGLOBALCONST XMVECTORI32 g_XMQNaN = {0x7FC00000, 0x7FC00000, 0x7FC00000, 0x7FC00000}; +XMGLOBALCONST XMVECTORI32 g_XMQNaNTest = {0x007FFFFF, 0x007FFFFF, 0x007FFFFF, 0x007FFFFF}; +XMGLOBALCONST XMVECTORI32 g_XMAbsMask = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF}; +XMGLOBALCONST XMVECTORI32 g_XMFltMin = {0x00800000, 0x00800000, 0x00800000, 0x00800000}; +XMGLOBALCONST XMVECTORI32 g_XMFltMax = {0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF}; +XMGLOBALCONST XMVECTORI32 g_XMNegOneMask = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}; +XMGLOBALCONST XMVECTORI32 g_XMMaskA8R8G8B8 = {0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipA8R8G8B8 = {0x00000000, 0x00000000, 0x00000000, 0x80000000}; +XMGLOBALCONST XMVECTORF32 g_XMFixAA8R8G8B8 = {0.0f,0.0f,0.0f,(float)(0x80000000U)}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeA8R8G8B8 = {1.0f/(255.0f*(float)(0x10000)),1.0f/(255.0f*(float)(0x100)),1.0f/255.0f,1.0f/(255.0f*(float)(0x1000000))}; +XMGLOBALCONST XMVECTORI32 g_XMMaskA2B10G10R10 = {0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipA2B10G10R10 = {0x00000200, 0x00080000, 0x20000000, 0x80000000}; +XMGLOBALCONST XMVECTORF32 g_XMFixAA2B10G10R10 = {-512.0f,-512.0f*(float)(0x400),-512.0f*(float)(0x100000),(float)(0x80000000U)}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeA2B10G10R10 = {1.0f/511.0f,1.0f/(511.0f*(float)(0x400)),1.0f/(511.0f*(float)(0x100000)),1.0f/(3.0f*(float)(0x40000000))}; +XMGLOBALCONST XMVECTORI32 g_XMMaskX16Y16 = {0x0000FFFF, 0xFFFF0000, 0x00000000, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16 = {0x00008000, 0x00000000, 0x00000000, 0x00000000}; +XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16 = {-32768.0f,0.0f,0.0f,0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16 = {1.0f/32767.0f,1.0f/(32767.0f*65536.0f),0.0f,0.0f}; +XMGLOBALCONST XMVECTORI32 g_XMMaskX16Y16Z16W16 = {0x0000FFFF, 0x0000FFFF, 0xFFFF0000, 0xFFFF0000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16Z16W16 = {0x00008000, 0x00008000, 0x00000000, 0x00000000}; +XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16Z16W16 = {-32768.0f,-32768.0f,0.0f,0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16Z16W16 = {1.0f/32767.0f,1.0f/32767.0f,1.0f/(32767.0f*65536.0f),1.0f/(32767.0f*65536.0f)}; +XMGLOBALCONST XMVECTORF32 g_XMNoFraction = {8388608.0f,8388608.0f,8388608.0f,8388608.0f}; +XMGLOBALCONST XMVECTORI32 g_XMMaskByte = {0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF}; +XMGLOBALCONST XMVECTORF32 g_XMNegateX = {-1.0f, 1.0f, 1.0f, 1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegateY = { 1.0f,-1.0f, 1.0f, 1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegateZ = { 1.0f, 1.0f,-1.0f, 1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegateW = { 1.0f, 1.0f, 1.0f,-1.0f}; +XMGLOBALCONST XMVECTORI32 g_XMSelect0101 = {XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1}; +XMGLOBALCONST XMVECTORI32 g_XMSelect1010 = {XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0}; +XMGLOBALCONST XMVECTORI32 g_XMOneHalfMinusEpsilon = { 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD}; +XMGLOBALCONST XMVECTORI32 g_XMSelect1000 = {XM_SELECT_1, XM_SELECT_0, XM_SELECT_0, XM_SELECT_0}; +XMGLOBALCONST XMVECTORI32 g_XMSelect1100 = {XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0}; +XMGLOBALCONST XMVECTORI32 g_XMSelect1110 = {XM_SELECT_1, XM_SELECT_1, XM_SELECT_1, XM_SELECT_0}; +XMGLOBALCONST XMVECTORI32 g_XMSwizzleXYXY = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0Y}; +XMGLOBALCONST XMVECTORI32 g_XMSwizzleXYZX = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X}; +XMGLOBALCONST XMVECTORI32 g_XMSwizzleYXZW = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0Z, XM_PERMUTE_0W}; +XMGLOBALCONST XMVECTORI32 g_XMSwizzleYZXW = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0W}; +XMGLOBALCONST XMVECTORI32 g_XMSwizzleZXYW = {XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W}; +XMGLOBALCONST XMVECTORI32 g_XMPermute0X0Y1X1Y = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_1Y}; +XMGLOBALCONST XMVECTORI32 g_XMPermute0Z0W1Z1W = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_1Z, XM_PERMUTE_1W}; +XMGLOBALCONST XMVECTORF32 g_XMFixupY16 = {1.0f,1.0f/65536.0f,0.0f,0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMFixupY16W16 = {1.0f,1.0f,1.0f/65536.0f,1.0f/65536.0f}; +XMGLOBALCONST XMVECTORI32 g_XMFlipY = {0,0x80000000,0,0}; +XMGLOBALCONST XMVECTORI32 g_XMFlipZ = {0,0,0x80000000,0}; +XMGLOBALCONST XMVECTORI32 g_XMFlipW = {0,0,0,0x80000000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipYZ = {0,0x80000000,0x80000000,0}; +XMGLOBALCONST XMVECTORI32 g_XMFlipZW = {0,0,0x80000000,0x80000000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipYW = {0,0x80000000,0,0x80000000}; +XMGLOBALCONST XMVECTORI32 g_XMMaskHenD3 = {0x7FF,0x7ff<<11,0x3FF<<22,0}; +XMGLOBALCONST XMVECTORI32 g_XMMaskDHen3 = {0x3FF,0x7ff<<10,0x7FF<<21,0}; +XMGLOBALCONST XMVECTORF32 g_XMAddUHenD3 = {0,0,32768.0f*65536.0f,0}; +XMGLOBALCONST XMVECTORF32 g_XMAddHenD3 = {-1024.0f,-1024.0f*2048.0f,0,0}; +XMGLOBALCONST XMVECTORF32 g_XMAddDHen3 = {-512.0f,-1024.0f*1024.0f,0,0}; +XMGLOBALCONST XMVECTORF32 g_XMMulHenD3 = {1.0f,1.0f/2048.0f,1.0f/(2048.0f*2048.0f),0}; +XMGLOBALCONST XMVECTORF32 g_XMMulDHen3 = {1.0f,1.0f/1024.0f,1.0f/(1024.0f*2048.0f),0}; +XMGLOBALCONST XMVECTORI32 g_XMXorHenD3 = {0x400,0x400<<11,0,0}; +XMGLOBALCONST XMVECTORI32 g_XMXorDHen3 = {0x200,0x400<<10,0,0}; +XMGLOBALCONST XMVECTORI32 g_XMMaskIco4 = {0xFFFFF,0xFFFFF000,0xFFFFF,0xF0000000}; +XMGLOBALCONST XMVECTORI32 g_XMXorXIco4 = {0x80000,0,0x80000,0x80000000}; +XMGLOBALCONST XMVECTORI32 g_XMXorIco4 = {0x80000,0,0x80000,0}; +XMGLOBALCONST XMVECTORF32 g_XMAddXIco4 = {-8.0f*65536.0f,0,-8.0f*65536.0f,32768.0f*65536.0f}; +XMGLOBALCONST XMVECTORF32 g_XMAddUIco4 = {0,32768.0f*65536.0f,0,32768.0f*65536.0f}; +XMGLOBALCONST XMVECTORF32 g_XMAddIco4 = {-8.0f*65536.0f,0,-8.0f*65536.0f,0}; +XMGLOBALCONST XMVECTORF32 g_XMMulIco4 = {1.0f,1.0f/4096.0f,1.0f,1.0f/(4096.0f*65536.0f)}; +XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<30}; +XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = {0x200,0x200<<10,0x200<<20,0}; +XMGLOBALCONST XMVECTORF32 g_XMAddUDec4 = {0,0,0,32768.0f*65536.0f}; +XMGLOBALCONST XMVECTORF32 g_XMAddDec4 = {-512.0f,-512.0f*1024.0f,-512.0f*1024.0f*1024.0f,0}; +XMGLOBALCONST XMVECTORF32 g_XMMulDec4 = {1.0f,1.0f/1024.0f,1.0f/(1024.0f*1024.0f),1.0f/(1024.0f*1024.0f*1024.0f)}; +XMGLOBALCONST XMVECTORI32 g_XMMaskByte4 = {0xFF,0xFF00,0xFF0000,0xFF000000}; +XMGLOBALCONST XMVECTORI32 g_XMXorByte4 = {0x80,0x8000,0x800000,0x00000000}; +XMGLOBALCONST XMVECTORF32 g_XMAddByte4 = {-128.0f,-128.0f*256.0f,-128.0f*65536.0f,0}; + +/**************************************************************************** + * + * Implementation + * + ****************************************************************************/ + +#pragma warning(push) +#pragma warning(disable:4214 4204 4365 4616 6001) + +#if !defined(__cplusplus) && !defined(_XBOX) && defined(_XM_ISVS2005_) + +/* Work around VC 2005 bug where math.h defines logf with a semicolon at the end. + * Note this is fixed as of Visual Studio 2005 Service Pack 1 + */ + +#undef logf +#define logf(x) ((float)log((double)(x))) + +#endif // !defined(__cplusplus) && !defined(_XBOX) && defined(_XM_ISVS2005_) + +//------------------------------------------------------------------------------ + +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + +XMFINLINE XMVECTOR XMVectorSetBinaryConstant(UINT C0, UINT C1, UINT C2, UINT C3) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = (0-(C0&1)) & 0x3F800000; + vResult.u[1] = (0-(C1&1)) & 0x3F800000; + vResult.u[2] = (0-(C2&1)) & 0x3F800000; + vResult.u[3] = (0-(C3&1)) & 0x3F800000; + return vResult.v; +#else // XM_SSE_INTRINSICS_ + static const XMVECTORU32 g_vMask1 = {1,1,1,1}; + // Move the parms to a vector + __m128i vTemp = _mm_set_epi32(C3,C2,C1,C0); + // Mask off the low bits + vTemp = _mm_and_si128(vTemp,g_vMask1); + // 0xFFFFFFFF on true bits + vTemp = _mm_cmpeq_epi32(vTemp,g_vMask1); + // 0xFFFFFFFF -> 1.0f, 0x00000000 -> 0.0f + vTemp = _mm_and_si128(vTemp,g_XMOne); + return reinterpret_cast(&vTemp)[0]; +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSplatConstant(INT IntConstant, UINT DivExponent) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT( IntConstant >= -16 && IntConstant <= 15 ); + XMASSERT(DivExponent<32); + { + XMVECTORI32 V = { IntConstant, IntConstant, IntConstant, IntConstant }; + return XMConvertVectorIntToFloat( V.v, DivExponent); + } +#else // XM_SSE_INTRINSICS_ + XMASSERT( IntConstant >= -16 && IntConstant <= 15 ); + XMASSERT(DivExponent<32); + // Splat the int + __m128i vScale = _mm_set1_epi32(IntConstant); + // Convert to a float + XMVECTOR vResult = _mm_cvtepi32_ps(vScale); + // Convert DivExponent into 1.0f/(1<(&vScale)[0]); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSplatConstantInt(INT IntConstant) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT( IntConstant >= -16 && IntConstant <= 15 ); + { + XMVECTORI32 V = { IntConstant, IntConstant, IntConstant, IntConstant }; + return V.v; + } +#else // XM_SSE_INTRINSICS_ + XMASSERT( IntConstant >= -16 && IntConstant <= 15 ); + __m128i V = _mm_set1_epi32( IntConstant ); + return reinterpret_cast<__m128 *>(&V)[0]; +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, UINT Elements) +{ + return XMVectorPermute(V1, V2, XMVectorPermuteControl((Elements), ((Elements) + 1), ((Elements) + 2), ((Elements) + 3))); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorRotateLeft(FXMVECTOR V, UINT Elements) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT( Elements < 4 ); + { + XMVECTORF32 vResult = { V.vector4_f32[Elements & 3], V.vector4_f32[(Elements + 1) & 3], + V.vector4_f32[(Elements + 2) & 3], V.vector4_f32[(Elements + 3) & 3] }; + return vResult.v; + } +#else // XM_SSE_INTRINSICS_ + FLOAT fx = XMVectorGetByIndex(V,(Elements) & 3); + FLOAT fy = XMVectorGetByIndex(V,((Elements) + 1) & 3); + FLOAT fz = XMVectorGetByIndex(V,((Elements) + 2) & 3); + FLOAT fw = XMVectorGetByIndex(V,((Elements) + 3) & 3); + return _mm_set_ps( fw, fz, fy, fx ); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorRotateRight(FXMVECTOR V, UINT Elements) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT( Elements < 4 ); + { + XMVECTORF32 vResult = { V.vector4_f32[(4 - (Elements)) & 3], V.vector4_f32[(5 - (Elements)) & 3], + V.vector4_f32[(6 - (Elements)) & 3], V.vector4_f32[(7 - (Elements)) & 3] }; + return vResult.v; + } +#else // XM_SSE_INTRINSICS_ + FLOAT fx = XMVectorGetByIndex(V,(4 - (Elements)) & 3); + FLOAT fy = XMVectorGetByIndex(V,(5 - (Elements)) & 3); + FLOAT fz = XMVectorGetByIndex(V,(6 - (Elements)) & 3); + FLOAT fw = XMVectorGetByIndex(V,(7 - (Elements)) & 3); + return _mm_set_ps( fw, fz, fy, fx ); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSwizzle(FXMVECTOR V, UINT E0, UINT E1, UINT E2, UINT E3) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT( (E0 < 4) && (E1 < 4) && (E2 < 4) && (E3 < 4) ); + { + XMVECTORF32 vResult = { V.vector4_f32[E0], V.vector4_f32[E1], V.vector4_f32[E2], V.vector4_f32[E3] }; + return vResult.v; + } +#else // XM_SSE_INTRINSICS_ + FLOAT fx = XMVectorGetByIndex(V,E0); + FLOAT fy = XMVectorGetByIndex(V,E1); + FLOAT fz = XMVectorGetByIndex(V,E2); + FLOAT fw = XMVectorGetByIndex(V,E3); + return _mm_set_ps( fw, fz, fy, fx ); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateElements, + UINT Select0, UINT Select1, UINT Select2, UINT Select3) +{ + XMVECTOR Control = XMVectorSelectControl(Select0&1, Select1&1, Select2&1, Select3&1); + return XMVectorSelect( VD, XMVectorRotateLeft(VS, VSLeftRotateElements), Control ); +} + +// Implemented for VMX128 intrinsics as #defines aboves +#endif _XM_NO_INTRINSICS_ || _XM_SSE_INTRINSICS_ + +//------------------------------------------------------------------------------ + +#include "xnamathconvert.inl" +#include "xnamathvector.inl" +#include "xnamathmatrix.inl" +#include "xnamathmisc.inl" + +#pragma warning(pop) + +#endif // __XNAMATH_H__ + diff --git a/RenderDll/Dx9Sdk/Include/xnamathconvert.inl b/RenderDll/Dx9Sdk/Include/xnamathconvert.inl new file mode 100644 index 0000000..370d27d --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/xnamathconvert.inl @@ -0,0 +1,5785 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xnamathconvert.inl + +Abstract: + + XNA math library for Windows and Xbox 360: Conversion, loading, and storing functions. +--*/ + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#ifndef __XNAMATHCONVERT_INL__ +#define __XNAMATHCONVERT_INL__ + +#define XM_PACK_FACTOR (FLOAT)(1 << 22) +#define XM_UNPACK_FACTOR_UNSIGNED (FLOAT)(1 << 23) +#define XM_UNPACK_FACTOR_SIGNED XM_PACK_FACTOR + +#define XM_UNPACK_UNSIGNEDN_OFFSET(BitsX, BitsY, BitsZ, BitsW) \ + {-XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsX)) - 1), \ + -XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsY)) - 1), \ + -XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsZ)) - 1), \ + -XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsW)) - 1)} + +#define XM_UNPACK_UNSIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \ + {XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsX)) - 1), \ + XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsY)) - 1), \ + XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsZ)) - 1), \ + XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsW)) - 1)} + +#define XM_UNPACK_SIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \ + {-XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsX) - 1)) - 1), \ + -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsY) - 1)) - 1), \ + -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsZ) - 1)) - 1), \ + -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsW) - 1)) - 1)} + +//#define XM_UNPACK_SIGNEDN_OFFSET(BitsX, BitsY, BitsZ, BitsW) \ +// {-XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsX) - 1)) - 1) * 3.0f, \ +// -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsY) - 1)) - 1) * 3.0f, \ +// -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsZ) - 1)) - 1) * 3.0f, \ +// -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsW) - 1)) - 1) * 3.0f} + +#define XM_PACK_UNSIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \ + {-(FLOAT)((1 << (BitsX)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << (BitsY)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << (BitsZ)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << (BitsW)) - 1) / XM_PACK_FACTOR} + +#define XM_PACK_SIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \ + {-(FLOAT)((1 << ((BitsX) - 1)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << ((BitsY) - 1)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << ((BitsZ) - 1)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << ((BitsW) - 1)) - 1) / XM_PACK_FACTOR} + +#define XM_PACK_OFFSET XMVectorSplatConstant(3, 0) +//#define XM_UNPACK_OFFSET XM_PACK_OFFSET + +/**************************************************************************** + * + * Data conversion + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE FLOAT XMConvertHalfToFloat +( + HALF Value +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + + UINT Mantissa; + UINT Exponent; + UINT Result; + + Mantissa = (UINT)(Value & 0x03FF); + + if ((Value & 0x7C00) != 0) // The value is normalized + { + Exponent = (UINT)((Value >> 10) & 0x1F); + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x0400) == 0); + + Mantissa &= 0x03FF; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result = ((Value & 0x8000) << 16) | // Sign + ((Exponent + 112) << 23) | // Exponent + (Mantissa << 13); // Mantissa + + return *(FLOAT*)&Result; + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE FLOAT* XMConvertHalfToFloatStream +( + FLOAT* pOutputStream, + UINT OutputStride, + CONST HALF* pInputStream, + UINT InputStride, + UINT HalfCount +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + + UINT i; + BYTE* pHalf = (BYTE*)pInputStream; + BYTE* pFloat = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < HalfCount; i++) + { + *(FLOAT*)pFloat = XMConvertHalfToFloat(*(HALF*)pHalf); + pHalf += InputStride; + pFloat += OutputStride; + } + + return pOutputStream; + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE HALF XMConvertFloatToHalf +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + UINT Result; + + UINT IValue = ((UINT *)(&Value))[0]; + UINT Sign = (IValue & 0x80000000U) >> 16U; + IValue = IValue & 0x7FFFFFFFU; // Hack off the sign + + if (IValue > 0x47FFEFFFU) + { + // The number is too large to be represented as a half. Saturate to infinity. + Result = 0x7FFFU; + } + else + { + if (IValue < 0x38800000U) + { + // The number is too small to be represented as a normalized half. + // Convert it to a denormalized value. + UINT Shift = 113U - (IValue >> 23U); + IValue = (0x800000U | (IValue & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized half. + IValue += 0xC8000000U; + } + + Result = ((IValue + 0x0FFFU + ((IValue >> 13U) & 1U)) >> 13U)&0x7FFFU; + } + return (HALF)(Result|Sign); + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE HALF* XMConvertFloatToHalfStream +( + HALF* pOutputStream, + UINT OutputStride, + CONST FLOAT* pInputStream, + UINT InputStride, + UINT FloatCount +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + + UINT i; + BYTE* pFloat = (BYTE*)pInputStream; + BYTE* pHalf = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < FloatCount; i++) + { + *(HALF*)pHalf = XMConvertFloatToHalf(*(FLOAT*)pFloat); + pFloat += InputStride; + pHalf += OutputStride; + } + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) +// For VMX128, these routines are all defines in the main header + +#pragma warning(push) +#pragma warning(disable:4701) // Prevent warnings about 'Result' potentially being used without having been initialized + +XMINLINE XMVECTOR XMConvertVectorIntToFloat +( + FXMVECTOR VInt, + UINT DivExponent +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ElementIndex; + FLOAT fScale; + XMVECTOR Result; + XMASSERT(DivExponent<32); + fScale = 1.0f / (FLOAT)(1U << DivExponent); + ElementIndex = 0; + do { + INT iTemp = (INT)VInt.vector4_u32[ElementIndex]; + Result.vector4_f32[ElementIndex] = ((FLOAT)iTemp) * fScale; + } while (++ElementIndex<4); + return Result; +#else // _XM_SSE_INTRINSICS_ + XMASSERT(DivExponent<32); + // Convert to floats + XMVECTOR vResult = _mm_cvtepi32_ps(reinterpret_cast(&VInt)[0]); + // Convert DivExponent into 1.0f/(1<(&vScale)[0]); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMConvertVectorFloatToInt +( + FXMVECTOR VFloat, + UINT MulExponent +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ElementIndex; + XMVECTOR Result; + FLOAT fScale; + XMASSERT(MulExponent<32); + // Get the scalar factor. + fScale = (FLOAT)(1U << MulExponent); + ElementIndex = 0; + do { + INT iResult; + FLOAT fTemp = VFloat.vector4_f32[ElementIndex]*fScale; + if (fTemp <= -(65536.0f*32768.0f)) { + iResult = (-0x7FFFFFFF)-1; + } else if (fTemp > (65536.0f*32768.0f)-128.0f) { + iResult = 0x7FFFFFFF; + } else { + iResult = (INT)fTemp; + } + Result.vector4_u32[ElementIndex] = (UINT)iResult; + } while (++ElementIndex<4); + return Result; +#else // _XM_SSE_INTRINSICS_ + XMASSERT(MulExponent<32); + static const XMVECTORF32 MaxInt = {65536.0f*32768.0f-128.0f,65536.0f*32768.0f-128.0f,65536.0f*32768.0f-128.0f,65536.0f*32768.0f-128.0f}; + XMVECTOR vResult = _mm_set_ps1((FLOAT)(1U << MulExponent)); + vResult = _mm_mul_ps(vResult,VFloat); + // In case of positive overflow, detect it + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult,MaxInt); + // Float to int conversion + __m128i vResulti = _mm_cvttps_epi32(vResult); + // If there was positive overflow, set to 0x7FFFFFFF + vResult = _mm_and_ps(vOverflow,g_XMAbsMask); + vOverflow = _mm_andnot_ps(vOverflow,reinterpret_cast(&vResulti)[0]); + vOverflow = _mm_or_ps(vOverflow,vResult); + return vOverflow; +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMConvertVectorUIntToFloat +( + FXMVECTOR VUInt, + UINT DivExponent +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ElementIndex; + FLOAT fScale; + XMVECTOR Result; + XMASSERT(DivExponent<32); + fScale = 1.0f / (FLOAT)(1U << DivExponent); + ElementIndex = 0; + do { + Result.vector4_f32[ElementIndex] = (FLOAT)VUInt.vector4_u32[ElementIndex] * fScale; + } while (++ElementIndex<4); + return Result; +#else // _XM_SSE_INTRINSICS_ + XMASSERT(DivExponent<32); + static const XMVECTORF32 FixUnsigned = {32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f}; + // For the values that are higher than 0x7FFFFFFF, a fixup is needed + // Determine which ones need the fix. + XMVECTOR vMask = _mm_and_ps(VUInt,g_XMNegativeZero); + // Force all values positive + XMVECTOR vResult = _mm_xor_ps(VUInt,vMask); + // Convert to floats + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert 0x80000000 -> 0xFFFFFFFF + __m128i iMask = _mm_srai_epi32(reinterpret_cast(&vMask)[0],31); + // For only the ones that are too big, add the fixup + vMask = _mm_and_ps(reinterpret_cast(&iMask)[0],FixUnsigned); + vResult = _mm_add_ps(vResult,vMask); + // Convert DivExponent into 1.0f/(1<(&iMask)[0]); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMConvertVectorFloatToUInt +( + FXMVECTOR VFloat, + UINT MulExponent +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ElementIndex; + XMVECTOR Result; + FLOAT fScale; + XMASSERT(MulExponent<32); + // Get the scalar factor. + fScale = (FLOAT)(1U << MulExponent); + ElementIndex = 0; + do { + UINT uResult; + FLOAT fTemp = VFloat.vector4_f32[ElementIndex]*fScale; + if (fTemp <= 0.0f) { + uResult = 0; + } else if (fTemp >= (65536.0f*65536.0f)) { + uResult = 0xFFFFFFFFU; + } else { + uResult = (UINT)fTemp; + } + Result.vector4_u32[ElementIndex] = uResult; + } while (++ElementIndex<4); + return Result; +#else // _XM_SSE_INTRINSICS_ + XMASSERT(MulExponent<32); + static const XMVECTORF32 MaxUInt = {65536.0f*65536.0f-256.0f,65536.0f*65536.0f-256.0f,65536.0f*65536.0f-256.0f,65536.0f*65536.0f-256.0f}; + static const XMVECTORF32 UnsignedFix = {32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f}; + XMVECTOR vResult = _mm_set_ps1(static_cast(1U << MulExponent)); + vResult = _mm_mul_ps(vResult,VFloat); + // Clamp to >=0 + vResult = _mm_max_ps(vResult,g_XMZero); + // Any numbers that are too big, set to 0xFFFFFFFFU + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult,MaxUInt); + XMVECTOR vValue = UnsignedFix; + // Too large for a signed integer? + XMVECTOR vMask = _mm_cmpge_ps(vResult,vValue); + // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise + vValue = _mm_and_ps(vValue,vMask); + // Perform fixup only on numbers too large (Keeps low bit precision) + vResult = _mm_sub_ps(vResult,vValue); + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Convert from signed to unsigned pnly if greater than 0x80000000 + vMask = _mm_and_ps(vMask,g_XMNegativeZero); + vResult = _mm_xor_ps(reinterpret_cast(&vResulti)[0],vMask); + // On those that are too large, set to 0xFFFFFFFF + vResult = _mm_or_ps(vResult,vOverflow); + return vResult; +#endif +} + +#pragma warning(pop) + +#endif // _XM_NO_INTRINSICS_ || _XM_SSE_INTRINSICS_ + +/**************************************************************************** + * + * Vector and matrix load operations + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt(CONST UINT* pSource) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 3) == 0); + + V.vector4_u32[0] = *pSource; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 3) == 0); + + return _mm_load_ss( (const float*)pSource ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat(CONST FLOAT* pSource) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 3) == 0); + + V.vector4_f32[0] = *pSource; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 3) == 0); + + return _mm_load_ss( pSource ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt2 +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + + return V; +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pSource); + + __m128 x = _mm_load_ss( (const float*)pSource ); + __m128 y = _mm_load_ss( (const float*)(pSource+1) ); + return _mm_unpacklo_ps( x, y ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt2A +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + __m128i V = _mm_loadl_epi64( (const __m128i*)pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat2 +( + CONST XMFLOAT2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + XMASSERT(pSource); + + ((UINT *)(&V.vector4_f32[0]))[0] = ((const UINT *)(&pSource->x))[0]; + ((UINT *)(&V.vector4_f32[1]))[0] = ((const UINT *)(&pSource->y))[0]; + return V; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + + __m128 x = _mm_load_ss( &pSource->x ); + __m128 y = _mm_load_ss( &pSource->y ); + return _mm_unpacklo_ps( x, y ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat2A +( + CONST XMFLOAT2A* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + __m128i V = _mm_loadl_epi64( (const __m128i*)pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadHalf2 +( + CONST XMHALF2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT(pSource); + { + XMVECTOR vResult = { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + 0.0f, + 0.0f + }; + return vResult; + } +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMVECTOR vResult = { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + 0.0f, + 0.0f + }; + return vResult; + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadShortN2 +( + CONST XMSHORTN2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + { + XMVECTOR vResult = { + (FLOAT)pSource->x * (1.0f/32767.0f), + (FLOAT)pSource->y * (1.0f/32767.0f), + 0.0f, + 0.0f + }; + return vResult; + } + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16); + // x needs to be sign extended + vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x - 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16); + // Convert 0-32767 to 0.0f-1.0f + return _mm_mul_ps(vTemp,g_XMNormalizeX16Y16); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadShort2 +( + CONST XMSHORT2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16); + // x needs to be sign extended + vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x - 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16); + // Y is 65536 too large + return _mm_mul_ps(vTemp,g_XMFixupY16); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUShortN2 +( + CONST XMUSHORTN2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x / 65535.0f; + V.vector4_f32[1] = (FLOAT)pSource->y / 65535.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixupY16 = {1.0f/65535.0f,1.0f/(65535.0f*65536.0f),0.0f,0.0f}; + static const XMVECTORF32 FixaddY16 = {0,32768.0f*65536.0f,0,0}; + XMASSERT(pSource); + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16); + // y needs to be sign flipped + vTemp = _mm_xor_ps(vTemp,g_XMFlipY); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // y + 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp,FixaddY16); + // Y is 65536 times too large + vTemp = _mm_mul_ps(vTemp,FixupY16); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUShort2 +( + CONST XMUSHORT2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixaddY16 = {0,32768.0f,0,0}; + XMASSERT(pSource); + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16); + // y needs to be sign flipped + vTemp = _mm_xor_ps(vTemp,g_XMFlipY); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // Y is 65536 times too large + vTemp = _mm_mul_ps(vTemp,g_XMFixupY16); + // y + 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp,FixaddY16); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt3 +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + +#ifdef _XM_ISVS2005_ + __m128i V = _mm_set_epi32( 0, *(pSource+2), *(pSource+1), *pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else + __m128 x = _mm_load_ss( (const float*)pSource ); + __m128 y = _mm_load_ss( (const float*)(pSource+1) ); + __m128 z = _mm_load_ss( (const float*)(pSource+2) ); + __m128 xy = _mm_unpacklo_ps( x, y ); + return _mm_movelh_ps( xy, z ); +#endif // !_XM_ISVS2005_ +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt3A +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + + // Reads an extra integer that is 'undefined' + + __m128i V = _mm_load_si128( (const __m128i*)pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat3 +( + CONST XMFLOAT3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + XMASSERT(pSource); + + ((UINT *)(&V.vector4_f32[0]))[0] = ((const UINT *)(&pSource->x))[0]; + ((UINT *)(&V.vector4_f32[1]))[0] = ((const UINT *)(&pSource->y))[0]; + ((UINT *)(&V.vector4_f32[2]))[0] = ((const UINT *)(&pSource->z))[0]; + return V; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + +#ifdef _XM_ISVS2005_ + // This reads 1 floats past the memory that should be ignored. + // Need to continue to do this for VS 2005 due to compiler issue but prefer new method + // to avoid triggering issues with memory debug tools (like AV) + return _mm_loadu_ps( &pSource->x ); +#else + __m128 x = _mm_load_ss( &pSource->x ); + __m128 y = _mm_load_ss( &pSource->y ); + __m128 z = _mm_load_ss( &pSource->z ); + __m128 xy = _mm_unpacklo_ps( x, y ); + return _mm_movelh_ps( xy, z ); +#endif // !_XM_ISVS2005_ +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat3A +( + CONST XMFLOAT3A* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + // This reads 1 floats past the memory that should be ignored. + return _mm_load_ps( &pSource->x ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUHenDN3 +( + CONST XMUHENDN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x7FF; + V.vector4_f32[0] = (FLOAT)Element / 2047.0f; + Element = (pSource->v >> 11) & 0x7FF; + V.vector4_f32[1] = (FLOAT)Element / 2047.0f; + Element = (pSource->v >> 22) & 0x3FF; + V.vector4_f32[2] = (FLOAT)Element / 1023.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 UHenDN3Mul = {1.0f/2047.0f,1.0f/(2047.0f*2048.0f),1.0f/(1023.0f*2048.0f*2048.0f),0}; + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskHenD3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMFlipZ); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddUHenD3); + // Normalize x,y and z to -1.0f-1.0f + vResult = _mm_mul_ps(vResult,UHenDN3Mul); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUHenD3 +( + CONST XMUHEND3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x7FF; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 11) & 0x7FF; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 22) & 0x3FF; + V.vector4_f32[2] = (FLOAT)Element; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskHenD3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMFlipZ); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddUHenD3); + // Normalize x and y to -1024-1023.0f and z to -512-511.0f + vResult = _mm_mul_ps(vResult,g_XMMulHenD3); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadHenDN3 +( + CONST XMHENDN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtendXY[] = {0x00000000, 0xFFFFF800}; + static CONST UINT SignExtendZ[] = {0x00000000, 0xFFFFFC00}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200); + + Element = pSource->v & 0x7FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]) / 1023.0f; + Element = (pSource->v >> 11) & 0x7FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]) / 1023.0f; + Element = (pSource->v >> 22) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendZ[Element >> 9]) / 511.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 HenDN3Mul = {1.0f/1023.0f,1.0f/(1023.0f*2048.0f),1.0f/(511.0f*2048.0f*2048.0f),0}; + XMASSERT(pSource); + XMASSERT((pSource->v & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskHenD3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMXorHenD3); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddHenD3); + // Normalize x,y and z to -1.0f-1.0f + vResult = _mm_mul_ps(vResult,HenDN3Mul); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadHenD3 +( + CONST XMHEND3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtendXY[] = {0x00000000, 0xFFFFF800}; + static CONST UINT SignExtendZ[] = {0x00000000, 0xFFFFFC00}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200); + + Element = pSource->v & 0x7FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]); + Element = (pSource->v >> 11) & 0x7FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]); + Element = (pSource->v >> 22) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendZ[Element >> 9]); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT((pSource->v & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskHenD3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMXorHenD3); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddHenD3); + // Normalize x and y to -1024-1023.0f and z to -512-511.0f + vResult = _mm_mul_ps(vResult,g_XMMulHenD3); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUDHenN3 +( + CONST XMUDHENN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)Element / 1023.0f; + Element = (pSource->v >> 10) & 0x7FF; + V.vector4_f32[1] = (FLOAT)Element / 2047.0f; + Element = (pSource->v >> 21) & 0x7FF; + V.vector4_f32[2] = (FLOAT)Element / 2047.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 UDHenN3Mul = {1.0f/1023.0f,1.0f/(2047.0f*1024.0f),1.0f/(2047.0f*1024.0f*2048.0f),0}; + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskDHen3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMFlipZ); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddUHenD3); + // Normalize x,y and z to -1.0f-1.0f + vResult = _mm_mul_ps(vResult,UDHenN3Mul); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUDHen3 +( + CONST XMUDHEN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 10) & 0x7FF; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 21) & 0x7FF; + V.vector4_f32[2] = (FLOAT)Element; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskDHen3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMFlipZ); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddUHenD3); + // Normalize x to 0-1023.0f and y and z to 0-2047.0f + vResult = _mm_mul_ps(vResult,g_XMMulDHen3); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadDHenN3 +( + CONST XMDHENN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtendX[] = {0x00000000, 0xFFFFFC00}; + static CONST UINT SignExtendYZ[] = {0x00000000, 0xFFFFF800}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendX[Element >> 9]) / 511.0f; + Element = (pSource->v >> 10) & 0x7FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]) / 1023.0f; + Element = (pSource->v >> 21) & 0x7FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]) / 1023.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 DHenN3Mul = {1.0f/511.0f,1.0f/(1023.0f*1024.0f),1.0f/(1023.0f*1024.0f*2048.0f),0}; + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskDHen3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMXorDHen3); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddDHen3); + // Normalize x,y and z to -1.0f-1.0f + vResult = _mm_mul_ps(vResult,DHenN3Mul); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadDHen3 +( + CONST XMDHEN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtendX[] = {0x00000000, 0xFFFFFC00}; + static CONST UINT SignExtendYZ[] = {0x00000000, 0xFFFFF800}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendX[Element >> 9]); + Element = (pSource->v >> 10) & 0x7FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]); + Element = (pSource->v >> 21) & 0x7FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskDHen3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMXorDHen3); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddDHen3); + // Normalize x to -210-511.0f and y and z to -1024-1023.0f + vResult = _mm_mul_ps(vResult,g_XMMulDHen3); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadU565 +( + CONST XMU565* pSource +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + static const XMVECTORI32 U565And = {0x1F,0x3F<<5,0x1F<<11,0}; + static const XMVECTORF32 U565Mul = {1.0f,1.0f/32.0f,1.0f/2048.f,0}; + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,U565And); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult,U565Mul); + return vResult; +#else + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x1F; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 5) & 0x3F; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 11) & 0x1F; + V.vector4_f32[2] = (FLOAT)Element; + + return V; +#endif // !_XM_SSE_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat3PK +( + CONST XMFLOAT3PK* pSource +) +{ + _DECLSPEC_ALIGN_16_ UINT Result[4]; + UINT Mantissa; + UINT Exponent; + + XMASSERT(pSource); + + // X Channel (6-bit mantissa) + Mantissa = pSource->xm; + + if ( pSource->xe == 0x1f ) // INF or NAN + { + Result[0] = 0x7f800000 | (pSource->xm << 17); + } + else + { + if ( pSource->xe != 0 ) // The value is normalized + { + Exponent = pSource->xe; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x40) == 0); + + Mantissa &= 0x3F; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[0] = ((Exponent + 112) << 23) | (Mantissa << 17); + } + + // Y Channel (6-bit mantissa) + Mantissa = pSource->ym; + + if ( pSource->ye == 0x1f ) // INF or NAN + { + Result[1] = 0x7f800000 | (pSource->ym << 17); + } + else + { + if ( pSource->ye != 0 ) // The value is normalized + { + Exponent = pSource->ye; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x40) == 0); + + Mantissa &= 0x3F; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[1] = ((Exponent + 112) << 23) | (Mantissa << 17); + } + + // Z Channel (5-bit mantissa) + Mantissa = pSource->zm; + + if ( pSource->ze == 0x1f ) // INF or NAN + { + Result[2] = 0x7f800000 | (pSource->zm << 17); + } + else + { + if ( pSource->ze != 0 ) // The value is normalized + { + Exponent = pSource->ze; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x20) == 0); + + Mantissa &= 0x1F; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[2] = ((Exponent + 112) << 23) | (Mantissa << 18); + } + + return XMLoadFloat3A( (XMFLOAT3A*)&Result ); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat3SE +( + CONST XMFLOAT3SE* pSource +) +{ + _DECLSPEC_ALIGN_16_ UINT Result[4]; + UINT Mantissa; + UINT Exponent, ExpBits; + + XMASSERT(pSource); + + if ( pSource->e == 0x1f ) // INF or NAN + { + Result[0] = 0x7f800000 | (pSource->xm << 14); + Result[1] = 0x7f800000 | (pSource->ym << 14); + Result[2] = 0x7f800000 | (pSource->zm << 14); + } + else if ( pSource->e != 0 ) // The values are all normalized + { + Exponent = pSource->e; + + ExpBits = (Exponent + 112) << 23; + + Mantissa = pSource->xm; + Result[0] = ExpBits | (Mantissa << 14); + + Mantissa = pSource->ym; + Result[1] = ExpBits | (Mantissa << 14); + + Mantissa = pSource->zm; + Result[2] = ExpBits | (Mantissa << 14); + } + else + { + // X Channel + Mantissa = pSource->xm; + + if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x200) == 0); + + Mantissa &= 0x1FF; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[0] = ((Exponent + 112) << 23) | (Mantissa << 14); + + // Y Channel + Mantissa = pSource->ym; + + if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x200) == 0); + + Mantissa &= 0x1FF; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[1] = ((Exponent + 112) << 23) | (Mantissa << 14); + + // Z Channel + Mantissa = pSource->zm; + + if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x200) == 0); + + Mantissa &= 0x1FF; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[2] = ((Exponent + 112) << 23) | (Mantissa << 14); + } + + return XMLoadFloat3A( (XMFLOAT3A*)&Result ); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt4 +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = pSource[3]; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pSource); + + __m128i V = _mm_loadu_si128( (const __m128i*)pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt4A +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = pSource[3]; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + __m128i V = _mm_load_si128( (const __m128i*)pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat4 +( + CONST XMFLOAT4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + XMASSERT(pSource); + + ((UINT *)(&V.vector4_f32[0]))[0] = ((const UINT *)(&pSource->x))[0]; + ((UINT *)(&V.vector4_f32[1]))[0] = ((const UINT *)(&pSource->y))[0]; + ((UINT *)(&V.vector4_f32[2]))[0] = ((const UINT *)(&pSource->z))[0]; + ((UINT *)(&V.vector4_f32[3]))[0] = ((const UINT *)(&pSource->w))[0]; + return V; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + + return _mm_loadu_ps( &pSource->x ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat4A +( + CONST XMFLOAT4A* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + V.vector4_f32[3] = pSource->w; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + return _mm_load_ps( &pSource->x ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadHalf4 +( + CONST XMHALF4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT(pSource); + { + XMVECTOR vResult = { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + XMConvertHalfToFloat(pSource->z), + XMConvertHalfToFloat(pSource->w) + }; + return vResult; + } +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMVECTOR vResult = { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + XMConvertHalfToFloat(pSource->z), + XMConvertHalfToFloat(pSource->w) + }; + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadShortN4 +( + CONST XMSHORTN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + XMASSERT(pSource->z != -32768); + XMASSERT(pSource->w != -32768); + { + XMVECTOR vResult = { + (FLOAT)pSource->x * (1.0f/32767.0f), + (FLOAT)pSource->y * (1.0f/32767.0f), + (FLOAT)pSource->z * (1.0f/32767.0f), + (FLOAT)pSource->w * (1.0f/32767.0f) + }; + return vResult; + } +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + XMASSERT(pSource->z != -32768); + XMASSERT(pSource->w != -32768); + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(reinterpret_cast(&vIntd)[0],g_XMMaskX16Y16Z16W16); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16Z16W16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16Z16W16); + // Convert -32767-32767 to -1.0f-1.0f + vTemp = _mm_mul_ps(vTemp,g_XMNormalizeX16Y16Z16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0)); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadShort4 +( + CONST XMSHORT4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + XMASSERT(pSource->z != -32768); + XMASSERT(pSource->w != -32768); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + V.vector4_f32[2] = (FLOAT)pSource->z; + V.vector4_f32[3] = (FLOAT)pSource->w; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + XMASSERT(pSource->z != -32768); + XMASSERT(pSource->w != -32768); + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(reinterpret_cast(&vIntd)[0],g_XMMaskX16Y16Z16W16); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16Z16W16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16Z16W16); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp,g_XMFixupY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0)); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUShortN4 +( + CONST XMUSHORTN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x / 65535.0f; + V.vector4_f32[1] = (FLOAT)pSource->y / 65535.0f; + V.vector4_f32[2] = (FLOAT)pSource->z / 65535.0f; + V.vector4_f32[3] = (FLOAT)pSource->w / 65535.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + static const XMVECTORF32 FixupY16W16 = {1.0f/65535.0f,1.0f/65535.0f,1.0f/(65535.0f*65536.0f),1.0f/(65535.0f*65536.0f)}; + static const XMVECTORF32 FixaddY16W16 = {0,0,32768.0f*65536.0f,32768.0f*65536.0f}; + XMASSERT(pSource); + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(reinterpret_cast(&vIntd)[0],g_XMMaskX16Y16Z16W16); + // y and w are signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp,g_XMFlipZW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // y and w + 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp,FixaddY16W16); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp,FixupY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0)); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUShort4 +( + CONST XMUSHORT4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + V.vector4_f32[2] = (FLOAT)pSource->z; + V.vector4_f32[3] = (FLOAT)pSource->w; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + static const XMVECTORF32 FixaddY16W16 = {0,0,32768.0f,32768.0f}; + XMASSERT(pSource); + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(reinterpret_cast(&vIntd)[0],g_XMMaskX16Y16Z16W16); + // y and w are signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp,g_XMFlipZW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp,g_XMFixupY16W16); + // y and w + 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp,FixaddY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0)); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadXIcoN4 +( + CONST XMXICON4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull); + + Element = (UINT)(pSource->v & 0xFFFFF); + V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + Element = (UINT)((pSource->v >> 20) & 0xFFFFF); + V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + Element = (UINT)((pSource->v >> 40) & 0xFFFFF); + V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + V.vector4_f32[3] = (FLOAT)(pSource->v >> 60) / 15.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull); + static const XMVECTORF32 LoadXIcoN4Mul = {1.0f/524287.0f,1.0f/(524287.0f*4096.0f),1.0f/524287.0f,1.0f/(15.0f*4096.0f*65536.0f)}; + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorXIco4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddXIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadXIcoN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadXIco4 +( + CONST XMXICO4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull); + + Element = (UINT)(pSource->v & 0xFFFFF); + V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + Element = (UINT)((pSource->v >> 20) & 0xFFFFF); + V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + Element = (UINT)((pSource->v >> 40) & 0xFFFFF); + V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + V.vector4_f32[3] = (FLOAT)(pSource->v >> 60); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull); + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorXIco4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddXIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,g_XMMulIco4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUIcoN4 +( + CONST XMUICON4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)(pSource->v & 0xFFFFF) / 1048575.0f; + V.vector4_f32[1] = (FLOAT)((pSource->v >> 20) & 0xFFFFF) / 1048575.0f; + V.vector4_f32[2] = (FLOAT)((pSource->v >> 40) & 0xFFFFF) / 1048575.0f; + V.vector4_f32[3] = (FLOAT)(pSource->v >> 60) / 15.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadUIcoN4Mul = {1.0f/1048575.0f,1.0f/(1048575.0f*4096.0f),1.0f/1048575.0f,1.0f/(15.0f*4096.0f*65536.0f)}; + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipYW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddUIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadUIcoN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUIco4 +( + CONST XMUICO4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)(pSource->v & 0xFFFFF); + V.vector4_f32[1] = (FLOAT)((pSource->v >> 20) & 0xFFFFF); + V.vector4_f32[2] = (FLOAT)((pSource->v >> 40) & 0xFFFFF); + V.vector4_f32[3] = (FLOAT)(pSource->v >> 60); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipYW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddUIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,g_XMMulIco4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadIcoN4 +( + CONST XMICON4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000}; + static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFF0}; + + XMASSERT(pSource); + + Element = (UINT)(pSource->v & 0xFFFFF); + V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + Element = (UINT)((pSource->v >> 20) & 0xFFFFF); + V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + Element = (UINT)((pSource->v >> 40) & 0xFFFFF); + V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + Element = (UINT)(pSource->v >> 60); + V.vector4_f32[3] = (FLOAT)(INT)(Element | SignExtendW[Element >> 3]) / 7.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadIcoN4Mul = {1.0f/524287.0f,1.0f/(524287.0f*4096.0f),1.0f/524287.0f,1.0f/(7.0f*4096.0f*65536.0f)}; + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorIco4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadIcoN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadIco4 +( + CONST XMICO4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000}; + static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFF0}; + + XMASSERT(pSource); + + Element = (UINT)(pSource->v & 0xFFFFF); + V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + Element = (UINT)((pSource->v >> 20) & 0xFFFFF); + V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + Element = (UINT)((pSource->v >> 40) & 0xFFFFF); + V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + Element = (UINT)(pSource->v >> 60); + V.vector4_f32[3] = (FLOAT)(INT)(Element | SignExtendW[Element >> 3]); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorIco4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,g_XMMulIco4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadXDecN4 +( + CONST XMXDECN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + V.vector4_f32[3] = (FLOAT)(pSource->v >> 30) / 3.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Splat the color in all four entries + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskA2B10G10R10); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipA2B10G10R10); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMFixAA2B10G10R10); + // Convert 0-255 to 0.0f-1.0f + return _mm_mul_ps(vTemp,g_XMNormalizeA2B10G10R10); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadXDec4 +( + CONST XMXDEC4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + V.vector4_f32[3] = (FLOAT)(pSource->v >> 30); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + static const XMVECTORI32 XDec4Xor = {0x200, 0x200<<10, 0x200<<20, 0x80000000}; + static const XMVECTORF32 XDec4Add = {-512.0f,-512.0f*1024.0f,-512.0f*1024.0f*1024.0f,32768*65536.0f}; + XMASSERT(pSource); + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,XDec4Xor); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,XDec4Add); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp,g_XMMulDec4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUDecN4 +( + CONST XMUDECN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)Element / 1023.0f; + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)Element / 1023.0f; + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)Element / 1023.0f; + V.vector4_f32[3] = (FLOAT)(pSource->v >> 30) / 3.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + static const XMVECTORF32 UDecN4Mul = {1.0f/1023.0f,1.0f/(1023.0f*1024.0f),1.0f/(1023.0f*1024.0f*1024.0f),1.0f/(3.0f*1024.0f*1024.0f*1024.0f)}; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMAddUDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp,UDecN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUDec4 +( + CONST XMUDEC4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)Element; + V.vector4_f32[3] = (FLOAT)(pSource->v >> 30); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMAddUDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp,g_XMMulDec4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadDecN4 +( + CONST XMDECN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00}; + static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFFC}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 30) & 0x3) != 0x2); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + Element = pSource->v >> 30; + V.vector4_f32[3] = (FLOAT)(SHORT)(Element | SignExtendW[Element >> 1]); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 30) & 0x3) != 0x2); + static const XMVECTORF32 DecN4Mul = {1.0f/511.0f,1.0f/(511.0f*1024.0f),1.0f/(511.0f*1024.0f*1024.0f),1.0f/(1024.0f*1024.0f*1024.0f)}; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorDec4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMAddDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp,DecN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadDec4 +( + CONST XMDEC4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00}; + static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFFC}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 30) & 0x3) != 0x2); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + Element = pSource->v >> 30; + V.vector4_f32[3] = (FLOAT)(SHORT)(Element | SignExtendW[Element >> 1]); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 30) & 0x3) != 0x2); + XMASSERT(pSource); + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorDec4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMAddDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp,g_XMMulDec4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUByteN4 +( + CONST XMUBYTEN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x / 255.0f; + V.vector4_f32[1] = (FLOAT)pSource->y / 255.0f; + V.vector4_f32[2] = (FLOAT)pSource->z / 255.0f; + V.vector4_f32[3] = (FLOAT)pSource->w / 255.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadUByteN4Mul = {1.0f/255.0f,1.0f/(255.0f*256.0f),1.0f/(255.0f*65536.0f),1.0f/(255.0f*65536.0f*256.0f)}; + XMASSERT(pSource); + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskByte4); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp,g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddUDec4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadUByteN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUByte4 +( + CONST XMUBYTE4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + V.vector4_f32[2] = (FLOAT)pSource->z; + V.vector4_f32[3] = (FLOAT)pSource->w; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadUByte4Mul = {1.0f,1.0f/256.0f,1.0f/65536.0f,1.0f/(65536.0f*256.0f)}; + XMASSERT(pSource); + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskByte4); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp,g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddUDec4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadUByte4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadByteN4 +( + CONST XMBYTEN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(pSource->x != -128); + XMASSERT(pSource->y != -128); + XMASSERT(pSource->z != -128); + XMASSERT(pSource->w != -128); + + V.vector4_f32[0] = (FLOAT)pSource->x / 127.0f; + V.vector4_f32[1] = (FLOAT)pSource->y / 127.0f; + V.vector4_f32[2] = (FLOAT)pSource->z / 127.0f; + V.vector4_f32[3] = (FLOAT)pSource->w / 127.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadByteN4Mul = {1.0f/127.0f,1.0f/(127.0f*256.0f),1.0f/(127.0f*65536.0f),1.0f/(127.0f*65536.0f*256.0f)}; + XMASSERT(pSource); + XMASSERT(pSource->x != -128); + XMASSERT(pSource->y != -128); + XMASSERT(pSource->z != -128); + XMASSERT(pSource->w != -128); + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskByte4); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddByte4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadByteN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadByte4 +( + CONST XMBYTE4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(pSource->x != -128); + XMASSERT(pSource->y != -128); + XMASSERT(pSource->z != -128); + XMASSERT(pSource->w != -128); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + V.vector4_f32[2] = (FLOAT)pSource->z; + V.vector4_f32[3] = (FLOAT)pSource->w; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadByte4Mul = {1.0f,1.0f/256.0f,1.0f/65536.0f,1.0f/(65536.0f*256.0f)}; + XMASSERT(pSource); + XMASSERT(pSource->x != -128); + XMASSERT(pSource->y != -128); + XMASSERT(pSource->z != -128); + XMASSERT(pSource->w != -128); + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskByte4); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddByte4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadByte4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUNibble4 +( + CONST XMUNIBBLE4* pSource +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + static const XMVECTORI32 UNibble4And = {0xF,0xF0,0xF00,0xF000}; + static const XMVECTORF32 UNibble4Mul = {1.0f,1.0f/16.f,1.0f/256.f,1.0f/4096.f}; + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,UNibble4And); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult,UNibble4Mul); + return vResult; +#else + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0xF; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 4) & 0xF; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 8) & 0xF; + V.vector4_f32[2] = (FLOAT)Element; + Element = (pSource->v >> 12) & 0xF; + V.vector4_f32[3] = (FLOAT)Element; + + return V; +#endif // !_XM_SSE_INTRISICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadU555 +( + CONST XMU555* pSource +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + static const XMVECTORI32 U555And = {0x1F,0x1F<<5,0x1F<<10,0x8000}; + static const XMVECTORF32 U555Mul = {1.0f,1.0f/32.f,1.0f/1024.f,1.0f/32768.f}; + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,U555And); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult,U555Mul); + return vResult; +#else + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x1F; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 5) & 0x1F; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 10) & 0x1F; + V.vector4_f32[2] = (FLOAT)Element; + Element = (pSource->v >> 15) & 0x1; + V.vector4_f32[3] = (FLOAT)Element; + + return V; +#endif // !_XM_SSE_INTRISICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadColor +( + CONST XMCOLOR* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT(pSource); + { + // INT -> Float conversions are done in one instruction. + // UINT -> Float calls a runtime function. Keep in INT + INT iColor = (INT)(pSource->c); + XMVECTOR vColor = { + (FLOAT)((iColor >> 16) & 0xFF) * (1.0f/255.0f), + (FLOAT)((iColor >> 8) & 0xFF) * (1.0f/255.0f), + (FLOAT)(iColor & 0xFF) * (1.0f/255.0f), + (FLOAT)((iColor >> 24) & 0xFF) * (1.0f/255.0f) + }; + return vColor; + } +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Splat the color in all four entries + __m128i vInt = _mm_set1_epi32(pSource->c); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vInt = _mm_and_si128(vInt,g_XMMaskA8R8G8B8); + // a is unsigned! Flip the bit to convert the order to signed + vInt = _mm_xor_si128(vInt,g_XMFlipA8R8G8B8); + // Convert to floating point numbers + XMVECTOR vTemp = _mm_cvtepi32_ps(vInt); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMFixAA8R8G8B8); + // Convert 0-255 to 0.0f-1.0f + return _mm_mul_ps(vTemp,g_XMNormalizeA8R8G8B8); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMLoadFloat3x3 +( + CONST XMFLOAT3X3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + XMASSERT(pSource); + + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = 0.0f; + M.r[3].vector4_f32[1] = 0.0f; + M.r[3].vector4_f32[2] = 0.0f; + M.r[3].vector4_f32[3] = 1.0f; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMVECTOR V1, V2, V3, Z, T1, T2, T3, T4, T5; + + Z = _mm_setzero_ps(); + + XMASSERT(pSource); + + V1 = _mm_loadu_ps( &pSource->m[0][0] ); + V2 = _mm_loadu_ps( &pSource->m[1][1] ); + V3 = _mm_load_ss( &pSource->m[2][2] ); + + T1 = _mm_unpackhi_ps( V1, Z ); + T2 = _mm_unpacklo_ps( V2, Z ); + T3 = _mm_shuffle_ps( V3, T2, _MM_SHUFFLE( 0, 1, 0, 0 ) ); + T4 = _mm_movehl_ps( T2, T3 ); + T5 = _mm_movehl_ps( Z, T1 ); + + M.r[0] = _mm_movelh_ps( V1, T1 ); + M.r[1] = _mm_add_ps( T4, T5 ); + M.r[2] = _mm_shuffle_ps( V2, V3, _MM_SHUFFLE(1, 0, 3, 2) ); + M.r[3] = g_XMIdentityR3; + + return M; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMLoadFloat4x3 +( + CONST XMFLOAT4X3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + XMASSERT(pSource); + + ((UINT *)(&M.r[0].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[0][0]))[0]; + ((UINT *)(&M.r[0].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[0][1]))[0]; + ((UINT *)(&M.r[0].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[0][2]))[0]; + M.r[0].vector4_f32[3] = 0.0f; + + ((UINT *)(&M.r[1].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[1][0]))[0]; + ((UINT *)(&M.r[1].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[1][1]))[0]; + ((UINT *)(&M.r[1].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[1][2]))[0]; + M.r[1].vector4_f32[3] = 0.0f; + + ((UINT *)(&M.r[2].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[2][0]))[0]; + ((UINT *)(&M.r[2].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[2][1]))[0]; + ((UINT *)(&M.r[2].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[2][2]))[0]; + M.r[2].vector4_f32[3] = 0.0f; + + ((UINT *)(&M.r[3].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[3][0]))[0]; + ((UINT *)(&M.r[3].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[3][1]))[0]; + ((UINT *)(&M.r[3].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[3][2]))[0]; + M.r[3].vector4_f32[3] = 1.0f; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Use unaligned load instructions to + // load the 12 floats + // vTemp1 = x1,y1,z1,x2 + XMVECTOR vTemp1 = _mm_loadu_ps(&pSource->m[0][0]); + // vTemp2 = y2,z2,x3,y3 + XMVECTOR vTemp2 = _mm_loadu_ps(&pSource->m[1][1]); + // vTemp4 = z3,x4,y4,z4 + XMVECTOR vTemp4 = _mm_loadu_ps(&pSource->m[2][2]); + // vTemp3 = x3,y3,z3,z3 + XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2,vTemp4,_MM_SHUFFLE(0,0,3,2)); + // vTemp2 = y2,z2,x2,x2 + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp1,_MM_SHUFFLE(3,3,1,0)); + // vTemp2 = x2,y2,z2,z2 + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(1,1,0,2)); + // vTemp1 = x1,y1,z1,0 + vTemp1 = _mm_and_ps(vTemp1,g_XMMask3); + // vTemp2 = x2,y2,z2,0 + vTemp2 = _mm_and_ps(vTemp2,g_XMMask3); + // vTemp3 = x3,y3,z3,0 + vTemp3 = _mm_and_ps(vTemp3,g_XMMask3); + // vTemp4i = x4,y4,z4,0 + __m128i vTemp4i = _mm_srli_si128(reinterpret_cast(&vTemp4)[0],32/8); + // vTemp4i = x4,y4,z4,1.0f + vTemp4i = _mm_or_si128(vTemp4i,g_XMIdentityR3); + XMMATRIX M(vTemp1, + vTemp2, + vTemp3, + reinterpret_cast(&vTemp4i)[0]); + return M; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMLoadFloat4x3A +( + CONST XMFLOAT4X3A* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = 1.0f; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Use aligned load instructions to + // load the 12 floats + // vTemp1 = x1,y1,z1,x2 + XMVECTOR vTemp1 = _mm_load_ps(&pSource->m[0][0]); + // vTemp2 = y2,z2,x3,y3 + XMVECTOR vTemp2 = _mm_load_ps(&pSource->m[1][1]); + // vTemp4 = z3,x4,y4,z4 + XMVECTOR vTemp4 = _mm_load_ps(&pSource->m[2][2]); + // vTemp3 = x3,y3,z3,z3 + XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2,vTemp4,_MM_SHUFFLE(0,0,3,2)); + // vTemp2 = y2,z2,x2,x2 + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp1,_MM_SHUFFLE(3,3,1,0)); + // vTemp2 = x2,y2,z2,z2 + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(1,1,0,2)); + // vTemp1 = x1,y1,z1,0 + vTemp1 = _mm_and_ps(vTemp1,g_XMMask3); + // vTemp2 = x2,y2,z2,0 + vTemp2 = _mm_and_ps(vTemp2,g_XMMask3); + // vTemp3 = x3,y3,z3,0 + vTemp3 = _mm_and_ps(vTemp3,g_XMMask3); + // vTemp4i = x4,y4,z4,0 + __m128i vTemp4i = _mm_srli_si128(reinterpret_cast(&vTemp4)[0],32/8); + // vTemp4i = x4,y4,z4,1.0f + vTemp4i = _mm_or_si128(vTemp4i,g_XMIdentityR3); + XMMATRIX M(vTemp1, + vTemp2, + vTemp3, + reinterpret_cast(&vTemp4i)[0]); + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMLoadFloat4x4 +( + CONST XMFLOAT4X4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + XMASSERT(pSource); + + ((UINT *)(&M.r[0].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[0][0]))[0]; + ((UINT *)(&M.r[0].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[0][1]))[0]; + ((UINT *)(&M.r[0].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[0][2]))[0]; + ((UINT *)(&M.r[0].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[0][3]))[0]; + + ((UINT *)(&M.r[1].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[1][0]))[0]; + ((UINT *)(&M.r[1].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[1][1]))[0]; + ((UINT *)(&M.r[1].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[1][2]))[0]; + ((UINT *)(&M.r[1].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[1][3]))[0]; + + ((UINT *)(&M.r[2].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[2][0]))[0]; + ((UINT *)(&M.r[2].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[2][1]))[0]; + ((UINT *)(&M.r[2].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[2][2]))[0]; + ((UINT *)(&M.r[2].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[2][3]))[0]; + + ((UINT *)(&M.r[3].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[3][0]))[0]; + ((UINT *)(&M.r[3].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[3][1]))[0]; + ((UINT *)(&M.r[3].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[3][2]))[0]; + ((UINT *)(&M.r[3].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[3][3]))[0]; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMMATRIX M; + + M.r[0] = _mm_loadu_ps( &pSource->_11 ); + M.r[1] = _mm_loadu_ps( &pSource->_21 ); + M.r[2] = _mm_loadu_ps( &pSource->_31 ); + M.r[3] = _mm_loadu_ps( &pSource->_41 ); + + return M; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMLoadFloat4x4A +( + CONST XMFLOAT4X4A* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = pSource->m[0][3]; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = pSource->m[1][3]; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = pSource->m[2][3]; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = pSource->m[3][3]; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + + XMASSERT(pSource); + + M.r[0] = _mm_load_ps( &pSource->_11 ); + M.r[1] = _mm_load_ps( &pSource->_21 ); + M.r[2] = _mm_load_ps( &pSource->_31 ); + M.r[3] = _mm_load_ps( &pSource->_41 ); + + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * Vector and matrix store operations + * + ****************************************************************************/ + +XMFINLINE VOID XMStoreInt +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + *pDestination = XMVectorGetIntX( V ); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + _mm_store_ss( (float*)pDestination, V ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat +( + FLOAT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + *pDestination = XMVectorGetX( V ); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + _mm_store_ss( pDestination, V ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt2 +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + XMVECTOR T = _mm_shuffle_ps( V, V, _MM_SHUFFLE( 1, 1, 1, 1 ) ); + _mm_store_ss( (float*)&pDestination[0], V ); + _mm_store_ss( (float*)&pDestination[1], T ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt2A +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat2 +( + XMFLOAT2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + XMVECTOR T = _mm_shuffle_ps( V, V, _MM_SHUFFLE( 1, 1, 1, 1 ) ); + _mm_store_ss( &pDestination->x, V ); + _mm_store_ss( &pDestination->y, T ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat2A +( + XMFLOAT2A* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreHalf2 +( + XMHALF2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->x = XMConvertFloatToHalf(V.vector4_f32[0]); + pDestination->y = XMConvertFloatToHalf(V.vector4_f32[1]); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + pDestination->x = XMConvertFloatToHalf(XMVectorGetX(V)); + pDestination->y = XMConvertFloatToHalf(XMVectorGetY(V)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreShortN2 +( + XMSHORTN2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = _mm_mul_ps(vResult,Scale); + __m128i vResulti = _mm_cvtps_epi32(vResult); + vResulti = _mm_packs_epi32(vResulti,vResulti); + _mm_store_ss(reinterpret_cast(&pDestination->x),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreShort2 +( + XMSHORT2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f}; + static CONST XMVECTOR Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f}; + static CONST XMVECTORF32 Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,Min); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Pack the ints into shorts + vInt = _mm_packs_epi32(vInt,vInt); + _mm_store_ss(reinterpret_cast(&pDestination->x),reinterpret_cast(&vInt)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUShortN2 +( + XMUSHORTN2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiplyAdd(N, Scale.v, g_XMOneHalf.v); + N = XMVectorTruncate(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = _mm_mul_ps(vResult,Scale); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt,0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt,2)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUShort2 +( + XMUSHORT2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt,0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt,2)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt3 +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + XMVECTOR T1 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR T2 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_store_ss( (float*)pDestination, V ); + _mm_store_ss( (float*)&pDestination[1], T1 ); + _mm_store_ss( (float*)&pDestination[2], T2 ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt3A +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + XMVECTOR T = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + _mm_store_ss( (float*)&pDestination[2], T ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3 +( + XMFLOAT3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + XMVECTOR T1 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR T2 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_store_ss( &pDestination->x, V ); + _mm_store_ss( &pDestination->y, T1 ); + _mm_store_ss( &pDestination->z, T2 ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3A +( + XMFLOAT3A* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + XMVECTOR T = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + _mm_store_ss( &pDestination->z, T ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUHenDN3 +( + XMUHENDN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {2047.0f, 2047.0f, 1023.0f, 0.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = (((UINT)N.vector4_f32[2] & 0x3FF) << 22) | + (((UINT)N.vector4_f32[1] & 0x7FF) << 11) | + (((UINT)N.vector4_f32[0] & 0x7FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleUHenDN3 = {2047.0f, 2047.0f*2048.0f,1023.0f*(2048.0f*2048.0f)/2.0f,1.0f}; + static const XMVECTORI32 MaskUHenDN3 = {0x7FF,0x7FF<<11,0x3FF<<(22-1),0}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUHenDN3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUHenDN3); + // Do a horizontal or of 3 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1)); + // i = x|y + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1)); + // Add Z to itself to perform a single bit left shift + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUHenD3 +( + XMUHEND3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {2047.0f, 2047.0f, 1023.0f, 0.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + + pDestination->v = (((UINT)N.vector4_f32[2] & 0x3FF) << 22) | + (((UINT)N.vector4_f32[1] & 0x7FF) << 11) | + (((UINT)N.vector4_f32[0] & 0x7FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MaxUHenD3 = { 2047.0f, 2047.0f, 1023.0f, 1.0f}; + static const XMVECTORF32 ScaleUHenD3 = {1.0f, 2048.0f,(2048.0f*2048.0f)/2.0f,1.0f}; + static const XMVECTORI32 MaskUHenD3 = {0x7FF,0x7FF<<11,0x3FF<<(22-1),0}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,MaxUHenD3); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUHenD3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUHenD3); + // Do a horizontal or of 3 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1)); + // i = x|y + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1)); + // Add Z to itself to perform a single bit left shift + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreHenDN3 +( + XMHENDN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {1023.0f, 1023.0f, 511.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = (((INT)N.vector4_f32[2] & 0x3FF) << 22) | + (((INT)N.vector4_f32[1] & 0x7FF) << 11) | + (((INT)N.vector4_f32[0] & 0x7FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleHenDN3 = {1023.0f, 1023.0f*2048.0f,511.0f*(2048.0f*2048.0f),1.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleHenDN3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,g_XMMaskHenD3); + // Do a horizontal or of all 4 entries + vResult = _mm_shuffle_ps(reinterpret_cast(&vResulti)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreHenD3 +( + XMHEND3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-1023.0f, -1023.0f, -511.0f, -1.0f}; + static CONST XMVECTOR Max = {1023.0f, 1023.0f, 511.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + + pDestination->v = (((INT)N.vector4_f32[2] & 0x3FF) << 22) | + (((INT)N.vector4_f32[1] & 0x7FF) << 11) | + (((INT)N.vector4_f32[0] & 0x7FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MinHenD3 = {-1023.0f,-1023.0f,-511.0f,-1.0f}; + static const XMVECTORF32 MaxHenD3 = { 1023.0f, 1023.0f, 511.0f, 1.0f}; + static const XMVECTORF32 ScaleHenD3 = {1.0f, 2048.0f,(2048.0f*2048.0f),1.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,MinHenD3); + vResult = _mm_min_ps(vResult,MaxHenD3); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleHenD3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,g_XMMaskHenD3); + // Do a horizontal or of all 4 entries + vResult = _mm_shuffle_ps(reinterpret_cast(&vResulti)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUDHenN3 +( + XMUDHENN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {1023.0f, 2047.0f, 2047.0f, 0.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = (((UINT)N.vector4_f32[2] & 0x7FF) << 21) | + (((UINT)N.vector4_f32[1] & 0x7FF) << 10) | + (((UINT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleUDHenN3 = {1023.0f,2047.0f*1024.0f,2047.0f*(1024.0f*2048.0f)/2.0f,1.0f}; + static const XMVECTORI32 MaskUDHenN3 = {0x3FF,0x7FF<<10,0x7FF<<(21-1),0}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUDHenN3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUDHenN3); + // Do a horizontal or of 3 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1)); + // i = x|y + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1)); + // Add Z to itself to perform a single bit left shift + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUDHen3 +( + XMUDHEN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {1023.0f, 2047.0f, 2047.0f, 0.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + + pDestination->v = (((UINT)N.vector4_f32[2] & 0x7FF) << 21) | + (((UINT)N.vector4_f32[1] & 0x7FF) << 10) | + (((UINT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MaxUDHen3 = { 1023.0f, 2047.0f, 2047.0f, 1.0f}; + static const XMVECTORF32 ScaleUDHen3 = {1.0f, 1024.0f,(1024.0f*2048.0f)/2.0f,1.0f}; + static const XMVECTORI32 MaskUDHen3 = {0x3FF,0x7FF<<10,0x7FF<<(21-1),0}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,MaxUDHen3); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUDHen3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUDHen3); + // Do a horizontal or of 3 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1)); + // i = x|y + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1)); + // Add Z to itself to perform a single bit left shift + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreDHenN3 +( + XMDHENN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {511.0f, 1023.0f, 1023.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = (((INT)N.vector4_f32[2] & 0x7FF) << 21) | + (((INT)N.vector4_f32[1] & 0x7FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleDHenN3 = {511.0f, 1023.0f*1024.0f,1023.0f*(1024.0f*2048.0f),1.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleDHenN3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,g_XMMaskDHen3); + // Do a horizontal or of all 4 entries + vResult = _mm_shuffle_ps(reinterpret_cast(&vResulti)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreDHen3 +( + XMDHEN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-511.0f, -1023.0f, -1023.0f, -1.0f}; + static CONST XMVECTOR Max = {511.0f, 1023.0f, 1023.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + + pDestination->v = (((INT)N.vector4_f32[2] & 0x7FF) << 21) | + (((INT)N.vector4_f32[1] & 0x7FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MinDHen3 = {-511.0f,-1023.0f,-1023.0f,-1.0f}; + static const XMVECTORF32 MaxDHen3 = { 511.0f, 1023.0f, 1023.0f, 1.0f}; + static const XMVECTORF32 ScaleDHen3 = {1.0f, 1024.0f,(1024.0f*2048.0f),1.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,MinDHen3); + vResult = _mm_min_ps(vResult,MaxDHen3); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleDHen3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,g_XMMaskDHen3); + // Do a horizontal or of all 4 entries + vResult = _mm_shuffle_ps(reinterpret_cast(&vResulti)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreU565 +( + XMU565* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Max = {31.0f, 63.0f, 31.0f, 0.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + USHORT x = static_cast(_mm_extract_epi16(vInt,0)); + USHORT y = static_cast(_mm_extract_epi16(vInt,2)); + USHORT z = static_cast(_mm_extract_epi16(vInt,4)); + pDestination->v = ((z & 0x1F) << 11) | + ((y & 0x3F) << 5) | + ((x & 0x1F)); +#else + XMVECTOR N; + static CONST XMVECTORF32 Max = {31.0f, 63.0f, 31.0f, 0.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + pDestination->v = (((USHORT)N.vector4_f32[2] & 0x1F) << 11) | + (((USHORT)N.vector4_f32[1] & 0x3F) << 5) | + (((USHORT)N.vector4_f32[0] & 0x1F)); +#endif !_XM_SSE_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3PK +( + XMFLOAT3PK* pDestination, + FXMVECTOR V +) +{ + _DECLSPEC_ALIGN_16_ UINT IValue[4]; + UINT I, Sign, j; + UINT Result[3]; + + XMASSERT(pDestination); + + XMStoreFloat3A( (XMFLOAT3A*)&IValue, V ); + + // X & Y Channels (5-bit exponent, 6-bit mantissa) + for(j=0; j < 2; ++j) + { + Sign = IValue[j] & 0x80000000; + I = IValue[j] & 0x7FFFFFFF; + + if ((I & 0x7F800000) == 0x7F800000) + { + // INF or NAN + Result[j] = 0x7c0; + if (( I & 0x7FFFFF ) != 0) + { + Result[j] = 0x7c0 | (((I>>17)|(I>11)|(I>>6)|(I))&0x3f); + } + else if ( Sign ) + { + // -INF is clamped to 0 since 3PK is positive only + Result[j] = 0; + } + } + else if ( Sign ) + { + // 3PK is positive only, so clamp to zero + Result[j] = 0; + } + else if (I > 0x477E0000U) + { + // The number is too large to be represented as a float11, set to max + Result[j] = 0x7BF; + } + else + { + if (I < 0x38800000U) + { + // The number is too small to be represented as a normalized float11 + // Convert it to a denormalized value. + UINT Shift = 113U - (I >> 23U); + I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float11 + I += 0xC8000000U; + } + + Result[j] = ((I + 0xFFFFU + ((I >> 17U) & 1U)) >> 17U)&0x7ffU; + } + } + + // Z Channel (5-bit exponent, 5-bit mantissa) + Sign = IValue[2] & 0x80000000; + I = IValue[2] & 0x7FFFFFFF; + + if ((I & 0x7F800000) == 0x7F800000) + { + // INF or NAN + Result[2] = 0x3e0; + if ( I & 0x7FFFFF ) + { + Result[2] = 0x3e0 | (((I>>18)|(I>13)|(I>>3)|(I))&0x1f); + } + else if ( Sign ) + { + // -INF is clamped to 0 since 3PK is positive only + Result[2] = 0; + } + } + else if ( Sign ) + { + // 3PK is positive only, so clamp to zero + Result[2] = 0; + } + else if (I > 0x477C0000U) + { + // The number is too large to be represented as a float10, set to max + Result[2] = 0x3df; + } + else + { + if (I < 0x38800000U) + { + // The number is too small to be represented as a normalized float10 + // Convert it to a denormalized value. + UINT Shift = 113U - (I >> 23U); + I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float10 + I += 0xC8000000U; + } + + Result[2] = ((I + 0x1FFFFU + ((I >> 18U) & 1U)) >> 18U)&0x3ffU; + } + + // Pack Result into memory + pDestination->v = (Result[0] & 0x7ff) + | ( (Result[1] & 0x7ff) << 11 ) + | ( (Result[2] & 0x3ff) << 22 ); +} + + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3SE +( + XMFLOAT3SE* pDestination, + FXMVECTOR V +) +{ + _DECLSPEC_ALIGN_16_ UINT IValue[4]; + UINT I, Sign, j, T; + UINT Frac[3]; + UINT Exp[3]; + + + XMASSERT(pDestination); + + XMStoreFloat3A( (XMFLOAT3A*)&IValue, V ); + + // X, Y, Z Channels (5-bit exponent, 9-bit mantissa) + for(j=0; j < 3; ++j) + { + Sign = IValue[j] & 0x80000000; + I = IValue[j] & 0x7FFFFFFF; + + if ((I & 0x7F800000) == 0x7F800000) + { + // INF or NAN + Exp[j] = 0x1f; + if (( I & 0x7FFFFF ) != 0) + { + Frac[j] = ((I>>14)|(I>5)|(I))&0x1ff; + } + else if ( Sign ) + { + // -INF is clamped to 0 since 3SE is positive only + Exp[j] = Frac[j] = 0; + } + } + else if ( Sign ) + { + // 3SE is positive only, so clamp to zero + Exp[j] = Frac[j] = 0; + } + else if (I > 0x477FC000U) + { + // The number is too large, set to max + Exp[j] = 0x1e; + Frac[j] = 0x1ff; + } + else + { + if (I < 0x38800000U) + { + // The number is too small to be represented as a normalized float11 + // Convert it to a denormalized value. + UINT Shift = 113U - (I >> 23U); + I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float11 + I += 0xC8000000U; + } + + T = ((I + 0x1FFFU + ((I >> 14U) & 1U)) >> 14U)&0x3fffU; + + Exp[j] = (T & 0x3E00) >> 9; + Frac[j] = T & 0x1ff; + } + } + + // Adjust to a shared exponent + T = XMMax( Exp[0], XMMax( Exp[1], Exp[2] ) ); + + Frac[0] = Frac[0] >> (T - Exp[0]); + Frac[1] = Frac[1] >> (T - Exp[1]); + Frac[2] = Frac[2] >> (T - Exp[2]); + + // Store packed into memory + pDestination->xm = Frac[0]; + pDestination->ym = Frac[1]; + pDestination->zm = Frac[2]; + pDestination->e = T; +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt4 +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + pDestination[3] = V.vector4_u32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + + _mm_storeu_si128( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt4A +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + pDestination[3] = V.vector4_u32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + _mm_store_si128( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt4NC +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + pDestination[3] = V.vector4_u32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + _mm_storeu_si128( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4 +( + XMFLOAT4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + pDestination->w = V.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + + _mm_storeu_ps( &pDestination->x, V ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4A +( + XMFLOAT4A* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + pDestination->w = V.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + _mm_store_ps( &pDestination->x, V ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4NC +( + XMFLOAT4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + pDestination->w = V.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + _mm_storeu_ps( &pDestination->x, V ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreHalf4 +( + XMHALF4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->x = XMConvertFloatToHalf(V.vector4_f32[0]); + pDestination->y = XMConvertFloatToHalf(V.vector4_f32[1]); + pDestination->z = XMConvertFloatToHalf(V.vector4_f32[2]); + pDestination->w = XMConvertFloatToHalf(V.vector4_f32[3]); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + pDestination->x = XMConvertFloatToHalf(XMVectorGetX(V)); + pDestination->y = XMConvertFloatToHalf(XMVectorGetY(V)); + pDestination->z = XMConvertFloatToHalf(XMVectorGetZ(V)); + pDestination->w = XMConvertFloatToHalf(XMVectorGetW(V)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreShortN4 +( + XMSHORTN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + pDestination->z = (SHORT)N.vector4_f32[2]; + pDestination->w = (SHORT)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = _mm_mul_ps(vResult,Scale); + __m128i vResulti = _mm_cvtps_epi32(vResult); + vResulti = _mm_packs_epi32(vResulti,vResulti); + _mm_store_sd(reinterpret_cast(&pDestination->x),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreShort4 +( + XMSHORT4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f}; + static CONST XMVECTOR Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + pDestination->z = (SHORT)N.vector4_f32[2]; + pDestination->w = (SHORT)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f}; + static CONST XMVECTORF32 Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,Min); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Pack the ints into shorts + vInt = _mm_packs_epi32(vInt,vInt); + _mm_store_sd(reinterpret_cast(&pDestination->x),reinterpret_cast(&vInt)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUShortN4 +( + XMUSHORTN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiplyAdd(N, Scale.v, g_XMOneHalf.v); + N = XMVectorTruncate(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + pDestination->z = (SHORT)N.vector4_f32[2]; + pDestination->w = (SHORT)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = _mm_mul_ps(vResult,Scale); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt,0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt,2)); + pDestination->z = static_cast(_mm_extract_epi16(vInt,4)); + pDestination->w = static_cast(_mm_extract_epi16(vInt,6)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUShort4 +( + XMUSHORT4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + pDestination->z = (SHORT)N.vector4_f32[2]; + pDestination->w = (SHORT)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt,0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt,2)); + pDestination->z = static_cast(_mm_extract_epi16(vInt,4)); + pDestination->w = static_cast(_mm_extract_epi16(vInt,6)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreXIcoN4 +( + XMXICON4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Min = {-1.0f, -1.0f, -1.0f, 0.0f}; + static CONST XMVECTORF32 Scale = {524287.0f, 524287.0f, 524287.0f, 15.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->v = ((UINT64)N.vector4_f32[3] << 60) | + (((INT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((INT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((INT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 MinXIcoN4 = {-1.0f, 0.0f,-1.0f,-1.0f}; + static const XMVECTORF32 ScaleXIcoN4 = {524287.0f,15.0f*4096.0f*65536.0f*0.5f,524287.0f*4096.0f,524287.0f}; + static const XMVECTORI32 MaskXIcoN4 = {0xFFFFF,0xF<<((60-32)-1),0xFFFFF000,0xFFFFF}; + + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,MinXIcoN4); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleXIcoN4); + // Convert to integer (w is unsigned) + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off unused bits + vResulti = _mm_and_si128(vResulti,MaskXIcoN4); + // Isolate Y + __m128i vResulti2 = _mm_and_si128(vResulti,g_XMMaskY); + // Double Y (Really W) to fixup for unsigned conversion + vResulti = _mm_add_epi32(vResulti,vResulti2); + // Shift y and z to straddle the 32-bit boundary + vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreXIco4 +( + XMXICO4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Min = {-524287.0f, -524287.0f, -524287.0f, 0.0f}; + static CONST XMVECTORF32 Max = {524287.0f, 524287.0f, 524287.0f, 15.0f}; + + XMASSERT(pDestination); + N = XMVectorClamp(V, Min.v, Max.v); + pDestination->v = ((UINT64)N.vector4_f32[3] << 60) | + (((INT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((INT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((INT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 MinXIco4 = {-524287.0f, 0.0f,-524287.0f,-524287.0f}; + static const XMVECTORF32 MaxXIco4 = { 524287.0f,15.0f, 524287.0f, 524287.0f}; + static const XMVECTORF32 ScaleXIco4 = {1.0f,4096.0f*65536.0f*0.5f,4096.0f,1.0f}; + static const XMVECTORI32 MaskXIco4 = {0xFFFFF,0xF<<((60-1)-32),0xFFFFF000,0xFFFFF}; + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,MinXIco4); + vResult = _mm_min_ps(vResult,MaxXIco4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleXIco4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskXIco4); + // Isolate Y + __m128i vResulti2 = _mm_and_si128(vResulti,g_XMMaskY); + // Double Y (Really W) to fixup for unsigned conversion + vResulti = _mm_add_epi32(vResulti,vResulti2); + // Shift y and z to straddle the 32-bit boundary + vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUIcoN4 +( + XMUICON4* pDestination, + FXMVECTOR V +) +{ + #define XM_URange ((FLOAT)(1 << 20)) + #define XM_URangeDiv2 ((FLOAT)(1 << 19)) + #define XM_UMaxXYZ ((FLOAT)((1 << 20) - 1)) + #define XM_UMaxW ((FLOAT)((1 << 4) - 1)) + #define XM_ScaleXYZ (-(FLOAT)((1 << 20) - 1) / XM_PACK_FACTOR) + #define XM_ScaleW (-(FLOAT)((1 << 4) - 1) / XM_PACK_FACTOR) + #define XM_Scale (-1.0f / XM_PACK_FACTOR) + #define XM_Offset (3.0f) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {1048575.0f, 1048575.0f, 1048575.0f, 15.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiplyAdd(N, Scale.v, g_XMOneHalf.v); + + pDestination->v = ((UINT64)N.vector4_f32[3] << 60) | + (((UINT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((UINT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((UINT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 ScaleUIcoN4 = {1048575.0f,15.0f*4096.0f*65536.0f,1048575.0f*4096.0f,1048575.0f}; + static const XMVECTORI32 MaskUIcoN4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF}; + static const XMVECTORF32 AddUIcoN4 = {0.0f,-32768.0f*65536.0f,-32768.0f*65536.0f,0.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUIcoN4); + // Adjust for unsigned entries + vResult = _mm_add_ps(vResult,AddUIcoN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Fix the signs on the unsigned entries + vResulti = _mm_xor_si128(vResulti,g_XMFlipYZ); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUIcoN4); + // Shift y and z to straddle the 32-bit boundary + __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ + + #undef XM_URange + #undef XM_URangeDiv2 + #undef XM_UMaxXYZ + #undef XM_UMaxW + #undef XM_ScaleXYZ + #undef XM_ScaleW + #undef XM_Scale + #undef XM_Offset +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUIco4 +( + XMUICO4* pDestination, + FXMVECTOR V +) +{ + #define XM_Scale (-1.0f / XM_PACK_FACTOR) + #define XM_URange ((FLOAT)(1 << 20)) + #define XM_URangeDiv2 ((FLOAT)(1 << 19)) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {1048575.0f, 1048575.0f, 1048575.0f, 15.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + N = XMVectorRound(N); + + pDestination->v = ((UINT64)N.vector4_f32[3] << 60) | + (((UINT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((UINT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((UINT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 MaxUIco4 = { 1048575.0f, 15.0f, 1048575.0f, 1048575.0f}; + static const XMVECTORF32 ScaleUIco4 = {1.0f,4096.0f*65536.0f,4096.0f,1.0f}; + static const XMVECTORI32 MaskUIco4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF}; + static const XMVECTORF32 AddUIco4 = {0.0f,-32768.0f*65536.0f,-32768.0f*65536.0f,0.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,g_XMZero); + vResult = _mm_min_ps(vResult,MaxUIco4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUIco4); + vResult = _mm_add_ps(vResult,AddUIco4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + vResulti = _mm_xor_si128(vResulti,g_XMFlipYZ); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUIco4); + // Shift y and z to straddle the 32-bit boundary + __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ + + #undef XM_Scale + #undef XM_URange + #undef XM_URangeDiv2 +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreIcoN4 +( + XMICON4* pDestination, + FXMVECTOR V +) +{ + #define XM_Scale (-1.0f / XM_PACK_FACTOR) + #define XM_URange ((FLOAT)(1 << 4)) + #define XM_Offset (3.0f) + #define XM_UMaxXYZ ((FLOAT)((1 << (20 - 1)) - 1)) + #define XM_UMaxW ((FLOAT)((1 << (4 - 1)) - 1)) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {524287.0f, 524287.0f, 524287.0f, 7.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiplyAdd(N, Scale.v, g_XMNegativeZero.v); + N = XMVectorRound(N); + + pDestination->v = ((UINT64)N.vector4_f32[3] << 60) | + (((UINT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((UINT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((UINT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 ScaleIcoN4 = {524287.0f,7.0f*4096.0f*65536.0f,524287.0f*4096.0f,524287.0f}; + static const XMVECTORI32 MaskIcoN4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF}; + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleIcoN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskIcoN4); + // Shift y and z to straddle the 32-bit boundary + __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ + + #undef XM_Scale + #undef XM_URange + #undef XM_Offset + #undef XM_UMaxXYZ + #undef XM_UMaxW +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreIco4 +( + XMICO4* pDestination, + FXMVECTOR V +) +{ + #define XM_Scale (-1.0f / XM_PACK_FACTOR) + #define XM_URange ((FLOAT)(1 << 4)) + #define XM_Offset (3.0f) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-524287.0f, -524287.0f, -524287.0f, -7.0f}; + static CONST XMVECTOR Max = {524287.0f, 524287.0f, 524287.0f, 7.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + N = XMVectorRound(N); + + pDestination->v = ((INT64)N.vector4_f32[3] << 60) | + (((INT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((INT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((INT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 MinIco4 = {-524287.0f,-7.0f,-524287.0f,-524287.0f}; + static const XMVECTORF32 MaxIco4 = { 524287.0f, 7.0f, 524287.0f, 524287.0f}; + static const XMVECTORF32 ScaleIco4 = {1.0f,4096.0f*65536.0f,4096.0f,1.0f}; + static const XMVECTORI32 MaskIco4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF}; + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,MinIco4); + vResult = _mm_min_ps(vResult,MaxIco4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleIco4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskIco4); + // Shift y and z to straddle the 32-bit boundary + __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ + + #undef XM_Scale + #undef XM_URange + #undef XM_Offset +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreXDecN4 +( + XMXDECN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Min = {-1.0f, -1.0f, -1.0f, 0.0f}; + static CONST XMVECTORF32 Scale = {511.0f, 511.0f, 511.0f, 3.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->v = ((UINT)N.vector4_f32[3] << 30) | + (((INT)N.vector4_f32[2] & 0x3FF) << 20) | + (((INT)N.vector4_f32[1] & 0x3FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Min = {-1.0f, -1.0f, -1.0f, 0.0f}; + static const XMVECTORF32 Scale = {511.0f, 511.0f*1024.0f, 511.0f*1048576.0f,3.0f*536870912.0f}; + static const XMVECTORI32 ScaleMask = {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<29}; + XMASSERT(pDestination); + XMVECTOR vResult = _mm_max_ps(V,Min); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,Scale); + // Convert to int (W is unsigned) + __m128i vResulti = _mm_cvtps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,ScaleMask); + // To fix W, add itself to shift it up to <<30 instead of <<29 + __m128i vResultw = _mm_and_si128(vResulti,g_XMMaskW); + vResulti = _mm_add_epi32(vResulti,vResultw); + // Do a horizontal or of all 4 entries + vResult = _mm_shuffle_ps(reinterpret_cast(&vResulti)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreXDec4 +( + XMXDEC4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-511.0f, -511.0f, -511.0f, 0.0f}; + static CONST XMVECTOR Max = {511.0f, 511.0f, 511.0f, 3.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + + pDestination->v = ((UINT)N.vector4_f32[3] << 30) | + (((INT)N.vector4_f32[2] & 0x3FF) << 20) | + (((INT)N.vector4_f32[1] & 0x3FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MinXDec4 = {-511.0f,-511.0f,-511.0f, 0.0f}; + static const XMVECTORF32 MaxXDec4 = { 511.0f, 511.0f, 511.0f, 3.0f}; + static const XMVECTORF32 ScaleXDec4 = {1.0f,1024.0f/2.0f,1024.0f*1024.0f,1024.0f*1024.0f*1024.0f/2.0f}; + static const XMVECTORI32 MaskXDec4= {0x3FF,0x3FF<<(10-1),0x3FF<<20,0x3<<(30-1)}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,MinXDec4); + vResult = _mm_min_ps(vResult,MaxXDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleXDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskXDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // Perform a single bit left shift on y|w + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUDecN4 +( + XMUDECN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {1023.0f, 1023.0f, 1023.0f, 3.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = ((UINT)N.vector4_f32[3] << 30) | + (((UINT)N.vector4_f32[2] & 0x3FF) << 20) | + (((UINT)N.vector4_f32[1] & 0x3FF) << 10) | + (((UINT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleUDecN4 = {1023.0f,1023.0f*1024.0f*0.5f,1023.0f*1024.0f*1024.0f,3.0f*1024.0f*1024.0f*1024.0f*0.5f}; + static const XMVECTORI32 MaskUDecN4= {0x3FF,0x3FF<<(10-1),0x3FF<<20,0x3<<(30-1)}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUDecN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUDecN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // Perform a left shift by one bit on y|w + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUDec4 +( + XMUDEC4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {1023.0f, 1023.0f, 1023.0f, 3.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + + pDestination->v = ((UINT)N.vector4_f32[3] << 30) | + (((UINT)N.vector4_f32[2] & 0x3FF) << 20) | + (((UINT)N.vector4_f32[1] & 0x3FF) << 10) | + (((UINT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MaxUDec4 = { 1023.0f, 1023.0f, 1023.0f, 3.0f}; + static const XMVECTORF32 ScaleUDec4 = {1.0f,1024.0f/2.0f,1024.0f*1024.0f,1024.0f*1024.0f*1024.0f/2.0f}; + static const XMVECTORI32 MaskUDec4= {0x3FF,0x3FF<<(10-1),0x3FF<<20,0x3<<(30-1)}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,MaxUDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // Perform a left shift by one bit on y|w + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreDecN4 +( + XMDECN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {511.0f, 511.0f, 511.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = ((INT)N.vector4_f32[3] << 30) | + (((INT)N.vector4_f32[2] & 0x3FF) << 20) | + (((INT)N.vector4_f32[1] & 0x3FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleDecN4 = {511.0f,511.0f*1024.0f,511.0f*1024.0f*1024.0f,1.0f*1024.0f*1024.0f*1024.0f}; + static const XMVECTORI32 MaskDecN4= {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<30}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleDecN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskDecN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreDec4 +( + XMDEC4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-511.0f, -511.0f, -511.0f, -1.0f}; + static CONST XMVECTOR Max = {511.0f, 511.0f, 511.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + + pDestination->v = ((INT)N.vector4_f32[3] << 30) | + (((INT)N.vector4_f32[2] & 0x3FF) << 20) | + (((INT)N.vector4_f32[1] & 0x3FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MinDec4 = {-511.0f,-511.0f,-511.0f,-1.0f}; + static const XMVECTORF32 MaxDec4 = { 511.0f, 511.0f, 511.0f, 1.0f}; + static const XMVECTORF32 ScaleDec4 = {1.0f,1024.0f,1024.0f*1024.0f,1024.0f*1024.0f*1024.0f}; + static const XMVECTORI32 MaskDec4= {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<30}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,MinDec4); + vResult = _mm_min_ps(vResult,MaxDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUByteN4 +( + XMUBYTEN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {255.0f, 255.0f, 255.0f, 255.0f}; + + XMASSERT(pDestination); + + N = XMVectorSaturate(V); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->x = (BYTE)N.vector4_f32[0]; + pDestination->y = (BYTE)N.vector4_f32[1]; + pDestination->z = (BYTE)N.vector4_f32[2]; + pDestination->w = (BYTE)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleUByteN4 = {255.0f,255.0f*256.0f*0.5f,255.0f*256.0f*256.0f,255.0f*256.0f*256.0f*256.0f*0.5f}; + static const XMVECTORI32 MaskUByteN4 = {0xFF,0xFF<<(8-1),0xFF<<16,0xFF<<(24-1)}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUByteN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUByteN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // Perform a single bit left shift to fix y|w + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUByte4 +( + XMUBYTE4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {255.0f, 255.0f, 255.0f, 255.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + N = XMVectorRound(N); + + pDestination->x = (BYTE)N.vector4_f32[0]; + pDestination->y = (BYTE)N.vector4_f32[1]; + pDestination->z = (BYTE)N.vector4_f32[2]; + pDestination->w = (BYTE)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MaxUByte4 = { 255.0f, 255.0f, 255.0f, 255.0f}; + static const XMVECTORF32 ScaleUByte4 = {1.0f,256.0f*0.5f,256.0f*256.0f,256.0f*256.0f*256.0f*0.5f}; + static const XMVECTORI32 MaskUByte4 = {0xFF,0xFF<<(8-1),0xFF<<16,0xFF<<(24-1)}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,MaxUByte4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUByte4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUByte4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // Perform a single bit left shift to fix y|w + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreByteN4 +( + XMBYTEN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {127.0f, 127.0f, 127.0f, 127.0f}; + + XMASSERT(pDestination); + + N = XMVectorMultiply(V, Scale.v); + N = XMVectorRound(N); + + pDestination->x = (CHAR)N.vector4_f32[0]; + pDestination->y = (CHAR)N.vector4_f32[1]; + pDestination->z = (CHAR)N.vector4_f32[2]; + pDestination->w = (CHAR)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleByteN4 = {127.0f,127.0f*256.0f,127.0f*256.0f*256.0f,127.0f*256.0f*256.0f*256.0f}; + static const XMVECTORI32 MaskByteN4 = {0xFF,0xFF<<8,0xFF<<16,0xFF<<24}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleByteN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskByteN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreByte4 +( + XMBYTE4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-127.0f, -127.0f, -127.0f, -127.0f}; + static CONST XMVECTOR Max = {127.0f, 127.0f, 127.0f, 127.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + N = XMVectorRound(N); + + pDestination->x = (CHAR)N.vector4_f32[0]; + pDestination->y = (CHAR)N.vector4_f32[1]; + pDestination->z = (CHAR)N.vector4_f32[2]; + pDestination->w = (CHAR)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MinByte4 = {-127.0f,-127.0f,-127.0f,-127.0f}; + static const XMVECTORF32 MaxByte4 = { 127.0f, 127.0f, 127.0f, 127.0f}; + static const XMVECTORF32 ScaleByte4 = {1.0f,256.0f,256.0f*256.0f,256.0f*256.0f*256.0f}; + static const XMVECTORI32 MaskByte4 = {0xFF,0xFF<<8,0xFF<<16,0xFF<<24}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,MinByte4); + vResult = _mm_min_ps(vResult,MaxByte4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleByte4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskByte4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUNibble4 +( + XMUNIBBLE4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Max = {15.0f,15.0f,15.0f,15.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + USHORT x = static_cast(_mm_extract_epi16(vInt,0)); + USHORT y = static_cast(_mm_extract_epi16(vInt,2)); + USHORT z = static_cast(_mm_extract_epi16(vInt,4)); + USHORT w = static_cast(_mm_extract_epi16(vInt,6)); + pDestination->v = ((w & 0xF) << 12) | + ((z & 0xF) << 8) | + ((y & 0xF) << 4) | + ((x & 0xF)); +#else + XMVECTOR N; + static CONST XMVECTORF32 Max = {15.0f,15.0f,15.0f,15.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + pDestination->v = (((USHORT)N.vector4_f32[3] & 0xF) << 12) | + (((USHORT)N.vector4_f32[2] & 0xF) << 8) | + (((USHORT)N.vector4_f32[1] & 0xF) << 4) | + (((USHORT)N.vector4_f32[0] & 0xF)); +#endif !_XM_SSE_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreU555( + XMU555* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Max = {31.0f, 31.0f, 31.0f, 1.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + USHORT x = static_cast(_mm_extract_epi16(vInt,0)); + USHORT y = static_cast(_mm_extract_epi16(vInt,2)); + USHORT z = static_cast(_mm_extract_epi16(vInt,4)); + USHORT w = static_cast(_mm_extract_epi16(vInt,6)); + pDestination->v = ((w) ? 0x8000 : 0) | + ((z & 0x1F) << 10) | + ((y & 0x1F) << 5) | + ((x & 0x1F)); +#else + XMVECTOR N; + static CONST XMVECTORF32 Max = {31.0f, 31.0f, 31.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + pDestination->v = ((N.vector4_f32[3] > 0.f) ? 0x8000 : 0) | + (((USHORT)N.vector4_f32[2] & 0x1F) << 10) | + (((USHORT)N.vector4_f32[1] & 0x1F) << 5) | + (((USHORT)N.vector4_f32[0] & 0x1F)); +#endif !_XM_SSE_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreColor +( + XMCOLOR* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {255.0f, 255.0f, 255.0f, 255.0f}; + + XMASSERT(pDestination); + + N = XMVectorSaturate(V); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->c = ((UINT)N.vector4_f32[3] << 24) | + ((UINT)N.vector4_f32[0] << 16) | + ((UINT)N.vector4_f32[1] << 8) | + ((UINT)N.vector4_f32[2]); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Scale = {255.0f,255.0f,255.0f,255.0f}; + // Set <0 to 0 + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + // Set>1 to 1 + vResult = _mm_min_ps(vResult,g_XMOne); + // Convert to 0-255 + vResult = _mm_mul_ps(vResult,Scale); + // Shuffle RGBA to ARGB + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2)); + // Convert to int + __m128i vInt = _mm_cvtps_epi32(vResult); + // Mash to shorts + vInt = _mm_packs_epi32(vInt,vInt); + // Mash to bytes + vInt = _mm_packus_epi16(vInt,vInt); + // Store the color + _mm_store_ss(reinterpret_cast(&pDestination->c),reinterpret_cast<__m128 *>(&vInt)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3x3 +( + XMFLOAT3X3* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_) + + XMStoreFloat3x3NC(pDestination, M); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3x3NC +( + XMFLOAT3X3* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMVECTOR vTemp1 = M.r[0]; + XMVECTOR vTemp2 = M.r[1]; + XMVECTOR vTemp3 = M.r[2]; + XMVECTOR vWork = _mm_shuffle_ps(vTemp1,vTemp2,_MM_SHUFFLE(0,0,2,2)); + vTemp1 = _mm_shuffle_ps(vTemp1,vWork,_MM_SHUFFLE(2,0,1,0)); + _mm_storeu_ps(&pDestination->m[0][0],vTemp1); + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp3,_MM_SHUFFLE(1,0,2,1)); + _mm_storeu_ps(&pDestination->m[1][1],vTemp2); + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp3,_MM_SHUFFLE(2,2,2,2)); + _mm_store_ss(&pDestination->m[2][2],vTemp3); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x3 +( + XMFLOAT4X3* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_) + + XMStoreFloat4x3NC(pDestination, M); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x3A +( + XMFLOAT4X3A* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + // x1,y1,z1,w1 + XMVECTOR vTemp1 = M.r[0]; + // x2,y2,z2,w2 + XMVECTOR vTemp2 = M.r[1]; + // x3,y3,z3,w3 + XMVECTOR vTemp3 = M.r[2]; + // x4,y4,z4,w4 + XMVECTOR vTemp4 = M.r[3]; + // z1,z1,x2,y2 + XMVECTOR vTemp = _mm_shuffle_ps(vTemp1,vTemp2,_MM_SHUFFLE(1,0,2,2)); + // y2,z2,x3,y3 (Final) + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp3,_MM_SHUFFLE(1,0,2,1)); + // x1,y1,z1,x2 (Final) + vTemp1 = _mm_shuffle_ps(vTemp1,vTemp,_MM_SHUFFLE(2,0,1,0)); + // z3,z3,x4,x4 + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(0,0,2,2)); + // z3,x4,y4,z4 (Final) + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(2,1,2,0)); + // Store in 3 operations + _mm_store_ps(&pDestination->m[0][0],vTemp1); + _mm_store_ps(&pDestination->m[1][1],vTemp2); + _mm_store_ps(&pDestination->m[2][2],vTemp3); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x3NC +( + XMFLOAT4X3* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMVECTOR vTemp1 = M.r[0]; + XMVECTOR vTemp2 = M.r[1]; + XMVECTOR vTemp3 = M.r[2]; + XMVECTOR vTemp4 = M.r[3]; + XMVECTOR vTemp2x = _mm_shuffle_ps(vTemp2,vTemp3,_MM_SHUFFLE(1,0,2,1)); + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp1,_MM_SHUFFLE(2,2,0,0)); + vTemp1 = _mm_shuffle_ps(vTemp1,vTemp2,_MM_SHUFFLE(0,2,1,0)); + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(0,0,2,2)); + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(2,1,2,0)); + _mm_storeu_ps(&pDestination->m[0][0],vTemp1); + _mm_storeu_ps(&pDestination->m[1][1],vTemp2x); + _mm_storeu_ps(&pDestination->m[2][2],vTemp3); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x4 +( + XMFLOAT4X4* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) + + XMStoreFloat4x4NC(pDestination, M); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + + _mm_storeu_ps( &pDestination->_11, M.r[0] ); + _mm_storeu_ps( &pDestination->_21, M.r[1] ); + _mm_storeu_ps( &pDestination->_31, M.r[2] ); + _mm_storeu_ps( &pDestination->_41, M.r[3] ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x4A +( + XMFLOAT4X4A* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + pDestination->m[0][3] = M.r[0].vector4_f32[3]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + pDestination->m[1][3] = M.r[1].vector4_f32[3]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[2].vector4_f32[3]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + pDestination->m[3][3] = M.r[3].vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + + _mm_store_ps( &pDestination->_11, M.r[0] ); + _mm_store_ps( &pDestination->_21, M.r[1] ); + _mm_store_ps( &pDestination->_31, M.r[2] ); + _mm_store_ps( &pDestination->_41, M.r[3] ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x4NC +( + XMFLOAT4X4* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + pDestination->m[0][3] = M.r[0].vector4_f32[3]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + pDestination->m[1][3] = M.r[1].vector4_f32[3]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[2].vector4_f32[3]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + pDestination->m[3][3] = M.r[3].vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + _mm_storeu_ps(&pDestination->m[0][0],M.r[0]); + _mm_storeu_ps(&pDestination->m[1][0],M.r[1]); + _mm_storeu_ps(&pDestination->m[2][0],M.r[2]); + _mm_storeu_ps(&pDestination->m[3][0],M.r[3]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +#endif // __XNAMATHCONVERT_INL__ + diff --git a/RenderDll/Dx9Sdk/Include/xnamathmatrix.inl b/RenderDll/Dx9Sdk/Include/xnamathmatrix.inl new file mode 100644 index 0000000..7ce4c1f --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/xnamathmatrix.inl @@ -0,0 +1,3254 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xnamathmatrix.inl + +Abstract: + + XNA math library for Windows and Xbox 360: Matrix functions +--*/ + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#ifndef __XNAMATHMATRIX_INL__ +#define __XNAMATHMATRIX_INL__ + +/**************************************************************************** + * + * Matrix + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +// Return TRUE if any entry in the matrix is NaN +XMFINLINE BOOL XMMatrixIsNaN +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT i, uTest; + const UINT *pWork; + + i = 16; + pWork = (const UINT *)(&M.m[0][0]); + do { + // Fetch value into integer unit + uTest = pWork[0]; + // Remove sign + uTest &= 0x7FFFFFFFU; + // NaN is 0x7F800001 through 0x7FFFFFFF inclusive + uTest -= 0x7F800001U; + if (uTest<0x007FFFFFU) { + break; // NaN found + } + ++pWork; // Next entry + } while (--i); + return (i!=0); // i == 0 if nothing matched +#elif defined(_XM_SSE_INTRINSICS_) + // Load in registers + XMVECTOR vX = M.r[0]; + XMVECTOR vY = M.r[1]; + XMVECTOR vZ = M.r[2]; + XMVECTOR vW = M.r[3]; + // Test themselves to check for NaN + vX = _mm_cmpneq_ps(vX,vX); + vY = _mm_cmpneq_ps(vY,vY); + vZ = _mm_cmpneq_ps(vZ,vZ); + vW = _mm_cmpneq_ps(vW,vW); + // Or all the results + vX = _mm_or_ps(vX,vZ); + vY = _mm_or_ps(vY,vW); + vX = _mm_or_ps(vX,vY); + // If any tested true, return true + return (_mm_movemask_ps(vX)!=0); +#else +#endif +} + +//------------------------------------------------------------------------------ + +// Return TRUE if any entry in the matrix is +/-INF +XMFINLINE BOOL XMMatrixIsInfinite +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT i, uTest; + const UINT *pWork; + + i = 16; + pWork = (const UINT *)(&M.m[0][0]); + do { + // Fetch value into integer unit + uTest = pWork[0]; + // Remove sign + uTest &= 0x7FFFFFFFU; + // INF is 0x7F800000 + if (uTest==0x7F800000U) { + break; // INF found + } + ++pWork; // Next entry + } while (--i); + return (i!=0); // i == 0 if nothing matched +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bits + XMVECTOR vTemp1 = _mm_and_ps(M.r[0],g_XMAbsMask); + XMVECTOR vTemp2 = _mm_and_ps(M.r[1],g_XMAbsMask); + XMVECTOR vTemp3 = _mm_and_ps(M.r[2],g_XMAbsMask); + XMVECTOR vTemp4 = _mm_and_ps(M.r[3],g_XMAbsMask); + // Compare to infinity + vTemp1 = _mm_cmpeq_ps(vTemp1,g_XMInfinity); + vTemp2 = _mm_cmpeq_ps(vTemp2,g_XMInfinity); + vTemp3 = _mm_cmpeq_ps(vTemp3,g_XMInfinity); + vTemp4 = _mm_cmpeq_ps(vTemp4,g_XMInfinity); + // Or the answers together + vTemp1 = _mm_or_ps(vTemp1,vTemp2); + vTemp3 = _mm_or_ps(vTemp3,vTemp4); + vTemp1 = _mm_or_ps(vTemp1,vTemp3); + // If any are infinity, the signs are true. + return (_mm_movemask_ps(vTemp1)!=0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Return TRUE if the XMMatrix is equal to identity +XMFINLINE BOOL XMMatrixIsIdentity +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + unsigned int uOne, uZero; + const unsigned int *pWork; + + // Use the integer pipeline to reduce branching to a minimum + pWork = (const unsigned int*)(&M.m[0][0]); + // Convert 1.0f to zero and or them together + uOne = pWork[0]^0x3F800000U; + // Or all the 0.0f entries together + uZero = pWork[1]; + uZero |= pWork[2]; + uZero |= pWork[3]; + // 2nd row + uZero |= pWork[4]; + uOne |= pWork[5]^0x3F800000U; + uZero |= pWork[6]; + uZero |= pWork[7]; + // 3rd row + uZero |= pWork[8]; + uZero |= pWork[9]; + uOne |= pWork[10]^0x3F800000U; + uZero |= pWork[11]; + // 4th row + uZero |= pWork[12]; + uZero |= pWork[13]; + uZero |= pWork[14]; + uOne |= pWork[15]^0x3F800000U; + // If all zero entries are zero, the uZero==0 + uZero &= 0x7FFFFFFF; // Allow -0.0f + // If all 1.0f entries are 1.0f, then uOne==0 + uOne |= uZero; + return (uOne==0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = _mm_cmpeq_ps(M.r[0],g_XMIdentityR0); + XMVECTOR vTemp2 = _mm_cmpeq_ps(M.r[1],g_XMIdentityR1); + XMVECTOR vTemp3 = _mm_cmpeq_ps(M.r[2],g_XMIdentityR2); + XMVECTOR vTemp4 = _mm_cmpeq_ps(M.r[3],g_XMIdentityR3); + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + vTemp3 = _mm_and_ps(vTemp3,vTemp4); + vTemp1 = _mm_and_ps(vTemp1,vTemp3); + return (_mm_movemask_ps(vTemp1)==0x0f); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Perform a 4x4 matrix multiply by a 4x4 matrix +XMFINLINE XMMATRIX XMMatrixMultiply +( + CXMMATRIX M1, + CXMMATRIX M2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX mResult; + // Cache the invariants in registers + float x = M1.m[0][0]; + float y = M1.m[0][1]; + float z = M1.m[0][2]; + float w = M1.m[0][3]; + // Perform the operation on the first row + mResult.m[0][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w); + mResult.m[0][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w); + mResult.m[0][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w); + mResult.m[0][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w); + // Repeat for all the other rows + x = M1.m[1][0]; + y = M1.m[1][1]; + z = M1.m[1][2]; + w = M1.m[1][3]; + mResult.m[1][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w); + mResult.m[1][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w); + mResult.m[1][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w); + mResult.m[1][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w); + x = M1.m[2][0]; + y = M1.m[2][1]; + z = M1.m[2][2]; + w = M1.m[2][3]; + mResult.m[2][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w); + mResult.m[2][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w); + mResult.m[2][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w); + mResult.m[2][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w); + x = M1.m[3][0]; + y = M1.m[3][1]; + z = M1.m[3][2]; + w = M1.m[3][3]; + mResult.m[3][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w); + mResult.m[3][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w); + mResult.m[3][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w); + mResult.m[3][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w); + return mResult; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX mResult; + // Use vW to hold the original row + XMVECTOR vW = M1.r[0]; + // Splat the component X,Y,Z then W + XMVECTOR vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0)); + XMVECTOR vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2)); + vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3)); + // Perform the opertion on the first row + vX = _mm_mul_ps(vX,M2.r[0]); + vY = _mm_mul_ps(vY,M2.r[1]); + vZ = _mm_mul_ps(vZ,M2.r[2]); + vW = _mm_mul_ps(vW,M2.r[3]); + // Perform a binary add to reduce cumulative errors + vX = _mm_add_ps(vX,vZ); + vY = _mm_add_ps(vY,vW); + vX = _mm_add_ps(vX,vY); + mResult.r[0] = vX; + // Repeat for the other 3 rows + vW = M1.r[1]; + vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0)); + vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1)); + vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2)); + vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3)); + vX = _mm_mul_ps(vX,M2.r[0]); + vY = _mm_mul_ps(vY,M2.r[1]); + vZ = _mm_mul_ps(vZ,M2.r[2]); + vW = _mm_mul_ps(vW,M2.r[3]); + vX = _mm_add_ps(vX,vZ); + vY = _mm_add_ps(vY,vW); + vX = _mm_add_ps(vX,vY); + mResult.r[1] = vX; + vW = M1.r[2]; + vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0)); + vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1)); + vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2)); + vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3)); + vX = _mm_mul_ps(vX,M2.r[0]); + vY = _mm_mul_ps(vY,M2.r[1]); + vZ = _mm_mul_ps(vZ,M2.r[2]); + vW = _mm_mul_ps(vW,M2.r[3]); + vX = _mm_add_ps(vX,vZ); + vY = _mm_add_ps(vY,vW); + vX = _mm_add_ps(vX,vY); + mResult.r[2] = vX; + vW = M1.r[3]; + vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0)); + vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1)); + vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2)); + vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3)); + vX = _mm_mul_ps(vX,M2.r[0]); + vY = _mm_mul_ps(vY,M2.r[1]); + vZ = _mm_mul_ps(vZ,M2.r[2]); + vW = _mm_mul_ps(vW,M2.r[3]); + vX = _mm_add_ps(vX,vZ); + vY = _mm_add_ps(vY,vW); + vX = _mm_add_ps(vX,vY); + mResult.r[3] = vX; + return mResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixMultiplyTranspose +( + CXMMATRIX M1, + CXMMATRIX M2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX mResult; + // Cache the invariants in registers + float x = M2.m[0][0]; + float y = M2.m[1][0]; + float z = M2.m[2][0]; + float w = M2.m[3][0]; + // Perform the operation on the first row + mResult.m[0][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w); + mResult.m[0][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w); + mResult.m[0][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w); + mResult.m[0][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w); + // Repeat for all the other rows + x = M2.m[0][1]; + y = M2.m[1][1]; + z = M2.m[2][1]; + w = M2.m[3][1]; + mResult.m[1][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w); + mResult.m[1][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w); + mResult.m[1][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w); + mResult.m[1][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w); + x = M2.m[0][2]; + y = M2.m[1][2]; + z = M2.m[2][2]; + w = M2.m[3][2]; + mResult.m[2][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w); + mResult.m[2][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w); + mResult.m[2][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w); + mResult.m[2][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w); + x = M2.m[0][3]; + y = M2.m[1][3]; + z = M2.m[2][3]; + w = M2.m[3][3]; + mResult.m[3][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w); + mResult.m[3][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w); + mResult.m[3][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w); + mResult.m[3][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w); + return mResult; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX Product; + XMMATRIX Result; + Product = XMMatrixMultiply(M1, M2); + Result = XMMatrixTranspose(Product); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixTranspose +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX P; + XMMATRIX MT; + + // Original matrix: + // + // m00m01m02m03 + // m10m11m12m13 + // m20m21m22m23 + // m30m31m32m33 + + P.r[0] = XMVectorMergeXY(M.r[0], M.r[2]); // m00m20m01m21 + P.r[1] = XMVectorMergeXY(M.r[1], M.r[3]); // m10m30m11m31 + P.r[2] = XMVectorMergeZW(M.r[0], M.r[2]); // m02m22m03m23 + P.r[3] = XMVectorMergeZW(M.r[1], M.r[3]); // m12m32m13m33 + + MT.r[0] = XMVectorMergeXY(P.r[0], P.r[1]); // m00m10m20m30 + MT.r[1] = XMVectorMergeZW(P.r[0], P.r[1]); // m01m11m21m31 + MT.r[2] = XMVectorMergeXY(P.r[2], P.r[3]); // m02m12m22m32 + MT.r[3] = XMVectorMergeZW(P.r[2], P.r[3]); // m03m13m23m33 + + return MT; + +#elif defined(_XM_SSE_INTRINSICS_) + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0],M.r[1],_MM_SHUFFLE(1,0,1,0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0],M.r[1],_MM_SHUFFLE(3,2,3,2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2],M.r[3],_MM_SHUFFLE(1,0,1,0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2],M.r[3],_MM_SHUFFLE(3,2,3,2)); + XMMATRIX mResult; + + // x.x,y.x,z.x,w.x + mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2,_MM_SHUFFLE(2,0,2,0)); + // x.y,y.y,z.y,w.y + mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2,_MM_SHUFFLE(3,1,3,1)); + // x.z,y.z,z.z,w.z + mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4,_MM_SHUFFLE(2,0,2,0)); + // x.w,y.w,z.w,w.w + mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4,_MM_SHUFFLE(3,1,3,1)); + return mResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return the inverse and the determinant of a 4x4 matrix +XMINLINE XMMATRIX XMMatrixInverse +( + XMVECTOR* pDeterminant, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX R; + XMMATRIX MT; + XMVECTOR D0, D1, D2; + XMVECTOR C0, C1, C2, C3, C4, C5, C6, C7; + XMVECTOR V0[4], V1[4]; + XMVECTOR Determinant; + XMVECTOR Reciprocal; + XMMATRIX Result; + static CONST XMVECTORU32 SwizzleXXYY = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 SwizzleZWZW = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_0Z, XM_PERMUTE_0W}; + static CONST XMVECTORU32 SwizzleYZXY = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 SwizzleZWYZ = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_0Y, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 SwizzleWXWX = {XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_0X}; + static CONST XMVECTORU32 SwizzleZXYX = {XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0X}; + static CONST XMVECTORU32 SwizzleYWXZ = {XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 SwizzleWZWY = {XM_PERMUTE_0W, XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 Permute0X0Z1X1Z = {XM_PERMUTE_0X, XM_PERMUTE_0Z, XM_PERMUTE_1X, XM_PERMUTE_1Z}; + static CONST XMVECTORU32 Permute0Y0W1Y1W = {XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_1Y, XM_PERMUTE_1W}; + static CONST XMVECTORU32 Permute1Y0Y0W0X = {XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute0W0X0Y1X = {XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_1X}; + static CONST XMVECTORU32 Permute0Z1Y1X0Z = {XM_PERMUTE_0Z, XM_PERMUTE_1Y, XM_PERMUTE_1X, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 Permute0W1Y0Y0Z = {XM_PERMUTE_0W, XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 Permute0Z0Y1X0X = {XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute1Y0X0W1X = {XM_PERMUTE_1Y, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1X}; + static CONST XMVECTORU32 Permute1W0Y0W0X = {XM_PERMUTE_1W, XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute0W0X0Y1Z = {XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_1Z}; + static CONST XMVECTORU32 Permute0Z1W1Z0Z = {XM_PERMUTE_0Z, XM_PERMUTE_1W, XM_PERMUTE_1Z, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 Permute0W1W0Y0Z = {XM_PERMUTE_0W, XM_PERMUTE_1W, XM_PERMUTE_0Y, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 Permute0Z0Y1Z0X = {XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_1Z, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute1W0X0W1Z = {XM_PERMUTE_1W, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1Z}; + + XMASSERT(pDeterminant); + + MT = XMMatrixTranspose(M); + + V0[0] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleXXYY.v); + V1[0] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleZWZW.v); + V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleXXYY.v); + V1[1] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleZWZW.v); + V0[2] = XMVectorPermute(MT.r[2], MT.r[0], Permute0X0Z1X1Z.v); + V1[2] = XMVectorPermute(MT.r[3], MT.r[1], Permute0Y0W1Y1W.v); + + D0 = XMVectorMultiply(V0[0], V1[0]); + D1 = XMVectorMultiply(V0[1], V1[1]); + D2 = XMVectorMultiply(V0[2], V1[2]); + + V0[0] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleZWZW.v); + V1[0] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleXXYY.v); + V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleZWZW.v); + V1[1] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleXXYY.v); + V0[2] = XMVectorPermute(MT.r[2], MT.r[0], Permute0Y0W1Y1W.v); + V1[2] = XMVectorPermute(MT.r[3], MT.r[1], Permute0X0Z1X1Z.v); + + D0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], D0); + D1 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], D1); + D2 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], D2); + + V0[0] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleYZXY.v); + V1[0] = XMVectorPermute(D0, D2, Permute1Y0Y0W0X.v); + V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleZXYX.v); + V1[1] = XMVectorPermute(D0, D2, Permute0W1Y0Y0Z.v); + V0[2] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleYZXY.v); + V1[2] = XMVectorPermute(D1, D2, Permute1W0Y0W0X.v); + V0[3] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleZXYX.v); + V1[3] = XMVectorPermute(D1, D2, Permute0W1W0Y0Z.v); + + C0 = XMVectorMultiply(V0[0], V1[0]); + C2 = XMVectorMultiply(V0[1], V1[1]); + C4 = XMVectorMultiply(V0[2], V1[2]); + C6 = XMVectorMultiply(V0[3], V1[3]); + + V0[0] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleZWYZ.v); + V1[0] = XMVectorPermute(D0, D2, Permute0W0X0Y1X.v); + V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleWZWY.v); + V1[1] = XMVectorPermute(D0, D2, Permute0Z0Y1X0X.v); + V0[2] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleZWYZ.v); + V1[2] = XMVectorPermute(D1, D2, Permute0W0X0Y1Z.v); + V0[3] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleWZWY.v); + V1[3] = XMVectorPermute(D1, D2, Permute0Z0Y1Z0X.v); + + C0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0); + C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2); + C4 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4); + C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6); + + V0[0] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleWXWX.v); + V1[0] = XMVectorPermute(D0, D2, Permute0Z1Y1X0Z.v); + V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleYWXZ.v); + V1[1] = XMVectorPermute(D0, D2, Permute1Y0X0W1X.v); + V0[2] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleWXWX.v); + V1[2] = XMVectorPermute(D1, D2, Permute0Z1W1Z0Z.v); + V0[3] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleYWXZ.v); + V1[3] = XMVectorPermute(D1, D2, Permute1W0X0W1Z.v); + + C1 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0); + C0 = XMVectorMultiplyAdd(V0[0], V1[0], C0); + C3 = XMVectorMultiplyAdd(V0[1], V1[1], C2); + C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2); + C5 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4); + C4 = XMVectorMultiplyAdd(V0[2], V1[2], C4); + C7 = XMVectorMultiplyAdd(V0[3], V1[3], C6); + C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6); + + R.r[0] = XMVectorSelect(C0, C1, g_XMSelect0101.v); + R.r[1] = XMVectorSelect(C2, C3, g_XMSelect0101.v); + R.r[2] = XMVectorSelect(C4, C5, g_XMSelect0101.v); + R.r[3] = XMVectorSelect(C6, C7, g_XMSelect0101.v); + + Determinant = XMVector4Dot(R.r[0], MT.r[0]); + + *pDeterminant = Determinant; + + Reciprocal = XMVectorReciprocal(Determinant); + + Result.r[0] = XMVectorMultiply(R.r[0], Reciprocal); + Result.r[1] = XMVectorMultiply(R.r[1], Reciprocal); + Result.r[2] = XMVectorMultiply(R.r[2], Reciprocal); + Result.r[3] = XMVectorMultiply(R.r[3], Reciprocal); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDeterminant); + XMMATRIX MT = XMMatrixTranspose(M); + XMVECTOR V00 = _mm_shuffle_ps(MT.r[2], MT.r[2],_MM_SHUFFLE(1,1,0,0)); + XMVECTOR V10 = _mm_shuffle_ps(MT.r[3], MT.r[3],_MM_SHUFFLE(3,2,3,2)); + XMVECTOR V01 = _mm_shuffle_ps(MT.r[0], MT.r[0],_MM_SHUFFLE(1,1,0,0)); + XMVECTOR V11 = _mm_shuffle_ps(MT.r[1], MT.r[1],_MM_SHUFFLE(3,2,3,2)); + XMVECTOR V02 = _mm_shuffle_ps(MT.r[2], MT.r[0],_MM_SHUFFLE(2,0,2,0)); + XMVECTOR V12 = _mm_shuffle_ps(MT.r[3], MT.r[1],_MM_SHUFFLE(3,1,3,1)); + + XMVECTOR D0 = _mm_mul_ps(V00,V10); + XMVECTOR D1 = _mm_mul_ps(V01,V11); + XMVECTOR D2 = _mm_mul_ps(V02,V12); + + V00 = _mm_shuffle_ps(MT.r[2],MT.r[2],_MM_SHUFFLE(3,2,3,2)); + V10 = _mm_shuffle_ps(MT.r[3],MT.r[3],_MM_SHUFFLE(1,1,0,0)); + V01 = _mm_shuffle_ps(MT.r[0],MT.r[0],_MM_SHUFFLE(3,2,3,2)); + V11 = _mm_shuffle_ps(MT.r[1],MT.r[1],_MM_SHUFFLE(1,1,0,0)); + V02 = _mm_shuffle_ps(MT.r[2],MT.r[0],_MM_SHUFFLE(3,1,3,1)); + V12 = _mm_shuffle_ps(MT.r[3],MT.r[1],_MM_SHUFFLE(2,0,2,0)); + + V00 = _mm_mul_ps(V00,V10); + V01 = _mm_mul_ps(V01,V11); + V02 = _mm_mul_ps(V02,V12); + D0 = _mm_sub_ps(D0,V00); + D1 = _mm_sub_ps(D1,V01); + D2 = _mm_sub_ps(D2,V02); + // V11 = D0Y,D0W,D2Y,D2Y + V11 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(1,1,3,1)); + V00 = _mm_shuffle_ps(MT.r[1], MT.r[1],_MM_SHUFFLE(1,0,2,1)); + V10 = _mm_shuffle_ps(V11,D0,_MM_SHUFFLE(0,3,0,2)); + V01 = _mm_shuffle_ps(MT.r[0], MT.r[0],_MM_SHUFFLE(0,1,0,2)); + V11 = _mm_shuffle_ps(V11,D0,_MM_SHUFFLE(2,1,2,1)); + // V13 = D1Y,D1W,D2W,D2W + XMVECTOR V13 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(3,3,3,1)); + V02 = _mm_shuffle_ps(MT.r[3], MT.r[3],_MM_SHUFFLE(1,0,2,1)); + V12 = _mm_shuffle_ps(V13,D1,_MM_SHUFFLE(0,3,0,2)); + XMVECTOR V03 = _mm_shuffle_ps(MT.r[2], MT.r[2],_MM_SHUFFLE(0,1,0,2)); + V13 = _mm_shuffle_ps(V13,D1,_MM_SHUFFLE(2,1,2,1)); + + XMVECTOR C0 = _mm_mul_ps(V00,V10); + XMVECTOR C2 = _mm_mul_ps(V01,V11); + XMVECTOR C4 = _mm_mul_ps(V02,V12); + XMVECTOR C6 = _mm_mul_ps(V03,V13); + + // V11 = D0X,D0Y,D2X,D2X + V11 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(0,0,1,0)); + V00 = _mm_shuffle_ps(MT.r[1], MT.r[1],_MM_SHUFFLE(2,1,3,2)); + V10 = _mm_shuffle_ps(D0,V11,_MM_SHUFFLE(2,1,0,3)); + V01 = _mm_shuffle_ps(MT.r[0], MT.r[0],_MM_SHUFFLE(1,3,2,3)); + V11 = _mm_shuffle_ps(D0,V11,_MM_SHUFFLE(0,2,1,2)); + // V13 = D1X,D1Y,D2Z,D2Z + V13 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(2,2,1,0)); + V02 = _mm_shuffle_ps(MT.r[3], MT.r[3],_MM_SHUFFLE(2,1,3,2)); + V12 = _mm_shuffle_ps(D1,V13,_MM_SHUFFLE(2,1,0,3)); + V03 = _mm_shuffle_ps(MT.r[2], MT.r[2],_MM_SHUFFLE(1,3,2,3)); + V13 = _mm_shuffle_ps(D1,V13,_MM_SHUFFLE(0,2,1,2)); + + V00 = _mm_mul_ps(V00,V10); + V01 = _mm_mul_ps(V01,V11); + V02 = _mm_mul_ps(V02,V12); + V03 = _mm_mul_ps(V03,V13); + C0 = _mm_sub_ps(C0,V00); + C2 = _mm_sub_ps(C2,V01); + C4 = _mm_sub_ps(C4,V02); + C6 = _mm_sub_ps(C6,V03); + + V00 = _mm_shuffle_ps(MT.r[1],MT.r[1],_MM_SHUFFLE(0,3,0,3)); + // V10 = D0Z,D0Z,D2X,D2Y + V10 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(1,0,2,2)); + V10 = _mm_shuffle_ps(V10,V10,_MM_SHUFFLE(0,2,3,0)); + V01 = _mm_shuffle_ps(MT.r[0],MT.r[0],_MM_SHUFFLE(2,0,3,1)); + // V11 = D0X,D0W,D2X,D2Y + V11 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(1,0,3,0)); + V11 = _mm_shuffle_ps(V11,V11,_MM_SHUFFLE(2,1,0,3)); + V02 = _mm_shuffle_ps(MT.r[3],MT.r[3],_MM_SHUFFLE(0,3,0,3)); + // V12 = D1Z,D1Z,D2Z,D2W + V12 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(3,2,2,2)); + V12 = _mm_shuffle_ps(V12,V12,_MM_SHUFFLE(0,2,3,0)); + V03 = _mm_shuffle_ps(MT.r[2],MT.r[2],_MM_SHUFFLE(2,0,3,1)); + // V13 = D1X,D1W,D2Z,D2W + V13 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(3,2,3,0)); + V13 = _mm_shuffle_ps(V13,V13,_MM_SHUFFLE(2,1,0,3)); + + V00 = _mm_mul_ps(V00,V10); + V01 = _mm_mul_ps(V01,V11); + V02 = _mm_mul_ps(V02,V12); + V03 = _mm_mul_ps(V03,V13); + XMVECTOR C1 = _mm_sub_ps(C0,V00); + C0 = _mm_add_ps(C0,V00); + XMVECTOR C3 = _mm_add_ps(C2,V01); + C2 = _mm_sub_ps(C2,V01); + XMVECTOR C5 = _mm_sub_ps(C4,V02); + C4 = _mm_add_ps(C4,V02); + XMVECTOR C7 = _mm_add_ps(C6,V03); + C6 = _mm_sub_ps(C6,V03); + + C0 = _mm_shuffle_ps(C0,C1,_MM_SHUFFLE(3,1,2,0)); + C2 = _mm_shuffle_ps(C2,C3,_MM_SHUFFLE(3,1,2,0)); + C4 = _mm_shuffle_ps(C4,C5,_MM_SHUFFLE(3,1,2,0)); + C6 = _mm_shuffle_ps(C6,C7,_MM_SHUFFLE(3,1,2,0)); + C0 = _mm_shuffle_ps(C0,C0,_MM_SHUFFLE(3,1,2,0)); + C2 = _mm_shuffle_ps(C2,C2,_MM_SHUFFLE(3,1,2,0)); + C4 = _mm_shuffle_ps(C4,C4,_MM_SHUFFLE(3,1,2,0)); + C6 = _mm_shuffle_ps(C6,C6,_MM_SHUFFLE(3,1,2,0)); + // Get the determinate + XMVECTOR vTemp = XMVector4Dot(C0,MT.r[0]); + *pDeterminant = vTemp; + vTemp = _mm_div_ps(g_XMOne,vTemp); + XMMATRIX mResult; + mResult.r[0] = _mm_mul_ps(C0,vTemp); + mResult.r[1] = _mm_mul_ps(C2,vTemp); + mResult.r[2] = _mm_mul_ps(C4,vTemp); + mResult.r[3] = _mm_mul_ps(C6,vTemp); + return mResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMMatrixDeterminant +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V0, V1, V2, V3, V4, V5; + XMVECTOR P0, P1, P2, R, S; + XMVECTOR Result; + static CONST XMVECTORU32 SwizzleYXXX = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X}; + static CONST XMVECTORU32 SwizzleZZYY = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 SwizzleWWWZ = {XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0Z}; + static CONST XMVECTOR Sign = {1.0f, -1.0f, 1.0f, -1.0f}; + + V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX.v); + V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY.v); + V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX.v); + V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ.v); + V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY.v); + V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ.v); + + P0 = XMVectorMultiply(V0, V1); + P1 = XMVectorMultiply(V2, V3); + P2 = XMVectorMultiply(V4, V5); + + V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY.v); + V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX.v); + V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ.v); + V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX.v); + V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ.v); + V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY.v); + + P0 = XMVectorNegativeMultiplySubtract(V0, V1, P0); + P1 = XMVectorNegativeMultiplySubtract(V2, V3, P1); + P2 = XMVectorNegativeMultiplySubtract(V4, V5, P2); + + V0 = XMVectorPermute(M.r[1], M.r[1], SwizzleWWWZ.v); + V1 = XMVectorPermute(M.r[1], M.r[1], SwizzleZZYY.v); + V2 = XMVectorPermute(M.r[1], M.r[1], SwizzleYXXX.v); + + S = XMVectorMultiply(M.r[0], Sign); + R = XMVectorMultiply(V0, P0); + R = XMVectorNegativeMultiplySubtract(V1, P1, R); + R = XMVectorMultiplyAdd(V2, P2, R); + + Result = XMVector4Dot(S, R); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V0, V1, V2, V3, V4, V5; + XMVECTOR P0, P1, P2, R, S; + XMVECTOR Result; + static CONST XMVECTORU32 SwizzleYXXX = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X}; + static CONST XMVECTORU32 SwizzleZZYY = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 SwizzleWWWZ = {XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0Z}; + static CONST XMVECTORF32 Sign = {1.0f, -1.0f, 1.0f, -1.0f}; + + V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX); + V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY); + V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX); + V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ); + V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY); + V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ); + + P0 = _mm_mul_ps(V0, V1); + P1 = _mm_mul_ps(V2, V3); + P2 = _mm_mul_ps(V4, V5); + + V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY); + V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX); + V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ); + V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX); + V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ); + V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY); + + P0 = XMVectorNegativeMultiplySubtract(V0, V1, P0); + P1 = XMVectorNegativeMultiplySubtract(V2, V3, P1); + P2 = XMVectorNegativeMultiplySubtract(V4, V5, P2); + + V0 = XMVectorPermute(M.r[1], M.r[1], SwizzleWWWZ); + V1 = XMVectorPermute(M.r[1], M.r[1], SwizzleZZYY); + V2 = XMVectorPermute(M.r[1], M.r[1], SwizzleYXXX); + + S = _mm_mul_ps(M.r[0], Sign); + R = _mm_mul_ps(V0, P0); + R = XMVectorNegativeMultiplySubtract(V1, P1, R); + R = XMVectorMultiplyAdd(V2, P2, R); + + Result = XMVector4Dot(S, R); + + return Result; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +#define XMRANKDECOMPOSE(a, b, c, x, y, z) \ + if((x) < (y)) \ + { \ + if((y) < (z)) \ + { \ + (a) = 2; \ + (b) = 1; \ + (c) = 0; \ + } \ + else \ + { \ + (a) = 1; \ + \ + if((x) < (z)) \ + { \ + (b) = 2; \ + (c) = 0; \ + } \ + else \ + { \ + (b) = 0; \ + (c) = 2; \ + } \ + } \ + } \ + else \ + { \ + if((x) < (z)) \ + { \ + (a) = 2; \ + (b) = 0; \ + (c) = 1; \ + } \ + else \ + { \ + (a) = 0; \ + \ + if((y) < (z)) \ + { \ + (b) = 2; \ + (c) = 1; \ + } \ + else \ + { \ + (b) = 1; \ + (c) = 2; \ + } \ + } \ + } + +#define XM_DECOMP_EPSILON 0.0001f + +XMINLINE BOOL XMMatrixDecompose( XMVECTOR *outScale, XMVECTOR *outRotQuat, XMVECTOR *outTrans, CXMMATRIX M ) +{ + FLOAT fDet; + FLOAT *pfScales; + XMVECTOR *ppvBasis[3]; + XMMATRIX matTemp; + UINT a, b, c; + static const XMVECTOR *pvCanonicalBasis[3] = { + &g_XMIdentityR0.v, + &g_XMIdentityR1.v, + &g_XMIdentityR2.v + }; + + // Get the translation + outTrans[0] = M.r[3]; + + ppvBasis[0] = &matTemp.r[0]; + ppvBasis[1] = &matTemp.r[1]; + ppvBasis[2] = &matTemp.r[2]; + + matTemp.r[0] = M.r[0]; + matTemp.r[1] = M.r[1]; + matTemp.r[2] = M.r[2]; + matTemp.r[3] = g_XMIdentityR3.v; + + pfScales = (FLOAT *)outScale; + + XMVectorGetXPtr(&pfScales[0],XMVector3Length(ppvBasis[0][0])); + XMVectorGetXPtr(&pfScales[1],XMVector3Length(ppvBasis[1][0])); + XMVectorGetXPtr(&pfScales[2],XMVector3Length(ppvBasis[2][0])); + + XMRANKDECOMPOSE(a, b, c, pfScales[0], pfScales[1], pfScales[2]) + + if(pfScales[a] < XM_DECOMP_EPSILON) + { + ppvBasis[a][0] = pvCanonicalBasis[a][0]; + } + ppvBasis[a][0] = XMVector3Normalize(ppvBasis[a][0]); + + if(pfScales[b] < XM_DECOMP_EPSILON) + { + UINT aa, bb, cc; + FLOAT fAbsX, fAbsY, fAbsZ; + + fAbsX = fabsf(XMVectorGetX(ppvBasis[a][0])); + fAbsY = fabsf(XMVectorGetY(ppvBasis[a][0])); + fAbsZ = fabsf(XMVectorGetZ(ppvBasis[a][0])); + + XMRANKDECOMPOSE(aa, bb, cc, fAbsX, fAbsY, fAbsZ) + + ppvBasis[b][0] = XMVector3Cross(ppvBasis[a][0],pvCanonicalBasis[cc][0]); + } + + ppvBasis[b][0] = XMVector3Normalize(ppvBasis[b][0]); + + if(pfScales[c] < XM_DECOMP_EPSILON) + { + ppvBasis[c][0] = XMVector3Cross(ppvBasis[a][0],ppvBasis[b][0]); + } + + ppvBasis[c][0] = XMVector3Normalize(ppvBasis[c][0]); + + fDet = XMVectorGetX(XMMatrixDeterminant(matTemp)); + + // use Kramer's rule to check for handedness of coordinate system + if(fDet < 0.0f) + { + // switch coordinate system by negating the scale and inverting the basis vector on the x-axis + pfScales[a] = -pfScales[a]; + ppvBasis[a][0] = XMVectorNegate(ppvBasis[a][0]); + + fDet = -fDet; + } + + fDet -= 1.0f; + fDet *= fDet; + + if(XM_DECOMP_EPSILON < fDet) + { +// Non-SRT matrix encountered + return FALSE; + } + + // generate the quaternion from the matrix + outRotQuat[0] = XMQuaternionRotationMatrix(matTemp); + return TRUE; +} + +//------------------------------------------------------------------------------ +// Transformation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixIdentity() +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0] = g_XMIdentityR0.v; + M.r[1] = g_XMIdentityR1.v; + M.r[2] = g_XMIdentityR2.v; + M.r[3] = g_XMIdentityR3.v; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = g_XMIdentityR0; + M.r[1] = g_XMIdentityR1; + M.r[2] = g_XMIdentityR2; + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixSet +( + FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33 +) +{ + XMMATRIX M; + + M.r[0] = XMVectorSet(m00, m01, m02, m03); + M.r[1] = XMVectorSet(m10, m11, m12, m13); + M.r[2] = XMVectorSet(m20, m21, m22, m23); + M.r[3] = XMVectorSet(m30, m31, m32, m33); + + return M; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixTranslation +( + FLOAT OffsetX, + FLOAT OffsetY, + FLOAT OffsetZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = OffsetX; + M.m[3][1] = OffsetY; + M.m[3][2] = OffsetZ; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = g_XMIdentityR0; + M.r[1] = g_XMIdentityR1; + M.r[2] = g_XMIdentityR2; + M.r[3] = _mm_set_ps(1.0f,OffsetZ,OffsetY,OffsetX); + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixTranslationFromVector +( + FXMVECTOR Offset +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = Offset.vector4_f32[0]; + M.m[3][1] = Offset.vector4_f32[1]; + M.m[3][2] = Offset.vector4_f32[2]; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_and_ps(Offset,g_XMMask3); + vTemp = _mm_or_ps(vTemp,g_XMIdentityR3); + XMMATRIX M; + M.r[0] = g_XMIdentityR0; + M.r[1] = g_XMIdentityR1; + M.r[2] = g_XMIdentityR2; + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixScaling +( + FLOAT ScaleX, + FLOAT ScaleY, + FLOAT ScaleZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + M.r[0] = XMVectorSet(ScaleX, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, ScaleY, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, ScaleZ, 0.0f); + + M.r[3] = g_XMIdentityR3.v; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_set_ps( 0, 0, 0, ScaleX ); + M.r[1] = _mm_set_ps( 0, 0, ScaleY, 0 ); + M.r[2] = _mm_set_ps( 0, ScaleZ, 0, 0 ); + M.r[3] = g_XMIdentityR3; + return M; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixScalingFromVector +( + FXMVECTOR Scale +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + M.m[0][0] = Scale.vector4_f32[0]; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = Scale.vector4_f32[1]; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = Scale.vector4_f32[2]; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_and_ps(Scale,g_XMMaskX); + M.r[1] = _mm_and_ps(Scale,g_XMMaskY); + M.r[2] = _mm_and_ps(Scale,g_XMMaskZ); + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationX +( + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + + FLOAT fSinAngle = sinf(Angle); + FLOAT fCosAngle = cosf(Angle); + + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = fCosAngle; + M.m[1][2] = fSinAngle; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = -fSinAngle; + M.m[2][2] = fCosAngle; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + FLOAT SinAngle = sinf(Angle); + FLOAT CosAngle = cosf(Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = 0,y = cos,z = sin, w = 0 + vCos = _mm_shuffle_ps(vCos,vSin,_MM_SHUFFLE(3,0,0,3)); + XMMATRIX M; + M.r[0] = g_XMIdentityR0; + M.r[1] = vCos; + // x = 0,y = sin,z = cos, w = 0 + vCos = _mm_shuffle_ps(vCos,vCos,_MM_SHUFFLE(3,1,2,0)); + // x = 0,y = -sin,z = cos, w = 0 + vCos = _mm_mul_ps(vCos,g_XMNegateY); + M.r[2] = vCos; + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationY +( + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + + FLOAT fSinAngle = sinf(Angle); + FLOAT fCosAngle = cosf(Angle); + + M.m[0][0] = fCosAngle; + M.m[0][1] = 0.0f; + M.m[0][2] = -fSinAngle; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = fSinAngle; + M.m[2][1] = 0.0f; + M.m[2][2] = fCosAngle; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + FLOAT SinAngle = sinf(Angle); + FLOAT CosAngle = cosf(Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = sin,y = 0,z = cos, w = 0 + vSin = _mm_shuffle_ps(vSin,vCos,_MM_SHUFFLE(3,0,3,0)); + XMMATRIX M; + M.r[2] = vSin; + M.r[1] = g_XMIdentityR1; + // x = cos,y = 0,z = sin, w = 0 + vSin = _mm_shuffle_ps(vSin,vSin,_MM_SHUFFLE(3,0,1,2)); + // x = cos,y = 0,z = -sin, w = 0 + vSin = _mm_mul_ps(vSin,g_XMNegateZ); + M.r[0] = vSin; + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationZ +( + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + + FLOAT fSinAngle = sinf(Angle); + FLOAT fCosAngle = cosf(Angle); + + M.m[0][0] = fCosAngle; + M.m[0][1] = fSinAngle; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = -fSinAngle; + M.m[1][1] = fCosAngle; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + FLOAT SinAngle = sinf(Angle); + FLOAT CosAngle = cosf(Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = cos,y = sin,z = 0, w = 0 + vCos = _mm_unpacklo_ps(vCos,vSin); + XMMATRIX M; + M.r[0] = vCos; + // x = sin,y = cos,z = 0, w = 0 + vCos = _mm_shuffle_ps(vCos,vCos,_MM_SHUFFLE(3,2,0,1)); + // x = cos,y = -sin,z = 0, w = 0 + vCos = _mm_mul_ps(vCos,g_XMNegateX); + M.r[1] = vCos; + M.r[2] = g_XMIdentityR2; + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationRollPitchYaw +( + FLOAT Pitch, + FLOAT Yaw, + FLOAT Roll +) +{ + XMVECTOR Angles; + XMMATRIX M; + + Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f); + M = XMMatrixRotationRollPitchYawFromVector(Angles); + + return M; +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationRollPitchYawFromVector +( + FXMVECTOR Angles // +) +{ + XMVECTOR Q; + XMMATRIX M; + + Q = XMQuaternionRotationRollPitchYawFromVector(Angles); + M = XMMatrixRotationQuaternion(Q); + + return M; +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationNormal +( + FXMVECTOR NormalAxis, + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR A; + XMVECTOR N0, N1; + XMVECTOR V0, V1, V2; + XMVECTOR R0, R1, R2; + XMVECTOR C0, C1, C2; + XMMATRIX M; + static CONST XMVECTORU32 SwizzleYZXW = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0W}; + static CONST XMVECTORU32 SwizzleZXYW = {XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute0Z1Y1Z0X = {XM_PERMUTE_0Z, XM_PERMUTE_1Y, XM_PERMUTE_1Z, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute0Y1X0Y1X = {XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_0Y, XM_PERMUTE_1X}; + static CONST XMVECTORU32 Permute0X1X1Y0W = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute1Z0Y1W0W = {XM_PERMUTE_1Z, XM_PERMUTE_0Y, XM_PERMUTE_1W, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute1X1Y0Z0W = {XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0Z, XM_PERMUTE_0W}; + + FLOAT fSinAngle = sinf(Angle); + FLOAT fCosAngle = cosf(Angle); + + A = XMVectorSet(fSinAngle, fCosAngle, 1.0f - fCosAngle, 0.0f); + + C2 = XMVectorSplatZ(A); + C1 = XMVectorSplatY(A); + C0 = XMVectorSplatX(A); + + N0 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleYZXW.v); + N1 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleZXYW.v); + + V0 = XMVectorMultiply(C2, N0); + V0 = XMVectorMultiply(V0, N1); + + R0 = XMVectorMultiply(C2, NormalAxis); + R0 = XMVectorMultiplyAdd(R0, NormalAxis, C1); + + R1 = XMVectorMultiplyAdd(C0, NormalAxis, V0); + R2 = XMVectorNegativeMultiplySubtract(C0, NormalAxis, V0); + + V0 = XMVectorSelect(A, R0, g_XMSelect1110.v); + V1 = XMVectorPermute(R1, R2, Permute0Z1Y1Z0X.v); + V2 = XMVectorPermute(R1, R2, Permute0Y1X0Y1X.v); + + M.r[0] = XMVectorPermute(V0, V1, Permute0X1X1Y0W.v); + M.r[1] = XMVectorPermute(V0, V1, Permute1Z0Y1W0W.v); + M.r[2] = XMVectorPermute(V0, V2, Permute1X1Y0Z0W.v); + M.r[3] = g_XMIdentityR3.v; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR N0, N1; + XMVECTOR V0, V1, V2; + XMVECTOR R0, R1, R2; + XMVECTOR C0, C1, C2; + XMMATRIX M; + + FLOAT fSinAngle = sinf(Angle); + FLOAT fCosAngle = cosf(Angle); + + C2 = _mm_set_ps1(1.0f - fCosAngle); + C1 = _mm_set_ps1(fCosAngle); + C0 = _mm_set_ps1(fSinAngle); + + N0 = _mm_shuffle_ps(NormalAxis,NormalAxis,_MM_SHUFFLE(3,0,2,1)); +// N0 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleYZXW); + N1 = _mm_shuffle_ps(NormalAxis,NormalAxis,_MM_SHUFFLE(3,1,0,2)); +// N1 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleZXYW); + + V0 = _mm_mul_ps(C2, N0); + V0 = _mm_mul_ps(V0, N1); + + R0 = _mm_mul_ps(C2, NormalAxis); + R0 = _mm_mul_ps(R0, NormalAxis); + R0 = _mm_add_ps(R0, C1); + + R1 = _mm_mul_ps(C0, NormalAxis); + R1 = _mm_add_ps(R1, V0); + R2 = _mm_mul_ps(C0, NormalAxis); + R2 = _mm_sub_ps(V0,R2); + + V0 = _mm_and_ps(R0,g_XMMask3); +// V0 = XMVectorSelect(A, R0, g_XMSelect1110); + V1 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(2,1,2,0)); + V1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(0,3,2,1)); +// V1 = XMVectorPermute(R1, R2, Permute0Z1Y1Z0X); + V2 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(0,0,1,1)); + V2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(2,0,2,0)); +// V2 = XMVectorPermute(R1, R2, Permute0Y1X0Y1X); + + R2 = _mm_shuffle_ps(V0,V1,_MM_SHUFFLE(1,0,3,0)); + R2 = _mm_shuffle_ps(R2,R2,_MM_SHUFFLE(1,3,2,0)); + M.r[0] = R2; +// M.r[0] = XMVectorPermute(V0, V1, Permute0X1X1Y0W); + R2 = _mm_shuffle_ps(V0,V1,_MM_SHUFFLE(3,2,3,1)); + R2 = _mm_shuffle_ps(R2,R2,_MM_SHUFFLE(1,3,0,2)); + M.r[1] = R2; +// M.r[1] = XMVectorPermute(V0, V1, Permute1Z0Y1W0W); + V2 = _mm_shuffle_ps(V2,V0,_MM_SHUFFLE(3,2,1,0)); +// R2 = _mm_shuffle_ps(R2,R2,_MM_SHUFFLE(3,2,1,0)); + M.r[2] = V2; +// M.r[2] = XMVectorPermute(V0, V2, Permute1X1Y0Z0W); + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationAxis +( + FXMVECTOR Axis, + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Normal; + XMMATRIX M; + + XMASSERT(!XMVector3Equal(Axis, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(Axis)); + + Normal = XMVector3Normalize(Axis); + M = XMMatrixRotationNormal(Normal, Angle); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMVector3Equal(Axis, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(Axis)); + XMVECTOR Normal = XMVector3Normalize(Axis); + XMMATRIX M = XMMatrixRotationNormal(Normal, Angle); + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixRotationQuaternion +( + FXMVECTOR Quaternion +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + XMVECTOR Q0, Q1; + XMVECTOR V0, V1, V2; + XMVECTOR R0, R1, R2; + static CONST XMVECTOR Constant1110 = {1.0f, 1.0f, 1.0f, 0.0f}; + static CONST XMVECTORU32 SwizzleXXYW = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W}; + static CONST XMVECTORU32 SwizzleZYZW = {XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0W}; + static CONST XMVECTORU32 SwizzleYZXW = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute0Y0X0X1W = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_1W}; + static CONST XMVECTORU32 Permute0Z0Z0Y1W = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_1W}; + static CONST XMVECTORU32 Permute0Y1X1Y0Z = {XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 Permute0X1Z0X1Z = {XM_PERMUTE_0X, XM_PERMUTE_1Z, XM_PERMUTE_0X, XM_PERMUTE_1Z}; + static CONST XMVECTORU32 Permute0X1X1Y0W = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute1Z0Y1W0W = {XM_PERMUTE_1Z, XM_PERMUTE_0Y, XM_PERMUTE_1W, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute1X1Y0Z0W = {XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0Z, XM_PERMUTE_0W}; + + Q0 = XMVectorAdd(Quaternion, Quaternion); + Q1 = XMVectorMultiply(Quaternion, Q0); + + V0 = XMVectorPermute(Q1, Constant1110, Permute0Y0X0X1W.v); + V1 = XMVectorPermute(Q1, Constant1110, Permute0Z0Z0Y1W.v); + R0 = XMVectorSubtract(Constant1110, V0); + R0 = XMVectorSubtract(R0, V1); + + V0 = XMVectorPermute(Quaternion, Quaternion, SwizzleXXYW.v); + V1 = XMVectorPermute(Q0, Q0, SwizzleZYZW.v); + V0 = XMVectorMultiply(V0, V1); + + V1 = XMVectorSplatW(Quaternion); + V2 = XMVectorPermute(Q0, Q0, SwizzleYZXW.v); + V1 = XMVectorMultiply(V1, V2); + + R1 = XMVectorAdd(V0, V1); + R2 = XMVectorSubtract(V0, V1); + + V0 = XMVectorPermute(R1, R2, Permute0Y1X1Y0Z.v); + V1 = XMVectorPermute(R1, R2, Permute0X1Z0X1Z.v); + + M.r[0] = XMVectorPermute(R0, V0, Permute0X1X1Y0W.v); + M.r[1] = XMVectorPermute(R0, V0, Permute1Z0Y1W0W.v); + M.r[2] = XMVectorPermute(R0, V1, Permute1X1Y0Z0W.v); + M.r[3] = g_XMIdentityR3.v; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMVECTOR Q0, Q1; + XMVECTOR V0, V1, V2; + XMVECTOR R0, R1, R2; + static CONST XMVECTORF32 Constant1110 = {1.0f, 1.0f, 1.0f, 0.0f}; + + Q0 = _mm_add_ps(Quaternion,Quaternion); + Q1 = _mm_mul_ps(Quaternion,Q0); + + V0 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(3,0,0,1)); + V0 = _mm_and_ps(V0,g_XMMask3); +// V0 = XMVectorPermute(Q1, Constant1110,Permute0Y0X0X1W); + V1 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(3,1,2,2)); + V1 = _mm_and_ps(V1,g_XMMask3); +// V1 = XMVectorPermute(Q1, Constant1110,Permute0Z0Z0Y1W); + R0 = _mm_sub_ps(Constant1110,V0); + R0 = _mm_sub_ps(R0, V1); + + V0 = _mm_shuffle_ps(Quaternion,Quaternion,_MM_SHUFFLE(3,1,0,0)); +// V0 = XMVectorPermute(Quaternion, Quaternion,SwizzleXXYW); + V1 = _mm_shuffle_ps(Q0,Q0,_MM_SHUFFLE(3,2,1,2)); +// V1 = XMVectorPermute(Q0, Q0,SwizzleZYZW); + V0 = _mm_mul_ps(V0, V1); + + V1 = _mm_shuffle_ps(Quaternion,Quaternion,_MM_SHUFFLE(3,3,3,3)); +// V1 = XMVectorSplatW(Quaternion); + V2 = _mm_shuffle_ps(Q0,Q0,_MM_SHUFFLE(3,0,2,1)); +// V2 = XMVectorPermute(Q0, Q0,SwizzleYZXW); + V1 = _mm_mul_ps(V1, V2); + + R1 = _mm_add_ps(V0, V1); + R2 = _mm_sub_ps(V0, V1); + + V0 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(1,0,2,1)); + V0 = _mm_shuffle_ps(V0,V0,_MM_SHUFFLE(1,3,2,0)); +// V0 = XMVectorPermute(R1, R2,Permute0Y1X1Y0Z); + V1 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(2,2,0,0)); + V1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(2,0,2,0)); +// V1 = XMVectorPermute(R1, R2,Permute0X1Z0X1Z); + + Q1 = _mm_shuffle_ps(R0,V0,_MM_SHUFFLE(1,0,3,0)); + Q1 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(1,3,2,0)); + M.r[0] = Q1; +// M.r[0] = XMVectorPermute(R0, V0,Permute0X1X1Y0W); + Q1 = _mm_shuffle_ps(R0,V0,_MM_SHUFFLE(3,2,3,1)); + Q1 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(1,3,0,2)); + M.r[1] = Q1; +// M.r[1] = XMVectorPermute(R0, V0,Permute1Z0Y1W0W); + Q1 = _mm_shuffle_ps(V1,R0,_MM_SHUFFLE(3,2,1,0)); + M.r[2] = Q1; +// M.r[2] = XMVectorPermute(R0, V1,Permute1X1Y0Z0W); + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixTransformation2D +( + FXMVECTOR ScalingOrigin, + FLOAT ScalingOrientation, + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + FLOAT Rotation, + CXMVECTOR Translation +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + XMVECTOR VScaling; + XMVECTOR NegScalingOrigin; + XMVECTOR VScalingOrigin; + XMMATRIX MScalingOriginI; + XMMATRIX MScalingOrientation; + XMMATRIX MScalingOrientationT; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + VScalingOrigin = XMVectorSelect(g_XMSelect1100.v, ScalingOrigin, g_XMSelect1100.v); + NegScalingOrigin = XMVectorNegate(VScalingOrigin); + + MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + MScalingOrientation = XMMatrixRotationZ(ScalingOrientation); + MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v); + MScaling = XMMatrixScalingFromVector(VScaling); + VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v); + MRotation = XMMatrixRotationZ(Rotation); + VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation,g_XMSelect1100.v); + + M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMVECTOR VScaling; + XMVECTOR NegScalingOrigin; + XMVECTOR VScalingOrigin; + XMMATRIX MScalingOriginI; + XMMATRIX MScalingOrientation; + XMMATRIX MScalingOrientationT; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + static const XMVECTORU32 Mask2 = {0xFFFFFFFF,0xFFFFFFFF,0,0}; + static const XMVECTORF32 ZWOne = {0,0,1.0f,1.0f}; + + VScalingOrigin = _mm_and_ps(ScalingOrigin, Mask2); + NegScalingOrigin = XMVectorNegate(VScalingOrigin); + + MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + MScalingOrientation = XMMatrixRotationZ(ScalingOrientation); + MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + VScaling = _mm_and_ps(Scaling, Mask2); + VScaling = _mm_or_ps(VScaling,ZWOne); + MScaling = XMMatrixScalingFromVector(VScaling); + VRotationOrigin = _mm_and_ps(RotationOrigin, Mask2); + MRotation = XMMatrixRotationZ(Rotation); + VTranslation = _mm_and_ps(Translation, Mask2); + + M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixTransformation +( + FXMVECTOR ScalingOrigin, + FXMVECTOR ScalingOrientationQuaternion, + FXMVECTOR Scaling, + CXMVECTOR RotationOrigin, + CXMVECTOR RotationQuaternion, + CXMVECTOR Translation +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + XMVECTOR NegScalingOrigin; + XMVECTOR VScalingOrigin; + XMMATRIX MScalingOriginI; + XMMATRIX MScalingOrientation; + XMMATRIX MScalingOrientationT; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + VScalingOrigin = XMVectorSelect(g_XMSelect1110.v, ScalingOrigin, g_XMSelect1110.v); + NegScalingOrigin = XMVectorNegate(ScalingOrigin); + + MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + MScalingOrientation = XMMatrixRotationQuaternion(ScalingOrientationQuaternion); + MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + MScaling = XMMatrixScalingFromVector(Scaling); + VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin, g_XMSelect1110.v); + MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation, g_XMSelect1110.v); + + M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMVECTOR NegScalingOrigin; + XMVECTOR VScalingOrigin; + XMMATRIX MScalingOriginI; + XMMATRIX MScalingOrientation; + XMMATRIX MScalingOrientationT; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + VScalingOrigin = _mm_and_ps(ScalingOrigin,g_XMMask3); + NegScalingOrigin = XMVectorNegate(ScalingOrigin); + + MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + MScalingOrientation = XMMatrixRotationQuaternion(ScalingOrientationQuaternion); + MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + MScaling = XMMatrixScalingFromVector(Scaling); + VRotationOrigin = _mm_and_ps(RotationOrigin,g_XMMask3); + MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + VTranslation = _mm_and_ps(Translation,g_XMMask3); + + M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixAffineTransformation2D +( + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + FLOAT Rotation, + FXMVECTOR Translation +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + XMVECTOR VScaling; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v); + MScaling = XMMatrixScalingFromVector(VScaling); + VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v); + MRotation = XMMatrixRotationZ(Rotation); + VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation,g_XMSelect1100.v); + + M = MScaling; + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMVECTOR VScaling; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + static const XMVECTORU32 Mask2 = {0xFFFFFFFFU,0xFFFFFFFFU,0,0}; + static const XMVECTORF32 ZW1 = {0,0,1.0f,1.0f}; + + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + VScaling = _mm_and_ps(Scaling, Mask2); + VScaling = _mm_or_ps(VScaling, ZW1); + MScaling = XMMatrixScalingFromVector(VScaling); + VRotationOrigin = _mm_and_ps(RotationOrigin, Mask2); + MRotation = XMMatrixRotationZ(Rotation); + VTranslation = _mm_and_ps(Translation, Mask2); + + M = MScaling; + M.r[3] = _mm_sub_ps(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = _mm_add_ps(M.r[3], VRotationOrigin); + M.r[3] = _mm_add_ps(M.r[3], VTranslation); + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixAffineTransformation +( + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + FXMVECTOR RotationQuaternion, + CXMVECTOR Translation +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + MScaling = XMMatrixScalingFromVector(Scaling); + VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin,g_XMSelect1110.v); + MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation,g_XMSelect1110.v); + + M = MScaling; + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + MScaling = XMMatrixScalingFromVector(Scaling); + VRotationOrigin = _mm_and_ps(RotationOrigin,g_XMMask3); + MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + VTranslation = _mm_and_ps(Translation,g_XMMask3); + + M = MScaling; + M.r[3] = _mm_sub_ps(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = _mm_add_ps(M.r[3], VRotationOrigin); + M.r[3] = _mm_add_ps(M.r[3], VTranslation); + + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixReflect +( + FXMVECTOR ReflectionPlane +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P; + XMVECTOR S; + XMVECTOR A, B, C, D; + XMMATRIX M; + static CONST XMVECTOR NegativeTwo = {-2.0f, -2.0f, -2.0f, 0.0f}; + + XMASSERT(!XMVector3Equal(ReflectionPlane, XMVectorZero())); + XMASSERT(!XMPlaneIsInfinite(ReflectionPlane)); + + P = XMPlaneNormalize(ReflectionPlane); + S = XMVectorMultiply(P, NegativeTwo); + + A = XMVectorSplatX(P); + B = XMVectorSplatY(P); + C = XMVectorSplatZ(P); + D = XMVectorSplatW(P); + + M.r[0] = XMVectorMultiplyAdd(A, S, g_XMIdentityR0.v); + M.r[1] = XMVectorMultiplyAdd(B, S, g_XMIdentityR1.v); + M.r[2] = XMVectorMultiplyAdd(C, S, g_XMIdentityR2.v); + M.r[3] = XMVectorMultiplyAdd(D, S, g_XMIdentityR3.v); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + static CONST XMVECTORF32 NegativeTwo = {-2.0f, -2.0f, -2.0f, 0.0f}; + + XMASSERT(!XMVector3Equal(ReflectionPlane, XMVectorZero())); + XMASSERT(!XMPlaneIsInfinite(ReflectionPlane)); + + XMVECTOR P = XMPlaneNormalize(ReflectionPlane); + XMVECTOR S = _mm_mul_ps(P,NegativeTwo); + XMVECTOR X = _mm_shuffle_ps(P,P,_MM_SHUFFLE(0,0,0,0)); + XMVECTOR Y = _mm_shuffle_ps(P,P,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR Z = _mm_shuffle_ps(P,P,_MM_SHUFFLE(2,2,2,2)); + P = _mm_shuffle_ps(P,P,_MM_SHUFFLE(3,3,3,3)); + X = _mm_mul_ps(X,S); + Y = _mm_mul_ps(Y,S); + Z = _mm_mul_ps(Z,S); + P = _mm_mul_ps(P,S); + X = _mm_add_ps(X,g_XMIdentityR0); + Y = _mm_add_ps(Y,g_XMIdentityR1); + Z = _mm_add_ps(Z,g_XMIdentityR2); + P = _mm_add_ps(P,g_XMIdentityR3); + M.r[0] = X; + M.r[1] = Y; + M.r[2] = Z; + M.r[3] = P; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixShadow +( + FXMVECTOR ShadowPlane, + FXMVECTOR LightPosition +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P; + XMVECTOR Dot; + XMVECTOR A, B, C, D; + XMMATRIX M; + static CONST XMVECTORU32 Select0001 = {XM_SELECT_0, XM_SELECT_0, XM_SELECT_0, XM_SELECT_1}; + + XMASSERT(!XMVector3Equal(ShadowPlane, XMVectorZero())); + XMASSERT(!XMPlaneIsInfinite(ShadowPlane)); + + P = XMPlaneNormalize(ShadowPlane); + Dot = XMPlaneDot(P, LightPosition); + P = XMVectorNegate(P); + D = XMVectorSplatW(P); + C = XMVectorSplatZ(P); + B = XMVectorSplatY(P); + A = XMVectorSplatX(P); + Dot = XMVectorSelect(Select0001.v, Dot, Select0001.v); + M.r[3] = XMVectorMultiplyAdd(D, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[2] = XMVectorMultiplyAdd(C, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[1] = XMVectorMultiplyAdd(B, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[0] = XMVectorMultiplyAdd(A, LightPosition, Dot); + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMASSERT(!XMVector3Equal(ShadowPlane, XMVectorZero())); + XMASSERT(!XMPlaneIsInfinite(ShadowPlane)); + XMVECTOR P = XMPlaneNormalize(ShadowPlane); + XMVECTOR Dot = XMPlaneDot(P,LightPosition); + // Negate + P = _mm_mul_ps(P,g_XMNegativeOne); + XMVECTOR X = _mm_shuffle_ps(P,P,_MM_SHUFFLE(0,0,0,0)); + XMVECTOR Y = _mm_shuffle_ps(P,P,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR Z = _mm_shuffle_ps(P,P,_MM_SHUFFLE(2,2,2,2)); + P = _mm_shuffle_ps(P,P,_MM_SHUFFLE(3,3,3,3)); + Dot = _mm_and_ps(Dot,g_XMMaskW); + X = _mm_mul_ps(X,LightPosition); + Y = _mm_mul_ps(Y,LightPosition); + Z = _mm_mul_ps(Z,LightPosition); + P = _mm_mul_ps(P,LightPosition); + P = _mm_add_ps(P,Dot); + Dot = _mm_shuffle_ps(Dot,Dot,_MM_SHUFFLE(0,3,2,1)); + Z = _mm_add_ps(Z,Dot); + Dot = _mm_shuffle_ps(Dot,Dot,_MM_SHUFFLE(0,3,2,1)); + Y = _mm_add_ps(Y,Dot); + Dot = _mm_shuffle_ps(Dot,Dot,_MM_SHUFFLE(0,3,2,1)); + X = _mm_add_ps(X,Dot); + // Store the resulting matrix + M.r[0] = X; + M.r[1] = Y; + M.r[2] = Z; + M.r[3] = P; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// View and projection initialization operations +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixLookAtLH +( + FXMVECTOR EyePosition, + FXMVECTOR FocusPosition, + FXMVECTOR UpDirection +) +{ + XMVECTOR EyeDirection; + XMMATRIX M; + + EyeDirection = XMVectorSubtract(FocusPosition, EyePosition); + M = XMMatrixLookToLH(EyePosition, EyeDirection, UpDirection); + + return M; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixLookAtRH +( + FXMVECTOR EyePosition, + FXMVECTOR FocusPosition, + FXMVECTOR UpDirection +) +{ + XMVECTOR NegEyeDirection; + XMMATRIX M; + + NegEyeDirection = XMVectorSubtract(EyePosition, FocusPosition); + M = XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection); + + return M; +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixLookToLH +( + FXMVECTOR EyePosition, + FXMVECTOR EyeDirection, + FXMVECTOR UpDirection +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegEyePosition; + XMVECTOR D0, D1, D2; + XMVECTOR R0, R1, R2; + XMMATRIX M; + + XMASSERT(!XMVector3Equal(EyeDirection, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(EyeDirection)); + XMASSERT(!XMVector3Equal(UpDirection, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(UpDirection)); + + R2 = XMVector3Normalize(EyeDirection); + + R0 = XMVector3Cross(UpDirection, R2); + R0 = XMVector3Normalize(R0); + + R1 = XMVector3Cross(R2, R0); + + NegEyePosition = XMVectorNegate(EyePosition); + + D0 = XMVector3Dot(R0, NegEyePosition); + D1 = XMVector3Dot(R1, NegEyePosition); + D2 = XMVector3Dot(R2, NegEyePosition); + + M.r[0] = XMVectorSelect(D0, R0, g_XMSelect1110.v); + M.r[1] = XMVectorSelect(D1, R1, g_XMSelect1110.v); + M.r[2] = XMVectorSelect(D2, R2, g_XMSelect1110.v); + M.r[3] = g_XMIdentityR3.v; + + M = XMMatrixTranspose(M); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + + XMASSERT(!XMVector3Equal(EyeDirection, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(EyeDirection)); + XMASSERT(!XMVector3Equal(UpDirection, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(UpDirection)); + + XMVECTOR R2 = XMVector3Normalize(EyeDirection); + XMVECTOR R0 = XMVector3Cross(UpDirection, R2); + R0 = XMVector3Normalize(R0); + XMVECTOR R1 = XMVector3Cross(R2,R0); + XMVECTOR NegEyePosition = _mm_mul_ps(EyePosition,g_XMNegativeOne); + XMVECTOR D0 = XMVector3Dot(R0,NegEyePosition); + XMVECTOR D1 = XMVector3Dot(R1,NegEyePosition); + XMVECTOR D2 = XMVector3Dot(R2,NegEyePosition); + R0 = _mm_and_ps(R0,g_XMMask3); + R1 = _mm_and_ps(R1,g_XMMask3); + R2 = _mm_and_ps(R2,g_XMMask3); + D0 = _mm_and_ps(D0,g_XMMaskW); + D1 = _mm_and_ps(D1,g_XMMaskW); + D2 = _mm_and_ps(D2,g_XMMaskW); + D0 = _mm_or_ps(D0,R0); + D1 = _mm_or_ps(D1,R1); + D2 = _mm_or_ps(D2,R2); + M.r[0] = D0; + M.r[1] = D1; + M.r[2] = D2; + M.r[3] = g_XMIdentityR3; + M = XMMatrixTranspose(M); + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixLookToRH +( + FXMVECTOR EyePosition, + FXMVECTOR EyeDirection, + FXMVECTOR UpDirection +) +{ + XMVECTOR NegEyeDirection; + XMMATRIX M; + + NegEyeDirection = XMVectorNegate(EyeDirection); + M = XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection); + + return M; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveLH +( + FLOAT ViewWidth, + FLOAT ViewHeight, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT TwoNearZ, fRange; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + TwoNearZ = NearZ + NearZ; + fRange = FarZ / (FarZ - NearZ); + M.m[0][0] = TwoNearZ / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 0.0f; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + XMMATRIX M; + FLOAT TwoNearZ = NearZ + NearZ; + FLOAT fRange = FarZ / (FarZ - NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ / ViewWidth, + TwoNearZ / ViewHeight, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // TwoNearZ / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,1.0f + vTemp = _mm_setzero_ps(); + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0 + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0)); + M.r[3] = vTemp; + + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveRH +( + FLOAT ViewWidth, + FLOAT ViewHeight, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT TwoNearZ, fRange; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + TwoNearZ = NearZ + NearZ; + fRange = FarZ / (NearZ - FarZ); + M.m[0][0] = TwoNearZ / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = -1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = fRange * NearZ; + M.m[3][3] = 0.0f; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + XMMATRIX M; + FLOAT TwoNearZ = NearZ + NearZ; + FLOAT fRange = FarZ / (NearZ-FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ / ViewWidth, + TwoNearZ / ViewHeight, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // TwoNearZ / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,-1.0f + vValues = _mm_shuffle_ps(vValues,g_XMNegIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,-1.0f + vTemp = _mm_setzero_ps(); + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0 + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0)); + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveFovLH +( + FLOAT FovAngleY, + FLOAT AspectRatio, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT SinFov; + FLOAT CosFov; + FLOAT Height; + FLOAT Width; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + Height = CosFov / SinFov; + Width = Height / AspectRatio; + + M.r[0] = XMVectorSet(Width, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, Height, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, FarZ / (FarZ - NearZ), 1.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, -M.r[2].vector4_f32[2] * NearZ, 0.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + XMMATRIX M; + FLOAT SinFov; + FLOAT CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + FLOAT fRange = FarZ / (FarZ-NearZ); + // Note: This is recorded on the stack + FLOAT Height = CosFov / SinFov; + XMVECTOR rMem = { + Height / AspectRatio, + Height, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // CosFov / SinFov,0,0,0 + M.r[0] = vTemp; + // 0,Height / AspectRatio,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,1.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0)); + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveFovRH +( + FLOAT FovAngleY, + FLOAT AspectRatio, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT SinFov; + FLOAT CosFov; + FLOAT Height; + FLOAT Width; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + Height = CosFov / SinFov; + Width = Height / AspectRatio; + + M.r[0] = XMVectorSet(Width, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, Height, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, FarZ / (NearZ - FarZ), -1.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, M.r[2].vector4_f32[2] * NearZ, 0.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + XMMATRIX M; + FLOAT SinFov; + FLOAT CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + FLOAT fRange = FarZ / (NearZ-FarZ); + // Note: This is recorded on the stack + FLOAT Height = CosFov / SinFov; + XMVECTOR rMem = { + Height / AspectRatio, + Height, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // CosFov / SinFov,0,0,0 + M.r[0] = vTemp; + // 0,Height / AspectRatio,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,-1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues,g_XMNegIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,-1.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0)); + M.r[2] = vTemp; + // 0,0,fRange * NearZ,0.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0)); + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterLH +( + FLOAT ViewLeft, + FLOAT ViewRight, + FLOAT ViewBottom, + FLOAT ViewTop, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT TwoNearZ; + FLOAT ReciprocalWidth; + FLOAT ReciprocalHeight; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + TwoNearZ = NearZ + NearZ; + ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + + M.r[0] = XMVectorSet(TwoNearZ * ReciprocalWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, TwoNearZ * ReciprocalHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + FarZ / (FarZ - NearZ), + 1.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, -M.r[2].vector4_f32[2] * NearZ, 0.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + XMMATRIX M; + FLOAT TwoNearZ = NearZ+NearZ; + FLOAT ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + FLOAT ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + FLOAT fRange = FarZ / (FarZ-NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ*ReciprocalWidth, + TwoNearZ*ReciprocalHeight, + -fRange * NearZ, + 0 + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // TwoNearZ*ReciprocalWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ*ReciprocalHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // 0,0,fRange,1.0f + M.m[2][0] = -(ViewLeft + ViewRight) * ReciprocalWidth; + M.m[2][1] = -(ViewTop + ViewBottom) * ReciprocalHeight; + M.m[2][2] = fRange; + M.m[2][3] = 1.0f; + // 0,0,-fRange * NearZ,0.0f + vValues = _mm_and_ps(vValues,g_XMMaskZ); + M.r[3] = vValues; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterRH +( + FLOAT ViewLeft, + FLOAT ViewRight, + FLOAT ViewBottom, + FLOAT ViewTop, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT TwoNearZ; + FLOAT ReciprocalWidth; + FLOAT ReciprocalHeight; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + TwoNearZ = NearZ + NearZ; + ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + + M.r[0] = XMVectorSet(TwoNearZ * ReciprocalWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, TwoNearZ * ReciprocalHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth, + (ViewTop + ViewBottom) * ReciprocalHeight, + FarZ / (NearZ - FarZ), + -1.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, M.r[2].vector4_f32[2] * NearZ, 0.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + XMMATRIX M; + FLOAT TwoNearZ = NearZ+NearZ; + FLOAT ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + FLOAT ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + FLOAT fRange = FarZ / (NearZ-FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ*ReciprocalWidth, + TwoNearZ*ReciprocalHeight, + fRange * NearZ, + 0 + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // TwoNearZ*ReciprocalWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ*ReciprocalHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // 0,0,fRange,1.0f + M.m[2][0] = (ViewLeft + ViewRight) * ReciprocalWidth; + M.m[2][1] = (ViewTop + ViewBottom) * ReciprocalHeight; + M.m[2][2] = fRange; + M.m[2][3] = -1.0f; + // 0,0,-fRange * NearZ,0.0f + vValues = _mm_and_ps(vValues,g_XMMaskZ); + M.r[3] = vValues; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixOrthographicLH +( + FLOAT ViewWidth, + FLOAT ViewHeight, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT fRange; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + fRange = 1.0f / (FarZ-NearZ); + M.r[0] = XMVectorSet(2.0f / ViewWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, 2.0f / ViewHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, fRange, 0.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, -fRange * NearZ, 1.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + XMMATRIX M; + FLOAT fRange = 1.0f / (FarZ-NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + 2.0f / ViewWidth, + 2.0f / ViewHeight, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // 2.0f / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,2.0f / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,0.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,0,0,0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,1.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,1,0,0)); + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixOrthographicRH +( + FLOAT ViewWidth, + FLOAT ViewHeight, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + M.r[0] = XMVectorSet(2.0f / ViewWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, 2.0f / ViewHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, 1.0f / (NearZ - FarZ), 0.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, M.r[2].vector4_f32[2] * NearZ, 1.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + XMMATRIX M; + FLOAT fRange = 1.0f / (NearZ-FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + 2.0f / ViewWidth, + 2.0f / ViewHeight, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // 2.0f / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,2.0f / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,0.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,0,0,0)); + M.r[2] = vTemp; + // 0,0,fRange * NearZ,1.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,1,0,0)); + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixOrthographicOffCenterLH +( + FLOAT ViewLeft, + FLOAT ViewRight, + FLOAT ViewBottom, + FLOAT ViewTop, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ReciprocalWidth; + FLOAT ReciprocalHeight; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + + M.r[0] = XMVectorSet(ReciprocalWidth + ReciprocalWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, ReciprocalHeight + ReciprocalHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, 1.0f / (FarZ - NearZ), 0.0f); + M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + -M.r[2].vector4_f32[2] * NearZ, + 1.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + FLOAT fReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + FLOAT fReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + FLOAT fRange = 1.0f / (FarZ-NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + fReciprocalWidth, + fReciprocalHeight, + fRange, + 1.0f + }; + XMVECTOR rMem2 = { + -(ViewLeft + ViewRight), + -(ViewTop + ViewBottom), + -NearZ, + 1.0f + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // fReciprocalWidth*2,0,0,0 + vTemp = _mm_add_ss(vTemp,vTemp); + M.r[0] = vTemp; + // 0,fReciprocalHeight*2,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + vTemp = _mm_add_ps(vTemp,vTemp); + M.r[1] = vTemp; + // 0,0,fRange,0.0f + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskZ); + M.r[2] = vTemp; + // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f + vValues = _mm_mul_ps(vValues,rMem2); + M.r[3] = vValues; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixOrthographicOffCenterRH +( + FLOAT ViewLeft, + FLOAT ViewRight, + FLOAT ViewBottom, + FLOAT ViewTop, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ReciprocalWidth; + FLOAT ReciprocalHeight; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + + M.r[0] = XMVectorSet(ReciprocalWidth + ReciprocalWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, ReciprocalHeight + ReciprocalHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, 1.0f / (NearZ - FarZ), 0.0f); + M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + M.r[2].vector4_f32[2] * NearZ, + 1.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + FLOAT fReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + FLOAT fReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + FLOAT fRange = 1.0f / (NearZ-FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + fReciprocalWidth, + fReciprocalHeight, + fRange, + 1.0f + }; + XMVECTOR rMem2 = { + -(ViewLeft + ViewRight), + -(ViewTop + ViewBottom), + NearZ, + 1.0f + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // fReciprocalWidth*2,0,0,0 + vTemp = _mm_add_ss(vTemp,vTemp); + M.r[0] = vTemp; + // 0,fReciprocalHeight*2,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + vTemp = _mm_add_ps(vTemp,vTemp); + M.r[1] = vTemp; + // 0,0,fRange,0.0f + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskZ); + M.r[2] = vTemp; + // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f + vValues = _mm_mul_ps(vValues,rMem2); + M.r[3] = vValues; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +#ifdef __cplusplus + +/**************************************************************************** + * + * XMMATRIX operators and methods + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMMATRIX::_XMMATRIX +( + FXMVECTOR R0, + FXMVECTOR R1, + FXMVECTOR R2, + CXMVECTOR R3 +) +{ + r[0] = R0; + r[1] = R1; + r[2] = R2; + r[3] = R3; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMMATRIX::_XMMATRIX +( + FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33 +) +{ + r[0] = XMVectorSet(m00, m01, m02, m03); + r[1] = XMVectorSet(m10, m11, m12, m13); + r[2] = XMVectorSet(m20, m21, m22, m23); + r[3] = XMVectorSet(m30, m31, m32, m33); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMMATRIX::_XMMATRIX +( + CONST FLOAT* pArray +) +{ + r[0] = XMLoadFloat4((XMFLOAT4*)pArray); + r[1] = XMLoadFloat4((XMFLOAT4*)(pArray + 4)); + r[2] = XMLoadFloat4((XMFLOAT4*)(pArray + 8)); + r[3] = XMLoadFloat4((XMFLOAT4*)(pArray + 12)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMMATRIX& _XMMATRIX::operator= +( + CONST _XMMATRIX& M +) +{ + r[0] = M.r[0]; + r[1] = M.r[1]; + r[2] = M.r[2]; + r[3] = M.r[3]; + return *this; +} + +//------------------------------------------------------------------------------ + +#ifndef XM_NO_OPERATOR_OVERLOADS + +#if !defined(_XBOX_VER) && defined(_XM_ISVS2005_) && defined(_XM_X64_) +#pragma warning(push) +#pragma warning(disable : 4328) +#endif + +XMFINLINE _XMMATRIX& _XMMATRIX::operator*= +( + CONST _XMMATRIX& M +) +{ + *this = XMMatrixMultiply(*this, M); + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMMATRIX _XMMATRIX::operator* +( + CONST _XMMATRIX& M +) CONST +{ + return XMMatrixMultiply(*this, M); +} + +#if !defined(_XBOX_VER) && defined(_XM_ISVS2005_) && defined(_XM_X64_) +#pragma warning(pop) +#endif + +#endif // !XM_NO_OPERATOR_OVERLOADS + +/**************************************************************************** + * + * XMFLOAT3X3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT3X3::_XMFLOAT3X3 +( + FLOAT m00, FLOAT m01, FLOAT m02, + FLOAT m10, FLOAT m11, FLOAT m12, + FLOAT m20, FLOAT m21, FLOAT m22 +) +{ + m[0][0] = m00; + m[0][1] = m01; + m[0][2] = m02; + + m[1][0] = m10; + m[1][1] = m11; + m[1][2] = m12; + + m[2][0] = m20; + m[2][1] = m21; + m[2][2] = m22; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT3X3::_XMFLOAT3X3 +( + CONST FLOAT* pArray +) +{ + UINT Row; + UINT Column; + + for (Row = 0; Row < 3; Row++) + { + for (Column = 0; Column < 3; Column++) + { + m[Row][Column] = pArray[Row * 3 + Column]; + } + } +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT3X3& _XMFLOAT3X3::operator= +( + CONST _XMFLOAT3X3& Float3x3 +) +{ + _11 = Float3x3._11; + _12 = Float3x3._12; + _13 = Float3x3._13; + _21 = Float3x3._21; + _22 = Float3x3._22; + _23 = Float3x3._23; + _31 = Float3x3._31; + _32 = Float3x3._32; + _33 = Float3x3._33; + + return *this; +} + +/**************************************************************************** + * + * XMFLOAT4X3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X3::_XMFLOAT4X3 +( + FLOAT m00, FLOAT m01, FLOAT m02, + FLOAT m10, FLOAT m11, FLOAT m12, + FLOAT m20, FLOAT m21, FLOAT m22, + FLOAT m30, FLOAT m31, FLOAT m32 +) +{ + m[0][0] = m00; + m[0][1] = m01; + m[0][2] = m02; + + m[1][0] = m10; + m[1][1] = m11; + m[1][2] = m12; + + m[2][0] = m20; + m[2][1] = m21; + m[2][2] = m22; + + m[3][0] = m30; + m[3][1] = m31; + m[3][2] = m32; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X3::_XMFLOAT4X3 +( + CONST FLOAT* pArray +) +{ + UINT Row; + UINT Column; + + for (Row = 0; Row < 4; Row++) + { + for (Column = 0; Column < 3; Column++) + { + m[Row][Column] = pArray[Row * 3 + Column]; + } + } +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X3& _XMFLOAT4X3::operator= +( + CONST _XMFLOAT4X3& Float4x3 +) +{ + XMVECTOR V1 = XMLoadFloat4((XMFLOAT4*)&Float4x3._11); + XMVECTOR V2 = XMLoadFloat4((XMFLOAT4*)&Float4x3._22); + XMVECTOR V3 = XMLoadFloat4((XMFLOAT4*)&Float4x3._33); + + XMStoreFloat4((XMFLOAT4*)&_11, V1); + XMStoreFloat4((XMFLOAT4*)&_22, V2); + XMStoreFloat4((XMFLOAT4*)&_33, V3); + + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMFLOAT4X3A& XMFLOAT4X3A::operator= +( + CONST XMFLOAT4X3A& Float4x3 +) +{ + XMVECTOR V1 = XMLoadFloat4A((XMFLOAT4A*)&Float4x3._11); + XMVECTOR V2 = XMLoadFloat4A((XMFLOAT4A*)&Float4x3._22); + XMVECTOR V3 = XMLoadFloat4A((XMFLOAT4A*)&Float4x3._33); + + XMStoreFloat4A((XMFLOAT4A*)&_11, V1); + XMStoreFloat4A((XMFLOAT4A*)&_22, V2); + XMStoreFloat4A((XMFLOAT4A*)&_33, V3); + + return *this; +} + +/**************************************************************************** + * + * XMFLOAT4X4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X4::_XMFLOAT4X4 +( + FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33 +) +{ + m[0][0] = m00; + m[0][1] = m01; + m[0][2] = m02; + m[0][3] = m03; + + m[1][0] = m10; + m[1][1] = m11; + m[1][2] = m12; + m[1][3] = m13; + + m[2][0] = m20; + m[2][1] = m21; + m[2][2] = m22; + m[2][3] = m23; + + m[3][0] = m30; + m[3][1] = m31; + m[3][2] = m32; + m[3][3] = m33; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X4::_XMFLOAT4X4 +( + CONST FLOAT* pArray +) +{ + UINT Row; + UINT Column; + + for (Row = 0; Row < 4; Row++) + { + for (Column = 0; Column < 4; Column++) + { + m[Row][Column] = pArray[Row * 4 + Column]; + } + } +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X4& _XMFLOAT4X4::operator= +( + CONST _XMFLOAT4X4& Float4x4 +) +{ + XMVECTOR V1 = XMLoadFloat4((XMFLOAT4*)&Float4x4._11); + XMVECTOR V2 = XMLoadFloat4((XMFLOAT4*)&Float4x4._21); + XMVECTOR V3 = XMLoadFloat4((XMFLOAT4*)&Float4x4._31); + XMVECTOR V4 = XMLoadFloat4((XMFLOAT4*)&Float4x4._41); + + XMStoreFloat4((XMFLOAT4*)&_11, V1); + XMStoreFloat4((XMFLOAT4*)&_21, V2); + XMStoreFloat4((XMFLOAT4*)&_31, V3); + XMStoreFloat4((XMFLOAT4*)&_41, V4); + + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMFLOAT4X4A& XMFLOAT4X4A::operator= +( + CONST XMFLOAT4X4A& Float4x4 +) +{ + XMVECTOR V1 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._11); + XMVECTOR V2 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._21); + XMVECTOR V3 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._31); + XMVECTOR V4 = XMLoadFloat4A((XMFLOAT4A*)&Float4x4._41); + + XMStoreFloat4A((XMFLOAT4A*)&_11, V1); + XMStoreFloat4A((XMFLOAT4A*)&_21, V2); + XMStoreFloat4A((XMFLOAT4A*)&_31, V3); + XMStoreFloat4A((XMFLOAT4A*)&_41, V4); + + return *this; +} + +#endif // __cplusplus + +#endif // __XNAMATHMATRIX_INL__ + diff --git a/RenderDll/Dx9Sdk/Include/xnamathmisc.inl b/RenderDll/Dx9Sdk/Include/xnamathmisc.inl new file mode 100644 index 0000000..c937ee1 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/xnamathmisc.inl @@ -0,0 +1,2464 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xnamathmisc.inl + +Abstract: + + XNA math library for Windows and Xbox 360: Quaternion, plane, and color functions. +--*/ + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#ifndef __XNAMATHMISC_INL__ +#define __XNAMATHMISC_INL__ + +/**************************************************************************** + * + * Quaternion + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMQuaternionEqual +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) +{ + return XMVector4Equal(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMQuaternionNotEqual +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) +{ + return XMVector4NotEqual(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMQuaternionIsNaN +( + FXMVECTOR Q +) +{ + return XMVector4IsNaN(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMQuaternionIsInfinite +( + FXMVECTOR Q +) +{ + return XMVector4IsInfinite(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMQuaternionIsIdentity +( + FXMVECTOR Q +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return XMVector4Equal(Q, g_XMIdentityR3.v); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(Q,g_XMIdentityR3); + return (_mm_movemask_ps(vTemp)==0x0f) ? true : false; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionDot +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) +{ + return XMVector4Dot(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionMultiply +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeQ1; + XMVECTOR Q2X; + XMVECTOR Q2Y; + XMVECTOR Q2Z; + XMVECTOR Q2W; + XMVECTOR Q1WZYX; + XMVECTOR Q1ZWXY; + XMVECTOR Q1YXWZ; + XMVECTOR Result; + CONST XMVECTORU32 ControlWZYX = {XM_PERMUTE_0W, XM_PERMUTE_1Z, XM_PERMUTE_0Y, XM_PERMUTE_1X}; + CONST XMVECTORU32 ControlZWXY = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_1X, XM_PERMUTE_1Y}; + CONST XMVECTORU32 ControlYXWZ = {XM_PERMUTE_1Y, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1Z}; + + NegativeQ1 = XMVectorNegate(Q1); + + Q2W = XMVectorSplatW(Q2); + Q2X = XMVectorSplatX(Q2); + Q2Y = XMVectorSplatY(Q2); + Q2Z = XMVectorSplatZ(Q2); + + Q1WZYX = XMVectorPermute(Q1, NegativeQ1, ControlWZYX.v); + Q1ZWXY = XMVectorPermute(Q1, NegativeQ1, ControlZWXY.v); + Q1YXWZ = XMVectorPermute(Q1, NegativeQ1, ControlYXWZ.v); + + Result = XMVectorMultiply(Q1, Q2W); + Result = XMVectorMultiplyAdd(Q1WZYX, Q2X, Result); + Result = XMVectorMultiplyAdd(Q1ZWXY, Q2Y, Result); + Result = XMVectorMultiplyAdd(Q1YXWZ, Q2Z, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 ControlWZYX = { 1.0f,-1.0f, 1.0f,-1.0f}; + static CONST XMVECTORF32 ControlZWXY = { 1.0f, 1.0f,-1.0f,-1.0f}; + static CONST XMVECTORF32 ControlYXWZ = {-1.0f, 1.0f, 1.0f,-1.0f}; + // Copy to SSE registers and use as few as possible for x86 + XMVECTOR Q2X = Q2; + XMVECTOR Q2Y = Q2; + XMVECTOR Q2Z = Q2; + XMVECTOR vResult = Q2; + // Splat with one instruction + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3)); + Q2X = _mm_shuffle_ps(Q2X,Q2X,_MM_SHUFFLE(0,0,0,0)); + Q2Y = _mm_shuffle_ps(Q2Y,Q2Y,_MM_SHUFFLE(1,1,1,1)); + Q2Z = _mm_shuffle_ps(Q2Z,Q2Z,_MM_SHUFFLE(2,2,2,2)); + // Retire Q1 and perform Q1*Q2W + vResult = _mm_mul_ps(vResult,Q1); + XMVECTOR Q1Shuffle = Q1; + // Shuffle the copies of Q1 + Q1Shuffle = _mm_shuffle_ps(Q1Shuffle,Q1Shuffle,_MM_SHUFFLE(0,1,2,3)); + // Mul by Q1WZYX + Q2X = _mm_mul_ps(Q2X,Q1Shuffle); + Q1Shuffle = _mm_shuffle_ps(Q1Shuffle,Q1Shuffle,_MM_SHUFFLE(2,3,0,1)); + // Flip the signs on y and z + Q2X = _mm_mul_ps(Q2X,ControlWZYX); + // Mul by Q1ZWXY + Q2Y = _mm_mul_ps(Q2Y,Q1Shuffle); + Q1Shuffle = _mm_shuffle_ps(Q1Shuffle,Q1Shuffle,_MM_SHUFFLE(0,1,2,3)); + // Flip the signs on z and w + Q2Y = _mm_mul_ps(Q2Y,ControlZWXY); + // Mul by Q1YXWZ + Q2Z = _mm_mul_ps(Q2Z,Q1Shuffle); + vResult = _mm_add_ps(vResult,Q2X); + // Flip the signs on x and w + Q2Z = _mm_mul_ps(Q2Z,ControlYXWZ); + Q2Y = _mm_add_ps(Q2Y,Q2Z); + vResult = _mm_add_ps(vResult,Q2Y); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionLengthSq +( + FXMVECTOR Q +) +{ + return XMVector4LengthSq(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionReciprocalLength +( + FXMVECTOR Q +) +{ + return XMVector4ReciprocalLength(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionLength +( + FXMVECTOR Q +) +{ + return XMVector4Length(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionNormalizeEst +( + FXMVECTOR Q +) +{ + return XMVector4NormalizeEst(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionNormalize +( + FXMVECTOR Q +) +{ + return XMVector4Normalize(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionConjugate +( + FXMVECTOR Q +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result = { + -Q.vector4_f32[0], + -Q.vector4_f32[1], + -Q.vector4_f32[2], + Q.vector4_f32[3] + }; + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 NegativeOne3 = {-1.0f,-1.0f,-1.0f,1.0f}; + XMVECTOR Result = _mm_mul_ps(Q,NegativeOne3); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionInverse +( + FXMVECTOR Q +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Conjugate; + XMVECTOR L; + XMVECTOR Control; + XMVECTOR Result; + CONST XMVECTOR Zero = XMVectorZero(); + + L = XMVector4LengthSq(Q); + Conjugate = XMQuaternionConjugate(Q); + + Control = XMVectorLessOrEqual(L, g_XMEpsilon.v); + + L = XMVectorReciprocal(L); + Result = XMVectorMultiply(Conjugate, L); + + Result = XMVectorSelect(Result, Zero, Control); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Conjugate; + XMVECTOR L; + XMVECTOR Control; + XMVECTOR Result; + XMVECTOR Zero = XMVectorZero(); + + L = XMVector4LengthSq(Q); + Conjugate = XMQuaternionConjugate(Q); + Control = XMVectorLessOrEqual(L, g_XMEpsilon); + Result = _mm_div_ps(Conjugate,L); + Result = XMVectorSelect(Result, Zero, Control); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionLn +( + FXMVECTOR Q +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Q0; + XMVECTOR QW; + XMVECTOR Theta; + XMVECTOR SinTheta; + XMVECTOR S; + XMVECTOR ControlW; + XMVECTOR Result; + static CONST XMVECTOR OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f}; + + QW = XMVectorSplatW(Q); + Q0 = XMVectorSelect(g_XMSelect1110.v, Q, g_XMSelect1110.v); + + ControlW = XMVectorInBounds(QW, OneMinusEpsilon); + + Theta = XMVectorACos(QW); + SinTheta = XMVectorSin(Theta); + + S = XMVectorReciprocal(SinTheta); + S = XMVectorMultiply(Theta, S); + + Result = XMVectorMultiply(Q0, S); + + Result = XMVectorSelect(Q0, Result, ControlW); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f}; + static CONST XMVECTORF32 NegOneMinusEpsilon = {-(1.0f - 0.00001f), -(1.0f - 0.00001f),-(1.0f - 0.00001f),-(1.0f - 0.00001f)}; + // Get W only + XMVECTOR QW = _mm_shuffle_ps(Q,Q,_MM_SHUFFLE(3,3,3,3)); + // W = 0 + XMVECTOR Q0 = _mm_and_ps(Q,g_XMMask3); + // Use W if within bounds + XMVECTOR ControlW = _mm_cmple_ps(QW,OneMinusEpsilon); + XMVECTOR vTemp2 = _mm_cmpge_ps(QW,NegOneMinusEpsilon); + ControlW = _mm_and_ps(ControlW,vTemp2); + // Get theta + XMVECTOR vTheta = XMVectorACos(QW); + // Get Sine of theta + vTemp2 = XMVectorSin(vTheta); + // theta/sine of theta + vTheta = _mm_div_ps(vTheta,vTemp2); + // Here's the answer + vTheta = _mm_mul_ps(vTheta,Q0); + // Was W in bounds? If not, return input as is + vTheta = XMVectorSelect(Q0,vTheta,ControlW); + return vTheta; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionExp +( + FXMVECTOR Q +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Theta; + XMVECTOR SinTheta; + XMVECTOR CosTheta; + XMVECTOR S; + XMVECTOR Control; + XMVECTOR Zero; + XMVECTOR Result; + + Theta = XMVector3Length(Q); + XMVectorSinCos(&SinTheta, &CosTheta, Theta); + + S = XMVectorReciprocal(Theta); + S = XMVectorMultiply(SinTheta, S); + + Result = XMVectorMultiply(Q, S); + + Zero = XMVectorZero(); + Control = XMVectorNearEqual(Theta, Zero, g_XMEpsilon.v); + Result = XMVectorSelect(Result, Q, Control); + + Result = XMVectorSelect(CosTheta, Result, g_XMSelect1110.v); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Theta; + XMVECTOR SinTheta; + XMVECTOR CosTheta; + XMVECTOR S; + XMVECTOR Control; + XMVECTOR Zero; + XMVECTOR Result; + Theta = XMVector3Length(Q); + XMVectorSinCos(&SinTheta, &CosTheta, Theta); + S = _mm_div_ps(SinTheta,Theta); + Result = _mm_mul_ps(Q, S); + Zero = XMVectorZero(); + Control = XMVectorNearEqual(Theta, Zero, g_XMEpsilon); + Result = XMVectorSelect(Result,Q,Control); + Result = _mm_and_ps(Result,g_XMMask3); + CosTheta = _mm_and_ps(CosTheta,g_XMMaskW); + Result = _mm_or_ps(Result,CosTheta); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMQuaternionSlerp +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FLOAT t +) +{ + XMVECTOR T = XMVectorReplicate(t); + return XMQuaternionSlerpV(Q0, Q1, T); +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMQuaternionSlerpV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR T +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Result = Q0 * sin((1.0 - t) * Omega) / sin(Omega) + Q1 * sin(t * Omega) / sin(Omega) + XMVECTOR Omega; + XMVECTOR CosOmega; + XMVECTOR SinOmega; + XMVECTOR InvSinOmega; + XMVECTOR V01; + XMVECTOR C1000; + XMVECTOR SignMask; + XMVECTOR S0; + XMVECTOR S1; + XMVECTOR Sign; + XMVECTOR Control; + XMVECTOR Result; + XMVECTOR Zero; + CONST XMVECTOR OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f}; + + XMASSERT((T.vector4_f32[1] == T.vector4_f32[0]) && (T.vector4_f32[2] == T.vector4_f32[0]) && (T.vector4_f32[3] == T.vector4_f32[0])); + + CosOmega = XMQuaternionDot(Q0, Q1); + + Zero = XMVectorZero(); + Control = XMVectorLess(CosOmega, Zero); + Sign = XMVectorSelect(g_XMOne.v, g_XMNegativeOne.v, Control); + + CosOmega = XMVectorMultiply(CosOmega, Sign); + + Control = XMVectorLess(CosOmega, OneMinusEpsilon); + + SinOmega = XMVectorNegativeMultiplySubtract(CosOmega, CosOmega, g_XMOne.v); + SinOmega = XMVectorSqrt(SinOmega); + + Omega = XMVectorATan2(SinOmega, CosOmega); + + SignMask = XMVectorSplatSignMask(); + C1000 = XMVectorSetBinaryConstant(1, 0, 0, 0); + V01 = XMVectorShiftLeft(T, Zero, 2); + SignMask = XMVectorShiftLeft(SignMask, Zero, 3); + V01 = XMVectorXorInt(V01, SignMask); + V01 = XMVectorAdd(C1000, V01); + + InvSinOmega = XMVectorReciprocal(SinOmega); + + S0 = XMVectorMultiply(V01, Omega); + S0 = XMVectorSin(S0); + S0 = XMVectorMultiply(S0, InvSinOmega); + + S0 = XMVectorSelect(V01, S0, Control); + + S1 = XMVectorSplatY(S0); + S0 = XMVectorSplatX(S0); + + S1 = XMVectorMultiply(S1, Sign); + + Result = XMVectorMultiply(Q0, S0); + Result = XMVectorMultiplyAdd(Q1, S1, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = Q0 * sin((1.0 - t) * Omega) / sin(Omega) + Q1 * sin(t * Omega) / sin(Omega) + XMVECTOR Omega; + XMVECTOR CosOmega; + XMVECTOR SinOmega; + XMVECTOR V01; + XMVECTOR S0; + XMVECTOR S1; + XMVECTOR Sign; + XMVECTOR Control; + XMVECTOR Result; + XMVECTOR Zero; + static const XMVECTORF32 OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f}; + static const XMVECTORI32 SignMask2 = {0x80000000,0x00000000,0x00000000,0x00000000}; + static const XMVECTORI32 MaskXY = {0xFFFFFFFF,0xFFFFFFFF,0x00000000,0x00000000}; + + XMASSERT((XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T))); + + CosOmega = XMQuaternionDot(Q0, Q1); + + Zero = XMVectorZero(); + Control = XMVectorLess(CosOmega, Zero); + Sign = XMVectorSelect(g_XMOne, g_XMNegativeOne, Control); + + CosOmega = _mm_mul_ps(CosOmega, Sign); + + Control = XMVectorLess(CosOmega, OneMinusEpsilon); + + SinOmega = _mm_mul_ps(CosOmega,CosOmega); + SinOmega = _mm_sub_ps(g_XMOne,SinOmega); + SinOmega = _mm_sqrt_ps(SinOmega); + + Omega = XMVectorATan2(SinOmega, CosOmega); + + V01 = _mm_shuffle_ps(T,T,_MM_SHUFFLE(2,3,0,1)); + V01 = _mm_and_ps(V01,MaskXY); + V01 = _mm_xor_ps(V01,SignMask2); + V01 = _mm_add_ps(g_XMIdentityR0, V01); + + S0 = _mm_mul_ps(V01, Omega); + S0 = XMVectorSin(S0); + S0 = _mm_div_ps(S0, SinOmega); + + S0 = XMVectorSelect(V01, S0, Control); + + S1 = XMVectorSplatY(S0); + S0 = XMVectorSplatX(S0); + + S1 = _mm_mul_ps(S1, Sign); + Result = _mm_mul_ps(Q0, S0); + S1 = _mm_mul_ps(S1, Q1); + Result = _mm_add_ps(Result,S1); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionSquad +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + CXMVECTOR Q3, + FLOAT t +) +{ + XMVECTOR T = XMVectorReplicate(t); + return XMQuaternionSquadV(Q0, Q1, Q2, Q3, T); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionSquadV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + CXMVECTOR Q3, + CXMVECTOR T +) +{ + XMVECTOR Q03; + XMVECTOR Q12; + XMVECTOR TP; + XMVECTOR Two; + XMVECTOR Result; + + XMASSERT( (XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T)) ); + + TP = T; + Two = XMVectorSplatConstant(2, 0); + + Q03 = XMQuaternionSlerpV(Q0, Q3, T); + Q12 = XMQuaternionSlerpV(Q1, Q2, T); + + TP = XMVectorNegativeMultiplySubtract(TP, TP, TP); + TP = XMVectorMultiply(TP, Two); + + Result = XMQuaternionSlerpV(Q03, Q12, TP); + + return Result; + +} + +//------------------------------------------------------------------------------ + +XMINLINE VOID XMQuaternionSquadSetup +( + XMVECTOR* pA, + XMVECTOR* pB, + XMVECTOR* pC, + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + CXMVECTOR Q3 +) +{ + XMVECTOR SQ0, SQ2, SQ3; + XMVECTOR InvQ1, InvQ2; + XMVECTOR LnQ0, LnQ1, LnQ2, LnQ3; + XMVECTOR ExpQ02, ExpQ13; + XMVECTOR LS01, LS12, LS23; + XMVECTOR LD01, LD12, LD23; + XMVECTOR Control0, Control1, Control2; + XMVECTOR NegativeOneQuarter; + + XMASSERT(pA); + XMASSERT(pB); + XMASSERT(pC); + + LS12 = XMQuaternionLengthSq(XMVectorAdd(Q1, Q2)); + LD12 = XMQuaternionLengthSq(XMVectorSubtract(Q1, Q2)); + SQ2 = XMVectorNegate(Q2); + + Control1 = XMVectorLess(LS12, LD12); + SQ2 = XMVectorSelect(Q2, SQ2, Control1); + + LS01 = XMQuaternionLengthSq(XMVectorAdd(Q0, Q1)); + LD01 = XMQuaternionLengthSq(XMVectorSubtract(Q0, Q1)); + SQ0 = XMVectorNegate(Q0); + + LS23 = XMQuaternionLengthSq(XMVectorAdd(SQ2, Q3)); + LD23 = XMQuaternionLengthSq(XMVectorSubtract(SQ2, Q3)); + SQ3 = XMVectorNegate(Q3); + + Control0 = XMVectorLess(LS01, LD01); + Control2 = XMVectorLess(LS23, LD23); + + SQ0 = XMVectorSelect(Q0, SQ0, Control0); + SQ3 = XMVectorSelect(Q3, SQ3, Control2); + + InvQ1 = XMQuaternionInverse(Q1); + InvQ2 = XMQuaternionInverse(SQ2); + + LnQ0 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ0)); + LnQ2 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ2)); + LnQ1 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, Q1)); + LnQ3 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, SQ3)); + + NegativeOneQuarter = XMVectorSplatConstant(-1, 2); + + ExpQ02 = XMVectorMultiply(XMVectorAdd(LnQ0, LnQ2), NegativeOneQuarter); + ExpQ13 = XMVectorMultiply(XMVectorAdd(LnQ1, LnQ3), NegativeOneQuarter); + ExpQ02 = XMQuaternionExp(ExpQ02); + ExpQ13 = XMQuaternionExp(ExpQ13); + + *pA = XMQuaternionMultiply(Q1, ExpQ02); + *pB = XMQuaternionMultiply(SQ2, ExpQ13); + *pC = SQ2; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionBaryCentric +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + FLOAT f, + FLOAT g +) +{ + XMVECTOR Q01; + XMVECTOR Q02; + FLOAT s; + XMVECTOR Result; + + s = f + g; + + if ((s < 0.00001f) && (s > -0.00001f)) + { + Result = Q0; + } + else + { + Q01 = XMQuaternionSlerp(Q0, Q1, s); + Q02 = XMQuaternionSlerp(Q0, Q2, s); + + Result = XMQuaternionSlerp(Q01, Q02, g / s); + } + + return Result; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionBaryCentricV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + CXMVECTOR F, + CXMVECTOR G +) +{ + XMVECTOR Q01; + XMVECTOR Q02; + XMVECTOR S, GS; + XMVECTOR Epsilon; + XMVECTOR Result; + + XMASSERT( (XMVectorGetY(F) == XMVectorGetX(F)) && (XMVectorGetZ(F) == XMVectorGetX(F)) && (XMVectorGetW(F) == XMVectorGetX(F)) ); + XMASSERT( (XMVectorGetY(G) == XMVectorGetX(G)) && (XMVectorGetZ(G) == XMVectorGetX(G)) && (XMVectorGetW(G) == XMVectorGetX(G)) ); + + Epsilon = XMVectorSplatConstant(1, 16); + + S = XMVectorAdd(F, G); + + if (XMVector4InBounds(S, Epsilon)) + { + Result = Q0; + } + else + { + Q01 = XMQuaternionSlerpV(Q0, Q1, S); + Q02 = XMQuaternionSlerpV(Q0, Q2, S); + GS = XMVectorReciprocal(S); + GS = XMVectorMultiply(G, GS); + + Result = XMQuaternionSlerpV(Q01, Q02, GS); + } + + return Result; +} + +//------------------------------------------------------------------------------ +// Transformation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionIdentity() +{ +#if defined(_XM_NO_INTRINSICS_) + return g_XMIdentityR3.v; +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMIdentityR3; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionRotationRollPitchYaw +( + FLOAT Pitch, + FLOAT Yaw, + FLOAT Roll +) +{ + XMVECTOR Angles; + XMVECTOR Q; + + Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f); + Q = XMQuaternionRotationRollPitchYawFromVector(Angles); + + return Q; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionRotationRollPitchYawFromVector +( + FXMVECTOR Angles // +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Q, Q0, Q1; + XMVECTOR P0, P1, Y0, Y1, R0, R1; + XMVECTOR HalfAngles; + XMVECTOR SinAngles, CosAngles; + static CONST XMVECTORU32 ControlPitch = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1X, XM_PERMUTE_1X}; + static CONST XMVECTORU32 ControlYaw = {XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Y}; + static CONST XMVECTORU32 ControlRoll = {XM_PERMUTE_1Z, XM_PERMUTE_1Z, XM_PERMUTE_0Z, XM_PERMUTE_1Z}; + static CONST XMVECTOR Sign = {1.0f, -1.0f, -1.0f, 1.0f}; + + HalfAngles = XMVectorMultiply(Angles, g_XMOneHalf.v); + XMVectorSinCos(&SinAngles, &CosAngles, HalfAngles); + + P0 = XMVectorPermute(SinAngles, CosAngles, ControlPitch.v); + Y0 = XMVectorPermute(SinAngles, CosAngles, ControlYaw.v); + R0 = XMVectorPermute(SinAngles, CosAngles, ControlRoll.v); + P1 = XMVectorPermute(CosAngles, SinAngles, ControlPitch.v); + Y1 = XMVectorPermute(CosAngles, SinAngles, ControlYaw.v); + R1 = XMVectorPermute(CosAngles, SinAngles, ControlRoll.v); + + Q1 = XMVectorMultiply(P1, Sign); + Q0 = XMVectorMultiply(P0, Y0); + Q1 = XMVectorMultiply(Q1, Y1); + Q0 = XMVectorMultiply(Q0, R0); + Q = XMVectorMultiplyAdd(Q1, R1, Q0); + + return Q; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Q, Q0, Q1; + XMVECTOR P0, P1, Y0, Y1, R0, R1; + XMVECTOR HalfAngles; + XMVECTOR SinAngles, CosAngles; + static CONST XMVECTORI32 ControlPitch = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1X, XM_PERMUTE_1X}; + static CONST XMVECTORI32 ControlYaw = {XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Y}; + static CONST XMVECTORI32 ControlRoll = {XM_PERMUTE_1Z, XM_PERMUTE_1Z, XM_PERMUTE_0Z, XM_PERMUTE_1Z}; + static CONST XMVECTORF32 Sign = {1.0f, -1.0f, -1.0f, 1.0f}; + + HalfAngles = _mm_mul_ps(Angles, g_XMOneHalf); + XMVectorSinCos(&SinAngles, &CosAngles, HalfAngles); + + P0 = XMVectorPermute(SinAngles, CosAngles, ControlPitch); + Y0 = XMVectorPermute(SinAngles, CosAngles, ControlYaw); + R0 = XMVectorPermute(SinAngles, CosAngles, ControlRoll); + P1 = XMVectorPermute(CosAngles, SinAngles, ControlPitch); + Y1 = XMVectorPermute(CosAngles, SinAngles, ControlYaw); + R1 = XMVectorPermute(CosAngles, SinAngles, ControlRoll); + + Q1 = _mm_mul_ps(P1, Sign); + Q0 = _mm_mul_ps(P0, Y0); + Q1 = _mm_mul_ps(Q1, Y1); + Q0 = _mm_mul_ps(Q0, R0); + Q = _mm_mul_ps(Q1, R1); + Q = _mm_add_ps(Q,Q0); + return Q; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionRotationNormal +( + FXMVECTOR NormalAxis, + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Q; + XMVECTOR N; + XMVECTOR Scale; + + N = XMVectorSelect(g_XMOne.v, NormalAxis, g_XMSelect1110.v); + + XMScalarSinCos(&Scale.vector4_f32[2], &Scale.vector4_f32[3], 0.5f * Angle); + + Scale.vector4_f32[0] = Scale.vector4_f32[1] = Scale.vector4_f32[2]; + + Q = XMVectorMultiply(N, Scale); + + return Q; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR N = _mm_and_ps(NormalAxis,g_XMMask3); + N = _mm_or_ps(N,g_XMIdentityR3); + XMVECTOR Scale = _mm_set_ps1(0.5f * Angle); + XMVECTOR vSine; + XMVECTOR vCosine; + XMVectorSinCos(&vSine,&vCosine,Scale); + Scale = _mm_and_ps(vSine,g_XMMask3); + vCosine = _mm_and_ps(vCosine,g_XMMaskW); + Scale = _mm_or_ps(Scale,vCosine); + N = _mm_mul_ps(N,Scale); + return N; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionRotationAxis +( + FXMVECTOR Axis, + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Normal; + XMVECTOR Q; + + XMASSERT(!XMVector3Equal(Axis, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(Axis)); + + Normal = XMVector3Normalize(Axis); + Q = XMQuaternionRotationNormal(Normal, Angle); + + return Q; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Normal; + XMVECTOR Q; + + XMASSERT(!XMVector3Equal(Axis, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(Axis)); + + Normal = XMVector3Normalize(Axis); + Q = XMQuaternionRotationNormal(Normal, Angle); + return Q; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMQuaternionRotationMatrix +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + + XMVECTOR Q0, Q1, Q2; + XMVECTOR M00, M11, M22; + XMVECTOR CQ0, CQ1, C; + XMVECTOR CX, CY, CZ, CW; + XMVECTOR SQ1, Scale; + XMVECTOR Rsq, Sqrt, VEqualsNaN; + XMVECTOR A, B, P; + XMVECTOR PermuteSplat, PermuteSplatT; + XMVECTOR SignB, SignBT; + XMVECTOR PermuteControl, PermuteControlT; + XMVECTOR Result; + static CONST XMVECTORF32 OneQuarter = {0.25f, 0.25f, 0.25f, 0.25f}; + static CONST XMVECTORF32 SignPNNP = {1.0f, -1.0f, -1.0f, 1.0f}; + static CONST XMVECTORF32 SignNPNP = {-1.0f, 1.0f, -1.0f, 1.0f}; + static CONST XMVECTORF32 SignNNPP = {-1.0f, -1.0f, 1.0f, 1.0f}; + static CONST XMVECTORF32 SignPNPP = {1.0f, -1.0f, 1.0f, 1.0f}; + static CONST XMVECTORF32 SignPPNP = {1.0f, 1.0f, -1.0f, 1.0f}; + static CONST XMVECTORF32 SignNPPP = {-1.0f, 1.0f, 1.0f, 1.0f}; + static CONST XMVECTORU32 Permute0X0X0Y0W = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute0Y0Z0Z1W = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_1W}; + static CONST XMVECTORU32 SplatX = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X}; + static CONST XMVECTORU32 SplatY = {XM_PERMUTE_0Y, XM_PERMUTE_0Y, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 SplatZ = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 SplatW = {XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W}; + static CONST XMVECTORU32 PermuteC = {XM_PERMUTE_0X, XM_PERMUTE_0Z, XM_PERMUTE_1X, XM_PERMUTE_1Y}; + static CONST XMVECTORU32 PermuteA = {XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Z, XM_PERMUTE_0W}; + static CONST XMVECTORU32 PermuteB = {XM_PERMUTE_1X, XM_PERMUTE_1W, XM_PERMUTE_0Z, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute0 = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1Z, XM_PERMUTE_1Y}; + static CONST XMVECTORU32 Permute1 = {XM_PERMUTE_1X, XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Z}; + static CONST XMVECTORU32 Permute2 = {XM_PERMUTE_1Z, XM_PERMUTE_1Y, XM_PERMUTE_0Z, XM_PERMUTE_1X}; + static CONST XMVECTORU32 Permute3 = {XM_PERMUTE_1Y, XM_PERMUTE_1Z, XM_PERMUTE_1X, XM_PERMUTE_0W}; + + M00 = XMVectorSplatX(M.r[0]); + M11 = XMVectorSplatY(M.r[1]); + M22 = XMVectorSplatZ(M.r[2]); + + Q0 = XMVectorMultiply(SignPNNP.v, M00); + Q0 = XMVectorMultiplyAdd(SignNPNP.v, M11, Q0); + Q0 = XMVectorMultiplyAdd(SignNNPP.v, M22, Q0); + + Q1 = XMVectorAdd(Q0, g_XMOne.v); + + Rsq = XMVectorReciprocalSqrt(Q1); + VEqualsNaN = XMVectorIsNaN(Rsq); + Sqrt = XMVectorMultiply(Q1, Rsq); + Q1 = XMVectorSelect(Sqrt, Q1, VEqualsNaN); + + Q1 = XMVectorMultiply(Q1, g_XMOneHalf.v); + + SQ1 = XMVectorMultiply(Rsq, g_XMOneHalf.v); + + CQ0 = XMVectorPermute(Q0, Q0, Permute0X0X0Y0W.v); + CQ1 = XMVectorPermute(Q0, g_XMEpsilon.v, Permute0Y0Z0Z1W.v); + C = XMVectorGreaterOrEqual(CQ0, CQ1); + + CX = XMVectorSplatX(C); + CY = XMVectorSplatY(C); + CZ = XMVectorSplatZ(C); + CW = XMVectorSplatW(C); + + PermuteSplat = XMVectorSelect(SplatZ.v, SplatY.v, CZ); + SignB = XMVectorSelect(SignNPPP.v, SignPPNP.v, CZ); + PermuteControl = XMVectorSelect(Permute2.v, Permute1.v, CZ); + + PermuteSplat = XMVectorSelect(PermuteSplat, SplatZ.v, CX); + SignB = XMVectorSelect(SignB, SignNPPP.v, CX); + PermuteControl = XMVectorSelect(PermuteControl, Permute2.v, CX); + + PermuteSplatT = XMVectorSelect(PermuteSplat,SplatX.v, CY); + SignBT = XMVectorSelect(SignB, SignPNPP.v, CY); + PermuteControlT = XMVectorSelect(PermuteControl,Permute0.v, CY); + + PermuteSplat = XMVectorSelect(PermuteSplat, PermuteSplatT, CX); + SignB = XMVectorSelect(SignB, SignBT, CX); + PermuteControl = XMVectorSelect(PermuteControl, PermuteControlT, CX); + + PermuteSplat = XMVectorSelect(PermuteSplat,SplatW.v, CW); + SignB = XMVectorSelect(SignB, g_XMNegativeOne.v, CW); + PermuteControl = XMVectorSelect(PermuteControl,Permute3.v, CW); + + Scale = XMVectorPermute(SQ1, SQ1, PermuteSplat); + + P = XMVectorPermute(M.r[1], M.r[2],PermuteC.v); // {M10, M12, M20, M21} + A = XMVectorPermute(M.r[0], P, PermuteA.v); // {M01, M12, M20, M03} + B = XMVectorPermute(M.r[0], P, PermuteB.v); // {M10, M21, M02, M03} + + Q2 = XMVectorMultiplyAdd(SignB, B, A); + Q2 = XMVectorMultiply(Q2, Scale); + + Result = XMVectorPermute(Q1, Q2, PermuteControl); + + return Result; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Conversion operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMQuaternionToAxisAngle +( + XMVECTOR* pAxis, + FLOAT* pAngle, + FXMVECTOR Q +) +{ + XMASSERT(pAxis); + XMASSERT(pAngle); + + *pAxis = Q; + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + *pAngle = 2.0f * acosf(XMVectorGetW(Q)); +#else + *pAngle = 2.0f * XMScalarACos(XMVectorGetW(Q)); +#endif +} + +/**************************************************************************** + * + * Plane + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMPlaneEqual +( + FXMVECTOR P1, + FXMVECTOR P2 +) +{ + return XMVector4Equal(P1, P2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMPlaneNearEqual +( + FXMVECTOR P1, + FXMVECTOR P2, + FXMVECTOR Epsilon +) +{ + XMVECTOR NP1 = XMPlaneNormalize(P1); + XMVECTOR NP2 = XMPlaneNormalize(P2); + return XMVector4NearEqual(NP1, NP2, Epsilon); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMPlaneNotEqual +( + FXMVECTOR P1, + FXMVECTOR P2 +) +{ + return XMVector4NotEqual(P1, P2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMPlaneIsNaN +( + FXMVECTOR P +) +{ + return XMVector4IsNaN(P); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMPlaneIsInfinite +( + FXMVECTOR P +) +{ + return XMVector4IsInfinite(P); +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneDot +( + FXMVECTOR P, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return XMVector4Dot(P, V); + +#elif defined(_XM_SSE_INTRINSICS_) + __m128 vTemp2 = V; + __m128 vTemp = _mm_mul_ps(P,vTemp2); + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position + vTemp2 = _mm_add_ps(vTemp2,vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp,vTemp2,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp,vTemp2); // Add Z and W together + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneDotCoord +( + FXMVECTOR P, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V3; + XMVECTOR Result; + + // Result = P[0] * V[0] + P[1] * V[1] + P[2] * V[2] + P[3] + V3 = XMVectorSelect(g_XMOne.v, V, g_XMSelect1110.v); + Result = XMVector4Dot(P, V3); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp2 = _mm_and_ps(V,g_XMMask3); + vTemp2 = _mm_or_ps(vTemp2,g_XMIdentityR3); + XMVECTOR vTemp = _mm_mul_ps(P,vTemp2); + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position + vTemp2 = _mm_add_ps(vTemp2,vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp,vTemp2,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp,vTemp2); // Add Z and W together + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneDotNormal +( + FXMVECTOR P, + FXMVECTOR V +) +{ + return XMVector3Dot(P, V); +} + +//------------------------------------------------------------------------------ +// XMPlaneNormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +XMFINLINE XMVECTOR XMPlaneNormalizeEst +( + FXMVECTOR P +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector3ReciprocalLength(P); + Result = XMVectorMultiply(P, Result); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(P,P); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(2,1,2,1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot,vTemp); + // x=Dot.z + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot,vTemp); + // Splat x + vDot = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(0,0,0,0)); + // Get the reciprocal + vDot = _mm_rsqrt_ps(vDot); + // Get the reciprocal + vDot = _mm_mul_ps(vDot,P); + return vDot; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneNormalize +( + FXMVECTOR P +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fLengthSq = sqrtf((P.vector4_f32[0]*P.vector4_f32[0])+(P.vector4_f32[1]*P.vector4_f32[1])+(P.vector4_f32[2]*P.vector4_f32[2])); + // Prevent divide by zero + if (fLengthSq) { + fLengthSq = 1.0f/fLengthSq; + } + { + XMVECTOR vResult = { + P.vector4_f32[0]*fLengthSq, + P.vector4_f32[1]*fLengthSq, + P.vector4_f32[2]*fLengthSq, + P.vector4_f32[3]*fLengthSq + }; + return vResult; + } +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z only + XMVECTOR vLengthSq = _mm_mul_ps(P,P); + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,1,2,1)); + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq,g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(P,vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult,vLengthSq); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneIntersectLine +( + FXMVECTOR P, + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1; + XMVECTOR V2; + XMVECTOR D; + XMVECTOR ReciprocalD; + XMVECTOR VT; + XMVECTOR Point; + XMVECTOR Zero; + XMVECTOR Control; + XMVECTOR Result; + + V1 = XMVector3Dot(P, LinePoint1); + V2 = XMVector3Dot(P, LinePoint2); + D = XMVectorSubtract(V1, V2); + + ReciprocalD = XMVectorReciprocal(D); + VT = XMPlaneDotCoord(P, LinePoint1); + VT = XMVectorMultiply(VT, ReciprocalD); + + Point = XMVectorSubtract(LinePoint2, LinePoint1); + Point = XMVectorMultiplyAdd(Point, VT, LinePoint1); + + Zero = XMVectorZero(); + Control = XMVectorNearEqual(D, Zero, g_XMEpsilon.v); + + Result = XMVectorSelect(Point, g_XMQNaN.v, Control); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1; + XMVECTOR V2; + XMVECTOR D; + XMVECTOR VT; + XMVECTOR Point; + XMVECTOR Zero; + XMVECTOR Control; + XMVECTOR Result; + + V1 = XMVector3Dot(P, LinePoint1); + V2 = XMVector3Dot(P, LinePoint2); + D = _mm_sub_ps(V1, V2); + + VT = XMPlaneDotCoord(P, LinePoint1); + VT = _mm_div_ps(VT, D); + + Point = _mm_sub_ps(LinePoint2, LinePoint1); + Point = _mm_mul_ps(Point,VT); + Point = _mm_add_ps(Point,LinePoint1); + Zero = XMVectorZero(); + Control = XMVectorNearEqual(D, Zero, g_XMEpsilon); + Result = XMVectorSelect(Point, g_XMQNaN, Control); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE VOID XMPlaneIntersectPlane +( + XMVECTOR* pLinePoint1, + XMVECTOR* pLinePoint2, + FXMVECTOR P1, + FXMVECTOR P2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1; + XMVECTOR V2; + XMVECTOR V3; + XMVECTOR LengthSq; + XMVECTOR RcpLengthSq; + XMVECTOR Point; + XMVECTOR P1W; + XMVECTOR P2W; + XMVECTOR Control; + XMVECTOR LinePoint1; + XMVECTOR LinePoint2; + + XMASSERT(pLinePoint1); + XMASSERT(pLinePoint2); + + V1 = XMVector3Cross(P2, P1); + + LengthSq = XMVector3LengthSq(V1); + + V2 = XMVector3Cross(P2, V1); + + P1W = XMVectorSplatW(P1); + Point = XMVectorMultiply(V2, P1W); + + V3 = XMVector3Cross(V1, P1); + + P2W = XMVectorSplatW(P2); + Point = XMVectorMultiplyAdd(V3, P2W, Point); + + RcpLengthSq = XMVectorReciprocal(LengthSq); + LinePoint1 = XMVectorMultiply(Point, RcpLengthSq); + + LinePoint2 = XMVectorAdd(LinePoint1, V1); + + Control = XMVectorLessOrEqual(LengthSq, g_XMEpsilon.v); + *pLinePoint1 = XMVectorSelect(LinePoint1,g_XMQNaN.v, Control); + *pLinePoint2 = XMVectorSelect(LinePoint2,g_XMQNaN.v, Control); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pLinePoint1); + XMASSERT(pLinePoint2); + XMVECTOR V1; + XMVECTOR V2; + XMVECTOR V3; + XMVECTOR LengthSq; + XMVECTOR Point; + XMVECTOR P1W; + XMVECTOR P2W; + XMVECTOR Control; + XMVECTOR LinePoint1; + XMVECTOR LinePoint2; + + V1 = XMVector3Cross(P2, P1); + + LengthSq = XMVector3LengthSq(V1); + + V2 = XMVector3Cross(P2, V1); + + P1W = _mm_shuffle_ps(P1,P1,_MM_SHUFFLE(3,3,3,3)); + Point = _mm_mul_ps(V2, P1W); + + V3 = XMVector3Cross(V1, P1); + + P2W = _mm_shuffle_ps(P2,P2,_MM_SHUFFLE(3,3,3,3)); + V3 = _mm_mul_ps(V3,P2W); + Point = _mm_add_ps(Point,V3); + LinePoint1 = _mm_div_ps(Point,LengthSq); + + LinePoint2 = _mm_add_ps(LinePoint1, V1); + + Control = XMVectorLessOrEqual(LengthSq, g_XMEpsilon); + *pLinePoint1 = XMVectorSelect(LinePoint1,g_XMQNaN, Control); + *pLinePoint2 = XMVectorSelect(LinePoint2,g_XMQNaN, Control); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneTransform +( + FXMVECTOR P, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR W; + XMVECTOR Result; + + W = XMVectorSplatW(P); + Z = XMVectorSplatZ(P); + Y = XMVectorSplatY(P); + X = XMVectorSplatX(P); + + Result = XMVectorMultiply(W, M.r[3]); + Result = XMVectorMultiplyAdd(Z, M.r[2], Result); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR X = _mm_shuffle_ps(P,P,_MM_SHUFFLE(0,0,0,0)); + XMVECTOR Y = _mm_shuffle_ps(P,P,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR Z = _mm_shuffle_ps(P,P,_MM_SHUFFLE(2,2,2,2)); + XMVECTOR W = _mm_shuffle_ps(P,P,_MM_SHUFFLE(3,3,3,3)); + X = _mm_mul_ps(X, M.r[0]); + Y = _mm_mul_ps(Y, M.r[1]); + Z = _mm_mul_ps(Z, M.r[2]); + W = _mm_mul_ps(W, M.r[3]); + X = _mm_add_ps(X,Z); + Y = _mm_add_ps(Y,W); + X = _mm_add_ps(X,Y); + return X; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMFLOAT4* XMPlaneTransformStream +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT4* pInputStream, + UINT InputStride, + UINT PlaneCount, + CXMMATRIX M +) +{ + return XMVector4TransformStream(pOutputStream, + OutputStride, + pInputStream, + InputStride, + PlaneCount, + M); +} + +//------------------------------------------------------------------------------ +// Conversion operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneFromPointNormal +( + FXMVECTOR Point, + FXMVECTOR Normal +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR W; + XMVECTOR Result; + + W = XMVector3Dot(Point, Normal); + W = XMVectorNegate(W); + Result = XMVectorSelect(W, Normal, g_XMSelect1110.v); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR W; + XMVECTOR Result; + W = XMVector3Dot(Point,Normal); + W = _mm_mul_ps(W,g_XMNegativeOne); + Result = _mm_and_ps(Normal,g_XMMask3); + W = _mm_and_ps(W,g_XMMaskW); + Result = _mm_or_ps(Result,W); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneFromPoints +( + FXMVECTOR Point1, + FXMVECTOR Point2, + FXMVECTOR Point3 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + XMVECTOR D; + XMVECTOR V21; + XMVECTOR V31; + XMVECTOR Result; + + V21 = XMVectorSubtract(Point1, Point2); + V31 = XMVectorSubtract(Point1, Point3); + + N = XMVector3Cross(V21, V31); + N = XMVector3Normalize(N); + + D = XMPlaneDotNormal(N, Point1); + D = XMVectorNegate(D); + + Result = XMVectorSelect(D, N, g_XMSelect1110.v); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR N; + XMVECTOR D; + XMVECTOR V21; + XMVECTOR V31; + XMVECTOR Result; + + V21 = _mm_sub_ps(Point1, Point2); + V31 = _mm_sub_ps(Point1, Point3); + + N = XMVector3Cross(V21, V31); + N = XMVector3Normalize(N); + + D = XMPlaneDotNormal(N, Point1); + D = _mm_mul_ps(D,g_XMNegativeOne); + N = _mm_and_ps(N,g_XMMask3); + D = _mm_and_ps(D,g_XMMaskW); + Result = _mm_or_ps(D,N); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * Color + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4Equal(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorNotEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4NotEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorGreater +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4Greater(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorGreaterOrEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4GreaterOrEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorLess +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4Less(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorLessOrEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4LessOrEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorIsNaN +( + FXMVECTOR C +) +{ + return XMVector4IsNaN(C); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorIsInfinite +( + FXMVECTOR C +) +{ + return XMVector4IsInfinite(C); +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMColorNegative +( + FXMVECTOR vColor +) +{ +#if defined(_XM_NO_INTRINSICS_) +// XMASSERT(XMVector4GreaterOrEqual(C, XMVectorReplicate(0.0f))); +// XMASSERT(XMVector4LessOrEqual(C, XMVectorReplicate(1.0f))); + XMVECTOR vResult = { + 1.0f - vColor.vector4_f32[0], + 1.0f - vColor.vector4_f32[1], + 1.0f - vColor.vector4_f32[2], + vColor.vector4_f32[3] + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // Negate only x,y and z. + XMVECTOR vTemp = _mm_xor_ps(vColor,g_XMNegate3); + // Add 1,1,1,0 to -x,-y,-z,w + return _mm_add_ps(vTemp,g_XMOne3); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMColorModulate +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVectorMultiply(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMColorAdjustSaturation +( + FXMVECTOR vColor, + FLOAT fSaturation +) +{ +#if defined(_XM_NO_INTRINSICS_) + CONST XMVECTOR gvLuminance = {0.2125f, 0.7154f, 0.0721f, 0.0f}; + + // Luminance = 0.2125f * C[0] + 0.7154f * C[1] + 0.0721f * C[2]; + // Result = (C - Luminance) * Saturation + Luminance; + + FLOAT fLuminance = (vColor.vector4_f32[0]*gvLuminance.vector4_f32[0])+(vColor.vector4_f32[1]*gvLuminance.vector4_f32[1])+(vColor.vector4_f32[2]*gvLuminance.vector4_f32[2]); + XMVECTOR vResult = { + ((vColor.vector4_f32[0] - fLuminance)*fSaturation)+fLuminance, + ((vColor.vector4_f32[1] - fLuminance)*fSaturation)+fLuminance, + ((vColor.vector4_f32[2] - fLuminance)*fSaturation)+fLuminance, + vColor.vector4_f32[3]}; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 gvLuminance = {0.2125f, 0.7154f, 0.0721f, 0.0f}; +// Mul RGB by intensity constants + XMVECTOR vLuminance = _mm_mul_ps(vColor,gvLuminance); +// vResult.x = vLuminance.y, vResult.y = vLuminance.y, +// vResult.z = vLuminance.z, vResult.w = vLuminance.z + XMVECTOR vResult = vLuminance; + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(2,2,1,1)); +// vLuminance.x += vLuminance.y + vLuminance = _mm_add_ss(vLuminance,vResult); +// Splat vLuminance.z + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(2,2,2,2)); +// vLuminance.x += vLuminance.z (Dot product) + vLuminance = _mm_add_ss(vLuminance,vResult); +// Splat vLuminance + vLuminance = _mm_shuffle_ps(vLuminance,vLuminance,_MM_SHUFFLE(0,0,0,0)); +// Splat fSaturation + XMVECTOR vSaturation = _mm_set_ps1(fSaturation); +// vResult = ((vColor-vLuminance)*vSaturation)+vLuminance; + vResult = _mm_sub_ps(vColor,vLuminance); + vResult = _mm_mul_ps(vResult,vSaturation); + vResult = _mm_add_ps(vResult,vLuminance); +// Retain w from the source color + vLuminance = _mm_shuffle_ps(vResult,vColor,_MM_SHUFFLE(3,2,2,2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w + vResult = _mm_shuffle_ps(vResult,vLuminance,_MM_SHUFFLE(3,0,1,0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMColorAdjustContrast +( + FXMVECTOR vColor, + FLOAT fContrast +) +{ +#if defined(_XM_NO_INTRINSICS_) + // Result = (vColor - 0.5f) * fContrast + 0.5f; + XMVECTOR vResult = { + ((vColor.vector4_f32[0]-0.5f) * fContrast) + 0.5f, + ((vColor.vector4_f32[1]-0.5f) * fContrast) + 0.5f, + ((vColor.vector4_f32[2]-0.5f) * fContrast) + 0.5f, + vColor.vector4_f32[3] // Leave W untouched + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vScale = _mm_set_ps1(fContrast); // Splat the scale + XMVECTOR vResult = _mm_sub_ps(vColor,g_XMOneHalf); // Subtract 0.5f from the source (Saving source) + vResult = _mm_mul_ps(vResult,vScale); // Mul by scale + vResult = _mm_add_ps(vResult,g_XMOneHalf); // Add 0.5f +// Retain w from the source color + vScale = _mm_shuffle_ps(vResult,vColor,_MM_SHUFFLE(3,2,2,2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w + vResult = _mm_shuffle_ps(vResult,vScale,_MM_SHUFFLE(3,0,1,0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * Miscellaneous + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMINLINE BOOL XMVerifyCPUSupport() +{ +#if defined(_XM_NO_INTRINSICS_) || !defined(_XM_SSE_INTRINSICS_) + return TRUE; +#else // _XM_SSE_INTRINSICS_ + // Note that on Windows 2000 or older, SSE2 detection is not supported so this will always fail + // Detecting SSE2 on older versions of Windows would require using cpuid directly + return ( IsProcessorFeaturePresent( PF_XMMI_INSTRUCTIONS_AVAILABLE ) && IsProcessorFeaturePresent( PF_XMMI64_INSTRUCTIONS_AVAILABLE ) ); +#endif +} + + +//------------------------------------------------------------------------------ + +#define XMASSERT_LINE_STRING_SIZE 16 + +XMINLINE VOID XMAssert +( + CONST CHAR* pExpression, + CONST CHAR* pFileName, + UINT LineNumber +) +{ + CHAR aLineString[XMASSERT_LINE_STRING_SIZE]; + CHAR* pLineString; + UINT Line; + + aLineString[XMASSERT_LINE_STRING_SIZE - 2] = '0'; + aLineString[XMASSERT_LINE_STRING_SIZE - 1] = '\0'; + for (Line = LineNumber, pLineString = aLineString + XMASSERT_LINE_STRING_SIZE - 2; + Line != 0 && pLineString >= aLineString; + Line /= 10, pLineString--) + { + *pLineString = (CHAR)('0' + (Line % 10)); + } + +#ifndef NO_OUTPUT_DEBUG_STRING + OutputDebugStringA("Assertion failed: "); + OutputDebugStringA(pExpression); + OutputDebugStringA(", file "); + OutputDebugStringA(pFileName); + OutputDebugStringA(", line "); + OutputDebugStringA(pLineString + 1); + OutputDebugStringA("\r\n"); +#else + DbgPrint("Assertion failed: %s, file %s, line %d\r\n", pExpression, pFileName, LineNumber); +#endif + + __debugbreak(); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMFresnelTerm +( + FXMVECTOR CosIncidentAngle, + FXMVECTOR RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR G; + XMVECTOR D, S; + XMVECTOR V0, V1, V2, V3; + XMVECTOR Result; + + // Result = 0.5f * (g - c)^2 / (g + c)^2 * ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) where + // c = CosIncidentAngle + // g = sqrt(c^2 + RefractionIndex^2 - 1) + + XMASSERT(!XMVector4IsInfinite(CosIncidentAngle)); + + G = XMVectorMultiplyAdd(RefractionIndex, RefractionIndex, g_XMNegativeOne.v); + G = XMVectorMultiplyAdd(CosIncidentAngle, CosIncidentAngle, G); + G = XMVectorAbs(G); + G = XMVectorSqrt(G); + + S = XMVectorAdd(G, CosIncidentAngle); + D = XMVectorSubtract(G, CosIncidentAngle); + + V0 = XMVectorMultiply(D, D); + V1 = XMVectorMultiply(S, S); + V1 = XMVectorReciprocal(V1); + V0 = XMVectorMultiply(g_XMOneHalf.v, V0); + V0 = XMVectorMultiply(V0, V1); + + V2 = XMVectorMultiplyAdd(CosIncidentAngle, S, g_XMNegativeOne.v); + V3 = XMVectorMultiplyAdd(CosIncidentAngle, D, g_XMOne.v); + V2 = XMVectorMultiply(V2, V2); + V3 = XMVectorMultiply(V3, V3); + V3 = XMVectorReciprocal(V3); + V2 = XMVectorMultiplyAdd(V2, V3, g_XMOne.v); + + Result = XMVectorMultiply(V0, V2); + + Result = XMVectorSaturate(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = 0.5f * (g - c)^2 / (g + c)^2 * ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) where + // c = CosIncidentAngle + // g = sqrt(c^2 + RefractionIndex^2 - 1) + + XMASSERT(!XMVector4IsInfinite(CosIncidentAngle)); + + // G = sqrt(abs((RefractionIndex^2-1) + CosIncidentAngle^2)) + XMVECTOR G = _mm_mul_ps(RefractionIndex,RefractionIndex); + XMVECTOR vTemp = _mm_mul_ps(CosIncidentAngle,CosIncidentAngle); + G = _mm_sub_ps(G,g_XMOne); + vTemp = _mm_add_ps(vTemp,G); + // max((0-vTemp),vTemp) == abs(vTemp) + // The abs is needed to deal with refraction and cosine being zero + G = _mm_setzero_ps(); + G = _mm_sub_ps(G,vTemp); + G = _mm_max_ps(G,vTemp); + // Last operation, the sqrt() + G = _mm_sqrt_ps(G); + + // Calc G-C and G+C + XMVECTOR GAddC = _mm_add_ps(G,CosIncidentAngle); + XMVECTOR GSubC = _mm_sub_ps(G,CosIncidentAngle); + // Perform the term (0.5f *(g - c)^2) / (g + c)^2 + XMVECTOR vResult = _mm_mul_ps(GSubC,GSubC); + vTemp = _mm_mul_ps(GAddC,GAddC); + vResult = _mm_mul_ps(vResult,g_XMOneHalf); + vResult = _mm_div_ps(vResult,vTemp); + // Perform the term ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) + GAddC = _mm_mul_ps(GAddC,CosIncidentAngle); + GSubC = _mm_mul_ps(GSubC,CosIncidentAngle); + GAddC = _mm_sub_ps(GAddC,g_XMOne); + GSubC = _mm_add_ps(GSubC,g_XMOne); + GAddC = _mm_mul_ps(GAddC,GAddC); + GSubC = _mm_mul_ps(GSubC,GSubC); + GAddC = _mm_div_ps(GAddC,GSubC); + GAddC = _mm_add_ps(GAddC,g_XMOne); + // Multiply the two term parts + vResult = _mm_mul_ps(vResult,GAddC); + // Clamp to 0.0 - 1.0f + vResult = _mm_max_ps(vResult,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMScalarNearEqual +( + FLOAT S1, + FLOAT S2, + FLOAT Epsilon +) +{ + FLOAT Delta = S1 - S2; +#if defined(_XM_NO_INTRINSICS_) + UINT AbsDelta = *(UINT*)&Delta & 0x7FFFFFFF; + return (*(FLOAT*)&AbsDelta <= Epsilon); +#elif defined(_XM_SSE_INTRINSICS_) + return (fabsf(Delta) <= Epsilon); +#else + return (__fabs(Delta) <= Epsilon); +#endif +} + +//------------------------------------------------------------------------------ +// Modulo the range of the given angle such that -XM_PI <= Angle < XM_PI +XMFINLINE FLOAT XMScalarModAngle +( + FLOAT Angle +) +{ + // Note: The modulo is performed with unsigned math only to work + // around a precision error on numbers that are close to PI + float fTemp; +#if defined(_XM_NO_INTRINSICS_) || !defined(_XM_VMX128_INTRINSICS_) + // Normalize the range from 0.0f to XM_2PI + Angle = Angle + XM_PI; + // Perform the modulo, unsigned + fTemp = fabsf(Angle); + fTemp = fTemp - (XM_2PI * (FLOAT)((INT)(fTemp/XM_2PI))); + // Restore the number to the range of -XM_PI to XM_PI-epsilon + fTemp = fTemp - XM_PI; + // If the modulo'd value was negative, restore negation + if (Angle<0.0f) { + fTemp = -fTemp; + } + return fTemp; +#else +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE FLOAT XMScalarSin +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ValueMod; + FLOAT ValueSq; + XMVECTOR V0123, V0246, V1357, V9111315, V17192123; + XMVECTOR V1, V7, V8; + XMVECTOR R0, R1, R2; + + ValueMod = XMScalarModAngle(Value); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - V^15 / 15! + + // V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI) + + ValueSq = ValueMod * ValueMod; + + V0123 = XMVectorSet(1.0f, ValueMod, ValueSq, ValueSq * ValueMod); + V1 = XMVectorSplatY(V0123); + V0246 = XMVectorMultiply(V0123, V0123); + V1357 = XMVectorMultiply(V0246, V1); + V7 = XMVectorSplatW(V1357); + V8 = XMVectorMultiply(V7, V1); + V9111315 = XMVectorMultiply(V1357, V8); + V17192123 = XMVectorMultiply(V9111315, V8); + + R0 = XMVector4Dot(V1357, g_XMSinCoefficients0.v); + R1 = XMVector4Dot(V9111315, g_XMSinCoefficients1.v); + R2 = XMVector4Dot(V17192123, g_XMSinCoefficients2.v); + + return R0.vector4_f32[0] + R1.vector4_f32[0] + R2.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + return sinf( Value ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE FLOAT XMScalarCos +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ValueMod; + FLOAT ValueSq; + XMVECTOR V0123, V0246, V8101214, V16182022; + XMVECTOR V2, V6, V8; + XMVECTOR R0, R1, R2; + + ValueMod = XMScalarModAngle(Value); + + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + + // V^12 / 12! - V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI) + + ValueSq = ValueMod * ValueMod; + + V0123 = XMVectorSet(1.0f, ValueMod, ValueSq, ValueSq * ValueMod); + V0246 = XMVectorMultiply(V0123, V0123); + + V2 = XMVectorSplatZ(V0123); + V6 = XMVectorSplatW(V0246); + V8 = XMVectorMultiply(V6, V2); + + V8101214 = XMVectorMultiply(V0246, V8); + V16182022 = XMVectorMultiply(V8101214, V8); + + R0 = XMVector4Dot(V0246, g_XMCosCoefficients0.v); + R1 = XMVector4Dot(V8101214, g_XMCosCoefficients1.v); + R2 = XMVector4Dot(V16182022, g_XMCosCoefficients2.v); + + return R0.vector4_f32[0] + R1.vector4_f32[0] + R2.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + return cosf(Value); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE VOID XMScalarSinCos +( + FLOAT* pSin, + FLOAT* pCos, + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ValueMod; + FLOAT ValueSq; + XMVECTOR V0123, V0246, V1357, V8101214, V9111315, V16182022, V17192123; + XMVECTOR V1, V2, V6, V8; + XMVECTOR S0, S1, S2, C0, C1, C2; + + XMASSERT(pSin); + XMASSERT(pCos); + + ValueMod = XMScalarModAngle(Value); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - V^15 / 15! + + // V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + + // V^12 / 12! - V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI) + + ValueSq = ValueMod * ValueMod; + + V0123 = XMVectorSet(1.0f, ValueMod, ValueSq, ValueSq * ValueMod); + + V1 = XMVectorSplatY(V0123); + V2 = XMVectorSplatZ(V0123); + + V0246 = XMVectorMultiply(V0123, V0123); + V1357 = XMVectorMultiply(V0246, V1); + + V6 = XMVectorSplatW(V0246); + V8 = XMVectorMultiply(V6, V2); + + V8101214 = XMVectorMultiply(V0246, V8); + V9111315 = XMVectorMultiply(V1357, V8); + V16182022 = XMVectorMultiply(V8101214, V8); + V17192123 = XMVectorMultiply(V9111315, V8); + + C0 = XMVector4Dot(V0246, g_XMCosCoefficients0.v); + S0 = XMVector4Dot(V1357, g_XMSinCoefficients0.v); + C1 = XMVector4Dot(V8101214, g_XMCosCoefficients1.v); + S1 = XMVector4Dot(V9111315, g_XMSinCoefficients1.v); + C2 = XMVector4Dot(V16182022, g_XMCosCoefficients2.v); + S2 = XMVector4Dot(V17192123, g_XMSinCoefficients2.v); + + *pCos = C0.vector4_f32[0] + C1.vector4_f32[0] + C2.vector4_f32[0]; + *pSin = S0.vector4_f32[0] + S1.vector4_f32[0] + S2.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSin); + XMASSERT(pCos); + + *pSin = sinf(Value); + *pCos = cosf(Value); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE FLOAT XMScalarASin +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT AbsValue, Value2, Value3, D; + XMVECTOR AbsV, R0, R1, Result; + XMVECTOR V3; + + *(UINT*)&AbsValue = *(UINT*)&Value & 0x7FFFFFFF; + + Value2 = Value * AbsValue; + Value3 = Value * Value2; + D = (Value - Value2) / sqrtf(1.00000011921f - AbsValue); + + AbsV = XMVectorReplicate(AbsValue); + + V3.vector4_f32[0] = Value3; + V3.vector4_f32[1] = 1.0f; + V3.vector4_f32[2] = Value3; + V3.vector4_f32[3] = 1.0f; + + R1 = XMVectorSet(D, D, Value, Value); + R1 = XMVectorMultiply(R1, V3); + + R0 = XMVectorMultiplyAdd(AbsV, g_XMASinCoefficients0.v, g_XMASinCoefficients1.v); + R0 = XMVectorMultiplyAdd(AbsV, R0, g_XMASinCoefficients2.v); + + Result = XMVector4Dot(R0, R1); + + return Result.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + return asinf(Value); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE FLOAT XMScalarACos +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return XM_PIDIV2 - XMScalarASin(Value); + +#elif defined(_XM_SSE_INTRINSICS_) + return acosf(Value); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE FLOAT XMScalarSinEst +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ValueSq; + XMVECTOR V; + XMVECTOR Y; + XMVECTOR Result; + + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + + ValueSq = Value * Value; + + V = XMVectorSet(1.0f, Value, ValueSq, ValueSq * Value); + Y = XMVectorSplatY(V); + V = XMVectorMultiply(V, V); + V = XMVectorMultiply(V, Y); + + Result = XMVector4Dot(V, g_XMSinEstCoefficients.v); + + return Result.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + float ValueSq = Value*Value; + XMVECTOR vValue = _mm_set_ps1(Value); + XMVECTOR vTemp = _mm_set_ps(ValueSq * Value,ValueSq,Value,1.0f); + vTemp = _mm_mul_ps(vTemp,vTemp); + vTemp = _mm_mul_ps(vTemp,vValue); + // vTemp = Value,Value^3,Value^5,Value^7 + vTemp = _mm_mul_ps(vTemp,g_XMSinEstCoefficients); + vValue = _mm_shuffle_ps(vValue,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position + vValue = _mm_add_ps(vValue,vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp,vValue,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp,vValue); // Add Z and W together + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return +#if defined(_MSC_VER) && (_MSC_VER>=1500) + return _mm_cvtss_f32(vTemp); +#else + return vTemp.m128_f32[0]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE FLOAT XMScalarCosEst +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT ValueSq; + XMVECTOR V; + XMVECTOR Result; + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI) + ValueSq = Value * Value; + V = XMVectorSet(1.0f, Value, ValueSq, ValueSq * Value); + V = XMVectorMultiply(V, V); + Result = XMVector4Dot(V, g_XMCosEstCoefficients.v); + return Result.vector4_f32[0]; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + float ValueSq = Value*Value; + XMVECTOR vValue = _mm_setzero_ps(); + XMVECTOR vTemp = _mm_set_ps(ValueSq * Value,ValueSq,Value,1.0f); + vTemp = _mm_mul_ps(vTemp,vTemp); + // vTemp = 1.0f,Value^2,Value^4,Value^6 + vTemp = _mm_mul_ps(vTemp,g_XMCosEstCoefficients); + vValue = _mm_shuffle_ps(vValue,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position + vValue = _mm_add_ps(vValue,vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp,vValue,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp,vValue); // Add Z and W together + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return +#if defined(_MSC_VER) && (_MSC_VER>=1500) + return _mm_cvtss_f32(vTemp); +#else + return vTemp.m128_f32[0]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMScalarSinCosEst +( + FLOAT* pSin, + FLOAT* pCos, + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ValueSq; + XMVECTOR V, Sin, Cos; + XMVECTOR Y; + + XMASSERT(pSin); + XMASSERT(pCos); + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI) + + ValueSq = Value * Value; + V = XMVectorSet(1.0f, Value, ValueSq, Value * ValueSq); + Y = XMVectorSplatY(V); + Cos = XMVectorMultiply(V, V); + Sin = XMVectorMultiply(Cos, Y); + + Cos = XMVector4Dot(Cos, g_XMCosEstCoefficients.v); + Sin = XMVector4Dot(Sin, g_XMSinEstCoefficients.v); + + *pCos = Cos.vector4_f32[0]; + *pSin = Sin.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSin); + XMASSERT(pCos); + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + float ValueSq = Value * Value; + XMVECTOR Cos = _mm_set_ps(Value * ValueSq,ValueSq,Value,1.0f); + XMVECTOR Sin = _mm_set_ps1(Value); + Cos = _mm_mul_ps(Cos,Cos); + Sin = _mm_mul_ps(Sin,Cos); + // Cos = 1.0f,Value^2,Value^4,Value^6 + Cos = XMVector4Dot(Cos,g_XMCosEstCoefficients); + _mm_store_ss(pCos,Cos); + // Sin = Value,Value^3,Value^5,Value^7 + Sin = XMVector4Dot(Sin, g_XMSinEstCoefficients); + _mm_store_ss(pSin,Sin); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE FLOAT XMScalarASinEst +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR VR, CR, CS; + XMVECTOR Result; + FLOAT AbsV, V2, D; + CONST FLOAT OnePlusEps = 1.00000011921f; + + *(UINT*)&AbsV = *(UINT*)&Value & 0x7FFFFFFF; + V2 = Value * AbsV; + D = OnePlusEps - AbsV; + + CS = XMVectorSet(Value, 1.0f, 1.0f, V2); + VR = XMVectorSet(sqrtf(D), Value, V2, D * AbsV); + CR = XMVectorMultiply(CS, g_XMASinEstCoefficients.v); + + Result = XMVector4Dot(VR, CR); + + return Result.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + CONST FLOAT OnePlusEps = 1.00000011921f; + FLOAT AbsV = fabsf(Value); + FLOAT V2 = Value * AbsV; // Square with sign retained + FLOAT D = OnePlusEps - AbsV; + + XMVECTOR Result = _mm_set_ps(V2,1.0f,1.0f,Value); + XMVECTOR VR = _mm_set_ps(D * AbsV,V2,Value,sqrtf(D)); + Result = _mm_mul_ps(Result, g_XMASinEstCoefficients); + Result = XMVector4Dot(VR,Result); +#if defined(_MSC_VER) && (_MSC_VER>=1500) + return _mm_cvtss_f32(Result); +#else + return Result.m128_f32[0]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE FLOAT XMScalarACosEst +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR VR, CR, CS; + XMVECTOR Result; + FLOAT AbsV, V2, D; + CONST FLOAT OnePlusEps = 1.00000011921f; + + // return XM_PIDIV2 - XMScalarASin(Value); + + *(UINT*)&AbsV = *(UINT*)&Value & 0x7FFFFFFF; + V2 = Value * AbsV; + D = OnePlusEps - AbsV; + + CS = XMVectorSet(Value, 1.0f, 1.0f, V2); + VR = XMVectorSet(sqrtf(D), Value, V2, D * AbsV); + CR = XMVectorMultiply(CS, g_XMASinEstCoefficients.v); + + Result = XMVector4Dot(VR, CR); + + return XM_PIDIV2 - Result.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + CONST FLOAT OnePlusEps = 1.00000011921f; + FLOAT AbsV = fabsf(Value); + FLOAT V2 = Value * AbsV; // Value^2 retaining sign + FLOAT D = OnePlusEps - AbsV; + XMVECTOR Result = _mm_set_ps(V2,1.0f,1.0f,Value); + XMVECTOR VR = _mm_set_ps(D * AbsV,V2,Value,sqrtf(D)); + Result = _mm_mul_ps(Result,g_XMASinEstCoefficients); + Result = XMVector4Dot(VR,Result); +#if defined(_MSC_VER) && (_MSC_VER>=1500) + return XM_PIDIV2 - _mm_cvtss_f32(Result); +#else + return XM_PIDIV2 - Result.m128_f32[0]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +#endif // __XNAMATHMISC_INL__ + diff --git a/RenderDll/Dx9Sdk/Include/xnamathvector.inl b/RenderDll/Dx9Sdk/Include/xnamathvector.inl new file mode 100644 index 0000000..bfea1d0 --- /dev/null +++ b/RenderDll/Dx9Sdk/Include/xnamathvector.inl @@ -0,0 +1,13279 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xnamathvector.inl + +Abstract: + + XNA math library for Windows and Xbox 360: Vector functions +--*/ + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#ifndef __XNAMATHVECTOR_INL__ +#define __XNAMATHVECTOR_INL__ + +#if defined(_XM_NO_INTRINSICS_) +#define XMISNAN(x) ((*(UINT*)&(x) & 0x7F800000) == 0x7F800000 && (*(UINT*)&(x) & 0x7FFFFF) != 0) +#define XMISINF(x) ((*(UINT*)&(x) & 0x7FFFFFFF) == 0x7F800000) +#endif + +/**************************************************************************** + * + * General Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Assignment operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Return a vector with all elements equaling zero +XMFINLINE XMVECTOR XMVectorZero() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = {0.0f,0.0f,0.0f,0.0f}; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_setzero_ps(); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with four floating point values +XMFINLINE XMVECTOR XMVectorSet +( + FLOAT x, + FLOAT y, + FLOAT z, + FLOAT w +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = {x,y,z,w}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_set_ps( w, z, y, x ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with four integer values +XMFINLINE XMVECTOR XMVectorSetInt +( + UINT x, + UINT y, + UINT z, + UINT w +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult = {x,y,z,w}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set_epi32( w, z, y, x ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated floating point value +XMFINLINE XMVECTOR XMVectorReplicate +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) + XMVECTORF32 vResult = {Value,Value,Value,Value}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_set_ps1( Value ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated floating point value passed by pointer +XMFINLINE XMVECTOR XMVectorReplicatePtr +( + CONST FLOAT *pValue +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) + FLOAT Value = pValue[0]; + XMVECTORF32 vResult = {Value,Value,Value,Value}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ps1( pValue ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated integer value +XMFINLINE XMVECTOR XMVectorReplicateInt +( + UINT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) + XMVECTORU32 vResult = {Value,Value,Value,Value}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_set1_epi32( Value ); + return reinterpret_cast(&vTemp)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated integer value passed by pointer +XMFINLINE XMVECTOR XMVectorReplicateIntPtr +( + CONST UINT *pValue +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) + UINT Value = pValue[0]; + XMVECTORU32 vResult = {Value,Value,Value,Value}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ps1(reinterpret_cast(pValue)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with all bits set (true mask) +XMFINLINE XMVECTOR XMVectorTrueInt() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult = {0xFFFFFFFFU,0xFFFFFFFFU,0xFFFFFFFFU,0xFFFFFFFFU}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set1_epi32(-1); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with all bits clear (false mask) +XMFINLINE XMVECTOR XMVectorFalseInt() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = {0.0f,0.0f,0.0f,0.0f}; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_setzero_ps(); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Replicate the x component of the vector +XMFINLINE XMVECTOR XMVectorSplatX +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_f32[0] = + vResult.vector4_f32[1] = + vResult.vector4_f32[2] = + vResult.vector4_f32[3] = V.vector4_f32[0]; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_shuffle_ps( V, V, _MM_SHUFFLE(0, 0, 0, 0) ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Replicate the y component of the vector +XMFINLINE XMVECTOR XMVectorSplatY +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_f32[0] = + vResult.vector4_f32[1] = + vResult.vector4_f32[2] = + vResult.vector4_f32[3] = V.vector4_f32[1]; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_shuffle_ps( V, V, _MM_SHUFFLE(1, 1, 1, 1) ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Replicate the z component of the vector +XMFINLINE XMVECTOR XMVectorSplatZ +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_f32[0] = + vResult.vector4_f32[1] = + vResult.vector4_f32[2] = + vResult.vector4_f32[3] = V.vector4_f32[2]; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_shuffle_ps( V, V, _MM_SHUFFLE(2, 2, 2, 2) ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Replicate the w component of the vector +XMFINLINE XMVECTOR XMVectorSplatW +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_f32[0] = + vResult.vector4_f32[1] = + vResult.vector4_f32[2] = + vResult.vector4_f32[3] = V.vector4_f32[3]; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_shuffle_ps( V, V, _MM_SHUFFLE(3, 3, 3, 3) ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a vector of 1.0f,1.0f,1.0f,1.0f +XMFINLINE XMVECTOR XMVectorSplatOne() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_f32[0] = + vResult.vector4_f32[1] = + vResult.vector4_f32[2] = + vResult.vector4_f32[3] = 1.0f; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMOne; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a vector of INF,INF,INF,INF +XMFINLINE XMVECTOR XMVectorSplatInfinity() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_u32[0] = + vResult.vector4_u32[1] = + vResult.vector4_u32[2] = + vResult.vector4_u32[3] = 0x7F800000; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMInfinity; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a vector of Q_NAN,Q_NAN,Q_NAN,Q_NAN +XMFINLINE XMVECTOR XMVectorSplatQNaN() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_u32[0] = + vResult.vector4_u32[1] = + vResult.vector4_u32[2] = + vResult.vector4_u32[3] = 0x7FC00000; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMQNaN; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a vector of 1.192092896e-7f,1.192092896e-7f,1.192092896e-7f,1.192092896e-7f +XMFINLINE XMVECTOR XMVectorSplatEpsilon() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_u32[0] = + vResult.vector4_u32[1] = + vResult.vector4_u32[2] = + vResult.vector4_u32[3] = 0x34000000; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMEpsilon; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a vector of -0.0f (0x80000000),-0.0f,-0.0f,-0.0f +XMFINLINE XMVECTOR XMVectorSplatSignMask() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_u32[0] = + vResult.vector4_u32[1] = + vResult.vector4_u32[2] = + vResult.vector4_u32[3] = 0x80000000U; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set1_epi32( 0x80000000 ); + return reinterpret_cast<__m128*>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a floating point value via an index. This is not a recommended +// function to use due to performance loss. +XMFINLINE FLOAT XMVectorGetByIndex(FXMVECTOR V,UINT i) +{ + XMASSERT( i <= 3 ); +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[i]; +#elif defined(_XM_SSE_INTRINSICS_) + return V.m128_f32[i]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return the X component in an FPU register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE FLOAT XMVectorGetX(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[0]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER>=1500) + return _mm_cvtss_f32(V); +#else + return V.m128_f32[0]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the Y component in an FPU register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE FLOAT XMVectorGetY(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[1]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER>=1500) + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + return _mm_cvtss_f32(vTemp); +#else + return V.m128_f32[1]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the Z component in an FPU register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE FLOAT XMVectorGetZ(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[2]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER>=1500) + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + return _mm_cvtss_f32(vTemp); +#else + return V.m128_f32[2]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the W component in an FPU register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE FLOAT XMVectorGetW(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[3]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER>=1500) + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3)); + return _mm_cvtss_f32(vTemp); +#else + return V.m128_f32[3]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Store a component indexed by i into a 32 bit float location in memory. +// This causes Load/Hit/Store on VMX targets +XMFINLINE VOID XMVectorGetByIndexPtr(FLOAT *f,FXMVECTOR V,UINT i) +{ + XMASSERT( f != 0 ); + XMASSERT( i < 4 ); +#if defined(_XM_NO_INTRINSICS_) + *f = V.vector4_f32[i]; +#elif defined(_XM_SSE_INTRINSICS_) + *f = V.m128_f32[i]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Store the X component into a 32 bit float location in memory. +XMFINLINE VOID XMVectorGetXPtr(FLOAT *x,FXMVECTOR V) +{ + XMASSERT( x != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_f32[0]; +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(x,V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the Y component into a 32 bit float location in memory. +XMFINLINE VOID XMVectorGetYPtr(FLOAT *y,FXMVECTOR V) +{ + XMASSERT( y != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *y = V.vector4_f32[1]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + _mm_store_ss(y,vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the Z component into a 32 bit float location in memory. +XMFINLINE VOID XMVectorGetZPtr(FLOAT *z,FXMVECTOR V) +{ + XMASSERT( z != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *z = V.vector4_f32[2]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_store_ss(z,vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the W component into a 32 bit float location in memory. +XMFINLINE VOID XMVectorGetWPtr(FLOAT *w,FXMVECTOR V) +{ + XMASSERT( w != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *w = V.vector4_f32[3]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3)); + _mm_store_ss(w,vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Return an integer value via an index. This is not a recommended +// function to use due to performance loss. +XMFINLINE UINT XMVectorGetIntByIndex(FXMVECTOR V, UINT i) +{ + XMASSERT( i < 4 ); +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[i]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER<1400) + XMVECTORU32 tmp; + tmp.v = V; + return tmp.u[i]; +#else + return V.m128_u32[i]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Return the X component in an integer register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE UINT XMVectorGetIntX(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[0]; +#elif defined(_XM_SSE_INTRINSICS_) + return static_cast(_mm_cvtsi128_si32(reinterpret_cast(&V)[0])); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the Y component in an integer register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE UINT XMVectorGetIntY(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[1]; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(reinterpret_cast(&V)[0],_MM_SHUFFLE(1,1,1,1)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the Z component in an integer register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE UINT XMVectorGetIntZ(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[2]; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(reinterpret_cast(&V)[0],_MM_SHUFFLE(2,2,2,2)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the W component in an integer register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE UINT XMVectorGetIntW(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[3]; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(reinterpret_cast(&V)[0],_MM_SHUFFLE(3,3,3,3)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Store a component indexed by i into a 32 bit integer location in memory. +// This causes Load/Hit/Store on VMX targets +XMFINLINE VOID XMVectorGetIntByIndexPtr(UINT *x,FXMVECTOR V,UINT i) +{ + XMASSERT( x != 0 ); + XMASSERT( i < 4 ); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_u32[i]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER<1400) + XMVECTORU32 tmp; + tmp.v = V; + *x = tmp.u[i]; +#else + *x = V.m128_u32[i]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Store the X component into a 32 bit integer location in memory. +XMFINLINE VOID XMVectorGetIntXPtr(UINT *x,FXMVECTOR V) +{ + XMASSERT( x != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_u32[0]; +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(reinterpret_cast(x),V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the Y component into a 32 bit integer location in memory. +XMFINLINE VOID XMVectorGetIntYPtr(UINT *y,FXMVECTOR V) +{ + XMASSERT( y != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *y = V.vector4_u32[1]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + _mm_store_ss(reinterpret_cast(y),vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the Z component into a 32 bit integer locaCantion in memory. +XMFINLINE VOID XMVectorGetIntZPtr(UINT *z,FXMVECTOR V) +{ + XMASSERT( z != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *z = V.vector4_u32[2]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_store_ss(reinterpret_cast(z),vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the W component into a 32 bit integer location in memory. +XMFINLINE VOID XMVectorGetIntWPtr(UINT *w,FXMVECTOR V) +{ + XMASSERT( w != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *w = V.vector4_u32[3]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3)); + _mm_store_ss(reinterpret_cast(w),vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Set a single indexed floating point component +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetByIndex(FXMVECTOR V, FLOAT f,UINT i) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( i <= 3 ); + U = V; + U.vector4_f32[i] = f; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( i <= 3 ); + XMVECTOR U = V; + U.m128_f32[i] = f; + return U; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to a passed floating point value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetX(FXMVECTOR V, FLOAT x) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_f32[0] = x; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_f32[0] = x; + return vResult; +#else + XMVECTOR vResult = _mm_set_ss(x); + vResult = _mm_move_ss(V,vResult); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Y component of a vector to a passed floating point value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetY(FXMVECTOR V, FLOAT y) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = y; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_f32[1] = y; + return vResult; +#else + // Swap y and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(y); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap y and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} +// Sets the Z component of a vector to a passed floating point value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetZ(FXMVECTOR V, FLOAT z) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = z; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_f32[2] = z; + return vResult; +#else + // Swap z and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(z); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap z and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the W component of a vector to a passed floating point value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetW(FXMVECTOR V, FLOAT w) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = w; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_f32[3] = w; + return vResult; +#else + // Swap w and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(w); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap w and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to a floating point value passed by pointer +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetByIndexPtr(FXMVECTOR V,CONST FLOAT *f,UINT i) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( f != 0 ); + XMASSERT( i <= 3 ); + U = V; + U.vector4_f32[i] = *f; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( f != 0 ); + XMASSERT( i <= 3 ); + XMVECTOR U = V; + U.m128_f32[i] = *f; + return U; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to a floating point value passed by pointer +XMFINLINE XMVECTOR XMVectorSetXPtr(FXMVECTOR V,CONST FLOAT *x) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( x != 0 ); + U.vector4_f32[0] = *x; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( x != 0 ); + XMVECTOR vResult = _mm_load_ss(x); + vResult = _mm_move_ss(V,vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Y component of a vector to a floating point value passed by pointer +XMFINLINE XMVECTOR XMVectorSetYPtr(FXMVECTOR V,CONST FLOAT *y) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( y != 0 ); + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = *y; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( y != 0 ); + // Swap y and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(y); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap y and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Z component of a vector to a floating point value passed by pointer +XMFINLINE XMVECTOR XMVectorSetZPtr(FXMVECTOR V,CONST FLOAT *z) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( z != 0 ); + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = *z; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( z != 0 ); + // Swap z and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(z); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap z and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the W component of a vector to a floating point value passed by pointer +XMFINLINE XMVECTOR XMVectorSetWPtr(FXMVECTOR V,CONST FLOAT *w) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( w != 0 ); + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = *w; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( w != 0 ); + // Swap w and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(w); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap w and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to an integer passed by value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntByIndex(FXMVECTOR V, UINT x, UINT i) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( i <= 3 ); + U = V; + U.vector4_u32[i] = x; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( i <= 3 ); + XMVECTORU32 tmp; + tmp.v = V; + tmp.u[i] = x; + return tmp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to an integer passed by value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntX(FXMVECTOR V, UINT x) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_u32[0] = x; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_i32[0] = x; + return vResult; +#else + __m128i vTemp = _mm_cvtsi32_si128(x); + XMVECTOR vResult = _mm_move_ss(V,reinterpret_cast(&vTemp)[0]); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Y component of a vector to an integer passed by value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntY(FXMVECTOR V, UINT y) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = y; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_i32[1] = y; + return vResult; +#else // Swap y and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(y); + // Replace the x component + vResult = _mm_move_ss(vResult,reinterpret_cast(&vTemp)[0]); + // Swap y and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Z component of a vector to an integer passed by value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntZ(FXMVECTOR V, UINT z) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = z; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_i32[2] = z; + return vResult; +#else + // Swap z and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(z); + // Replace the x component + vResult = _mm_move_ss(vResult,reinterpret_cast(&vTemp)[0]); + // Swap z and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the W component of a vector to an integer passed by value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntW(FXMVECTOR V, UINT w) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = w; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_i32[3] = w; + return vResult; +#else + // Swap w and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(w); + // Replace the x component + vResult = _mm_move_ss(vResult,reinterpret_cast(&vTemp)[0]); + // Swap w and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to an integer value passed by pointer +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntByIndexPtr(FXMVECTOR V, CONST UINT *x,UINT i) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( x != 0 ); + XMASSERT( i <= 3 ); + U = V; + U.vector4_u32[i] = *x; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( x != 0 ); + XMASSERT( i <= 3 ); + XMVECTORU32 tmp; + tmp.v = V; + tmp.u[i] = *x; + return tmp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to an integer value passed by pointer +XMFINLINE XMVECTOR XMVectorSetIntXPtr(FXMVECTOR V,CONST UINT *x) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( x != 0 ); + U.vector4_u32[0] = *x; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( x != 0 ); + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(x)); + XMVECTOR vResult = _mm_move_ss(V,vTemp); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Y component of a vector to an integer value passed by pointer +XMFINLINE XMVECTOR XMVectorSetIntYPtr(FXMVECTOR V,CONST UINT *y) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( y != 0 ); + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = *y; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( y != 0 ); + // Swap y and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(y)); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap y and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Z component of a vector to an integer value passed by pointer +XMFINLINE XMVECTOR XMVectorSetIntZPtr(FXMVECTOR V,CONST UINT *z) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( z != 0 ); + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = *z; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( z != 0 ); + // Swap z and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(z)); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap z and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the W component of a vector to an integer value passed by pointer +XMFINLINE XMVECTOR XMVectorSetIntWPtr(FXMVECTOR V,CONST UINT *w) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( w != 0 ); + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = *w; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( w != 0 ); + // Swap w and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(w)); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap w and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Define a control vector to be used in XMVectorPermute +// operations. Visualize the two vectors V1 and V2 given +// in a permute as arranged back to back in a linear fashion, +// such that they form an array of 8 floating point values. +// The four integers specified in XMVectorPermuteControl +// will serve as indices into the array to select components +// from the two vectors. ElementIndex0 is used to select +// an element from the vectors to be placed in the first +// component of the resulting vector, ElementIndex1 is used +// to select an element for the second component, etc. + +XMFINLINE XMVECTOR XMVectorPermuteControl +( + UINT ElementIndex0, + UINT ElementIndex1, + UINT ElementIndex2, + UINT ElementIndex3 +) +{ +#if defined(_XM_SSE_INTRINSICS_) || defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vControl; + static CONST UINT ControlElement[] = { + XM_PERMUTE_0X, + XM_PERMUTE_0Y, + XM_PERMUTE_0Z, + XM_PERMUTE_0W, + XM_PERMUTE_1X, + XM_PERMUTE_1Y, + XM_PERMUTE_1Z, + XM_PERMUTE_1W + }; + XMASSERT(ElementIndex0 < 8); + XMASSERT(ElementIndex1 < 8); + XMASSERT(ElementIndex2 < 8); + XMASSERT(ElementIndex3 < 8); + + vControl.u[0] = ControlElement[ElementIndex0]; + vControl.u[1] = ControlElement[ElementIndex1]; + vControl.u[2] = ControlElement[ElementIndex2]; + vControl.u[3] = ControlElement[ElementIndex3]; + return vControl.v; +#else +#endif +} + +//------------------------------------------------------------------------------ + +// Using a control vector made up of 16 bytes from 0-31, remap V1 and V2's byte +// entries into a single 16 byte vector and return it. Index 0-15 = V1, +// 16-31 = V2 +XMFINLINE XMVECTOR XMVectorPermute +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Control +) +{ +#if defined(_XM_NO_INTRINSICS_) + const BYTE *aByte[2]; + XMVECTOR Result; + UINT i, uIndex, VectorIndex; + const BYTE *pControl; + BYTE *pWork; + + // Indices must be in range from 0 to 31 + XMASSERT((Control.vector4_u32[0] & 0xE0E0E0E0) == 0); + XMASSERT((Control.vector4_u32[1] & 0xE0E0E0E0) == 0); + XMASSERT((Control.vector4_u32[2] & 0xE0E0E0E0) == 0); + XMASSERT((Control.vector4_u32[3] & 0xE0E0E0E0) == 0); + + // 0-15 = V1, 16-31 = V2 + aByte[0] = (const BYTE*)(&V1); + aByte[1] = (const BYTE*)(&V2); + i = 16; + pControl = (const BYTE *)(&Control); + pWork = (BYTE *)(&Result); + do { + // Get the byte to map from + uIndex = pControl[0]; + ++pControl; + VectorIndex = (uIndex>>4)&1; + uIndex &= 0x0F; +#if defined(_XM_LITTLEENDIAN_) + uIndex ^= 3; // Swap byte ordering on little endian machines +#endif + pWork[0] = aByte[VectorIndex][uIndex]; + ++pWork; + } while (--i); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_PREFAST_) || defined(XMDEBUG) + // Indices must be in range from 0 to 31 + static const XMVECTORI32 PremuteTest = {0xE0E0E0E0,0xE0E0E0E0,0xE0E0E0E0,0xE0E0E0E0}; + XMVECTOR vAssert = _mm_and_ps(Control,PremuteTest); + __m128i vAsserti = _mm_cmpeq_epi32(reinterpret_cast(&vAssert)[0],g_XMZero); + XMASSERT(_mm_movemask_ps(*reinterpret_cast(&vAsserti)) == 0xf); +#endif + // Store the vectors onto local memory on the stack + XMVECTOR Array[2]; + Array[0] = V1; + Array[1] = V2; + // Output vector, on the stack + XMVECTORU8 vResult; + // Get pointer to the two vectors on the stack + const BYTE *pInput = reinterpret_cast(Array); + // Store the Control vector on the stack to access the bytes + // don't use Control, it can cause a register variable to spill on the stack. + XMVECTORU8 vControl; + vControl.v = Control; // Write to memory + UINT i = 0; + do { + UINT ComponentIndex = vControl.u[i] & 0x1FU; + ComponentIndex ^= 3; // Swap byte ordering + vResult.u[i] = pInput[ComponentIndex]; + } while (++i<16); + return vResult; +#else // _XM_SSE_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Define a control vector to be used in XMVectorSelect +// operations. The four integers specified in XMVectorSelectControl +// serve as indices to select between components in two vectors. +// The first index controls selection for the first component of +// the vectors involved in a select operation, the second index +// controls selection for the second component etc. A value of +// zero for an index causes the corresponding component from the first +// vector to be selected whereas a one causes the component from the +// second vector to be selected instead. + +XMFINLINE XMVECTOR XMVectorSelectControl +( + UINT VectorIndex0, + UINT VectorIndex1, + UINT VectorIndex2, + UINT VectorIndex3 +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + // x=Index0,y=Index1,z=Index2,w=Index3 + __m128i vTemp = _mm_set_epi32(VectorIndex3,VectorIndex2,VectorIndex1,VectorIndex0); + // Any non-zero entries become 0xFFFFFFFF else 0 + vTemp = _mm_cmpgt_epi32(vTemp,g_XMZero); + return reinterpret_cast<__m128 *>(&vTemp)[0]; +#else + XMVECTOR ControlVector; + CONST UINT ControlElement[] = + { + XM_SELECT_0, + XM_SELECT_1 + }; + + XMASSERT(VectorIndex0 < 2); + XMASSERT(VectorIndex1 < 2); + XMASSERT(VectorIndex2 < 2); + XMASSERT(VectorIndex3 < 2); + + ControlVector.vector4_u32[0] = ControlElement[VectorIndex0]; + ControlVector.vector4_u32[1] = ControlElement[VectorIndex1]; + ControlVector.vector4_u32[2] = ControlElement[VectorIndex2]; + ControlVector.vector4_u32[3] = ControlElement[VectorIndex3]; + + return ControlVector; + +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSelect +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Control +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = (V1.vector4_u32[0] & ~Control.vector4_u32[0]) | (V2.vector4_u32[0] & Control.vector4_u32[0]); + Result.vector4_u32[1] = (V1.vector4_u32[1] & ~Control.vector4_u32[1]) | (V2.vector4_u32[1] & Control.vector4_u32[1]); + Result.vector4_u32[2] = (V1.vector4_u32[2] & ~Control.vector4_u32[2]) | (V2.vector4_u32[2] & Control.vector4_u32[2]); + Result.vector4_u32[3] = (V1.vector4_u32[3] & ~Control.vector4_u32[3]) | (V2.vector4_u32[3] & Control.vector4_u32[3]); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = _mm_andnot_ps(Control,V1); + XMVECTOR vTemp2 = _mm_and_ps(V2,Control); + return _mm_or_ps(vTemp1,vTemp2); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMergeXY +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[0]; + Result.vector4_u32[1] = V2.vector4_u32[0]; + Result.vector4_u32[2] = V1.vector4_u32[1]; + Result.vector4_u32[3] = V2.vector4_u32[1]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_unpacklo_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMergeZW +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[2]; + Result.vector4_u32[1] = V2.vector4_u32[2]; + Result.vector4_u32[2] = V1.vector4_u32[3]; + Result.vector4_u32[3] = V2.vector4_u32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_unpackhi_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + + Control.vector4_u32[0] = (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpeq_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorEqualR +( + UINT* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ux, uy, uz, uw, CR; + XMVECTOR Control; + + XMASSERT( pCR ); + + ux = (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uy = (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uz = (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uw = (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + CR = 0; + if (ux&uy&uz&uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux|uy|uz|uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + Control.vector4_u32[0] = ux; + Control.vector4_u32[1] = uy; + Control.vector4_u32[2] = uz; + Control.vector4_u32[3] = uw; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( pCR ); + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + UINT CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest==0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Treat the components of the vectors as unsigned integers and +// compare individual bits between the two. This is useful for +// comparing control vectors and result vectors returned from +// other comparison operations. + +XMFINLINE XMVECTOR XMVectorEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + + Control.vector4_u32[0] = (V1.vector4_u32[0] == V2.vector4_u32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_u32[1] == V2.vector4_u32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_u32[2] == V2.vector4_u32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_u32[3] == V2.vector4_u32[3]) ? 0xFFFFFFFF : 0; + + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_cmpeq_epi32( reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0] ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorEqualIntR +( + UINT* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + + XMASSERT(pCR); + + Control = XMVectorEqualInt(V1, V2); + + *pCR = 0; + + if (XMVector4EqualInt(Control, XMVectorTrueInt())) + { + // All elements are equal + *pCR |= XM_CRMASK_CR6TRUE; + } + else if (XMVector4EqualInt(Control, XMVectorFalseInt())) + { + // All elements are not equal + *pCR |= XM_CRMASK_CR6FALSE; + } + + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pCR); + __m128i V = _mm_cmpeq_epi32( reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0] ); + int iTemp = _mm_movemask_ps(reinterpret_cast(&V)[0]); + UINT CR = 0; + if (iTemp==0x0F) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTemp) + { + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT fDeltax, fDeltay, fDeltaz, fDeltaw; + XMVECTOR Control; + + fDeltax = V1.vector4_f32[0]-V2.vector4_f32[0]; + fDeltay = V1.vector4_f32[1]-V2.vector4_f32[1]; + fDeltaz = V1.vector4_f32[2]-V2.vector4_f32[2]; + fDeltaw = V1.vector4_f32[3]-V2.vector4_f32[3]; + + fDeltax = fabsf(fDeltax); + fDeltay = fabsf(fDeltay); + fDeltaz = fabsf(fDeltaz); + fDeltaw = fabsf(fDeltaw); + + Control.vector4_u32[0] = (fDeltax <= Epsilon.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[1] = (fDeltay <= Epsilon.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[2] = (fDeltaz <= Epsilon.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[3] = (fDeltaw <= Epsilon.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1,V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp,vDelta); + vTemp = _mm_max_ps(vTemp,vDelta); + vTemp = _mm_cmple_ps(vTemp,Epsilon); + return vTemp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_f32[0] != V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] != V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] != V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] != V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpneq_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_u32[0] != V2.vector4_u32[0]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[1] = (V1.vector4_u32[1] != V2.vector4_u32[1]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[2] = (V1.vector4_u32[2] != V2.vector4_u32[2]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[3] = (V1.vector4_u32[3] != V2.vector4_u32[3]) ? 0xFFFFFFFFU : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_cmpeq_epi32( reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0] ); + return _mm_xor_ps(reinterpret_cast<__m128 *>(&V)[0],g_XMNegOneMask); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorGreater +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpgt_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorGreaterR +( + UINT* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ux, uy, uz, uw, CR; + XMVECTOR Control; + + XMASSERT( pCR ); + + ux = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uy = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uz = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uw = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + CR = 0; + if (ux&uy&uz&uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux|uy|uz|uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + Control.vector4_u32[0] = ux; + Control.vector4_u32[1] = uy; + Control.vector4_u32[2] = uz; + Control.vector4_u32[3] = uw; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( pCR ); + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + UINT CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest==0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorGreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpge_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorGreaterOrEqualR +( + UINT* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ux, uy, uz, uw, CR; + XMVECTOR Control; + + XMASSERT( pCR ); + + ux = (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uy = (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uz = (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uw = (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + CR = 0; + if (ux&uy&uz&uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux|uy|uz|uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + Control.vector4_u32[0] = ux; + Control.vector4_u32[1] = uy; + Control.vector4_u32[2] = uz; + Control.vector4_u32[3] = uw; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( pCR ); + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + UINT CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest==0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorLess +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_f32[0] < V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] < V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] < V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] < V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmplt_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorLessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_f32[0] <= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] <= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] <= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] <= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmple_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorInBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + return vTemp1; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorInBoundsR +( + UINT* pCR, + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ux, uy, uz, uw, CR; + XMVECTOR Control; + + XMASSERT( pCR != 0 ); + + ux = (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uy = (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uz = (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uw = (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + + CR = 0; + + if (ux&uy&uz&uw) + { + // All elements are in bounds + CR = XM_CRMASK_CR6BOUNDS; + } + *pCR = CR; + Control.vector4_u32[0] = ux; + Control.vector4_u32[1] = uy; + Control.vector4_u32[2] = uz; + Control.vector4_u32[3] = uw; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( pCR != 0 ); + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + + UINT CR = 0; + if (_mm_movemask_ps(vTemp1)==0xf) { + // All elements are in bounds + CR = XM_CRMASK_CR6BOUNDS; + } + *pCR = CR; + return vTemp1; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorIsNaN +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = XMISNAN(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[1] = XMISNAN(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[2] = XMISNAN(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[3] = XMISNAN(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the exponent + __m128i vTempInf = _mm_and_si128(reinterpret_cast(&V)[0],g_XMInfinity); + // Mask off the mantissa + __m128i vTempNan = _mm_and_si128(reinterpret_cast(&V)[0],g_XMQNaNTest); + // Are any of the exponents == 0x7F800000? + vTempInf = _mm_cmpeq_epi32(vTempInf,g_XMInfinity); + // Are any of the mantissa's zero? (SSE2 doesn't have a neq test) + vTempNan = _mm_cmpeq_epi32(vTempNan,g_XMZero); + // Perform a not on the NaN test to be true on NON-zero mantissas + vTempNan = _mm_andnot_si128(vTempNan,vTempInf); + // If any are NaN, the signs are true after the merge above + return reinterpret_cast(&vTempNan)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorIsInfinite +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = XMISINF(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[1] = XMISINF(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[2] = XMISINF(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[3] = XMISINF(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V,g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp,g_XMInfinity); + // If any are infinity, the signs are true. + return vTemp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Rounding and clamping operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMin +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result.vector4_f32[0] = (V1.vector4_f32[0] < V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0]; + Result.vector4_f32[1] = (V1.vector4_f32[1] < V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1]; + Result.vector4_f32[2] = (V1.vector4_f32[2] < V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2]; + Result.vector4_f32[3] = (V1.vector4_f32[3] < V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3]; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_min_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMax +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result.vector4_f32[0] = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0]; + Result.vector4_f32[1] = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1]; + Result.vector4_f32[2] = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2]; + Result.vector4_f32[3] = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3]; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_max_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorRound +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + XMVECTOR Bias; + CONST XMVECTOR Zero = XMVectorZero(); + CONST XMVECTOR BiasPos = XMVectorReplicate(0.5f); + CONST XMVECTOR BiasNeg = XMVectorReplicate(-0.5f); + + Bias = XMVectorLess(V, Zero); + Bias = XMVectorSelect(BiasPos, BiasNeg, Bias); + Result = XMVectorAdd(V, Bias); + Result = XMVectorTruncate(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // To handle NAN, INF and numbers greater than 8388608, use masking + // Get the abs value + __m128i vTest = _mm_and_si128(reinterpret_cast(&V)[0],g_XMAbsMask); + // Test for greater than 8388608 (All floats with NO fractionals, NAN and INF + vTest = _mm_cmplt_epi32(vTest,g_XMNoFraction); + // Convert to int and back to float for rounding + __m128i vInt = _mm_cvtps_epi32(V); + // Convert back to floats + XMVECTOR vResult = _mm_cvtepi32_ps(vInt); + // All numbers less than 8388608 will use the round to int + vResult = _mm_and_ps(vResult,reinterpret_cast(&vTest)[0]); + // All others, use the ORIGINAL value + vTest = _mm_andnot_si128(vTest,reinterpret_cast(&V)[0]); + vResult = _mm_or_ps(vResult,reinterpret_cast(&vTest)[0]); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorTruncate +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result; + UINT i; + + // Avoid C4701 + Result.vector4_f32[0] = 0.0f; + + for (i = 0; i < 4; i++) + { + if (XMISNAN(V.vector4_f32[i])) + { + Result.vector4_u32[i] = 0x7FC00000; + } + else if (fabsf(V.vector4_f32[i]) < 8388608.0f) + { + Result.vector4_f32[i] = (FLOAT)((INT)V.vector4_f32[i]); + } + else + { + Result.vector4_f32[i] = V.vector4_f32[i]; + } + } + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // To handle NAN, INF and numbers greater than 8388608, use masking + // Get the abs value + __m128i vTest = _mm_and_si128(reinterpret_cast(&V)[0],g_XMAbsMask); + // Test for greater than 8388608 (All floats with NO fractionals, NAN and INF + vTest = _mm_cmplt_epi32(vTest,g_XMNoFraction); + // Convert to int and back to float for rounding with truncation + __m128i vInt = _mm_cvttps_epi32(V); + // Convert back to floats + XMVECTOR vResult = _mm_cvtepi32_ps(vInt); + // All numbers less than 8388608 will use the round to int + vResult = _mm_and_ps(vResult,reinterpret_cast(&vTest)[0]); + // All others, use the ORIGINAL value + vTest = _mm_andnot_si128(vTest,reinterpret_cast(&V)[0]); + vResult = _mm_or_ps(vResult,reinterpret_cast(&vTest)[0]); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorFloor +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR vResult = { + floorf(V.vector4_f32[0]), + floorf(V.vector4_f32[1]), + floorf(V.vector4_f32[2]), + floorf(V.vector4_f32[3]) + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_sub_ps(V,g_XMOneHalfMinusEpsilon); + __m128i vInt = _mm_cvtps_epi32(vResult); + vResult = _mm_cvtepi32_ps(vInt); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorCeiling +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = { + ceilf(V.vector4_f32[0]), + ceilf(V.vector4_f32[1]), + ceilf(V.vector4_f32[2]), + ceilf(V.vector4_f32[3]) + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_add_ps(V,g_XMOneHalfMinusEpsilon); + __m128i vInt = _mm_cvtps_epi32(vResult); + vResult = _mm_cvtepi32_ps(vInt); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorClamp +( + FXMVECTOR V, + FXMVECTOR Min, + FXMVECTOR Max +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + XMASSERT(XMVector4LessOrEqual(Min, Max)); + + Result = XMVectorMax(Min, V); + Result = XMVectorMin(Max, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult; + XMASSERT(XMVector4LessOrEqual(Min, Max)); + vResult = _mm_max_ps(Min,V); + vResult = _mm_min_ps(vResult,Max); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSaturate +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + CONST XMVECTOR Zero = XMVectorZero(); + + return XMVectorClamp(V, Zero, g_XMOne.v); + +#elif defined(_XM_SSE_INTRINSICS_) + // Set <0 to 0 + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + // Set>1 to 1 + return _mm_min_ps(vResult,g_XMOne); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Bitwise logical operations +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorAndInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[0] & V2.vector4_u32[0]; + Result.vector4_u32[1] = V1.vector4_u32[1] & V2.vector4_u32[1]; + Result.vector4_u32[2] = V1.vector4_u32[2] & V2.vector4_u32[2]; + Result.vector4_u32[3] = V1.vector4_u32[3] & V2.vector4_u32[3]; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_and_ps(V1,V2); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorAndCInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[0] & ~V2.vector4_u32[0]; + Result.vector4_u32[1] = V1.vector4_u32[1] & ~V2.vector4_u32[1]; + Result.vector4_u32[2] = V1.vector4_u32[2] & ~V2.vector4_u32[2]; + Result.vector4_u32[3] = V1.vector4_u32[3] & ~V2.vector4_u32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_andnot_si128( reinterpret_cast(&V2)[0], reinterpret_cast(&V1)[0] ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorOrInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[0] | V2.vector4_u32[0]; + Result.vector4_u32[1] = V1.vector4_u32[1] | V2.vector4_u32[1]; + Result.vector4_u32[2] = V1.vector4_u32[2] | V2.vector4_u32[2]; + Result.vector4_u32[3] = V1.vector4_u32[3] | V2.vector4_u32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_or_si128( reinterpret_cast(&V1)[0], reinterpret_cast(&V2)[0] ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNorInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = ~(V1.vector4_u32[0] | V2.vector4_u32[0]); + Result.vector4_u32[1] = ~(V1.vector4_u32[1] | V2.vector4_u32[1]); + Result.vector4_u32[2] = ~(V1.vector4_u32[2] | V2.vector4_u32[2]); + Result.vector4_u32[3] = ~(V1.vector4_u32[3] | V2.vector4_u32[3]); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i Result; + Result = _mm_or_si128( reinterpret_cast(&V1)[0], reinterpret_cast(&V2)[0] ); + Result = _mm_andnot_si128( Result,g_XMNegOneMask); + return reinterpret_cast<__m128 *>(&Result)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorXorInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[0] ^ V2.vector4_u32[0]; + Result.vector4_u32[1] = V1.vector4_u32[1] ^ V2.vector4_u32[1]; + Result.vector4_u32[2] = V1.vector4_u32[2] ^ V2.vector4_u32[2]; + Result.vector4_u32[3] = V1.vector4_u32[3] ^ V2.vector4_u32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_xor_si128( reinterpret_cast(&V1)[0], reinterpret_cast(&V2)[0] ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNegate +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = -V.vector4_f32[0]; + Result.vector4_f32[1] = -V.vector4_f32[1]; + Result.vector4_f32[2] = -V.vector4_f32[2]; + Result.vector4_f32[3] = -V.vector4_f32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Z; + + Z = _mm_setzero_ps(); + + return _mm_sub_ps( Z, V ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorAdd +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = V1.vector4_f32[0] + V2.vector4_f32[0]; + Result.vector4_f32[1] = V1.vector4_f32[1] + V2.vector4_f32[1]; + Result.vector4_f32[2] = V1.vector4_f32[2] + V2.vector4_f32[2]; + Result.vector4_f32[3] = V1.vector4_f32[3] + V2.vector4_f32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_add_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorAddAngles +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Mask; + XMVECTOR Offset; + XMVECTOR Result; + CONST XMVECTOR Zero = XMVectorZero(); + + // Add the given angles together. If the range of V1 is such + // that -Pi <= V1 < Pi and the range of V2 is such that + // -2Pi <= V2 <= 2Pi, then the range of the resulting angle + // will be -Pi <= Result < Pi. + Result = XMVectorAdd(V1, V2); + + Mask = XMVectorLess(Result, g_XMNegativePi.v); + Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask); + + Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v); + Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask); + + Result = XMVectorAdd(Result, Offset); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Adjust the angles + XMVECTOR vResult = _mm_add_ps(V1,V2); + // Less than Pi? + XMVECTOR vOffset = _mm_cmplt_ps(vResult,g_XMNegativePi); + vOffset = _mm_and_ps(vOffset,g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = _mm_add_ps(vResult,vOffset); + // Greater than or equal to Pi? + vOffset = _mm_cmpge_ps(vResult,g_XMPi); + vOffset = _mm_and_ps(vOffset,g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = _mm_sub_ps(vResult,vOffset); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSubtract +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = V1.vector4_f32[0] - V2.vector4_f32[0]; + Result.vector4_f32[1] = V1.vector4_f32[1] - V2.vector4_f32[1]; + Result.vector4_f32[2] = V1.vector4_f32[2] - V2.vector4_f32[2]; + Result.vector4_f32[3] = V1.vector4_f32[3] - V2.vector4_f32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sub_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSubtractAngles +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Mask; + XMVECTOR Offset; + XMVECTOR Result; + CONST XMVECTOR Zero = XMVectorZero(); + + // Subtract the given angles. If the range of V1 is such + // that -Pi <= V1 < Pi and the range of V2 is such that + // -2Pi <= V2 <= 2Pi, then the range of the resulting angle + // will be -Pi <= Result < Pi. + Result = XMVectorSubtract(V1, V2); + + Mask = XMVectorLess(Result, g_XMNegativePi.v); + Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask); + + Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v); + Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask); + + Result = XMVectorAdd(Result, Offset); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Adjust the angles + XMVECTOR vResult = _mm_sub_ps(V1,V2); + // Less than Pi? + XMVECTOR vOffset = _mm_cmplt_ps(vResult,g_XMNegativePi); + vOffset = _mm_and_ps(vOffset,g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = _mm_add_ps(vResult,vOffset); + // Greater than or equal to Pi? + vOffset = _mm_cmpge_ps(vResult,g_XMPi); + vOffset = _mm_and_ps(vOffset,g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = _mm_sub_ps(vResult,vOffset); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMultiply +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result = { + V1.vector4_f32[0] * V2.vector4_f32[0], + V1.vector4_f32[1] * V2.vector4_f32[1], + V1.vector4_f32[2] * V2.vector4_f32[2], + V1.vector4_f32[3] * V2.vector4_f32[3] + }; + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_mul_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMultiplyAdd +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = { + (V1.vector4_f32[0] * V2.vector4_f32[0]) + V3.vector4_f32[0], + (V1.vector4_f32[1] * V2.vector4_f32[1]) + V3.vector4_f32[1], + (V1.vector4_f32[2] * V2.vector4_f32[2]) + V3.vector4_f32[2], + (V1.vector4_f32[3] * V2.vector4_f32[3]) + V3.vector4_f32[3] + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_mul_ps( V1, V2 ); + return _mm_add_ps(vResult, V3 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorDivide +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result; + Result.vector4_f32[0] = V1.vector4_f32[0] / V2.vector4_f32[0]; + Result.vector4_f32[1] = V1.vector4_f32[1] / V2.vector4_f32[1]; + Result.vector4_f32[2] = V1.vector4_f32[2] / V2.vector4_f32[2]; + Result.vector4_f32[3] = V1.vector4_f32[3] / V2.vector4_f32[3]; + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_div_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNegativeMultiplySubtract +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR vResult = { + V3.vector4_f32[0] - (V1.vector4_f32[0] * V2.vector4_f32[0]), + V3.vector4_f32[1] - (V1.vector4_f32[1] * V2.vector4_f32[1]), + V3.vector4_f32[2] - (V1.vector4_f32[2] * V2.vector4_f32[2]), + V3.vector4_f32[3] - (V1.vector4_f32[3] * V2.vector4_f32[3]) + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR R = _mm_mul_ps( V1, V2 ); + return _mm_sub_ps( V3, R ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorScale +( + FXMVECTOR V, + FLOAT ScaleFactor +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = { + V.vector4_f32[0] * ScaleFactor, + V.vector4_f32[1] * ScaleFactor, + V.vector4_f32[2] * ScaleFactor, + V.vector4_f32[3] * ScaleFactor + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_set_ps1(ScaleFactor); + return _mm_mul_ps(vResult,V); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorReciprocalEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result; + UINT i; + + // Avoid C4701 + Result.vector4_f32[0] = 0.0f; + + for (i = 0; i < 4; i++) + { + if (XMISNAN(V.vector4_f32[i])) + { + Result.vector4_u32[i] = 0x7FC00000; + } + else if (V.vector4_f32[i] == 0.0f || V.vector4_f32[i] == -0.0f) + { + Result.vector4_u32[i] = 0x7F800000 | (V.vector4_u32[i] & 0x80000000); + } + else + { + Result.vector4_f32[i] = 1.f / V.vector4_f32[i]; + } + } + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_rcp_ps(V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorReciprocal +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + return XMVectorReciprocalEst(V); + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_div_ps(g_XMOne,V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return an estimated square root +XMFINLINE XMVECTOR XMVectorSqrtEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Select; + + // if (x == +Infinity) sqrt(x) = +Infinity + // if (x == +0.0f) sqrt(x) = +0.0f + // if (x == -0.0f) sqrt(x) = -0.0f + // if (x < 0.0f) sqrt(x) = QNaN + + XMVECTOR Result = XMVectorReciprocalSqrtEst(V); + XMVECTOR Zero = XMVectorZero(); + XMVECTOR VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v); + XMVECTOR VEqualsZero = XMVectorEqual(V, Zero); + Result = XMVectorMultiply(V, Result); + Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero); + Result = XMVectorSelect(V, Result, Select); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sqrt_ps(V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSqrt +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Zero; + XMVECTOR VEqualsInfinity, VEqualsZero; + XMVECTOR Select; + XMVECTOR Result; + + // if (x == +Infinity) sqrt(x) = +Infinity + // if (x == +0.0f) sqrt(x) = +0.0f + // if (x == -0.0f) sqrt(x) = -0.0f + // if (x < 0.0f) sqrt(x) = QNaN + + Result = XMVectorReciprocalSqrt(V); + Zero = XMVectorZero(); + VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v); + VEqualsZero = XMVectorEqual(V, Zero); + Result = XMVectorMultiply(V, Result); + Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero); + Result = XMVectorSelect(V, Result, Select); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sqrt_ps(V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorReciprocalSqrtEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // if (x == +Infinity) rsqrt(x) = 0 + // if (x == +0.0f) rsqrt(x) = +Infinity + // if (x == -0.0f) rsqrt(x) = -Infinity + // if (x < 0.0f) rsqrt(x) = QNaN + + XMVECTOR Result; + UINT i; + + // Avoid C4701 + Result.vector4_f32[0] = 0.0f; + + for (i = 0; i < 4; i++) + { + if (XMISNAN(V.vector4_f32[i])) + { + Result.vector4_u32[i] = 0x7FC00000; + } + else if (V.vector4_f32[i] == 0.0f || V.vector4_f32[i] == -0.0f) + { + Result.vector4_u32[i] = 0x7F800000 | (V.vector4_u32[i] & 0x80000000); + } + else if (V.vector4_f32[i] < 0.0f) + { + Result.vector4_u32[i] = 0x7FFFFFFF; + } + else if (XMISINF(V.vector4_f32[i])) + { + Result.vector4_f32[i] = 0.0f; + } + else + { + Result.vector4_f32[i] = 1.0f / sqrtf(V.vector4_f32[i]); + } + } + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_rsqrt_ps(V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorReciprocalSqrt +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return XMVectorReciprocalSqrtEst(V); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_sqrt_ps(V); + vResult = _mm_div_ps(g_XMOne,vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorExpEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result.vector4_f32[0] = powf(2.0f, V.vector4_f32[0]); + Result.vector4_f32[1] = powf(2.0f, V.vector4_f32[1]); + Result.vector4_f32[2] = powf(2.0f, V.vector4_f32[2]); + Result.vector4_f32[3] = powf(2.0f, V.vector4_f32[3]); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_setr_ps( + powf(2.0f,XMVectorGetX(V)), + powf(2.0f,XMVectorGetY(V)), + powf(2.0f,XMVectorGetZ(V)), + powf(2.0f,XMVectorGetW(V))); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorExp +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR E, S; + XMVECTOR R, R2, R3, R4; + XMVECTOR V0, V1; + XMVECTOR C0X, C0Y, C0Z, C0W; + XMVECTOR C1X, C1Y, C1Z, C1W; + XMVECTOR Result; + static CONST XMVECTOR C0 = {1.0f, -6.93147182e-1f, 2.40226462e-1f, -5.55036440e-2f}; + static CONST XMVECTOR C1 = {9.61597636e-3f, -1.32823968e-3f, 1.47491097e-4f, -1.08635004e-5f}; + + R = XMVectorFloor(V); + E = XMVectorExpEst(R); + R = XMVectorSubtract(V, R); + R2 = XMVectorMultiply(R, R); + R3 = XMVectorMultiply(R, R2); + R4 = XMVectorMultiply(R2, R2); + + C0X = XMVectorSplatX(C0); + C0Y = XMVectorSplatY(C0); + C0Z = XMVectorSplatZ(C0); + C0W = XMVectorSplatW(C0); + + C1X = XMVectorSplatX(C1); + C1Y = XMVectorSplatY(C1); + C1Z = XMVectorSplatZ(C1); + C1W = XMVectorSplatW(C1); + + V0 = XMVectorMultiplyAdd(R, C0Y, C0X); + V0 = XMVectorMultiplyAdd(R2, C0Z, V0); + V0 = XMVectorMultiplyAdd(R3, C0W, V0); + + V1 = XMVectorMultiplyAdd(R, C1Y, C1X); + V1 = XMVectorMultiplyAdd(R2, C1Z, V1); + V1 = XMVectorMultiplyAdd(R3, C1W, V1); + + S = XMVectorMultiplyAdd(R4, V1, V0); + + S = XMVectorReciprocal(S); + Result = XMVectorMultiply(E, S); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 C0 = {1.0f, -6.93147182e-1f, 2.40226462e-1f, -5.55036440e-2f}; + static CONST XMVECTORF32 C1 = {9.61597636e-3f, -1.32823968e-3f, 1.47491097e-4f, -1.08635004e-5f}; + + // Get the integer of the input + XMVECTOR R = XMVectorFloor(V); + // Get the exponent estimate + XMVECTOR E = XMVectorExpEst(R); + // Get the fractional only + R = _mm_sub_ps(V,R); + // Get R^2 + XMVECTOR R2 = _mm_mul_ps(R,R); + // And R^3 + XMVECTOR R3 = _mm_mul_ps(R,R2); + + XMVECTOR V0 = _mm_load_ps1(&C0.f[1]); + V0 = _mm_mul_ps(V0,R); + XMVECTOR vConstants = _mm_load_ps1(&C0.f[0]); + V0 = _mm_add_ps(V0,vConstants); + vConstants = _mm_load_ps1(&C0.f[2]); + vConstants = _mm_mul_ps(vConstants,R2); + V0 = _mm_add_ps(V0,vConstants); + vConstants = _mm_load_ps1(&C0.f[3]); + vConstants = _mm_mul_ps(vConstants,R3); + V0 = _mm_add_ps(V0,vConstants); + + XMVECTOR V1 = _mm_load_ps1(&C1.f[1]); + V1 = _mm_mul_ps(V1,R); + vConstants = _mm_load_ps1(&C1.f[0]); + V1 = _mm_add_ps(V1,vConstants); + vConstants = _mm_load_ps1(&C1.f[2]); + vConstants = _mm_mul_ps(vConstants,R2); + V1 = _mm_add_ps(V1,vConstants); + vConstants = _mm_load_ps1(&C1.f[3]); + vConstants = _mm_mul_ps(vConstants,R3); + V1 = _mm_add_ps(V1,vConstants); + // R2 = R^4 + R2 = _mm_mul_ps(R2,R2); + R2 = _mm_mul_ps(R2,V1); + R2 = _mm_add_ps(R2,V0); + E = _mm_div_ps(E,R2); + return E; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorLogEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT fScale = (1.0f / logf(2.0f)); + XMVECTOR Result; + + Result.vector4_f32[0] = logf(V.vector4_f32[0])*fScale; + Result.vector4_f32[1] = logf(V.vector4_f32[1])*fScale; + Result.vector4_f32[2] = logf(V.vector4_f32[2])*fScale; + Result.vector4_f32[3] = logf(V.vector4_f32[3])*fScale; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vScale = _mm_set_ps1(1.0f / logf(2.0f)); + XMVECTOR vResult = _mm_setr_ps( + logf(XMVectorGetX(V)), + logf(XMVectorGetY(V)), + logf(XMVectorGetZ(V)), + logf(XMVectorGetW(V))); + vResult = _mm_mul_ps(vResult,vScale); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorLog +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fScale = (1.0f / logf(2.0f)); + XMVECTOR Result; + + Result.vector4_f32[0] = logf(V.vector4_f32[0])*fScale; + Result.vector4_f32[1] = logf(V.vector4_f32[1])*fScale; + Result.vector4_f32[2] = logf(V.vector4_f32[2])*fScale; + Result.vector4_f32[3] = logf(V.vector4_f32[3])*fScale; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vScale = _mm_set_ps1(1.0f / logf(2.0f)); + XMVECTOR vResult = _mm_setr_ps( + logf(XMVectorGetX(V)), + logf(XMVectorGetY(V)), + logf(XMVectorGetZ(V)), + logf(XMVectorGetW(V))); + vResult = _mm_mul_ps(vResult,vScale); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorPowEst +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = powf(V1.vector4_f32[0], V2.vector4_f32[0]); + Result.vector4_f32[1] = powf(V1.vector4_f32[1], V2.vector4_f32[1]); + Result.vector4_f32[2] = powf(V1.vector4_f32[2], V2.vector4_f32[2]); + Result.vector4_f32[3] = powf(V1.vector4_f32[3], V2.vector4_f32[3]); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_setr_ps( + powf(XMVectorGetX(V1),XMVectorGetX(V2)), + powf(XMVectorGetY(V1),XMVectorGetY(V2)), + powf(XMVectorGetZ(V1),XMVectorGetZ(V2)), + powf(XMVectorGetW(V1),XMVectorGetW(V2))); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorPow +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + + return XMVectorPowEst(V1, V2); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorAbs +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = { + fabsf(V.vector4_f32[0]), + fabsf(V.vector4_f32[1]), + fabsf(V.vector4_f32[2]), + fabsf(V.vector4_f32[3]) + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_setzero_ps(); + vResult = _mm_sub_ps(vResult,V); + vResult = _mm_max_ps(vResult,V); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMod +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Reciprocal; + XMVECTOR Quotient; + XMVECTOR Result; + + // V1 % V2 = V1 - V2 * truncate(V1 / V2) + Reciprocal = XMVectorReciprocal(V2); + Quotient = XMVectorMultiply(V1, Reciprocal); + Quotient = XMVectorTruncate(Quotient); + Result = XMVectorNegativeMultiplySubtract(V2, Quotient, V1); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_div_ps(V1, V2); + vResult = XMVectorTruncate(vResult); + vResult = _mm_mul_ps(vResult,V2); + vResult = _mm_sub_ps(V1,vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorModAngles +( + FXMVECTOR Angles +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR Result; + + // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI + V = XMVectorMultiply(Angles, g_XMReciprocalTwoPi.v); + V = XMVectorRound(V); + Result = XMVectorNegativeMultiplySubtract(g_XMTwoPi.v, V, Angles); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI + XMVECTOR vResult = _mm_mul_ps(Angles,g_XMReciprocalTwoPi); + // Use the inline function due to complexity for rounding + vResult = XMVectorRound(vResult); + vResult = _mm_mul_ps(vResult,g_XMTwoPi); + vResult = _mm_sub_ps(Angles,vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorSin +( + FXMVECTOR V +) +{ + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2, V3, V5, V7, V9, V11, V13, V15, V17, V19, V21, V23; + XMVECTOR S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11; + XMVECTOR Result; + + V1 = XMVectorModAngles(V); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - + // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI) + V2 = XMVectorMultiply(V1, V1); + V3 = XMVectorMultiply(V2, V1); + V5 = XMVectorMultiply(V3, V2); + V7 = XMVectorMultiply(V5, V2); + V9 = XMVectorMultiply(V7, V2); + V11 = XMVectorMultiply(V9, V2); + V13 = XMVectorMultiply(V11, V2); + V15 = XMVectorMultiply(V13, V2); + V17 = XMVectorMultiply(V15, V2); + V19 = XMVectorMultiply(V17, V2); + V21 = XMVectorMultiply(V19, V2); + V23 = XMVectorMultiply(V21, V2); + + S1 = XMVectorSplatY(g_XMSinCoefficients0.v); + S2 = XMVectorSplatZ(g_XMSinCoefficients0.v); + S3 = XMVectorSplatW(g_XMSinCoefficients0.v); + S4 = XMVectorSplatX(g_XMSinCoefficients1.v); + S5 = XMVectorSplatY(g_XMSinCoefficients1.v); + S6 = XMVectorSplatZ(g_XMSinCoefficients1.v); + S7 = XMVectorSplatW(g_XMSinCoefficients1.v); + S8 = XMVectorSplatX(g_XMSinCoefficients2.v); + S9 = XMVectorSplatY(g_XMSinCoefficients2.v); + S10 = XMVectorSplatZ(g_XMSinCoefficients2.v); + S11 = XMVectorSplatW(g_XMSinCoefficients2.v); + + Result = XMVectorMultiplyAdd(S1, V3, V1); + Result = XMVectorMultiplyAdd(S2, V5, Result); + Result = XMVectorMultiplyAdd(S3, V7, Result); + Result = XMVectorMultiplyAdd(S4, V9, Result); + Result = XMVectorMultiplyAdd(S5, V11, Result); + Result = XMVectorMultiplyAdd(S6, V13, Result); + Result = XMVectorMultiplyAdd(S7, V15, Result); + Result = XMVectorMultiplyAdd(S8, V17, Result); + Result = XMVectorMultiplyAdd(S9, V19, Result); + Result = XMVectorMultiplyAdd(S10, V21, Result); + Result = XMVectorMultiplyAdd(S11, V23, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR vResult = XMVectorModAngles(V); + // Each on is V to the "num" power + // V2 = V1^2 + XMVECTOR V2 = _mm_mul_ps(vResult,vResult); + // V1^3 + XMVECTOR vPower = _mm_mul_ps(vResult,V2); + XMVECTOR vConstants = _mm_load_ps1(&g_XMSinCoefficients0.f[1]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^5 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients0.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^7 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients0.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^9 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[0]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^11 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[1]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^13 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^15 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^17 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[0]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^19 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[1]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^21 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^23 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorCos +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2, V4, V6, V8, V10, V12, V14, V16, V18, V20, V22; + XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11; + XMVECTOR Result; + + V1 = XMVectorModAngles(V); + + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! - + // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI) + V2 = XMVectorMultiply(V1, V1); + V4 = XMVectorMultiply(V2, V2); + V6 = XMVectorMultiply(V4, V2); + V8 = XMVectorMultiply(V4, V4); + V10 = XMVectorMultiply(V6, V4); + V12 = XMVectorMultiply(V6, V6); + V14 = XMVectorMultiply(V8, V6); + V16 = XMVectorMultiply(V8, V8); + V18 = XMVectorMultiply(V10, V8); + V20 = XMVectorMultiply(V10, V10); + V22 = XMVectorMultiply(V12, V10); + + C1 = XMVectorSplatY(g_XMCosCoefficients0.v); + C2 = XMVectorSplatZ(g_XMCosCoefficients0.v); + C3 = XMVectorSplatW(g_XMCosCoefficients0.v); + C4 = XMVectorSplatX(g_XMCosCoefficients1.v); + C5 = XMVectorSplatY(g_XMCosCoefficients1.v); + C6 = XMVectorSplatZ(g_XMCosCoefficients1.v); + C7 = XMVectorSplatW(g_XMCosCoefficients1.v); + C8 = XMVectorSplatX(g_XMCosCoefficients2.v); + C9 = XMVectorSplatY(g_XMCosCoefficients2.v); + C10 = XMVectorSplatZ(g_XMCosCoefficients2.v); + C11 = XMVectorSplatW(g_XMCosCoefficients2.v); + + Result = XMVectorMultiplyAdd(C1, V2, g_XMOne.v); + Result = XMVectorMultiplyAdd(C2, V4, Result); + Result = XMVectorMultiplyAdd(C3, V6, Result); + Result = XMVectorMultiplyAdd(C4, V8, Result); + Result = XMVectorMultiplyAdd(C5, V10, Result); + Result = XMVectorMultiplyAdd(C6, V12, Result); + Result = XMVectorMultiplyAdd(C7, V14, Result); + Result = XMVectorMultiplyAdd(C8, V16, Result); + Result = XMVectorMultiplyAdd(C9, V18, Result); + Result = XMVectorMultiplyAdd(C10, V20, Result); + Result = XMVectorMultiplyAdd(C11, V22, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR V2 = XMVectorModAngles(V); + // Each on is V to the "num" power + // V2 = V1^2 + V2 = _mm_mul_ps(V2,V2); + // V^2 + XMVECTOR vConstants = _mm_load_ps1(&g_XMCosCoefficients0.f[1]); + vConstants = _mm_mul_ps(vConstants,V2); + XMVECTOR vResult = _mm_add_ps(vConstants,g_XMOne); + + // V^4 + XMVECTOR vPower = _mm_mul_ps(V2,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients0.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^6 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients0.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^8 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[0]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^10 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[1]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^12 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^14 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^16 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[0]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^18 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[1]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^20 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^22 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE VOID XMVectorSinCos +( + XMVECTOR* pSin, + XMVECTOR* pCos, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13; + XMVECTOR V14, V15, V16, V17, V18, V19, V20, V21, V22, V23; + XMVECTOR S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11; + XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11; + XMVECTOR Sin, Cos; + + XMASSERT(pSin); + XMASSERT(pCos); + + V1 = XMVectorModAngles(V); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - + // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! - + // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI) + + V2 = XMVectorMultiply(V1, V1); + V3 = XMVectorMultiply(V2, V1); + V4 = XMVectorMultiply(V2, V2); + V5 = XMVectorMultiply(V3, V2); + V6 = XMVectorMultiply(V3, V3); + V7 = XMVectorMultiply(V4, V3); + V8 = XMVectorMultiply(V4, V4); + V9 = XMVectorMultiply(V5, V4); + V10 = XMVectorMultiply(V5, V5); + V11 = XMVectorMultiply(V6, V5); + V12 = XMVectorMultiply(V6, V6); + V13 = XMVectorMultiply(V7, V6); + V14 = XMVectorMultiply(V7, V7); + V15 = XMVectorMultiply(V8, V7); + V16 = XMVectorMultiply(V8, V8); + V17 = XMVectorMultiply(V9, V8); + V18 = XMVectorMultiply(V9, V9); + V19 = XMVectorMultiply(V10, V9); + V20 = XMVectorMultiply(V10, V10); + V21 = XMVectorMultiply(V11, V10); + V22 = XMVectorMultiply(V11, V11); + V23 = XMVectorMultiply(V12, V11); + + S1 = XMVectorSplatY(g_XMSinCoefficients0.v); + S2 = XMVectorSplatZ(g_XMSinCoefficients0.v); + S3 = XMVectorSplatW(g_XMSinCoefficients0.v); + S4 = XMVectorSplatX(g_XMSinCoefficients1.v); + S5 = XMVectorSplatY(g_XMSinCoefficients1.v); + S6 = XMVectorSplatZ(g_XMSinCoefficients1.v); + S7 = XMVectorSplatW(g_XMSinCoefficients1.v); + S8 = XMVectorSplatX(g_XMSinCoefficients2.v); + S9 = XMVectorSplatY(g_XMSinCoefficients2.v); + S10 = XMVectorSplatZ(g_XMSinCoefficients2.v); + S11 = XMVectorSplatW(g_XMSinCoefficients2.v); + + C1 = XMVectorSplatY(g_XMCosCoefficients0.v); + C2 = XMVectorSplatZ(g_XMCosCoefficients0.v); + C3 = XMVectorSplatW(g_XMCosCoefficients0.v); + C4 = XMVectorSplatX(g_XMCosCoefficients1.v); + C5 = XMVectorSplatY(g_XMCosCoefficients1.v); + C6 = XMVectorSplatZ(g_XMCosCoefficients1.v); + C7 = XMVectorSplatW(g_XMCosCoefficients1.v); + C8 = XMVectorSplatX(g_XMCosCoefficients2.v); + C9 = XMVectorSplatY(g_XMCosCoefficients2.v); + C10 = XMVectorSplatZ(g_XMCosCoefficients2.v); + C11 = XMVectorSplatW(g_XMCosCoefficients2.v); + + Sin = XMVectorMultiplyAdd(S1, V3, V1); + Sin = XMVectorMultiplyAdd(S2, V5, Sin); + Sin = XMVectorMultiplyAdd(S3, V7, Sin); + Sin = XMVectorMultiplyAdd(S4, V9, Sin); + Sin = XMVectorMultiplyAdd(S5, V11, Sin); + Sin = XMVectorMultiplyAdd(S6, V13, Sin); + Sin = XMVectorMultiplyAdd(S7, V15, Sin); + Sin = XMVectorMultiplyAdd(S8, V17, Sin); + Sin = XMVectorMultiplyAdd(S9, V19, Sin); + Sin = XMVectorMultiplyAdd(S10, V21, Sin); + Sin = XMVectorMultiplyAdd(S11, V23, Sin); + + Cos = XMVectorMultiplyAdd(C1, V2, g_XMOne.v); + Cos = XMVectorMultiplyAdd(C2, V4, Cos); + Cos = XMVectorMultiplyAdd(C3, V6, Cos); + Cos = XMVectorMultiplyAdd(C4, V8, Cos); + Cos = XMVectorMultiplyAdd(C5, V10, Cos); + Cos = XMVectorMultiplyAdd(C6, V12, Cos); + Cos = XMVectorMultiplyAdd(C7, V14, Cos); + Cos = XMVectorMultiplyAdd(C8, V16, Cos); + Cos = XMVectorMultiplyAdd(C9, V18, Cos); + Cos = XMVectorMultiplyAdd(C10, V20, Cos); + Cos = XMVectorMultiplyAdd(C11, V22, Cos); + + *pSin = Sin; + *pCos = Cos; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSin); + XMASSERT(pCos); + XMVECTOR V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13; + XMVECTOR V14, V15, V16, V17, V18, V19, V20, V21, V22, V23; + XMVECTOR S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11; + XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11; + XMVECTOR Sin, Cos; + + V1 = XMVectorModAngles(V); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - + // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! - + // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI) + + V2 = XMVectorMultiply(V1, V1); + V3 = XMVectorMultiply(V2, V1); + V4 = XMVectorMultiply(V2, V2); + V5 = XMVectorMultiply(V3, V2); + V6 = XMVectorMultiply(V3, V3); + V7 = XMVectorMultiply(V4, V3); + V8 = XMVectorMultiply(V4, V4); + V9 = XMVectorMultiply(V5, V4); + V10 = XMVectorMultiply(V5, V5); + V11 = XMVectorMultiply(V6, V5); + V12 = XMVectorMultiply(V6, V6); + V13 = XMVectorMultiply(V7, V6); + V14 = XMVectorMultiply(V7, V7); + V15 = XMVectorMultiply(V8, V7); + V16 = XMVectorMultiply(V8, V8); + V17 = XMVectorMultiply(V9, V8); + V18 = XMVectorMultiply(V9, V9); + V19 = XMVectorMultiply(V10, V9); + V20 = XMVectorMultiply(V10, V10); + V21 = XMVectorMultiply(V11, V10); + V22 = XMVectorMultiply(V11, V11); + V23 = XMVectorMultiply(V12, V11); + + S1 = _mm_load_ps1(&g_XMSinCoefficients0.f[1]); + S2 = _mm_load_ps1(&g_XMSinCoefficients0.f[2]); + S3 = _mm_load_ps1(&g_XMSinCoefficients0.f[3]); + S4 = _mm_load_ps1(&g_XMSinCoefficients1.f[0]); + S5 = _mm_load_ps1(&g_XMSinCoefficients1.f[1]); + S6 = _mm_load_ps1(&g_XMSinCoefficients1.f[2]); + S7 = _mm_load_ps1(&g_XMSinCoefficients1.f[3]); + S8 = _mm_load_ps1(&g_XMSinCoefficients2.f[0]); + S9 = _mm_load_ps1(&g_XMSinCoefficients2.f[1]); + S10 = _mm_load_ps1(&g_XMSinCoefficients2.f[2]); + S11 = _mm_load_ps1(&g_XMSinCoefficients2.f[3]); + + C1 = _mm_load_ps1(&g_XMCosCoefficients0.f[1]); + C2 = _mm_load_ps1(&g_XMCosCoefficients0.f[2]); + C3 = _mm_load_ps1(&g_XMCosCoefficients0.f[3]); + C4 = _mm_load_ps1(&g_XMCosCoefficients1.f[0]); + C5 = _mm_load_ps1(&g_XMCosCoefficients1.f[1]); + C6 = _mm_load_ps1(&g_XMCosCoefficients1.f[2]); + C7 = _mm_load_ps1(&g_XMCosCoefficients1.f[3]); + C8 = _mm_load_ps1(&g_XMCosCoefficients2.f[0]); + C9 = _mm_load_ps1(&g_XMCosCoefficients2.f[1]); + C10 = _mm_load_ps1(&g_XMCosCoefficients2.f[2]); + C11 = _mm_load_ps1(&g_XMCosCoefficients2.f[3]); + + S1 = _mm_mul_ps(S1,V3); + Sin = _mm_add_ps(S1,V1); + Sin = XMVectorMultiplyAdd(S2, V5, Sin); + Sin = XMVectorMultiplyAdd(S3, V7, Sin); + Sin = XMVectorMultiplyAdd(S4, V9, Sin); + Sin = XMVectorMultiplyAdd(S5, V11, Sin); + Sin = XMVectorMultiplyAdd(S6, V13, Sin); + Sin = XMVectorMultiplyAdd(S7, V15, Sin); + Sin = XMVectorMultiplyAdd(S8, V17, Sin); + Sin = XMVectorMultiplyAdd(S9, V19, Sin); + Sin = XMVectorMultiplyAdd(S10, V21, Sin); + Sin = XMVectorMultiplyAdd(S11, V23, Sin); + + Cos = _mm_mul_ps(C1,V2); + Cos = _mm_add_ps(Cos,g_XMOne); + Cos = XMVectorMultiplyAdd(C2, V4, Cos); + Cos = XMVectorMultiplyAdd(C3, V6, Cos); + Cos = XMVectorMultiplyAdd(C4, V8, Cos); + Cos = XMVectorMultiplyAdd(C5, V10, Cos); + Cos = XMVectorMultiplyAdd(C6, V12, Cos); + Cos = XMVectorMultiplyAdd(C7, V14, Cos); + Cos = XMVectorMultiplyAdd(C8, V16, Cos); + Cos = XMVectorMultiplyAdd(C9, V18, Cos); + Cos = XMVectorMultiplyAdd(C10, V20, Cos); + Cos = XMVectorMultiplyAdd(C11, V22, Cos); + + *pSin = Sin; + *pCos = Cos; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorTan +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Cody and Waite algorithm to compute tangent. + + XMVECTOR VA, VB, VC, VC2; + XMVECTOR T0, T1, T2, T3, T4, T5, T6, T7; + XMVECTOR C0, C1, TwoDivPi, Epsilon; + XMVECTOR N, D; + XMVECTOR R0, R1; + XMVECTOR VIsZero, VCNearZero, VBIsEven; + XMVECTOR Zero; + XMVECTOR Result; + UINT i; + static CONST XMVECTOR TanCoefficients0 = {1.0f, -4.667168334e-1f, 2.566383229e-2f, -3.118153191e-4f}; + static CONST XMVECTOR TanCoefficients1 = {4.981943399e-7f, -1.333835001e-1f, 3.424887824e-3f, -1.786170734e-5f}; + static CONST XMVECTOR TanConstants = {1.570796371f, 6.077100628e-11f, 0.000244140625f, 2.0f / XM_PI}; + static CONST XMVECTORU32 Mask = {0x1, 0x1, 0x1, 0x1}; + + TwoDivPi = XMVectorSplatW(TanConstants); + + Zero = XMVectorZero(); + + C0 = XMVectorSplatX(TanConstants); + C1 = XMVectorSplatY(TanConstants); + Epsilon = XMVectorSplatZ(TanConstants); + + VA = XMVectorMultiply(V, TwoDivPi); + + VA = XMVectorRound(VA); + + VC = XMVectorNegativeMultiplySubtract(VA, C0, V); + + VB = XMVectorAbs(VA); + + VC = XMVectorNegativeMultiplySubtract(VA, C1, VC); + + for (i = 0; i < 4; i++) + { + VB.vector4_u32[i] = (UINT)VB.vector4_f32[i]; + } + + VC2 = XMVectorMultiply(VC, VC); + + T7 = XMVectorSplatW(TanCoefficients1); + T6 = XMVectorSplatZ(TanCoefficients1); + T4 = XMVectorSplatX(TanCoefficients1); + T3 = XMVectorSplatW(TanCoefficients0); + T5 = XMVectorSplatY(TanCoefficients1); + T2 = XMVectorSplatZ(TanCoefficients0); + T1 = XMVectorSplatY(TanCoefficients0); + T0 = XMVectorSplatX(TanCoefficients0); + + VBIsEven = XMVectorAndInt(VB, Mask.v); + VBIsEven = XMVectorEqualInt(VBIsEven, Zero); + + N = XMVectorMultiplyAdd(VC2, T7, T6); + D = XMVectorMultiplyAdd(VC2, T4, T3); + N = XMVectorMultiplyAdd(VC2, N, T5); + D = XMVectorMultiplyAdd(VC2, D, T2); + N = XMVectorMultiply(VC2, N); + D = XMVectorMultiplyAdd(VC2, D, T1); + N = XMVectorMultiplyAdd(VC, N, VC); + VCNearZero = XMVectorInBounds(VC, Epsilon); + D = XMVectorMultiplyAdd(VC2, D, T0); + + N = XMVectorSelect(N, VC, VCNearZero); + D = XMVectorSelect(D, g_XMOne.v, VCNearZero); + + R0 = XMVectorNegate(N); + R1 = XMVectorReciprocal(D); + R0 = XMVectorReciprocal(R0); + R1 = XMVectorMultiply(N, R1); + R0 = XMVectorMultiply(D, R0); + + VIsZero = XMVectorEqual(V, Zero); + + Result = XMVectorSelect(R0, R1, VBIsEven); + + Result = XMVectorSelect(Result, Zero, VIsZero); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Cody and Waite algorithm to compute tangent. + + XMVECTOR VA, VB, VC, VC2; + XMVECTOR T0, T1, T2, T3, T4, T5, T6, T7; + XMVECTOR C0, C1, TwoDivPi, Epsilon; + XMVECTOR N, D; + XMVECTOR R0, R1; + XMVECTOR VIsZero, VCNearZero, VBIsEven; + XMVECTOR Zero; + XMVECTOR Result; + static CONST XMVECTORF32 TanCoefficients0 = {1.0f, -4.667168334e-1f, 2.566383229e-2f, -3.118153191e-4f}; + static CONST XMVECTORF32 TanCoefficients1 = {4.981943399e-7f, -1.333835001e-1f, 3.424887824e-3f, -1.786170734e-5f}; + static CONST XMVECTORF32 TanConstants = {1.570796371f, 6.077100628e-11f, 0.000244140625f, 2.0f / XM_PI}; + static CONST XMVECTORI32 Mask = {0x1, 0x1, 0x1, 0x1}; + + TwoDivPi = XMVectorSplatW(TanConstants); + + Zero = XMVectorZero(); + + C0 = XMVectorSplatX(TanConstants); + C1 = XMVectorSplatY(TanConstants); + Epsilon = XMVectorSplatZ(TanConstants); + + VA = XMVectorMultiply(V, TwoDivPi); + + VA = XMVectorRound(VA); + + VC = XMVectorNegativeMultiplySubtract(VA, C0, V); + + VB = XMVectorAbs(VA); + + VC = XMVectorNegativeMultiplySubtract(VA, C1, VC); + + reinterpret_cast<__m128i *>(&VB)[0] = _mm_cvttps_epi32(VB); + + VC2 = XMVectorMultiply(VC, VC); + + T7 = XMVectorSplatW(TanCoefficients1); + T6 = XMVectorSplatZ(TanCoefficients1); + T4 = XMVectorSplatX(TanCoefficients1); + T3 = XMVectorSplatW(TanCoefficients0); + T5 = XMVectorSplatY(TanCoefficients1); + T2 = XMVectorSplatZ(TanCoefficients0); + T1 = XMVectorSplatY(TanCoefficients0); + T0 = XMVectorSplatX(TanCoefficients0); + + VBIsEven = XMVectorAndInt(VB,Mask); + VBIsEven = XMVectorEqualInt(VBIsEven, Zero); + + N = XMVectorMultiplyAdd(VC2, T7, T6); + D = XMVectorMultiplyAdd(VC2, T4, T3); + N = XMVectorMultiplyAdd(VC2, N, T5); + D = XMVectorMultiplyAdd(VC2, D, T2); + N = XMVectorMultiply(VC2, N); + D = XMVectorMultiplyAdd(VC2, D, T1); + N = XMVectorMultiplyAdd(VC, N, VC); + VCNearZero = XMVectorInBounds(VC, Epsilon); + D = XMVectorMultiplyAdd(VC2, D, T0); + + N = XMVectorSelect(N, VC, VCNearZero); + D = XMVectorSelect(D, g_XMOne, VCNearZero); + R0 = XMVectorNegate(N); + R1 = _mm_div_ps(N,D); + R0 = _mm_div_ps(D,R0); + VIsZero = XMVectorEqual(V, Zero); + Result = XMVectorSelect(R0, R1, VBIsEven); + Result = XMVectorSelect(Result, Zero, VIsZero); + + return Result; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorSinH +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = XMVectorMultiplyAdd(V, Scale.v, g_XMNegativeOne.v); + V2 = XMVectorNegativeMultiplySubtract(V, Scale.v, g_XMNegativeOne.v); + + E1 = XMVectorExp(V1); + E2 = XMVectorExp(V2); + + Result = XMVectorSubtract(E1, E2); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = _mm_mul_ps(V, Scale); + V1 = _mm_add_ps(V1,g_XMNegativeOne); + V2 = _mm_mul_ps(V, Scale); + V2 = _mm_sub_ps(g_XMNegativeOne,V2); + E1 = XMVectorExp(V1); + E2 = XMVectorExp(V2); + + Result = _mm_sub_ps(E1, E2); + + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorCosH +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTOR Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = XMVectorMultiplyAdd(V, Scale, g_XMNegativeOne.v); + V2 = XMVectorNegativeMultiplySubtract(V, Scale, g_XMNegativeOne.v); + + E1 = XMVectorExp(V1); + E2 = XMVectorExp(V2); + + Result = XMVectorAdd(E1, E2); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = _mm_mul_ps(V,Scale); + V1 = _mm_add_ps(V1,g_XMNegativeOne); + V2 = _mm_mul_ps(V, Scale); + V2 = _mm_sub_ps(g_XMNegativeOne,V2); + E1 = XMVectorExp(V1); + E2 = XMVectorExp(V2); + Result = _mm_add_ps(E1, E2); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorTanH +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR E; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f) + + E = XMVectorMultiply(V, Scale.v); + E = XMVectorExp(E); + E = XMVectorMultiplyAdd(E, g_XMOneHalf.v, g_XMOneHalf.v); + E = XMVectorReciprocal(E); + + Result = XMVectorSubtract(g_XMOne.v, E); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f) + + XMVECTOR E = _mm_mul_ps(V, Scale); + E = XMVectorExp(E); + E = _mm_mul_ps(E,g_XMOneHalf); + E = _mm_add_ps(E,g_XMOneHalf); + E = XMVectorReciprocal(E); + E = _mm_sub_ps(g_XMOne, E); + return E; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorASin +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V2, V3, AbsV; + XMVECTOR C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11; + XMVECTOR R0, R1, R2, R3, R4; + XMVECTOR OneMinusAbsV; + XMVECTOR Rsq; + XMVECTOR Result; + static CONST XMVECTOR OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f}; + + // asin(V) = V * (C0 + C1 * V + C2 * V^2 + C3 * V^3 + C4 * V^4 + C5 * V^5) + (1 - V) * rsq(1 - V) * + // V * (C6 + C7 * V + C8 * V^2 + C9 * V^3 + C10 * V^4 + C11 * V^5) + + AbsV = XMVectorAbs(V); + + V2 = XMVectorMultiply(V, V); + V3 = XMVectorMultiply(V2, AbsV); + + R4 = XMVectorNegativeMultiplySubtract(AbsV, V, V); + + OneMinusAbsV = XMVectorSubtract(OnePlusEpsilon, AbsV); + Rsq = XMVectorReciprocalSqrt(OneMinusAbsV); + + C0 = XMVectorSplatX(g_XMASinCoefficients0.v); + C1 = XMVectorSplatY(g_XMASinCoefficients0.v); + C2 = XMVectorSplatZ(g_XMASinCoefficients0.v); + C3 = XMVectorSplatW(g_XMASinCoefficients0.v); + + C4 = XMVectorSplatX(g_XMASinCoefficients1.v); + C5 = XMVectorSplatY(g_XMASinCoefficients1.v); + C6 = XMVectorSplatZ(g_XMASinCoefficients1.v); + C7 = XMVectorSplatW(g_XMASinCoefficients1.v); + + C8 = XMVectorSplatX(g_XMASinCoefficients2.v); + C9 = XMVectorSplatY(g_XMASinCoefficients2.v); + C10 = XMVectorSplatZ(g_XMASinCoefficients2.v); + C11 = XMVectorSplatW(g_XMASinCoefficients2.v); + + R0 = XMVectorMultiplyAdd(C3, AbsV, C7); + R1 = XMVectorMultiplyAdd(C1, AbsV, C5); + R2 = XMVectorMultiplyAdd(C2, AbsV, C6); + R3 = XMVectorMultiplyAdd(C0, AbsV, C4); + + R0 = XMVectorMultiplyAdd(R0, AbsV, C11); + R1 = XMVectorMultiplyAdd(R1, AbsV, C9); + R2 = XMVectorMultiplyAdd(R2, AbsV, C10); + R3 = XMVectorMultiplyAdd(R3, AbsV, C8); + + R0 = XMVectorMultiplyAdd(R2, V3, R0); + R1 = XMVectorMultiplyAdd(R3, V3, R1); + + R0 = XMVectorMultiply(V, R0); + R1 = XMVectorMultiply(R4, R1); + + Result = XMVectorMultiplyAdd(R1, Rsq, R0); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f}; + + // asin(V) = V * (C0 + C1 * V + C2 * V^2 + C3 * V^3 + C4 * V^4 + C5 * V^5) + (1 - V) * rsq(1 - V) * + // V * (C6 + C7 * V + C8 * V^2 + C9 * V^3 + C10 * V^4 + C11 * V^5) + // Get abs(V) + XMVECTOR vAbsV = _mm_setzero_ps(); + vAbsV = _mm_sub_ps(vAbsV,V); + vAbsV = _mm_max_ps(vAbsV,V); + + XMVECTOR R0 = vAbsV; + XMVECTOR vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[3]); + R0 = _mm_mul_ps(R0,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[3]); + R0 = _mm_add_ps(R0,vConstants); + + XMVECTOR R1 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[1]); + R1 = _mm_mul_ps(R1,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[1]); + R1 = _mm_add_ps(R1, vConstants); + + XMVECTOR R2 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[2]); + R2 = _mm_mul_ps(R2,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[2]); + R2 = _mm_add_ps(R2, vConstants); + + XMVECTOR R3 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[0]); + R3 = _mm_mul_ps(R3,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[0]); + R3 = _mm_add_ps(R3, vConstants); + + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[3]); + R0 = _mm_mul_ps(R0,vAbsV); + R0 = _mm_add_ps(R0,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[1]); + R1 = _mm_mul_ps(R1,vAbsV); + R1 = _mm_add_ps(R1,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[2]); + R2 = _mm_mul_ps(R2,vAbsV); + R2 = _mm_add_ps(R2,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[0]); + R3 = _mm_mul_ps(R3,vAbsV); + R3 = _mm_add_ps(R3,vConstants); + + // V3 = V^3 + vConstants = _mm_mul_ps(V,V); + vConstants = _mm_mul_ps(vConstants, vAbsV); + // Mul by V^3 + R2 = _mm_mul_ps(R2,vConstants); + R3 = _mm_mul_ps(R3,vConstants); + // Merge the results + R0 = _mm_add_ps(R0,R2); + R1 = _mm_add_ps(R1,R3); + + R0 = _mm_mul_ps(R0,V); + // vConstants = V-(V^2 retaining sign) + vConstants = _mm_mul_ps(vAbsV, V); + vConstants = _mm_sub_ps(V,vConstants); + R1 = _mm_mul_ps(R1,vConstants); + vConstants = _mm_sub_ps(OnePlusEpsilon,vAbsV); + // Do NOT use rsqrt/mul. This needs the precision + vConstants = _mm_sqrt_ps(vConstants); + R1 = _mm_div_ps(R1,vConstants); + R0 = _mm_add_ps(R0,R1); + return R0; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorACos +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V2, V3, AbsV; + XMVECTOR C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11; + XMVECTOR R0, R1, R2, R3, R4; + XMVECTOR OneMinusAbsV; + XMVECTOR Rsq; + XMVECTOR Result; + static CONST XMVECTOR OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f}; + + // acos(V) = PI / 2 - asin(V) + + AbsV = XMVectorAbs(V); + + V2 = XMVectorMultiply(V, V); + V3 = XMVectorMultiply(V2, AbsV); + + R4 = XMVectorNegativeMultiplySubtract(AbsV, V, V); + + OneMinusAbsV = XMVectorSubtract(OnePlusEpsilon, AbsV); + Rsq = XMVectorReciprocalSqrt(OneMinusAbsV); + + C0 = XMVectorSplatX(g_XMASinCoefficients0.v); + C1 = XMVectorSplatY(g_XMASinCoefficients0.v); + C2 = XMVectorSplatZ(g_XMASinCoefficients0.v); + C3 = XMVectorSplatW(g_XMASinCoefficients0.v); + + C4 = XMVectorSplatX(g_XMASinCoefficients1.v); + C5 = XMVectorSplatY(g_XMASinCoefficients1.v); + C6 = XMVectorSplatZ(g_XMASinCoefficients1.v); + C7 = XMVectorSplatW(g_XMASinCoefficients1.v); + + C8 = XMVectorSplatX(g_XMASinCoefficients2.v); + C9 = XMVectorSplatY(g_XMASinCoefficients2.v); + C10 = XMVectorSplatZ(g_XMASinCoefficients2.v); + C11 = XMVectorSplatW(g_XMASinCoefficients2.v); + + R0 = XMVectorMultiplyAdd(C3, AbsV, C7); + R1 = XMVectorMultiplyAdd(C1, AbsV, C5); + R2 = XMVectorMultiplyAdd(C2, AbsV, C6); + R3 = XMVectorMultiplyAdd(C0, AbsV, C4); + + R0 = XMVectorMultiplyAdd(R0, AbsV, C11); + R1 = XMVectorMultiplyAdd(R1, AbsV, C9); + R2 = XMVectorMultiplyAdd(R2, AbsV, C10); + R3 = XMVectorMultiplyAdd(R3, AbsV, C8); + + R0 = XMVectorMultiplyAdd(R2, V3, R0); + R1 = XMVectorMultiplyAdd(R3, V3, R1); + + R0 = XMVectorMultiply(V, R0); + R1 = XMVectorMultiply(R4, R1); + + Result = XMVectorMultiplyAdd(R1, Rsq, R0); + + Result = XMVectorSubtract(g_XMHalfPi.v, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f}; + // Uses only 6 registers for good code on x86 targets + // acos(V) = PI / 2 - asin(V) + // Get abs(V) + XMVECTOR vAbsV = _mm_setzero_ps(); + vAbsV = _mm_sub_ps(vAbsV,V); + vAbsV = _mm_max_ps(vAbsV,V); + // Perform the series in precision groups to + // retain precision across 20 bits. (3 bits of imprecision due to operations) + XMVECTOR R0 = vAbsV; + XMVECTOR vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[3]); + R0 = _mm_mul_ps(R0,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[3]); + R0 = _mm_add_ps(R0,vConstants); + R0 = _mm_mul_ps(R0,vAbsV); + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[3]); + R0 = _mm_add_ps(R0,vConstants); + + XMVECTOR R1 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[1]); + R1 = _mm_mul_ps(R1,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[1]); + R1 = _mm_add_ps(R1,vConstants); + R1 = _mm_mul_ps(R1, vAbsV); + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[1]); + R1 = _mm_add_ps(R1,vConstants); + + XMVECTOR R2 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[2]); + R2 = _mm_mul_ps(R2,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[2]); + R2 = _mm_add_ps(R2,vConstants); + R2 = _mm_mul_ps(R2, vAbsV); + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[2]); + R2 = _mm_add_ps(R2,vConstants); + + XMVECTOR R3 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[0]); + R3 = _mm_mul_ps(R3,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[0]); + R3 = _mm_add_ps(R3,vConstants); + R3 = _mm_mul_ps(R3, vAbsV); + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[0]); + R3 = _mm_add_ps(R3,vConstants); + + // vConstants = V^3 + vConstants = _mm_mul_ps(V,V); + vConstants = _mm_mul_ps(vConstants,vAbsV); + R2 = _mm_mul_ps(R2,vConstants); + R3 = _mm_mul_ps(R3,vConstants); + // Add the pair of values together here to retain + // as much precision as possible + R0 = _mm_add_ps(R0,R2); + R1 = _mm_add_ps(R1,R3); + + R0 = _mm_mul_ps(R0,V); + // vConstants = V-(V*abs(V)) + vConstants = _mm_mul_ps(V,vAbsV); + vConstants = _mm_sub_ps(V,vConstants); + R1 = _mm_mul_ps(R1,vConstants); + // Episilon exists to allow 1.0 as an answer + vConstants = _mm_sub_ps(OnePlusEpsilon, vAbsV); + // Use sqrt instead of rsqrt for precision + vConstants = _mm_sqrt_ps(vConstants); + R1 = _mm_div_ps(R1,vConstants); + R1 = _mm_add_ps(R1,R0); + vConstants = _mm_sub_ps(g_XMHalfPi,R1); + return vConstants; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorATan +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Cody and Waite algorithm to compute inverse tangent. + + XMVECTOR N, D; + XMVECTOR VF, G, ReciprocalF, AbsF, FA, FB; + XMVECTOR Sqrt3, Sqrt3MinusOne, TwoMinusSqrt3; + XMVECTOR HalfPi, OneThirdPi, OneSixthPi, Epsilon, MinV, MaxV; + XMVECTOR Zero; + XMVECTOR NegativeHalfPi; + XMVECTOR Angle1, Angle2; + XMVECTOR F_GT_One, F_GT_TwoMinusSqrt3, AbsF_LT_Epsilon, V_LT_Zero, V_GT_MaxV, V_LT_MinV; + XMVECTOR NegativeResult, Result; + XMVECTOR P0, P1, P2, P3, Q0, Q1, Q2, Q3; + static CONST XMVECTOR ATanConstants0 = {-1.3688768894e+1f, -2.0505855195e+1f, -8.4946240351f, -8.3758299368e-1f}; + static CONST XMVECTOR ATanConstants1 = {4.1066306682e+1f, 8.6157349597e+1f, 5.9578436142e+1f, 1.5024001160e+1f}; + static CONST XMVECTOR ATanConstants2 = {1.732050808f, 7.320508076e-1f, 2.679491924e-1f, 0.000244140625f}; // + static CONST XMVECTOR ATanConstants3 = {XM_PIDIV2, XM_PI / 3.0f, XM_PI / 6.0f, 8.507059173e+37f}; // + + Zero = XMVectorZero(); + + P0 = XMVectorSplatX(ATanConstants0); + P1 = XMVectorSplatY(ATanConstants0); + P2 = XMVectorSplatZ(ATanConstants0); + P3 = XMVectorSplatW(ATanConstants0); + + Q0 = XMVectorSplatX(ATanConstants1); + Q1 = XMVectorSplatY(ATanConstants1); + Q2 = XMVectorSplatZ(ATanConstants1); + Q3 = XMVectorSplatW(ATanConstants1); + + Sqrt3 = XMVectorSplatX(ATanConstants2); + Sqrt3MinusOne = XMVectorSplatY(ATanConstants2); + TwoMinusSqrt3 = XMVectorSplatZ(ATanConstants2); + Epsilon = XMVectorSplatW(ATanConstants2); + + HalfPi = XMVectorSplatX(ATanConstants3); + OneThirdPi = XMVectorSplatY(ATanConstants3); + OneSixthPi = XMVectorSplatZ(ATanConstants3); + MaxV = XMVectorSplatW(ATanConstants3); + + VF = XMVectorAbs(V); + ReciprocalF = XMVectorReciprocal(VF); + + F_GT_One = XMVectorGreater(VF, g_XMOne.v); + + VF = XMVectorSelect(VF, ReciprocalF, F_GT_One); + Angle1 = XMVectorSelect(Zero, HalfPi, F_GT_One); + Angle2 = XMVectorSelect(OneSixthPi, OneThirdPi, F_GT_One); + + F_GT_TwoMinusSqrt3 = XMVectorGreater(VF, TwoMinusSqrt3); + + FA = XMVectorMultiplyAdd(Sqrt3MinusOne, VF, VF); + FA = XMVectorAdd(FA, g_XMNegativeOne.v); + FB = XMVectorAdd(VF, Sqrt3); + FB = XMVectorReciprocal(FB); + FA = XMVectorMultiply(FA, FB); + + VF = XMVectorSelect(VF, FA, F_GT_TwoMinusSqrt3); + Angle1 = XMVectorSelect(Angle1, Angle2, F_GT_TwoMinusSqrt3); + + AbsF = XMVectorAbs(VF); + AbsF_LT_Epsilon = XMVectorLess(AbsF, Epsilon); + + G = XMVectorMultiply(VF, VF); + + D = XMVectorAdd(G, Q3); + D = XMVectorMultiplyAdd(D, G, Q2); + D = XMVectorMultiplyAdd(D, G, Q1); + D = XMVectorMultiplyAdd(D, G, Q0); + D = XMVectorReciprocal(D); + + N = XMVectorMultiplyAdd(P3, G, P2); + N = XMVectorMultiplyAdd(N, G, P1); + N = XMVectorMultiplyAdd(N, G, P0); + N = XMVectorMultiply(N, G); + Result = XMVectorMultiply(N, D); + + Result = XMVectorMultiplyAdd(Result, VF, VF); + + Result = XMVectorSelect(Result, VF, AbsF_LT_Epsilon); + + NegativeResult = XMVectorNegate(Result); + Result = XMVectorSelect(Result, NegativeResult, F_GT_One); + + Result = XMVectorAdd(Result, Angle1); + + V_LT_Zero = XMVectorLess(V, Zero); + NegativeResult = XMVectorNegate(Result); + Result = XMVectorSelect(Result, NegativeResult, V_LT_Zero); + + MinV = XMVectorNegate(MaxV); + NegativeHalfPi = XMVectorNegate(HalfPi); + V_GT_MaxV = XMVectorGreater(V, MaxV); + V_LT_MinV = XMVectorLess(V, MinV); + Result = XMVectorSelect(Result, g_XMHalfPi.v, V_GT_MaxV); + Result = XMVectorSelect(Result, NegativeHalfPi, V_LT_MinV); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 ATanConstants0 = {-1.3688768894e+1f, -2.0505855195e+1f, -8.4946240351f, -8.3758299368e-1f}; + static CONST XMVECTORF32 ATanConstants1 = {4.1066306682e+1f, 8.6157349597e+1f, 5.9578436142e+1f, 1.5024001160e+1f}; + static CONST XMVECTORF32 ATanConstants2 = {1.732050808f, 7.320508076e-1f, 2.679491924e-1f, 0.000244140625f}; // + static CONST XMVECTORF32 ATanConstants3 = {XM_PIDIV2, XM_PI / 3.0f, XM_PI / 6.0f, 8.507059173e+37f}; // + + XMVECTOR VF = XMVectorAbs(V); + XMVECTOR F_GT_One = _mm_cmpgt_ps(VF,g_XMOne); + XMVECTOR ReciprocalF = XMVectorReciprocal(VF); + VF = XMVectorSelect(VF, ReciprocalF, F_GT_One); + XMVECTOR Zero = XMVectorZero(); + XMVECTOR HalfPi = _mm_load_ps1(&ATanConstants3.f[0]); + XMVECTOR Angle1 = XMVectorSelect(Zero, HalfPi, F_GT_One); + // Pi/3 + XMVECTOR vConstants = _mm_load_ps1(&ATanConstants3.f[1]); + // Pi/6 + XMVECTOR Angle2 = _mm_load_ps1(&ATanConstants3.f[2]); + Angle2 = XMVectorSelect(Angle2, vConstants, F_GT_One); + + // 1-sqrt(3) + XMVECTOR FA = _mm_load_ps1(&ATanConstants2.f[1]); + FA = _mm_mul_ps(FA,VF); + FA = _mm_add_ps(FA,VF); + FA = _mm_add_ps(FA,g_XMNegativeOne); + // sqrt(3) + vConstants = _mm_load_ps1(&ATanConstants2.f[0]); + vConstants = _mm_add_ps(vConstants,VF); + FA = _mm_div_ps(FA,vConstants); + + // 2-sqrt(3) + vConstants = _mm_load_ps1(&ATanConstants2.f[2]); + // >2-sqrt(3)? + vConstants = _mm_cmpgt_ps(VF,vConstants); + VF = XMVectorSelect(VF, FA, vConstants); + Angle1 = XMVectorSelect(Angle1, Angle2, vConstants); + + XMVECTOR AbsF = XMVectorAbs(VF); + + XMVECTOR G = _mm_mul_ps(VF,VF); + XMVECTOR D = _mm_load_ps1(&ATanConstants1.f[3]); + D = _mm_add_ps(D,G); + D = _mm_mul_ps(D,G); + vConstants = _mm_load_ps1(&ATanConstants1.f[2]); + D = _mm_add_ps(D,vConstants); + D = _mm_mul_ps(D,G); + vConstants = _mm_load_ps1(&ATanConstants1.f[1]); + D = _mm_add_ps(D,vConstants); + D = _mm_mul_ps(D,G); + vConstants = _mm_load_ps1(&ATanConstants1.f[0]); + D = _mm_add_ps(D,vConstants); + + XMVECTOR N = _mm_load_ps1(&ATanConstants0.f[3]); + N = _mm_mul_ps(N,G); + vConstants = _mm_load_ps1(&ATanConstants0.f[2]); + N = _mm_add_ps(N,vConstants); + N = _mm_mul_ps(N,G); + vConstants = _mm_load_ps1(&ATanConstants0.f[1]); + N = _mm_add_ps(N,vConstants); + N = _mm_mul_ps(N,G); + vConstants = _mm_load_ps1(&ATanConstants0.f[0]); + N = _mm_add_ps(N,vConstants); + N = _mm_mul_ps(N,G); + XMVECTOR Result = _mm_div_ps(N,D); + + Result = _mm_mul_ps(Result,VF); + Result = _mm_add_ps(Result,VF); + // Epsilon + vConstants = _mm_load_ps1(&ATanConstants2.f[3]); + vConstants = _mm_cmpge_ps(vConstants,AbsF); + Result = XMVectorSelect(Result,VF,vConstants); + + XMVECTOR NegativeResult = _mm_mul_ps(Result,g_XMNegativeOne); + Result = XMVectorSelect(Result,NegativeResult,F_GT_One); + Result = _mm_add_ps(Result,Angle1); + + Zero = _mm_cmpge_ps(Zero,V); + NegativeResult = _mm_mul_ps(Result,g_XMNegativeOne); + Result = XMVectorSelect(Result,NegativeResult,Zero); + + XMVECTOR MaxV = _mm_load_ps1(&ATanConstants3.f[3]); + XMVECTOR MinV = _mm_mul_ps(MaxV,g_XMNegativeOne); + // Negate HalfPi + HalfPi = _mm_mul_ps(HalfPi,g_XMNegativeOne); + MaxV = _mm_cmple_ps(MaxV,V); + MinV = _mm_cmpge_ps(MinV,V); + Result = XMVectorSelect(Result,g_XMHalfPi,MaxV); + // HalfPi = -HalfPi + Result = XMVectorSelect(Result,HalfPi,MinV); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorATan2 +( + FXMVECTOR Y, + FXMVECTOR X +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Return the inverse tangent of Y / X in the range of -Pi to Pi with the following exceptions: + + // Y == 0 and X is Negative -> Pi with the sign of Y + // y == 0 and x is positive -> 0 with the sign of y + // Y != 0 and X == 0 -> Pi / 2 with the sign of Y + // Y != 0 and X is Negative -> atan(y/x) + (PI with the sign of Y) + // X == -Infinity and Finite Y -> Pi with the sign of Y + // X == +Infinity and Finite Y -> 0 with the sign of Y + // Y == Infinity and X is Finite -> Pi / 2 with the sign of Y + // Y == Infinity and X == -Infinity -> 3Pi / 4 with the sign of Y + // Y == Infinity and X == +Infinity -> Pi / 4 with the sign of Y + + XMVECTOR Reciprocal; + XMVECTOR V; + XMVECTOR YSign; + XMVECTOR Pi, PiOverTwo, PiOverFour, ThreePiOverFour; + XMVECTOR YEqualsZero, XEqualsZero, XIsPositive, YEqualsInfinity, XEqualsInfinity; + XMVECTOR ATanResultValid; + XMVECTOR R0, R1, R2, R3, R4, R5; + XMVECTOR Zero; + XMVECTOR Result; + static CONST XMVECTOR ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f}; + + Zero = XMVectorZero(); + ATanResultValid = XMVectorTrueInt(); + + Pi = XMVectorSplatX(ATan2Constants); + PiOverTwo = XMVectorSplatY(ATan2Constants); + PiOverFour = XMVectorSplatZ(ATan2Constants); + ThreePiOverFour = XMVectorSplatW(ATan2Constants); + + YEqualsZero = XMVectorEqual(Y, Zero); + XEqualsZero = XMVectorEqual(X, Zero); + XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v); + XIsPositive = XMVectorEqualInt(XIsPositive, Zero); + YEqualsInfinity = XMVectorIsInfinite(Y); + XEqualsInfinity = XMVectorIsInfinite(X); + + YSign = XMVectorAndInt(Y, g_XMNegativeZero.v); + Pi = XMVectorOrInt(Pi, YSign); + PiOverTwo = XMVectorOrInt(PiOverTwo, YSign); + PiOverFour = XMVectorOrInt(PiOverFour, YSign); + ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign); + + R1 = XMVectorSelect(Pi, YSign, XIsPositive); + R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero); + R3 = XMVectorSelect(R2, R1, YEqualsZero); + R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity); + Result = XMVectorSelect(R3, R5, YEqualsInfinity); + ATanResultValid = XMVectorEqualInt(Result, ATanResultValid); + + Reciprocal = XMVectorReciprocal(X); + V = XMVectorMultiply(Y, Reciprocal); + R0 = XMVectorATan(V); + + R1 = XMVectorSelect( Pi, Zero, XIsPositive ); + R2 = XMVectorAdd(R0, R1); + + Result = XMVectorSelect(Result, R2, ATanResultValid); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f}; + + // Mask if Y>0 && Y!=INF + XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y); + // Get the sign of (Y&0x80000000) + XMVECTOR YSign = _mm_and_ps(Y, g_XMNegativeZero); + // Get the sign bits of X + XMVECTOR XIsPositive = _mm_and_ps(X,g_XMNegativeZero); + // Change them to masks + XIsPositive = XMVectorEqualInt(XIsPositive,g_XMZero); + // Get Pi + XMVECTOR Pi = _mm_load_ps1(&ATan2Constants.f[0]); + // Copy the sign of Y + Pi = _mm_or_ps(Pi,YSign); + XMVECTOR R1 = XMVectorSelect(Pi,YSign,XIsPositive); + // Mask for X==0 + XMVECTOR vConstants = _mm_cmpeq_ps(X,g_XMZero); + // Get Pi/2 with with sign of Y + XMVECTOR PiOverTwo = _mm_load_ps1(&ATan2Constants.f[1]); + PiOverTwo = _mm_or_ps(PiOverTwo,YSign); + XMVECTOR R2 = XMVectorSelect(g_XMNegOneMask,PiOverTwo,vConstants); + // Mask for Y==0 + vConstants = _mm_cmpeq_ps(Y,g_XMZero); + R2 = XMVectorSelect(R2,R1,vConstants); + // Get Pi/4 with sign of Y + XMVECTOR PiOverFour = _mm_load_ps1(&ATan2Constants.f[2]); + PiOverFour = _mm_or_ps(PiOverFour,YSign); + // Get (Pi*3)/4 with sign of Y + XMVECTOR ThreePiOverFour = _mm_load_ps1(&ATan2Constants.f[3]); + ThreePiOverFour = _mm_or_ps(ThreePiOverFour,YSign); + vConstants = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X); + vConstants = XMVectorSelect(PiOverTwo,vConstants,XEqualsInfinity); + + XMVECTOR vResult = XMVectorSelect(R2,vConstants,YEqualsInfinity); + vConstants = XMVectorSelect(R1,vResult,YEqualsInfinity); + // At this point, any entry that's zero will get the result + // from XMVectorATan(), otherwise, return the failsafe value + vResult = XMVectorSelect(vResult,vConstants,XEqualsInfinity); + // Any entries not 0xFFFFFFFF, are considered precalculated + XMVECTOR ATanResultValid = XMVectorEqualInt(vResult,g_XMNegOneMask); + // Let's do the ATan2 function + vConstants = _mm_div_ps(Y,X); + vConstants = XMVectorATan(vConstants); + // Discard entries that have been declared void + + XMVECTOR R3 = XMVectorSelect( Pi, g_XMZero, XIsPositive ); + vConstants = _mm_add_ps( vConstants, R3 ); + + vResult = XMVectorSelect(vResult,vConstants,ATanResultValid); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSinEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V2, V3, V5, V7; + XMVECTOR S1, S2, S3; + XMVECTOR Result; + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + V2 = XMVectorMultiply(V, V); + V3 = XMVectorMultiply(V2, V); + V5 = XMVectorMultiply(V3, V2); + V7 = XMVectorMultiply(V5, V2); + + S1 = XMVectorSplatY(g_XMSinEstCoefficients.v); + S2 = XMVectorSplatZ(g_XMSinEstCoefficients.v); + S3 = XMVectorSplatW(g_XMSinEstCoefficients.v); + + Result = XMVectorMultiplyAdd(S1, V3, V); + Result = XMVectorMultiplyAdd(S2, V5, Result); + Result = XMVectorMultiplyAdd(S3, V7, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + XMVECTOR V2 = _mm_mul_ps(V,V); + XMVECTOR V3 = _mm_mul_ps(V2,V); + XMVECTOR vResult = _mm_load_ps1(&g_XMSinEstCoefficients.f[1]); + vResult = _mm_mul_ps(vResult,V3); + vResult = _mm_add_ps(vResult,V); + XMVECTOR vConstants = _mm_load_ps1(&g_XMSinEstCoefficients.f[2]); + // V^5 + V3 = _mm_mul_ps(V3,V2); + vConstants = _mm_mul_ps(vConstants,V3); + vResult = _mm_add_ps(vResult,vConstants); + vConstants = _mm_load_ps1(&g_XMSinEstCoefficients.f[3]); + // V^7 + V3 = _mm_mul_ps(V3,V2); + vConstants = _mm_mul_ps(vConstants,V3); + vResult = _mm_add_ps(vResult,vConstants); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorCosEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V2, V4, V6; + XMVECTOR C0, C1, C2, C3; + XMVECTOR Result; + + V2 = XMVectorMultiply(V, V); + V4 = XMVectorMultiply(V2, V2); + V6 = XMVectorMultiply(V4, V2); + + C0 = XMVectorSplatX(g_XMCosEstCoefficients.v); + C1 = XMVectorSplatY(g_XMCosEstCoefficients.v); + C2 = XMVectorSplatZ(g_XMCosEstCoefficients.v); + C3 = XMVectorSplatW(g_XMCosEstCoefficients.v); + + Result = XMVectorMultiplyAdd(C1, V2, C0); + Result = XMVectorMultiplyAdd(C2, V4, Result); + Result = XMVectorMultiplyAdd(C3, V6, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Get V^2 + XMVECTOR V2 = _mm_mul_ps(V,V); + XMVECTOR vResult = _mm_load_ps1(&g_XMCosEstCoefficients.f[1]); + vResult = _mm_mul_ps(vResult,V2); + XMVECTOR vConstants = _mm_load_ps1(&g_XMCosEstCoefficients.f[0]); + vResult = _mm_add_ps(vResult,vConstants); + vConstants = _mm_load_ps1(&g_XMCosEstCoefficients.f[2]); + // Get V^4 + XMVECTOR V4 = _mm_mul_ps(V2, V2); + vConstants = _mm_mul_ps(vConstants,V4); + vResult = _mm_add_ps(vResult,vConstants); + vConstants = _mm_load_ps1(&g_XMCosEstCoefficients.f[3]); + // It's really V^6 + V4 = _mm_mul_ps(V4,V2); + vConstants = _mm_mul_ps(vConstants,V4); + vResult = _mm_add_ps(vResult,vConstants); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMVectorSinCosEst +( + XMVECTOR* pSin, + XMVECTOR* pCos, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V2, V3, V4, V5, V6, V7; + XMVECTOR S1, S2, S3; + XMVECTOR C0, C1, C2, C3; + XMVECTOR Sin, Cos; + + XMASSERT(pSin); + XMASSERT(pCos); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI) + V2 = XMVectorMultiply(V, V); + V3 = XMVectorMultiply(V2, V); + V4 = XMVectorMultiply(V2, V2); + V5 = XMVectorMultiply(V3, V2); + V6 = XMVectorMultiply(V3, V3); + V7 = XMVectorMultiply(V4, V3); + + S1 = XMVectorSplatY(g_XMSinEstCoefficients.v); + S2 = XMVectorSplatZ(g_XMSinEstCoefficients.v); + S3 = XMVectorSplatW(g_XMSinEstCoefficients.v); + + C0 = XMVectorSplatX(g_XMCosEstCoefficients.v); + C1 = XMVectorSplatY(g_XMCosEstCoefficients.v); + C2 = XMVectorSplatZ(g_XMCosEstCoefficients.v); + C3 = XMVectorSplatW(g_XMCosEstCoefficients.v); + + Sin = XMVectorMultiplyAdd(S1, V3, V); + Sin = XMVectorMultiplyAdd(S2, V5, Sin); + Sin = XMVectorMultiplyAdd(S3, V7, Sin); + + Cos = XMVectorMultiplyAdd(C1, V2, C0); + Cos = XMVectorMultiplyAdd(C2, V4, Cos); + Cos = XMVectorMultiplyAdd(C3, V6, Cos); + + *pSin = Sin; + *pCos = Cos; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSin); + XMASSERT(pCos); + XMVECTOR V2, V3, V4, V5, V6, V7; + XMVECTOR S1, S2, S3; + XMVECTOR C0, C1, C2, C3; + XMVECTOR Sin, Cos; + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI) + V2 = XMVectorMultiply(V, V); + V3 = XMVectorMultiply(V2, V); + V4 = XMVectorMultiply(V2, V2); + V5 = XMVectorMultiply(V3, V2); + V6 = XMVectorMultiply(V3, V3); + V7 = XMVectorMultiply(V4, V3); + + S1 = _mm_load_ps1(&g_XMSinEstCoefficients.f[1]); + S2 = _mm_load_ps1(&g_XMSinEstCoefficients.f[2]); + S3 = _mm_load_ps1(&g_XMSinEstCoefficients.f[3]); + + C0 = _mm_load_ps1(&g_XMCosEstCoefficients.f[0]); + C1 = _mm_load_ps1(&g_XMCosEstCoefficients.f[1]); + C2 = _mm_load_ps1(&g_XMCosEstCoefficients.f[2]); + C3 = _mm_load_ps1(&g_XMCosEstCoefficients.f[3]); + + Sin = XMVectorMultiplyAdd(S1, V3, V); + Sin = XMVectorMultiplyAdd(S2, V5, Sin); + Sin = XMVectorMultiplyAdd(S3, V7, Sin); + + Cos = XMVectorMultiplyAdd(C1, V2, C0); + Cos = XMVectorMultiplyAdd(C2, V4, Cos); + Cos = XMVectorMultiplyAdd(C3, V6, Cos); + + *pSin = Sin; + *pCos = Cos; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorTanEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2, V1T0, V1T1, V2T2; + XMVECTOR T0, T1, T2; + XMVECTOR N, D; + XMVECTOR OneOverPi; + XMVECTOR Result; + + OneOverPi = XMVectorSplatW(g_XMTanEstCoefficients.v); + + V1 = XMVectorMultiply(V, OneOverPi); + V1 = XMVectorRound(V1); + + V1 = XMVectorNegativeMultiplySubtract(g_XMPi.v, V1, V); + + T0 = XMVectorSplatX(g_XMTanEstCoefficients.v); + T1 = XMVectorSplatY(g_XMTanEstCoefficients.v); + T2 = XMVectorSplatZ(g_XMTanEstCoefficients.v); + + V2T2 = XMVectorNegativeMultiplySubtract(V1, V1, T2); + V2 = XMVectorMultiply(V1, V1); + V1T0 = XMVectorMultiply(V1, T0); + V1T1 = XMVectorMultiply(V1, T1); + + D = XMVectorReciprocalEst(V2T2); + N = XMVectorMultiplyAdd(V2, V1T1, V1T0); + + Result = XMVectorMultiply(N, D); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1, V2, V1T0, V1T1, V2T2; + XMVECTOR T0, T1, T2; + XMVECTOR N, D; + XMVECTOR OneOverPi; + XMVECTOR Result; + + OneOverPi = XMVectorSplatW(g_XMTanEstCoefficients); + + V1 = XMVectorMultiply(V, OneOverPi); + V1 = XMVectorRound(V1); + + V1 = XMVectorNegativeMultiplySubtract(g_XMPi, V1, V); + + T0 = XMVectorSplatX(g_XMTanEstCoefficients); + T1 = XMVectorSplatY(g_XMTanEstCoefficients); + T2 = XMVectorSplatZ(g_XMTanEstCoefficients); + + V2T2 = XMVectorNegativeMultiplySubtract(V1, V1, T2); + V2 = XMVectorMultiply(V1, V1); + V1T0 = XMVectorMultiply(V1, T0); + V1T1 = XMVectorMultiply(V1, T1); + + D = XMVectorReciprocalEst(V2T2); + N = XMVectorMultiplyAdd(V2, V1T1, V1T0); + + Result = XMVectorMultiply(N, D); + + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSinHEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = XMVectorMultiplyAdd(V, Scale.v, g_XMNegativeOne.v); + V2 = XMVectorNegativeMultiplySubtract(V, Scale.v, g_XMNegativeOne.v); + + E1 = XMVectorExpEst(V1); + E2 = XMVectorExpEst(V2); + + Result = XMVectorSubtract(E1, E2); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = _mm_mul_ps(V,Scale); + V1 = _mm_add_ps(V1,g_XMNegativeOne); + V2 = _mm_mul_ps(V,Scale); + V2 = _mm_sub_ps(g_XMNegativeOne,V2); + E1 = XMVectorExpEst(V1); + E2 = XMVectorExpEst(V2); + Result = _mm_sub_ps(E1, E2); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorCosHEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTOR Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = XMVectorMultiplyAdd(V, Scale, g_XMNegativeOne.v); + V2 = XMVectorNegativeMultiplySubtract(V, Scale, g_XMNegativeOne.v); + + E1 = XMVectorExpEst(V1); + E2 = XMVectorExpEst(V2); + + Result = XMVectorAdd(E1, E2); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = _mm_mul_ps(V,Scale); + V1 = _mm_add_ps(V1,g_XMNegativeOne); + V2 = _mm_mul_ps(V, Scale); + V2 = _mm_sub_ps(g_XMNegativeOne,V2); + E1 = XMVectorExpEst(V1); + E2 = XMVectorExpEst(V2); + Result = _mm_add_ps(E1, E2); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorTanHEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR E; + XMVECTOR Result; + static CONST XMVECTOR Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f) + + E = XMVectorMultiply(V, Scale); + E = XMVectorExpEst(E); + E = XMVectorMultiplyAdd(E, g_XMOneHalf.v, g_XMOneHalf.v); + E = XMVectorReciprocalEst(E); + + Result = XMVectorSubtract(g_XMOne.v, E); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f) + + XMVECTOR E = _mm_mul_ps(V, Scale); + E = XMVectorExpEst(E); + E = _mm_mul_ps(E,g_XMOneHalf); + E = _mm_add_ps(E,g_XMOneHalf); + E = XMVectorReciprocalEst(E); + E = _mm_sub_ps(g_XMOne, E); + return E; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorASinEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR AbsV, V2, VD, VC0, V2C3; + XMVECTOR C0, C1, C2, C3; + XMVECTOR D, Rsq, SqrtD; + XMVECTOR OnePlusEps; + XMVECTOR Result; + + AbsV = XMVectorAbs(V); + + OnePlusEps = XMVectorSplatX(g_XMASinEstConstants.v); + + C0 = XMVectorSplatX(g_XMASinEstCoefficients.v); + C1 = XMVectorSplatY(g_XMASinEstCoefficients.v); + C2 = XMVectorSplatZ(g_XMASinEstCoefficients.v); + C3 = XMVectorSplatW(g_XMASinEstCoefficients.v); + + D = XMVectorSubtract(OnePlusEps, AbsV); + + Rsq = XMVectorReciprocalSqrtEst(D); + SqrtD = XMVectorMultiply(D, Rsq); + + V2 = XMVectorMultiply(V, AbsV); + V2C3 = XMVectorMultiply(V2, C3); + VD = XMVectorMultiply(D, AbsV); + VC0 = XMVectorMultiply(V, C0); + + Result = XMVectorMultiply(V, C1); + Result = XMVectorMultiplyAdd(V2, C2, Result); + Result = XMVectorMultiplyAdd(V2C3, VD, Result); + Result = XMVectorMultiplyAdd(VC0, SqrtD, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Get abs(V) + XMVECTOR vAbsV = _mm_setzero_ps(); + vAbsV = _mm_sub_ps(vAbsV,V); + vAbsV = _mm_max_ps(vAbsV,V); + + XMVECTOR D = _mm_load_ps1(&g_XMASinEstConstants.f[0]); + D = _mm_sub_ps(D,vAbsV); + // Since this is an estimate, rqsrt is okay + XMVECTOR vConstants = _mm_rsqrt_ps(D); + XMVECTOR SqrtD = _mm_mul_ps(D,vConstants); + // V2 = V^2 retaining sign + XMVECTOR V2 = _mm_mul_ps(V,vAbsV); + D = _mm_mul_ps(D,vAbsV); + + XMVECTOR vResult = _mm_load_ps1(&g_XMASinEstCoefficients.f[1]); + vResult = _mm_mul_ps(vResult,V); + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[2]); + vConstants = _mm_mul_ps(vConstants,V2); + vResult = _mm_add_ps(vResult,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[3]); + vConstants = _mm_mul_ps(vConstants,V2); + vConstants = _mm_mul_ps(vConstants,D); + vResult = _mm_add_ps(vResult,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[0]); + vConstants = _mm_mul_ps(vConstants,V); + vConstants = _mm_mul_ps(vConstants,SqrtD); + vResult = _mm_add_ps(vResult,vConstants); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorACosEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR AbsV, V2, VD, VC0, V2C3; + XMVECTOR C0, C1, C2, C3; + XMVECTOR D, Rsq, SqrtD; + XMVECTOR OnePlusEps, HalfPi; + XMVECTOR Result; + + // acos(V) = PI / 2 - asin(V) + + AbsV = XMVectorAbs(V); + + OnePlusEps = XMVectorSplatX(g_XMASinEstConstants.v); + HalfPi = XMVectorSplatY(g_XMASinEstConstants.v); + + C0 = XMVectorSplatX(g_XMASinEstCoefficients.v); + C1 = XMVectorSplatY(g_XMASinEstCoefficients.v); + C2 = XMVectorSplatZ(g_XMASinEstCoefficients.v); + C3 = XMVectorSplatW(g_XMASinEstCoefficients.v); + + D = XMVectorSubtract(OnePlusEps, AbsV); + + Rsq = XMVectorReciprocalSqrtEst(D); + SqrtD = XMVectorMultiply(D, Rsq); + + V2 = XMVectorMultiply(V, AbsV); + V2C3 = XMVectorMultiply(V2, C3); + VD = XMVectorMultiply(D, AbsV); + VC0 = XMVectorMultiply(V, C0); + + Result = XMVectorMultiply(V, C1); + Result = XMVectorMultiplyAdd(V2, C2, Result); + Result = XMVectorMultiplyAdd(V2C3, VD, Result); + Result = XMVectorMultiplyAdd(VC0, SqrtD, Result); + Result = XMVectorSubtract(HalfPi, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // acos(V) = PI / 2 - asin(V) + // Get abs(V) + XMVECTOR vAbsV = _mm_setzero_ps(); + vAbsV = _mm_sub_ps(vAbsV,V); + vAbsV = _mm_max_ps(vAbsV,V); + // Calc D + XMVECTOR D = _mm_load_ps1(&g_XMASinEstConstants.f[0]); + D = _mm_sub_ps(D,vAbsV); + // SqrtD = sqrt(D-abs(V)) estimated + XMVECTOR vConstants = _mm_rsqrt_ps(D); + XMVECTOR SqrtD = _mm_mul_ps(D,vConstants); + // V2 = V^2 while retaining sign + XMVECTOR V2 = _mm_mul_ps(V, vAbsV); + // Drop vAbsV here. D = (Const-abs(V))*abs(V) + D = _mm_mul_ps(D, vAbsV); + + XMVECTOR vResult = _mm_load_ps1(&g_XMASinEstCoefficients.f[1]); + vResult = _mm_mul_ps(vResult,V); + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[2]); + vConstants = _mm_mul_ps(vConstants,V2); + vResult = _mm_add_ps(vResult,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[3]); + vConstants = _mm_mul_ps(vConstants,V2); + vConstants = _mm_mul_ps(vConstants,D); + vResult = _mm_add_ps(vResult,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[0]); + vConstants = _mm_mul_ps(vConstants,V); + vConstants = _mm_mul_ps(vConstants,SqrtD); + vResult = _mm_add_ps(vResult,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinEstConstants.f[1]); + vResult = _mm_sub_ps(vConstants,vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorATanEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR AbsV, V2S2, N, D; + XMVECTOR S0, S1, S2; + XMVECTOR HalfPi; + XMVECTOR Result; + + S0 = XMVectorSplatX(g_XMATanEstCoefficients.v); + S1 = XMVectorSplatY(g_XMATanEstCoefficients.v); + S2 = XMVectorSplatZ(g_XMATanEstCoefficients.v); + HalfPi = XMVectorSplatW(g_XMATanEstCoefficients.v); + + AbsV = XMVectorAbs(V); + + V2S2 = XMVectorMultiplyAdd(V, V, S2); + N = XMVectorMultiplyAdd(AbsV, HalfPi, S0); + D = XMVectorMultiplyAdd(AbsV, S1, V2S2); + N = XMVectorMultiply(N, V); + D = XMVectorReciprocalEst(D); + + Result = XMVectorMultiply(N, D); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Get abs(V) + XMVECTOR vAbsV = _mm_setzero_ps(); + vAbsV = _mm_sub_ps(vAbsV,V); + vAbsV = _mm_max_ps(vAbsV,V); + + XMVECTOR vResult = _mm_load_ps1(&g_XMATanEstCoefficients.f[3]); + vResult = _mm_mul_ps(vResult,vAbsV); + XMVECTOR vConstants = _mm_load_ps1(&g_XMATanEstCoefficients.f[0]); + vResult = _mm_add_ps(vResult,vConstants); + vResult = _mm_mul_ps(vResult,V); + + XMVECTOR D = _mm_mul_ps(V,V); + vConstants = _mm_load_ps1(&g_XMATanEstCoefficients.f[2]); + D = _mm_add_ps(D,vConstants); + vConstants = _mm_load_ps1(&g_XMATanEstCoefficients.f[1]); + vConstants = _mm_mul_ps(vConstants,vAbsV); + D = _mm_add_ps(D,vConstants); + vResult = _mm_div_ps(vResult,D); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorATan2Est +( + FXMVECTOR Y, + FXMVECTOR X +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Reciprocal; + XMVECTOR V; + XMVECTOR YSign; + XMVECTOR Pi, PiOverTwo, PiOverFour, ThreePiOverFour; + XMVECTOR YEqualsZero, XEqualsZero, XIsPositive, YEqualsInfinity, XEqualsInfinity; + XMVECTOR ATanResultValid; + XMVECTOR R0, R1, R2, R3, R4, R5; + XMVECTOR Zero; + XMVECTOR Result; + static CONST XMVECTOR ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f}; + + Zero = XMVectorZero(); + ATanResultValid = XMVectorTrueInt(); + + Pi = XMVectorSplatX(ATan2Constants); + PiOverTwo = XMVectorSplatY(ATan2Constants); + PiOverFour = XMVectorSplatZ(ATan2Constants); + ThreePiOverFour = XMVectorSplatW(ATan2Constants); + + YEqualsZero = XMVectorEqual(Y, Zero); + XEqualsZero = XMVectorEqual(X, Zero); + XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v); + XIsPositive = XMVectorEqualInt(XIsPositive, Zero); + YEqualsInfinity = XMVectorIsInfinite(Y); + XEqualsInfinity = XMVectorIsInfinite(X); + + YSign = XMVectorAndInt(Y, g_XMNegativeZero.v); + Pi = XMVectorOrInt(Pi, YSign); + PiOverTwo = XMVectorOrInt(PiOverTwo, YSign); + PiOverFour = XMVectorOrInt(PiOverFour, YSign); + ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign); + + R1 = XMVectorSelect(Pi, YSign, XIsPositive); + R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero); + R3 = XMVectorSelect(R2, R1, YEqualsZero); + R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity); + Result = XMVectorSelect(R3, R5, YEqualsInfinity); + ATanResultValid = XMVectorEqualInt(Result, ATanResultValid); + + Reciprocal = XMVectorReciprocalEst(X); + V = XMVectorMultiply(Y, Reciprocal); + R0 = XMVectorATanEst(V); + + R1 = XMVectorSelect( Pi, Zero, XIsPositive ); + R2 = XMVectorAdd(R0, R1); + + Result = XMVectorSelect(Result, R2, ATanResultValid); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f}; + + // Mask if Y>0 && Y!=INF + XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y); + // Get the sign of (Y&0x80000000) + XMVECTOR YSign = _mm_and_ps(Y, g_XMNegativeZero); + // Get the sign bits of X + XMVECTOR XIsPositive = _mm_and_ps(X,g_XMNegativeZero); + // Change them to masks + XIsPositive = XMVectorEqualInt(XIsPositive,g_XMZero); + // Get Pi + XMVECTOR Pi = _mm_load_ps1(&ATan2Constants.f[0]); + // Copy the sign of Y + Pi = _mm_or_ps(Pi,YSign); + XMVECTOR R1 = XMVectorSelect(Pi,YSign,XIsPositive); + // Mask for X==0 + XMVECTOR vConstants = _mm_cmpeq_ps(X,g_XMZero); + // Get Pi/2 with with sign of Y + XMVECTOR PiOverTwo = _mm_load_ps1(&ATan2Constants.f[1]); + PiOverTwo = _mm_or_ps(PiOverTwo,YSign); + XMVECTOR R2 = XMVectorSelect(g_XMNegOneMask,PiOverTwo,vConstants); + // Mask for Y==0 + vConstants = _mm_cmpeq_ps(Y,g_XMZero); + R2 = XMVectorSelect(R2,R1,vConstants); + // Get Pi/4 with sign of Y + XMVECTOR PiOverFour = _mm_load_ps1(&ATan2Constants.f[2]); + PiOverFour = _mm_or_ps(PiOverFour,YSign); + // Get (Pi*3)/4 with sign of Y + XMVECTOR ThreePiOverFour = _mm_load_ps1(&ATan2Constants.f[3]); + ThreePiOverFour = _mm_or_ps(ThreePiOverFour,YSign); + vConstants = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X); + vConstants = XMVectorSelect(PiOverTwo,vConstants,XEqualsInfinity); + + XMVECTOR vResult = XMVectorSelect(R2,vConstants,YEqualsInfinity); + vConstants = XMVectorSelect(R1,vResult,YEqualsInfinity); + // At this point, any entry that's zero will get the result + // from XMVectorATan(), otherwise, return the failsafe value + vResult = XMVectorSelect(vResult,vConstants,XEqualsInfinity); + // Any entries not 0xFFFFFFFF, are considered precalculated + XMVECTOR ATanResultValid = XMVectorEqualInt(vResult,g_XMNegOneMask); + // Let's do the ATan2 function + XMVECTOR Reciprocal = _mm_rcp_ps(X); + vConstants = _mm_mul_ps(Y, Reciprocal); + vConstants = XMVectorATanEst(vConstants); + // Discard entries that have been declared void + + XMVECTOR R3 = XMVectorSelect( Pi, g_XMZero, XIsPositive ); + vConstants = _mm_add_ps( vConstants, R3 ); + + vResult = XMVectorSelect(vResult,vConstants,ATanResultValid); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorLerp +( + FXMVECTOR V0, + FXMVECTOR V1, + FLOAT t +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Scale; + XMVECTOR Length; + XMVECTOR Result; + + // V0 + t * (V1 - V0) + Scale = XMVectorReplicate(t); + Length = XMVectorSubtract(V1, V0); + Result = XMVectorMultiplyAdd(Length, Scale, V0); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR L, S; + XMVECTOR Result; + + L = _mm_sub_ps( V1, V0 ); + + S = _mm_set_ps1( t ); + + Result = _mm_mul_ps( L, S ); + + return _mm_add_ps( Result, V0 ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorLerpV +( + FXMVECTOR V0, + FXMVECTOR V1, + FXMVECTOR T +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Length; + XMVECTOR Result; + + // V0 + T * (V1 - V0) + Length = XMVectorSubtract(V1, V0); + Result = XMVectorMultiplyAdd(Length, T, V0); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Length; + XMVECTOR Result; + + Length = _mm_sub_ps( V1, V0 ); + + Result = _mm_mul_ps( Length, T ); + + return _mm_add_ps( Result, V0 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorHermite +( + FXMVECTOR Position0, + FXMVECTOR Tangent0, + FXMVECTOR Position1, + CXMVECTOR Tangent1, + FLOAT t +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P0; + XMVECTOR T0; + XMVECTOR P1; + XMVECTOR T1; + XMVECTOR Result; + FLOAT t2; + FLOAT t3; + + // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + + // (t^3 - 2 * t^2 + t) * Tangent0 + + // (-2 * t^3 + 3 * t^2) * Position1 + + // (t^3 - t^2) * Tangent1 + t2 = t * t; + t3 = t * t2; + + P0 = XMVectorReplicate(2.0f * t3 - 3.0f * t2 + 1.0f); + T0 = XMVectorReplicate(t3 - 2.0f * t2 + t); + P1 = XMVectorReplicate(-2.0f * t3 + 3.0f * t2); + T1 = XMVectorReplicate(t3 - t2); + + Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(T0, Tangent0, Result); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(T1, Tangent1, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + FLOAT t2 = t * t; + FLOAT t3 = t * t2; + + XMVECTOR P0 = _mm_set_ps1(2.0f * t3 - 3.0f * t2 + 1.0f); + XMVECTOR T0 = _mm_set_ps1(t3 - 2.0f * t2 + t); + XMVECTOR P1 = _mm_set_ps1(-2.0f * t3 + 3.0f * t2); + XMVECTOR T1 = _mm_set_ps1(t3 - t2); + + XMVECTOR vResult = _mm_mul_ps(P0, Position0); + XMVECTOR vTemp = _mm_mul_ps(T0, Tangent0); + vResult = _mm_add_ps(vResult,vTemp); + vTemp = _mm_mul_ps(P1, Position1); + vResult = _mm_add_ps(vResult,vTemp); + vTemp = _mm_mul_ps(T1, Tangent1); + vResult = _mm_add_ps(vResult,vTemp); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorHermiteV +( + FXMVECTOR Position0, + FXMVECTOR Tangent0, + FXMVECTOR Position1, + CXMVECTOR Tangent1, + CXMVECTOR T +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P0; + XMVECTOR T0; + XMVECTOR P1; + XMVECTOR T1; + XMVECTOR Result; + XMVECTOR T2; + XMVECTOR T3; + + // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + + // (t^3 - 2 * t^2 + t) * Tangent0 + + // (-2 * t^3 + 3 * t^2) * Position1 + + // (t^3 - t^2) * Tangent1 + T2 = XMVectorMultiply(T, T); + T3 = XMVectorMultiply(T , T2); + + P0 = XMVectorReplicate(2.0f * T3.vector4_f32[0] - 3.0f * T2.vector4_f32[0] + 1.0f); + T0 = XMVectorReplicate(T3.vector4_f32[1] - 2.0f * T2.vector4_f32[1] + T.vector4_f32[1]); + P1 = XMVectorReplicate(-2.0f * T3.vector4_f32[2] + 3.0f * T2.vector4_f32[2]); + T1 = XMVectorReplicate(T3.vector4_f32[3] - T2.vector4_f32[3]); + + Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(T0, Tangent0, Result); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(T1, Tangent1, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 CatMulT2 = {-3.0f,-2.0f,3.0f,-1.0f}; + static const XMVECTORF32 CatMulT3 = {2.0f,1.0f,-2.0f,1.0f}; + + // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + + // (t^3 - 2 * t^2 + t) * Tangent0 + + // (-2 * t^3 + 3 * t^2) * Position1 + + // (t^3 - t^2) * Tangent1 + XMVECTOR T2 = _mm_mul_ps(T,T); + XMVECTOR T3 = _mm_mul_ps(T,T2); + // Mul by the constants against t^2 + T2 = _mm_mul_ps(T2,CatMulT2); + // Mul by the constants against t^3 + T3 = _mm_mul_ps(T3,CatMulT3); + // T3 now has the pre-result. + T3 = _mm_add_ps(T3,T2); + // I need to add t.y only + T2 = _mm_and_ps(T,g_XMMaskY); + T3 = _mm_add_ps(T3,T2); + // Add 1.0f to x + T3 = _mm_add_ps(T3,g_XMIdentityR0); + // Now, I have the constants created + // Mul the x constant to Position0 + XMVECTOR vResult = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,Position0); + // Mul the y constant to Tangent0 + T2 = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(1,1,1,1)); + T2 = _mm_mul_ps(T2,Tangent0); + vResult = _mm_add_ps(vResult,T2); + // Mul the z constant to Position1 + T2 = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(2,2,2,2)); + T2 = _mm_mul_ps(T2,Position1); + vResult = _mm_add_ps(vResult,T2); + // Mul the w constant to Tangent1 + T3 = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(3,3,3,3)); + T3 = _mm_mul_ps(T3,Tangent1); + vResult = _mm_add_ps(vResult,T3); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorCatmullRom +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + CXMVECTOR Position3, + FLOAT t +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P0; + XMVECTOR P1; + XMVECTOR P2; + XMVECTOR P3; + XMVECTOR Result; + FLOAT t2; + FLOAT t3; + + // Result = ((-t^3 + 2 * t^2 - t) * Position0 + + // (3 * t^3 - 5 * t^2 + 2) * Position1 + + // (-3 * t^3 + 4 * t^2 + t) * Position2 + + // (t^3 - t^2) * Position3) * 0.5 + t2 = t * t; + t3 = t * t2; + + P0 = XMVectorReplicate((-t3 + 2.0f * t2 - t) * 0.5f); + P1 = XMVectorReplicate((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f); + P2 = XMVectorReplicate((-3.0f * t3 + 4.0f * t2 + t) * 0.5f); + P3 = XMVectorReplicate((t3 - t2) * 0.5f); + + Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(P2, Position2, Result); + Result = XMVectorMultiplyAdd(P3, Position3, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + FLOAT t2 = t * t; + FLOAT t3 = t * t2; + + XMVECTOR P0 = _mm_set_ps1((-t3 + 2.0f * t2 - t) * 0.5f); + XMVECTOR P1 = _mm_set_ps1((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f); + XMVECTOR P2 = _mm_set_ps1((-3.0f * t3 + 4.0f * t2 + t) * 0.5f); + XMVECTOR P3 = _mm_set_ps1((t3 - t2) * 0.5f); + + P0 = _mm_mul_ps(P0, Position0); + P1 = _mm_mul_ps(P1, Position1); + P2 = _mm_mul_ps(P2, Position2); + P3 = _mm_mul_ps(P3, Position3); + P0 = _mm_add_ps(P0,P1); + P2 = _mm_add_ps(P2,P3); + P0 = _mm_add_ps(P0,P2); + return P0; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorCatmullRomV +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + CXMVECTOR Position3, + CXMVECTOR T +) +{ +#if defined(_XM_NO_INTRINSICS_) + float fx = T.vector4_f32[0]; + float fy = T.vector4_f32[1]; + float fz = T.vector4_f32[2]; + float fw = T.vector4_f32[3]; + XMVECTOR vResult = { + 0.5f*((-fx*fx*fx+2*fx*fx-fx)*Position0.vector4_f32[0]+ + (3*fx*fx*fx-5*fx*fx+2)*Position1.vector4_f32[0]+ + (-3*fx*fx*fx+4*fx*fx+fx)*Position2.vector4_f32[0]+ + (fx*fx*fx-fx*fx)*Position3.vector4_f32[0]), + 0.5f*((-fy*fy*fy+2*fy*fy-fy)*Position0.vector4_f32[1]+ + (3*fy*fy*fy-5*fy*fy+2)*Position1.vector4_f32[1]+ + (-3*fy*fy*fy+4*fy*fy+fy)*Position2.vector4_f32[1]+ + (fy*fy*fy-fy*fy)*Position3.vector4_f32[1]), + 0.5f*((-fz*fz*fz+2*fz*fz-fz)*Position0.vector4_f32[2]+ + (3*fz*fz*fz-5*fz*fz+2)*Position1.vector4_f32[2]+ + (-3*fz*fz*fz+4*fz*fz+fz)*Position2.vector4_f32[2]+ + (fz*fz*fz-fz*fz)*Position3.vector4_f32[2]), + 0.5f*((-fw*fw*fw+2*fw*fw-fw)*Position0.vector4_f32[3]+ + (3*fw*fw*fw-5*fw*fw+2)*Position1.vector4_f32[3]+ + (-3*fw*fw*fw+4*fw*fw+fw)*Position2.vector4_f32[3]+ + (fw*fw*fw-fw*fw)*Position3.vector4_f32[3]) + }; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Catmul2 = {2.0f,2.0f,2.0f,2.0f}; + static const XMVECTORF32 Catmul3 = {3.0f,3.0f,3.0f,3.0f}; + static const XMVECTORF32 Catmul4 = {4.0f,4.0f,4.0f,4.0f}; + static const XMVECTORF32 Catmul5 = {5.0f,5.0f,5.0f,5.0f}; + // Cache T^2 and T^3 + XMVECTOR T2 = _mm_mul_ps(T,T); + XMVECTOR T3 = _mm_mul_ps(T,T2); + // Perform the Position0 term + XMVECTOR vResult = _mm_add_ps(T2,T2); + vResult = _mm_sub_ps(vResult,T); + vResult = _mm_sub_ps(vResult,T3); + vResult = _mm_mul_ps(vResult,Position0); + // Perform the Position1 term and add + XMVECTOR vTemp = _mm_mul_ps(T3,Catmul3); + XMVECTOR vTemp2 = _mm_mul_ps(T2,Catmul5); + vTemp = _mm_sub_ps(vTemp,vTemp2); + vTemp = _mm_add_ps(vTemp,Catmul2); + vTemp = _mm_mul_ps(vTemp,Position1); + vResult = _mm_add_ps(vResult,vTemp); + // Perform the Position2 term and add + vTemp = _mm_mul_ps(T2,Catmul4); + vTemp2 = _mm_mul_ps(T3,Catmul3); + vTemp = _mm_sub_ps(vTemp,vTemp2); + vTemp = _mm_add_ps(vTemp,T); + vTemp = _mm_mul_ps(vTemp,Position2); + vResult = _mm_add_ps(vResult,vTemp); + // Position3 is the last term + T3 = _mm_sub_ps(T3,T2); + T3 = _mm_mul_ps(T3,Position3); + vResult = _mm_add_ps(vResult,T3); + // Multiply by 0.5f and exit + vResult = _mm_mul_ps(vResult,g_XMOneHalf); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorBaryCentric +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + FLOAT f, + FLOAT g +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0) + XMVECTOR P10; + XMVECTOR P20; + XMVECTOR ScaleF; + XMVECTOR ScaleG; + XMVECTOR Result; + + P10 = XMVectorSubtract(Position1, Position0); + ScaleF = XMVectorReplicate(f); + + P20 = XMVectorSubtract(Position2, Position0); + ScaleG = XMVectorReplicate(g); + + Result = XMVectorMultiplyAdd(P10, ScaleF, Position0); + Result = XMVectorMultiplyAdd(P20, ScaleG, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR R1 = _mm_sub_ps(Position1,Position0); + XMVECTOR SF = _mm_set_ps1(f); + XMVECTOR R2 = _mm_sub_ps(Position2,Position0); + XMVECTOR SG = _mm_set_ps1(g); + R1 = _mm_mul_ps(R1,SF); + R2 = _mm_mul_ps(R2,SG); + R1 = _mm_add_ps(R1,Position0); + R1 = _mm_add_ps(R1,R2); + return R1; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorBaryCentricV +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + CXMVECTOR F, + CXMVECTOR G +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0) + XMVECTOR P10; + XMVECTOR P20; + XMVECTOR Result; + + P10 = XMVectorSubtract(Position1, Position0); + P20 = XMVectorSubtract(Position2, Position0); + + Result = XMVectorMultiplyAdd(P10, F, Position0); + Result = XMVectorMultiplyAdd(P20, G, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR R1 = _mm_sub_ps(Position1,Position0); + XMVECTOR R2 = _mm_sub_ps(Position2,Position0); + R1 = _mm_mul_ps(R1,F); + R2 = _mm_mul_ps(R2,G); + R1 = _mm_add_ps(R1,Position0); + R1 = _mm_add_ps(R1,R2); + return R1; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * 2D Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); +// z and w are don't care + return (((_mm_movemask_ps(vTemp)&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2EqualR(V1, V2)); +#endif +} + + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector2EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); +// z and w are don't care + int iTest = _mm_movemask_ps(vTemp)&3; + UINT CR = 0; + if (iTest==3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return (((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector2EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + if ((V1.vector4_u32[0] == V2.vector4_u32[0]) && + (V1.vector4_u32[1] == V2.vector4_u32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) && + (V1.vector4_u32[1] != V2.vector4_u32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + int iTest = _mm_movemask_ps(reinterpret_cast(&vTemp)[0])&3; + UINT CR = 0; + if (iTest==3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT dx, dy; + dx = fabsf(V1.vector4_f32[0]-V2.vector4_f32[0]); + dy = fabsf(V1.vector4_f32[1]-V2.vector4_f32[1]); + return ((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1])); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1,V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp,vDelta); + vTemp = _mm_max_ps(vTemp,vDelta); + vTemp = _mm_cmple_ps(vTemp,Epsilon); + // z and w are don't care + return (((_mm_movemask_ps(vTemp)&3)==0x3) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); +// z and w are don't care + return (((_mm_movemask_ps(vTemp)&3)!=3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAnyFalse(XMVector2EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return (((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])&3)!=3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAnyFalse(XMVector2EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1])) != 0); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); +// z and w are don't care + return (((_mm_movemask_ps(vTemp)&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2GreaterR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector2GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + if ((V1.vector4_f32[0] > V2.vector4_f32[0]) && + (V1.vector4_f32[1] > V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) && + (V1.vector4_f32[1] <= V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp)&3; + UINT CR = 0; + if (iTest==3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2GreaterOrEqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector2GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp)&3; + UINT CR = 0; + if (iTest == 3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2GreaterR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2GreaterOrEqualR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ + #if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1])) != 0); + #elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // x and y in bounds? (z and w are don't care) + return (((_mm_movemask_ps(vTemp1)&0x3)==0x3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllInBounds(XMVector2InBoundsR(V, Bounds)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector2InBoundsR +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1])) + { + CR = XM_CRMASK_CR6BOUNDS; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // x and y in bounds? (z and w are don't care) + return ((_mm_movemask_ps(vTemp1)&0x3)==0x3) ? XM_CRMASK_CR6BOUNDS : 0; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2IsNaN +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1])); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the exponent + __m128i vTempInf = _mm_and_si128(reinterpret_cast(&V)[0],g_XMInfinity); + // Mask off the mantissa + __m128i vTempNan = _mm_and_si128(reinterpret_cast(&V)[0],g_XMQNaNTest); + // Are any of the exponents == 0x7F800000? + vTempInf = _mm_cmpeq_epi32(vTempInf,g_XMInfinity); + // Are any of the mantissa's zero? (SSE2 doesn't have a neq test) + vTempNan = _mm_cmpeq_epi32(vTempNan,g_XMZero); + // Perform a not on the NaN test to be true on NON-zero mantissas + vTempNan = _mm_andnot_si128(vTempNan,vTempInf); + // If x or y are NaN, the signs are true after the merge above + return ((_mm_movemask_ps(reinterpret_cast(&vTempNan)[0])&3) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2IsInfinite +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1])); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V,g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp,g_XMInfinity); + // If x or z are infinity, the signs are true. + return ((_mm_movemask_ps(vTemp)&3) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = + Result.vector4_f32[1] = + Result.vector4_f32[2] = + Result.vector4_f32[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V1,V2); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Cross +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fCross = (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]); + XMVECTOR vResult = { + fCross, + fCross, + fCross, + fCross + }; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Swap x and y + XMVECTOR vResult = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(0,1,0,1)); + // Perform the muls + vResult = _mm_mul_ps(vResult,V1); + // Splat y + XMVECTOR vTemp = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(1,1,1,1)); + // Sub the values + vResult = _mm_sub_ss(vResult,vTemp); + // Splat the cross product + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,0,0,0)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2LengthSq +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + return XMVector2Dot(V, V); +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + return vLengthSq; +#else + return XMVector2Dot(V, V); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2ReciprocalLengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector2LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_rsqrt_ss(vLengthSq); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2ReciprocalLength +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector2LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_sqrt_ss(vLengthSq); + vLengthSq = _mm_div_ss(g_XMOne,vLengthSq); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2LengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorSqrtEst(Result); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_sqrt_ss(vLengthSq); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Length +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorSqrt(Result); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// XMVector2NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +XMFINLINE XMVECTOR XMVector2NormalizeEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_rsqrt_ss(vLengthSq); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + vLengthSq = _mm_mul_ps(vLengthSq,V); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Normalize +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fLength; + XMVECTOR vResult; + + vResult = XMVector2Length( V ); + fLength = vResult.vector4_f32[0]; + + // Prevent divide by zero + if (fLength > 0) { + fLength = 1.0f/fLength; + } + + vResult.vector4_f32[0] = V.vector4_f32[0]*fLength; + vResult.vector4_f32[1] = V.vector4_f32[1]*fLength; + vResult.vector4_f32[2] = V.vector4_f32[2]*fLength; + vResult.vector4_f32[3] = V.vector4_f32[3]*fLength; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y only + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask,vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq,g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(V,vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult,vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq,g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult,vLengthSq); + vResult = _mm_or_ps(vTemp1,vTemp2); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2ClampLength +( + FXMVECTOR V, + FLOAT LengthMin, + FLOAT LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampMax; + XMVECTOR ClampMin; + + ClampMax = XMVectorReplicate(LengthMax); + ClampMin = XMVectorReplicate(LengthMin); + + return XMVector2ClampLengthV(V, ClampMin, ClampMax); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampMax = _mm_set_ps1(LengthMax); + XMVECTOR ClampMin = _mm_set_ps1(LengthMin); + return XMVector2ClampLengthV(V, ClampMin, ClampMax); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR Zero; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((LengthMin.vector4_f32[1] == LengthMin.vector4_f32[0])); + XMASSERT((LengthMax.vector4_f32[1] == LengthMax.vector4_f32[0])); + XMASSERT(XMVector2GreaterOrEqual(LengthMin, XMVectorZero())); + XMASSERT(XMVector2GreaterOrEqual(LengthMax, XMVectorZero())); + XMASSERT(XMVector2GreaterOrEqual(LengthMax, LengthMin)); + + LengthSq = XMVector2LengthSq(V); + + Zero = XMVectorZero(); + + RcpLength = XMVectorReciprocalSqrt(LengthSq); + + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + ZeroLength = XMVectorEqual(LengthSq, Zero); + + Length = XMVectorMultiply(LengthSq, RcpLength); + + Normal = XMVectorMultiply(V, RcpLength); + + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin))); + XMASSERT((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax))); + XMASSERT(XMVector2GreaterOrEqual(LengthMin, g_XMZero)); + XMASSERT(XMVector2GreaterOrEqual(LengthMax, g_XMZero)); + XMASSERT(XMVector2GreaterOrEqual(LengthMax, LengthMin)); + LengthSq = XMVector2LengthSq(V); + RcpLength = XMVectorReciprocalSqrt(LengthSq); + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity); + ZeroLength = XMVectorEqual(LengthSq, g_XMZero); + Length = _mm_mul_ps(LengthSq, RcpLength); + Normal = _mm_mul_ps(V, RcpLength); + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + Result = _mm_mul_ps(Normal, ClampLength); + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + Result = XMVector2Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + XMVECTOR Result = XMVector2Dot(Incident,Normal); + Result = _mm_add_ps(Result, Result); + Result = _mm_mul_ps(Result, Normal); + Result = _mm_sub_ps(Incident,Result); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FLOAT RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Index; + Index = XMVectorReplicate(RefractionIndex); + return XMVector2RefractV(Incident, Normal, Index); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Index = _mm_set_ps1(RefractionIndex); + return XMVector2RefractV(Incident,Normal,Index); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Return the refraction of a 2D vector +XMFINLINE XMVECTOR XMVector2RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + float IDotN; + float RX,RY; + XMVECTOR vResult; + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + IDotN = (Incident.vector4_f32[0]*Normal.vector4_f32[0])+(Incident.vector4_f32[1]*Normal.vector4_f32[1]); + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + RY = 1.0f-(IDotN*IDotN); + RX = 1.0f-(RY*RefractionIndex.vector4_f32[0]*RefractionIndex.vector4_f32[0]); + RY = 1.0f-(RY*RefractionIndex.vector4_f32[1]*RefractionIndex.vector4_f32[1]); + if (RX>=0.0f) { + RX = (RefractionIndex.vector4_f32[0]*Incident.vector4_f32[0])-(Normal.vector4_f32[0]*((RefractionIndex.vector4_f32[0]*IDotN)+sqrtf(RX))); + } else { + RX = 0.0f; + } + if (RY>=0.0f) { + RY = (RefractionIndex.vector4_f32[1]*Incident.vector4_f32[1])-(Normal.vector4_f32[1]*((RefractionIndex.vector4_f32[1]*IDotN)+sqrtf(RY))); + } else { + RY = 0.0f; + } + vResult.vector4_f32[0] = RX; + vResult.vector4_f32[1] = RY; + vResult.vector4_f32[2] = 0.0f; + vResult.vector4_f32[3] = 0.0f; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + // Get the 2D Dot product of Incident-Normal + XMVECTOR IDotN = _mm_mul_ps(Incident,Normal); + XMVECTOR vTemp = _mm_shuffle_ps(IDotN,IDotN,_MM_SHUFFLE(1,1,1,1)); + IDotN = _mm_add_ss(IDotN,vTemp); + IDotN = _mm_shuffle_ps(IDotN,IDotN,_MM_SHUFFLE(0,0,0,0)); + // vTemp = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + vTemp = _mm_mul_ps(IDotN,IDotN); + vTemp = _mm_sub_ps(g_XMOne,vTemp); + vTemp = _mm_mul_ps(vTemp,RefractionIndex); + vTemp = _mm_mul_ps(vTemp,RefractionIndex); + vTemp = _mm_sub_ps(g_XMOne,vTemp); + // If any terms are <=0, sqrt() will fail, punt to zero + XMVECTOR vMask = _mm_cmpgt_ps(vTemp,g_XMZero); + // R = RefractionIndex * IDotN + sqrt(R) + vTemp = _mm_sqrt_ps(vTemp); + XMVECTOR vResult = _mm_mul_ps(RefractionIndex,IDotN); + vTemp = _mm_add_ps(vTemp,vResult); + // Result = RefractionIndex * Incident - Normal * R + vResult = _mm_mul_ps(RefractionIndex,Incident); + vTemp = _mm_mul_ps(vTemp,Normal); + vResult = _mm_sub_ps(vResult,vTemp); + vResult = _mm_and_ps(vResult,vMask); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Orthogonal +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = -V.vector4_f32[1]; + Result.vector4_f32[1] = V.vector4_f32[0]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1)); + vResult = _mm_mul_ps(vResult,g_XMNegateX); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + Result = XMVector2Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACosEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector2Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne);; + vResult = XMVectorACosEst(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + Result = XMVector2Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACos(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector2Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne);; + vResult = XMVectorACos(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + L1 = XMVector2ReciprocalLength(V1); + L2 = XMVector2ReciprocalLength(V2); + + Dot = XMVector2Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + CosAngle = XMVectorMultiply(Dot, L1); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + CosAngle = XMVectorClamp(CosAngle, NegativeOne, One); + + Result = XMVectorACos(CosAngle); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR Result; + L1 = XMVector2ReciprocalLength(V1); + L2 = XMVector2ReciprocalLength(V2); + Dot = XMVector2Dot(V1, V2); + L1 = _mm_mul_ps(L1, L2); + CosAngle = _mm_mul_ps(Dot, L1); + CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne,g_XMOne); + Result = XMVectorACos(CosAngle); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2LinePointDistance +( + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2, + FXMVECTOR Point +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR PointVector; + XMVECTOR LineVector; + XMVECTOR ReciprocalLengthSq; + XMVECTOR PointProjectionScale; + XMVECTOR DistanceVector; + XMVECTOR Result; + + // Given a vector PointVector from LinePoint1 to Point and a vector + // LineVector from LinePoint1 to LinePoint2, the scaled distance + // PointProjectionScale from LinePoint1 to the perpendicular projection + // of PointVector onto the line is defined as: + // + // PointProjectionScale = dot(PointVector, LineVector) / LengthSq(LineVector) + + PointVector = XMVectorSubtract(Point, LinePoint1); + LineVector = XMVectorSubtract(LinePoint2, LinePoint1); + + ReciprocalLengthSq = XMVector2LengthSq(LineVector); + ReciprocalLengthSq = XMVectorReciprocal(ReciprocalLengthSq); + + PointProjectionScale = XMVector2Dot(PointVector, LineVector); + PointProjectionScale = XMVectorMultiply(PointProjectionScale, ReciprocalLengthSq); + + DistanceVector = XMVectorMultiply(LineVector, PointProjectionScale); + DistanceVector = XMVectorSubtract(PointVector, DistanceVector); + + Result = XMVector2Length(DistanceVector); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR PointVector = _mm_sub_ps(Point,LinePoint1); + XMVECTOR LineVector = _mm_sub_ps(LinePoint2,LinePoint1); + XMVECTOR ReciprocalLengthSq = XMVector2LengthSq(LineVector); + XMVECTOR vResult = XMVector2Dot(PointVector,LineVector); + vResult = _mm_div_ps(vResult,ReciprocalLengthSq); + vResult = _mm_mul_ps(vResult,LineVector); + vResult = _mm_sub_ps(PointVector,vResult); + vResult = XMVector2Length(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2IntersectLine +( + FXMVECTOR Line1Point1, + FXMVECTOR Line1Point2, + FXMVECTOR Line2Point1, + CXMVECTOR Line2Point2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1; + XMVECTOR V2; + XMVECTOR V3; + XMVECTOR C1; + XMVECTOR C2; + XMVECTOR Result; + CONST XMVECTOR Zero = XMVectorZero(); + + V1 = XMVectorSubtract(Line1Point2, Line1Point1); + V2 = XMVectorSubtract(Line2Point2, Line2Point1); + V3 = XMVectorSubtract(Line1Point1, Line2Point1); + + C1 = XMVector2Cross(V1, V2); + C2 = XMVector2Cross(V2, V3); + + if (XMVector2NearEqual(C1, Zero, g_XMEpsilon.v)) + { + if (XMVector2NearEqual(C2, Zero, g_XMEpsilon.v)) + { + // Coincident + Result = g_XMInfinity.v; + } + else + { + // Parallel + Result = g_XMQNaN.v; + } + } + else + { + // Intersection point = Line1Point1 + V1 * (C2 / C1) + XMVECTOR Scale; + Scale = XMVectorReciprocal(C1); + Scale = XMVectorMultiply(C2, Scale); + Result = XMVectorMultiplyAdd(V1, Scale, Line1Point1); + } + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1 = _mm_sub_ps(Line1Point2, Line1Point1); + XMVECTOR V2 = _mm_sub_ps(Line2Point2, Line2Point1); + XMVECTOR V3 = _mm_sub_ps(Line1Point1, Line2Point1); + // Generate the cross products + XMVECTOR C1 = XMVector2Cross(V1, V2); + XMVECTOR C2 = XMVector2Cross(V2, V3); + // If C1 is not close to epsilon, use the calculated value + XMVECTOR vResultMask = _mm_setzero_ps(); + vResultMask = _mm_sub_ps(vResultMask,C1); + vResultMask = _mm_max_ps(vResultMask,C1); + // 0xFFFFFFFF if the calculated value is to be used + vResultMask = _mm_cmpgt_ps(vResultMask,g_XMEpsilon); + // If C1 is close to epsilon, which fail type is it? INFINITY or NAN? + XMVECTOR vFailMask = _mm_setzero_ps(); + vFailMask = _mm_sub_ps(vFailMask,C2); + vFailMask = _mm_max_ps(vFailMask,C2); + vFailMask = _mm_cmple_ps(vFailMask,g_XMEpsilon); + XMVECTOR vFail = _mm_and_ps(vFailMask,g_XMInfinity); + vFailMask = _mm_andnot_ps(vFailMask,g_XMQNaN); + // vFail is NAN or INF + vFail = _mm_or_ps(vFail,vFailMask); + // Intersection point = Line1Point1 + V1 * (C2 / C1) + XMVECTOR vResult = _mm_div_ps(C2,C1); + vResult = _mm_mul_ps(vResult,V1); + vResult = _mm_add_ps(vResult,Line1Point1); + // Use result, or failure value + vResult = _mm_and_ps(vResult,vResultMask); + vResultMask = _mm_andnot_ps(vResultMask,vFail); + vResult = _mm_or_ps(vResult,vResultMask); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Transform +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Result; + + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + vResult = _mm_add_ps(vResult,M.r[3]); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT4* XMVector2TransformStream +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT2* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat2((XMFLOAT2*)pInputVector); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// Y = XMVectorReplicate(((XMFLOAT2*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT2*)pInputVector)->x); + + Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMStoreFloat4((XMFLOAT4*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + UINT i; + const BYTE* pInputVector = (const BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + vResult = _mm_mul_ps(vResult,M.r[1]); + vResult = _mm_add_ps(vResult,M.r[3]); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + _mm_storeu_ps(reinterpret_cast(pOutputVector),vResult); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT4* XMVector2TransformStreamNC +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT2* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_) + return XMVector2TransformStream( pOutputStream, OutputStride, pInputStream, InputStride, VectorCount, M ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2TransformCoord +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR InverseW; + XMVECTOR Result; + + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + InverseW = XMVectorSplatW(Result); + InverseW = XMVectorReciprocal(InverseW); + + Result = XMVectorMultiply(Result, InverseW); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + vResult = _mm_add_ps(vResult,M.r[3]); + vTemp = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3)); + vResult = _mm_div_ps(vResult,vTemp); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT2* XMVector2TransformCoordStream +( + XMFLOAT2* pOutputStream, + UINT OutputStride, + CONST XMFLOAT2* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR InverseW; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat2((XMFLOAT2*)pInputVector); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// Y = XMVectorReplicate(((XMFLOAT2*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT2*)pInputVector)->x); + + Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + InverseW = XMVectorSplatW(Result); + InverseW = XMVectorReciprocal(InverseW); + + Result = XMVectorMultiply(Result, InverseW); + + XMStoreFloat2((XMFLOAT2*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + UINT i; + const BYTE *pInputVector = (BYTE*)pInputStream; + BYTE *pOutputVector = (BYTE*)pOutputStream; + + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + vResult = _mm_mul_ps(vResult,M.r[1]); + vResult = _mm_add_ps(vResult,M.r[3]); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + X = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3)); + vResult = _mm_div_ps(vResult,X); + _mm_store_sd(reinterpret_cast(pOutputVector),reinterpret_cast<__m128d *>(&vResult)[0]); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2TransformNormal +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Result; + + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiply(Y, M.r[1]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT2* XMVector2TransformNormalStream +( + XMFLOAT2* pOutputStream, + UINT OutputStride, + CONST XMFLOAT2* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat2((XMFLOAT2*)pInputVector); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// Y = XMVectorReplicate(((XMFLOAT2*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT2*)pInputVector)->x); + + Result = XMVectorMultiply(Y, M.r[1]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMStoreFloat2((XMFLOAT2*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + UINT i; + const BYTE*pInputVector = (const BYTE*)pInputStream; + BYTE *pOutputVector = (BYTE*)pOutputStream; + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + vResult = _mm_mul_ps(vResult,M.r[1]); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + _mm_store_sd(reinterpret_cast(pOutputVector),reinterpret_cast(&vResult)[0]); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * 3D Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1]) && (V1.vector4_f32[2] == V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector3EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1]) && + (V1.vector4_f32[2] == V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1]) && + (V1.vector4_f32[2] != V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp)&7; + UINT CR = 0; + if (iTest==7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1]) && (V1.vector4_u32[2] == V2.vector4_u32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return (((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector3EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V1.vector4_u32[0] == V2.vector4_u32[0]) && + (V1.vector4_u32[1] == V2.vector4_u32[1]) && + (V1.vector4_u32[2] == V2.vector4_u32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) && + (V1.vector4_u32[1] != V2.vector4_u32[1]) && + (V1.vector4_u32[2] != V2.vector4_u32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + int iTemp = _mm_movemask_ps(reinterpret_cast(&vTemp)[0])&7; + UINT CR = 0; + if (iTemp==7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTemp) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT dx, dy, dz; + + dx = fabsf(V1.vector4_f32[0]-V2.vector4_f32[0]); + dy = fabsf(V1.vector4_f32[1]-V2.vector4_f32[1]); + dz = fabsf(V1.vector4_f32[2]-V2.vector4_f32[2]); + return (((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1]) && + (dz <= Epsilon.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1,V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp,vDelta); + vTemp = _mm_max_ps(vTemp,vDelta); + vTemp = _mm_cmple_ps(vTemp,Epsilon); + // w is don't care + return (((_mm_movemask_ps(vTemp)&7)==0x7) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1]) || (V1.vector4_f32[2] != V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)!=7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAnyFalse(XMVector3EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1]) || (V1.vector4_u32[2] != V2.vector4_u32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return (((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])&7)!=7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAnyFalse(XMVector3EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1]) && (V1.vector4_f32[2] > V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3GreaterR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector3GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V1.vector4_f32[0] > V2.vector4_f32[0]) && + (V1.vector4_f32[1] > V2.vector4_f32[1]) && + (V1.vector4_f32[2] > V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) && + (V1.vector4_f32[1] <= V2.vector4_f32[1]) && + (V1.vector4_f32[2] <= V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + UINT CR = 0; + int iTest = _mm_movemask_ps(vTemp)&7; + if (iTest==7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1]) && (V1.vector4_f32[2] >= V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3GreaterOrEqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector3GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1]) && + (V1.vector4_f32[2] >= V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1]) && + (V1.vector4_f32[2] < V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + UINT CR = 0; + int iTest = _mm_movemask_ps(vTemp)&7; + if (iTest==7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1]) && (V1.vector4_f32[2] < V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3GreaterR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1]) && (V1.vector4_f32[2] <= V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3GreaterOrEqualR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // x,y and z in bounds? (w is don't care) + return (((_mm_movemask_ps(vTemp1)&0x7)==0x7) != 0); +#else + return XMComparisonAllInBounds(XMVector3InBoundsR(V, Bounds)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector3InBoundsR +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2])) + { + CR = XM_CRMASK_CR6BOUNDS; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // x,y and z in bounds? (w is don't care) + return ((_mm_movemask_ps(vTemp1)&0x7)==0x7) ? XM_CRMASK_CR6BOUNDS : 0; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3IsNaN +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1]) || + XMISNAN(V.vector4_f32[2])); + +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the exponent + __m128i vTempInf = _mm_and_si128(reinterpret_cast(&V)[0],g_XMInfinity); + // Mask off the mantissa + __m128i vTempNan = _mm_and_si128(reinterpret_cast(&V)[0],g_XMQNaNTest); + // Are any of the exponents == 0x7F800000? + vTempInf = _mm_cmpeq_epi32(vTempInf,g_XMInfinity); + // Are any of the mantissa's zero? (SSE2 doesn't have a neq test) + vTempNan = _mm_cmpeq_epi32(vTempNan,g_XMZero); + // Perform a not on the NaN test to be true on NON-zero mantissas + vTempNan = _mm_andnot_si128(vTempNan,vTempInf); + // If x, y or z are NaN, the signs are true after the merge above + return ((_mm_movemask_ps(reinterpret_cast(&vTempNan)[0])&7) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3IsInfinite +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1]) || + XMISINF(V.vector4_f32[2])); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V,g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp,g_XMInfinity); + // If x,y or z are infinity, the signs are true. + return ((_mm_movemask_ps(vTemp)&7) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fValue = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1] + V1.vector4_f32[2] * V2.vector4_f32[2]; + XMVECTOR vResult = { + fValue, + fValue, + fValue, + fValue + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V1,V2); + // x=Dot.vector4_f32[1], y=Dot.vector4_f32[2] + XMVECTOR vTemp = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(2,1,2,1)); + // Result.vector4_f32[0] = x+y + vDot = _mm_add_ss(vDot,vTemp); + // x=Dot.vector4_f32[2] + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // Result.vector4_f32[0] = (x+y)+z + vDot = _mm_add_ss(vDot,vTemp); + // Splat x + return _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(0,0,0,0)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Cross +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = { + (V1.vector4_f32[1] * V2.vector4_f32[2]) - (V1.vector4_f32[2] * V2.vector4_f32[1]), + (V1.vector4_f32[2] * V2.vector4_f32[0]) - (V1.vector4_f32[0] * V2.vector4_f32[2]), + (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]), + 0.0f + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // y1,z1,x1,w1 + XMVECTOR vTemp1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(3,0,2,1)); + // z2,x2,y2,w2 + XMVECTOR vTemp2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(3,1,0,2)); + // Perform the left operation + XMVECTOR vResult = _mm_mul_ps(vTemp1,vTemp2); + // z1,x1,y1,w1 + vTemp1 = _mm_shuffle_ps(vTemp1,vTemp1,_MM_SHUFFLE(3,0,2,1)); + // y2,z2,x2,w2 + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(3,1,0,2)); + // Perform the right operation + vTemp1 = _mm_mul_ps(vTemp1,vTemp2); + // Subract the right from left, and return answer + vResult = _mm_sub_ps(vResult,vTemp1); + // Set w to zero + return _mm_and_ps(vResult,g_XMMask3); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3LengthSq +( + FXMVECTOR V +) +{ + return XMVector3Dot(V, V); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3ReciprocalLengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and y + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,2,1,2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // y,y,y,y + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // Splat the length squared + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Get the reciprocal + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3ReciprocalLength +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V,V); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(2,1,2,1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot,vTemp); + // x=Dot.z + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot,vTemp); + // Splat x + vDot = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(0,0,0,0)); + // Get the reciprocal + vDot = _mm_sqrt_ps(vDot); + // Get the reciprocal + vDot = _mm_div_ps(g_XMOne,vDot); + return vDot; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3LengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorSqrtEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and y + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,2,1,2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // y,y,y,y + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // Splat the length squared + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Length +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorSqrt(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and y + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,2,1,2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // y,y,y,y + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // Splat the length squared + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// XMVector3NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +XMFINLINE XMVECTOR XMVector3NormalizeEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector3ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V,V); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(2,1,2,1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot,vTemp); + // x=Dot.z + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot,vTemp); + // Splat x + vDot = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(0,0,0,0)); + // Get the reciprocal + vDot = _mm_rsqrt_ps(vDot); + // Perform the normalization + vDot = _mm_mul_ps(vDot,V); + return vDot; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Normalize +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fLength; + XMVECTOR vResult; + + vResult = XMVector3Length( V ); + fLength = vResult.vector4_f32[0]; + + // Prevent divide by zero + if (fLength > 0) { + fLength = 1.0f/fLength; + } + + vResult.vector4_f32[0] = V.vector4_f32[0]*fLength; + vResult.vector4_f32[1] = V.vector4_f32[1]*fLength; + vResult.vector4_f32[2] = V.vector4_f32[2]*fLength; + vResult.vector4_f32[3] = V.vector4_f32[3]*fLength; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z only + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,1,2,1)); + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask,vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq,g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V,vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult,vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq,g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult,vLengthSq); + vResult = _mm_or_ps(vTemp1,vTemp2); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3ClampLength +( + FXMVECTOR V, + FLOAT LengthMin, + FLOAT LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampMax; + XMVECTOR ClampMin; + + ClampMax = XMVectorReplicate(LengthMax); + ClampMin = XMVectorReplicate(LengthMin); + + return XMVector3ClampLengthV(V, ClampMin, ClampMax); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampMax = _mm_set_ps1(LengthMax); + XMVECTOR ClampMin = _mm_set_ps1(LengthMin); + return XMVector3ClampLengthV(V,ClampMin,ClampMax); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR Zero; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((LengthMin.vector4_f32[1] == LengthMin.vector4_f32[0]) && (LengthMin.vector4_f32[2] == LengthMin.vector4_f32[0])); + XMASSERT((LengthMax.vector4_f32[1] == LengthMax.vector4_f32[0]) && (LengthMax.vector4_f32[2] == LengthMax.vector4_f32[0])); + XMASSERT(XMVector3GreaterOrEqual(LengthMin, XMVectorZero())); + XMASSERT(XMVector3GreaterOrEqual(LengthMax, XMVectorZero())); + XMASSERT(XMVector3GreaterOrEqual(LengthMax, LengthMin)); + + LengthSq = XMVector3LengthSq(V); + + Zero = XMVectorZero(); + + RcpLength = XMVectorReciprocalSqrt(LengthSq); + + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + ZeroLength = XMVectorEqual(LengthSq, Zero); + + Normal = XMVectorMultiply(V, RcpLength); + + Length = XMVectorMultiply(LengthSq, RcpLength); + + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetZ(LengthMin) == XMVectorGetX(LengthMin))); + XMASSERT((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetZ(LengthMax) == XMVectorGetX(LengthMax))); + XMASSERT(XMVector3GreaterOrEqual(LengthMin, g_XMZero)); + XMASSERT(XMVector3GreaterOrEqual(LengthMax, g_XMZero)); + XMASSERT(XMVector3GreaterOrEqual(LengthMax, LengthMin)); + + LengthSq = XMVector3LengthSq(V); + RcpLength = XMVectorReciprocalSqrt(LengthSq); + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity); + ZeroLength = XMVectorEqual(LengthSq,g_XMZero); + Normal = _mm_mul_ps(V, RcpLength); + Length = _mm_mul_ps(LengthSq, RcpLength); + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + Result = _mm_mul_ps(Normal, ClampLength); + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + Result = XMVector3Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + XMVECTOR Result = XMVector3Dot(Incident, Normal); + Result = _mm_add_ps(Result, Result); + Result = _mm_mul_ps(Result, Normal); + Result = _mm_sub_ps(Incident,Result); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FLOAT RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Index; + Index = XMVectorReplicate(RefractionIndex); + return XMVector3RefractV(Incident, Normal, Index); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Index = _mm_set_ps1(RefractionIndex); + return XMVector3RefractV(Incident,Normal,Index); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR IDotN; + XMVECTOR R; + CONST XMVECTOR Zero = XMVectorZero(); + + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + + IDotN = XMVector3Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + R = XMVectorNegativeMultiplySubtract(IDotN, IDotN, g_XMOne.v); + R = XMVectorMultiply(R, RefractionIndex); + R = XMVectorNegativeMultiplySubtract(R, RefractionIndex, g_XMOne.v); + + if (XMVector4LessOrEqual(R, Zero)) + { + // Total internal reflection + return Zero; + } + else + { + XMVECTOR Result; + + // R = RefractionIndex * IDotN + sqrt(R) + R = XMVectorSqrt(R); + R = XMVectorMultiplyAdd(RefractionIndex, IDotN, R); + + // Result = RefractionIndex * Incident - Normal * R + Result = XMVectorMultiply(RefractionIndex, Incident); + Result = XMVectorNegativeMultiplySubtract(Normal, R, Result); + + return Result; + } + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + XMVECTOR IDotN = XMVector3Dot(Incident, Normal); + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR R = _mm_mul_ps(IDotN, IDotN); + R = _mm_sub_ps(g_XMOne,R); + R = _mm_mul_ps(R, RefractionIndex); + R = _mm_mul_ps(R, RefractionIndex); + R = _mm_sub_ps(g_XMOne,R); + + XMVECTOR vResult = _mm_cmple_ps(R,g_XMZero); + if (_mm_movemask_ps(vResult)==0x0f) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // R = RefractionIndex * IDotN + sqrt(R) + R = _mm_sqrt_ps(R); + vResult = _mm_mul_ps(RefractionIndex,IDotN); + R = _mm_add_ps(R,vResult); + // Result = RefractionIndex * Incident - Normal * R + vResult = _mm_mul_ps(RefractionIndex, Incident); + R = _mm_mul_ps(R,Normal); + vResult = _mm_sub_ps(vResult,R); + } + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Orthogonal +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeV; + XMVECTOR Z, YZYY; + XMVECTOR ZIsNegative, YZYYIsNegative; + XMVECTOR S, D; + XMVECTOR R0, R1; + XMVECTOR Select; + XMVECTOR Zero; + XMVECTOR Result; + static CONST XMVECTORU32 Permute1X0X0X0X = {XM_PERMUTE_1X, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute0Y0Z0Y0Y= {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + + Zero = XMVectorZero(); + Z = XMVectorSplatZ(V); + YZYY = XMVectorPermute(V, V, Permute0Y0Z0Y0Y.v); + + NegativeV = XMVectorSubtract(Zero, V); + + ZIsNegative = XMVectorLess(Z, Zero); + YZYYIsNegative = XMVectorLess(YZYY, Zero); + + S = XMVectorAdd(YZYY, Z); + D = XMVectorSubtract(YZYY, Z); + + Select = XMVectorEqualInt(ZIsNegative, YZYYIsNegative); + + R0 = XMVectorPermute(NegativeV, S, Permute1X0X0X0X.v); + R1 = XMVectorPermute(V, D, Permute1X0X0X0X.v); + + Result = XMVectorSelect(R1, R0, Select); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR NegativeV; + XMVECTOR Z, YZYY; + XMVECTOR ZIsNegative, YZYYIsNegative; + XMVECTOR S, D; + XMVECTOR R0, R1; + XMVECTOR Select; + XMVECTOR Zero; + XMVECTOR Result; + static CONST XMVECTORI32 Permute1X0X0X0X = {XM_PERMUTE_1X, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X}; + static CONST XMVECTORI32 Permute0Y0Z0Y0Y= {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + + Zero = XMVectorZero(); + Z = XMVectorSplatZ(V); + YZYY = XMVectorPermute(V, V, Permute0Y0Z0Y0Y); + + NegativeV = _mm_sub_ps(Zero, V); + + ZIsNegative = XMVectorLess(Z, Zero); + YZYYIsNegative = XMVectorLess(YZYY, Zero); + + S = _mm_add_ps(YZYY, Z); + D = _mm_sub_ps(YZYY, Z); + + Select = XMVectorEqualInt(ZIsNegative, YZYYIsNegative); + + R0 = XMVectorPermute(NegativeV, S, Permute1X0X0X0X); + R1 = XMVectorPermute(V, D,Permute1X0X0X0X); + Result = XMVectorSelect(R1, R0, Select); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + XMVECTOR NegativeOne; + XMVECTOR One; + + Result = XMVector3Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACosEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector3Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = XMVectorACosEst(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + XMVECTOR NegativeOne; + XMVECTOR One; + + Result = XMVector3Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACos(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector3Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = XMVectorACos(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + L1 = XMVector3ReciprocalLength(V1); + L2 = XMVector3ReciprocalLength(V2); + + Dot = XMVector3Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + + CosAngle = XMVectorMultiply(Dot, L1); + + CosAngle = XMVectorClamp(CosAngle, NegativeOne, One); + + Result = XMVectorACos(CosAngle); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR Result; + + L1 = XMVector3ReciprocalLength(V1); + L2 = XMVector3ReciprocalLength(V2); + Dot = XMVector3Dot(V1, V2); + L1 = _mm_mul_ps(L1, L2); + CosAngle = _mm_mul_ps(Dot, L1); + CosAngle = XMVectorClamp(CosAngle,g_XMNegativeOne,g_XMOne); + Result = XMVectorACos(CosAngle); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3LinePointDistance +( + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2, + FXMVECTOR Point +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR PointVector; + XMVECTOR LineVector; + XMVECTOR ReciprocalLengthSq; + XMVECTOR PointProjectionScale; + XMVECTOR DistanceVector; + XMVECTOR Result; + + // Given a vector PointVector from LinePoint1 to Point and a vector + // LineVector from LinePoint1 to LinePoint2, the scaled distance + // PointProjectionScale from LinePoint1 to the perpendicular projection + // of PointVector onto the line is defined as: + // + // PointProjectionScale = dot(PointVector, LineVector) / LengthSq(LineVector) + + PointVector = XMVectorSubtract(Point, LinePoint1); + LineVector = XMVectorSubtract(LinePoint2, LinePoint1); + + ReciprocalLengthSq = XMVector3LengthSq(LineVector); + ReciprocalLengthSq = XMVectorReciprocal(ReciprocalLengthSq); + + PointProjectionScale = XMVector3Dot(PointVector, LineVector); + PointProjectionScale = XMVectorMultiply(PointProjectionScale, ReciprocalLengthSq); + + DistanceVector = XMVectorMultiply(LineVector, PointProjectionScale); + DistanceVector = XMVectorSubtract(PointVector, DistanceVector); + + Result = XMVector3Length(DistanceVector); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR PointVector = _mm_sub_ps(Point,LinePoint1); + XMVECTOR LineVector = _mm_sub_ps(LinePoint2,LinePoint1); + XMVECTOR ReciprocalLengthSq = XMVector3LengthSq(LineVector); + XMVECTOR vResult = XMVector3Dot(PointVector,LineVector); + vResult = _mm_div_ps(vResult,ReciprocalLengthSq); + vResult = _mm_mul_ps(vResult,LineVector); + vResult = _mm_sub_ps(PointVector,vResult); + vResult = XMVector3Length(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMVector3ComponentsFromNormal +( + XMVECTOR* pParallel, + XMVECTOR* pPerpendicular, + FXMVECTOR V, + FXMVECTOR Normal +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Parallel; + XMVECTOR Scale; + + XMASSERT(pParallel); + XMASSERT(pPerpendicular); + + Scale = XMVector3Dot(V, Normal); + + Parallel = XMVectorMultiply(Normal, Scale); + + *pParallel = Parallel; + *pPerpendicular = XMVectorSubtract(V, Parallel); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pParallel); + XMASSERT(pPerpendicular); + XMVECTOR Scale = XMVector3Dot(V, Normal); + XMVECTOR Parallel = _mm_mul_ps(Normal,Scale); + *pParallel = Parallel; + *pPerpendicular = _mm_sub_ps(V,Parallel); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Transform a vector using a rotation expressed as a unit quaternion + +XMFINLINE XMVECTOR XMVector3Rotate +( + FXMVECTOR V, + FXMVECTOR RotationQuaternion +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR A; + XMVECTOR Q; + XMVECTOR Result; + + A = XMVectorSelect(g_XMSelect1110.v, V, g_XMSelect1110.v); + Q = XMQuaternionConjugate(RotationQuaternion); + Result = XMQuaternionMultiply(Q, A); + Result = XMQuaternionMultiply(Result, RotationQuaternion); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR A; + XMVECTOR Q; + XMVECTOR Result; + + A = _mm_and_ps(V,g_XMMask3); + Q = XMQuaternionConjugate(RotationQuaternion); + Result = XMQuaternionMultiply(Q, A); + Result = XMQuaternionMultiply(Result, RotationQuaternion); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Transform a vector using the inverse of a rotation expressed as a unit quaternion + +XMFINLINE XMVECTOR XMVector3InverseRotate +( + FXMVECTOR V, + FXMVECTOR RotationQuaternion +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR A; + XMVECTOR Q; + XMVECTOR Result; + + A = XMVectorSelect(g_XMSelect1110.v, V, g_XMSelect1110.v); + Result = XMQuaternionMultiply(RotationQuaternion, A); + Q = XMQuaternionConjugate(RotationQuaternion); + Result = XMQuaternionMultiply(Result, Q); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR A; + XMVECTOR Q; + XMVECTOR Result; + A = _mm_and_ps(V,g_XMMask3); + Result = XMQuaternionMultiply(RotationQuaternion, A); + Q = XMQuaternionConjugate(RotationQuaternion); + Result = XMQuaternionMultiply(Result, Q); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Transform +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR Result; + + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + vTemp = _mm_mul_ps(vTemp,M.r[2]); + vResult = _mm_add_ps(vResult,vTemp); + vResult = _mm_add_ps(vResult,M.r[3]); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT4* XMVector3TransformStream +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMStoreFloat4((XMFLOAT4*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + UINT i; + const BYTE* pInputVector = (const BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR Y = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->z); + vResult = _mm_mul_ps(vResult,M.r[2]); + vResult = _mm_add_ps(vResult,M.r[3]); + Y = _mm_mul_ps(Y,M.r[1]); + vResult = _mm_add_ps(vResult,Y); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + _mm_storeu_ps(reinterpret_cast(pOutputVector),vResult); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT4* XMVector3TransformStreamNC +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_) + return XMVector3TransformStream( pOutputStream, OutputStride, pInputStream, InputStride, VectorCount, M ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3TransformCoord +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR InverseW; + XMVECTOR Result; + + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + InverseW = XMVectorSplatW(Result); + InverseW = XMVectorReciprocal(InverseW); + + Result = XMVectorMultiply(Result, InverseW); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + vTemp = _mm_mul_ps(vTemp,M.r[2]); + vResult = _mm_add_ps(vResult,vTemp); + vResult = _mm_add_ps(vResult,M.r[3]); + vTemp = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3)); + vResult = _mm_div_ps(vResult,vTemp); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT3* XMVector3TransformCoordStream +( + XMFLOAT3* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR InverseW; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// Z = XMVectorReplicate(((XMFLOAT3*)pInputVector)->z); +// Y = XMVectorReplicate(((XMFLOAT3*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT3*)pInputVector)->x); + + Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + InverseW = XMVectorSplatW(Result); + InverseW = XMVectorReciprocal(InverseW); + + Result = XMVectorMultiply(Result, InverseW); + + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + UINT i; + const BYTE *pInputVector = (BYTE*)pInputStream; + BYTE *pOutputVector = (BYTE*)pOutputStream; + + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR Y = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->z); + vResult = _mm_mul_ps(vResult,M.r[2]); + vResult = _mm_add_ps(vResult,M.r[3]); + Y = _mm_mul_ps(Y,M.r[1]); + vResult = _mm_add_ps(vResult,Y); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + + X = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3)); + vResult = _mm_div_ps(vResult,X); + _mm_store_ss(&reinterpret_cast(pOutputVector)->x,vResult); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + _mm_store_ss(&reinterpret_cast(pOutputVector)->y,vResult); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + _mm_store_ss(&reinterpret_cast(pOutputVector)->z,vResult); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3TransformNormal +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR Result; + + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiply(Z, M.r[2]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + vTemp = _mm_mul_ps(vTemp,M.r[2]); + vResult = _mm_add_ps(vResult,vTemp); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT3* XMVector3TransformNormalStream +( + XMFLOAT3* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// Z = XMVectorReplicate(((XMFLOAT3*)pInputVector)->z); +// Y = XMVectorReplicate(((XMFLOAT3*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT3*)pInputVector)->x); + + Result = XMVectorMultiply(Z, M.r[2]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + UINT i; + const BYTE *pInputVector = (BYTE*)pInputStream; + BYTE *pOutputVector = (BYTE*)pOutputStream; + + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR Y = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->z); + vResult = _mm_mul_ps(vResult,M.r[2]); + Y = _mm_mul_ps(Y,M.r[1]); + vResult = _mm_add_ps(vResult,Y); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + _mm_store_ss(&reinterpret_cast(pOutputVector)->x,vResult); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + _mm_store_ss(&reinterpret_cast(pOutputVector)->y,vResult); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + _mm_store_ss(&reinterpret_cast(pOutputVector)->z,vResult); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVector3Project +( + FXMVECTOR V, + FLOAT ViewportX, + FLOAT ViewportY, + FLOAT ViewportWidth, + FLOAT ViewportHeight, + FLOAT ViewportMinZ, + FLOAT ViewportMaxZ, + CXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Result; + FLOAT HalfViewportWidth = ViewportWidth * 0.5f; + FLOAT HalfViewportHeight = ViewportHeight * 0.5f; + + Scale = XMVectorSet(HalfViewportWidth, + -HalfViewportHeight, + ViewportMaxZ - ViewportMinZ, + 0.0f); + + Offset = XMVectorSet(ViewportX + HalfViewportWidth, + ViewportY + HalfViewportHeight, + ViewportMinZ, + 0.0f); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + Result = XMVector3TransformCoord(V, Transform); + + Result = XMVectorMultiplyAdd(Result, Scale, Offset); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Result; + FLOAT HalfViewportWidth = ViewportWidth * 0.5f; + FLOAT HalfViewportHeight = ViewportHeight * 0.5f; + + Scale = XMVectorSet(HalfViewportWidth, + -HalfViewportHeight, + ViewportMaxZ - ViewportMinZ, + 0.0f); + + Offset = XMVectorSet(ViewportX + HalfViewportWidth, + ViewportY + HalfViewportHeight, + ViewportMinZ, + 0.0f); + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Result = XMVector3TransformCoord(V, Transform); + Result = _mm_mul_ps(Result,Scale); + Result = _mm_add_ps(Result,Offset); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT3* XMVector3ProjectStream +( + XMFLOAT3* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + FLOAT ViewportX, + FLOAT ViewportY, + FLOAT ViewportWidth, + FLOAT ViewportHeight, + FLOAT ViewportMinZ, + FLOAT ViewportMaxZ, + CXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX Transform; + XMVECTOR V; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Result; + UINT i; + FLOAT HalfViewportWidth = ViewportWidth * 0.5f; + FLOAT HalfViewportHeight = ViewportHeight * 0.5f; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + Scale = XMVectorSet(HalfViewportWidth, + -HalfViewportHeight, + ViewportMaxZ - ViewportMinZ, + 1.0f); + + Offset = XMVectorSet(ViewportX + HalfViewportWidth, + ViewportY + HalfViewportHeight, + ViewportMinZ, + 0.0f); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + + Result = XMVector3TransformCoord(V, Transform); + + Result = XMVectorMultiplyAdd(Result, Scale, Offset); + + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + XMMATRIX Transform; + XMVECTOR V; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Result; + UINT i; + FLOAT HalfViewportWidth = ViewportWidth * 0.5f; + FLOAT HalfViewportHeight = ViewportHeight * 0.5f; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + Scale = XMVectorSet(HalfViewportWidth, + -HalfViewportHeight, + ViewportMaxZ - ViewportMinZ, + 1.0f); + + Offset = XMVectorSet(ViewportX + HalfViewportWidth, + ViewportY + HalfViewportHeight, + ViewportMinZ, + 0.0f); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + + Result = XMVector3TransformCoord(V, Transform); + + Result = _mm_mul_ps(Result,Scale); + Result = _mm_add_ps(Result,Offset); + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + return pOutputStream; + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Unproject +( + FXMVECTOR V, + FLOAT ViewportX, + FLOAT ViewportY, + FLOAT ViewportWidth, + FLOAT ViewportHeight, + FLOAT ViewportMinZ, + FLOAT ViewportMaxZ, + CXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Determinant; + XMVECTOR Result; + CONST XMVECTOR D = XMVectorSet(-1.0f, 1.0f, 0.0f, 0.0f); + + Scale = XMVectorSet(ViewportWidth * 0.5f, + -ViewportHeight * 0.5f, + ViewportMaxZ - ViewportMinZ, + 1.0f); + Scale = XMVectorReciprocal(Scale); + + Offset = XMVectorSet(-ViewportX, + -ViewportY, + -ViewportMinZ, + 0.0f); + Offset = XMVectorMultiplyAdd(Scale, Offset, D); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(&Determinant, Transform); + + Result = XMVectorMultiplyAdd(V, Scale, Offset); + + Result = XMVector3TransformCoord(Result, Transform); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Determinant; + XMVECTOR Result; + CONST XMVECTORF32 D = {-1.0f, 1.0f, 0.0f, 0.0f}; + + Scale = XMVectorSet(ViewportWidth * 0.5f, + -ViewportHeight * 0.5f, + ViewportMaxZ - ViewportMinZ, + 1.0f); + Scale = XMVectorReciprocal(Scale); + + Offset = XMVectorSet(-ViewportX, + -ViewportY, + -ViewportMinZ, + 0.0f); + Offset = _mm_mul_ps(Offset,Scale); + Offset = _mm_add_ps(Offset,D); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(&Determinant, Transform); + + Result = _mm_mul_ps(V,Scale); + Result = _mm_add_ps(Result,Offset); + + Result = XMVector3TransformCoord(Result, Transform); + + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT3* XMVector3UnprojectStream +( + XMFLOAT3* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + FLOAT ViewportX, + FLOAT ViewportY, + FLOAT ViewportWidth, + FLOAT ViewportHeight, + FLOAT ViewportMinZ, + FLOAT ViewportMaxZ, + CXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR V; + XMVECTOR Determinant; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + CONST XMVECTOR D = XMVectorSet(-1.0f, 1.0f, 0.0f, 0.0f); + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + Scale = XMVectorSet(ViewportWidth * 0.5f, + -ViewportHeight * 0.5f, + ViewportMaxZ - ViewportMinZ, + 1.0f); + Scale = XMVectorReciprocal(Scale); + + Offset = XMVectorSet(-ViewportX, + -ViewportY, + -ViewportMinZ, + 0.0f); + Offset = XMVectorMultiplyAdd(Scale, Offset, D); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(&Determinant, Transform); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + + Result = XMVectorMultiplyAdd(V, Scale, Offset); + + Result = XMVector3TransformCoord(Result, Transform); + + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR V; + XMVECTOR Determinant; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + CONST XMVECTORF32 D = {-1.0f, 1.0f, 0.0f, 0.0f}; + + Scale = XMVectorSet(ViewportWidth * 0.5f, + -ViewportHeight * 0.5f, + ViewportMaxZ - ViewportMinZ, + 1.0f); + Scale = XMVectorReciprocal(Scale); + + Offset = XMVectorSet(-ViewportX, + -ViewportY, + -ViewportMinZ, + 0.0f); + Offset = _mm_mul_ps(Offset,Scale); + Offset = _mm_add_ps(Offset,D); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(&Determinant, Transform); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + + Result = XMVectorMultiplyAdd(V, Scale, Offset); + + Result = XMVector3TransformCoord(Result, Transform); + + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * 4D Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1]) && (V1.vector4_f32[2] == V2.vector4_f32[2]) && (V1.vector4_f32[3] == V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)==0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector4EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1]) && + (V1.vector4_f32[2] == V2.vector4_f32[2]) && + (V1.vector4_f32[3] == V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1]) && + (V1.vector4_f32[2] != V2.vector4_f32[2]) && + (V1.vector4_f32[3] != V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp); + UINT CR = 0; + if (iTest==0xf) // All equal? + { + CR = XM_CRMASK_CR6TRUE; + } + else if (iTest==0) // All not equal? + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1]) && (V1.vector4_u32[2] == V2.vector4_u32[2]) && (V1.vector4_u32[3] == V2.vector4_u32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return ((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])==0xf) != 0); +#else + return XMComparisonAllTrue(XMVector4EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector4EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if (V1.vector4_u32[0] == V2.vector4_u32[0] && + V1.vector4_u32[1] == V2.vector4_u32[1] && + V1.vector4_u32[2] == V2.vector4_u32[2] && + V1.vector4_u32[3] == V2.vector4_u32[3]) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (V1.vector4_u32[0] != V2.vector4_u32[0] && + V1.vector4_u32[1] != V2.vector4_u32[1] && + V1.vector4_u32[2] != V2.vector4_u32[2] && + V1.vector4_u32[3] != V2.vector4_u32[3]) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + int iTest = _mm_movemask_ps(reinterpret_cast(&vTemp)[0]); + UINT CR = 0; + if (iTest==0xf) // All equal? + { + CR = XM_CRMASK_CR6TRUE; + } + else if (iTest==0) // All not equal? + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +XMFINLINE BOOL XMVector4NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT dx, dy, dz, dw; + + dx = fabsf(V1.vector4_f32[0]-V2.vector4_f32[0]); + dy = fabsf(V1.vector4_f32[1]-V2.vector4_f32[1]); + dz = fabsf(V1.vector4_f32[2]-V2.vector4_f32[2]); + dw = fabsf(V1.vector4_f32[3]-V2.vector4_f32[3]); + return (((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1]) && + (dz <= Epsilon.vector4_f32[2]) && + (dw <= Epsilon.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1,V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp,vDelta); + vTemp = _mm_max_ps(vTemp,vDelta); + vTemp = _mm_cmple_ps(vTemp,Epsilon); + return ((_mm_movemask_ps(vTemp)==0xf) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1]) || (V1.vector4_f32[2] != V2.vector4_f32[2]) || (V1.vector4_f32[3] != V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpneq_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)) != 0); +#else + return XMComparisonAnyFalse(XMVector4EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1]) || (V1.vector4_u32[2] != V2.vector4_u32[2]) || (V1.vector4_u32[3] != V2.vector4_u32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return ((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])!=0xF) != 0); +#else + return XMComparisonAnyFalse(XMVector4EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1]) && (V1.vector4_f32[2] > V2.vector4_f32[2]) && (V1.vector4_f32[3] > V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)==0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector4GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if (V1.vector4_f32[0] > V2.vector4_f32[0] && + V1.vector4_f32[1] > V2.vector4_f32[1] && + V1.vector4_f32[2] > V2.vector4_f32[2] && + V1.vector4_f32[3] > V2.vector4_f32[3]) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (V1.vector4_f32[0] <= V2.vector4_f32[0] && + V1.vector4_f32[1] <= V2.vector4_f32[1] && + V1.vector4_f32[2] <= V2.vector4_f32[2] && + V1.vector4_f32[3] <= V2.vector4_f32[3]) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + UINT CR = 0; + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp); + if (iTest==0xf) { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1]) && (V1.vector4_f32[2] >= V2.vector4_f32[2]) && (V1.vector4_f32[3] >= V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)==0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterOrEqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector4GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1]) && + (V1.vector4_f32[2] >= V2.vector4_f32[2]) && + (V1.vector4_f32[3] >= V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1]) && + (V1.vector4_f32[2] < V2.vector4_f32[2]) && + (V1.vector4_f32[3] < V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + UINT CR = 0; + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp); + if (iTest==0x0f) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1]) && (V1.vector4_f32[2] < V2.vector4_f32[2]) && (V1.vector4_f32[3] < V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)==0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1]) && (V1.vector4_f32[2] <= V2.vector4_f32[2]) && (V1.vector4_f32[3] <= V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)==0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterOrEqualR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) && + (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // All in bounds? + return ((_mm_movemask_ps(vTemp1)==0x0f) != 0); +#else + return XMComparisonAllInBounds(XMVector4InBoundsR(V, Bounds)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector4InBoundsR +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + if ((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) && + (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3])) + { + CR = XM_CRMASK_CR6BOUNDS; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // All in bounds? + return (_mm_movemask_ps(vTemp1)==0x0f) ? XM_CRMASK_CR6BOUNDS : 0; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4IsNaN +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1]) || + XMISNAN(V.vector4_f32[2]) || + XMISNAN(V.vector4_f32[3])); +#elif defined(_XM_SSE_INTRINSICS_) + // Test against itself. NaN is always not equal + XMVECTOR vTempNan = _mm_cmpneq_ps(V,V); + // If any are NaN, the mask is non-zero + return (_mm_movemask_ps(vTempNan)!=0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4IsInfinite +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1]) || + XMISINF(V.vector4_f32[2]) || + XMISINF(V.vector4_f32[3])); + +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + XMVECTOR vTemp = _mm_and_ps(V,g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp,g_XMInfinity); + // If any are infinity, the signs are true. + return (_mm_movemask_ps(vTemp) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = + Result.vector4_f32[1] = + Result.vector4_f32[2] = + Result.vector4_f32[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1] + V1.vector4_f32[2] * V2.vector4_f32[2] + V1.vector4_f32[3] * V2.vector4_f32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp2 = V2; + XMVECTOR vTemp = _mm_mul_ps(V1,vTemp2); + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position + vTemp2 = _mm_add_ps(vTemp2,vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp,vTemp2,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp,vTemp2); // Add Z and W together + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Cross +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result; + + Result.vector4_f32[0] = (((V2.vector4_f32[2]*V3.vector4_f32[3])-(V2.vector4_f32[3]*V3.vector4_f32[2]))*V1.vector4_f32[1])-(((V2.vector4_f32[1]*V3.vector4_f32[3])-(V2.vector4_f32[3]*V3.vector4_f32[1]))*V1.vector4_f32[2])+(((V2.vector4_f32[1]*V3.vector4_f32[2])-(V2.vector4_f32[2]*V3.vector4_f32[1]))*V1.vector4_f32[3]); + Result.vector4_f32[1] = (((V2.vector4_f32[3]*V3.vector4_f32[2])-(V2.vector4_f32[2]*V3.vector4_f32[3]))*V1.vector4_f32[0])-(((V2.vector4_f32[3]*V3.vector4_f32[0])-(V2.vector4_f32[0]*V3.vector4_f32[3]))*V1.vector4_f32[2])+(((V2.vector4_f32[2]*V3.vector4_f32[0])-(V2.vector4_f32[0]*V3.vector4_f32[2]))*V1.vector4_f32[3]); + Result.vector4_f32[2] = (((V2.vector4_f32[1]*V3.vector4_f32[3])-(V2.vector4_f32[3]*V3.vector4_f32[1]))*V1.vector4_f32[0])-(((V2.vector4_f32[0]*V3.vector4_f32[3])-(V2.vector4_f32[3]*V3.vector4_f32[0]))*V1.vector4_f32[1])+(((V2.vector4_f32[0]*V3.vector4_f32[1])-(V2.vector4_f32[1]*V3.vector4_f32[0]))*V1.vector4_f32[3]); + Result.vector4_f32[3] = (((V2.vector4_f32[2]*V3.vector4_f32[1])-(V2.vector4_f32[1]*V3.vector4_f32[2]))*V1.vector4_f32[0])-(((V2.vector4_f32[2]*V3.vector4_f32[0])-(V2.vector4_f32[0]*V3.vector4_f32[2]))*V1.vector4_f32[1])+(((V2.vector4_f32[1]*V3.vector4_f32[0])-(V2.vector4_f32[0]*V3.vector4_f32[1]))*V1.vector4_f32[2]); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // V2zwyz * V3wzwy + XMVECTOR vResult = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(2,1,3,2)); + XMVECTOR vTemp3 = _mm_shuffle_ps(V3,V3,_MM_SHUFFLE(1,3,2,3)); + vResult = _mm_mul_ps(vResult,vTemp3); + // - V2wzwy * V3zwyz + XMVECTOR vTemp2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(1,3,2,3)); + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp3,_MM_SHUFFLE(1,3,0,1)); + vTemp2 = _mm_mul_ps(vTemp2,vTemp3); + vResult = _mm_sub_ps(vResult,vTemp2); + // term1 * V1yxxx + XMVECTOR vTemp1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(0,0,0,1)); + vResult = _mm_mul_ps(vResult,vTemp1); + + // V2ywxz * V3wxwx + vTemp2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(2,0,3,1)); + vTemp3 = _mm_shuffle_ps(V3,V3,_MM_SHUFFLE(0,3,0,3)); + vTemp3 = _mm_mul_ps(vTemp3,vTemp2); + // - V2wxwx * V3ywxz + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(2,1,2,1)); + vTemp1 = _mm_shuffle_ps(V3,V3,_MM_SHUFFLE(2,0,3,1)); + vTemp2 = _mm_mul_ps(vTemp2,vTemp1); + vTemp3 = _mm_sub_ps(vTemp3,vTemp2); + // vResult - temp * V1zzyy + vTemp1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(1,1,2,2)); + vTemp1 = _mm_mul_ps(vTemp1,vTemp3); + vResult = _mm_sub_ps(vResult,vTemp1); + + // V2yzxy * V3zxyx + vTemp2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(1,0,2,1)); + vTemp3 = _mm_shuffle_ps(V3,V3,_MM_SHUFFLE(0,1,0,2)); + vTemp3 = _mm_mul_ps(vTemp3,vTemp2); + // - V2zxyx * V3yzxy + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(2,0,2,1)); + vTemp1 = _mm_shuffle_ps(V3,V3,_MM_SHUFFLE(1,0,2,1)); + vTemp1 = _mm_mul_ps(vTemp1,vTemp2); + vTemp3 = _mm_sub_ps(vTemp3,vTemp1); + // vResult + term * V1wwwz + vTemp1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(2,3,3,3)); + vTemp3 = _mm_mul_ps(vTemp3,vTemp1); + vResult = _mm_add_ps(vResult,vTemp3); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4LengthSq +( + FXMVECTOR V +) +{ + return XMVector4Dot(V, V); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4ReciprocalLengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Get the reciprocal + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4ReciprocalLength +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Get the reciprocal + vLengthSq = _mm_sqrt_ps(vLengthSq); + // Accurate! + vLengthSq = _mm_div_ps(g_XMOne,vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4LengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorSqrtEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Prepare for the division + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Length +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorSqrt(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Prepare for the division + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// XMVector4NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +XMFINLINE XMVECTOR XMVector4NormalizeEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector4ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Get the reciprocal + XMVECTOR vResult = _mm_rsqrt_ps(vLengthSq); + // Reciprocal mul to perform the normalization + vResult = _mm_mul_ps(vResult,V); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Normalize +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fLength; + XMVECTOR vResult; + + vResult = XMVector4Length( V ); + fLength = vResult.vector4_f32[0]; + + // Prevent divide by zero + if (fLength > 0) { + fLength = 1.0f/fLength; + } + + vResult.vector4_f32[0] = V.vector4_f32[0]*fLength; + vResult.vector4_f32[1] = V.vector4_f32[1]*fLength; + vResult.vector4_f32[2] = V.vector4_f32[2]*fLength; + vResult.vector4_f32[3] = V.vector4_f32[3]*fLength; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Create zero with a single instruction + XMVECTOR vZeroMask = _mm_setzero_ps(); + // Test for a divide by zero (Must be FP to detect -0.0) + vZeroMask = _mm_cmpneq_ps(vZeroMask,vResult); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq,g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V,vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult,vZeroMask); + // Select qnan or result based on infinite length + XMVECTOR vTemp1 = _mm_andnot_ps(vLengthSq,g_XMQNaN); + XMVECTOR vTemp2 = _mm_and_ps(vResult,vLengthSq); + vResult = _mm_or_ps(vTemp1,vTemp2); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4ClampLength +( + FXMVECTOR V, + FLOAT LengthMin, + FLOAT LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampMax; + XMVECTOR ClampMin; + + ClampMax = XMVectorReplicate(LengthMax); + ClampMin = XMVectorReplicate(LengthMin); + + return XMVector4ClampLengthV(V, ClampMin, ClampMax); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampMax = _mm_set_ps1(LengthMax); + XMVECTOR ClampMin = _mm_set_ps1(LengthMin); + return XMVector4ClampLengthV(V, ClampMin, ClampMax); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR Zero; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((LengthMin.vector4_f32[1] == LengthMin.vector4_f32[0]) && (LengthMin.vector4_f32[2] == LengthMin.vector4_f32[0]) && (LengthMin.vector4_f32[3] == LengthMin.vector4_f32[0])); + XMASSERT((LengthMax.vector4_f32[1] == LengthMax.vector4_f32[0]) && (LengthMax.vector4_f32[2] == LengthMax.vector4_f32[0]) && (LengthMax.vector4_f32[3] == LengthMax.vector4_f32[0])); + XMASSERT(XMVector4GreaterOrEqual(LengthMin, XMVectorZero())); + XMASSERT(XMVector4GreaterOrEqual(LengthMax, XMVectorZero())); + XMASSERT(XMVector4GreaterOrEqual(LengthMax, LengthMin)); + + LengthSq = XMVector4LengthSq(V); + + Zero = XMVectorZero(); + + RcpLength = XMVectorReciprocalSqrt(LengthSq); + + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + ZeroLength = XMVectorEqual(LengthSq, Zero); + + Normal = XMVectorMultiply(V, RcpLength); + + Length = XMVectorMultiply(LengthSq, RcpLength); + + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR Zero; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetZ(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetW(LengthMin) == XMVectorGetX(LengthMin))); + XMASSERT((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetZ(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetW(LengthMax) == XMVectorGetX(LengthMax))); + XMASSERT(XMVector4GreaterOrEqual(LengthMin, g_XMZero)); + XMASSERT(XMVector4GreaterOrEqual(LengthMax, g_XMZero)); + XMASSERT(XMVector4GreaterOrEqual(LengthMax, LengthMin)); + + LengthSq = XMVector4LengthSq(V); + Zero = XMVectorZero(); + RcpLength = XMVectorReciprocalSqrt(LengthSq); + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity); + ZeroLength = XMVectorEqual(LengthSq, Zero); + Normal = _mm_mul_ps(V, RcpLength); + Length = _mm_mul_ps(LengthSq, RcpLength); + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + Result = _mm_mul_ps(Normal, ClampLength); + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax,ControlMin); + Result = XMVectorSelect(Result,V,Control); + return Result; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + Result = XMVector4Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + XMVECTOR Result = XMVector4Dot(Incident,Normal); + Result = _mm_add_ps(Result,Result); + Result = _mm_mul_ps(Result,Normal); + Result = _mm_sub_ps(Incident,Result); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FLOAT RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Index; + Index = XMVectorReplicate(RefractionIndex); + return XMVector4RefractV(Incident, Normal, Index); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Index = _mm_set_ps1(RefractionIndex); + return XMVector4RefractV(Incident,Normal,Index); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR IDotN; + XMVECTOR R; + CONST XMVECTOR Zero = XMVectorZero(); + + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + + IDotN = XMVector4Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + R = XMVectorNegativeMultiplySubtract(IDotN, IDotN, g_XMOne.v); + R = XMVectorMultiply(R, RefractionIndex); + R = XMVectorNegativeMultiplySubtract(R, RefractionIndex, g_XMOne.v); + + if (XMVector4LessOrEqual(R, Zero)) + { + // Total internal reflection + return Zero; + } + else + { + XMVECTOR Result; + + // R = RefractionIndex * IDotN + sqrt(R) + R = XMVectorSqrt(R); + R = XMVectorMultiplyAdd(RefractionIndex, IDotN, R); + + // Result = RefractionIndex * Incident - Normal * R + Result = XMVectorMultiply(RefractionIndex, Incident); + Result = XMVectorNegativeMultiplySubtract(Normal, R, Result); + + return Result; + } + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + + XMVECTOR IDotN = XMVector4Dot(Incident,Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR R = _mm_mul_ps(IDotN,IDotN); + R = _mm_sub_ps(g_XMOne,R); + R = _mm_mul_ps(R, RefractionIndex); + R = _mm_mul_ps(R, RefractionIndex); + R = _mm_sub_ps(g_XMOne,R); + + XMVECTOR vResult = _mm_cmple_ps(R,g_XMZero); + if (_mm_movemask_ps(vResult)==0x0f) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // R = RefractionIndex * IDotN + sqrt(R) + R = _mm_sqrt_ps(R); + vResult = _mm_mul_ps(RefractionIndex, IDotN); + R = _mm_add_ps(R,vResult); + // Result = RefractionIndex * Incident - Normal * R + vResult = _mm_mul_ps(RefractionIndex, Incident); + R = _mm_mul_ps(R,Normal); + vResult = _mm_sub_ps(vResult,R); + } + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Orthogonal +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result.vector4_f32[0] = V.vector4_f32[2]; + Result.vector4_f32[1] = V.vector4_f32[3]; + Result.vector4_f32[2] = -V.vector4_f32[0]; + Result.vector4_f32[3] = -V.vector4_f32[1]; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FlipZW = {1.0f,1.0f,-1.0f,-1.0f}; + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,0,3,2)); + vResult = _mm_mul_ps(vResult,FlipZW); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + Result = XMVector4Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACosEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector4Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne);; + vResult = XMVectorACosEst(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + Result = XMVector4Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACos(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector4Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne);; + vResult = XMVectorACos(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + L1 = XMVector4ReciprocalLength(V1); + L2 = XMVector4ReciprocalLength(V2); + + Dot = XMVector4Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + CosAngle = XMVectorMultiply(Dot, L1); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + CosAngle = XMVectorClamp(CosAngle, NegativeOne, One); + + Result = XMVectorACos(CosAngle); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR Result; + + L1 = XMVector4ReciprocalLength(V1); + L2 = XMVector4ReciprocalLength(V2); + Dot = XMVector4Dot(V1, V2); + L1 = _mm_mul_ps(L1,L2); + CosAngle = _mm_mul_ps(Dot,L1); + CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne, g_XMOne); + Result = XMVectorACos(CosAngle); + return Result; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Transform +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fX = (M.m[0][0]*V.vector4_f32[0])+(M.m[1][0]*V.vector4_f32[1])+(M.m[2][0]*V.vector4_f32[2])+(M.m[3][0]*V.vector4_f32[3]); + FLOAT fY = (M.m[0][1]*V.vector4_f32[0])+(M.m[1][1]*V.vector4_f32[1])+(M.m[2][1]*V.vector4_f32[2])+(M.m[3][1]*V.vector4_f32[3]); + FLOAT fZ = (M.m[0][2]*V.vector4_f32[0])+(M.m[1][2]*V.vector4_f32[1])+(M.m[2][2]*V.vector4_f32[2])+(M.m[3][2]*V.vector4_f32[3]); + FLOAT fW = (M.m[0][3]*V.vector4_f32[0])+(M.m[1][3]*V.vector4_f32[1])+(M.m[2][3]*V.vector4_f32[2])+(M.m[3][3]*V.vector4_f32[3]); + XMVECTOR vResult = { + fX, + fY, + fZ, + fW + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // Splat x,y,z and w + XMVECTOR vTempX = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + XMVECTOR vTempY = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR vTempZ = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + XMVECTOR vTempW = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3)); + // Mul by the matrix + vTempX = _mm_mul_ps(vTempX,M.r[0]); + vTempY = _mm_mul_ps(vTempY,M.r[1]); + vTempZ = _mm_mul_ps(vTempZ,M.r[2]); + vTempW = _mm_mul_ps(vTempW,M.r[3]); + // Add them all together + vTempX = _mm_add_ps(vTempX,vTempY); + vTempZ = _mm_add_ps(vTempZ,vTempW); + vTempX = _mm_add_ps(vTempX,vTempZ); + return vTempX; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT4* XMVector4TransformStream +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT4* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR W; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat4((XMFLOAT4*)pInputVector); + W = XMVectorSplatW(V); + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// W = XMVectorReplicate(((XMFLOAT4*)pInputVector)->w); +// Z = XMVectorReplicate(((XMFLOAT4*)pInputVector)->z); +// Y = XMVectorReplicate(((XMFLOAT4*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT4*)pInputVector)->x); + + Result = XMVectorMultiply(W, M.r[3]); + Result = XMVectorMultiplyAdd(Z, M.r[2], Result); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMStoreFloat4((XMFLOAT4*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + UINT i; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + const BYTE*pInputVector = reinterpret_cast(pInputStream); + BYTE* pOutputVector = reinterpret_cast(pOutputStream); + for (i = 0; i < VectorCount; i++) + { + // Fetch the row and splat it + XMVECTOR vTempx = _mm_loadu_ps(reinterpret_cast(pInputVector)); + XMVECTOR vTempy = _mm_shuffle_ps(vTempx,vTempx,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR vTempz = _mm_shuffle_ps(vTempx,vTempx,_MM_SHUFFLE(2,2,2,2)); + XMVECTOR vTempw = _mm_shuffle_ps(vTempx,vTempx,_MM_SHUFFLE(3,3,3,3)); + vTempx = _mm_shuffle_ps(vTempx,vTempx,_MM_SHUFFLE(0,0,0,0)); + vTempx = _mm_mul_ps(vTempx,M.r[0]); + vTempy = _mm_mul_ps(vTempy,M.r[1]); + vTempz = _mm_mul_ps(vTempz,M.r[2]); + vTempw = _mm_mul_ps(vTempw,M.r[3]); + vTempx = _mm_add_ps(vTempx,vTempy); + vTempw = _mm_add_ps(vTempw,vTempz); + vTempw = _mm_add_ps(vTempw,vTempx); + // Store the transformed vector + _mm_storeu_ps(reinterpret_cast(pOutputVector),vTempw); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +#ifdef __cplusplus + +/**************************************************************************** + * + * XMVECTOR operators + * + ****************************************************************************/ + +#ifndef XM_NO_OPERATOR_OVERLOADS + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator+ (FXMVECTOR V) +{ + return V; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator- (FXMVECTOR V) +{ + return XMVectorNegate(V); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator+= +( + XMVECTOR& V1, + FXMVECTOR V2 +) +{ + V1 = XMVectorAdd(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator-= +( + XMVECTOR& V1, + FXMVECTOR V2 +) +{ + V1 = XMVectorSubtract(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator*= +( + XMVECTOR& V1, + FXMVECTOR V2 +) +{ + V1 = XMVectorMultiply(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator/= +( + XMVECTOR& V1, + FXMVECTOR V2 +) +{ + V1 = XMVectorDivide(V1,V2); + return V1; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator*= +( + XMVECTOR& V, + CONST FLOAT S +) +{ + V = XMVectorScale(V, S); + return V; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator/= +( + XMVECTOR& V, + CONST FLOAT S +) +{ + V = XMVectorScale(V, 1.0f / S); + return V; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator+ +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ + return XMVectorAdd(V1, V2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator- +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ + return XMVectorSubtract(V1, V2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator* +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ + return XMVectorMultiply(V1, V2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator/ +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ + return XMVectorDivide(V1,V2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator* +( + FXMVECTOR V, + CONST FLOAT S +) +{ + return XMVectorScale(V, S); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator/ +( + FXMVECTOR V, + CONST FLOAT S +) +{ + return XMVectorScale(V, 1.0f / S); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator* +( + FLOAT S, + FXMVECTOR V +) +{ + return XMVectorScale(V, S); +} + +#endif // !XM_NO_OPERATOR_OVERLOADS + +/**************************************************************************** + * + * XMFLOAT2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT2::_XMFLOAT2 +( + CONST FLOAT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT2& _XMFLOAT2::operator= +( + CONST _XMFLOAT2& Float2 +) +{ + x = Float2.x; + y = Float2.y; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMFLOAT2A& XMFLOAT2A::operator= +( + CONST XMFLOAT2A& Float2 +) +{ + x = Float2.x; + y = Float2.y; + return *this; +} + +/**************************************************************************** + * + * XMHALF2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF2::_XMHALF2 +( + CONST HALF* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF2::_XMHALF2 +( + FLOAT _x, + FLOAT _y +) +{ + x = XMConvertFloatToHalf(_x); + y = XMConvertFloatToHalf(_y); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF2::_XMHALF2 +( + CONST FLOAT* pArray +) +{ + x = XMConvertFloatToHalf(pArray[0]); + y = XMConvertFloatToHalf(pArray[1]); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF2& _XMHALF2::operator= +( + CONST _XMHALF2& Half2 +) +{ + x = Half2.x; + y = Half2.y; + return *this; +} + +/**************************************************************************** + * + * XMSHORTN2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN2::_XMSHORTN2 +( + CONST SHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN2::_XMSHORTN2 +( + FLOAT _x, + FLOAT _y +) +{ + XMStoreShortN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN2::_XMSHORTN2 +( + CONST FLOAT* pArray +) +{ + XMStoreShortN2(this, XMLoadFloat2((XMFLOAT2*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN2& _XMSHORTN2::operator= +( + CONST _XMSHORTN2& ShortN2 +) +{ + x = ShortN2.x; + y = ShortN2.y; + return *this; +} + +/**************************************************************************** + * + * XMSHORT2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT2::_XMSHORT2 +( + CONST SHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT2::_XMSHORT2 +( + FLOAT _x, + FLOAT _y +) +{ + XMStoreShort2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT2::_XMSHORT2 +( + CONST FLOAT* pArray +) +{ + XMStoreShort2(this, XMLoadFloat2((XMFLOAT2*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT2& _XMSHORT2::operator= +( + CONST _XMSHORT2& Short2 +) +{ + x = Short2.x; + y = Short2.y; + return *this; +} + +/**************************************************************************** + * + * XMUSHORTN2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN2::_XMUSHORTN2 +( + CONST USHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN2::_XMUSHORTN2 +( + FLOAT _x, + FLOAT _y +) +{ + XMStoreUShortN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN2::_XMUSHORTN2 +( + CONST FLOAT* pArray +) +{ + XMStoreUShortN2(this, XMLoadFloat2((XMFLOAT2*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN2& _XMUSHORTN2::operator= +( + CONST _XMUSHORTN2& UShortN2 +) +{ + x = UShortN2.x; + y = UShortN2.y; + return *this; +} + +/**************************************************************************** + * + * XMUSHORT2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT2::_XMUSHORT2 +( + CONST USHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT2::_XMUSHORT2 +( + FLOAT _x, + FLOAT _y +) +{ + XMStoreUShort2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT2::_XMUSHORT2 +( + CONST FLOAT* pArray +) +{ + XMStoreUShort2(this, XMLoadFloat2((XMFLOAT2*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT2& _XMUSHORT2::operator= +( + CONST _XMUSHORT2& UShort2 +) +{ + x = UShort2.x; + y = UShort2.y; + return *this; +} + +/**************************************************************************** + * + * XMFLOAT3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT3::_XMFLOAT3 +( + CONST FLOAT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT3& _XMFLOAT3::operator= +( + CONST _XMFLOAT3& Float3 +) +{ + x = Float3.x; + y = Float3.y; + z = Float3.z; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMFLOAT3A& XMFLOAT3A::operator= +( + CONST XMFLOAT3A& Float3 +) +{ + x = Float3.x; + y = Float3.y; + z = Float3.z; + return *this; +} + +/**************************************************************************** + * + * XMHENDN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHENDN3::_XMHENDN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreHenDN3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHENDN3::_XMHENDN3 +( + CONST FLOAT* pArray +) +{ + XMStoreHenDN3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHENDN3& _XMHENDN3::operator= +( + CONST _XMHENDN3& HenDN3 +) +{ + v = HenDN3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHENDN3& _XMHENDN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMHEND3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHEND3::_XMHEND3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreHenD3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHEND3::_XMHEND3 +( + CONST FLOAT* pArray +) +{ + XMStoreHenD3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHEND3& _XMHEND3::operator= +( + CONST _XMHEND3& HenD3 +) +{ + v = HenD3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHEND3& _XMHEND3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUHENDN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHENDN3::_XMUHENDN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreUHenDN3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHENDN3::_XMUHENDN3 +( + CONST FLOAT* pArray +) +{ + XMStoreUHenDN3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHENDN3& _XMUHENDN3::operator= +( + CONST _XMUHENDN3& UHenDN3 +) +{ + v = UHenDN3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHENDN3& _XMUHENDN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUHEND3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHEND3::_XMUHEND3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreUHenD3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHEND3::_XMUHEND3 +( + CONST FLOAT* pArray +) +{ + XMStoreUHenD3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHEND3& _XMUHEND3::operator= +( + CONST _XMUHEND3& UHenD3 +) +{ + v = UHenD3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHEND3& _XMUHEND3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMDHENN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHENN3::_XMDHENN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreDHenN3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHENN3::_XMDHENN3 +( + CONST FLOAT* pArray +) +{ + XMStoreDHenN3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHENN3& _XMDHENN3::operator= +( + CONST _XMDHENN3& DHenN3 +) +{ + v = DHenN3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHENN3& _XMDHENN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMDHEN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHEN3::_XMDHEN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreDHen3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHEN3::_XMDHEN3 +( + CONST FLOAT* pArray +) +{ + XMStoreDHen3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHEN3& _XMDHEN3::operator= +( + CONST _XMDHEN3& DHen3 +) +{ + v = DHen3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHEN3& _XMDHEN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUDHENN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHENN3::_XMUDHENN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreUDHenN3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHENN3::_XMUDHENN3 +( + CONST FLOAT* pArray +) +{ + XMStoreUDHenN3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHENN3& _XMUDHENN3::operator= +( + CONST _XMUDHENN3& UDHenN3 +) +{ + v = UDHenN3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHENN3& _XMUDHENN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUDHEN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHEN3::_XMUDHEN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreUDHen3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHEN3::_XMUDHEN3 +( + CONST FLOAT* pArray +) +{ + XMStoreUDHen3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHEN3& _XMUDHEN3::operator= +( + CONST _XMUDHEN3& UDHen3 +) +{ + v = UDHen3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHEN3& _XMUDHEN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMU565 operators + * + ****************************************************************************/ + +XMFINLINE _XMU565::_XMU565 +( + CONST CHAR *pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; +} + +XMFINLINE _XMU565::_XMU565 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreU565(this, XMVectorSet( _x, _y, _z, 0.0f )); +} + +XMFINLINE _XMU565::_XMU565 +( + CONST FLOAT *pArray +) +{ + XMStoreU565(this, XMLoadFloat3((XMFLOAT3*)pArray )); +} + +XMFINLINE _XMU565& _XMU565::operator= +( + CONST _XMU565& U565 +) +{ + v = U565.v; + return *this; +} + +XMFINLINE _XMU565& _XMU565::operator= +( + CONST USHORT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMFLOAT3PK operators + * + ****************************************************************************/ + +XMFINLINE _XMFLOAT3PK::_XMFLOAT3PK +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreFloat3PK(this, XMVectorSet( _x, _y, _z, 0.0f )); +} + +XMFINLINE _XMFLOAT3PK::_XMFLOAT3PK +( + CONST FLOAT *pArray +) +{ + XMStoreFloat3PK(this, XMLoadFloat3((XMFLOAT3*)pArray )); +} + +XMFINLINE _XMFLOAT3PK& _XMFLOAT3PK::operator= +( + CONST _XMFLOAT3PK& float3pk +) +{ + v = float3pk.v; + return *this; +} + +XMFINLINE _XMFLOAT3PK& _XMFLOAT3PK::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMFLOAT3SE operators + * + ****************************************************************************/ + +XMFINLINE _XMFLOAT3SE::_XMFLOAT3SE +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreFloat3SE(this, XMVectorSet( _x, _y, _z, 0.0f )); +} + +XMFINLINE _XMFLOAT3SE::_XMFLOAT3SE +( + CONST FLOAT *pArray +) +{ + XMStoreFloat3SE(this, XMLoadFloat3((XMFLOAT3*)pArray )); +} + +XMFINLINE _XMFLOAT3SE& _XMFLOAT3SE::operator= +( + CONST _XMFLOAT3SE& float3se +) +{ + v = float3se.v; + return *this; +} + +XMFINLINE _XMFLOAT3SE& _XMFLOAT3SE::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMFLOAT4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4::_XMFLOAT4 +( + CONST FLOAT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4& _XMFLOAT4::operator= +( + CONST _XMFLOAT4& Float4 +) +{ + x = Float4.x; + y = Float4.y; + z = Float4.z; + w = Float4.w; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMFLOAT4A& XMFLOAT4A::operator= +( + CONST XMFLOAT4A& Float4 +) +{ + x = Float4.x; + y = Float4.y; + z = Float4.z; + w = Float4.w; + return *this; +} + +/**************************************************************************** + * + * XMHALF4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF4::_XMHALF4 +( + CONST HALF* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF4::_XMHALF4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + x = XMConvertFloatToHalf(_x); + y = XMConvertFloatToHalf(_y); + z = XMConvertFloatToHalf(_z); + w = XMConvertFloatToHalf(_w); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF4::_XMHALF4 +( + CONST FLOAT* pArray +) +{ + XMConvertFloatToHalfStream(&x, sizeof(HALF), pArray, sizeof(FLOAT), 4); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF4& _XMHALF4::operator= +( + CONST _XMHALF4& Half4 +) +{ + x = Half4.x; + y = Half4.y; + z = Half4.z; + w = Half4.w; + return *this; +} + +/**************************************************************************** + * + * XMSHORTN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN4::_XMSHORTN4 +( + CONST SHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN4::_XMSHORTN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreShortN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN4::_XMSHORTN4 +( + CONST FLOAT* pArray +) +{ + XMStoreShortN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN4& _XMSHORTN4::operator= +( + CONST _XMSHORTN4& ShortN4 +) +{ + x = ShortN4.x; + y = ShortN4.y; + z = ShortN4.z; + w = ShortN4.w; + return *this; +} + +/**************************************************************************** + * + * XMSHORT4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT4::_XMSHORT4 +( + CONST SHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT4::_XMSHORT4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreShort4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT4::_XMSHORT4 +( + CONST FLOAT* pArray +) +{ + XMStoreShort4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT4& _XMSHORT4::operator= +( + CONST _XMSHORT4& Short4 +) +{ + x = Short4.x; + y = Short4.y; + z = Short4.z; + w = Short4.w; + return *this; +} + +/**************************************************************************** + * + * XMUSHORTN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN4::_XMUSHORTN4 +( + CONST USHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN4::_XMUSHORTN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUShortN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN4::_XMUSHORTN4 +( + CONST FLOAT* pArray +) +{ + XMStoreUShortN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN4& _XMUSHORTN4::operator= +( + CONST _XMUSHORTN4& UShortN4 +) +{ + x = UShortN4.x; + y = UShortN4.y; + z = UShortN4.z; + w = UShortN4.w; + return *this; +} + +/**************************************************************************** + * + * XMUSHORT4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT4::_XMUSHORT4 +( + CONST USHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT4::_XMUSHORT4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUShort4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT4::_XMUSHORT4 +( + CONST FLOAT* pArray +) +{ + XMStoreUShort4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT4& _XMUSHORT4::operator= +( + CONST _XMUSHORT4& UShort4 +) +{ + x = UShort4.x; + y = UShort4.y; + z = UShort4.z; + w = UShort4.w; + return *this; +} + +/**************************************************************************** + * + * XMXDECN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDECN4::_XMXDECN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreXDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDECN4::_XMXDECN4 +( + CONST FLOAT* pArray +) +{ + XMStoreXDecN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDECN4& _XMXDECN4::operator= +( + CONST _XMXDECN4& XDecN4 +) +{ + v = XDecN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDECN4& _XMXDECN4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMXDEC4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDEC4::_XMXDEC4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreXDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDEC4::_XMXDEC4 +( + CONST FLOAT* pArray +) +{ + XMStoreXDec4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDEC4& _XMXDEC4::operator= +( + CONST _XMXDEC4& XDec4 +) +{ + v = XDec4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDEC4& _XMXDEC4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMDECN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDECN4::_XMDECN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDECN4::_XMDECN4 +( + CONST FLOAT* pArray +) +{ + XMStoreDecN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDECN4& _XMDECN4::operator= +( + CONST _XMDECN4& DecN4 +) +{ + v = DecN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDECN4& _XMDECN4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMDEC4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDEC4::_XMDEC4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDEC4::_XMDEC4 +( + CONST FLOAT* pArray +) +{ + XMStoreDec4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDEC4& _XMDEC4::operator= +( + CONST _XMDEC4& Dec4 +) +{ + v = Dec4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDEC4& _XMDEC4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUDECN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDECN4::_XMUDECN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDECN4::_XMUDECN4 +( + CONST FLOAT* pArray +) +{ + XMStoreUDecN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDECN4& _XMUDECN4::operator= +( + CONST _XMUDECN4& UDecN4 +) +{ + v = UDecN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDECN4& _XMUDECN4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUDEC4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDEC4::_XMUDEC4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDEC4::_XMUDEC4 +( + CONST FLOAT* pArray +) +{ + XMStoreUDec4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDEC4& _XMUDEC4::operator= +( + CONST _XMUDEC4& UDec4 +) +{ + v = UDec4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDEC4& _XMUDEC4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMXICON4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICON4::_XMXICON4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreXIcoN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICON4::_XMXICON4 +( + CONST FLOAT* pArray +) +{ + XMStoreXIcoN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICON4& _XMXICON4::operator= +( + CONST _XMXICON4& XIcoN4 +) +{ + v = XIcoN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICON4& _XMXICON4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMXICO4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICO4::_XMXICO4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreXIco4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICO4::_XMXICO4 +( + CONST FLOAT* pArray +) +{ + XMStoreXIco4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICO4& _XMXICO4::operator= +( + CONST _XMXICO4& XIco4 +) +{ + v = XIco4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICO4& _XMXICO4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMICON4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICON4::_XMICON4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreIcoN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICON4::_XMICON4 +( + CONST FLOAT* pArray +) +{ + XMStoreIcoN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICON4& _XMICON4::operator= +( + CONST _XMICON4& IcoN4 +) +{ + v = IcoN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICON4& _XMICON4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMICO4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICO4::_XMICO4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreIco4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICO4::_XMICO4 +( + CONST FLOAT* pArray +) +{ + XMStoreIco4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICO4& _XMICO4::operator= +( + CONST _XMICO4& Ico4 +) +{ + v = Ico4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICO4& _XMICO4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUICON4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICON4::_XMUICON4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUIcoN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICON4::_XMUICON4 +( + CONST FLOAT* pArray +) +{ + XMStoreUIcoN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICON4& _XMUICON4::operator= +( + CONST _XMUICON4& UIcoN4 +) +{ + v = UIcoN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICON4& _XMUICON4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUICO4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICO4::_XMUICO4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUIco4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICO4::_XMUICO4 +( + CONST FLOAT* pArray +) +{ + XMStoreUIco4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICO4& _XMUICO4::operator= +( + CONST _XMUICO4& UIco4 +) +{ + v = UIco4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICO4& _XMUICO4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMCOLOR4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMCOLOR::_XMCOLOR +( + FLOAT _r, + FLOAT _g, + FLOAT _b, + FLOAT _a +) +{ + XMStoreColor(this, XMVectorSet(_r, _g, _b, _a)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMCOLOR::_XMCOLOR +( + CONST FLOAT* pArray +) +{ + XMStoreColor(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMCOLOR& _XMCOLOR::operator= +( + CONST _XMCOLOR& Color +) +{ + c = Color.c; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMCOLOR& _XMCOLOR::operator= +( + CONST UINT Color +) +{ + c = Color; + return *this; +} + +/**************************************************************************** + * + * XMBYTEN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTEN4::_XMBYTEN4 +( + CONST CHAR* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTEN4::_XMBYTEN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreByteN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTEN4::_XMBYTEN4 +( + CONST FLOAT* pArray +) +{ + XMStoreByteN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTEN4& _XMBYTEN4::operator= +( + CONST _XMBYTEN4& ByteN4 +) +{ + x = ByteN4.x; + y = ByteN4.y; + z = ByteN4.z; + w = ByteN4.w; + return *this; +} + +/**************************************************************************** + * + * XMBYTE4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTE4::_XMBYTE4 +( + CONST CHAR* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTE4::_XMBYTE4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreByte4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTE4::_XMBYTE4 +( + CONST FLOAT* pArray +) +{ + XMStoreByte4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTE4& _XMBYTE4::operator= +( + CONST _XMBYTE4& Byte4 +) +{ + x = Byte4.x; + y = Byte4.y; + z = Byte4.z; + w = Byte4.w; + return *this; +} + +/**************************************************************************** + * + * XMUBYTEN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTEN4::_XMUBYTEN4 +( + CONST BYTE* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTEN4::_XMUBYTEN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUByteN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTEN4::_XMUBYTEN4 +( + CONST FLOAT* pArray +) +{ + XMStoreUByteN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTEN4& _XMUBYTEN4::operator= +( + CONST _XMUBYTEN4& UByteN4 +) +{ + x = UByteN4.x; + y = UByteN4.y; + z = UByteN4.z; + w = UByteN4.w; + return *this; +} + +/**************************************************************************** + * + * XMUBYTE4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTE4::_XMUBYTE4 +( + CONST BYTE* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTE4::_XMUBYTE4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUByte4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTE4::_XMUBYTE4 +( + CONST FLOAT* pArray +) +{ + XMStoreUByte4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTE4& _XMUBYTE4::operator= +( + CONST _XMUBYTE4& UByte4 +) +{ + x = UByte4.x; + y = UByte4.y; + z = UByte4.z; + w = UByte4.w; + return *this; +} + +/**************************************************************************** + * + * XMUNIBBLE4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUNIBBLE4::_XMUNIBBLE4 +( + CONST CHAR *pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUNIBBLE4::_XMUNIBBLE4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUNibble4(this, XMVectorSet( _x, _y, _z, _w )); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUNIBBLE4::_XMUNIBBLE4 +( + CONST FLOAT *pArray +) +{ + XMStoreUNibble4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUNIBBLE4& _XMUNIBBLE4::operator= +( + CONST _XMUNIBBLE4& UNibble4 +) +{ + v = UNibble4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUNIBBLE4& _XMUNIBBLE4::operator= +( + CONST USHORT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMU555 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMU555::_XMU555 +( + CONST CHAR *pArray, + BOOL _w +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = _w; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMU555::_XMU555 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + BOOL _w +) +{ + XMStoreU555(this, XMVectorSet(_x, _y, _z, ((_w) ? 1.0f : 0.0f) )); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMU555::_XMU555 +( + CONST FLOAT *pArray, + BOOL _w +) +{ + XMVECTOR V = XMLoadFloat3((XMFLOAT3*)pArray); + XMStoreU555(this, XMVectorSetW(V, ((_w) ? 1.0f : 0.0f) )); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMU555& _XMU555::operator= +( + CONST _XMU555& U555 +) +{ + v = U555.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMU555& _XMU555::operator= +( + CONST USHORT Packed +) +{ + v = Packed; + return *this; +} + +#endif // __cplusplus + +#if defined(_XM_NO_INTRINSICS_) +#undef XMISNAN +#undef XMISINF +#endif + +#endif // __XNAMATHVECTOR_INL__ + diff --git a/RenderDll/Dx9Sdk/Lib/D3DCSX.lib b/RenderDll/Dx9Sdk/Lib/D3DCSX.lib new file mode 100644 index 0000000..fd2c502 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/D3DCSX.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/D3DCSXd.lib b/RenderDll/Dx9Sdk/Lib/D3DCSXd.lib new file mode 100644 index 0000000..f637815 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/D3DCSXd.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/DxErr.lib b/RenderDll/Dx9Sdk/Lib/DxErr.lib new file mode 100644 index 0000000..8c7651e Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/DxErr.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/DxErr9.lib b/RenderDll/Dx9Sdk/Lib/DxErr9.lib deleted file mode 100644 index 3f039fa..0000000 Binary files a/RenderDll/Dx9Sdk/Lib/DxErr9.lib and /dev/null differ diff --git a/RenderDll/Dx9Sdk/Lib/X3DAudio.lib b/RenderDll/Dx9Sdk/Lib/X3DAudio.lib new file mode 100644 index 0000000..ffef84d Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/X3DAudio.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/XAPOFX.lib b/RenderDll/Dx9Sdk/Lib/XAPOFX.lib new file mode 100644 index 0000000..53a5f0c Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/XAPOFX.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/XInput.lib b/RenderDll/Dx9Sdk/Lib/XInput.lib new file mode 100644 index 0000000..4d3bd7c Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/XInput.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d2d1.lib b/RenderDll/Dx9Sdk/Lib/d2d1.lib new file mode 100644 index 0000000..751c67f Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/d2d1.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3d10.lib b/RenderDll/Dx9Sdk/Lib/d3d10.lib new file mode 100644 index 0000000..df8ed19 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/d3d10.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3d10_1.lib b/RenderDll/Dx9Sdk/Lib/d3d10_1.lib new file mode 100644 index 0000000..80645d6 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/d3d10_1.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3d11.lib b/RenderDll/Dx9Sdk/Lib/d3d11.lib new file mode 100644 index 0000000..9200898 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/d3d11.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3d9.lib b/RenderDll/Dx9Sdk/Lib/d3d9.lib index 9e08d86..f6eddc6 100644 Binary files a/RenderDll/Dx9Sdk/Lib/d3d9.lib and b/RenderDll/Dx9Sdk/Lib/d3d9.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3dcompiler.lib b/RenderDll/Dx9Sdk/Lib/d3dcompiler.lib new file mode 100644 index 0000000..36cc5d4 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/d3dcompiler.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3dx10.lib b/RenderDll/Dx9Sdk/Lib/d3dx10.lib new file mode 100644 index 0000000..a397032 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/d3dx10.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3dx10d.lib b/RenderDll/Dx9Sdk/Lib/d3dx10d.lib new file mode 100644 index 0000000..5c28adf Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/d3dx10d.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3dx11.lib b/RenderDll/Dx9Sdk/Lib/d3dx11.lib new file mode 100644 index 0000000..904d157 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/d3dx11.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3dx11d.lib b/RenderDll/Dx9Sdk/Lib/d3dx11d.lib new file mode 100644 index 0000000..c1c756a Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/d3dx11d.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3dx9.lib b/RenderDll/Dx9Sdk/Lib/d3dx9.lib index 9024f20..11853bf 100644 Binary files a/RenderDll/Dx9Sdk/Lib/d3dx9.lib and b/RenderDll/Dx9Sdk/Lib/d3dx9.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3dx9d.lib b/RenderDll/Dx9Sdk/Lib/d3dx9d.lib index feacd89..15ed743 100644 Binary files a/RenderDll/Dx9Sdk/Lib/d3dx9d.lib and b/RenderDll/Dx9Sdk/Lib/d3dx9d.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/d3dxof.lib b/RenderDll/Dx9Sdk/Lib/d3dxof.lib new file mode 100644 index 0000000..bf3cde4 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/d3dxof.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/dinput8.lib b/RenderDll/Dx9Sdk/Lib/dinput8.lib new file mode 100644 index 0000000..c870a09 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/dinput8.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/dsetup.lib b/RenderDll/Dx9Sdk/Lib/dsetup.lib new file mode 100644 index 0000000..a3cfdc7 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/dsetup.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/dsound.lib b/RenderDll/Dx9Sdk/Lib/dsound.lib new file mode 100644 index 0000000..c07fe85 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/dsound.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/dwrite.lib b/RenderDll/Dx9Sdk/Lib/dwrite.lib new file mode 100644 index 0000000..aa13636 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/dwrite.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/dxgi.lib b/RenderDll/Dx9Sdk/Lib/dxgi.lib new file mode 100644 index 0000000..011c928 Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/dxgi.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/dxguid.lib b/RenderDll/Dx9Sdk/Lib/dxguid.lib new file mode 100644 index 0000000..82835ab Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/dxguid.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/xapobase.lib b/RenderDll/Dx9Sdk/Lib/xapobase.lib new file mode 100644 index 0000000..531c06b Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/xapobase.lib differ diff --git a/RenderDll/Dx9Sdk/Lib/xapobased.lib b/RenderDll/Dx9Sdk/Lib/xapobased.lib new file mode 100644 index 0000000..900734f Binary files /dev/null and b/RenderDll/Dx9Sdk/Lib/xapobased.lib differ diff --git a/RenderDll/RenderPCH.h b/RenderDll/RenderPCH.h index ef6e7c2..9175e9c 100644 --- a/RenderDll/RenderPCH.h +++ b/RenderDll/RenderPCH.h @@ -19,6 +19,7 @@ ////////////////////////////////////////////////////////////////////////// #define _NOTHREADS #define _STLP_NO_THREADS +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ////////////////////////////////////////////////////////////////////////// //! Include standart headers. diff --git a/RenderDll/XRenderD3D8/XRenderD3D8.vcproj.vspscc b/RenderDll/XRenderD3D8/XRenderD3D8.vcproj.vspscc index 6190079..b98246e 100644 --- a/RenderDll/XRenderD3D8/XRenderD3D8.vcproj.vspscc +++ b/RenderDll/XRenderD3D8/XRenderD3D8.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/RenderDll/XRenderD3D8/XRenderD3D8_XBox.vcproj.vspscc b/RenderDll/XRenderD3D8/XRenderD3D8_XBox.vcproj.vspscc index fc54126..416a667 100644 --- a/RenderDll/XRenderD3D8/XRenderD3D8_XBox.vcproj.vspscc +++ b/RenderDll/XRenderD3D8/XRenderD3D8_XBox.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/RenderDll/XRenderD3D9/D3DCGPShader.cpp b/RenderDll/XRenderD3D9/D3DCGPShader.cpp index d21ef55..04d55ed 100644 --- a/RenderDll/XRenderD3D9/D3DCGPShader.cpp +++ b/RenderDll/XRenderD3D9/D3DCGPShader.cpp @@ -25,9 +25,9 @@ static char THIS_FILE[] = __FILE__; //======================================================================= // init memory pool usage -#ifndef PS2 - _ACCESS_POOL; -#endif +//#ifndef PS2 +// _ACCESS_POOL; +//#endif vec4_t CCGPShader_D3D::m_CurParams[32]; @@ -183,7 +183,7 @@ bool CCGPShader_D3D::mfGetFXParamNameByID(int nParam, char *ParamName) if (!strcmp(m_EntryFunc.c_str(), funcName)) { const char *pFunc = m_Functions[i].m_Struct.c_str(); - char *s = strchr(pFunc, '('); + char *s = strchr((char*)pFunc, '('); s = strchr(s, ','); s++; int n = 0; diff --git a/RenderDll/XRenderD3D9/D3DCGVProgram.cpp b/RenderDll/XRenderD3D9/D3DCGVProgram.cpp index d763eeb..a125937 100644 --- a/RenderDll/XRenderD3D9/D3DCGVProgram.cpp +++ b/RenderDll/XRenderD3D9/D3DCGVProgram.cpp @@ -212,7 +212,7 @@ bool CCGVProgram_D3D::mfGetFXParamNameByID(int nParam, char *ParamName) if (!strcmp(m_EntryFunc.c_str(), funcName)) { const char *pFunc = m_Functions[i].m_Struct.c_str(); - char *s = strchr(pFunc, '('); + char *s = strchr((char*)pFunc, '('); s = strchr(s, ','); s++; int n = 0; diff --git a/RenderDll/XRenderD3D9/D3DHDRRender.cpp b/RenderDll/XRenderD3D9/D3DHDRRender.cpp index ec78194..809d960 100644 --- a/RenderDll/XRenderD3D9/D3DHDRRender.cpp +++ b/RenderDll/XRenderD3D9/D3DHDRRender.cpp @@ -2378,7 +2378,7 @@ bool HDR_RenderStar() const CStarDef& starDef = g_GlareDef.m_starDef; const float fTanFoV = atanf(D3DX_PI/8) ; const D3DXVECTOR4 vWhite( 1.0f, 1.0f, 1.0f, 1.0f ); - static const s_maxPasses = 3 ; + static const int s_maxPasses = 3 ; static const int nSamples = 8 ; static D3DXVECTOR4 s_aaColor[s_maxPasses][8] ; static const D3DXCOLOR s_colorWhite(0.63f, 0.63f, 0.63f, 0.0f) ; diff --git a/RenderDll/XRenderD3D9/D3DSystem.cpp b/RenderDll/XRenderD3D9/D3DSystem.cpp index 394bd0a..1e3c06c 100644 --- a/RenderDll/XRenderD3D9/D3DSystem.cpp +++ b/RenderDll/XRenderD3D9/D3DSystem.cpp @@ -9,7 +9,7 @@ #include "RenderPCH.h" #include "DriverD3D9.h" -#include +#include #include "D3DCGVProgram.h" #include "D3DCGPShader.h" @@ -1025,7 +1025,7 @@ WIN_HWND CD3D9Renderer::Init(int x,int y,int width,int height,unsigned int cbpp, const char *CD3D9Renderer::D3DError( HRESULT h ) { const TCHAR* strHRESULT; - strHRESULT = DXGetErrorString9(h); + strHRESULT = DXGetErrorString(h); return strHRESULT; } @@ -2913,3 +2913,8 @@ void CD3D9Renderer::RecognizePixelFormat(SPixFormat& Dest, D3DFORMAT FromD3D, IN iLog->Log(" Using '%s' pixel texture format\n", InDesc); } +namespace std +{ + + +} \ No newline at end of file diff --git a/RenderDll/XRenderD3D9/DriverD3D9.cpp b/RenderDll/XRenderD3D9/DriverD3D9.cpp index 830dd51..900ba13 100644 --- a/RenderDll/XRenderD3D9/DriverD3D9.cpp +++ b/RenderDll/XRenderD3D9/DriverD3D9.cpp @@ -4477,6 +4477,15 @@ void *gGet_glReadPixels() return NULL; } +namespace ATL +{ + int __cdecl _AtlInitializeCriticalSectionEx(struct _RTL_CRITICAL_SECTION*, unsigned long, unsigned long) + { + return 0; + } +} + + //========================================================================================= //========================================================================================= diff --git a/RenderDll/XRenderD3D9/DriverD3D9.h b/RenderDll/XRenderD3D9/DriverD3D9.h index 7cabe8e..7ddce7f 100644 --- a/RenderDll/XRenderD3D9/DriverD3D9.h +++ b/RenderDll/XRenderD3D9/DriverD3D9.h @@ -30,7 +30,7 @@ The DXRenderer interface Class #else // Base class #include -#include +#include #endif //======================================================================= @@ -349,6 +349,8 @@ struct SD3DRenderTarget //====================================================================== /// Direct3D Render driver class +class IEntityRender; + class CD3D9Renderer : public CRenderer { friend class CD3D9TexMan; @@ -1780,7 +1782,7 @@ class CD3D9TexMan : public CTexMan static void CalcMipsAndSize(STexPic *ti); - static BindNULL(int From) + static void BindNULL(int From) { int n = CTexMan::m_nCurStages; CTexMan::m_nCurStages = From; diff --git a/RenderDll/XRenderD3D9/Release/XRenderD3D9.Build.CppClean.log b/RenderDll/XRenderD3D9/Release/XRenderD3D9.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/RenderDll/XRenderD3D9/Release/XRenderD3D9.lib b/RenderDll/XRenderD3D9/Release/XRenderD3D9.lib new file mode 100644 index 0000000..87c0082 Binary files /dev/null and b/RenderDll/XRenderD3D9/Release/XRenderD3D9.lib differ diff --git a/RenderDll/XRenderD3D9/Release/XRenderD3D9.log b/RenderDll/XRenderD3D9/Release/XRenderD3D9.log new file mode 100644 index 0000000..e69de29 diff --git a/RenderDll/XRenderD3D9/Release/XRenderD3D9.tlog/unsuccessfulbuild b/RenderDll/XRenderD3D9/Release/XRenderD3D9.tlog/unsuccessfulbuild new file mode 100644 index 0000000..e69de29 diff --git a/RenderDll/XRenderD3D9/Release/XRenderD3D9.vcxproj.FileListAbsolute.txt b/RenderDll/XRenderD3D9/Release/XRenderD3D9.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/RenderDll/XRenderD3D9/XRenderD3D9.vcproj.vspscc b/RenderDll/XRenderD3D9/XRenderD3D9.vcproj.vspscc index cd32550..17a31f0 100644 --- a/RenderDll/XRenderD3D9/XRenderD3D9.vcproj.vspscc +++ b/RenderDll/XRenderD3D9/XRenderD3D9.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/RenderDll/XRenderD3D9/XRenderD3D9.vcxproj b/RenderDll/XRenderD3D9/XRenderD3D9.vcxproj new file mode 100644 index 0000000..79b4fcb --- /dev/null +++ b/RenderDll/XRenderD3D9/XRenderD3D9.vcxproj @@ -0,0 +1,770 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {6711B2B2-6829-4314-A491-D01A29365658} + Perforce Project + + .. + MSSCCI:Perforce SCM + 10.0 + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + C:\Users\James\Documents\FarCry_Build + .\Debug\ + true + + + D:\Games\FC\Bin32\ + Debug64\ + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Full + AnySuitable + true + Speed + true + false + ..\DX9SDK\Include;..\..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;COMP_VC;DO_ASM;DIRECT3D9;OS_WIN32;PROC_INTEL;WIN32;NDEBUG;_WINDOWS;_USRDLL;XRENDERD3D9_EXPORTS;_RENDERER;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + NotSet + true + Use + RenderPCH.h + .\Release/XRenderD3D9.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + Winmm.lib;version.lib;d3d9.lib;d3dx9.lib;DXErr.lib;cg.lib;cgD3D9.lib;legacy_stdio_definitions.lib;ijl15.lib;nvDXTlib.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + ..\DX9SDK\Lib;Libraries;%(AdditionalLibraryDirectories) + .\Release/XRenderD3D9.pdb + $(IntDir)$(TargetName).lib + libcp.lib;LIBC.lib + false + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/XRenderD3D9.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Speed + true + false + ..\DX9SDK\Include;..\..\CryCommon;%(AdditionalIncludeDirectories) + ENABLE_FRAME_PROFILER;COMP_VC;DO_ASM;DIRECT3D9;OS_WIN32;PROC_INTEL;WIN32;NDEBUG;_WINDOWS;_USRDLL;XRENDERD3D9_EXPORTS;DO_RENDERLOG;DO_RENDERSTATS;_RENDERER;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + NotSet + true + Use + RenderPCH.h + .\Profile/XRenderD3D9.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 /OPT:REF /OPT:ICF %(AdditionalOptions) + Winmm.lib;version.lib;d3dx9.lib;d3d9.lib;DXErr9.lib;cg.lib;cgD3D9.lib;%(AdditionalDependencies) + true + ..\DX9SDK\Lib;Libraries;%(AdditionalLibraryDirectories) + true + 0x38000000 + false + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/XRenderD3D9.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + .\;..\DX9SDK\Include;..\..\CryCommon;%(AdditionalIncludeDirectories) + ENABLE_FRAME_PROFILER;COMP_VC;DO_ASM;DIRECT3D9;OS_WIN32;PROC_INTEL;WIN32;_DEBUG;_WINDOWS;_USRDLL;XRENDERD3D9_EXPORTS;DO_RENDERLOG;DO_RENDERSTATS;_RENDERER;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + Use + RenderPCH.h + .\Debug/XRenderD3D9.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 %(AdditionalOptions) + Winmm.lib;version.lib;d3d9.lib;d3dx9.lib;DXErr.lib;cg.lib;cgD3D9.lib;legacy_stdio_definitions.lib;ijl15.lib;nvDXTlib.lib;%(AdditionalDependencies) + true + ..\DX9SDK\Lib;Libraries;%(AdditionalLibraryDirectories) + true + $(IntDir)$(TargetName).lib + false + libcp.lib;LIBC.lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/XRenderD3D9.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\..\CryCommon;..\DX9SDK\Include;%(AdditionalIncludeDirectories) + _AMD64_;ENABLE_FRAME_PROFILER;COMP_VC;DIRECT3D9;OS_WIN32;PROC_INTEL;WIN64;_DEBUG;_WINDOWS;_USRDLL;XRENDERD3D9_EXPORTS;DO_RENDERLOG;DO_RENDERSTATS;_RENDERER;%(PreprocessorDefinitions) + Default + MultiThreadedDebugDLL + false + true + Use + RenderPCH.h + $(IntDir)$(TargetName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + Winmm.lib;d3dx9.lib;d3d9.lib;DxErr9.lib;version.lib;../../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + false + E:\WINDDK\dx9\AMD64\libs;Libraries;%(AdditionalLibraryDirectories) + libcd.lib;%(IgnoreSpecificDefaultLibraries) + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + false + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/XRenderD3D9.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + /fp:fast %(AdditionalOptions) + MaxSpeed + AnySuitable + true + Speed + ..\..\CryCommon;..\DX9SDK\Include;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;ENABLE_FRAME_PROFILER;COMP_VC;DIRECT3D9;OS_WIN32;PROC_INTEL;_WINDOWS;_USRDLL;XRENDERD3D9_EXPORTS;DO_RENDERLOG;DO_RENDERSTATS;_RENDERER;%(PreprocessorDefinitions) + Default + MultiThreaded + false + true + Use + RenderPCH.h + $(IntDir)$(TargetName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + Winmm.lib;d3dx9.lib;d3d9.lib;DxErr9.lib;version.lib;../../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + false + D:\AMD64\dx91amd64\libs;Libraries;%(AdditionalLibraryDirectories) + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + false + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/XRenderD3D9.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AssemblyAndSourceCode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + true + true + Use + + + true + + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + AssemblyAndSourceCode + + + + + + + AssemblyAndSourceCode + AssemblyAndSourceCode + + + + AssemblyAndSourceCode + AssemblyAndSourceCode + AssemblyAndSourceCode + + + + + AssemblyAndSourceCode + AssemblyAndSourceCode + AssemblyAndSourceCode + AssemblyAndSourceCode + AssemblyAndSourceCode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RenderDll/XRenderD3D9/XRenderD3D9.vcxproj.filters b/RenderDll/XRenderD3D9/XRenderD3D9.vcxproj.filters new file mode 100644 index 0000000..10e1805 --- /dev/null +++ b/RenderDll/XRenderD3D9/XRenderD3D9.vcxproj.filters @@ -0,0 +1,586 @@ + + + + + {8eee38e4-6d86-4635-b798-71ff769aa8bd} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {de8bf71f-98f3-4dcf-88f2-07cce0edcb06} + + + {8b658641-f9a4-4740-91a1-761d975d14df} + h;hpp;hxx;hm;inl + + + {8c7e07c2-6616-4810-aaa5-83794a8f69b4} + + + {bf054817-139a-462c-bc22-b2cc356b7277} + + + {9c6c2004-ae86-4b3c-87c5-236595596b1e} + + + {ab063caf-a668-4f31-ac90-8c8cb0e5349b} + + + {a6ba8dae-d552-4a76-80e3-6e0b7ec31678} + + + {b685a5ea-25d6-4b25-a4c6-aa13b1a08502} + + + {f95ff7ac-b29e-45eb-9143-9f28b34fb873} + + + {feea8b21-53d2-41eb-a57e-487c6871668c} + + + {08e393f3-463f-48d0-82b9-3ba3f45051c6} + + + {401adc96-316c-4f7f-95b4-0b595ad4b451} + + + {b2ec21a7-4d57-4b55-a908-98d3017225bf} + + + {f2c8c6f2-baad-4cd5-b9ef-089a666e8c1d} + + + {27bd685b-9aa4-4685-b783-1b8edb5d01fb} + + + {161e2371-86d0-491c-b21e-84093003cf8f} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\Textures + + + Common\Textures + + + Common\Textures + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\LeafBuffer + + + Common\LeafBuffer + + + Common\LeafBuffer + + + Common\LeafBuffer + + + Common\NvTriStrip + + + Common\NvTriStrip + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Source Files + + + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\Textures + + + Common\Textures + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\zlib + + + Common\Textures\Image\zlib + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\Textures\Image\jpeg6 + + + Common\NvTriStrip + + + Common\NvTriStrip + + + Common\NvTriStrip + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\3Dc + + + Header Files + + + Header Files + + + + + Common\Common_h + + + + + + \ No newline at end of file diff --git a/RenderDll/XRenderD3D9/XRenderD3D9.vcxproj.user b/RenderDll/XRenderD3D9/XRenderD3D9.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/RenderDll/XRenderD3D9/XRenderD3D9.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/RenderDll/XRenderNULL/Release/XRenderNULL.Build.CppClean.log b/RenderDll/XRenderNULL/Release/XRenderNULL.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/RenderDll/XRenderNULL/Release/XRenderNULL.log b/RenderDll/XRenderNULL/Release/XRenderNULL.log new file mode 100644 index 0000000..e69de29 diff --git a/RenderDll/XRenderNULL/Release/XRenderNULL.vcxproj.FileListAbsolute.txt b/RenderDll/XRenderNULL/Release/XRenderNULL.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/RenderDll/XRenderNULL/XRenderNULL.vcproj.vspscc b/RenderDll/XRenderNULL/XRenderNULL.vcproj.vspscc index 58fc1b9..34091c9 100644 --- a/RenderDll/XRenderNULL/XRenderNULL.vcproj.vspscc +++ b/RenderDll/XRenderNULL/XRenderNULL.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/RenderDll/XRenderNULL/XRenderNULL.vcxproj b/RenderDll/XRenderNULL/XRenderNULL.vcxproj new file mode 100644 index 0000000..62f2b62 --- /dev/null +++ b/RenderDll/XRenderNULL/XRenderNULL.vcxproj @@ -0,0 +1,414 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {1EE58697-2D3E-454A-BA80-2455F7EA14A0} + Perforce Project + + .. + MSSCCI:Perforce SCM + Win32Proj + 10.0 + + + + DynamicLibrary + v143 + MultiByte + true + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + C:\Users\James\Documents\FarCry_Build + Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Disabled + ..\..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;NULL_RENDERER;DO_ASM;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + Use + RenderPCH.h + + $(IntDir) + $(IntDir)vc70.pdb + Level3 + EditAndContinue + + + true + Windows + MachineX86 + false + libcp.lib;libc.lib + legacy_stdio_definitions.lib;%(AdditionalDependencies) + + + + + Full + AnySuitable + true + Size + true + false + ..\..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;NULL_RENDERER;DO_ASM;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + RenderPCH.h + Level3 + ProgramDatabase + + + true + Windows + true + true + MachineX86 + + + + + Full + AnySuitable + true + Size + true + false + ..\..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;WIN32;NDEBUG;_WINDOWS;NULL_RENDERER;DO_ASM;%(PreprocessorDefinitions) + true + MultiThreaded + false + false + NotSet + Use + RenderPCH.h + Level3 + ProgramDatabase + + + true + Windows + true + true + 0x38000000 + MachineX86 + + + + + Disabled + ..\..\CryCommon;%(AdditionalIncludeDirectories) + _AMD64_;WIN64;WIN32;_DEBUG;_WINDOWS;NULL_RENDERER;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + Use + RenderPCH.h + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + ProgramDatabase + + + /MACHINE:AMD64 %(AdditionalOptions) + ../../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).dll + true + $(OutDir)$(ProjectName).pdb + Windows + true + $(OutDir)$(ProjectName).lib + NotSet + + + + + Full + AnySuitable + true + ..\..\CryCommon;%(AdditionalIncludeDirectories) + _RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS;NULL_RENDERER;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + Use + RenderPCH.h + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + ProgramDatabase + + + /MACHINE:AMD64 %(AdditionalOptions) + ../../CryCommon/fSinCos64.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).dll + true + $(OutDir)$(ProjectName).pdb + Windows + $(OutDir)$(ProjectName).lib + NotSet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + + + + + + + + + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RenderDll/XRenderNULL/XRenderNULL.vcxproj.filters b/RenderDll/XRenderNULL/XRenderNULL.vcxproj.filters new file mode 100644 index 0000000..c6f4a2e --- /dev/null +++ b/RenderDll/XRenderNULL/XRenderNULL.vcxproj.filters @@ -0,0 +1,402 @@ + + + + + {e738b0ac-4462-4070-b618-669b9a1589f1} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + {199c1333-ff30-427b-a2a3-9ea7a4d3001d} + h;hpp;hxx;hm;inl;inc + + + {cb88f2a4-361c-4b5d-8181-c23b4fa097d4} + + + {4bb8dafa-201e-4aba-86b8-83c46fb0986b} + + + {9f243fd7-9ccf-4b1e-9d56-29663fdf738f} + + + {50c00ebe-6648-4135-b83d-689c16314b07} + + + {6d7dde53-1e7c-4dd5-912f-e8cc9ba80ebe} + + + {87552cd4-c6f1-4eb5-8a00-c487082ff1a7} + + + {e54cee6a-d5c4-45e7-a35e-b56d12d4dc12} + + + {5001072f-8a5b-4dfa-a12d-cf91a63debc8} + + + {1af6caa1-0771-44f8-97f5-d3dffa2f830a} + + + {26809a2d-d0cb-45b7-9378-2b389b20c7b9} + + + {d0246653-1e6d-4e82-8913-75c901bbf63b} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\Textures + + + Common\Textures + + + Common\Textures + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\LeafBuffer + + + Common\LeafBuffer + + + Common\LeafBuffer + + + Common\LeafBuffer + + + Common\NvTriStrip + + + Common\NvTriStrip + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Source Files + + + + + Header Files + + + Common + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\Textures + + + Common\Textures + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\NvTriStrip + + + Common\NvTriStrip + + + Common\NvTriStrip + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Header Files + + + Header Files + + + + + Common\Common_h + + + + + Libraries + + + Libraries + + + Libraries + + + \ No newline at end of file diff --git a/RenderDll/XRenderNULL/XRenderNULL.vcxproj.user b/RenderDll/XRenderNULL/XRenderNULL.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/RenderDll/XRenderNULL/XRenderNULL.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/RenderDll/XRenderOGL/GLCGPShader.h b/RenderDll/XRenderOGL/GLCGPShader.h index 9aaf87a..845a0fe 100644 --- a/RenderDll/XRenderOGL/GLCGPShader.h +++ b/RenderDll/XRenderOGL/GLCGPShader.h @@ -55,8 +55,8 @@ class CCGPShader_GL : public CPShader TArray *m_ParamsNoObj; TArray *m_ParamsObj; TArray *m_MatrixObj; - uint m_dwHandle; - uint m_dwHandleExt; + unsigned int m_dwHandle; + unsigned int m_dwHandleExt; TArray *m_BindConstants; TArray *m_BindVars; int m_nCacheID; @@ -538,7 +538,8 @@ class CCGPShader_GL : public CPShader { char sLine[4][128]; int n = 8; - for (int i=0; i<4; i++) + int i; + for (i=0; i<4; i++) { int m = 0; while (sStr[n] != 0xa) diff --git a/RenderDll/XRenderOGL/GLFuncs.h b/RenderDll/XRenderOGL/GLFuncs.h index 7d533f0..65de237 100644 --- a/RenderDll/XRenderOGL/GLFuncs.h +++ b/RenderDll/XRenderOGL/GLFuncs.h @@ -11,7 +11,6 @@ /*----------------------------------------------------------------------------- Standard OpenGL functions. -----------------------------------------------------------------------------*/ - GL_EXT(_GL) // OpenGL. diff --git a/RenderDll/XRenderOGL/GLRERender.cpp b/RenderDll/XRenderOGL/GLRERender.cpp index cc6fc1e..9555db8 100644 --- a/RenderDll/XRenderOGL/GLRERender.cpp +++ b/RenderDll/XRenderOGL/GLRERender.cpp @@ -21,6 +21,8 @@ #undef THIS_FILE static char THIS_FILE[] = __FILE__; +int (WINAPIV* __vsnprintf)(char*, size_t, const char*, va_list) = _vsnprintf; + //======================================================================= void CREFlareGeom::mfCheckVis(CFColor &col, CCObject *obj) diff --git a/RenderDll/XRenderOGL/GLRendPipeline.cpp b/RenderDll/XRenderOGL/GLRendPipeline.cpp index 22bc384..495584a 100644 --- a/RenderDll/XRenderOGL/GLRendPipeline.cpp +++ b/RenderDll/XRenderOGL/GLRendPipeline.cpp @@ -466,6 +466,7 @@ void CGLRenderer::EF_PipelineInit() m_RP.m_VisObjects[0] = &m_RP.m_ObjectsPool[0]; } + int i; for (i=0; im_Flags & DLF_FAKE) diff --git a/RenderDll/XRenderOGL/GLTextures.cpp b/RenderDll/XRenderOGL/GLTextures.cpp index 7907287..3e4f44e 100644 --- a/RenderDll/XRenderOGL/GLTextures.cpp +++ b/RenderDll/XRenderOGL/GLTextures.cpp @@ -2879,7 +2879,8 @@ void CGLTexMan::CreateBufRegion(int Width, int Height) { if (SUPPORTS_WGL_ARB_buffer_region) { - for (int i=0; im_Width == Width && br->m_Height == Height) @@ -2944,7 +2945,8 @@ void CGLTexMan::ClearBuffer(int Width, int Height, bool bEnd,STexPic *pImage, in SBufRegion *br = NULL; if (SUPPORTS_WGL_ARB_buffer_region) { - for (int i=0; im_Width == Width && br->m_Height == Height) diff --git a/RenderDll/XRenderOGL/GL_Renderer.h b/RenderDll/XRenderOGL/GL_Renderer.h index 66275c3..8558a0c 100644 --- a/RenderDll/XRenderOGL/GL_Renderer.h +++ b/RenderDll/XRenderOGL/GL_Renderer.h @@ -29,6 +29,8 @@ The GLRenderer interface Class #include "Mygl.h" #include "Myglu.h" +#include "map" + // GL functions declare. #define GL_EXT(name) extern byte SUPPORTS##name; #define GL_PROC(ext,ret,func,parms) extern ret (__stdcall *func)parms; @@ -1409,7 +1411,7 @@ class CGLTexMan : public CTexMan static int GetTexDstFormat(ETEX_Format eTF); static void CalcMipsAndSize(STexPic *ti); static ETEX_Format GetTexFormat(int GLFormat); - static BindNULL(int From) + static void BindNULL(int From) { int n = CTexMan::m_nCurStages; CTexMan::m_nCurStages = From; diff --git a/RenderDll/XRenderOGL/GL_VertBuffer.cpp b/RenderDll/XRenderOGL/GL_VertBuffer.cpp index 67dfe27..fcbf9dc 100644 --- a/RenderDll/XRenderOGL/GL_VertBuffer.cpp +++ b/RenderDll/XRenderOGL/GL_VertBuffer.cpp @@ -1306,6 +1306,7 @@ void CGLRenderer::GenerateVBLog(const char *szName) int SizeLB = 0; int SizeGR = 0; const char *szLast = NULL; + int i; for (i=0; i + + + + Debug64 + Win32 + + + Debug + Win32 + + + Profile + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {4C5F1B66-2962-439A-AECF-D727FDDBCD48} + Perforce Project + + .. + MSSCCI:Perforce SCM + 10.0 + + + + DynamicLibrary + v143 + false + MultiByte + true + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + DynamicLibrary + v143 + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Profile\ + false + + + C:\Users\James\Documents\FarCry_Build + Debug\ + true + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Full + AnySuitable + true + Speed + true + false + ..\..\;..\..\FarCry;..\..\CryNetwork;..\..\CryCommon;..\..\CryCommon\Stl;..\..\CryPhysics;%(AdditionalIncludeDirectories) + _RELEASE;COMP_VC;DO_ASM;OPENGL;OS_WIN32;PROC_INTEL;WIN32;NDEBUG;_WINDOWS;_USRDLL;XRENDEROGL_EXPORTS;_RENDERER;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + NotSet + Use + RenderPCH.h + .\Release/XRenderOGL.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + Default + + + /MACHINE:I386 %(AdditionalOptions) + Glu32.lib;OpenGL32.lib;Winmm.lib;cg.lib;cgGL.lib;%(AdditionalDependencies) + $(OutDir)XRenderOGL.dll + true + Libraries;%(AdditionalLibraryDirectories) + .\Release/XRenderOGL.pdb + .\Release/XRenderOGL.lib + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/XRenderOGL.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + Speed + true + false + ..\..\;..\..\FarCry;..\..\CryNetwork;..\..\CryCommon;..\..\CryCommon\Stl;..\..\CryPhysics;%(AdditionalIncludeDirectories) + ENABLE_FRAME_PROFILER;COMP_VC;DO_ASM;OPENGL;OS_WIN32;PROC_INTEL;WIN32;NDEBUG;_WINDOWS;_USRDLL;XRENDEROGL_EXPORTS;DO_RENDERLOG;DO_RENDERSTATS;_RENDERER; USE_3DC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + NotSet + Use + RenderPCH.h + .\Profile/XRenderOGL.pch + .\Profile/ + .\Profile/ + .\Profile/ + Level3 + true + ProgramDatabase + Default + + + /MACHINE:I386 %(AdditionalOptions) + glu32.lib;OpenGL32.lib;Winmm.lib;cg.lib;cgGL.lib;%(AdditionalDependencies) + true + Libraries;%(AdditionalLibraryDirectories) + true + 0x38000000 + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + C:\MasterCD/XRenderOGL.tlb + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + C:\Users\James\source\repos\FarCry\SourceCode\RenderDll;C:\Users\James\source\repos\FarCry\SourceCode\RenderDll\Common\Shaders;C:\Users\James\source\repos\FarCry\SourceCode\RenderDll\Common;..\..\CryCommon;%(AdditionalIncludeDirectories) + ENABLE_FRAME_PROFILER;COMP_VC;DO_ASM;OPENGL;OS_WIN32;PROC_INTEL;WIN32;_DEBUG;_WINDOWS;_USRDLL;XRENDEROGL_EXPORTS;DO_RENDERLOG;DO_RENDERSTATS;_RENDERER;USE_3DC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + Use + RenderPCH.h + .\Debug/XRenderOGL.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + Default + + + /MACHINE:I386 /VERBOSE %(AdditionalOptions) + glu32.lib;OpenGL32.lib;Winmm.lib;cg.lib;cgGL.lib;%(AdditionalDependencies) + true + Libraries;%(AdditionalLibraryDirectories) + true + false + libcp.lib;LIBC.lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/XRenderOGL.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Disabled + ..\..\CryCommon;%(AdditionalIncludeDirectories) + _AMD64_;WIN64;ENABLE_FRAME_PROFILER;COMP_VC;OPENGL;OS_WIN32;WIN32;_DEBUG;_WINDOWS;_USRDLL;XRENDEROGL_EXPORTS;DO_RENDERLOG;DO_RENDERSTATS;%(PreprocessorDefinitions) + Default + MultiThreadedDebug + false + Use + RenderPCH.h + $(IntDir)$(TargetName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + glu32.lib;OpenGL32.lib;Winmm.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).dll + true + Libraries;%(AdditionalLibraryDirectories) + true + $(OutDir)$(ProjectName).pdb + true + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/XRenderOGL.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + Full + AnySuitable + true + ..\..\CryCommon;%(AdditionalIncludeDirectories) + ENABLE_FRAME_PROFILER;_RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;ENABLE_FRAME_PROFILER;COMP_VC;OPENGL;OS_WIN32;_WINDOWS;_USRDLL;XRENDEROGL_EXPORTS;DO_RENDERLOG;DO_RENDERSTATS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + Use + RenderPCH.h + $(IntDir)$(TargetName).pch + $(IntDir) + $(IntDir) + $(IntDir)$(ProjectName).pdb + Level3 + true + ProgramDatabase + Default + + + /MACHINE:AMD64 %(AdditionalOptions) + glu32.lib;OpenGL32.lib;Winmm.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).dll + true + Libraries;%(AdditionalLibraryDirectories) + true + $(OutDir)$(ProjectName).pdb + $(OutDir)$(ProjectName).lib + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/XRenderOGL.tlb + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AssemblyAndSourceCode + + + + + + + + + + + + + + true + true + + + + AssemblyAndSourceCode + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.obj + + + + + + + + + + + + + + + + + + + AssemblyAndSourceCode + + + + + Create + Create + Create + Create + Create + + + + + + + + + + AssemblyAndSourceCode + + + + + + + + + + + + AssemblyAndSourceCode + + + + AssemblyAndSourceCode + AssemblyAndSourceCode + AssemblyAndSourceCode + + + + + + AssemblyAndSourceCode + AssemblyAndSourceCode + AssemblyAndSourceCode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RenderDll/XRenderOGL/XRenderOGL.vcxproj.filters b/RenderDll/XRenderOGL/XRenderOGL.vcxproj.filters new file mode 100644 index 0000000..2404cf4 --- /dev/null +++ b/RenderDll/XRenderOGL/XRenderOGL.vcxproj.filters @@ -0,0 +1,612 @@ + + + + + {c5327b71-e56f-4161-baa7-782fe3288459} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {69f5a04e-c30c-4a5a-9762-cc85ca3c0c42} + + + {f5135024-8733-448a-88cc-d7f5a902d743} + + + {860d8ae7-dc7a-42f3-9446-c47a79421c21} + + + {56035d4a-4274-492f-a6ff-7a0af8056423} + h;hpp;hxx;hm;inl + + + {7f6cc069-e1eb-47e0-9204-90f6efa5ef3c} + + + {87ae5938-4718-4c8c-9fe6-21894aa1d323} + + + {cc414e13-02b7-4170-8cc7-589c5d09d212} + + + {73a96c5a-a625-4b9c-bb50-4e85acd52e08} + + + {3b6b72f2-d734-4089-b701-583a36dc36e4} + + + {b09f3aba-57a5-447c-b9f9-6554ff06631b} + + + {2dacba47-a4e9-4bcb-9b69-907ee10f6d2a} + + + {1906113d-9fde-43ee-a9ed-2645007f8806} + + + {c882247e-9807-493d-b3f4-8c45c9822c5b} + + + {56d95d85-1dba-44b7-bc4c-68f608885717} + + + {fcb4f5b2-9cdc-40a9-8358-e9ddf6ac8e1e} + + + {48cbdd3a-34c2-4bc5-9588-b9149c1b651d} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Source Files\NVParse + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\RendElements + + + Common\Textures + + + Common\Textures + + + Common\Textures + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\Textures\Image + + + Common\LeafBuffer + + + Common\LeafBuffer + + + Common\LeafBuffer + + + Common\LeafBuffer + + + Common\NvTriStrip + + + Common\NvTriStrip + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Source Files + + + + + Source Files + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\NVParse\NVParse_h + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Source Files\CG + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\Common_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\RendElements\RendElements_h + + + Common\Textures + + + Common\Textures + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\Textures\Image\Image_h + + + Common\NvTriStrip + + + Common\NvTriStrip + + + Common\NvTriStrip + + + Common\Shaders + + + Common\Shaders + + + Common\Shaders + + + Common\3Dc + + + Header Files + + + Header Files + + + + + Common\Common_h + + + + + Libraries + + + Libraries + + + + + + \ No newline at end of file diff --git a/RenderDll/XRenderOGL/XRenderOGL.vcxproj.user b/RenderDll/XRenderOGL/XRenderOGL.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/RenderDll/XRenderOGL/XRenderOGL.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ResourceCompiler/Debug/ResourceCompiler.Build.CppClean.log b/ResourceCompiler/Debug/ResourceCompiler.Build.CppClean.log new file mode 100644 index 0000000..027a427 --- /dev/null +++ b/ResourceCompiler/Debug/ResourceCompiler.Build.CppClean.log @@ -0,0 +1,28 @@ +e:\prj\farcry\sourcecode\resourcecompiler\debug\resourcecompiler.pch +e:\prj\farcry\sourcecode\resourcecompiler\debug\vc143.pdb +e:\prj\farcry\sourcecode\resourcecompiler\debug\vc143.idb +e:\prj\farcry\sourcecode\resourcecompiler\debug\stdafx.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\cfgfile.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\cgfutils.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\chunkfilereader.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\cmdline.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\config.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\crybonedesc.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\crybonehierarchyloader.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\crychunkedfile.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\cryvertexbinding.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\extensionmanager.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\filemapping.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\fileutil.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\resourcecompiler.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\nvtristrip.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\nvtristripobjects.obj +e:\prj\farcry\sourcecode\resourcecompiler\debug\resourcecompiler.ilk +d:\games\fc\bin32\rc.exe +d:\games\fc\bin32\rc.pdb +e:\prj\farcry\sourcecode\resourcecompiler\debug\resourcecompiler.tlog\cl.command.1.tlog +e:\prj\farcry\sourcecode\resourcecompiler\debug\resourcecompiler.tlog\cl.read.1.tlog +e:\prj\farcry\sourcecode\resourcecompiler\debug\resourcecompiler.tlog\cl.write.1.tlog +e:\prj\farcry\sourcecode\resourcecompiler\debug\resourcecompiler.tlog\link.command.1.tlog +e:\prj\farcry\sourcecode\resourcecompiler\debug\resourcecompiler.tlog\link.read.1.tlog +e:\prj\farcry\sourcecode\resourcecompiler\debug\resourcecompiler.tlog\link.write.1.tlog diff --git a/ResourceCompiler/Debug/ResourceCompiler.exe.recipe b/ResourceCompiler/Debug/ResourceCompiler.exe.recipe new file mode 100644 index 0000000..091c478 --- /dev/null +++ b/ResourceCompiler/Debug/ResourceCompiler.exe.recipe @@ -0,0 +1,14 @@ + + + + + D:\Games\FC\Bin32\ResourceCompilerPC.dll + + + D:\Games\FC\Bin32\ResourceCompiler.exe + + + + + + \ No newline at end of file diff --git a/ResourceCompiler/Debug/ResourceCompiler.log b/ResourceCompiler/Debug/ResourceCompiler.log new file mode 100644 index 0000000..e69de29 diff --git a/ResourceCompiler/Debug/ResourceCompiler.vcxproj.FileListAbsolute.txt b/ResourceCompiler/Debug/ResourceCompiler.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/ResourceCompiler/Release/ResourceCompiler.Build.CppClean.log b/ResourceCompiler/Release/ResourceCompiler.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/ResourceCompiler/Release/ResourceCompiler.exe.recipe b/ResourceCompiler/Release/ResourceCompiler.exe.recipe new file mode 100644 index 0000000..091c478 --- /dev/null +++ b/ResourceCompiler/Release/ResourceCompiler.exe.recipe @@ -0,0 +1,14 @@ + + + + + D:\Games\FC\Bin32\ResourceCompilerPC.dll + + + D:\Games\FC\Bin32\ResourceCompiler.exe + + + + + + \ No newline at end of file diff --git a/ResourceCompiler/Release/ResourceCompiler.log b/ResourceCompiler/Release/ResourceCompiler.log new file mode 100644 index 0000000..e69de29 diff --git a/ResourceCompiler/Release/ResourceCompiler.vcxproj.FileListAbsolute.txt b/ResourceCompiler/Release/ResourceCompiler.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/ResourceCompiler/ResourceCompiler.cpp b/ResourceCompiler/ResourceCompiler.cpp index dfdcdee..ab38858 100644 --- a/ResourceCompiler/ResourceCompiler.cpp +++ b/ResourceCompiler/ResourceCompiler.cpp @@ -17,6 +17,8 @@ #include "CgfUtils.h" #include +#include + //! Section in rc.ini file for common settings. #define COMMON_SECTION "Common" @@ -720,7 +722,7 @@ void RegisterConvertors( IResourceCompiler *rc ) void TestMatEntityNameTokenizer () { char szMatName[1024]; - while (gets (szMatName)) + while (gets_s (szMatName)) { CMatEntityNameTokenizer mt; mt.tokenize(szMatName); diff --git a/ResourceCompiler/ResourceCompiler.vcproj.vspscc b/ResourceCompiler/ResourceCompiler.vcproj.vspscc index f2c6f7a..3865910 100644 --- a/ResourceCompiler/ResourceCompiler.vcproj.vspscc +++ b/ResourceCompiler/ResourceCompiler.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/ResourceCompiler/ResourceCompiler.vcxproj b/ResourceCompiler/ResourceCompiler.vcxproj new file mode 100644 index 0000000..dbae3a2 --- /dev/null +++ b/ResourceCompiler/ResourceCompiler.vcxproj @@ -0,0 +1,282 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {2F21D2A8-925B-4A73-A32B-D111580614C3} + Perforce Project + + .. + MSSCCI:Perforce SCM + Win32Proj + + + + Application + v143 + MultiByte + true + + + Application + v143 + MultiByte + + + Application + v143 + MultiByte + + + Application + v143 + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Disabled + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + false + true + Use + Level3 + EditAndContinue + + + dbghelp.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + $(OutDir)rc.pdb + Console + MachineX86 + + + + + Full + AnySuitable + true + Size + true + false + ..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_RELEASE;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + Level3 + ProgramDatabase + + + /fixed:no %(AdditionalOptions) + dbghelp.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + Console + true + true + MachineX86 + + + + + Disabled + AnySuitable + ..\CryCommon;%(AdditionalIncludeDirectories) + _AMD64_;WIN64;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + Default + false + MultiThreadedDebugDLL + false + Use + Level3 + ProgramDatabase + + + /MACHINE:AMD64 %(AdditionalOptions) + dbghelp.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + $(OutDir)$(TargetName).pdb + Console + true + NotSet + + + + + Disabled + Default + false + ..\CryCommon;%(AdditionalIncludeDirectories) + _AMD64_;WIN64;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + false + MultiThreadedDLL + false + Use + Level3 + ProgramDatabase + + + /MACHINE:AMD64 %(AdditionalOptions) + dbghelp.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + $(OutDir)$(TargetName).pdb + Console + true + NotSet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {43b9f5ef-c4fc-44ff-beb0-70efe792b6c0} + false + + + + + + \ No newline at end of file diff --git a/ResourceCompiler/ResourceCompiler.vcxproj.filters b/ResourceCompiler/ResourceCompiler.vcxproj.filters new file mode 100644 index 0000000..17b9777 --- /dev/null +++ b/ResourceCompiler/ResourceCompiler.vcxproj.filters @@ -0,0 +1,168 @@ + + + + + {040b84db-267c-4915-a350-0f38dd42dcb9} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + {0302629a-3f55-4a3b-b17b-4325230cf8a3} + h;hpp;hxx;hm;inl;inc + + + {36c9ddbf-7e8d-4c3b-a328-e226d1b27985} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + {3e0687b0-22fb-45b1-ad24-7b3ecb87e92b} + + + {4ae3af0c-e816-45c7-b0ac-e43e1cf8f06e} + + + {81c7511e-8343-4776-b1dc-db7b69c3dd25} + + + {03f5d9ad-c1f3-4a78-9a73-30399ba5ece9} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + NvTriStrip + + + NvTriStrip + + + NvTriStrip + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Interfaces + + + Interfaces + + + Interfaces + + + Interfaces + + + Interfaces + + + NvTriStrip + + + NvTriStrip + + + NvTriStrip + + + NvTriStrip + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + \ No newline at end of file diff --git a/ResourceCompiler/ResourceCompiler.vcxproj.user b/ResourceCompiler/ResourceCompiler.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/ResourceCompiler/ResourceCompiler.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ResourceCompiler/stdafx.h b/ResourceCompiler/stdafx.h index a265483..af36731 100644 --- a/ResourceCompiler/stdafx.h +++ b/ResourceCompiler/stdafx.h @@ -6,6 +6,10 @@ #pragma once #define NOT_USE_CRY_MEMORY_MANAGER +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS + +#define NOSHLWAPI + #include #include #include diff --git a/ResourceCompilerImage/ResourceCompilerImage.vcproj.vspscc b/ResourceCompilerImage/ResourceCompilerImage.vcproj.vspscc index 6cb031b..dcc120f 100644 --- a/ResourceCompilerImage/ResourceCompilerImage.vcproj.vspscc +++ b/ResourceCompilerImage/ResourceCompilerImage.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/ResourceCompilerPC/Release/ResourceCompilerPC.Build.CppClean.log b/ResourceCompilerPC/Release/ResourceCompilerPC.Build.CppClean.log new file mode 100644 index 0000000..e69de29 diff --git a/ResourceCompilerPC/Release/ResourceCompilerPC.dll.recipe b/ResourceCompilerPC/Release/ResourceCompilerPC.dll.recipe new file mode 100644 index 0000000..8f4ce11 --- /dev/null +++ b/ResourceCompilerPC/Release/ResourceCompilerPC.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\Games\FC\Bin32\ResourceCompilerPC.dll + + + + + + \ No newline at end of file diff --git a/ResourceCompilerPC/Release/ResourceCompilerPC.log b/ResourceCompilerPC/Release/ResourceCompilerPC.log new file mode 100644 index 0000000..e69de29 diff --git a/ResourceCompilerPC/Release/ResourceCompilerPC.vcxproj.FileListAbsolute.txt b/ResourceCompilerPC/Release/ResourceCompilerPC.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/ResourceCompilerPC/ResourceCompilerPC.vcproj.vspscc b/ResourceCompilerPC/ResourceCompilerPC.vcproj.vspscc index 876d4c6..0ef2a6f 100644 --- a/ResourceCompilerPC/ResourceCompilerPC.vcproj.vspscc +++ b/ResourceCompilerPC/ResourceCompilerPC.vcproj.vspscc @@ -1,4 +1,4 @@ -"" +"" { "FILE_VERSION" = "9237" "ENLISTMENT_CHOICE" = "NEVER" diff --git a/ResourceCompilerPC/ResourceCompilerPC.vcxproj b/ResourceCompilerPC/ResourceCompilerPC.vcxproj new file mode 100644 index 0000000..dbd3afd --- /dev/null +++ b/ResourceCompilerPC/ResourceCompilerPC.vcxproj @@ -0,0 +1,335 @@ + + + + + Debug64 + Win32 + + + Debug + Win32 + + + Release64 + Win32 + + + Release + Win32 + + + + 17.0 + {43B9F5EF-C4FC-44FF-BEB0-70EFE792B6C0} + SAK + SAK + SAK + SAK + Win32Proj + + + + DynamicLibrary + v143 + MultiByte + true + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + DynamicLibrary + v143 + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>17.0.33516.290 + + + D:\Games\FC\Bin32\ + Debug\ + true + + + D:\Games\FC\Bin32\ + Release\ + false + + + D:\Games\FC\Bin32\ + Debug64\ + true + + + D:\Games\FC\Bin32\ + Release64\ + false + + + + Disabled + ..\ResourceCompiler;..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;RESOURCECOMPILERPC_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + false + true + Use + Level3 + EditAndContinue + + + dbghelp.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + ResourceCompilerPlugin.def + true + $(OutDir)ResourceCompilerPC.pdb + Windows + $(OutDir)ResourceCompilerPC.lib + MachineX86 + + + + + Full + AnySuitable + true + Size + true + false + ..\ResourceCompiler;..\CryCommon;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;RESOURCECOMPILERPC_EXPORTS;_RELEASE;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + false + NotSet + Use + Level3 + ProgramDatabase + + + dbghelp.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + ResourceCompilerPlugin.def + true + Windows + true + true + $(OutDir)ResourceCompilerPC.lib + MachineX86 + + + + + Disabled + ..\ResourceCompiler;..\CryCommon;%(AdditionalIncludeDirectories) + _AMD64_;WIN64;WIN32;_DEBUG;_WINDOWS;_USRDLL;RESOURCECOMPILERPC_EXPORTS;%(PreprocessorDefinitions) + Default + false + MultiThreadedDebugDLL + false + Use + Level3 + ProgramDatabase + + + /MACHINE:AMD64 %(AdditionalOptions) + dbghelp.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + ResourceCompilerPlugin.def + true + $(OutDir)$(TargetName).pdb + Windows + true + $(OutDir)$(ProjectName)64.lib + NotSet + + + + + Disabled + Default + false + ..\ResourceCompiler;..\CryCommon;%(AdditionalIncludeDirectories) + _AMD64_;WIN64;WIN32;NDEBUG;_WINDOWS;_USRDLL;RESOURCECOMPILERPC_EXPORTS;%(PreprocessorDefinitions) + true + Default + false + MultiThreadedDLL + false + Use + Level3 + ProgramDatabase + + + /MACHINE:AMD64 %(AdditionalOptions) + dbghelp.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + ResourceCompilerPlugin.def + true + $(OutDir)$(TargetName).pdb + Windows + true + true + true + $(OutDir)$(ProjectName)64.lib + NotSet + + + + + Compiling %(Filename) + ml64 /c /Fl"$(OutDir)%(Filename).cod" /Fo"$(OutDir)%(Filename).obj" %(FullPath) + + $(OutDir)%(Filename).obj;%(Outputs) + true + Compiling %(Filename) + ml64 /c /Fl"$(OutDir)%(Filename).cod" /Fo"$(OutDir)%(Filename).obj" %(FullPath) + + $(OutDir)%(Filename).obj;%(Outputs) + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ResourceCompilerPC/ResourceCompilerPC.vcxproj.filters b/ResourceCompilerPC/ResourceCompilerPC.vcxproj.filters new file mode 100644 index 0000000..2e84fac --- /dev/null +++ b/ResourceCompilerPC/ResourceCompilerPC.vcxproj.filters @@ -0,0 +1,296 @@ + + + + + {f04802a1-1f89-4962-9140-45304ecf0b6d} + + + {99c37519-08b8-4c9f-99e7-34f77fd1ea81} + + + {bc17eeb4-76cb-4411-8f33-b1989cebc18c} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;h;hpp;hxx;hm;inl;inc + + + {ed607f54-5f79-4ca3-bbd9-43cc3d2b0ecb} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + {e5dd0fad-3583-49de-9a50-7c6fb67d64f0} + + + {2984b69b-091d-4567-a8cc-61b34eb53894} + + + {c2f025f4-03bf-438e-a7e8-c87763a74c13} + + + {c23bf491-98ab-4558-a23a-8b9a93f99eac} + + + {20cf7241-7257-47cc-a829-941674c05000} + + + + + Resource Files + + + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin\DataSources + + + Front-End + + + Front-End + + + Front-End + + + Front-End + + + Front-End + + + Support + + + Shared with Animation + + + Shared with Animation + + + Shared with Animation + + + Shared with Animation + + + Shared with Animation + + + Shared with Animation + + + NvTriStrip + + + NvTriStrip + + + Stencil Shadows + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin + + + Skin\DataSources + + + Front-End + + + Front-End + + + Front-End + + + Front-End + + + Front-End + + + Support + + + Support + + + Support + + + Support + + + Support + + + Shared with Animation + + + Shared with Animation + + + Shared with Animation + + + Shared with Animation + + + Shared with Animation + + + Shared with Animation + + + Shared with Animation + + + Shared with Animation + + + NvTriStrip + + + NvTriStrip + + + NvTriStrip + + + NvTriStrip + + + Stencil Shadows + + + Stencil Shadows + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + StatCGFCompiler + + + + + Resource Files + + + + + + + + Skin + + + \ No newline at end of file diff --git a/ResourceCompilerPC/ResourceCompilerPC.vcxproj.user b/ResourceCompilerPC/ResourceCompilerPC.vcxproj.user new file mode 100644 index 0000000..824d5a9 --- /dev/null +++ b/ResourceCompilerPC/ResourceCompilerPC.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ResourceCompilerPC/stdafx.h b/ResourceCompilerPC/stdafx.h index 174ae6a..99aca01 100644 --- a/ResourceCompilerPC/stdafx.h +++ b/ResourceCompilerPC/stdafx.h @@ -5,6 +5,10 @@ #pragma once #define NOT_USE_CRY_MEMORY_MANAGER +#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS + +#define NOSHLWAPI + #include // Windows Header Files: #ifdef WIN64