removed WP8 project files
|
@ -1,247 +0,0 @@
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 2013
|
|
||||||
VisualStudioVersion = 12.0.30723.0
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.wp8\libSpine.vcxproj", "{7D4FC6EB-9497-4804-98F3-3EAEDC896154}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D", "..\external\Box2D\proj.wp8\Box2D.vcxproj", "{C55734A3-702C-4FA1-B950-32C8E169302F}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-tests-wp8-xaml", "cpp-tests-wp8-xaml", "{671E147E-1DBD-41FC-99B3-2119CA828C8A}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cpp-tests", "..\tests\cpp-tests\proj.wp8-xaml\cpp-tests\cpp-tests.csproj", "{60D53713-1675-4466-81DC-D67A031C3D21}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9} = {86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-testsComponent", "..\tests\cpp-tests\proj.wp8-xaml\cpp-testsComponent\cpp-testsComponent.vcxproj", "{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-empty-test-wp8-xaml", "cpp-empty-test-wp8-xaml", "{2C306303-EB4F-4058-8CA0-1F28A4FECE39}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cpp-empty-test", "..\tests\cpp-empty-test\proj-wp8-xaml\cpp-empty-test\cpp-empty-test.csproj", "{5921FE12-7EF3-4847-8453-42EF286DDBE7}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2} = {F5D665F8-AE19-4F3F-99A7-230A1E8305D2}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-empty-testComponent", "..\tests\cpp-empty-test\proj-wp8-xaml\cpp-empty-testComponent\cpp-empty-testComponent.vcxproj", "{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CopyTemplateFiles", "..\cocos\platform\wp8-xaml\CopyTemplateFiles.vcxproj", "{271FEE84-9198-4C26-8567-4247C563B0B1}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7} = {5921FE12-7EF3-4847-8453-42EF286DDBE7}
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21} = {60D53713-1675-4466-81DC-D67A031C3D21}
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9} = {86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2} = {F5D665F8-AE19-4F3F-99A7-230A1E8305D2}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d_wp8", "..\cocos\2d\libcocos2d_wp8.vcxproj", "{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Debug|ARM = Debug|ARM
|
|
||||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
|
||||||
Debug|Win32 = Debug|Win32
|
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Debug|x86 = Debug|x86
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
Release|ARM = Release|ARM
|
|
||||||
Release|Mixed Platforms = Release|Mixed Platforms
|
|
||||||
Release|Win32 = Release|Win32
|
|
||||||
Release|x64 = Release|x64
|
|
||||||
Release|x86 = Release|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Debug|x64.ActiveCfg = Debug|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Release|Any CPU.ActiveCfg = Release|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Release|Mixed Platforms.Build.0 = Release|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Release|x64.ActiveCfg = Release|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{7D4FC6EB-9497-4804-98F3-3EAEDC896154}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Debug|x64.ActiveCfg = Debug|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|Any CPU.ActiveCfg = Release|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|Mixed Platforms.Build.0 = Release|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|x64.ActiveCfg = Release|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{C55734A3-702C-4FA1-B950-32C8E169302F}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|ARM.Deploy.0 = Debug|ARM
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|Mixed Platforms.Deploy.0 = Debug|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|Win32.ActiveCfg = Debug|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|Win32.Build.0 = Debug|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|Win32.Deploy.0 = Debug|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Debug|x86.Deploy.0 = Debug|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|ARM.Deploy.0 = Release|ARM
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|Mixed Platforms.Build.0 = Release|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|Mixed Platforms.Deploy.0 = Release|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|Win32.ActiveCfg = Release|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|Win32.Build.0 = Release|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|Win32.Deploy.0 = Release|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|x86.ActiveCfg = Release|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|x86.Build.0 = Release|x86
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21}.Release|x86.Deploy.0 = Release|x86
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Debug|x64.ActiveCfg = Debug|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Release|Any CPU.ActiveCfg = Release|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Release|Mixed Platforms.Build.0 = Release|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Release|x64.ActiveCfg = Release|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|ARM.Deploy.0 = Debug|ARM
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|Mixed Platforms.Deploy.0 = Debug|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|Win32.ActiveCfg = Debug|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|Win32.Build.0 = Debug|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|Win32.Deploy.0 = Debug|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Debug|x86.Deploy.0 = Debug|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|ARM.Deploy.0 = Release|ARM
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|Mixed Platforms.Build.0 = Release|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|Mixed Platforms.Deploy.0 = Release|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|Win32.ActiveCfg = Release|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|Win32.Build.0 = Release|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|Win32.Deploy.0 = Release|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|x86.ActiveCfg = Release|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|x86.Build.0 = Release|x86
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7}.Release|x86.Deploy.0 = Release|x86
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Debug|x64.ActiveCfg = Debug|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Release|Any CPU.ActiveCfg = Release|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Release|Mixed Platforms.Build.0 = Release|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Release|x64.ActiveCfg = Release|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Debug|x64.ActiveCfg = Debug|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Release|Any CPU.ActiveCfg = Release|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Release|Mixed Platforms.Build.0 = Release|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Release|x64.ActiveCfg = Release|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{271FEE84-9198-4C26-8567-4247C563B0B1}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Debug|x64.ActiveCfg = Debug|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Release|Any CPU.ActiveCfg = Release|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Release|Mixed Platforms.Build.0 = Release|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Release|x64.ActiveCfg = Release|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{7C5DBC42-27F6-4978-AABC-02BA77E2A7F0}.Release|x86.Build.0 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(NestedProjects) = preSolution
|
|
||||||
{60D53713-1675-4466-81DC-D67A031C3D21} = {671E147E-1DBD-41FC-99B3-2119CA828C8A}
|
|
||||||
{86B2C23C-3A6C-4C4E-AB0E-16A8CC1523E9} = {671E147E-1DBD-41FC-99B3-2119CA828C8A}
|
|
||||||
{5921FE12-7EF3-4847-8453-42EF286DDBE7} = {2C306303-EB4F-4058-8CA0-1F28A4FECE39}
|
|
||||||
{F5D665F8-AE19-4F3F-99A7-230A1E8305D2} = {2C306303-EB4F-4058-8CA0-1F28A4FECE39}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
|
@ -1,63 +0,0 @@
|
||||||
set IN_DIR=.\..\..\..\angle\src\WP8\redist\vs2012\ARM\Release
|
|
||||||
|
|
||||||
set OUT_DIR=.\..\..\external\wp8-specific\angle\prebuilt\ARM\
|
|
||||||
xcopy "%IN_DIR%\libGLESv2_phone\libGLESv2_phone.dll" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libGLESv2_phone\libGLESv2_phone.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libEGL_phone\libEGL_phone.dll" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libEGL_phone\libEGL_phone.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\esUtil_phone\esUtil_phone.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set IN_DIR=.\..\..\..\angle\src\WP8\redist\vs2012\Win32\Release
|
|
||||||
|
|
||||||
set OUT_DIR=.\..\..\external\wp8-specific\angle\prebuilt\Win32\
|
|
||||||
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libGLESv2_phone\libGLESv2_phone.dll" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libGLESv2_phone\libGLESv2_phone.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libEGL_phone\libEGL_phone.dll" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libEGL_phone\libEGL_phone.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\esUtil_phone\esUtil_phone.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set IN_DIR=.\..\..\..\angle\src\WinRT\redist\vs2013\ARM\Release\
|
|
||||||
set OUT_DIR=.\..\..\external\winrt-specific\angle\prebuilt\ARM\
|
|
||||||
xcopy "%IN_DIR%\libGLESv2_winrt_2013\libGLESv2.dll" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libGLESv2_winrt_2013\libGLESv2.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libEGL_winrt_2013\libEGL.dll" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libEGL_winrt_2013\libEGL.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\esUtil_winrt_2013\esUtil.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
|
|
||||||
set IN_DIR=.\..\..\..\angle\src\WinRT\redist\vs2013\Win32\Release\
|
|
||||||
set OUT_DIR=.\..\..\external\winrt-specific\angle\prebuilt\Win32\
|
|
||||||
xcopy "%IN_DIR%\libGLESv2_winrt_2013\libGLESv2.dll" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libGLESv2_winrt_2013\libGLESv2.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libEGL_winrt_2013\libEGL.dll" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\libEGL_winrt_2013\libEGL.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
xcopy "%IN_DIR%\esUtil_winrt_2013\esUtil.lib" "%OUT_DIR%" /iycq
|
|
||||||
|
|
||||||
|
|
||||||
set OUT_DIR=.\..\..\external\winrt-specific\angle\include
|
|
||||||
xcopy ".\..\..\..\angle\include" "%OUT_DIR%" /eiycq
|
|
||||||
xcopy ".\..\..\..\angle\src\common\winrtangle.h" "%OUT_DIR%" /iycq
|
|
||||||
xcopy ".\..\..\..\angle\samples\gles2_book\Common\esUtil.h" "%OUT_DIR%" /iycq
|
|
||||||
|
|
|
@ -1,83 +0,0 @@
|
||||||
. ".\scripts\createsln.ps1"
|
|
||||||
. ".\scripts\converterutils.ps1"
|
|
||||||
. ".\scripts\winrtconverter.ps1"
|
|
||||||
|
|
||||||
|
|
||||||
$workingDir = $PSScriptRoot
|
|
||||||
|
|
||||||
|
|
||||||
$cocosDir = join-path $workingDir "..\..\cocos" -Resolve
|
|
||||||
$libGUI = join-path $cocosDir "\gui\proj.wp8\libGUI.vcxproj"
|
|
||||||
$in = join-path $cocosDir "\gui\proj.win32\libGUI.vcxproj"
|
|
||||||
#WinrtConverter $in $libGUI "wp8" >> $null
|
|
||||||
|
|
||||||
$c2dLib = join-path $cocosDir "\2d\cocos2d_wp8.vcxproj"
|
|
||||||
$in = join-path $cocosDir "\2d\cocos2d.vcxproj"
|
|
||||||
#WinrtConverter $in $c2dLib "wp8" >> $null
|
|
||||||
|
|
||||||
$c2dLib = join-path $cocosDir "\2d\cocos2d_winrt.vcxproj"
|
|
||||||
$in = join-path $cocosDir "\2d\cocos2d.vcxproj"
|
|
||||||
#WinrtConverter $in $c2dLib "winrt" >> $null
|
|
||||||
|
|
||||||
$libNetwork = join-path $cocosDir "\network\proj.wp8\libNetwork.vcxproj"
|
|
||||||
$in = join-path $cocosDir "\network\proj.win32\libNetwork.vcxproj"
|
|
||||||
#WinrtConverter $in $libNetwork "wp8" >> $null
|
|
||||||
|
|
||||||
$libLocalStorage = join-path $cocosDir "\storage\local-storage\proj.wp8\libLocalStorage.vcxproj"
|
|
||||||
$in = join-path $cocosDir "\storage\local-storage\proj.win32\libLocalStorage.vcxproj"
|
|
||||||
#WinrtConverter $in $libLocalStorage "wp8" >> $null
|
|
||||||
|
|
||||||
$libAudio = join-path $cocosDir "\audio\proj.wp8\CocosDenshion.vcxproj"
|
|
||||||
$in = join-path $cocosDir "\audio\proj.win32\CocosDenshion.vcxproj"
|
|
||||||
#WinrtConverter $in $libAudio "wp8" >> $null
|
|
||||||
|
|
||||||
$libSpine = join-path $cocosDir "\editor-support\spine\proj.wp8\libSpine.vcxproj"
|
|
||||||
$in = join-path $cocosDir "\editor-support\spine\proj.win32\libSpine.vcxproj"
|
|
||||||
#WinrtConverter $in $libSpine "wp8" >> $null
|
|
||||||
|
|
||||||
$libCocosStudio = join-path $cocosDir "\editor-support\cocostudio\proj.wp8\libCocosStudio.vcxproj"
|
|
||||||
$in = join-path $cocosDir "\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj"
|
|
||||||
#WinrtConverter $in $libCocosStudio "wp8" >> $null
|
|
||||||
|
|
||||||
$libCocosBuilder = join-path $cocosDir "\editor-support\cocosbuilder\proj.wp8\libCocosBuilder.vcxproj"
|
|
||||||
$in = join-path $cocosDir "\editor-support\cocosbuilder\proj.win32\libCocosBuilder.vcxproj"
|
|
||||||
#WinrtConverter $in $libCocosBuilder "wp8" >> $null
|
|
||||||
|
|
||||||
$extensionsDir = join-path $workingDir "..\..\extensions" -Resolve
|
|
||||||
$libExtensions = join-path $extensionsDir "\proj.wp8\libExtensions.vcxproj"
|
|
||||||
#$in = join-path $extensionsDir "\proj.win32\libExtensions.vcxproj"
|
|
||||||
#WinrtConverter $in $libExtensions "wp8" >> $null
|
|
||||||
|
|
||||||
$externalDir = join-path $workingDir "..\..\external" -Resolve
|
|
||||||
$box2dDir = join-path $workingDir "..\..\external\Box2D" -Resolve
|
|
||||||
$libBox2d = join-path $box2dDir "\proj.wp8\Box2D.vcxproj"
|
|
||||||
$in = join-path $box2dDir "\proj.win32\Box2D.vcxproj"
|
|
||||||
#WinrtConverter $in $libBox2d "wp8" >> $null
|
|
||||||
|
|
||||||
$freetypeDir = join-path $workingDir "..\..\external\freetype2\include\wp8" -Resolve
|
|
||||||
$libFreetype = join-path $freetypeDir "\freetype-2.5.3\builds\windows\vc2010\freetype_wp8.vcxproj"
|
|
||||||
$in = join-path $freetypeDir "\freetype-2.5.3\builds\windows\vc2010\freetype.vcxproj"
|
|
||||||
#WinrtConverter $in $libFreetype "wp8" >> $null
|
|
||||||
|
|
||||||
|
|
||||||
$chipmunkDir = join-path $workingDir "..\..\external\chipmunk" -Resolve
|
|
||||||
$libChipmunk = join-path $chipmunkDir "\proj.wp8\chipmunk.vcxproj"
|
|
||||||
$in = join-path $chipmunkDir "\proj.win32\chipmunk.vcxproj"
|
|
||||||
#WinrtConverter $in $libChipmunk "wp8" >> $null
|
|
||||||
|
|
||||||
$chipmunkDir = join-path $workingDir "..\..\external\chipmunk" -Resolve
|
|
||||||
$libChipmunk = join-path $chipmunkDir "\proj.winrt\chipmunk.vcxproj"
|
|
||||||
$in = join-path $chipmunkDir "\proj.win32\chipmunk.vcxproj"
|
|
||||||
#WinrtConverter $in $libChipmunk "winrt" >> $null
|
|
||||||
|
|
||||||
|
|
||||||
$testDir = join-path $workingDir "..\..\tests" -Resolve
|
|
||||||
$testApp = join-path $testDir "\proj.wp8\TestCpp.vcxproj"
|
|
||||||
$in = join-path $testDir "\proj.win32\TestCpp.vcxproj"
|
|
||||||
#WinrtConverter $in $testApp "wp8" >> $null
|
|
||||||
|
|
||||||
#create opencv sln
|
|
||||||
$solutionDir = join-path $workingDir "..\" -Resolve
|
|
||||||
$solution = join-path $solutionDir "cocos2d-wp8.vc2012.sln"
|
|
||||||
#CreateSolutionFile $solution "wp8" ($c2dLib, $libGUI, $libSpine, $libCocosStudio, $libCocosBuilder, $libExtensions, $libBox2d, $libChipmunk, $libLocalStorage, $libAudio, $testApp)
|
|
||||||
|
|
|
@ -1,157 +0,0 @@
|
||||||
. ".\scripts\createsln.ps1"
|
|
||||||
|
|
||||||
#use MSBuild namespace
|
|
||||||
$ms = 'http://schemas.microsoft.com/developer/msbuild/2003'
|
|
||||||
$ns = @{ ms = $ms }
|
|
||||||
|
|
||||||
Function GetDirectoryName($path)
|
|
||||||
{
|
|
||||||
return [System.IO.Path]::GetFileName($path)
|
|
||||||
}
|
|
||||||
|
|
||||||
Function GetFileName($path)
|
|
||||||
{
|
|
||||||
return [System.IO.Path]::GetFileName($path)
|
|
||||||
}
|
|
||||||
|
|
||||||
Function Get-RelativePath($Folder, $FilePath)
|
|
||||||
{
|
|
||||||
Write-Verbose "Resolving paths relative to '$Folder'"
|
|
||||||
$from = $Folder = split-path $Folder -NoQualifier -Resolve:$Resolve
|
|
||||||
$to = $filePath = split-path $filePath -NoQualifier -Resolve:$Resolve
|
|
||||||
|
|
||||||
while($from -and $to -and ($from -ne $to)) {
|
|
||||||
if($from.Length -gt $to.Length) {
|
|
||||||
$from = split-path $from
|
|
||||||
} else {
|
|
||||||
$to = split-path $to
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$filepath = $filepath -replace "^"+[regex]::Escape($to)+"\\"
|
|
||||||
$from = $Folder
|
|
||||||
while($from -and $to -and $from -gt $to ) {
|
|
||||||
$from = split-path $from
|
|
||||||
$filepath = join-path ".." $filepath
|
|
||||||
}
|
|
||||||
return $filepath
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Function ReplaceText($path, $text, $replace)
|
|
||||||
{
|
|
||||||
(Get-Content $path) |
|
|
||||||
Foreach-Object {$_ -replace $text, $replace} |
|
|
||||||
Set-Content $path
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function LoadXmlFile($path)
|
|
||||||
{
|
|
||||||
$xml = New-Object -TypeName XML
|
|
||||||
$xml.Load($path)
|
|
||||||
return $xml
|
|
||||||
}
|
|
||||||
|
|
||||||
Function AddElement($xml, $root, $name, $value, $namespace)
|
|
||||||
{
|
|
||||||
$newEl = $xml.CreateElement($name, $namespace)
|
|
||||||
$xmlText = $xml.CreateTextNode($value)
|
|
||||||
$newEl.AppendChild($xmlText)
|
|
||||||
$root.AppendChild($newEl)
|
|
||||||
return $newEl
|
|
||||||
}
|
|
||||||
|
|
||||||
Function GetProjectGlobals($path, $namespace)
|
|
||||||
{
|
|
||||||
$xml = LoadXmlFile($path)
|
|
||||||
$globals = Select-XML -Xml $xml -XPath '//ms:PropertyGroup[@Label="Globals"]' -Namespace $namespace
|
|
||||||
return $globals
|
|
||||||
}
|
|
||||||
|
|
||||||
Function AddProjectReference($toProject, $projects)
|
|
||||||
{
|
|
||||||
$xml = LoadXmlFile($toProject)
|
|
||||||
$xdNS = $xml.DocumentElement.NamespaceURI
|
|
||||||
|
|
||||||
foreach($fromProject in $projects)
|
|
||||||
{
|
|
||||||
$globals = GetProjectGlobals $fromProject $ns
|
|
||||||
$itemGroup = $xml.CreateElement("ItemGroup", $xdNS)
|
|
||||||
$projectReference = $xml.CreateElement("ProjectReference", $xdNS)
|
|
||||||
$project = $xml.CreateElement("Project", $xdNS)
|
|
||||||
$xmlText = $xml.CreateTextNode($globals.Node.ProjectGuid)
|
|
||||||
$project.AppendChild($xmlText)
|
|
||||||
$projectReference.AppendChild($project)
|
|
||||||
|
|
||||||
$include = $xml.CreateAttribute("Include")
|
|
||||||
|
|
||||||
$dir = Split-Path -parent $toProject
|
|
||||||
$include.Value = Get-RelativePath $dir $fromProject
|
|
||||||
$projectReference.Attributes.Append($include)
|
|
||||||
|
|
||||||
|
|
||||||
$itemGroup.AppendChild($projectReference)
|
|
||||||
|
|
||||||
$root = Select-XML -Xml $xml -XPath '//ms:Project[@DefaultTargets="Build"]' -Namespace $ns
|
|
||||||
$root.Node.AppendChild($itemGroup)
|
|
||||||
}
|
|
||||||
$xml.Save($toProject)
|
|
||||||
}
|
|
||||||
|
|
||||||
Function AddPreprocessorDefine($xml, $define)
|
|
||||||
{
|
|
||||||
foreach($item in (Select-XML -Xml $xml -XPath '//ms:ItemDefinitionGroup' -Namespace $ns))
|
|
||||||
{
|
|
||||||
if(!($item.Node.ClCompile.PreprocessorDefinitions -match ($define + ';')))
|
|
||||||
{
|
|
||||||
$item.Node.ClCompile.PreprocessorDefinitions = $define + ";" + $item.Node.ClCompile.PreprocessorDefinitions
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<#
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\3rdparty\zlib\zlib.vcxproj">
|
|
||||||
<Project>{c38fab57-9dec-4546-bd9a-6c1dbba6c077}</Project>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
#>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function RemoveNode($xml, $xpath)
|
|
||||||
{
|
|
||||||
$item = Select-XML -Xml $xml -XPath $xpath -Namespace $ns
|
|
||||||
if($item)
|
|
||||||
{
|
|
||||||
$item.Node.ParentNode.RemoveChild($item.node)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Function RemoveProjectFile($path, $filename)
|
|
||||||
{
|
|
||||||
$xml = LoadXmlFile($path)
|
|
||||||
$xpath = '//ms:ClCompile [@Include="' + $filename + '"]'
|
|
||||||
RemoveNode $xml $xpath
|
|
||||||
$xml.Save($path)
|
|
||||||
$xml = LoadXmlFile($path + ".filters")
|
|
||||||
RemoveNode $xml $xpath
|
|
||||||
$xml.Save($path + ".filters")
|
|
||||||
}
|
|
||||||
|
|
||||||
Function CreateSolutionFile($path, $platform, $projects)
|
|
||||||
{
|
|
||||||
$solution = CreateSolution
|
|
||||||
$solution.solutionDir = Split-Path -parent $path
|
|
||||||
foreach($project in $projects)
|
|
||||||
{
|
|
||||||
$solution.AddProject($project)
|
|
||||||
}
|
|
||||||
$solution.Save($path, $platform)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,98 +0,0 @@
|
||||||
Function CreateSolution()
|
|
||||||
{
|
|
||||||
$solution = New-Module -AsCustomObject -ScriptBlock {
|
|
||||||
. ".\scripts\converterutils.ps1"
|
|
||||||
|
|
||||||
#use MSBuild namespace
|
|
||||||
$ms = 'http://schemas.microsoft.com/developer/msbuild/2003'
|
|
||||||
$ns = @{ ms = $ms }
|
|
||||||
|
|
||||||
$projects = @()
|
|
||||||
$solutionDir = ""
|
|
||||||
|
|
||||||
|
|
||||||
Function AddProject($path) {
|
|
||||||
$globals = GetProjectGlobals $path $ns
|
|
||||||
$guid = $globals.Node.ProjectGuid
|
|
||||||
$relativePath = Get-RelativePath $this.solutionDir $path
|
|
||||||
$project = New-Object –TypeName PSObject
|
|
||||||
$project | Add-Member –MemberType NoteProperty –Name guid –Value $globals.Node.ProjectGuid
|
|
||||||
$project | Add-Member –MemberType NoteProperty –Name path –Value $relativePath
|
|
||||||
if($globals.Node.ProjectName)
|
|
||||||
{
|
|
||||||
$project | Add-Member –MemberType NoteProperty –Name name –Value $globals.Node.ProjectName
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$project | Add-Member –MemberType NoteProperty –Name name –Value $globals.Node.RootNamespace
|
|
||||||
}
|
|
||||||
|
|
||||||
$this.projects += $project
|
|
||||||
}
|
|
||||||
|
|
||||||
Function Save($path, $platform) {
|
|
||||||
$output = New-Item $path -type file -force
|
|
||||||
|
|
||||||
if($platform -eq "winrt")
|
|
||||||
{
|
|
||||||
$template = join-path $PSScriptRoot "templates\winrt_sln_header_template.txt"
|
|
||||||
}
|
|
||||||
elseif($platform -eq "wp8")
|
|
||||||
{
|
|
||||||
$template = join-path $PSScriptRoot "templates\wp8_sln_header_template.txt"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw "Unknown platform argument (winrt or wp8)"
|
|
||||||
}
|
|
||||||
|
|
||||||
(Get-Content $template) |
|
|
||||||
Add-Content $path
|
|
||||||
|
|
||||||
foreach($project in $this.projects)
|
|
||||||
{
|
|
||||||
$line = 'Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "' + $project.name + '", "' + $project.path + '", "' + $project.guid + '"'
|
|
||||||
#Add-Content $path 'Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opencv_core", "opencv_core.vcxproj", "{8F928FE0-8A06-4F93-99FE-53B9C7A006CA}"'
|
|
||||||
Add-Content $path $line
|
|
||||||
Add-Content $path 'EndProject'
|
|
||||||
}
|
|
||||||
|
|
||||||
$template = join-path $PSScriptRoot "templates\global_start_template.txt"
|
|
||||||
(Get-Content $template) |
|
|
||||||
Add-Content $path
|
|
||||||
|
|
||||||
$template = join-path $PSScriptRoot "templates\globalsection_template.txt"
|
|
||||||
foreach($project in $this.projects)
|
|
||||||
{
|
|
||||||
(Get-Content $template) |
|
|
||||||
Foreach-Object {$_ -replace "REPLACE_GUID", $project.guid} |
|
|
||||||
Add-Content $path
|
|
||||||
}
|
|
||||||
|
|
||||||
$template = join-path $PSScriptRoot "templates\global_end_template.txt"
|
|
||||||
(Get-Content $template) |
|
|
||||||
Add-Content $path
|
|
||||||
}
|
|
||||||
|
|
||||||
Export-ModuleMember -Variable * -Function *
|
|
||||||
}
|
|
||||||
return $solution
|
|
||||||
}
|
|
||||||
|
|
||||||
<#
|
|
||||||
$solutionDir = join-path $WorkingDir ".\modules\core"
|
|
||||||
$path = join-path $solutionDir "opencv_core.vcxproj"
|
|
||||||
$output = join-path $solutionDir "opencv_core2.sln"
|
|
||||||
|
|
||||||
|
|
||||||
$solution = CreateSolution
|
|
||||||
$solution.solutionDir = $solutionDir
|
|
||||||
$solution.AddProject($path)
|
|
||||||
|
|
||||||
$path = join-path $WorkingDir ".\3rdparty\zlib\zlib.vcxproj"
|
|
||||||
$solution.AddProject($path)
|
|
||||||
|
|
||||||
$solution.Save($output)
|
|
||||||
notepad $output
|
|
||||||
#>
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
|
@ -1,10 +0,0 @@
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|ARM = Debug|ARM
|
|
||||||
Debug|Win32 = Debug|Win32
|
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Release|ARM = Release|ARM
|
|
||||||
Release|Win32 = Release|Win32
|
|
||||||
Release|x64 = Release|x64
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
|
@ -1,12 +0,0 @@
|
||||||
REPLACE_GUID.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
REPLACE_GUID.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
REPLACE_GUID.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
REPLACE_GUID.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
REPLACE_GUID.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
REPLACE_GUID.Debug|x64.Build.0 = Debug|x64
|
|
||||||
REPLACE_GUID.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
REPLACE_GUID.Release|ARM.Build.0 = Release|ARM
|
|
||||||
REPLACE_GUID.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
REPLACE_GUID.Release|Win32.Build.0 = Release|Win32
|
|
||||||
REPLACE_GUID.Release|x64.ActiveCfg = Release|x64
|
|
||||||
REPLACE_GUID.Release|x64.Build.0 = Release|x64
|
|
|
@ -1,188 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|ARM">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|ARM">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{9c7946f4-84fe-4b1c-b715-50083798b41c}</ProjectGuid>
|
|
||||||
<Keyword>Win32Proj</Keyword>
|
|
||||||
<ProjectName>Dll1</ProjectName>
|
|
||||||
<RootNamespace>Dll1</RootNamespace>
|
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
|
||||||
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
|
|
||||||
<AppContainerApplication>true</AppContainerApplication>
|
|
||||||
<ApplicationType>Windows Store</ApplicationType>
|
|
||||||
<ApplicationTypeRevision>8.1</ApplicationTypeRevision>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
|
@ -1,188 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|ARM">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|ARM">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{8597d6ff-2d26-4f86-a7d4-72d102a7a8b6}</ProjectGuid>
|
|
||||||
<Keyword>Win32Proj</Keyword>
|
|
||||||
<ProjectName>WinRTStatic</ProjectName>
|
|
||||||
<RootNamespace>WinRTStatic</RootNamespace>
|
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
|
||||||
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
|
|
||||||
<AppContainerApplication>true</AppContainerApplication>
|
|
||||||
<ApplicationType>Windows Store</ApplicationType>
|
|
||||||
<ApplicationTypeRevision>8.1</ApplicationTypeRevision>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
|
@ -1,4 +0,0 @@
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 2013
|
|
||||||
VisualStudioVersion = 12.0.21005.1
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
|
@ -1,135 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|ARM">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|ARM">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{03008f82-0317-416a-88d1-068f2c3158e4}</ProjectGuid>
|
|
||||||
<RootNamespace>PhoneDLL1</RootNamespace>
|
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
|
||||||
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
<IgnoreImportLibrary>false</IgnoreImportLibrary>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Windows">
|
|
||||||
<IsWinMDFile>true</IsWinMDFile>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="platform.winmd">
|
|
||||||
<IsWinMDFile>true</IsWinMDFile>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
|
@ -1,119 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|ARM">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|ARM">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{5c48b0d3-dcad-4bfd-a77f-0dac7316f57a}</ProjectGuid>
|
|
||||||
<RootNamespace>PhoneLib1</RootNamespace>
|
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
|
||||||
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Windows">
|
|
||||||
<IsWinMDFile>true</IsWinMDFile>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="platform.winmd">
|
|
||||||
<IsWinMDFile>true</IsWinMDFile>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
|
@ -1,2 +0,0 @@
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 2012
|
|
|
@ -1,259 +0,0 @@
|
||||||
. ".\scripts\converterutils.ps1"
|
|
||||||
|
|
||||||
#use MSBuild namespace
|
|
||||||
$ms = 'http://schemas.microsoft.com/developer/msbuild/2003'
|
|
||||||
$ns = @{ ms = $ms }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function ConvertAdditionalIncludesToRelativePaths($paths, $folder)
|
|
||||||
{
|
|
||||||
$result = ""
|
|
||||||
$tokens = $paths.replace(' ','').split(';')
|
|
||||||
foreach($token in $tokens)
|
|
||||||
{
|
|
||||||
if($token -ne "%(AdditionalIncludeDirectories)")
|
|
||||||
{
|
|
||||||
$result += (Get-RelativePath $folder $token) + ';'
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$result += "%(AdditionalIncludeDirectories);"
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return $result
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function WinrtConverter($inFile, $outFile, $platform)
|
|
||||||
{
|
|
||||||
$InputDirPath = Split-Path -parent $inFile
|
|
||||||
$InputDir = [System.IO.Path]::GetFileNameWithoutExtension($InputDirPath)
|
|
||||||
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($inFile)
|
|
||||||
$OutDir = Split-Path -parent $outFile
|
|
||||||
|
|
||||||
#create output dir
|
|
||||||
New-Item -ItemType Directory -Force -Path $OutDir
|
|
||||||
|
|
||||||
<#
|
|
||||||
Try to load the output file.
|
|
||||||
If successful, copy the guid out of the globals section
|
|
||||||
#>
|
|
||||||
|
|
||||||
$guid =$null
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$xml = New-Object -TypeName XML
|
|
||||||
$xml.Load($outFile)
|
|
||||||
$globals = Select-XML -Xml $xml -XPath '//ms:PropertyGroup[@Label="Globals"]' -Namespace $ns
|
|
||||||
$guid = $globals.Node.ProjectGuid
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
$guid = '{' + [guid]::NewGuid().toString().ToUpper() + '}'
|
|
||||||
}
|
|
||||||
|
|
||||||
# load input file into an XML object:
|
|
||||||
$xml_win32 = New-Object -TypeName XML
|
|
||||||
$xml_win32.Load($inFile)
|
|
||||||
|
|
||||||
$configs = Select-XML -Xml $xml_win32 -XPath '//ms:PropertyGroup[@Label="Configuration"]' -Namespace $ns
|
|
||||||
|
|
||||||
$Template = $null
|
|
||||||
|
|
||||||
if($platform -eq "winrt")
|
|
||||||
{
|
|
||||||
if($configs[0].Node.ConfigurationType -eq "DynamicLibrary")
|
|
||||||
{
|
|
||||||
$Template = join-path $PSScriptRoot "templates\winrt_dll_template.vcxproj"
|
|
||||||
}
|
|
||||||
elseif($configs[0].Node.ConfigurationType -eq "StaticLibrary")
|
|
||||||
{
|
|
||||||
$Template = join-path $PSScriptRoot "templates\winrt_lib_template.vcxproj"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw "Unknown vcxproj type"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif($platform -eq "wp8")
|
|
||||||
{
|
|
||||||
if($configs[0].Node.ConfigurationType -eq "DynamicLibrary")
|
|
||||||
{
|
|
||||||
$Template = join-path $PSScriptRoot "templates\wp8_dll_template.vcxproj"
|
|
||||||
}
|
|
||||||
elseif($configs[0].Node.ConfigurationType -eq "StaticLibrary")
|
|
||||||
{
|
|
||||||
$Template = join-path $PSScriptRoot "templates\wp8_lib_template.vcxproj"
|
|
||||||
}
|
|
||||||
elseif($configs[0].Node.ConfigurationType -eq "Application")
|
|
||||||
{
|
|
||||||
$Template = join-path $PSScriptRoot "templates\wp8_lib_template.vcxproj"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw "Unknown vcxproj type"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw "Unknown platform argument -p (winrt or wp8)"
|
|
||||||
}
|
|
||||||
|
|
||||||
$xml_template = New-Object -TypeName XML
|
|
||||||
$xml_template.Load($Template)
|
|
||||||
|
|
||||||
|
|
||||||
#Update Project Guid and Name
|
|
||||||
$win32_globals = Select-XML -Xml $xml_win32 -XPath '//ms:PropertyGroup[@Label="Globals"]' -Namespace $ns
|
|
||||||
|
|
||||||
$winrt_globals = Select-XML -Xml $xml_template -XPath '//ms:PropertyGroup[@Label="Globals"]' -Namespace $ns
|
|
||||||
$winrt_globals.Node.ProjectGuid = $guid
|
|
||||||
|
|
||||||
|
|
||||||
if($win32_globals.Node.ProjectName)
|
|
||||||
{
|
|
||||||
$winrt_globals.Node.RootNamespace = $win32_globals.Node.ProjectName
|
|
||||||
|
|
||||||
if($winrt_globals.Node.ProjectName)
|
|
||||||
{
|
|
||||||
$winrt_globals.Node.ProjectName = $win32_globals.Node.ProjectName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($win32_globals.Node.RootNamespace)
|
|
||||||
{
|
|
||||||
$winrt_globals.Node.RootNamespace = $win32_globals.Node.RootNamespace
|
|
||||||
}
|
|
||||||
|
|
||||||
$project = Select-XML -Xml $xml_template -XPath '//ms:Project' -Namespace $ns
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($item in (Select-XML -Xml $xml_win32 -XPath '//ms:ItemGroup' -Namespace $ns))
|
|
||||||
{
|
|
||||||
if ($item.node.ClInclude -or $item.node.ClCompile)
|
|
||||||
{
|
|
||||||
$newNode = $xml_template.ImportNode($item.Node, $true)
|
|
||||||
$project.Node.AppendChild($newNode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#Copy ItemDefinitionGroup properties
|
|
||||||
$debug_properties = $null
|
|
||||||
$release_properties = $null
|
|
||||||
|
|
||||||
|
|
||||||
foreach($item in (Select-XML -Xml $xml_win32 -XPath '//ms:ItemDefinitionGroup' -Namespace $ns))
|
|
||||||
{
|
|
||||||
if($item.node.Condition -match "debug")
|
|
||||||
{
|
|
||||||
$debug_properties = $item
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$release_properties = $item
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$debug_includes = $debug_properties.Node.ClCompile.AdditionalIncludeDirectories
|
|
||||||
$release_includes = $release_properties.Node.ClCompile.AdditionalIncludeDirectories
|
|
||||||
|
|
||||||
|
|
||||||
foreach($item in (Select-XML -Xml $xml_template -XPath '//ms:ItemDefinitionGroup' -Namespace $ns))
|
|
||||||
{
|
|
||||||
$includes = $release_includes;
|
|
||||||
$properties = $release_properties
|
|
||||||
|
|
||||||
if($item.node.Condition -match "debug")
|
|
||||||
{
|
|
||||||
$includes = $debug_includes;
|
|
||||||
$properties = $debug_properties
|
|
||||||
}
|
|
||||||
|
|
||||||
AddElement $xml_template $item.Node.ClCompile 'AdditionalIncludeDirectories' $includes $ms
|
|
||||||
AddElement $xml_template $item.Node.ClCompile 'PreprocessorDefinitions' $properties.Node.ClCompile.PreprocessorDefinitions $ms
|
|
||||||
if($properties.Node.ClCompile.PrecompiledHeader)
|
|
||||||
{
|
|
||||||
$item.Node.ClCompile.PrecompiledHeader = $properties.Node.ClCompile.PrecompiledHeader
|
|
||||||
}
|
|
||||||
|
|
||||||
if($properties.Node.ClCompile.PrecompiledHeaderFile)
|
|
||||||
{
|
|
||||||
AddElement $xml_template $item.Node.ClCompile 'PrecompiledHeaderFile' "precomp.hpp" $ms
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($properties.Node.ClCompile.ForcedIncludeFiles)
|
|
||||||
{
|
|
||||||
AddElement $xml_template $item.Node.ClCompile 'ForcedIncludeFiles' "precomp.hpp" $ms
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if($properties.Node.ClCompile.DisableSpecificWarnings)
|
|
||||||
{
|
|
||||||
AddElement $xml_template $item.Node.ClCompile 'DisableSpecificWarnings' $properties.Node.ClCompile.DisableSpecificWarnings $ms
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#save output file
|
|
||||||
$xml_template.Save($outFile)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($item in (Select-XML -Xml $xml_template -XPath '//ms:Project//ms:ItemGroup//ms:ClCompile//ms:PrecompiledHeader' -Namespace $ns))
|
|
||||||
{
|
|
||||||
$newNode = $xml_template.ImportNode($item.Node, $true)
|
|
||||||
$newNode.Condition = $newNode.Condition.replace("Win32", "ARM")
|
|
||||||
$item.Node.parentNode.AppendChild($newNode)
|
|
||||||
$newNode = $xml_template.ImportNode($item.Node, $true)
|
|
||||||
$newNode.Condition = $newNode.Condition.replace("Win32", "x64")
|
|
||||||
$item.Node.parentNode.AppendChild($newNode)
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($item in (Select-XML -Xml $xml_template -XPath '//ms:Project//ms:ItemGroup//ms:ClCompile//ms:PrecompiledHeaderFile' -Namespace $ns))
|
|
||||||
{
|
|
||||||
$item.Node."#text" = "precomp.hpp"
|
|
||||||
$newNode = $xml_template.ImportNode($item.Node, $true)
|
|
||||||
$newNode.Condition = $newNode.Condition.replace("Win32", "ARM")
|
|
||||||
$item.Node.parentNode.AppendChild($newNode)
|
|
||||||
$newNode = $xml_template.ImportNode($item.Node, $true)
|
|
||||||
$newNode.Condition = $newNode.Condition.replace("Win32", "x64")
|
|
||||||
$item.Node.parentNode.AppendChild($newNode)
|
|
||||||
}
|
|
||||||
|
|
||||||
$xml_template.selectNodes('//data/value[contains(.,"precomp.hpp")]')|
|
|
||||||
ForEach-Object{
|
|
||||||
$_.'#text' = 'precomp.hpp'
|
|
||||||
}
|
|
||||||
|
|
||||||
$xml_template.Save($outFile)
|
|
||||||
|
|
||||||
|
|
||||||
#copy .filters file
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$filters = $inFile + ".filters"
|
|
||||||
$xml_filters = New-Object -TypeName XML
|
|
||||||
$xml_filters.Load($filters)
|
|
||||||
$xml_filters.Save($outFile + ".filters")
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Write-Host "No .filters file"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
How to compile precompiled shaders for Windows Phone 8.0 (WP8)
|
|
||||||
|
|
||||||
1. Open the VS project Cocos2dShaderCompiler\Cocos2dShaderCompiler.sln
|
|
||||||
2. Build and run the project
|
|
||||||
3. Click the Compile button
|
|
||||||
4. Select the file cocos\platform\wp8\shaders\precompiledshaders.h in the file dialog box
|
|
||||||
5. Program will precompile all of the cached cocos2d-x shaders.
|
|
|
@ -1,7 +0,0 @@
|
||||||
<Application
|
|
||||||
x:Class="Cocos2dShaderCompiler.App"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:local="using:Cocos2dShaderCompiler">
|
|
||||||
|
|
||||||
</Application>
|
|
|
@ -1,89 +0,0 @@
|
||||||
//
|
|
||||||
// App.xaml.cpp
|
|
||||||
// Implementation of the App class.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "pch.h"
|
|
||||||
#include "DirectXPage.xaml.h"
|
|
||||||
|
|
||||||
using namespace Cocos2dShaderCompiler;
|
|
||||||
|
|
||||||
using namespace Platform;
|
|
||||||
using namespace Windows::ApplicationModel;
|
|
||||||
using namespace Windows::ApplicationModel::Activation;
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::Foundation::Collections;
|
|
||||||
using namespace Windows::Storage;
|
|
||||||
using namespace Windows::UI::Xaml;
|
|
||||||
using namespace Windows::UI::Xaml::Controls;
|
|
||||||
using namespace Windows::UI::Xaml::Controls::Primitives;
|
|
||||||
using namespace Windows::UI::Xaml::Data;
|
|
||||||
using namespace Windows::UI::Xaml::Input;
|
|
||||||
using namespace Windows::UI::Xaml::Interop;
|
|
||||||
using namespace Windows::UI::Xaml::Media;
|
|
||||||
using namespace Windows::UI::Xaml::Navigation;
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes the singleton application object. This is the first line of authored code
|
|
||||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
|
||||||
/// </summary>
|
|
||||||
App::App()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
|
|
||||||
Resuming += ref new EventHandler<Object^>(this, &App::OnResuming);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Invoked when the application is launched normally by the end user. Other entry points
|
|
||||||
/// will be used when the application is launched to open a specific file, to display
|
|
||||||
/// search results, and so forth.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="e">Details about the launch request and process.</param>
|
|
||||||
void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
|
|
||||||
{
|
|
||||||
#if _DEBUG
|
|
||||||
if (IsDebuggerPresent())
|
|
||||||
{
|
|
||||||
DebugSettings->EnableFrameRateCounter = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_directXPage = ref new DirectXPage();
|
|
||||||
|
|
||||||
if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
|
|
||||||
{
|
|
||||||
m_directXPage->LoadInternalState(ApplicationData::Current->LocalSettings->Values);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Place the page in the current window and ensure that it is active.
|
|
||||||
Window::Current->Content = m_directXPage;
|
|
||||||
Window::Current->Activate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Invoked when application execution is being suspended. Application state is saved
|
|
||||||
/// without knowing whether the application will be terminated or resumed with the contents
|
|
||||||
/// of memory still intact.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender">The source of the suspend request.</param>
|
|
||||||
/// <param name="e">Details about the suspend request.</param>
|
|
||||||
void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
|
|
||||||
{
|
|
||||||
(void) sender; // Unused parameter
|
|
||||||
(void) e; // Unused parameter
|
|
||||||
|
|
||||||
m_directXPage->SaveInternalState(ApplicationData::Current->LocalSettings->Values);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Invoked when application execution is being resumed.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender">The source of the resume request.</param>
|
|
||||||
/// <param name="args">Details about the resume request.</param>
|
|
||||||
void App::OnResuming(Object ^sender, Object ^args)
|
|
||||||
{
|
|
||||||
(void) sender; // Unused parameter
|
|
||||||
(void) args; // Unused parameter
|
|
||||||
|
|
||||||
m_directXPage->LoadInternalState(ApplicationData::Current->LocalSettings->Values);
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
//
|
|
||||||
// App.xaml.h
|
|
||||||
// Declaration of the App class.
|
|
||||||
//
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "App.g.h"
|
|
||||||
#include "DirectXPage.xaml.h"
|
|
||||||
|
|
||||||
namespace Cocos2dShaderCompiler
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Provides application-specific behavior to supplement the default Application class.
|
|
||||||
/// </summary>
|
|
||||||
ref class App sealed
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
App();
|
|
||||||
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
|
|
||||||
void OnResuming(Platform::Object ^sender, Platform::Object ^args);
|
|
||||||
DirectXPage^ m_directXPage;
|
|
||||||
};
|
|
||||||
}
|
|
Before Width: | Height: | Size: 801 B |
Before Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 429 B |
|
@ -1,92 +0,0 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 2013
|
|
||||||
VisualStudioVersion = 12.0.31101.0
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cocos2dShaderCompiler", "Cocos2dShaderCompiler.vcxproj", "{4F6DEF20-AC4C-487F-85B8-5993519E3911}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{ECA7A2AA-8501-4177-8360-322A569B6C3E}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Box2D", "Box2D", "{7CA66464-6A5E-493B-82EF-DBD84F91766F}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libSpine", "libSpine", "{8F8A69D6-BD64-4BAD-AE20-2D07E7BD57BA}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.Shared", "..\..\..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems", "{4A3C6BA8-C227-498B-AA21-40BDA27B461F}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d.Windows", "..\..\..\external\Box2D\proj.win8.1-universal\libbox2d.Windows\libbox2d.Windows.vcxproj", "{3B26A12D-3A44-47EA-82D2-282660FC844D}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Shared", "..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems", "{ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine.Windows", "..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Windows\libSpine.Windows.vcxproj", "{F3550FE0-C795-44F6-8FEB-093EB68143AE}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
|
||||||
..\..\..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{4a3c6ba8-c227-498b-aa21-40bda27b461f}*SharedItemsImports = 9
|
|
||||||
..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{adafd00d-a0d6-46ef-9f0b-ea2880bfe1de}*SharedItemsImports = 9
|
|
||||||
..\..\..\external\Box2D\proj.win8.1-universal\libbox2d.Shared\libbox2d.Shared.vcxitems*{3b26a12d-3a44-47ea-82d2-282660fc844d}*SharedItemsImports = 4
|
|
||||||
..\..\..\cocos\editor-support\spine\proj.win8.1-universal\libSpine.Shared\libSpine.Shared.vcxitems*{f3550fe0-c795-44f6-8feb-093eb68143ae}*SharedItemsImports = 4
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|ARM = Debug|ARM
|
|
||||||
Debug|Win32 = Debug|Win32
|
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Release|ARM = Release|ARM
|
|
||||||
Release|Win32 = Release|Win32
|
|
||||||
Release|x64 = Release|x64
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Debug|ARM.Deploy.0 = Debug|ARM
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Debug|Win32.Deploy.0 = Debug|Win32
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Debug|x64.Deploy.0 = Debug|x64
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Release|ARM.Deploy.0 = Release|ARM
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Release|Win32.Deploy.0 = Release|Win32
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Release|x64.Build.0 = Release|x64
|
|
||||||
{4F6DEF20-AC4C-487F-85B8-5993519E3911}.Release|x64.Deploy.0 = Release|x64
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D}.Release|x64.Build.0 = Release|x64
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|ARM.ActiveCfg = Debug|ARM
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|ARM.Build.0 = Debug|ARM
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|ARM.ActiveCfg = Release|ARM
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|ARM.Build.0 = Release|ARM
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE}.Release|x64.Build.0 = Release|x64
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(NestedProjects) = preSolution
|
|
||||||
{7CA66464-6A5E-493B-82EF-DBD84F91766F} = {ECA7A2AA-8501-4177-8360-322A569B6C3E}
|
|
||||||
{8F8A69D6-BD64-4BAD-AE20-2D07E7BD57BA} = {ECA7A2AA-8501-4177-8360-322A569B6C3E}
|
|
||||||
{4A3C6BA8-C227-498B-AA21-40BDA27B461F} = {7CA66464-6A5E-493B-82EF-DBD84F91766F}
|
|
||||||
{3B26A12D-3A44-47EA-82D2-282660FC844D} = {7CA66464-6A5E-493B-82EF-DBD84F91766F}
|
|
||||||
{ADAFD00D-A0D6-46EF-9F0B-EA2880BFE1DE} = {8F8A69D6-BD64-4BAD-AE20-2D07E7BD57BA}
|
|
||||||
{F3550FE0-C795-44F6-8FEB-093EB68143AE} = {8F8A69D6-BD64-4BAD-AE20-2D07E7BD57BA}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
|
@ -1,698 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|ARM">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|ARM">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{4f6def20-ac4c-487f-85b8-5993519e3911}</ProjectGuid>
|
|
||||||
<RootNamespace>Cocos2dShaderCompiler</RootNamespace>
|
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
|
||||||
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
|
|
||||||
<AppContainerApplication>true</AppContainerApplication>
|
|
||||||
<ApplicationType>Windows Store</ApplicationType>
|
|
||||||
<ApplicationTypeRevision>8.1</ApplicationTypeRevision>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v120</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ImageContentTask.props" />
|
|
||||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\MeshContentTask.props" />
|
|
||||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ShaderGraphContentTask.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_app.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_platform.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_app.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_platform.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_app.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_platform.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_app.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_platform.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_app.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_platform.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_app.props" />
|
|
||||||
<Import Project="..\..\..\cocos\2d\winrt_props\cocos2d_winrt_platform.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackageCertificateKeyFile>Cocos2dShaderCompiler_TemporaryKey.pfx</PackageCertificateKeyFile>
|
|
||||||
<PackageCertificateThumbprint>2371BAA26A4995D58B8E87430D9BE585C3507553</PackageCertificateThumbprint>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>d2d1.lib;d3d11.lib;dwrite.lib;dxguid.lib;dxgi.lib;ole32.lib;windowscodecs.lib;libGLESv2.lib;libEGL.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\..\external\winrt-specific\angle\prebuilt\$(Platform);%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
|
|
||||||
</Link>
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir);$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8\freetype;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<PreprocessorDefinitions>WP8_SHADER_COMPILER;CC_USE_PHYSICS=0;CC_STATIC;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<ForcedIncludeFiles>
|
|
||||||
</ForcedIncludeFiles>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>d2d1.lib;d3d11.lib;dwrite.lib;dxguid.lib;dxgi.lib;ole32.lib;windowscodecs.lib;libGLESv2.lib;libEGL.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\..\external\winrt-specific\angle\prebuilt\$(Platform);%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
|
|
||||||
</Link>
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir);$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8\freetype;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<PreprocessorDefinitions>WP8_SHADER_COMPILER;CC_USE_PHYSICS=0;CC_STATIC;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<ForcedIncludeFiles>
|
|
||||||
</ForcedIncludeFiles>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>d2d1.lib;d3d11.lib;dwrite.lib;dxguid.lib;dxgi.lib;ole32.lib;windowscodecs.lib;libGLESv2.lib;libEGL.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\..\external\winrt-specific\angle\prebuilt\$(Platform);%(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store;$(VCInstallDir)\lib</AdditionalLibraryDirectories>
|
|
||||||
</Link>
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir);$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8\freetype;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<PreprocessorDefinitions>WP8_SHADER_COMPILER;CC_USE_PHYSICS=0;CC_STATIC;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<ForcedIncludeFiles>
|
|
||||||
</ForcedIncludeFiles>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>d2d1.lib;d3d11.lib;dwrite.lib;dxguid.lib;dxgi.lib;ole32.lib;windowscodecs.lib;libGLESv2.lib;libEGL.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\..\external\winrt-specific\angle\prebuilt\$(Platform);%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
|
|
||||||
</Link>
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir);$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8\freetype;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<PreprocessorDefinitions>WP8_SHADER_COMPILER;CC_USE_PHYSICS=0;CC_STATIC;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<ForcedIncludeFiles>
|
|
||||||
</ForcedIncludeFiles>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>d2d1.lib;d3d11.lib;dwrite.lib;dxguid.lib;dxgi.lib;ole32.lib;windowscodecs.lib;libGLESv2.lib;libEGL.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\..\external\winrt-specific\angle\prebuilt\$(Platform);%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
|
|
||||||
</Link>
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir);$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8\freetype;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<PreprocessorDefinitions>WP8_SHADER_COMPILER;CC_USE_PHYSICS=0;CC_STATIC;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<ForcedIncludeFiles>
|
|
||||||
</ForcedIncludeFiles>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>d2d1.lib;d3d11.lib;dwrite.lib;dxguid.lib;dxgi.lib;ole32.lib;windowscodecs.lib;libGLESv2.lib;libEGL.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\..\external\winrt-specific\angle\prebuilt\$(Platform);%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
|
|
||||||
</Link>
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir);$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8\freetype;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<PreprocessorDefinitions>WP8_SHADER_COMPILER;CC_USE_PHYSICS=0;CC_STATIC;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<ForcedIncludeFiles>
|
|
||||||
</ForcedIncludeFiles>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Image Include="Assets\Logo.png" />
|
|
||||||
<Image Include="Assets\SmallLogo.png" />
|
|
||||||
<Image Include="Assets\StoreLogo.png" />
|
|
||||||
<Image Include="Assets\SplashScreen.png" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCAction.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionCamera.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionCatmullRom.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionEase.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionGrid.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionGrid3D.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionInstant.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionInterval.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionManager.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionPageTurn3D.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionProgressTimer.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionTiledGrid.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCActionTween.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCAnimation.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCAnimationCache.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCAtlasNode.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCCamera.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCClippingNode.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCComponent.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCComponentContainer.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCDrawingPrimitives.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCDrawNode.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCFastTMXLayer.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCFastTMXTiledMap.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCFont.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCFontAtlas.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCFontAtlasCache.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCFontCharMap.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCFontFNT.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCFontFreeType.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCGLBufferedNode.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCGrabber.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCGrid.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCLabel.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCLabelAtlas.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCLabelBMFont.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCLabelTextFormatter.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCLabelTTF.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCLayer.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCLight.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCMenu.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCMenuItem.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCMotionStreak.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCNode.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCNodeGrid.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCParallaxNode.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCParticleBatchNode.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCParticleExamples.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCParticleSystem.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCParticleSystemQuad.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCProgressTimer.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCProtectedNode.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCRenderTexture.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCScene.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCSprite.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCSpriteBatchNode.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCSpriteFrame.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCSpriteFrameCache.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCTextFieldTTF.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCTileMapAtlas.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCTMXLayer.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCTMXObjectGroup.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCTMXTiledMap.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCTMXXMLParser.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCTransition.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCTransitionPageTurn.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCTransitionProgress.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\2d\CCTweenFunction.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCAABB.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCAnimate3D.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCAnimation3D.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCAnimationCurve.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCAttachNode.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCBillBoard.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCBundle3D.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCBundle3DData.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCBundleReader.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCFrustum.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCMesh.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCMeshSkin.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCMeshVertexIndexData.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCOBB.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCObjLoader.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCPlane.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCRay.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCSkeleton3D.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCSprite3D.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\CCSprite3DMaterial.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\3d\cocos3d.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorBase.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorDiagnostics.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorGlobal.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorMacros.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorMutex.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyDefault.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyFixedBlock.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyGlobalSmallBlock.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\allocator\CCAllocatorStrategyPool.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\atitc.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\base64.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCAsyncTaskPool.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCAutoreleasePool.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\ccCArray.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\ccConfig.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCConfiguration.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCConsole.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCController.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCData.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCDataVisitor.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCDirector.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEvent.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventAcceleration.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventController.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventCustom.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventDispatcher.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventFocus.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventKeyboard.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventListener.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventListenerAcceleration.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventListenerController.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventListenerCustom.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventListenerFocus.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventListenerKeyboard.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventListenerMouse.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventListenerTouch.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventMouse.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventTouch.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCEventType.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\ccFPSImages.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCGameController.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCIMEDelegate.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCIMEDispatcher.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\ccMacros.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCMap.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCNS.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCProfiling.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCProtocols.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\ccRandom.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCRef.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCRefPtr.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCScheduler.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCScriptSupport.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCTouch.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\ccTypes.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCUserDefault.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\ccUTF8.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\ccUtils.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCValue.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\CCVector.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\etc1.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\firePngData.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\ObjectFactory.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\pvr.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\s3tc.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\TGAlib.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\uthash.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\utlist.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\base\ZipUtils.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\deprecated\CCArray.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\deprecated\CCBool.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\deprecated\CCDeprecated.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\deprecated\CCDictionary.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\deprecated\CCDouble.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\deprecated\CCFloat.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\deprecated\CCInteger.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\deprecated\CCNotificationCenter.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\deprecated\CCSet.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\deprecated\CCString.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\CCAffineTransform.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\CCGeometry.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\CCMath.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\CCMathBase.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\CCVertex.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\Mat4.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\MathUtil.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\Quaternion.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\TransformUtils.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\Vec2.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\Vec3.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\math\Vec4.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\CCFileUtils.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\CCImage.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\CCSAXParser.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\winrt\CCFileUtilsWinRT.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\winrt\CCFreeTypeFont.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\winrt\CCGL.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\winrt\CCGL_Angle.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\winrt\CCPrecompiledShaders.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\winrt\CCStdC.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\winrt\CCWinRTUtils.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\platform\winrt\sha1.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCBatchCommand.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCCustomCommand.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCGLProgram.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCGLProgramCache.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCGLProgramState.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCGLProgramStateCache.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\ccGLStateCache.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCGroupCommand.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCMeshCommand.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCPrimitive.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCPrimitiveCommand.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCQuadCommand.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCRenderCommand.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCRenderCommandPool.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCRenderer.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\ccShaders.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCTexture2D.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCTextureAtlas.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCTextureCache.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCTrianglesCommand.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCVertexIndexBuffer.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\renderer\CCVertexIndexData.h" />
|
|
||||||
<ClInclude Include="..\..\..\cocos\ui\shaders\UIShaders.h" />
|
|
||||||
<ClInclude Include="..\..\..\external\ConvertUTF\ConvertUTF.h" />
|
|
||||||
<ClInclude Include="..\..\..\external\edtaa3func\edtaa3func.h" />
|
|
||||||
<ClInclude Include="..\..\..\external\tinyxml2\tinyxml2.h" />
|
|
||||||
<ClInclude Include="..\..\..\external\unzip\ioapi.h" />
|
|
||||||
<ClInclude Include="..\..\..\external\unzip\ioapi_mem.h" />
|
|
||||||
<ClInclude Include="..\..\..\external\unzip\unzip.h" />
|
|
||||||
<ClInclude Include="..\..\..\external\xxhash\xxhash.h" />
|
|
||||||
<ClInclude Include="App.xaml.h">
|
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="DirectXPage.xaml.h">
|
|
||||||
<DependentUpon>DirectXPage.xaml</DependentUpon>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="ShaderCompiler.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCAction.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionCamera.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionCatmullRom.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionEase.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionGrid.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionGrid3D.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionInstant.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionInterval.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionManager.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionPageTurn3D.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionProgressTimer.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionTiledGrid.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCActionTween.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCAnimation.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCAnimationCache.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCAtlasNode.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCCamera.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCClippingNode.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCComponent.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCComponentContainer.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCDrawingPrimitives.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCDrawNode.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCFastTMXLayer.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCFastTMXTiledMap.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCFont.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCFontAtlas.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCFontAtlasCache.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCFontCharMap.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCFontFNT.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCFontFreeType.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCGLBufferedNode.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCGrabber.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCGrid.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCLabel.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCLabelAtlas.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCLabelBMFont.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCLabelTextFormatter.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCLabelTTF.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCLayer.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCLight.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCMenu.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCMenuItem.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCMotionStreak.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCNode.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCNodeGrid.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCParallaxNode.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCParticleBatchNode.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCParticleExamples.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCParticleSystem.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCParticleSystemQuad.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCProgressTimer.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCProtectedNode.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCRenderTexture.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCScene.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCSprite.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCSpriteBatchNode.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCSpriteFrame.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCSpriteFrameCache.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCTextFieldTTF.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCTileMapAtlas.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCTMXLayer.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCTMXObjectGroup.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCTMXTiledMap.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCTMXXMLParser.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCTransition.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCTransitionPageTurn.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCTransitionProgress.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\2d\CCTweenFunction.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCAABB.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCAnimate3D.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCAnimation3D.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCAttachNode.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCBillBoard.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCBundle3D.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCBundleReader.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCFrustum.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCMesh.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCMeshSkin.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCMeshVertexIndexData.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCOBB.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCObjLoader.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCPlane.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCRay.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCSkeleton3D.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCSprite3D.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\3d\CCSprite3DMaterial.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\allocator\CCAllocatorDiagnostics.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\allocator\CCAllocatorGlobal.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\allocator\CCAllocatorGlobalNewDelete.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\atitc.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\base64.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCAsyncTaskPool.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCAutoreleasePool.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\ccCArray.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCConfiguration.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCConsole.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCController.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCData.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCDataVisitor.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCDirector.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEvent.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventAcceleration.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventController.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventCustom.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventDispatcher.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventFocus.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventKeyboard.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventListener.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventListenerAcceleration.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventListenerController.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventListenerCustom.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventListenerFocus.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventListenerKeyboard.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventListenerMouse.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventListenerTouch.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventMouse.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCEventTouch.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\ccFPSImages.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCIMEDispatcher.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCNS.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCProfiling.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\ccRandom.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCRef.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCScheduler.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCScriptSupport.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCTouch.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\ccTypes.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCUserDefault.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\ccUTF8.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\ccUtils.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\CCValue.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\etc1.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\ObjectFactory.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\pvr.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\s3tc.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\TGAlib.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\base\ZipUtils.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\cocos2d.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\deprecated\CCArray.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\deprecated\CCDeprecated.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\deprecated\CCDictionary.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\deprecated\CCNotificationCenter.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\deprecated\CCSet.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\deprecated\CCString.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\math\CCAffineTransform.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\math\CCGeometry.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\math\CCVertex.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\math\Mat4.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\math\MathUtil.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\math\Quaternion.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\math\TransformUtils.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\math\Vec2.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\math\Vec3.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\math\Vec4.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\CCFileUtils.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\CCImage.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\CCSAXParser.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\winrt\CCCommon.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\winrt\CCDevice.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\winrt\CCFileUtilsWinRT.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\winrt\CCFreeTypeFont.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\winrt\CCPrecompiledShaders.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\winrt\CCStdC.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\winrt\CCWinRTUtils.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\platform\winrt\sha1.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCBatchCommand.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCCustomCommand.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCGLProgram.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCGLProgramCache.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCGLProgramState.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCGLProgramStateCache.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\ccGLStateCache.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCGroupCommand.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCMeshCommand.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCPrimitive.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCPrimitiveCommand.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCQuadCommand.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCRenderCommand.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCRenderer.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\ccShaders.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCTexture2D.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCTextureAtlas.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCTextureCache.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCTrianglesCommand.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCVertexIndexBuffer.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\renderer\CCVertexIndexData.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\cocos\ui\shaders\UIShaders.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\external\ConvertUTF\ConvertUTF.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\..\external\ConvertUTF\ConvertUTFWrapper.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\external\edtaa3func\edtaa3func.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\external\tinyxml2\tinyxml2.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\external\unzip\ioapi.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\external\unzip\ioapi_mem.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\external\unzip\unzip.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\external\xxhash\xxhash.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="App.xaml.cpp">
|
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="DirectXPage.xaml.cpp">
|
|
||||||
<DependentUpon>DirectXPage.xaml</DependentUpon>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="ShaderCompiler.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<AppxManifest Include="Package.appxmanifest">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</AppxManifest>
|
|
||||||
<None Include="..\..\..\cocos\3d\CCAnimationCurve.inl" />
|
|
||||||
<None Include="..\..\..\cocos\math\MathUtil.inl" />
|
|
||||||
<None Include="Cocos2dShaderCompiler_TemporaryKey.pfx" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ApplicationDefinition Include="App.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</ApplicationDefinition>
|
|
||||||
<Page Include="DirectXPage.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ImageContentTask.targets" />
|
|
||||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\MeshContentTask.targets" />
|
|
||||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ShaderGraphContentTask.targets" />
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
|
@ -1,23 +0,0 @@
|
||||||
<Page
|
|
||||||
x:Class="Cocos2dShaderCompiler.DirectXPage"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:local="using:Cocos2dShaderCompiler"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d">
|
|
||||||
|
|
||||||
<!--LayoutRoot is the root grid where all page content is placed-->
|
|
||||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
|
||||||
<StackPanel Orientation="Vertical">
|
|
||||||
<StackPanel Orientation="Horizontal" Margin="40,100,0,0" Height="50" VerticalAlignment="Top">
|
|
||||||
<TextBlock Text="Save file to cocos\platform\wp8\shaders\precompiledshaders.h" FontSize="36"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" Margin="40,100,0,0" Height="50" VerticalAlignment="Top">
|
|
||||||
<TextBlock Text="Result: " FontSize="36"/>
|
|
||||||
<TextBlock Text="" FontSize="36" x:Name="ResultText" />
|
|
||||||
</StackPanel>
|
|
||||||
<Button Margin="40,100,0,0" x:Name="compileButton" Content="Compile" Width="150" Click="OnCompile" />
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</Page>
|
|
|
@ -1,126 +0,0 @@
|
||||||
//
|
|
||||||
// DirectXPage.xaml.cpp
|
|
||||||
// Implementation of the DirectXPage class.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "pch.h"
|
|
||||||
#include "DirectXPage.xaml.h"
|
|
||||||
|
|
||||||
using namespace Cocos2dShaderCompiler;
|
|
||||||
|
|
||||||
using namespace Platform;
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::Foundation::Collections;
|
|
||||||
using namespace Windows::Graphics::Display;
|
|
||||||
using namespace Windows::System::Threading;
|
|
||||||
using namespace Windows::UI::Core;
|
|
||||||
using namespace Windows::UI::Input;
|
|
||||||
using namespace Windows::UI::Xaml;
|
|
||||||
using namespace Windows::UI::Xaml::Controls;
|
|
||||||
using namespace Windows::UI::Xaml::Controls::Primitives;
|
|
||||||
using namespace Windows::UI::Xaml::Data;
|
|
||||||
using namespace Windows::UI::Xaml::Input;
|
|
||||||
using namespace Windows::UI::Xaml::Media;
|
|
||||||
using namespace Windows::UI::Xaml::Navigation;
|
|
||||||
using namespace concurrency;
|
|
||||||
|
|
||||||
DirectXPage::DirectXPage():
|
|
||||||
m_windowVisible(true),
|
|
||||||
m_coreInput(nullptr)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
// Register event handlers for page lifecycle.
|
|
||||||
CoreWindow^ window = Window::Current->CoreWindow;
|
|
||||||
|
|
||||||
window->VisibilityChanged +=
|
|
||||||
ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &DirectXPage::OnVisibilityChanged);
|
|
||||||
|
|
||||||
DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
|
|
||||||
|
|
||||||
currentDisplayInformation->DpiChanged +=
|
|
||||||
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnDpiChanged);
|
|
||||||
|
|
||||||
currentDisplayInformation->OrientationChanged +=
|
|
||||||
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnOrientationChanged);
|
|
||||||
|
|
||||||
DisplayInformation::DisplayContentsInvalidated +=
|
|
||||||
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &DirectXPage::OnDisplayContentsInvalidated);
|
|
||||||
|
|
||||||
|
|
||||||
// Disable all pointer visual feedback for better performance when touching.
|
|
||||||
auto pointerVisualizationSettings = PointerVisualizationSettings::GetForCurrentView();
|
|
||||||
pointerVisualizationSettings->IsContactFeedbackEnabled = false;
|
|
||||||
pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
DirectXPage::~DirectXPage()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXPage::OnCompile(Object^ sender, RoutedEventArgs^ args)
|
|
||||||
{
|
|
||||||
compiler.Compile(ResultText);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Saves the current state of the app for suspend and terminate events.
|
|
||||||
void DirectXPage::SaveInternalState(IPropertySet^ state)
|
|
||||||
{
|
|
||||||
//m_deviceResources->Trim();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Loads the current state of the app for resume events.
|
|
||||||
void DirectXPage::LoadInternalState(IPropertySet^ state)
|
|
||||||
{
|
|
||||||
// Put code to load app state here.
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Window event handlers.
|
|
||||||
|
|
||||||
void DirectXPage::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
|
|
||||||
{
|
|
||||||
m_windowVisible = args->Visible;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// DisplayInformation event handlers.
|
|
||||||
|
|
||||||
void DirectXPage::OnDpiChanged(DisplayInformation^ sender, Object^ args)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXPage::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DirectXPage::OnDisplayContentsInvalidated(DisplayInformation^ sender, Object^ args)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DirectXPage::OnPointerPressed(Object^ sender, PointerEventArgs^ e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXPage::OnPointerMoved(Object^ sender, PointerEventArgs^ e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXPage::OnPointerReleased(Object^ sender, PointerEventArgs^ e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXPage::OnCompositionScaleChanged(SwapChainPanel^ sender, Object^ args)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
//
|
|
||||||
// DirectXPage.xaml.h
|
|
||||||
// Declaration of the DirectXPage class.
|
|
||||||
//
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "DirectXPage.g.h"
|
|
||||||
#include "ShaderCompiler.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Cocos2dShaderCompiler
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// A page that hosts a DirectX SwapChainPanel.
|
|
||||||
/// </summary>
|
|
||||||
public ref class DirectXPage sealed
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DirectXPage();
|
|
||||||
virtual ~DirectXPage();
|
|
||||||
|
|
||||||
void SaveInternalState(Windows::Foundation::Collections::IPropertySet^ state);
|
|
||||||
void LoadInternalState(Windows::Foundation::Collections::IPropertySet^ state);
|
|
||||||
|
|
||||||
private:
|
|
||||||
// XAML low-level rendering event handler.
|
|
||||||
void OnRendering(Platform::Object^ sender, Platform::Object^ args);
|
|
||||||
|
|
||||||
// Window event handlers.
|
|
||||||
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
|
|
||||||
|
|
||||||
// DisplayInformation event handlers.
|
|
||||||
void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
|
|
||||||
void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
|
|
||||||
void OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
|
|
||||||
|
|
||||||
// Other event handlers.
|
|
||||||
void OnCompositionScaleChanged(Windows::UI::Xaml::Controls::SwapChainPanel^ sender, Object^ args);
|
|
||||||
void OnCompile(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
|
||||||
|
|
||||||
// Track our independent input on a background worker thread.
|
|
||||||
Windows::Foundation::IAsyncAction^ m_inputLoopWorker;
|
|
||||||
Windows::UI::Core::CoreIndependentInputSource^ m_coreInput;
|
|
||||||
|
|
||||||
// Independent input handling functions.
|
|
||||||
void OnPointerPressed(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
|
|
||||||
void OnPointerMoved(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
|
|
||||||
void OnPointerReleased(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
|
|
||||||
|
|
||||||
ShaderCompiler compiler;
|
|
||||||
|
|
||||||
bool m_windowVisible;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
|
|
||||||
<Identity Name="648a721b-11b5-48d7-816b-4d7fa8b140c0" Publisher="CN=msopentech" Version="1.0.0.0" />
|
|
||||||
<Properties>
|
|
||||||
<DisplayName>Cocos2dShaderCompiler</DisplayName>
|
|
||||||
<PublisherDisplayName>msopentech</PublisherDisplayName>
|
|
||||||
<Logo>Assets\StoreLogo.png</Logo>
|
|
||||||
</Properties>
|
|
||||||
<Prerequisites>
|
|
||||||
<OSMinVersion>6.3.0</OSMinVersion>
|
|
||||||
<OSMaxVersionTested>6.3.0</OSMaxVersionTested>
|
|
||||||
</Prerequisites>
|
|
||||||
<Resources>
|
|
||||||
<Resource Language="x-generate" />
|
|
||||||
</Resources>
|
|
||||||
<Applications>
|
|
||||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Cocos2dShaderCompiler.App">
|
|
||||||
<m2:VisualElements DisplayName="Cocos2dShaderCompiler" Description="Cocos2dShaderCompiler" BackgroundColor="#464646" ForegroundText="light" Square150x150Logo="Assets\Logo.png" Square30x30Logo="Assets\SmallLogo.png">
|
|
||||||
<m2:DefaultTile>
|
|
||||||
<m2:ShowNameOnTiles>
|
|
||||||
<m2:ShowOn Tile="square150x150Logo" />
|
|
||||||
</m2:ShowNameOnTiles>
|
|
||||||
</m2:DefaultTile>
|
|
||||||
<m2:SplashScreen Image="Assets\SplashScreen.png" />
|
|
||||||
</m2:VisualElements>
|
|
||||||
</Application>
|
|
||||||
</Applications>
|
|
||||||
<Capabilities>
|
|
||||||
<Capability Name="internetClient" />
|
|
||||||
</Capabilities>
|
|
||||||
</Package>
|
|
|
@ -1,168 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "ShaderCompiler.h"
|
|
||||||
#include "cocos2d.h"
|
|
||||||
#include "CCPrecompiledShaders.h"
|
|
||||||
|
|
||||||
using namespace Concurrency;
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::UI::Core;
|
|
||||||
|
|
||||||
USING_NS_CC;
|
|
||||||
|
|
||||||
ShaderCompiler::ShaderCompiler()
|
|
||||||
: m_display(nullptr),
|
|
||||||
m_context(nullptr),
|
|
||||||
m_initialized(false),
|
|
||||||
m_resultText(nullptr)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ShaderCompiler::~ShaderCompiler()
|
|
||||||
{
|
|
||||||
|
|
||||||
CloseAngle();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool ShaderCompiler::Compile(Windows::UI::Xaml::Controls::TextBlock^ resultText)
|
|
||||||
{
|
|
||||||
m_resultText = resultText;
|
|
||||||
resultText->Text = "Compiling shaders...";
|
|
||||||
|
|
||||||
if (!InitializeAngle(ANGLE_D3D_FEATURE_LEVEL::ANGLE_D3D_FEATURE_LEVEL_9_3))
|
|
||||||
{
|
|
||||||
resultText->Text = "Unable to initialize Angle";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto director = cocos2d::Director::getInstance();
|
|
||||||
|
|
||||||
//Director::getInstance()->setAnimationInterval(1.0 / 60.0);
|
|
||||||
CCShaderCache::getInstance()->loadDefaultShaders();
|
|
||||||
CCPrecompiledShaders::getInstance()->savePrecompiledShaders();
|
|
||||||
resultText->Text = "Complete";
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Creates and restores Cocos2d-x after DirectX and Angle contexts are created or updated
|
|
||||||
void ShaderCompiler::InitializeCocos2d()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShaderCompiler::CloseAngle()
|
|
||||||
{
|
|
||||||
eglMakeCurrent(NULL, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
if (m_display && m_context)
|
|
||||||
{
|
|
||||||
eglDestroyContext(m_context, m_context);
|
|
||||||
}
|
|
||||||
if (m_display)
|
|
||||||
{
|
|
||||||
eglTerminate(m_display);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_eglWindow = nullptr;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShaderCompiler::InitializeAngle(ANGLE_D3D_FEATURE_LEVEL featureLevel)
|
|
||||||
{
|
|
||||||
// setup EGL
|
|
||||||
EGLint configAttribList[] = {
|
|
||||||
EGL_RED_SIZE, 8,
|
|
||||||
EGL_GREEN_SIZE, 8,
|
|
||||||
EGL_BLUE_SIZE, 8,
|
|
||||||
EGL_ALPHA_SIZE, 8,
|
|
||||||
EGL_DEPTH_SIZE, 8,
|
|
||||||
EGL_STENCIL_SIZE, 8,
|
|
||||||
EGL_SAMPLE_BUFFERS, 0,
|
|
||||||
EGL_NONE
|
|
||||||
};
|
|
||||||
|
|
||||||
EGLint surfaceAttribList[] = {
|
|
||||||
EGL_NONE, EGL_NONE
|
|
||||||
};
|
|
||||||
|
|
||||||
EGLint numConfigs;
|
|
||||||
EGLint majorVersion;
|
|
||||||
EGLint minorVersion;
|
|
||||||
EGLConfig config;
|
|
||||||
EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE, EGL_NONE };
|
|
||||||
|
|
||||||
IUnknown* dummy = nullptr;
|
|
||||||
HRESULT result = CreateWinrtEglWindow(WINRT_EGL_IUNKNOWN(dummy), featureLevel, m_eglWindow.GetAddressOf());
|
|
||||||
if (!SUCCEEDED(result))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_display = eglGetDisplay(m_eglWindow);
|
|
||||||
if (m_display == EGL_NO_DISPLAY){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!eglInitialize(m_display, &majorVersion, &minorVersion)){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get configs
|
|
||||||
if (!eglGetConfigs(m_display, NULL, 0, &numConfigs)){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Choose config
|
|
||||||
if (!eglChooseConfig(m_display, configAttribList, &config, 1, &numConfigs)){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a GL context
|
|
||||||
m_context = eglCreateContext(m_display, config, EGL_NO_CONTEXT, contextAttribs);
|
|
||||||
if (m_context == EGL_NO_CONTEXT){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make the context current
|
|
||||||
// Note: we are not using a surface
|
|
||||||
if (!eglMakeCurrent(m_display, NULL, NULL, m_context)){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
|
|
||||||
#include "CCGL.h"
|
|
||||||
|
|
||||||
class ShaderCompiler
|
|
||||||
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ShaderCompiler();
|
|
||||||
~ShaderCompiler();
|
|
||||||
bool Compile(Windows::UI::Xaml::Controls::TextBlock^ resultText);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Windows::UI::Xaml::Controls::TextBlock^ m_resultText;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void InitializeCocos2d();
|
|
||||||
bool InitializeAngle(ANGLE_D3D_FEATURE_LEVEL featureLevel);
|
|
||||||
void CloseAngle();
|
|
||||||
|
|
||||||
Microsoft::WRL::ComPtr<IWinrtEglWindow> m_eglWindow;
|
|
||||||
EGLDisplay m_display;
|
|
||||||
EGLContext m_context;
|
|
||||||
bool m_initialized;
|
|
||||||
};
|
|
|
@ -1 +0,0 @@
|
||||||
#include "pch.h"
|
|
|
@ -1,16 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <wrl.h>
|
|
||||||
#include <wrl/client.h>
|
|
||||||
#include <d3d11_2.h>
|
|
||||||
#include <d2d1_2.h>
|
|
||||||
#include <d2d1effects_1.h>
|
|
||||||
#include <dwrite_2.h>
|
|
||||||
#include <wincodec.h>
|
|
||||||
#include <DirectXColors.h>
|
|
||||||
#include <DirectXMath.h>
|
|
||||||
#include <memory>
|
|
||||||
#include <agile.h>
|
|
||||||
#include <concrt.h>
|
|
||||||
#include <collection.h>
|
|
||||||
#include "App.xaml.h"
|
|
|
@ -1,8 +0,0 @@
|
||||||
How to compile precompiled shaders for Windows Phone 8.0 (WP8)
|
|
||||||
You need to use VS2013 with update 3.
|
|
||||||
|
|
||||||
1. Open the VS project Cocos2dShaderCompiler\Cocos2dShaderCompiler.sln
|
|
||||||
2. Build and run the project
|
|
||||||
3. Click the Compile button
|
|
||||||
4. Select the file cocos\platform\wp8\shaders\precompiledshaders.h in the file dialog box
|
|
||||||
5. Program will precompile all of the cached cocos2d-x shaders.
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ImportGroup Label="PropertySheets" />
|
|
||||||
<PropertyGroup Label="COCOS2">
|
|
||||||
<COCOS2D_PLATFORM Condition=" '$(COCOS2_PLATFORM)' == '' ">wp8</COCOS2D_PLATFORM>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Label="UserMacros">
|
|
||||||
<EngineRoot>$(MSBuildThisFileDirectory)..\..\..\</EngineRoot>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup />
|
|
||||||
<ItemDefinitionGroup>
|
|
||||||
<ClCompile>
|
|
||||||
<AdditionalIncludeDirectories>$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\include;$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\include;$(EngineRoot)external\freetype2\include\$(COCOS2D_PLATFORM)\freetype;$(EngineRoot)external\curl\include\$(COCOS2D_PLATFORM);$(EngineRoot)external\websockets\include\$(COCOS2D_PLATFORM);$(EngineRoot)cocos\platform\wp8;$(EngineRoot)cocos\platform\winrt;$(EngineRoot)cocos\platform;$(EngineRoot)cocos\editor-support;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\sqlite3\include;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos;$(EngineRoot)extensions;$(EngineRoot)external;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\unzip;$(EngineRoot)external\tinyxml2;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>WP8;_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<CompileAsWinRT>true</CompileAsWinRT>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
<MinimalRebuild>false</MinimalRebuild>
|
|
||||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
|
||||||
<DisableSpecificWarnings>4056;4244;4251;4756;4453;28204;</DisableSpecificWarnings>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<AdditionalDependencies>libGLESv2_phone.lib;libEGL_phone.lib;ws2_32.lib;libwebsockets.lib;libcurl.lib;libchipmunk.lib;zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;sqlite3.lib;d3d11.lib;dxgi.lib;dxguid.lib;xaudio2.lib;mfplat.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<AdditionalLibraryDirectories>$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\prebuilt\$(Platform);$(EngineRoot)cocos\platform\wp8;$(EngineRoot)external\curl\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\chipmunk\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\png\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\tiff\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\jpeg\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\freetype2\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);%(AdditionalLibraryDirectories);</AdditionalLibraryDirectories>
|
|
||||||
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<BuildMacro Include="EngineRoot">
|
|
||||||
<Value>$(EngineRoot)</Value>
|
|
||||||
<EnvironmentVariable>true</EnvironmentVariable>
|
|
||||||
</BuildMacro>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
|
@ -1,34 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ImportGroup Label="PropertySheets" />
|
|
||||||
<PropertyGroup Label="APP_DLLS">
|
|
||||||
<AngleBinPath Condition=" '$(AngleBinPath)' == '' ">$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\prebuilt\$(Platform)\</AngleBinPath>
|
|
||||||
<CurlBinPath Condition=" '$(CurlBinPath)' == '' ">$(EngineRoot)external\curl\prebuilt\$(COCOS2D_PLATFORM)\$(Platform)\</CurlBinPath>
|
|
||||||
<WebsocketsBinPath Condition=" '$(WebsocketsBinPath)' == '' ">$(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform)\</WebsocketsBinPath>
|
|
||||||
<SQLiteBinPath Condition=" '$(SQLiteBinPath)' == '' ">$(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform)\</SQLiteBinPath>
|
|
||||||
<CurlBinPath Condition=" '$(CurlBinPath)' == '' ">$(EngineRoot)external\curl\prebuilt\$(COCOS2D_PLATFORM)\$(Platform)\</CurlBinPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup Label="ANGLE">
|
|
||||||
<None Include="$(AngleBinPath)libEGL_phone.dll">
|
|
||||||
<DeploymentContent>true</DeploymentContent>
|
|
||||||
</None>
|
|
||||||
<None Include="$(AngleBinPath)libGLESv2_phone.dll">
|
|
||||||
<DeploymentContent>true</DeploymentContent>
|
|
||||||
</None>
|
|
||||||
<None Include="$(WebsocketsBinPath)libwebsockets.dll">
|
|
||||||
<DeploymentContent>true</DeploymentContent>
|
|
||||||
</None>
|
|
||||||
<None Include="$(SQLiteBinPath)sqlite3.dll">
|
|
||||||
<DeploymentContent>true</DeploymentContent>
|
|
||||||
</None>
|
|
||||||
<None Include="$(CurlBinPath)libcurl.dll">
|
|
||||||
<DeploymentContent>true</DeploymentContent>
|
|
||||||
</None>
|
|
||||||
<None Include="$(CurlBinPath)libeay32.dll">
|
|
||||||
<DeploymentContent>true</DeploymentContent>
|
|
||||||
</None>
|
|
||||||
<None Include="$(CurlBinPath)ssleay32.dll">
|
|
||||||
<DeploymentContent>true</DeploymentContent>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
|
@ -1,9 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ImportGroup Label="PropertySheets" />
|
|
||||||
<ItemDefinitionGroup>
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
</Project>
|
|
|
@ -1,611 +0,0 @@
|
||||||
/*
|
|
||||||
* cocos2d-x http://www.cocos2d-x.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2011 - cocos2d-x community
|
|
||||||
*
|
|
||||||
* Portions Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
* All Rights Reserved
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "Audio.h"
|
|
||||||
#include "MediaStreamer.h"
|
|
||||||
//#include "CCCommon.h"
|
|
||||||
|
|
||||||
inline void ThrowIfFailed(HRESULT hr)
|
|
||||||
{
|
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
|
||||||
// Set a breakpoint on this line to catch DX API errors.
|
|
||||||
throw Platform::Exception::CreateException(hr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void AudioEngineCallbacks::Initialize(Audio *audio)
|
|
||||||
{
|
|
||||||
m_audio = audio;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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.
|
|
||||||
void _stdcall AudioEngineCallbacks::OnCriticalError(HRESULT Error)
|
|
||||||
{
|
|
||||||
UNUSED_PARAM(Error);
|
|
||||||
m_audio->SetEngineExperiencedCriticalError();
|
|
||||||
};
|
|
||||||
|
|
||||||
Audio::Audio() :
|
|
||||||
m_backgroundID(0),
|
|
||||||
m_soundEffctVolume(1.0f),
|
|
||||||
m_backgroundMusicVolume(1.0f)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::Initialize()
|
|
||||||
{
|
|
||||||
m_engineExperiencedCriticalError = false;
|
|
||||||
|
|
||||||
m_musicEngine = nullptr;
|
|
||||||
m_soundEffectEngine = nullptr;
|
|
||||||
m_musicMasteringVoice = nullptr;
|
|
||||||
m_soundEffectMasteringVoice = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::CreateResources()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ThrowIfFailed(
|
|
||||||
XAudio2Create(&m_musicEngine)
|
|
||||||
);
|
|
||||||
|
|
||||||
#if defined(_DEBUG)
|
|
||||||
XAUDIO2_DEBUG_CONFIGURATION debugConfig = {0};
|
|
||||||
debugConfig.BreakMask = XAUDIO2_LOG_ERRORS;
|
|
||||||
debugConfig.TraceMask = XAUDIO2_LOG_ERRORS;
|
|
||||||
m_musicEngine->SetDebugConfiguration(&debugConfig);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_musicEngineCallback.Initialize(this);
|
|
||||||
m_musicEngine->RegisterForCallbacks(&m_musicEngineCallback);
|
|
||||||
|
|
||||||
// This sample plays the equivalent of background music, which we tag on the mastering voice as AudioCategory_GameMedia.
|
|
||||||
// In ordinary usage, if we were playing the music track with no effects, we could route it entirely through
|
|
||||||
// Media Foundation. Here we are using XAudio2 to apply a reverb effect to the music, so we use Media Foundation to
|
|
||||||
// decode the data then we feed it through the XAudio2 pipeline as a separate Mastering Voice, so that we can tag it
|
|
||||||
// as Game Media.
|
|
||||||
// We default the mastering voice to 2 channels to simplify the reverb logic.
|
|
||||||
ThrowIfFailed(
|
|
||||||
m_musicEngine->CreateMasteringVoice(&m_musicMasteringVoice, XAUDIO2_DEFAULT_CHANNELS, XAUDIO2_DEFAULT_SAMPLERATE, 0, nullptr, nullptr, AudioCategory_GameMedia)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create a separate engine and mastering voice for sound effects in the sample
|
|
||||||
// Games will use many voices in a complex graph for audio, mixing all effects down to a
|
|
||||||
// single mastering voice.
|
|
||||||
// We are creating an entirely new engine instance and mastering voice in order to tag
|
|
||||||
// our sound effects with the audio category AudioCategory_GameEffects.
|
|
||||||
ThrowIfFailed(
|
|
||||||
XAudio2Create(&m_soundEffectEngine)
|
|
||||||
);
|
|
||||||
|
|
||||||
m_soundEffectEngineCallback.Initialize(this);
|
|
||||||
m_soundEffectEngine->RegisterForCallbacks(&m_soundEffectEngineCallback);
|
|
||||||
|
|
||||||
// We default the mastering voice to 2 channels to simplify the reverb logic.
|
|
||||||
ThrowIfFailed(
|
|
||||||
m_soundEffectEngine->CreateMasteringVoice(&m_soundEffectMasteringVoice, XAUDIO2_DEFAULT_CHANNELS, XAUDIO2_DEFAULT_SAMPLERATE, 0, nullptr, nullptr, AudioCategory_GameEffects)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
m_engineExperiencedCriticalError = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int Audio::Hash(const char *key)
|
|
||||||
{
|
|
||||||
unsigned int len = strlen(key);
|
|
||||||
const char *end=key+len;
|
|
||||||
unsigned int hash;
|
|
||||||
|
|
||||||
for (hash = 0; key < end; key++)
|
|
||||||
{
|
|
||||||
hash *= 16777619;
|
|
||||||
hash ^= (unsigned int) (unsigned char) toupper(*key);
|
|
||||||
}
|
|
||||||
return (hash);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::ReleaseResources()
|
|
||||||
{
|
|
||||||
if (m_musicMasteringVoice != nullptr)
|
|
||||||
{
|
|
||||||
m_musicMasteringVoice->DestroyVoice();
|
|
||||||
m_musicMasteringVoice = nullptr;
|
|
||||||
}
|
|
||||||
if (m_soundEffectMasteringVoice != nullptr)
|
|
||||||
{
|
|
||||||
m_soundEffectMasteringVoice->DestroyVoice();
|
|
||||||
m_soundEffectMasteringVoice = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
EffectList::iterator EffectIter = m_soundEffects.begin();
|
|
||||||
for (; EffectIter != m_soundEffects.end(); EffectIter++)
|
|
||||||
{
|
|
||||||
if (EffectIter->second.m_soundEffectSourceVoice != nullptr)
|
|
||||||
{
|
|
||||||
EffectIter->second.m_soundEffectSourceVoice->DestroyVoice();
|
|
||||||
EffectIter->second.m_soundEffectSourceVoice = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_soundEffects.clear();
|
|
||||||
|
|
||||||
m_musicEngine = nullptr;
|
|
||||||
m_soundEffectEngine = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::Start()
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! m_backgroundFile.empty())
|
|
||||||
PlayBackgroundMusic(m_backgroundFile.c_str(), m_backgroundLoop);
|
|
||||||
}
|
|
||||||
|
|
||||||
// This sample processes audio buffers during the render cycle of the application.
|
|
||||||
// As long as the sample maintains a high-enough frame rate, this approach should
|
|
||||||
// not glitch audio. In game code, it is best for audio buffers to be processed
|
|
||||||
// on a separate thread that is not synced to the main render loop of the game.
|
|
||||||
void Audio::Render()
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError)
|
|
||||||
{
|
|
||||||
ReleaseResources();
|
|
||||||
Initialize();
|
|
||||||
CreateResources();
|
|
||||||
Start();
|
|
||||||
if (m_engineExperiencedCriticalError)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::PlayBackgroundMusic(const char* pszFilePath, bool bLoop)
|
|
||||||
{
|
|
||||||
m_backgroundFile = pszFilePath;
|
|
||||||
m_backgroundLoop = bLoop;
|
|
||||||
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
StopBackgroundMusic(true);
|
|
||||||
PlaySoundEffect(pszFilePath, bLoop, m_backgroundID, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::StopBackgroundMusic(bool bReleaseData)
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
StopSoundEffect(m_backgroundID);
|
|
||||||
|
|
||||||
if (bReleaseData){
|
|
||||||
UnloadSoundEffect(m_backgroundID);
|
|
||||||
RemoveFromList(m_backgroundID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::PauseBackgroundMusic()
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PauseSoundEffect(m_backgroundID);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::ResumeBackgroundMusic()
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ResumeSoundEffect(m_backgroundID);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::RewindBackgroundMusic()
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
RewindSoundEffect(m_backgroundID);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Audio::IsBackgroundMusicPlaying()
|
|
||||||
{
|
|
||||||
return IsSoundEffectStarted(m_backgroundID);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::SetBackgroundVolume(float volume)
|
|
||||||
{
|
|
||||||
m_backgroundMusicVolume = volume;
|
|
||||||
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_soundEffects.end() != m_soundEffects.find(m_backgroundID))
|
|
||||||
{
|
|
||||||
m_soundEffects[m_backgroundID].m_soundEffectSourceVoice->SetVolume(volume);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float Audio::GetBackgroundVolume()
|
|
||||||
{
|
|
||||||
return m_backgroundMusicVolume;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::SetSoundEffectVolume(float volume)
|
|
||||||
{
|
|
||||||
m_soundEffctVolume = volume;
|
|
||||||
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EffectList::iterator iter;
|
|
||||||
for (iter = m_soundEffects.begin(); iter != m_soundEffects.end(); iter++)
|
|
||||||
{
|
|
||||||
if (iter->first != m_backgroundID)
|
|
||||||
iter->second.m_soundEffectSourceVoice->SetVolume(m_soundEffctVolume);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float Audio::GetSoundEffectVolume()
|
|
||||||
{
|
|
||||||
return m_soundEffctVolume;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::PlaySoundEffect(const char* pszFilePath, bool bLoop, unsigned int& sound, bool isMusic)
|
|
||||||
{
|
|
||||||
sound = Hash(pszFilePath);
|
|
||||||
|
|
||||||
if (m_soundEffects.end() == m_soundEffects.find(sound))
|
|
||||||
{
|
|
||||||
PreloadSoundEffect(pszFilePath, isMusic);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_soundEffects.end() == m_soundEffects.find(sound))
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_soundEffects[sound].m_audioBuffer.LoopCount = bLoop ? XAUDIO2_LOOP_INFINITE : 0;
|
|
||||||
|
|
||||||
PlaySoundEffect(sound);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::PlaySoundEffect(unsigned int sound)
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_soundEffects.end() == m_soundEffects.find(sound))
|
|
||||||
return;
|
|
||||||
|
|
||||||
StopSoundEffect(sound);
|
|
||||||
|
|
||||||
ThrowIfFailed(
|
|
||||||
m_soundEffects[sound].m_soundEffectSourceVoice->SubmitSourceBuffer(&m_soundEffects[sound].m_audioBuffer)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
// If there's an error, then we'll recreate the engine on the next render pass
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SoundEffectData* soundEffect = &m_soundEffects[sound];
|
|
||||||
HRESULT hr = soundEffect->m_soundEffectSourceVoice->Start();
|
|
||||||
if FAILED(hr)
|
|
||||||
{
|
|
||||||
m_engineExperiencedCriticalError = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_soundEffects[sound].m_soundEffectStarted = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::StopSoundEffect(unsigned int sound)
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_soundEffects.end() == m_soundEffects.find(sound))
|
|
||||||
return;
|
|
||||||
|
|
||||||
HRESULT hr = m_soundEffects[sound].m_soundEffectSourceVoice->Stop();
|
|
||||||
HRESULT hr1 = m_soundEffects[sound].m_soundEffectSourceVoice->FlushSourceBuffers();
|
|
||||||
if (FAILED(hr) || FAILED(hr1))
|
|
||||||
{
|
|
||||||
// If there's an error, then we'll recreate the engine on the next render pass
|
|
||||||
m_engineExperiencedCriticalError = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_soundEffects[sound].m_soundEffectStarted = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::PauseSoundEffect(unsigned int sound)
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_soundEffects.end() == m_soundEffects.find(sound))
|
|
||||||
return;
|
|
||||||
|
|
||||||
HRESULT hr = m_soundEffects[sound].m_soundEffectSourceVoice->Stop();
|
|
||||||
if FAILED(hr)
|
|
||||||
{
|
|
||||||
// If there's an error, then we'll recreate the engine on the next render pass
|
|
||||||
m_engineExperiencedCriticalError = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::ResumeSoundEffect(unsigned int sound)
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_soundEffects.end() == m_soundEffects.find(sound))
|
|
||||||
return;
|
|
||||||
|
|
||||||
HRESULT hr = m_soundEffects[sound].m_soundEffectSourceVoice->Start();
|
|
||||||
if FAILED(hr)
|
|
||||||
{
|
|
||||||
// If there's an error, then we'll recreate the engine on the next render pass
|
|
||||||
m_engineExperiencedCriticalError = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::RewindSoundEffect(unsigned int sound)
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_soundEffects.end() == m_soundEffects.find(sound))
|
|
||||||
return;
|
|
||||||
|
|
||||||
StopSoundEffect(sound);
|
|
||||||
PlaySoundEffect(sound);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::PauseAllSoundEffects()
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EffectList::iterator iter;
|
|
||||||
for (iter = m_soundEffects.begin(); iter != m_soundEffects.end(); iter++)
|
|
||||||
{
|
|
||||||
if (iter->first != m_backgroundID)
|
|
||||||
PauseSoundEffect(iter->first);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::ResumeAllSoundEffects()
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EffectList::iterator iter;
|
|
||||||
for (iter = m_soundEffects.begin(); iter != m_soundEffects.end(); iter++)
|
|
||||||
{
|
|
||||||
if (iter->first != m_backgroundID)
|
|
||||||
ResumeSoundEffect(iter->first);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::StopAllSoundEffects(bool bReleaseData)
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EffectList::iterator iter;
|
|
||||||
for (iter = m_soundEffects.begin(); iter != m_soundEffects.end(); iter++)
|
|
||||||
{
|
|
||||||
if (iter->first != m_backgroundID){
|
|
||||||
StopSoundEffect(iter->first);
|
|
||||||
if (bReleaseData)
|
|
||||||
{
|
|
||||||
UnloadSoundEffect(iter->first);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bReleaseData)
|
|
||||||
{
|
|
||||||
for (iter = m_soundEffects.begin(); iter != m_soundEffects.end();)
|
|
||||||
{
|
|
||||||
if (iter->first != m_backgroundID){
|
|
||||||
m_soundEffects.erase(iter++);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iter++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Audio::IsSoundEffectStarted(unsigned int sound)
|
|
||||||
{
|
|
||||||
if (m_soundEffects.end() == m_soundEffects.find(sound))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return m_soundEffects[sound].m_soundEffectStarted;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::wstring CCUtf8ToUnicode(const char * pszUtf8Str)
|
|
||||||
{
|
|
||||||
std::wstring ret;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (! pszUtf8Str) break;
|
|
||||||
size_t len = strlen(pszUtf8Str);
|
|
||||||
if (len <= 0) break;
|
|
||||||
++len;
|
|
||||||
wchar_t * pwszStr = new wchar_t[len];
|
|
||||||
if (! pwszStr) break;
|
|
||||||
pwszStr[len - 1] = 0;
|
|
||||||
MultiByteToWideChar(CP_UTF8, 0, pszUtf8Str, len, pwszStr, len);
|
|
||||||
ret = pwszStr;
|
|
||||||
|
|
||||||
if(pwszStr) {
|
|
||||||
delete[] (pwszStr);
|
|
||||||
(pwszStr) = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} while (0);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CCUnicodeToUtf8(const wchar_t* pwszStr)
|
|
||||||
{
|
|
||||||
std::string ret;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if(! pwszStr) break;
|
|
||||||
size_t len = wcslen(pwszStr);
|
|
||||||
if (len <= 0) break;
|
|
||||||
|
|
||||||
char * pszUtf8Str = new char[len*3 + 1];
|
|
||||||
WideCharToMultiByte(CP_UTF8, 0, pwszStr, len+1, pszUtf8Str, len*3 + 1, 0, 0);
|
|
||||||
ret = pszUtf8Str;
|
|
||||||
|
|
||||||
if(pszUtf8Str) {
|
|
||||||
delete[] (pszUtf8Str);
|
|
||||||
(pszUtf8Str) = 0;
|
|
||||||
}
|
|
||||||
}while(0);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::PreloadSoundEffect(const char* pszFilePath, bool isMusic)
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sound = Hash(pszFilePath);
|
|
||||||
|
|
||||||
MediaStreamer mediaStreamer;
|
|
||||||
mediaStreamer.Initialize(CCUtf8ToUnicode(pszFilePath).c_str());
|
|
||||||
m_soundEffects[sound].m_soundID = sound;
|
|
||||||
|
|
||||||
uint32 bufferLength = mediaStreamer.GetMaxStreamLengthInBytes();
|
|
||||||
m_soundEffects[sound].m_soundEffectBufferData = new byte[bufferLength];
|
|
||||||
mediaStreamer.ReadAll(m_soundEffects[sound].m_soundEffectBufferData, bufferLength, &m_soundEffects[sound].m_soundEffectBufferLength);
|
|
||||||
|
|
||||||
if (isMusic)
|
|
||||||
{
|
|
||||||
XAUDIO2_SEND_DESCRIPTOR descriptors[1];
|
|
||||||
descriptors[0].pOutputVoice = m_musicMasteringVoice;
|
|
||||||
descriptors[0].Flags = 0;
|
|
||||||
XAUDIO2_VOICE_SENDS sends = {0};
|
|
||||||
sends.SendCount = 1;
|
|
||||||
sends.pSends = descriptors;
|
|
||||||
|
|
||||||
ThrowIfFailed(
|
|
||||||
m_musicEngine->CreateSourceVoice(&m_soundEffects[sound].m_soundEffectSourceVoice,
|
|
||||||
&(mediaStreamer.GetOutputWaveFormatEx()), 0, 1.0f, &m_voiceContext, &sends)
|
|
||||||
);
|
|
||||||
//fix bug: set a initial volume
|
|
||||||
m_soundEffects[sound].m_soundEffectSourceVoice->SetVolume(m_backgroundMusicVolume);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
XAUDIO2_SEND_DESCRIPTOR descriptors[1];
|
|
||||||
descriptors[0].pOutputVoice = m_soundEffectMasteringVoice;
|
|
||||||
descriptors[0].Flags = 0;
|
|
||||||
XAUDIO2_VOICE_SENDS sends = {0};
|
|
||||||
sends.SendCount = 1;
|
|
||||||
sends.pSends = descriptors;
|
|
||||||
|
|
||||||
ThrowIfFailed(
|
|
||||||
m_soundEffectEngine->CreateSourceVoice(&m_soundEffects[sound].m_soundEffectSourceVoice,
|
|
||||||
&(mediaStreamer.GetOutputWaveFormatEx()), 0, 1.0f, &m_voiceContext, &sends, nullptr)
|
|
||||||
);
|
|
||||||
//fix bug: set a initial volume
|
|
||||||
m_soundEffects[sound].m_soundEffectSourceVoice->SetVolume(m_soundEffctVolume);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_soundEffects[sound].m_soundEffectSampleRate = mediaStreamer.GetOutputWaveFormatEx().nSamplesPerSec;
|
|
||||||
|
|
||||||
// Queue in-memory buffer for playback
|
|
||||||
ZeroMemory(&m_soundEffects[sound].m_audioBuffer, sizeof(m_soundEffects[sound].m_audioBuffer));
|
|
||||||
|
|
||||||
m_soundEffects[sound].m_audioBuffer.AudioBytes = m_soundEffects[sound].m_soundEffectBufferLength;
|
|
||||||
m_soundEffects[sound].m_audioBuffer.pAudioData = m_soundEffects[sound].m_soundEffectBufferData;
|
|
||||||
m_soundEffects[sound].m_audioBuffer.pContext = &m_soundEffects[sound];
|
|
||||||
m_soundEffects[sound].m_audioBuffer.Flags = XAUDIO2_END_OF_STREAM;
|
|
||||||
m_soundEffects[sound].m_audioBuffer.LoopCount = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::UnloadSoundEffect(const char* pszFilePath)
|
|
||||||
{
|
|
||||||
int sound = Hash(pszFilePath);
|
|
||||||
|
|
||||||
UnloadSoundEffect(sound);
|
|
||||||
|
|
||||||
RemoveFromList(sound);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::UnloadSoundEffect(unsigned int sound)
|
|
||||||
{
|
|
||||||
if (m_engineExperiencedCriticalError) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_soundEffects.end() == m_soundEffects.find(sound))
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_soundEffects[sound].m_soundEffectSourceVoice->DestroyVoice();
|
|
||||||
|
|
||||||
if(m_soundEffects[sound].m_soundEffectBufferData)
|
|
||||||
delete [] m_soundEffects[sound].m_soundEffectBufferData;
|
|
||||||
|
|
||||||
m_soundEffects[sound].m_soundEffectBufferData = nullptr;
|
|
||||||
m_soundEffects[sound].m_soundEffectSourceVoice = nullptr;
|
|
||||||
m_soundEffects[sound].m_soundEffectStarted = false;
|
|
||||||
ZeroMemory(&m_soundEffects[sound].m_audioBuffer, sizeof(m_soundEffects[sound].m_audioBuffer));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Audio::RemoveFromList( unsigned int sound )
|
|
||||||
{
|
|
||||||
m_soundEffects.erase(sound);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,167 +0,0 @@
|
||||||
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
|
||||||
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
||||||
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
|
||||||
//// PARTICULAR PURPOSE.
|
|
||||||
////
|
|
||||||
//// Copyright (c) Microsoft Corporation. All rights reserved
|
|
||||||
|
|
||||||
// For licensing information relating to this distribution please see Third Party Notices file.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <wrl.h>
|
|
||||||
#include <d3d11_1.h>
|
|
||||||
#include <agile.h>
|
|
||||||
#include <DirectXMath.h>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#define XAUDIO2_HELPER_FUNCTIONS 1
|
|
||||||
#include <xaudio2.h>
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
static const int STREAMING_BUFFER_SIZE = 65536;
|
|
||||||
static const int MAX_BUFFER_COUNT = 3;
|
|
||||||
|
|
||||||
#define UNUSED_PARAM(unusedparam) (void)unusedparam
|
|
||||||
|
|
||||||
struct SoundEffectData
|
|
||||||
{
|
|
||||||
unsigned int m_soundID;
|
|
||||||
IXAudio2SourceVoice* m_soundEffectSourceVoice;
|
|
||||||
XAUDIO2_BUFFER m_audioBuffer;
|
|
||||||
byte* m_soundEffectBufferData;
|
|
||||||
uint32 m_soundEffectBufferLength;
|
|
||||||
uint32 m_soundEffectSampleRate;
|
|
||||||
bool m_soundEffectStarted;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Audio;
|
|
||||||
class AudioEngineCallbacks: public IXAudio2EngineCallback
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
Audio *m_audio;
|
|
||||||
|
|
||||||
public :
|
|
||||||
AudioEngineCallbacks(){};
|
|
||||||
void Initialize(Audio* audio);
|
|
||||||
|
|
||||||
// Called by XAudio2 just before an audio processing pass begins.
|
|
||||||
void _stdcall OnProcessingPassStart(){};
|
|
||||||
|
|
||||||
// Called just after an audio processing pass ends.
|
|
||||||
void _stdcall OnProcessingPassEnd(){};
|
|
||||||
|
|
||||||
// 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.
|
|
||||||
void _stdcall OnCriticalError(HRESULT Error);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct StreamingVoiceContext : public IXAudio2VoiceCallback
|
|
||||||
{
|
|
||||||
STDMETHOD_(void, OnVoiceProcessingPassStart)(UINT32){}
|
|
||||||
STDMETHOD_(void, OnVoiceProcessingPassEnd)(){}
|
|
||||||
STDMETHOD_(void, OnStreamEnd)(){}
|
|
||||||
STDMETHOD_(void, OnBufferStart)(void*)
|
|
||||||
{
|
|
||||||
ResetEvent(hBufferEndEvent);
|
|
||||||
}
|
|
||||||
STDMETHOD_(void, OnBufferEnd)(void* pContext)
|
|
||||||
{
|
|
||||||
//Trigger the event for the music stream.
|
|
||||||
if (pContext == 0) {
|
|
||||||
SetEvent(hBufferEndEvent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
STDMETHOD_(void, OnLoopEnd)(void*){}
|
|
||||||
STDMETHOD_(void, OnVoiceError)(void*, HRESULT){}
|
|
||||||
|
|
||||||
HANDLE hBufferEndEvent;
|
|
||||||
StreamingVoiceContext() : hBufferEndEvent(CreateEventEx(NULL, FALSE, FALSE, NULL))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
virtual ~StreamingVoiceContext()
|
|
||||||
{
|
|
||||||
CloseHandle(hBufferEndEvent);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class Audio
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
IXAudio2* m_musicEngine;
|
|
||||||
IXAudio2* m_soundEffectEngine;
|
|
||||||
IXAudio2MasteringVoice* m_musicMasteringVoice;
|
|
||||||
IXAudio2MasteringVoice* m_soundEffectMasteringVoice;
|
|
||||||
|
|
||||||
StreamingVoiceContext m_voiceContext;
|
|
||||||
|
|
||||||
typedef std::map<unsigned int, SoundEffectData> EffectList;
|
|
||||||
typedef std::pair<unsigned int, SoundEffectData> Effect;
|
|
||||||
EffectList m_soundEffects;
|
|
||||||
|
|
||||||
unsigned int m_backgroundID;
|
|
||||||
std::string m_backgroundFile;
|
|
||||||
bool m_backgroundLoop;
|
|
||||||
|
|
||||||
float m_soundEffctVolume;
|
|
||||||
float m_backgroundMusicVolume;
|
|
||||||
|
|
||||||
bool m_engineExperiencedCriticalError;
|
|
||||||
AudioEngineCallbacks m_musicEngineCallback;
|
|
||||||
AudioEngineCallbacks m_soundEffectEngineCallback;
|
|
||||||
|
|
||||||
unsigned int Hash(const char* key);
|
|
||||||
|
|
||||||
public:
|
|
||||||
Audio();
|
|
||||||
|
|
||||||
void Initialize();
|
|
||||||
void CreateResources();
|
|
||||||
void ReleaseResources();
|
|
||||||
void Start();
|
|
||||||
void Render();
|
|
||||||
|
|
||||||
// This flag can be used to tell when the audio system is experiencing critial errors.
|
|
||||||
// XAudio2 gives a critical error when the user unplugs their headphones, and a new
|
|
||||||
// speaker configuration is generated.
|
|
||||||
void SetEngineExperiencedCriticalError()
|
|
||||||
{
|
|
||||||
m_engineExperiencedCriticalError = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HasEngineExperiencedCriticalError()
|
|
||||||
{
|
|
||||||
return m_engineExperiencedCriticalError;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlayBackgroundMusic(const char* pszFilePath, bool bLoop);
|
|
||||||
void StopBackgroundMusic(bool bReleaseData);
|
|
||||||
void PauseBackgroundMusic();
|
|
||||||
void ResumeBackgroundMusic();
|
|
||||||
void RewindBackgroundMusic();
|
|
||||||
bool IsBackgroundMusicPlaying();
|
|
||||||
|
|
||||||
void SetBackgroundVolume(float volume);
|
|
||||||
float GetBackgroundVolume();
|
|
||||||
void SetSoundEffectVolume(float volume);
|
|
||||||
float GetSoundEffectVolume();
|
|
||||||
|
|
||||||
void PlaySoundEffect(const char* pszFilePath, bool bLoop, unsigned int& sound, bool isMusic = false);
|
|
||||||
void PlaySoundEffect(unsigned int sound);
|
|
||||||
bool IsSoundEffectStarted(unsigned int sound);
|
|
||||||
void StopSoundEffect(unsigned int sound);
|
|
||||||
void PauseSoundEffect(unsigned int sound);
|
|
||||||
void ResumeSoundEffect(unsigned int sound);
|
|
||||||
void RewindSoundEffect(unsigned int sound);
|
|
||||||
|
|
||||||
void PauseAllSoundEffects();
|
|
||||||
void ResumeAllSoundEffects();
|
|
||||||
void StopAllSoundEffects(bool bReleaseData);
|
|
||||||
|
|
||||||
void PreloadSoundEffect(const char* pszFilePath, bool isMusic = false);
|
|
||||||
void UnloadSoundEffect(const char* pszFilePath);
|
|
||||||
void UnloadSoundEffect(unsigned int sound);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void RemoveFromList(unsigned int sound);
|
|
||||||
};
|
|
|
@ -1,216 +0,0 @@
|
||||||
/*
|
|
||||||
* cocos2d-x http://www.cocos2d-x.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2011 - cocos2d-x community
|
|
||||||
*
|
|
||||||
* Portions Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
* All Rights Reserved
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "MediaStreamer.h"
|
|
||||||
#include <wrl\wrappers\corewrappers.h>
|
|
||||||
#include <ppltasks.h>
|
|
||||||
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
using namespace Windows::Storage;
|
|
||||||
using namespace Windows::Storage::FileProperties;
|
|
||||||
using namespace Windows::Storage::Streams;
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::ApplicationModel;
|
|
||||||
using namespace Concurrency;
|
|
||||||
|
|
||||||
#ifndef MAKEFOURCC
|
|
||||||
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
|
|
||||||
((uint32)(byte)(ch0) | ((uint32)(byte)(ch1) << 8) | \
|
|
||||||
((uint32)(byte)(ch2) << 16) | ((uint32)(byte)(ch3) << 24 ))
|
|
||||||
#endif /* defined(MAKEFOURCC) */
|
|
||||||
|
|
||||||
inline void ThrowIfFailed(HRESULT hr)
|
|
||||||
{
|
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
|
||||||
// Set a breakpoint on this line to catch DX API errors.
|
|
||||||
throw Platform::Exception::CreateException(hr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MediaStreamer::MediaStreamer() :
|
|
||||||
m_offset(0)
|
|
||||||
{
|
|
||||||
ZeroMemory(&m_waveFormat, sizeof(m_waveFormat));
|
|
||||||
m_location = Package::Current->InstalledLocation;
|
|
||||||
m_locationPath = Platform::String::Concat(m_location->Path, "\\Assets\\Resources\\");
|
|
||||||
}
|
|
||||||
|
|
||||||
MediaStreamer::~MediaStreamer()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
Platform::Array<byte>^ MediaStreamer::ReadData(
|
|
||||||
_In_ Platform::String^ filename
|
|
||||||
)
|
|
||||||
{
|
|
||||||
CREATEFILE2_EXTENDED_PARAMETERS extendedParams = {0};
|
|
||||||
extendedParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
|
|
||||||
extendedParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
|
|
||||||
extendedParams.dwFileFlags = FILE_FLAG_SEQUENTIAL_SCAN;
|
|
||||||
extendedParams.dwSecurityQosFlags = SECURITY_ANONYMOUS;
|
|
||||||
extendedParams.lpSecurityAttributes = nullptr;
|
|
||||||
extendedParams.hTemplateFile = nullptr;
|
|
||||||
|
|
||||||
Wrappers::FileHandle file(
|
|
||||||
CreateFile2(
|
|
||||||
filename->Data(),
|
|
||||||
GENERIC_READ,
|
|
||||||
FILE_SHARE_READ,
|
|
||||||
OPEN_EXISTING,
|
|
||||||
&extendedParams
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if (file.Get()==INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
throw ref new Platform::FailureException();
|
|
||||||
}
|
|
||||||
|
|
||||||
FILE_STANDARD_INFO fileInfo = {0};
|
|
||||||
if (!GetFileInformationByHandleEx(
|
|
||||||
file.Get(),
|
|
||||||
FileStandardInfo,
|
|
||||||
&fileInfo,
|
|
||||||
sizeof(fileInfo)
|
|
||||||
))
|
|
||||||
{
|
|
||||||
throw ref new Platform::FailureException();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fileInfo.EndOfFile.HighPart != 0)
|
|
||||||
{
|
|
||||||
throw ref new Platform::OutOfMemoryException();
|
|
||||||
}
|
|
||||||
|
|
||||||
Platform::Array<byte>^ fileData = ref new Platform::Array<byte>(fileInfo.EndOfFile.LowPart);
|
|
||||||
|
|
||||||
if (!ReadFile(
|
|
||||||
file.Get(),
|
|
||||||
fileData->Data,
|
|
||||||
fileData->Length,
|
|
||||||
nullptr,
|
|
||||||
nullptr
|
|
||||||
) )
|
|
||||||
{
|
|
||||||
throw ref new Platform::FailureException();
|
|
||||||
}
|
|
||||||
|
|
||||||
return fileData;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MediaStreamer::Initialize(__in const WCHAR* url)
|
|
||||||
{
|
|
||||||
|
|
||||||
WCHAR filePath[MAX_PATH] = {0};
|
|
||||||
if ((wcslen(url) > 1 && url[1] == ':'))
|
|
||||||
{
|
|
||||||
// path start with "x:", is absolute path
|
|
||||||
wcscat_s(filePath, url);
|
|
||||||
}
|
|
||||||
else if (wcslen(url) > 0
|
|
||||||
&& (L'/' == url[0] || L'\\' == url[0]))
|
|
||||||
{
|
|
||||||
// path start with '/' or '\', is absolute path without driver name
|
|
||||||
wcscat_s(filePath, m_locationPath->Data());
|
|
||||||
// remove '/' or '\\'
|
|
||||||
wcscat_s(filePath, (const WCHAR*)url[1]);
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
wcscat_s(filePath, m_locationPath->Data());
|
|
||||||
wcscat_s(filePath, url);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Platform::Array<byte>^ data = ReadData(ref new Platform::String(filePath));
|
|
||||||
UINT32 length = data->Length;
|
|
||||||
const byte * dataPtr = data->Data;
|
|
||||||
UINT32 offset = 0;
|
|
||||||
|
|
||||||
DWORD riffDataSize = 0;
|
|
||||||
|
|
||||||
auto ReadChunk = [&length, &offset, &dataPtr, &riffDataSize](DWORD fourcc, DWORD& outChunkSize, DWORD& outChunkPos) -> HRESULT
|
|
||||||
{
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
if (offset + sizeof(DWORD) * 2 >= length)
|
|
||||||
{
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read two DWORDs.
|
|
||||||
DWORD chunkType = *reinterpret_cast<const DWORD *>(&dataPtr[offset]);
|
|
||||||
DWORD chunkSize = *reinterpret_cast<const DWORD *>(&dataPtr[offset + sizeof(DWORD)]);
|
|
||||||
offset += sizeof(DWORD) * 2;
|
|
||||||
|
|
||||||
if (chunkType == MAKEFOURCC('R', 'I', 'F', 'F'))
|
|
||||||
{
|
|
||||||
riffDataSize = chunkSize;
|
|
||||||
chunkSize = sizeof(DWORD);
|
|
||||||
outChunkSize = sizeof(DWORD);
|
|
||||||
outChunkPos = offset;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outChunkSize = chunkSize;
|
|
||||||
outChunkPos = offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
offset += chunkSize;
|
|
||||||
|
|
||||||
if (chunkType == fourcc)
|
|
||||||
{
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Locate riff chunk, check the file type.
|
|
||||||
DWORD chunkSize = 0;
|
|
||||||
DWORD chunkPos = 0;
|
|
||||||
|
|
||||||
ThrowIfFailed(ReadChunk(MAKEFOURCC('R', 'I', 'F', 'F'), chunkSize, chunkPos));
|
|
||||||
if (*reinterpret_cast<const DWORD *>(&dataPtr[chunkPos]) != MAKEFOURCC('W', 'A', 'V', 'E')) ThrowIfFailed(E_FAIL);
|
|
||||||
|
|
||||||
// Locate 'fmt ' chunk, copy to WAVEFORMATEXTENSIBLE.
|
|
||||||
ThrowIfFailed(ReadChunk(MAKEFOURCC('f', 'm', 't', ' '), chunkSize, chunkPos));
|
|
||||||
ThrowIfFailed((chunkSize <= sizeof(m_waveFormat)) ? S_OK : E_FAIL);
|
|
||||||
CopyMemory(&m_waveFormat, &dataPtr[chunkPos], chunkSize);
|
|
||||||
|
|
||||||
// Locate the 'data' chunk and copy its contents to a buffer.
|
|
||||||
ThrowIfFailed(ReadChunk(MAKEFOURCC('d', 'a', 't', 'a'), chunkSize, chunkPos));
|
|
||||||
m_data.resize(chunkSize);
|
|
||||||
CopyMemory(m_data.data(), &dataPtr[chunkPos], chunkSize);
|
|
||||||
|
|
||||||
m_offset = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MediaStreamer::ReadAll(uint8* buffer, uint32 maxBufferSize, uint32* bufferLength)
|
|
||||||
{
|
|
||||||
UINT32 toCopy = m_data.size() - m_offset;
|
|
||||||
if (toCopy > maxBufferSize) toCopy = maxBufferSize;
|
|
||||||
|
|
||||||
CopyMemory(buffer, m_data.data(), toCopy);
|
|
||||||
*bufferLength = toCopy;
|
|
||||||
|
|
||||||
m_offset += toCopy;
|
|
||||||
if (m_offset > m_data.size()) m_offset = m_data.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MediaStreamer::Restart()
|
|
||||||
{
|
|
||||||
m_offset = 0;
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
/*
|
|
||||||
* cocos2d-x http://www.cocos2d-x.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2011 - cocos2d-x community
|
|
||||||
*
|
|
||||||
* Portions Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
* All Rights Reserved
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <xaudio2.h>
|
|
||||||
|
|
||||||
ref class MediaStreamer
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
WAVEFORMATEX m_waveFormat;
|
|
||||||
uint32 m_maxStreamLengthInBytes;
|
|
||||||
std::vector<byte> m_data;
|
|
||||||
UINT32 m_offset;
|
|
||||||
Platform::Array<byte>^ ReadData(
|
|
||||||
_In_ Platform::String^ filename
|
|
||||||
);
|
|
||||||
internal:
|
|
||||||
Windows::Storage::StorageFolder^ m_location;
|
|
||||||
Platform::String^ m_locationPath;
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual ~MediaStreamer();
|
|
||||||
|
|
||||||
internal:
|
|
||||||
MediaStreamer();
|
|
||||||
|
|
||||||
WAVEFORMATEX& GetOutputWaveFormatEx()
|
|
||||||
{
|
|
||||||
return m_waveFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
UINT32 GetMaxStreamLengthInBytes()
|
|
||||||
{
|
|
||||||
return m_data.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Initialize(_In_ const WCHAR* url);
|
|
||||||
void ReadAll(uint8* buffer, uint32 maxBufferSize, uint32* bufferLength);
|
|
||||||
void Restart();
|
|
||||||
};
|
|
|
@ -1,198 +0,0 @@
|
||||||
/*
|
|
||||||
* cocos2d-x http://www.cocos2d-x.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2011 - cocos2d-x community
|
|
||||||
*
|
|
||||||
* Portions Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
* All Rights Reserved
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "SimpleAudioEngine.h"
|
|
||||||
#include "Audio.h"
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
//#include "CCCommon.h"
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace CocosDenshion {
|
|
||||||
|
|
||||||
Audio* s_audioController = NULL;
|
|
||||||
bool s_initialized = false;
|
|
||||||
|
|
||||||
SimpleAudioEngine* SimpleAudioEngine::getInstance()
|
|
||||||
{
|
|
||||||
static SimpleAudioEngine s_SharedEngine;
|
|
||||||
return &s_SharedEngine;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static Audio* sharedAudioController()
|
|
||||||
{
|
|
||||||
if (! s_audioController || !s_initialized)
|
|
||||||
{
|
|
||||||
if(s_audioController == NULL)
|
|
||||||
{
|
|
||||||
s_audioController = new Audio;
|
|
||||||
}
|
|
||||||
s_audioController->Initialize();
|
|
||||||
s_audioController->CreateResources();
|
|
||||||
s_initialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return s_audioController;
|
|
||||||
}
|
|
||||||
|
|
||||||
SimpleAudioEngine::SimpleAudioEngine()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
SimpleAudioEngine::~SimpleAudioEngine()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SimpleAudioEngine::end()
|
|
||||||
{
|
|
||||||
sharedAudioController()->StopBackgroundMusic(true);
|
|
||||||
sharedAudioController()->StopAllSoundEffects(true);
|
|
||||||
sharedAudioController()->ReleaseResources();
|
|
||||||
s_initialized = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// BackgroundMusic
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
|
|
||||||
{
|
|
||||||
if (! pszFilePath)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
sharedAudioController()->PlayBackgroundMusic(pszFilePath, bLoop);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)
|
|
||||||
{
|
|
||||||
sharedAudioController()->StopBackgroundMusic(bReleaseData);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::pauseBackgroundMusic()
|
|
||||||
{
|
|
||||||
sharedAudioController()->PauseBackgroundMusic();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::resumeBackgroundMusic()
|
|
||||||
{
|
|
||||||
sharedAudioController()->ResumeBackgroundMusic();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::rewindBackgroundMusic()
|
|
||||||
{
|
|
||||||
sharedAudioController()->RewindBackgroundMusic();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SimpleAudioEngine::willPlayBackgroundMusic()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SimpleAudioEngine::isBackgroundMusicPlaying()
|
|
||||||
{
|
|
||||||
return sharedAudioController()->IsBackgroundMusicPlaying();
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// effect function
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop,float pitch, float pan, float gain)
|
|
||||||
{
|
|
||||||
unsigned int sound;
|
|
||||||
sharedAudioController()->PlaySoundEffect(pszFilePath, bLoop, sound);
|
|
||||||
// TODO: need to support playEffect parameters
|
|
||||||
return sound;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::stopEffect(unsigned int nSoundId)
|
|
||||||
{
|
|
||||||
sharedAudioController()->StopSoundEffect(nSoundId);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
|
|
||||||
{
|
|
||||||
sharedAudioController()->PreloadSoundEffect(pszFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::pauseEffect(unsigned int nSoundId)
|
|
||||||
{
|
|
||||||
sharedAudioController()->PauseSoundEffect(nSoundId);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::resumeEffect(unsigned int nSoundId)
|
|
||||||
{
|
|
||||||
sharedAudioController()->ResumeSoundEffect(nSoundId);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::pauseAllEffects()
|
|
||||||
{
|
|
||||||
sharedAudioController()->PauseAllSoundEffects();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::resumeAllEffects()
|
|
||||||
{
|
|
||||||
sharedAudioController()->ResumeAllSoundEffects();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::stopAllEffects()
|
|
||||||
{
|
|
||||||
sharedAudioController()->StopAllSoundEffects(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)
|
|
||||||
{
|
|
||||||
UNUSED_PARAM(pszFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::unloadEffect(const char* pszFilePath)
|
|
||||||
{
|
|
||||||
sharedAudioController()->UnloadSoundEffect(pszFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
// volume interface
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
float SimpleAudioEngine::getBackgroundMusicVolume()
|
|
||||||
{
|
|
||||||
return sharedAudioController()->GetBackgroundVolume();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::setBackgroundMusicVolume(float volume)
|
|
||||||
{
|
|
||||||
sharedAudioController()->SetBackgroundVolume((volume<=0.0f)? 0.0f : volume);
|
|
||||||
}
|
|
||||||
|
|
||||||
float SimpleAudioEngine::getEffectsVolume()
|
|
||||||
{
|
|
||||||
return sharedAudioController()->GetSoundEffectVolume();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimpleAudioEngine::setEffectsVolume(float volume)
|
|
||||||
{
|
|
||||||
sharedAudioController()->SetSoundEffectVolume((volume<=0.0f)? 0.0f : volume);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end of namespace CocosDenshion
|
|
|
@ -1,372 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|ARM">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|ARM">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{7D4FC6EB-9497-4804-98F3-3EAEDC896154}</ProjectGuid>
|
|
||||||
<RootNamespace>libSpine</RootNamespace>
|
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
|
||||||
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="..\..\..\2d\wp8_props\cocos2d_wp8.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<Import Project="..\..\..\2d\wp8_props\cocos2d_wp8.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="..\..\..\2d\wp8_props\cocos2d_wp8.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<Import Project="..\..\..\2d\wp8_props\cocos2d_wp8.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<PreprocessorDefinitions>WP8;_DEBUG;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
|
||||||
<ForcedIncludeFiles>
|
|
||||||
</ForcedIncludeFiles>
|
|
||||||
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<SDLCheck>false</SDLCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<Lib>
|
|
||||||
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
</Lib>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<PreprocessorDefinitions>WP8;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ForcedIncludeFiles>
|
|
||||||
</ForcedIncludeFiles>
|
|
||||||
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<SDLCheck>false</SDLCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<Lib>
|
|
||||||
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
|
|
||||||
</Lib>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<PreprocessorDefinitions>WP8;_DEBUG;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
|
||||||
<ForcedIncludeFiles>
|
|
||||||
</ForcedIncludeFiles>
|
|
||||||
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<SDLCheck>false</SDLCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<Lib>
|
|
||||||
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
</Lib>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<PreprocessorDefinitions>WP8;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ForcedIncludeFiles>
|
|
||||||
</ForcedIncludeFiles>
|
|
||||||
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<SDLCheck>false</SDLCheck>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<Lib>
|
|
||||||
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
|
|
||||||
</Lib>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Windows">
|
|
||||||
<IsWinMDFile>true</IsWinMDFile>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="platform.winmd">
|
|
||||||
<IsWinMDFile>true</IsWinMDFile>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="..\Animation.h" />
|
|
||||||
<ClInclude Include="..\AnimationState.h" />
|
|
||||||
<ClInclude Include="..\AnimationStateData.h" />
|
|
||||||
<ClInclude Include="..\Atlas.h" />
|
|
||||||
<ClInclude Include="..\AtlasAttachmentLoader.h" />
|
|
||||||
<ClInclude Include="..\Attachment.h" />
|
|
||||||
<ClInclude Include="..\AttachmentLoader.h" />
|
|
||||||
<ClInclude Include="..\Bone.h" />
|
|
||||||
<ClInclude Include="..\BoneData.h" />
|
|
||||||
<ClInclude Include="..\BoundingBoxAttachment.h" />
|
|
||||||
<ClInclude Include="..\Event.h" />
|
|
||||||
<ClInclude Include="..\EventData.h" />
|
|
||||||
<ClInclude Include="..\extension.h" />
|
|
||||||
<ClInclude Include="..\IkConstraint.h" />
|
|
||||||
<ClInclude Include="..\IkConstraintData.h" />
|
|
||||||
<ClInclude Include="..\Json.h" />
|
|
||||||
<ClInclude Include="..\MeshAttachment.h" />
|
|
||||||
<ClInclude Include="..\PolygonBatch.h" />
|
|
||||||
<ClInclude Include="..\RegionAttachment.h" />
|
|
||||||
<ClInclude Include="..\Skeleton.h" />
|
|
||||||
<ClInclude Include="..\SkeletonAnimation.h" />
|
|
||||||
<ClInclude Include="..\SkeletonBounds.h" />
|
|
||||||
<ClInclude Include="..\SkeletonData.h" />
|
|
||||||
<ClInclude Include="..\SkeletonJson.h" />
|
|
||||||
<ClInclude Include="..\SkeletonRenderer.h" />
|
|
||||||
<ClInclude Include="..\Skin.h" />
|
|
||||||
<ClInclude Include="..\SkinnedMeshAttachment.h" />
|
|
||||||
<ClInclude Include="..\Slot.h" />
|
|
||||||
<ClInclude Include="..\SlotData.h" />
|
|
||||||
<ClInclude Include="..\spine-cocos2dx.h" />
|
|
||||||
<ClInclude Include="..\spine.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="..\Animation.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\AnimationState.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\AnimationStateData.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Atlas.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\AtlasAttachmentLoader.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Attachment.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\AttachmentLoader.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Bone.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\BoneData.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\BoundingBoxAttachment.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Event.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\EventData.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\extension.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\IkConstraint.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\IkConstraintData.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Json.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\MeshAttachment.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\PolygonBatch.cpp" />
|
|
||||||
<ClCompile Include="..\RegionAttachment.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Skeleton.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkeletonAnimation.cpp" />
|
|
||||||
<ClCompile Include="..\SkeletonBounds.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkeletonData.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkeletonJson.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkeletonRenderer.cpp" />
|
|
||||||
<ClCompile Include="..\Skin.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkinnedMeshAttachment.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Slot.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SlotData.c">
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
|
||||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\spine-cocos2dx.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
|
@ -1,200 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup>
|
|
||||||
<Filter Include="Header Files">
|
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Source Files">
|
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
|
||||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
|
||||||
</Filter>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="..\Animation.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\AnimationState.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\AnimationStateData.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Atlas.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\AtlasAttachmentLoader.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Attachment.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\AttachmentLoader.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Bone.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\BoneData.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\BoundingBoxAttachment.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Event.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\EventData.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\extension.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\IkConstraint.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\IkConstraintData.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Json.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\MeshAttachment.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\PolygonBatch.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\RegionAttachment.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Skeleton.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\SkeletonAnimation.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\SkeletonBounds.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\SkeletonData.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\SkeletonJson.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\SkeletonRenderer.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Skin.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\SkinnedMeshAttachment.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Slot.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\SlotData.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\spine.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\spine-cocos2dx.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="..\Animation.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\AnimationState.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\AnimationStateData.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Atlas.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\AtlasAttachmentLoader.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Attachment.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\AttachmentLoader.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Bone.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\BoneData.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\BoundingBoxAttachment.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Event.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\EventData.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\extension.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\IkConstraint.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\IkConstraintData.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Json.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\MeshAttachment.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\PolygonBatch.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\RegionAttachment.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Skeleton.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkeletonAnimation.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkeletonBounds.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkeletonData.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkeletonJson.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkeletonRenderer.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Skin.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SkinnedMeshAttachment.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Slot.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\SlotData.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\spine-cocos2dx.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<FullDeploy>true</FullDeploy>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
|
@ -1,159 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|ARM">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|ARM">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{271fee84-9198-4c26-8567-4247c563b0b1}</ProjectGuid>
|
|
||||||
<RootNamespace>CopyTemplateFiles</RootNamespace>
|
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
|
||||||
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Command>echo "Copying WP8-XAML CPP template files"
|
|
||||||
xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "cpp" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\AppComponent\src\" /eiycq</Command>
|
|
||||||
</PostBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Command>echo "Copying WP8-XAML CPP template files"
|
|
||||||
xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "cpp" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\AppComponent\src\" /eiycq</Command>
|
|
||||||
</PostBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Command>echo "Copying WP8-XAML CPP template files"
|
|
||||||
xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "cpp" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\AppComponent\src\" /eiycq</Command>
|
|
||||||
</PostBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
</Link>
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Command>echo "Copying WP8-XAML CPP template files"
|
|
||||||
xcopy "xaml\App.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\App.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\MainPage.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\MainPage.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\EditBox.xaml" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "xaml\EditBox.xaml.cs" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\App\*" /eiycq
|
|
||||||
xcopy "cpp" "..\..\..\templates\cpp-template-default\proj.wp8-xaml\AppComponent\src\" /eiycq</Command>
|
|
||||||
</PostBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Windows">
|
|
||||||
<IsWinMDFile>true</IsWinMDFile>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="platform.winmd">
|
|
||||||
<IsWinMDFile>true</IsWinMDFile>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
|
@ -1,2 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<FullDeploy>true</FullDeploy>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
|
@ -1,191 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "Cocos2dRenderer.h"
|
|
||||||
#include "cocos2d.h"
|
|
||||||
#include "CCApplication.h"
|
|
||||||
#include "CCGLViewImpl-wp8.h"
|
|
||||||
#include "AppDelegate.h"
|
|
||||||
#include <ppltasks.h>
|
|
||||||
|
|
||||||
using namespace Concurrency;
|
|
||||||
using namespace DirectX;
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::UI::Core;
|
|
||||||
|
|
||||||
USING_NS_CC;
|
|
||||||
|
|
||||||
Cocos2dRenderer::Cocos2dRenderer(Windows::Graphics::Display::DisplayOrientations orientation): mInitialized(false), m_loadingComplete(false), m_delegate(nullptr), m_messageBoxDelegate(nullptr)
|
|
||||||
{
|
|
||||||
mApp = new AppDelegate();
|
|
||||||
m_orientation = orientation;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Creates and restores Cocos2d-x after DirectX and Angle contexts are created or updated
|
|
||||||
void Cocos2dRenderer::CreateGLResources()
|
|
||||||
{
|
|
||||||
auto director = cocos2d::Director::getInstance();
|
|
||||||
|
|
||||||
if(!mInitialized)
|
|
||||||
{
|
|
||||||
mInitialized = true;
|
|
||||||
GLViewImpl* glview = GLViewImpl::create("Test Cpp");
|
|
||||||
glview->Create(m_eglDisplay, m_eglContext, m_eglSurface, m_renderTargetSize.Width, m_renderTargetSize.Height,m_orientation);
|
|
||||||
director->setOpenGLView(glview);
|
|
||||||
glview->SetXamlEventDelegate(m_delegate);
|
|
||||||
glview->SetXamlMessageBoxDelegate(m_messageBoxDelegate);
|
|
||||||
glview->SetXamlEditBoxDelegate(m_editBoxDelegate);
|
|
||||||
CCApplication::getInstance()->run();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cocos2d::GL::invalidateStateCache();
|
|
||||||
cocos2d::ShaderCache::getInstance()->reloadDefaultGLPrograms();
|
|
||||||
cocos2d::DrawPrimitives::init();
|
|
||||||
cocos2d::VolatileTextureMgr::reloadAllTextures();
|
|
||||||
cocos2d::EventCustom recreatedEvent(EVENT_RENDERER_RECREATED);
|
|
||||||
director->getEventDispatcher()->dispatchEvent(&recreatedEvent);
|
|
||||||
cocos2d::Application::getInstance()->applicationWillEnterForeground();
|
|
||||||
director->setGLDefaultValues();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_loadingComplete = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::Connect()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// purge Cocos2d-x gl GL resourses since the DirectX/Angle Context has been lost
|
|
||||||
void Cocos2dRenderer::Disconnect()
|
|
||||||
{
|
|
||||||
Application::getInstance()->applicationDidEnterBackground();
|
|
||||||
cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);
|
|
||||||
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);
|
|
||||||
CloseAngle();
|
|
||||||
m_loadingComplete = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// save your game state here
|
|
||||||
IAsyncAction^ Cocos2dRenderer::OnSuspending()
|
|
||||||
{
|
|
||||||
return create_async([]() {
|
|
||||||
// save your game state here
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Cocos2dRenderer::OnUpdateDevice()
|
|
||||||
{
|
|
||||||
//GLView* glview = GLView::sharedOpenGLView();
|
|
||||||
GLViewImpl::sharedOpenGLView()->UpdateDevice(m_eglDisplay, m_eglContext, m_eglSurface);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::OnOrientationChanged(Windows::Graphics::Display::DisplayOrientations orientation)
|
|
||||||
{
|
|
||||||
DirectXBase::OnOrientationChanged(orientation);
|
|
||||||
GLViewImpl::sharedOpenGLView()->UpdateOrientation(orientation);
|
|
||||||
}
|
|
||||||
|
|
||||||
// return true if eglSwapBuffers was called by OnRender()
|
|
||||||
bool Cocos2dRenderer::OnRender()
|
|
||||||
{
|
|
||||||
if(m_loadingComplete)
|
|
||||||
{
|
|
||||||
//GLView* glview = GLView::sharedOpenGLView();
|
|
||||||
GLViewImpl::sharedOpenGLView()->Render();
|
|
||||||
return true; // eglSwapBuffers was called by glview->Render();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::OnKeyPressed(Platform::String^ text)
|
|
||||||
{
|
|
||||||
char szUtf8[8] = {0};
|
|
||||||
int nLen = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)text->Data(), 1, szUtf8, sizeof(szUtf8), NULL, NULL);
|
|
||||||
IMEDispatcher::sharedDispatcher()->dispatchInsertText(szUtf8, nLen);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::OnCocos2dKeyEvent(Cocos2dKeyEvent event)
|
|
||||||
{
|
|
||||||
switch(event)
|
|
||||||
{
|
|
||||||
case Cocos2dKeyEvent::Escape:
|
|
||||||
//Director::getInstance()()->getKeypadDispatcher()->dispatchKeypadMSG(kTypeBackClicked);
|
|
||||||
break;
|
|
||||||
case Cocos2dKeyEvent::Back:
|
|
||||||
IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward();
|
|
||||||
break;
|
|
||||||
case Cocos2dKeyEvent::Enter:
|
|
||||||
//SetFocus(false);
|
|
||||||
IMEDispatcher::sharedDispatcher()->dispatchInsertText("\n", 1);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::SetXamlEventDelegate(Cocos2dEventDelegate^ delegate)
|
|
||||||
{
|
|
||||||
m_delegate = delegate;
|
|
||||||
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
|
|
||||||
if(eglView)
|
|
||||||
{
|
|
||||||
eglView->SetXamlEventDelegate(delegate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::SetXamlMessageBoxDelegate(Cocos2dMessageBoxDelegate^ delegate)
|
|
||||||
{
|
|
||||||
m_messageBoxDelegate = delegate;
|
|
||||||
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
|
|
||||||
if(eglView)
|
|
||||||
{
|
|
||||||
eglView->SetXamlMessageBoxDelegate(delegate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::SetXamlEditBoxDelegate(Cocos2dEditBoxDelegate^ delegate)
|
|
||||||
{
|
|
||||||
m_editBoxDelegate = delegate;
|
|
||||||
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
|
|
||||||
if(eglView)
|
|
||||||
{
|
|
||||||
eglView->SetXamlEditBoxDelegate(delegate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::SetXamlOpenURLDelegate(Cocos2dOpenURLDelegate^ delegate)
|
|
||||||
{
|
|
||||||
m_openURLDelegate = delegate;
|
|
||||||
Application* app = Application::getInstance();
|
|
||||||
if (app)
|
|
||||||
{
|
|
||||||
app->SetXamlOpenURLDelegate(delegate);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,70 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "InputEvent.h"
|
|
||||||
#include "DirectXBase.h"
|
|
||||||
|
|
||||||
class AppDelegate;
|
|
||||||
|
|
||||||
ref class Cocos2dRenderer sealed : public DirectXBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Cocos2dRenderer(Windows::Graphics::Display::DisplayOrientations orientation);
|
|
||||||
|
|
||||||
// Direct3DBase methods.
|
|
||||||
virtual void OnOrientationChanged(Windows::Graphics::Display::DisplayOrientations orientation) override;
|
|
||||||
virtual bool OnRender() override;
|
|
||||||
virtual void CreateGLResources() override;
|
|
||||||
|
|
||||||
void OnBackButton();
|
|
||||||
void OnKeyPressed(Platform::String^ text);
|
|
||||||
void OnCocos2dKeyEvent(cocos2d::Cocos2dKeyEvent event);
|
|
||||||
void SetXamlEventDelegate(cocos2d::Cocos2dEventDelegate^ delegate);
|
|
||||||
void SetXamlMessageBoxDelegate(cocos2d::Cocos2dMessageBoxDelegate^ delegate);
|
|
||||||
void SetXamlEditBoxDelegate(cocos2d::Cocos2dEditBoxDelegate^ delegate);
|
|
||||||
void SetXamlOpenURLDelegate(cocos2d::Cocos2dOpenURLDelegate^ delegate);
|
|
||||||
|
|
||||||
Windows::Foundation::IAsyncAction^ OnSuspending();
|
|
||||||
void Connect();
|
|
||||||
void Disconnect();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void OnUpdateDevice() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
bool m_loadingComplete;
|
|
||||||
bool mInitialized;
|
|
||||||
|
|
||||||
cocos2d::Cocos2dEventDelegate^ m_delegate;
|
|
||||||
cocos2d::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
|
||||||
cocos2d::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
|
||||||
cocos2d::Cocos2dOpenURLDelegate^ m_openURLDelegate;
|
|
||||||
|
|
||||||
// The AppDelegate for the Cocos2D app
|
|
||||||
AppDelegate* mApp;
|
|
||||||
Windows::Graphics::Display::DisplayOrientations m_orientation;
|
|
||||||
};
|
|
|
@ -1,65 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "Direct3DContentProvider.h"
|
|
||||||
#include "Direct3DInterop.h"
|
|
||||||
|
|
||||||
using namespace cocos2d;
|
|
||||||
|
|
||||||
Direct3DContentProvider::Direct3DContentProvider(Direct3DInterop^ controller) :
|
|
||||||
m_controller(controller)
|
|
||||||
{
|
|
||||||
m_controller->RequestAdditionalFrame += ref new RequestAdditionalFrameHandler([=] ()
|
|
||||||
{
|
|
||||||
if (m_host)
|
|
||||||
{
|
|
||||||
m_host->RequestAdditionalFrame();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// IDrawingSurfaceContentProviderNative interface
|
|
||||||
HRESULT Direct3DContentProvider::Connect(_In_ IDrawingSurfaceRuntimeHostNative* host, _In_ ID3D11Device1* device)
|
|
||||||
{
|
|
||||||
m_host = host;
|
|
||||||
|
|
||||||
return m_controller->Connect(host, device);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DContentProvider::Disconnect()
|
|
||||||
{
|
|
||||||
m_controller->Disconnect();
|
|
||||||
m_host = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT Direct3DContentProvider::PrepareResources(_In_ const LARGE_INTEGER* presentTargetTime, _Inout_ DrawingSurfaceSizeF* desiredRenderTargetSize)
|
|
||||||
{
|
|
||||||
return m_controller->PrepareResources(presentTargetTime, desiredRenderTargetSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT Direct3DContentProvider::Draw(_In_ ID3D11Device1* device, _In_ ID3D11DeviceContext1* context, _In_ ID3D11RenderTargetView* renderTargetView)
|
|
||||||
{
|
|
||||||
return m_controller->Draw(device, context, renderTargetView);
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <wrl/module.h>
|
|
||||||
#include <Windows.Phone.Graphics.Interop.h>
|
|
||||||
#include <DrawingSurfaceNative.h>
|
|
||||||
|
|
||||||
#include "Direct3DInterop.h"
|
|
||||||
|
|
||||||
class Direct3DContentProvider : public Microsoft::WRL::RuntimeClass<
|
|
||||||
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::WinRtClassicComMix>,
|
|
||||||
ABI::Windows::Phone::Graphics::Interop::IDrawingSurfaceBackgroundContentProvider,
|
|
||||||
IDrawingSurfaceBackgroundContentProviderNative>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Direct3DContentProvider(cocos2d::Direct3DInterop^ controller);
|
|
||||||
|
|
||||||
// IDrawingSurfaceContentProviderNative
|
|
||||||
HRESULT STDMETHODCALLTYPE Connect(_In_ IDrawingSurfaceRuntimeHostNative* host, _In_ ID3D11Device1* device);
|
|
||||||
void STDMETHODCALLTYPE Disconnect();
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE PrepareResources(_In_ const LARGE_INTEGER* presentTargetTime, _Inout_ DrawingSurfaceSizeF* desiredRenderTargetSize);
|
|
||||||
HRESULT STDMETHODCALLTYPE Draw(_In_ ID3D11Device1* device, _In_ ID3D11DeviceContext1* context, _In_ ID3D11RenderTargetView* renderTargetView);
|
|
||||||
|
|
||||||
private:
|
|
||||||
cocos2d::Direct3DInterop^ m_controller;
|
|
||||||
Microsoft::WRL::ComPtr<IDrawingSurfaceRuntimeHostNative> m_host;
|
|
||||||
};
|
|
|
@ -1,201 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
#include "Direct3DInterop.h"
|
|
||||||
#include "Direct3DContentProvider.h"
|
|
||||||
#include "EditBoxEvent.h"
|
|
||||||
#include "cocos2d.h"
|
|
||||||
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::UI::Core;
|
|
||||||
using namespace Windows::UI::Input;
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
using namespace Windows::Phone::Graphics::Interop;
|
|
||||||
using namespace Windows::Phone::Input::Interop;
|
|
||||||
using namespace Windows::Graphics::Display;
|
|
||||||
using namespace DirectX;
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
|
|
||||||
Direct3DInterop::Direct3DInterop(Windows::Graphics::Display::DisplayOrientations orientation)
|
|
||||||
: mCurrentOrientation(orientation), m_delegate(nullptr)
|
|
||||||
{
|
|
||||||
m_renderer = ref new Cocos2dRenderer(mCurrentOrientation);
|
|
||||||
}
|
|
||||||
|
|
||||||
IDrawingSurfaceBackgroundContentProvider^ Direct3DInterop::CreateContentProvider()
|
|
||||||
{
|
|
||||||
ComPtr<Direct3DContentProvider> provider = Make<Direct3DContentProvider>(this);
|
|
||||||
return reinterpret_cast<IDrawingSurfaceBackgroundContentProvider^>(provider.Get());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Interface With Direct3DContentProvider
|
|
||||||
HRESULT Direct3DInterop::Connect(_In_ IDrawingSurfaceRuntimeHostNative* host, _In_ ID3D11Device1* device)
|
|
||||||
{
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::Disconnect()
|
|
||||||
{
|
|
||||||
m_renderer->Disconnect();
|
|
||||||
}
|
|
||||||
|
|
||||||
// IDrawingSurfaceManipulationHandler
|
|
||||||
void Direct3DInterop::SetManipulationHost(DrawingSurfaceManipulationHost^ manipulationHost)
|
|
||||||
{
|
|
||||||
manipulationHost->PointerPressed +=
|
|
||||||
ref new TypedEventHandler<DrawingSurfaceManipulationHost^, PointerEventArgs^>(this, &Direct3DInterop::OnPointerPressed);
|
|
||||||
|
|
||||||
manipulationHost->PointerMoved +=
|
|
||||||
ref new TypedEventHandler<DrawingSurfaceManipulationHost^, PointerEventArgs^>(this, &Direct3DInterop::OnPointerMoved);
|
|
||||||
|
|
||||||
manipulationHost->PointerReleased +=
|
|
||||||
ref new TypedEventHandler<DrawingSurfaceManipulationHost^, PointerEventArgs^>(this, &Direct3DInterop::OnPointerReleased);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::UpdateForWindowSizeChange(float width, float height)
|
|
||||||
{
|
|
||||||
m_renderer->UpdateForWindowSizeChange(width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
IAsyncAction^ Direct3DInterop::OnSuspending()
|
|
||||||
{
|
|
||||||
return m_renderer->OnSuspending();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::OnBackKeyPress()
|
|
||||||
{
|
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueueBackKeyPress();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pointer Event Handlers. We need to queue up pointer events to pass them to the drawing thread
|
|
||||||
void Direct3DInterop::OnPointerPressed(DrawingSurfaceManipulationHost^ sender, PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueuePointerEvent(cocos2d::PointerEventType::PointerPressed, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::OnPointerMoved(DrawingSurfaceManipulationHost^ sender, PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueuePointerEvent(cocos2d::PointerEventType::PointerMoved, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::OnPointerReleased(DrawingSurfaceManipulationHost^ sender, PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueuePointerEvent(cocos2d::PointerEventType::PointerReleased, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::OnOrientationChanged(Windows::Graphics::Display::DisplayOrientations orientation)
|
|
||||||
{
|
|
||||||
std::shared_ptr<cocos2d::InputEvent> e(new cocos2d::CustomInputEvent([this, orientation]()
|
|
||||||
{
|
|
||||||
m_renderer->OnOrientationChanged(orientation);
|
|
||||||
}));
|
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::OnCocos2dKeyEvent(Cocos2dKeyEvent key)
|
|
||||||
{
|
|
||||||
std::shared_ptr<cocos2d::InputEvent> e(new cocos2d::KeyboardEvent(key));
|
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Direct3DInterop::OnCocos2dKeyEvent(Cocos2dKeyEvent key, Platform::String^ text)
|
|
||||||
{
|
|
||||||
std::shared_ptr<cocos2d::InputEvent> e(new cocos2d::KeyboardEvent(key,text));
|
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Direct3DInterop::OnCocos2dEditboxEvent(Object^ sender, Platform::String^ args, Windows::Foundation::EventHandler<Platform::String^>^ handler)
|
|
||||||
{
|
|
||||||
std::shared_ptr<cocos2d::InputEvent> e(new EditBoxEvent(sender, args, handler));
|
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->QueueEvent(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::OnCocos2dOpenURL(Platform::String^ url)
|
|
||||||
{
|
|
||||||
m_openURLDelegate->Invoke(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HRESULT Direct3DInterop::PrepareResources(_In_ const LARGE_INTEGER* presentTargetTime, _Inout_ DrawingSurfaceSizeF* desiredRenderTargetSize)
|
|
||||||
{
|
|
||||||
desiredRenderTargetSize->width = WindowBounds.Width;
|
|
||||||
desiredRenderTargetSize->height = WindowBounds.Height;
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT Direct3DInterop::Draw(_In_ ID3D11Device1* device, _In_ ID3D11DeviceContext1* context, _In_ ID3D11RenderTargetView* renderTargetView)
|
|
||||||
{
|
|
||||||
m_renderer->UpdateDevice(device, context, renderTargetView);
|
|
||||||
|
|
||||||
cocos2d::GLViewImpl::sharedOpenGLView()->ProcessEvents();
|
|
||||||
m_renderer->Render();
|
|
||||||
RequestAdditionalFrame();
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::SetCocos2dEventDelegate(Cocos2dEventDelegate^ delegate)
|
|
||||||
{
|
|
||||||
m_delegate = delegate;
|
|
||||||
m_renderer->SetXamlEventDelegate(delegate);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::SetCocos2dMessageBoxDelegate(Cocos2dMessageBoxDelegate ^ delegate)
|
|
||||||
{
|
|
||||||
m_messageBoxDelegate = delegate;
|
|
||||||
m_renderer->SetXamlMessageBoxDelegate(delegate);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::SetCocos2dEditBoxDelegate(Cocos2dEditBoxDelegate ^ delegate)
|
|
||||||
{
|
|
||||||
m_editBoxDelegate = delegate;
|
|
||||||
m_renderer->SetXamlEditBoxDelegate(delegate);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DInterop::SetCocos2dOpenURLDelegate(Cocos2dOpenURLDelegate ^ delegate)
|
|
||||||
{
|
|
||||||
m_openURLDelegate = delegate;
|
|
||||||
m_renderer->SetXamlOpenURLDelegate(delegate);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Direct3DInterop::SendCocos2dEvent(Cocos2dEvent event)
|
|
||||||
{
|
|
||||||
Platform::String^ str;
|
|
||||||
if(m_delegate)
|
|
||||||
{
|
|
||||||
m_delegate->Invoke(event, str);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,100 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <wrl/client.h>
|
|
||||||
#include <mutex>
|
|
||||||
#include <queue>
|
|
||||||
#include <memory>
|
|
||||||
#include "Cocos2dRenderer.h"
|
|
||||||
#include "InputEvent.h"
|
|
||||||
#include <DrawingSurfaceNative.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
|
|
||||||
public delegate void RequestAdditionalFrameHandler();
|
|
||||||
|
|
||||||
[Windows::Foundation::Metadata::WebHostHidden]
|
|
||||||
public ref class Direct3DInterop sealed : public Windows::Phone::Input::Interop::IDrawingSurfaceManipulationHandler
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Direct3DInterop(Windows::Graphics::Display::DisplayOrientations orientation);
|
|
||||||
|
|
||||||
Windows::Phone::Graphics::Interop::IDrawingSurfaceBackgroundContentProvider^ CreateContentProvider();
|
|
||||||
|
|
||||||
// IDrawingSurfaceManipulationHandler
|
|
||||||
virtual void SetManipulationHost(Windows::Phone::Input::Interop::DrawingSurfaceManipulationHost^ manipulationHost);
|
|
||||||
|
|
||||||
event RequestAdditionalFrameHandler^ RequestAdditionalFrame;
|
|
||||||
|
|
||||||
|
|
||||||
void UpdateForWindowSizeChange(float width, float height);
|
|
||||||
Windows::Foundation::IAsyncAction^ OnSuspending();
|
|
||||||
|
|
||||||
void OnBackKeyPress();
|
|
||||||
void OnCocos2dKeyEvent(Cocos2dKeyEvent key);
|
|
||||||
void OnCocos2dKeyEvent(Cocos2dKeyEvent key, Platform::String^ text);
|
|
||||||
void OnCocos2dEditboxEvent(Platform::Object^ sender, Platform::String^ args, Windows::Foundation::EventHandler<Platform::String^>^ handler);
|
|
||||||
void OnOrientationChanged(Windows::Graphics::Display::DisplayOrientations orientation);
|
|
||||||
void OnCocos2dOpenURL(Platform::String^ url);
|
|
||||||
|
|
||||||
property Windows::Graphics::Display::DisplayOrientations WindowOrientation;
|
|
||||||
property Windows::Foundation::Size WindowBounds;
|
|
||||||
|
|
||||||
void SetCocos2dEventDelegate(Cocos2dEventDelegate^ delegate);
|
|
||||||
void SetCocos2dMessageBoxDelegate(Cocos2dMessageBoxDelegate ^ delegate);
|
|
||||||
void SetCocos2dEditBoxDelegate(Cocos2dEditBoxDelegate ^ delegate);
|
|
||||||
void SetCocos2dOpenURLDelegate(Cocos2dOpenURLDelegate ^ delegate);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Event Handlers
|
|
||||||
void OnPointerPressed(Windows::Phone::Input::Interop::DrawingSurfaceManipulationHost^ sender, Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
void OnPointerMoved(Windows::Phone::Input::Interop::DrawingSurfaceManipulationHost^ sender, Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
void OnPointerReleased(Windows::Phone::Input::Interop::DrawingSurfaceManipulationHost^ sender, Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
|
|
||||||
internal:
|
|
||||||
HRESULT Connect(_In_ IDrawingSurfaceRuntimeHostNative* host, _In_ ID3D11Device1* device);
|
|
||||||
void Disconnect();
|
|
||||||
HRESULT PrepareResources(_In_ const LARGE_INTEGER* presentTargetTime, _Inout_ DrawingSurfaceSizeF* desiredRenderTargetSize);
|
|
||||||
HRESULT Draw(_In_ ID3D11Device1* device, _In_ ID3D11DeviceContext1* context, _In_ ID3D11RenderTargetView* renderTargetView);
|
|
||||||
bool SendCocos2dEvent(Cocos2dEvent event);
|
|
||||||
|
|
||||||
private:
|
|
||||||
Cocos2dRenderer^ m_renderer;
|
|
||||||
Windows::Graphics::Display::DisplayOrientations mCurrentOrientation;
|
|
||||||
|
|
||||||
|
|
||||||
Cocos2dEventDelegate^ m_delegate;
|
|
||||||
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
|
||||||
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
|
||||||
Cocos2dOpenURLDelegate^ m_openURLDelegate;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,321 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "DirectXBase.h"
|
|
||||||
#include "DirectXHelper.h"
|
|
||||||
|
|
||||||
using namespace DirectX;
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::Graphics::Display;
|
|
||||||
|
|
||||||
// Constructor.
|
|
||||||
DirectXBase::DirectXBase()
|
|
||||||
: m_bAngleInitialized(false)
|
|
||||||
, m_eglDisplay(nullptr)
|
|
||||||
, m_eglSurface(nullptr)
|
|
||||||
, m_eglContext(nullptr)
|
|
||||||
, m_eglWindow(nullptr)
|
|
||||||
, m_eglPhoneWindow(nullptr)
|
|
||||||
, m_device(nullptr)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize the Direct3D resources required to run.
|
|
||||||
void DirectXBase::Initialize()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// These are the resources that depend on the device.
|
|
||||||
void DirectXBase::CreateDeviceResources()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXBase::SetDevice(ID3D11Device1* device)
|
|
||||||
{
|
|
||||||
if(m_device)
|
|
||||||
{
|
|
||||||
m_device->Release();
|
|
||||||
m_device = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_device = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXBase::UpdateDevice(ID3D11Device1* device, ID3D11DeviceContext1* context, ID3D11RenderTargetView* renderTargetView)
|
|
||||||
{
|
|
||||||
if (m_device != device)
|
|
||||||
{
|
|
||||||
CloseAngle();
|
|
||||||
device->AddRef();
|
|
||||||
m_device = device;
|
|
||||||
|
|
||||||
CreateDeviceResources();
|
|
||||||
|
|
||||||
// Force call to CreateWindowSizeDependentResources
|
|
||||||
m_renderTargetSize.Width = -1;
|
|
||||||
m_renderTargetSize.Height = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_featureLevel = device->GetFeatureLevel();
|
|
||||||
|
|
||||||
|
|
||||||
ComPtr<ID3D11Resource> renderTargetViewResource;
|
|
||||||
renderTargetView->GetResource(&renderTargetViewResource);
|
|
||||||
|
|
||||||
ComPtr<ID3D11Texture2D> backBuffer;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
renderTargetViewResource.As(&backBuffer)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Cache the rendertarget dimensions in our helper class for convenient use.
|
|
||||||
D3D11_TEXTURE2D_DESC backBufferDesc;
|
|
||||||
backBuffer->GetDesc(&backBufferDesc);
|
|
||||||
|
|
||||||
if (m_renderTargetSize.Width != static_cast<float>(backBufferDesc.Width) ||
|
|
||||||
m_renderTargetSize.Height != static_cast<float>(backBufferDesc.Height))
|
|
||||||
{
|
|
||||||
m_renderTargetSize.Width = static_cast<float>(backBufferDesc.Width);
|
|
||||||
m_renderTargetSize.Height = static_cast<float>(backBufferDesc.Height);
|
|
||||||
CreateWindowSizeDependentResources();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!m_bAngleInitialized)
|
|
||||||
{
|
|
||||||
InitializeAngle(device, context, renderTargetView);
|
|
||||||
CreateGLResources();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_eglPhoneWindow->Update(device, context, renderTargetView);
|
|
||||||
}
|
|
||||||
|
|
||||||
OnUpdateDevice();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DirectXBase::UpdateForWindowSizeChange(float width, float height)
|
|
||||||
{
|
|
||||||
if (width != m_windowBounds.Width || height != m_windowBounds.Height)
|
|
||||||
{
|
|
||||||
m_windowBounds.Width = width;
|
|
||||||
m_windowBounds.Height = height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allocate all memory resources that depend on the window size.
|
|
||||||
void DirectXBase::CreateWindowSizeDependentResources()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXBase::OnOrientationChanged(DisplayOrientations orientation)
|
|
||||||
{
|
|
||||||
switch(orientation)
|
|
||||||
{
|
|
||||||
case DisplayOrientations::Portrait:
|
|
||||||
m_orientationMatrix = XMMatrixIdentity();
|
|
||||||
m_aspectRatio = m_renderTargetSize.Width / m_renderTargetSize.Height;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DisplayOrientations::PortraitFlipped:
|
|
||||||
m_orientationMatrix = XMMatrixRotationZ(XM_PI);
|
|
||||||
m_aspectRatio = m_renderTargetSize.Width / m_renderTargetSize.Height;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DisplayOrientations::Landscape:
|
|
||||||
m_orientationMatrix = XMMatrixRotationZ(-XM_PIDIV2);
|
|
||||||
m_aspectRatio = m_renderTargetSize.Height / m_renderTargetSize.Width;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DisplayOrientations::LandscapeFlipped:
|
|
||||||
m_orientationMatrix = XMMatrixRotationZ(XM_PIDIV2);
|
|
||||||
m_aspectRatio = m_renderTargetSize.Height / m_renderTargetSize.Width;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXBase::Render()
|
|
||||||
{
|
|
||||||
if(!OnRender())
|
|
||||||
{
|
|
||||||
eglSwapBuffers(m_eglDisplay, m_eglSurface);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXBase::CloseAngle()
|
|
||||||
{
|
|
||||||
eglMakeCurrent(NULL, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
if(m_eglPhoneWindow != nullptr)
|
|
||||||
{
|
|
||||||
m_eglPhoneWindow->Update(nullptr, nullptr, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(m_eglDisplay && m_eglContext)
|
|
||||||
{
|
|
||||||
eglDestroyContext(m_eglDisplay, m_eglContext);
|
|
||||||
m_eglContext = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(m_eglDisplay && m_eglSurface)
|
|
||||||
{
|
|
||||||
eglDestroySurface(m_eglDisplay, m_eglSurface);
|
|
||||||
m_eglSurface = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(m_eglDisplay)
|
|
||||||
{
|
|
||||||
eglTerminate(m_eglDisplay);
|
|
||||||
m_eglDisplay = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(m_device)
|
|
||||||
{
|
|
||||||
m_device->Release();
|
|
||||||
m_device = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_eglPhoneWindow = nullptr;
|
|
||||||
m_eglWindow = nullptr;
|
|
||||||
|
|
||||||
m_bAngleInitialized = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DirectXBase::InitializeAngle(ID3D11Device1* d3dDevice, ID3D11DeviceContext1* d3dContext, ID3D11RenderTargetView* d3dRenderTargetView)
|
|
||||||
{
|
|
||||||
// setup EGL
|
|
||||||
EGLint configAttribList[] = {
|
|
||||||
EGL_RED_SIZE, 8,
|
|
||||||
EGL_GREEN_SIZE, 8,
|
|
||||||
EGL_BLUE_SIZE, 8,
|
|
||||||
EGL_ALPHA_SIZE, 8,
|
|
||||||
EGL_DEPTH_SIZE, 8,
|
|
||||||
EGL_STENCIL_SIZE, 8,
|
|
||||||
EGL_SAMPLE_BUFFERS, 0,
|
|
||||||
EGL_NONE
|
|
||||||
};
|
|
||||||
EGLint surfaceAttribList[] = {
|
|
||||||
EGL_NONE, EGL_NONE
|
|
||||||
};
|
|
||||||
|
|
||||||
EGLint numConfigs;
|
|
||||||
EGLint majorVersion;
|
|
||||||
EGLint minorVersion;
|
|
||||||
EGLDisplay display;
|
|
||||||
EGLContext context;
|
|
||||||
EGLSurface surface;
|
|
||||||
EGLConfig config;
|
|
||||||
EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE, EGL_NONE };
|
|
||||||
|
|
||||||
// we need to select the correct DirectX feature level depending on the platform
|
|
||||||
// default is D3D_FEATURE_LEVEL_9_3 Windows Phone 8.0
|
|
||||||
ANGLE_D3D_FEATURE_LEVEL featureLevel = ANGLE_D3D_FEATURE_LEVEL::ANGLE_D3D_FEATURE_LEVEL_9_3;
|
|
||||||
|
|
||||||
switch(m_featureLevel)
|
|
||||||
{
|
|
||||||
case ANGLE_D3D_FEATURE_LEVEL_9_3:
|
|
||||||
featureLevel = ANGLE_D3D_FEATURE_LEVEL::ANGLE_D3D_FEATURE_LEVEL_9_3;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ANGLE_D3D_FEATURE_LEVEL_9_2:
|
|
||||||
featureLevel = ANGLE_D3D_FEATURE_LEVEL::ANGLE_D3D_FEATURE_LEVEL_9_2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ANGLE_D3D_FEATURE_LEVEL_9_1:
|
|
||||||
featureLevel = ANGLE_D3D_FEATURE_LEVEL::ANGLE_D3D_FEATURE_LEVEL_9_1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(m_eglPhoneWindow == nullptr)
|
|
||||||
{
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
CreateWinPhone8XamlWindow(&m_eglPhoneWindow)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_eglPhoneWindow->Update(d3dDevice, d3dContext, d3dRenderTargetView);
|
|
||||||
|
|
||||||
ComPtr<IUnknown> u;
|
|
||||||
HRESULT r = m_eglPhoneWindow.As(&u);
|
|
||||||
|
|
||||||
if(m_eglWindow == nullptr)
|
|
||||||
{ DX::ThrowIfFailed(
|
|
||||||
CreateWinrtEglWindow(u.Get(), featureLevel, m_eglWindow.GetAddressOf())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
display = eglGetDisplay(m_eglWindow);
|
|
||||||
if(display == EGL_NO_DISPLAY){
|
|
||||||
//ofLogError("ofAppWinRTWindow") << "couldn't get EGL display";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!eglInitialize(display, &majorVersion, &minorVersion)){
|
|
||||||
//ofLogError("ofAppWinRTWindow") << "failed to initialize EGL";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get configs
|
|
||||||
if ( !eglGetConfigs(display, NULL, 0, &numConfigs) ){
|
|
||||||
//ofLogError("ofAppWinRTWindow") << "failed to get configurations";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Choose config
|
|
||||||
if(!eglChooseConfig(display, configAttribList, &config, 1, &numConfigs)){
|
|
||||||
//ofLogError("ofAppWinRTWindow") << "failed to choose configuration";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a surface
|
|
||||||
surface = eglCreateWindowSurface(display, config, m_eglWindow, surfaceAttribList);
|
|
||||||
if(surface == EGL_NO_SURFACE){
|
|
||||||
//ofLogError("ofAppWinRTWindow") << "failed to create EGL window surface";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a GL context
|
|
||||||
context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs);
|
|
||||||
if(context == EGL_NO_CONTEXT){
|
|
||||||
//ofLogError("ofAppWinRTWindow") << "failed to create EGL context";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make the context current
|
|
||||||
if (!eglMakeCurrent(display, surface, surface, context)){
|
|
||||||
//ofLogError("ofAppWinRTWindow") << "failed to make EGL context current";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_eglDisplay = display;
|
|
||||||
m_eglSurface = surface;
|
|
||||||
m_eglContext = context;
|
|
||||||
|
|
||||||
m_bAngleInitialized = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
|
@ -1,84 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <d3d11_1.h>
|
|
||||||
#include <DirectXMath.h>
|
|
||||||
#include "EGL/egl.h"
|
|
||||||
#include "EGL/eglext.h"
|
|
||||||
#include "EGL/eglplatform.h"
|
|
||||||
#include "GLES2/gl2.h"
|
|
||||||
#include "GLES2/gl2ext.h"
|
|
||||||
#include "winrtangle.h"
|
|
||||||
|
|
||||||
// Helper class that initializes DirectX APIs for 3D rendering.
|
|
||||||
ref class DirectXBase abstract
|
|
||||||
{
|
|
||||||
internal:
|
|
||||||
DirectXBase();
|
|
||||||
|
|
||||||
virtual void Initialize();
|
|
||||||
virtual void CreateDeviceResources();
|
|
||||||
virtual void SetDevice(ID3D11Device1* device);
|
|
||||||
virtual void UpdateDevice(ID3D11Device1* device, ID3D11DeviceContext1* context, ID3D11RenderTargetView* renderTargetView);
|
|
||||||
virtual void UpdateForWindowSizeChange(float width, float height);
|
|
||||||
virtual void CreateWindowSizeDependentResources();
|
|
||||||
virtual void OnOrientationChanged(Windows::Graphics::Display::DisplayOrientations orientation);
|
|
||||||
|
|
||||||
virtual void CreateGLResources() = 0;
|
|
||||||
|
|
||||||
void Render();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// return true if eglSwapBuffers was called by OnRender
|
|
||||||
virtual bool OnRender() = 0;
|
|
||||||
virtual void OnUpdateDevice() = 0;
|
|
||||||
void CloseAngle();
|
|
||||||
|
|
||||||
protected private:
|
|
||||||
// Direct3D Objects.
|
|
||||||
ID3D11Device1* m_device;
|
|
||||||
|
|
||||||
D3D_FEATURE_LEVEL m_featureLevel;
|
|
||||||
|
|
||||||
bool InitializeAngle(ID3D11Device1* device, ID3D11DeviceContext1* context, ID3D11RenderTargetView* renderTargetView);
|
|
||||||
|
|
||||||
// Cached renderer properties.
|
|
||||||
Windows::Foundation::Size m_renderTargetSize;
|
|
||||||
Windows::Foundation::Rect m_windowBounds;
|
|
||||||
Windows::Graphics::Display::DisplayOrientations m_orientation;
|
|
||||||
|
|
||||||
// Angle EGL
|
|
||||||
bool m_bAngleInitialized;
|
|
||||||
EGLDisplay m_eglDisplay;
|
|
||||||
EGLContext m_eglContext;
|
|
||||||
EGLSurface m_eglSurface;
|
|
||||||
Microsoft::WRL::ComPtr<IWinrtEglWindow> m_eglWindow;
|
|
||||||
Microsoft::WRL::ComPtr<IWinPhone8XamlD3DWindow> m_eglPhoneWindow;
|
|
||||||
DirectX::XMMATRIX m_orientationMatrix;
|
|
||||||
float m_aspectRatio;
|
|
||||||
};
|
|
|
@ -1,47 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
|
||||||
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
||||||
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
|
||||||
//// PARTICULAR PURPOSE.
|
|
||||||
////
|
|
||||||
//// Copyright (c) Microsoft Corporation. All rights reserved
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
|
|
||||||
// This header defines helper utilities to make DirectX APIs work with exceptions.
|
|
||||||
namespace DX
|
|
||||||
{
|
|
||||||
inline void ThrowIfFailed(HRESULT hr)
|
|
||||||
{
|
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
|
||||||
// Set a breakpoint on this line to catch DX API errors.
|
|
||||||
throw Platform::Exception::CreateException(hr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2014 cocos2d-x.org
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "EditBoxEvent.h"
|
|
||||||
|
|
||||||
using namespace Platform;
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
EditBoxEvent::EditBoxEvent( Platform::Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler<Platform::String^>^ handle ):
|
|
||||||
m_sender(sender),
|
|
||||||
m_args(arg),
|
|
||||||
m_handler(handle)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void EditBoxEvent::execute()
|
|
||||||
{
|
|
||||||
if(m_handler.Get())
|
|
||||||
{
|
|
||||||
m_handler.Get()->Invoke(m_sender.Get(), m_args.Get());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2014 cocos2d-x.org
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef __EditBoxEVENT_H__
|
|
||||||
#define __EditBoxEVENT_H__
|
|
||||||
|
|
||||||
#include "InputEvent.h"
|
|
||||||
#include <agile.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
class EditBoxEvent : public cocos2d::InputEvent
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
EditBoxEvent(Platform::Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler<Platform::String^>^ handle);
|
|
||||||
|
|
||||||
virtual void execute();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Platform::Agile<Platform::Object^> m_sender;
|
|
||||||
Platform::Agile<Platform::String^> m_args;
|
|
||||||
Platform::Agile<Windows::Foundation::EventHandler<Platform::String^>^> m_handler;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,20 +0,0 @@
|
||||||
<Application
|
|
||||||
x:Class="cocos2d.App"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
|
||||||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
|
|
||||||
|
|
||||||
<!--Application Resources-->
|
|
||||||
<Application.Resources>
|
|
||||||
<local:LocalizedStrings xmlns:local="clr-namespace:cocos2d" x:Key="LocalizedStrings"/>
|
|
||||||
</Application.Resources>
|
|
||||||
|
|
||||||
<Application.ApplicationLifetimeObjects>
|
|
||||||
<!--Required object that handles lifetime events for the application-->
|
|
||||||
<shell:PhoneApplicationService
|
|
||||||
Launching="Application_Launching" Closing="Application_Closing"
|
|
||||||
Activated="Application_Activated" Deactivated="Application_Deactivated"/>
|
|
||||||
</Application.ApplicationLifetimeObjects>
|
|
||||||
|
|
||||||
</Application>
|
|
|
@ -1,362 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Resources;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Markup;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using Microsoft.Phone.Controls;
|
|
||||||
using Microsoft.Phone.Shell;
|
|
||||||
using System.IO.IsolatedStorage;
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
public partial class App : Application
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Provides easy access to the root frame of the Phone Application.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>The root frame of the Phone Application.</returns>
|
|
||||||
public static PhoneApplicationFrame RootFrame { get; private set; }
|
|
||||||
|
|
||||||
|
|
||||||
enum SessionType
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
Home,
|
|
||||||
DeepLink
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set to Home when the app is launched from Primary tile.
|
|
||||||
// Set to DeepLink when the app is launched from Deep Link.
|
|
||||||
private SessionType sessionType = SessionType.None;
|
|
||||||
|
|
||||||
// Set to true when the page navigation is being reset
|
|
||||||
bool wasRelaunched = false;
|
|
||||||
|
|
||||||
// set to true when 5 min passed since the app was relaunched
|
|
||||||
bool mustClearPagestack = false;
|
|
||||||
|
|
||||||
IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor for the Application object.
|
|
||||||
/// </summary>
|
|
||||||
public App()
|
|
||||||
{
|
|
||||||
// Global handler for uncaught exceptions.
|
|
||||||
UnhandledException += Application_UnhandledException;
|
|
||||||
|
|
||||||
// Standard XAML initialization
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
// Phone-specific initialization
|
|
||||||
InitializePhoneApplication();
|
|
||||||
|
|
||||||
// Show graphics profiling information while debugging.
|
|
||||||
if (Debugger.IsAttached)
|
|
||||||
{
|
|
||||||
// Display the current frame rate counters.
|
|
||||||
Application.Current.Host.Settings.EnableFrameRateCounter = false;
|
|
||||||
|
|
||||||
// Show the areas of the app that are being redrawn in each frame.
|
|
||||||
//Application.Current.Host.Settings.EnableRedrawRegions = true;
|
|
||||||
|
|
||||||
// Enable non-production analysis visualization mode,
|
|
||||||
// which shows areas of a page that are handed off to GPU with a colored overlay.
|
|
||||||
//Application.Current.Host.Settings.EnableCacheVisualization = true;
|
|
||||||
|
|
||||||
// Prevent the screen from turning off while under the debugger by disabling
|
|
||||||
// the application's idle detection.
|
|
||||||
// Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
|
|
||||||
// and consume battery power when the user is not using the phone.
|
|
||||||
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute when the application is launching (eg, from Start)
|
|
||||||
// This code will not execute when the application is reactivated
|
|
||||||
private void Application_Launching(object sender, LaunchingEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
// When a new instance of the app is launched, clear all deactivation settings
|
|
||||||
RemoveCurrentDeactivationSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute when the application is activated (brought to foreground)
|
|
||||||
// This code will not execute when the application is first launched
|
|
||||||
private void Application_Activated(object sender, ActivatedEventArgs e)
|
|
||||||
{
|
|
||||||
// If some interval has passed since the app was deactivated (30 seconds in this example),
|
|
||||||
// then remember to clear the back stack of pages
|
|
||||||
mustClearPagestack = CheckDeactivationTimeStamp();
|
|
||||||
|
|
||||||
|
|
||||||
// If IsApplicationInstancePreserved is not true, then set the session type to the value
|
|
||||||
// saved in isolated storage. This will make sure the session type is correct for an
|
|
||||||
// app that is being resumed after being tombstoned.
|
|
||||||
if (!e.IsApplicationInstancePreserved)
|
|
||||||
{
|
|
||||||
RestoreSessionType();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute when the application is deactivated (sent to background)
|
|
||||||
// This code will not execute when the application is closing
|
|
||||||
private void Application_Deactivated(object sender, DeactivatedEventArgs e)
|
|
||||||
{
|
|
||||||
// When the applicaiton is deactivated, save the current deactivation settings to isolated storage
|
|
||||||
SaveCurrentDeactivationSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute when the application is closing (eg, user hit Back)
|
|
||||||
// This code will not execute when the application is deactivated
|
|
||||||
private void Application_Closing(object sender, ClosingEventArgs e)
|
|
||||||
{
|
|
||||||
// When the application closes, delete any deactivation settings from isolated storage
|
|
||||||
RemoveCurrentDeactivationSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute if a navigation fails
|
|
||||||
private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
|
|
||||||
{
|
|
||||||
if (Debugger.IsAttached)
|
|
||||||
{
|
|
||||||
// A navigation has failed; break into the debugger
|
|
||||||
Debugger.Break();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute on Unhandled Exceptions
|
|
||||||
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
|
|
||||||
{
|
|
||||||
if (Debugger.IsAttached)
|
|
||||||
{
|
|
||||||
// An unhandled exception has occurred; break into the debugger
|
|
||||||
Debugger.Break();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Phone application initialization
|
|
||||||
|
|
||||||
// Avoid double-initialization
|
|
||||||
private bool phoneApplicationInitialized = false;
|
|
||||||
|
|
||||||
// Do not add any additional code to this method
|
|
||||||
private void InitializePhoneApplication()
|
|
||||||
{
|
|
||||||
if (phoneApplicationInitialized)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Create the frame but don't set it as RootVisual yet; this allows the splash
|
|
||||||
// screen to remain active until the application is ready to render.
|
|
||||||
RootFrame = new PhoneApplicationFrame();
|
|
||||||
RootFrame.Navigated += CompleteInitializePhoneApplication;
|
|
||||||
|
|
||||||
// Handle navigation failures
|
|
||||||
RootFrame.NavigationFailed += RootFrame_NavigationFailed;
|
|
||||||
|
|
||||||
// Handle reset requests for clearing the backstack
|
|
||||||
RootFrame.Navigated += CheckForResetNavigation;
|
|
||||||
|
|
||||||
// Monitor deep link launching
|
|
||||||
RootFrame.Navigating += RootFrame_Navigating;
|
|
||||||
|
|
||||||
// Ensure we don't initialize again
|
|
||||||
phoneApplicationInitialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Event handler for the Navigating event of the root frame. Use this handler to modify
|
|
||||||
// the default navigation behavior.
|
|
||||||
void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
// If the session type is None or New, check the navigation Uri to determine if the
|
|
||||||
// navigation is a deep link or if it points to the app's main page.
|
|
||||||
if (sessionType == SessionType.None && e.NavigationMode == NavigationMode.New)
|
|
||||||
{
|
|
||||||
// This block will run if the current navigation is part of the app's intial launch
|
|
||||||
|
|
||||||
|
|
||||||
// Keep track of Session Type
|
|
||||||
if (e.Uri.ToString().Contains("DeepLink=true"))
|
|
||||||
{
|
|
||||||
sessionType = SessionType.DeepLink;
|
|
||||||
}
|
|
||||||
else if (e.Uri.ToString().Contains("/MainPage.xaml"))
|
|
||||||
{
|
|
||||||
sessionType = SessionType.Home;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (e.NavigationMode == NavigationMode.Reset)
|
|
||||||
{
|
|
||||||
// This block will execute if the current navigation is a relaunch.
|
|
||||||
// If so, another navigation will be coming, so this records that a relaunch just happened
|
|
||||||
// so that the next navigation can use this info.
|
|
||||||
wasRelaunched = true;
|
|
||||||
}
|
|
||||||
else if (e.NavigationMode == NavigationMode.New && wasRelaunched)
|
|
||||||
{
|
|
||||||
// This block will run if the previous navigation was a relaunch
|
|
||||||
wasRelaunched = false;
|
|
||||||
|
|
||||||
if (e.Uri.ToString().Contains("DeepLink=true"))
|
|
||||||
{
|
|
||||||
// This block will run if the launch Uri contains "DeepLink=true" which
|
|
||||||
// was specified when the secondary tile was created in MainPage.xaml.cs
|
|
||||||
|
|
||||||
sessionType = SessionType.DeepLink;
|
|
||||||
// The app was relaunched via a Deep Link.
|
|
||||||
// The page stack will be cleared.
|
|
||||||
}
|
|
||||||
else if (e.Uri.ToString().Contains("/MainPage.xaml"))
|
|
||||||
{
|
|
||||||
// This block will run if the navigation Uri is the main page
|
|
||||||
if (sessionType == SessionType.DeepLink)
|
|
||||||
{
|
|
||||||
// When the app was previously launched via Deep Link and relaunched via Main Tile, we need to clear the page stack.
|
|
||||||
sessionType = SessionType.Home;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!mustClearPagestack)
|
|
||||||
{
|
|
||||||
//The app was previously launched via Main Tile and relaunched via Main Tile. Cancel the navigation to resume.
|
|
||||||
e.Cancel = true;
|
|
||||||
RootFrame.Navigated -= ClearBackStackAfterReset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mustClearPagestack = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Do not add any additional code to this method
|
|
||||||
private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
|
|
||||||
{
|
|
||||||
// Set the root visual to allow the application to render
|
|
||||||
if (RootVisual != RootFrame)
|
|
||||||
RootVisual = RootFrame;
|
|
||||||
|
|
||||||
// Remove this handler since it is no longer needed
|
|
||||||
RootFrame.Navigated -= CompleteInitializePhoneApplication;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CheckForResetNavigation(object sender, NavigationEventArgs e)
|
|
||||||
{
|
|
||||||
// If the app has received a 'reset' navigation, then we need to check
|
|
||||||
// on the next navigation to see if the page stack should be reset
|
|
||||||
if (e.NavigationMode == NavigationMode.Reset)
|
|
||||||
RootFrame.Navigated += ClearBackStackAfterReset;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ClearBackStackAfterReset(object sender, NavigationEventArgs e)
|
|
||||||
{
|
|
||||||
// Unregister the event so it doesn't get called again
|
|
||||||
RootFrame.Navigated -= ClearBackStackAfterReset;
|
|
||||||
|
|
||||||
// Only clear the stack for 'new' (forward) and 'refresh' navigations
|
|
||||||
if (e.NavigationMode != NavigationMode.New)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// For UI consistency, clear the entire page stack
|
|
||||||
while (RootFrame.RemoveBackEntry() != null)
|
|
||||||
{
|
|
||||||
; // do nothing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
// Helper method for adding or updating a key/value pair in isolated storage
|
|
||||||
public bool AddOrUpdateValue(string Key, Object value)
|
|
||||||
{
|
|
||||||
bool valueChanged = false;
|
|
||||||
|
|
||||||
// If the key exists
|
|
||||||
if (settings.Contains(Key))
|
|
||||||
{
|
|
||||||
// If the value has changed
|
|
||||||
if (settings[Key] != value)
|
|
||||||
{
|
|
||||||
// Store the new value
|
|
||||||
settings[Key] = value;
|
|
||||||
valueChanged = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Otherwise create the key.
|
|
||||||
else
|
|
||||||
{
|
|
||||||
settings.Add(Key, value);
|
|
||||||
valueChanged = true;
|
|
||||||
}
|
|
||||||
return valueChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper method for removing a key/value pair from isolated storage
|
|
||||||
public void RemoveValue(string Key)
|
|
||||||
{
|
|
||||||
// If the key exists
|
|
||||||
if (settings.Contains(Key))
|
|
||||||
{
|
|
||||||
settings.Remove(Key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the app is deactivating. Saves the time of the deactivation and the
|
|
||||||
// session type of the app instance to isolated storage.
|
|
||||||
public void SaveCurrentDeactivationSettings()
|
|
||||||
{
|
|
||||||
if (AddOrUpdateValue("DeactivateTime", DateTimeOffset.Now))
|
|
||||||
{
|
|
||||||
settings.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AddOrUpdateValue("SessionType", sessionType))
|
|
||||||
{
|
|
||||||
settings.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the app is launched or closed. Removes all deactivation settings from
|
|
||||||
// isolated storage
|
|
||||||
public void RemoveCurrentDeactivationSettings()
|
|
||||||
{
|
|
||||||
RemoveValue("DeactivateTime");
|
|
||||||
RemoveValue("SessionType");
|
|
||||||
settings.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper method to determine if the interval since the app was deactivated is
|
|
||||||
// greater than 30 seconds
|
|
||||||
bool CheckDeactivationTimeStamp()
|
|
||||||
{
|
|
||||||
DateTimeOffset lastDeactivated;
|
|
||||||
|
|
||||||
if (settings.Contains("DeactivateTime"))
|
|
||||||
{
|
|
||||||
lastDeactivated = (DateTimeOffset)settings["DeactivateTime"];
|
|
||||||
}
|
|
||||||
|
|
||||||
var currentDuration = DateTimeOffset.Now.Subtract(lastDeactivated);
|
|
||||||
|
|
||||||
return TimeSpan.FromSeconds(currentDuration.TotalSeconds) > TimeSpan.FromSeconds(30);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper method to restore the session type from isolated storage.
|
|
||||||
void RestoreSessionType()
|
|
||||||
{
|
|
||||||
if (settings.Contains("SessionType"))
|
|
||||||
{
|
|
||||||
sessionType = (SessionType)settings["SessionType"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
<UserControl x:Class="cocos2d.EditBox"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
|
||||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
|
||||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
|
||||||
d:DesignHeight="480" d:DesignWidth="480">
|
|
||||||
|
|
||||||
<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneSemitransparentBrush}">
|
|
||||||
<!--<TextBox KeyDown="OnKeyDownHandler" Height="72" x:Name="textinput" TextWrapping="Wrap" VerticalAlignment="Top" Margin="0,0,220,0" TextChanged="textinput_TextChanged"/>-->
|
|
||||||
<!-- comment TextBox and uncomment PasswordBox to use PasswordBox -->
|
|
||||||
<!--<PasswordBox KeyDown="OnKeyDownHandler" Height="72" x:Name="textinput" TextWrapping="Wrap" VerticalAlignment="Top" Margin="0,0,220,0" TextChanged="textinput_TextChanged"/>-->
|
|
||||||
<Button Content="Done" VerticalAlignment="Top" Width="108" Background="{StaticResource PhoneChromeBrush}" HorizontalAlignment="Right" Margin="0,0,120,0" Click="Done_Click"/>
|
|
||||||
<Button Content="Cancel" VerticalAlignment="Top" Width="131" Background="{StaticResource PhoneChromeBrush}" HorizontalAlignment="Right" Click="Cancel_Click"/>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
|
@ -1,190 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2014 cocos2d-x.org
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using Microsoft.Phone.Controls;
|
|
||||||
using Microsoft.Phone.Shell;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
public partial class EditBox : UserControl
|
|
||||||
{
|
|
||||||
private MainPage m_mainPage = null;
|
|
||||||
private String m_strText = "";
|
|
||||||
private String m_strPlaceholder = "";
|
|
||||||
private bool bIsFocus = false;
|
|
||||||
private int m_inputFlag = 0;
|
|
||||||
private Control m_textinput = null;
|
|
||||||
|
|
||||||
public void initTextinput(int maxLen, int inputMode)
|
|
||||||
{
|
|
||||||
if (m_inputFlag == 0)
|
|
||||||
{
|
|
||||||
// kEditBoxInputFlagPassword
|
|
||||||
PasswordBox pwdBox = new PasswordBox();
|
|
||||||
pwdBox.MaxLength = maxLen < 0 ? 0 : maxLen;
|
|
||||||
pwdBox.Password = m_strText;
|
|
||||||
pwdBox.GotFocus += pwdBox_GotFocus;
|
|
||||||
m_textinput = pwdBox;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TextBox textbox = new TextBox();
|
|
||||||
textbox.MaxLength = maxLen < 0 ? 0 : maxLen;
|
|
||||||
SetInputScope(textbox, inputMode);
|
|
||||||
textbox.TextChanged += textinput_TextChanged;
|
|
||||||
textbox.GotFocus += textinput_GotFocus;
|
|
||||||
textbox.LostFocus += textinput_LostFocus;
|
|
||||||
m_textinput = textbox;
|
|
||||||
}
|
|
||||||
m_textinput.Margin = new System.Windows.Thickness(0, 0, 220, 0);
|
|
||||||
m_textinput.Height = 72.0;
|
|
||||||
m_textinput.TabIndex = 0;
|
|
||||||
m_textinput.VerticalAlignment = VerticalAlignment.Top;
|
|
||||||
m_textinput.KeyDown += OnKeyDownHandler;
|
|
||||||
this.LayoutRoot.Children.Add(m_textinput);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pwdBox_GotFocus(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
((PasswordBox)m_textinput).SelectAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
public EditBox(MainPage page, String strPlaceholder, String strText, int maxLen, int inputMode, int inputFlag)
|
|
||||||
{
|
|
||||||
m_mainPage = page;
|
|
||||||
InitializeComponent();
|
|
||||||
m_strText = strText;
|
|
||||||
m_strPlaceholder = strPlaceholder;
|
|
||||||
m_inputFlag = inputFlag;
|
|
||||||
initTextinput(maxLen, inputMode);
|
|
||||||
this.Loaded += EditBox_Loaded;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EditBox_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
m_textinput.Focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
void textinput_LostFocus(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
// TextBox.LostFocus
|
|
||||||
TextBox curBox = (TextBox)m_textinput;
|
|
||||||
bIsFocus = false;
|
|
||||||
m_strText = curBox.Text;
|
|
||||||
string strText = "";
|
|
||||||
strText = curBox.Text;
|
|
||||||
if (strText == "" && m_inputFlag != 0)
|
|
||||||
{
|
|
||||||
curBox.Text = m_strPlaceholder;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void textinput_GotFocus(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
// TextBox.GotFocus
|
|
||||||
TextBox curBox = (TextBox)m_textinput;
|
|
||||||
bIsFocus = true;
|
|
||||||
curBox.Text = m_strText;
|
|
||||||
curBox.Select(curBox.Text.Length, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnKeyDownHandler(object sender, System.Windows.Input.KeyEventArgs e)
|
|
||||||
{
|
|
||||||
switch (e.Key)
|
|
||||||
{
|
|
||||||
case Key.Enter:
|
|
||||||
Done_Click(sender, null);
|
|
||||||
e.Handled = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Done_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
m_mainPage.OnSelectText(sender, m_inputFlag == 0 ? ((PasswordBox)m_textinput).Password : m_strText);
|
|
||||||
((Grid)this.Parent).Children.Remove(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Cancel_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
((Grid)this.Parent).Children.Remove(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textinput_TextChanged(object sender, TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
// TextBox.textinput_TextChanged
|
|
||||||
if (bIsFocus)
|
|
||||||
m_strText = ((TextBox)m_textinput).Text;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetInputScope(TextBox curBox, int inputMode)
|
|
||||||
{
|
|
||||||
// TextBox.SetInputScope
|
|
||||||
InputScope inputScope = new InputScope();
|
|
||||||
InputScopeName name = new InputScopeName();
|
|
||||||
|
|
||||||
switch (inputMode)
|
|
||||||
{
|
|
||||||
case 0:// kEditBoxInputModeAny
|
|
||||||
name.NameValue = InputScopeNameValue.Default;
|
|
||||||
break;
|
|
||||||
case 1:// kEditBoxInputModeEmailAddr
|
|
||||||
name.NameValue = InputScopeNameValue.EmailNameOrAddress;
|
|
||||||
break;
|
|
||||||
case 2:// kEditBoxInputModeNumeric
|
|
||||||
name.NameValue = InputScopeNameValue.Number;
|
|
||||||
break;
|
|
||||||
case 3:// kEditBoxInputModePhoneNumber
|
|
||||||
name.NameValue = InputScopeNameValue.TelephoneNumber;
|
|
||||||
break;
|
|
||||||
case 4:// kEditBoxInputModeUrl
|
|
||||||
name.NameValue = InputScopeNameValue.Url;
|
|
||||||
break;
|
|
||||||
case 5:// kEditBoxInputModeDecimal
|
|
||||||
name.NameValue = InputScopeNameValue.Digits;
|
|
||||||
break;
|
|
||||||
case 6:// kEditBoxInputModeSingleLine
|
|
||||||
name.NameValue = InputScopeNameValue.Default;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
name.NameValue = InputScopeNameValue.Default;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
inputScope.Names.Add(name);
|
|
||||||
curBox.InputScope = inputScope;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
<phone:PhoneApplicationPage
|
|
||||||
x:Class="cocos2d.MainPage"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
|
||||||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
|
||||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
|
||||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
|
||||||
SupportedOrientations="Landscape" Orientation="Landscape"
|
|
||||||
shell:SystemTray.IsVisible="False">
|
|
||||||
|
|
||||||
<!--LayoutRoot is the root grid where all page content is placed-->
|
|
||||||
<DrawingSurfaceBackgroundGrid x:Name="DrawingSurfaceBackground" Loaded="DrawingSurfaceBackground_Loaded">
|
|
||||||
<StackPanel Orientation="Horizontal" Margin="10,0,0,0" Height="30" VerticalAlignment="Top" x:Name="MemoryDisplay">
|
|
||||||
<TextBlock Text="Memory: "/>
|
|
||||||
<TextBlock x:Name="MemoryTextBlock"/>
|
|
||||||
<TextBlock Text=" MB"/>
|
|
||||||
<TextBlock Text=" Peak: "/>
|
|
||||||
<TextBlock x:Name="PeakMemoryTextBlock"/>
|
|
||||||
<TextBlock Text=" MB"/>
|
|
||||||
</StackPanel>
|
|
||||||
</DrawingSurfaceBackgroundGrid>
|
|
||||||
|
|
||||||
</phone:PhoneApplicationPage>
|
|
|
@ -1,251 +0,0 @@
|
||||||
#if DEBUG
|
|
||||||
#define DISPLAY_MEMORY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Animation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using Microsoft.Phone.Controls;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.Phone.Shell;
|
|
||||||
using Windows.UI.Input;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
using Microsoft.Phone.Info;
|
|
||||||
using Windows.Graphics.Display;
|
|
||||||
using Microsoft.Phone.Tasks;
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
public partial class MainPage : PhoneApplicationPage
|
|
||||||
{
|
|
||||||
private Direct3DInterop m_d3dInterop = null;
|
|
||||||
private DispatcherTimer m_timer;
|
|
||||||
|
|
||||||
// event handler for CCEditBox
|
|
||||||
private event EventHandler<String> m_receiveHandler;
|
|
||||||
|
|
||||||
// invisible XAML TextBox for Cocos2d-x keyboard input
|
|
||||||
TextBox m_textBox = null;
|
|
||||||
|
|
||||||
// Constructor
|
|
||||||
public MainPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
#if DISPLAY_MEMORY
|
|
||||||
StartTimer();
|
|
||||||
#else
|
|
||||||
MemoryDisplay.Visibility = Visibility.Collapsed;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
override protected void OnOrientationChanged(OrientationChangedEventArgs args)
|
|
||||||
{
|
|
||||||
base.OnOrientationChanged(args);
|
|
||||||
if (m_d3dInterop != null)
|
|
||||||
{
|
|
||||||
DisplayOrientations orientation = ConvertToNativeOrientation(args.Orientation);
|
|
||||||
m_d3dInterop.OnOrientationChanged(orientation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static DisplayOrientations ConvertToNativeOrientation(PageOrientation xamlOrientation)
|
|
||||||
{
|
|
||||||
switch (xamlOrientation)
|
|
||||||
{
|
|
||||||
case PageOrientation.Portrait:
|
|
||||||
case PageOrientation.PortraitUp:
|
|
||||||
return DisplayOrientations.Portrait;
|
|
||||||
case PageOrientation.PortraitDown:
|
|
||||||
return DisplayOrientations.PortraitFlipped;
|
|
||||||
case PageOrientation.Landscape:
|
|
||||||
case PageOrientation.LandscapeLeft:
|
|
||||||
return DisplayOrientations.Landscape;
|
|
||||||
case PageOrientation.LandscapeRight:
|
|
||||||
return DisplayOrientations.LandscapeFlipped;
|
|
||||||
default:
|
|
||||||
return DisplayOrientations.Landscape;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawingSurfaceBackground_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (m_d3dInterop == null)
|
|
||||||
{
|
|
||||||
PageOrientation pageOrientation = (PageOrientation)GetValue(OrientationProperty);
|
|
||||||
DisplayOrientations displayOrientation = ConvertToNativeOrientation(pageOrientation);
|
|
||||||
|
|
||||||
m_d3dInterop = new Direct3DInterop(displayOrientation);
|
|
||||||
|
|
||||||
// Set WindowBounds to size of DrawingSurface
|
|
||||||
m_d3dInterop.WindowBounds = new Windows.Foundation.Size(
|
|
||||||
(float)Application.Current.Host.Content.ActualWidth,
|
|
||||||
(float)Application.Current.Host.Content.ActualHeight
|
|
||||||
);
|
|
||||||
|
|
||||||
// Hook-up native component to DrawingSurfaceBackgroundGrid
|
|
||||||
DrawingSurfaceBackground.SetBackgroundContentProvider(m_d3dInterop.CreateContentProvider());
|
|
||||||
DrawingSurfaceBackground.SetBackgroundManipulationHandler(m_d3dInterop);
|
|
||||||
|
|
||||||
// Hook-up Cocos2d-x delegates
|
|
||||||
m_d3dInterop.SetCocos2dEventDelegate(OnCocos2dEvent);
|
|
||||||
m_d3dInterop.SetCocos2dMessageBoxDelegate(OnCocos2dMessageBoxEvent);
|
|
||||||
m_d3dInterop.SetCocos2dEditBoxDelegate(OpenEditBox);
|
|
||||||
m_d3dInterop.SetCocos2dOpenURLDelegate(OpenURL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// called when the user presses the back button on the device
|
|
||||||
protected override void OnBackKeyPress(CancelEventArgs e)
|
|
||||||
{
|
|
||||||
m_d3dInterop.OnBackKeyPress();
|
|
||||||
// cocos2d-x will async send Cocos2dEvent.TerminateApp event if it is time to exit app.
|
|
||||||
// We do not want to exit now, so we set e.Cancel to true.
|
|
||||||
e.Cancel = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnKeyDown(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
ModifierKeys modifiers = Keyboard.Modifiers;
|
|
||||||
|
|
||||||
switch (e.Key)
|
|
||||||
{
|
|
||||||
case Key.Escape:
|
|
||||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Escape);
|
|
||||||
e.Handled = true;
|
|
||||||
break;
|
|
||||||
case Key.Back:
|
|
||||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Back);
|
|
||||||
e.Handled = true;
|
|
||||||
break;
|
|
||||||
case Key.Enter:
|
|
||||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Enter);
|
|
||||||
e.Handled = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnKeyUp(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnTextChanged(object sender, TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (m_textBox.Text.Length > 0)
|
|
||||||
{
|
|
||||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text);
|
|
||||||
m_textBox.Text = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called by the Cocos2d-x C++ engine to display a MessageBox
|
|
||||||
public void OnCocos2dMessageBoxEvent(String title, String text)
|
|
||||||
{
|
|
||||||
Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show(text, title, MessageBoxButton.OK);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// events called by the Cocos2d-x C++ engine to be handled by C#
|
|
||||||
public void OnCocos2dEvent(Cocos2dEvent theEvent, String text)
|
|
||||||
{
|
|
||||||
Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
switch (theEvent)
|
|
||||||
{
|
|
||||||
case Cocos2dEvent.TerminateApp:
|
|
||||||
Application.Current.Terminate();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Cocos2dEvent.ShowKeyboard:
|
|
||||||
if (m_textBox == null)
|
|
||||||
{
|
|
||||||
m_textBox = new TextBox();
|
|
||||||
m_textBox.Opacity = 0.0;
|
|
||||||
m_textBox.Width = 1;
|
|
||||||
m_textBox.Height = 1;
|
|
||||||
m_textBox.KeyDown += OnKeyDown;
|
|
||||||
m_textBox.TextChanged += OnTextChanged;
|
|
||||||
DrawingSurfaceBackground.Children.Add(m_textBox);
|
|
||||||
}
|
|
||||||
m_textBox.SelectionLength = 0;
|
|
||||||
m_textBox.SelectionStart = int.MaxValue;
|
|
||||||
m_textBox.Focus();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Cocos2dEvent.HideKeyboard:
|
|
||||||
if (m_textBox != null)
|
|
||||||
{
|
|
||||||
DrawingSurfaceBackground.Children.Remove(m_textBox);
|
|
||||||
}
|
|
||||||
m_textBox = null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called by the Cocos2d-x C++ engine to display a CCEditBox
|
|
||||||
public void OpenEditBox(String strPlaceHolder, string strText, int maxLength, int inputMode, int inputFlag, EventHandler<String> receiveHandler)
|
|
||||||
{
|
|
||||||
m_receiveHandler = receiveHandler;
|
|
||||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
EditBox editbox = new EditBox(this, strPlaceHolder, strText, maxLength, inputMode, inputFlag);
|
|
||||||
DrawingSurfaceBackground.Children.Add(editbox);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSelectText(object sender, String str)
|
|
||||||
{
|
|
||||||
if (m_d3dInterop != null && m_receiveHandler != null)
|
|
||||||
{
|
|
||||||
m_d3dInterop.OnCocos2dEditboxEvent(sender, str, m_receiveHandler);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OpenURL(String url)
|
|
||||||
{
|
|
||||||
WebBrowserTask webBrowserTask = new WebBrowserTask();
|
|
||||||
webBrowserTask.Uri = new Uri(url, UriKind.Absolute);
|
|
||||||
webBrowserTask.Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StartTimer()
|
|
||||||
{
|
|
||||||
m_timer = new DispatcherTimer();
|
|
||||||
m_timer.Interval = new TimeSpan(0, 0, 1);
|
|
||||||
m_timer.Tick += new EventHandler(TimerTick);
|
|
||||||
m_timer.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TimerTick(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// These are TextBlock controls that are created in the page’s XAML file.
|
|
||||||
float value = DeviceStatus.ApplicationCurrentMemoryUsage / (1024.0f * 1024.0f);
|
|
||||||
MemoryTextBlock.Text = value.ToString();
|
|
||||||
value = DeviceStatus.ApplicationPeakMemoryUsage / (1024.0f * 1024.0f);
|
|
||||||
PeakMemoryTextBlock.Text = value.ToString();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MemoryTextBlock.Text = ex.Message;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,560 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "CCGLViewImpl-wp8.h"
|
|
||||||
#include "deprecated/CCSet.h"
|
|
||||||
#include "base/ccMacros.h"
|
|
||||||
#include "base/CCDirector.h"
|
|
||||||
#include "base/CCTouch.h"
|
|
||||||
#include "base/CCIMEDispatcher.h"
|
|
||||||
#include "CCApplication.h"
|
|
||||||
#include "CCWinRTUtils.h"
|
|
||||||
#include "deprecated/CCNotificationCenter.h"
|
|
||||||
|
|
||||||
using namespace Platform;
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::Foundation::Collections;
|
|
||||||
using namespace Windows::Graphics::Display;
|
|
||||||
using namespace Windows::UI::Input;
|
|
||||||
using namespace Windows::UI::Core;
|
|
||||||
using namespace Windows::UI::Xaml;
|
|
||||||
using namespace Windows::UI::Xaml::Media;
|
|
||||||
using namespace Windows::System;
|
|
||||||
using namespace Windows::UI::ViewManagement;
|
|
||||||
using namespace Windows::ApplicationModel;
|
|
||||||
using namespace Windows::ApplicationModel::Core;
|
|
||||||
using namespace Windows::ApplicationModel::Activation;
|
|
||||||
using namespace Windows::Phone::UI::Core;
|
|
||||||
using namespace Platform;
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
|
||||||
|
|
||||||
static GLViewImpl* s_pEglView = NULL;
|
|
||||||
|
|
||||||
GLViewImpl* GLViewImpl::create(const std::string& viewName)
|
|
||||||
{
|
|
||||||
auto ret = new GLViewImpl;
|
|
||||||
if(ret && ret->initWithFullScreen(viewName))
|
|
||||||
{
|
|
||||||
ret->autorelease();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GLViewImpl::GLViewImpl()
|
|
||||||
: _frameZoomFactor(1.0f)
|
|
||||||
, _supportTouch(true)
|
|
||||||
, _isRetina(false)
|
|
||||||
, m_lastPointValid(false)
|
|
||||||
, m_running(false)
|
|
||||||
, m_initialized(false)
|
|
||||||
, m_windowClosed(false)
|
|
||||||
, m_windowVisible(true)
|
|
||||||
, m_width(0)
|
|
||||||
, m_height(0)
|
|
||||||
, m_eglDisplay(nullptr)
|
|
||||||
, m_eglContext(nullptr)
|
|
||||||
, m_eglSurface(nullptr)
|
|
||||||
, m_delegate(nullptr)
|
|
||||||
, m_messageBoxDelegate(nullptr)
|
|
||||||
, m_orientation(DisplayOrientations::Landscape)
|
|
||||||
{
|
|
||||||
s_pEglView = this;
|
|
||||||
_viewName = "cocos2dx";
|
|
||||||
}
|
|
||||||
|
|
||||||
GLViewImpl::~GLViewImpl()
|
|
||||||
{
|
|
||||||
CC_ASSERT(this == s_pEglView);
|
|
||||||
s_pEglView = NULL;
|
|
||||||
|
|
||||||
// TODO: cleanup
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor)
|
|
||||||
{
|
|
||||||
setViewName(viewName);
|
|
||||||
setFrameSize(rect.size.width, rect.size.height);
|
|
||||||
setFrameZoomFactor(frameZoomFactor);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GLViewImpl::initWithFullScreen(const std::string& viewName)
|
|
||||||
{
|
|
||||||
return initWithRect(viewName, Rect(0, 0, m_width, m_height), 1.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool GLViewImpl::Create(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface, float width, float height, DisplayOrientations orientation)
|
|
||||||
{
|
|
||||||
m_orientation = orientation;
|
|
||||||
m_eglDisplay = eglDisplay;
|
|
||||||
m_eglContext = eglContext;
|
|
||||||
m_eglSurface = eglSurface;
|
|
||||||
UpdateForWindowSizeChange(width, height);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::UpdateDevice(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface)
|
|
||||||
{
|
|
||||||
m_eglDisplay = eglDisplay;
|
|
||||||
m_eglContext = eglContext;
|
|
||||||
m_eglSurface = eglSurface;
|
|
||||||
|
|
||||||
//UpdateForWindowSizeChange(width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::setIMEKeyboardState(bool bOpen)
|
|
||||||
{
|
|
||||||
std::string str;
|
|
||||||
setIMEKeyboardState(bOpen, str);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::setIMEKeyboardState(bool bOpen, std::string str)
|
|
||||||
{
|
|
||||||
if(m_delegate)
|
|
||||||
{
|
|
||||||
if(bOpen)
|
|
||||||
{
|
|
||||||
m_delegate->Invoke(Cocos2dEvent::ShowKeyboard, stringToPlatformString(str));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_delegate->Invoke(Cocos2dEvent::HideKeyboard, stringToPlatformString(str));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Platform::String^ GLViewImpl::stringToPlatformString(std::string strSrc)
|
|
||||||
{
|
|
||||||
// to wide char
|
|
||||||
int strLen = MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, NULL, 0);
|
|
||||||
wchar_t* wstr = new wchar_t[strLen + 1];
|
|
||||||
memset(wstr, 0, strLen + 1);
|
|
||||||
MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, wstr, strLen);
|
|
||||||
Platform::String^ strDst = ref new Platform::String(wstr);
|
|
||||||
delete[] wstr;
|
|
||||||
return strDst;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::swapBuffers()
|
|
||||||
{
|
|
||||||
eglSwapBuffers(m_eglDisplay, m_eglSurface);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool GLViewImpl::isOpenGLReady()
|
|
||||||
{
|
|
||||||
// TODO: need to revisit this
|
|
||||||
return (m_eglDisplay && m_orientation != DisplayOrientations::None);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::end()
|
|
||||||
{
|
|
||||||
m_windowClosed = true;
|
|
||||||
std::string str;
|
|
||||||
if (m_delegate) {
|
|
||||||
// Terminate app on Director::getInstance()->end();
|
|
||||||
m_delegate->Invoke(Cocos2dEvent::TerminateApp, stringToPlatformString(str));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GLViewImpl::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::OnResuming(Platform::Object^ sender, Platform::Object^ args)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// user pressed the Back Key on the phone
|
|
||||||
void GLViewImpl::OnBackKeyPress()
|
|
||||||
{
|
|
||||||
EventKeyboard event(EventKeyboard::KeyCode::KEY_ESCAPE, false);
|
|
||||||
Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
OnPointerPressed(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::OnPointerPressed(PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
int id = args->CurrentPoint->PointerId;
|
|
||||||
Vec2 pt = GetPoint(args);
|
|
||||||
handleTouchesBegin(1, &id, &pt.x, &pt.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GLViewImpl::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
float direction = (float)args->CurrentPoint->Properties->MouseWheelDelta;
|
|
||||||
int id = 0;
|
|
||||||
Vec2 p(0.0f,0.0f);
|
|
||||||
handleTouchesBegin(1, &id, &p.x, &p.y);
|
|
||||||
p.y += direction;
|
|
||||||
handleTouchesMove(1, &id, &p.x, &p.y);
|
|
||||||
handleTouchesEnd(1, &id, &p.x, &p.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
|
|
||||||
{
|
|
||||||
m_windowVisible = args->Visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
|
|
||||||
{
|
|
||||||
m_windowClosed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
OnPointerMoved(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::OnPointerMoved( PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
auto currentPoint = args->CurrentPoint;
|
|
||||||
if (currentPoint->IsInContact)
|
|
||||||
{
|
|
||||||
if (m_lastPointValid)
|
|
||||||
{
|
|
||||||
int id = args->CurrentPoint->PointerId;
|
|
||||||
Vec2 p = GetPoint(args);
|
|
||||||
handleTouchesMove(1, &id, &p.x, &p.y);
|
|
||||||
}
|
|
||||||
m_lastPoint = currentPoint->Position;
|
|
||||||
m_lastPointValid = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_lastPointValid = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
OnPointerReleased(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::OnPointerReleased(PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
int id = args->CurrentPoint->PointerId;
|
|
||||||
Vec2 pt = GetPoint(args);
|
|
||||||
handleTouchesEnd(1, &id, &pt.x, &pt.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GLViewImpl::resize(int width, int height)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::setFrameZoomFactor(float fZoomFactor)
|
|
||||||
{
|
|
||||||
_frameZoomFactor = fZoomFactor;
|
|
||||||
Director::getInstance()->setProjection(Director::getInstance()->getProjection());
|
|
||||||
//resize(m_obScreenSize.width * fZoomFactor, m_obScreenSize.height * fZoomFactor);
|
|
||||||
}
|
|
||||||
|
|
||||||
float GLViewImpl::getFrameZoomFactor()
|
|
||||||
{
|
|
||||||
return _frameZoomFactor;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::centerWindow()
|
|
||||||
{
|
|
||||||
// not implemented in WinRT. Window is always full screen
|
|
||||||
}
|
|
||||||
|
|
||||||
GLViewImpl* GLViewImpl::sharedOpenGLView()
|
|
||||||
{
|
|
||||||
return s_pEglView;
|
|
||||||
}
|
|
||||||
|
|
||||||
int GLViewImpl::Run()
|
|
||||||
{
|
|
||||||
// XAML version does not have a run loop
|
|
||||||
m_running = true;
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
void GLViewImpl::Render()
|
|
||||||
{
|
|
||||||
OnRendering();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::OnRendering()
|
|
||||||
{
|
|
||||||
if(m_running && m_initialized)
|
|
||||||
{
|
|
||||||
Director::getInstance()->mainLoop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool GLViewImpl::ShowMessageBox(Platform::String^ title, Platform::String^ message)
|
|
||||||
{
|
|
||||||
if(m_messageBoxDelegate)
|
|
||||||
{
|
|
||||||
m_messageBoxDelegate->Invoke(title, message);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GLViewImpl::OpenXamlEditBox(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler)
|
|
||||||
{
|
|
||||||
if(m_editBoxDelegate)
|
|
||||||
{
|
|
||||||
m_editBoxDelegate->Invoke(strPlaceHolder, strText, maxLength, inputMode, inputFlag, receiveHandler);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// called by orientation change from WP8 XAML
|
|
||||||
void GLViewImpl::UpdateOrientation(DisplayOrientations orientation)
|
|
||||||
{
|
|
||||||
if(m_orientation != orientation)
|
|
||||||
{
|
|
||||||
m_orientation = orientation;
|
|
||||||
UpdateWindowSize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// called by size change from WP8 XAML
|
|
||||||
void GLViewImpl::UpdateForWindowSizeChange(float width, float height)
|
|
||||||
{
|
|
||||||
m_width = width;
|
|
||||||
m_height = height;
|
|
||||||
UpdateWindowSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
win32 version
|
|
||||||
|
|
||||||
void GLViewEventHandler::OnGLFWWindowSizeFunCallback(GLFWwindow *windows, int width, int height)
|
|
||||||
{
|
|
||||||
auto view = Director::getInstance()->getOpenGLView();
|
|
||||||
if(view && view->getResolutionPolicy() != ResolutionPolicy::UNKNOWN)
|
|
||||||
{
|
|
||||||
Size resSize=view->getDesignResolutionSize();
|
|
||||||
ResolutionPolicy resPolicy=view->getResolutionPolicy();
|
|
||||||
view->setFrameSize(width, height);
|
|
||||||
view->setDesignResolutionSize(resSize.width, resSize.height, resPolicy);
|
|
||||||
Director::getInstance()->setViewport();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void GLViewImpl::UpdateWindowSize()
|
|
||||||
{
|
|
||||||
float width, height;
|
|
||||||
|
|
||||||
if(m_orientation == DisplayOrientations::Landscape || m_orientation == DisplayOrientations::LandscapeFlipped)
|
|
||||||
{
|
|
||||||
width = m_height;
|
|
||||||
height = m_width;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
width = m_width;
|
|
||||||
height = m_height;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateOrientationMatrix();
|
|
||||||
|
|
||||||
//CCSize designSize = getDesignResolutionSize();
|
|
||||||
if(!m_initialized)
|
|
||||||
{
|
|
||||||
m_initialized = true;
|
|
||||||
GLView::setFrameSize(width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto view = Director::getInstance()->getOpenGLView();
|
|
||||||
if(view && view->getResolutionPolicy() != ResolutionPolicy::UNKNOWN)
|
|
||||||
{
|
|
||||||
Size resSize=view->getDesignResolutionSize();
|
|
||||||
ResolutionPolicy resPolicy=view->getResolutionPolicy();
|
|
||||||
view->setFrameSize(width, height);
|
|
||||||
view->setDesignResolutionSize(resSize.width, resSize.height, resPolicy);
|
|
||||||
Director::getInstance()->setViewport();
|
|
||||||
Director::sharedDirector()->setProjection(Director::sharedDirector()->getProjection());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const Mat4& GLViewImpl::getOrientationMatrix() const
|
|
||||||
{
|
|
||||||
return m_orientationMatrix;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void GLViewImpl::UpdateOrientationMatrix()
|
|
||||||
{
|
|
||||||
kmMat4Identity(&m_orientationMatrix);
|
|
||||||
kmMat4Identity(&m_reverseOrientationMatrix);
|
|
||||||
switch(m_orientation)
|
|
||||||
{
|
|
||||||
case Windows::Graphics::Display::DisplayOrientations::PortraitFlipped:
|
|
||||||
kmMat4RotationZ(&m_orientationMatrix, M_PI);
|
|
||||||
kmMat4RotationZ(&m_reverseOrientationMatrix, -M_PI);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Windows::Graphics::Display::DisplayOrientations::Landscape:
|
|
||||||
kmMat4RotationZ(&m_orientationMatrix, -M_PI_2);
|
|
||||||
kmMat4RotationZ(&m_reverseOrientationMatrix, M_PI_2);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Windows::Graphics::Display::DisplayOrientations::LandscapeFlipped:
|
|
||||||
kmMat4RotationZ(&m_orientationMatrix, M_PI_2);
|
|
||||||
kmMat4RotationZ(&m_reverseOrientationMatrix, -M_PI_2);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cocos2d::Vec2 GLViewImpl::TransformToOrientation(Windows::Foundation::Point p)
|
|
||||||
{
|
|
||||||
cocos2d::Vec2 returnValue;
|
|
||||||
|
|
||||||
float x = p.X;
|
|
||||||
float y = p.Y;
|
|
||||||
|
|
||||||
switch (m_orientation)
|
|
||||||
{
|
|
||||||
case DisplayOrientations::Portrait:
|
|
||||||
default:
|
|
||||||
returnValue = Vec2(x, y);
|
|
||||||
break;
|
|
||||||
case DisplayOrientations::Landscape:
|
|
||||||
returnValue = Vec2(y, m_width - x);
|
|
||||||
break;
|
|
||||||
case DisplayOrientations::PortraitFlipped:
|
|
||||||
returnValue = Vec2(m_width - x, m_height - y);
|
|
||||||
break;
|
|
||||||
case DisplayOrientations::LandscapeFlipped:
|
|
||||||
returnValue = Vec2(m_height - y, x);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
float zoomFactor = GLViewImpl::sharedOpenGLView()->getFrameZoomFactor();
|
|
||||||
if(zoomFactor > 0.0f) {
|
|
||||||
returnValue.x /= zoomFactor;
|
|
||||||
returnValue.y /= zoomFactor;
|
|
||||||
}
|
|
||||||
|
|
||||||
// CCLOG("%.2f %.2f : %.2f %.2f", p.X, p.Y,returnValue.x, returnValue.y);
|
|
||||||
|
|
||||||
return returnValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vec2 GLViewImpl::GetPoint(PointerEventArgs^ args) {
|
|
||||||
|
|
||||||
return TransformToOrientation(args->CurrentPoint->Position);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GLViewImpl::setViewPortInPoints(float x , float y , float w , float h)
|
|
||||||
{
|
|
||||||
switch(m_orientation)
|
|
||||||
{
|
|
||||||
case DisplayOrientations::Landscape:
|
|
||||||
case DisplayOrientations::LandscapeFlipped:
|
|
||||||
glViewport((GLint)(y * _scaleY + _viewPortRect.origin.y),
|
|
||||||
(GLint)(x * _scaleX + _viewPortRect.origin.x),
|
|
||||||
(GLsizei)(h * _scaleY),
|
|
||||||
(GLsizei)(w * _scaleX));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
glViewport((GLint)(x * _scaleX + _viewPortRect.origin.x),
|
|
||||||
(GLint)(y * _scaleY + _viewPortRect.origin.y),
|
|
||||||
(GLsizei)(w * _scaleX),
|
|
||||||
(GLsizei)(h * _scaleY));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::setScissorInPoints(float x , float y , float w , float h)
|
|
||||||
{
|
|
||||||
switch(m_orientation)
|
|
||||||
{
|
|
||||||
case DisplayOrientations::Landscape:
|
|
||||||
case DisplayOrientations::LandscapeFlipped:
|
|
||||||
glScissor((GLint)(y * _scaleX + _viewPortRect.origin.y),
|
|
||||||
(GLint)((_viewPortRect.size.width - ((x + w) * _scaleX)) + _viewPortRect.origin.x),
|
|
||||||
(GLsizei)(h * _scaleY),
|
|
||||||
(GLsizei)(w * _scaleX));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
glScissor((GLint)(x * _scaleX + _viewPortRect.origin.x),
|
|
||||||
(GLint)(y * _scaleY + _viewPortRect.origin.y),
|
|
||||||
(GLsizei)(w * _scaleX),
|
|
||||||
(GLsizei)(h * _scaleY));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::QueueBackKeyPress()
|
|
||||||
{
|
|
||||||
std::shared_ptr<BackButtonEvent> e(new BackButtonEvent());
|
|
||||||
mInputEvents.push(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::QueuePointerEvent(PointerEventType type, PointerEventArgs^ args)
|
|
||||||
{
|
|
||||||
std::shared_ptr<PointerEvent> e(new PointerEvent(type, args));
|
|
||||||
mInputEvents.push(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::QueueEvent(std::shared_ptr<InputEvent>& event)
|
|
||||||
{
|
|
||||||
mInputEvents.push(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLViewImpl::ProcessEvents()
|
|
||||||
{
|
|
||||||
std::shared_ptr<InputEvent> e;
|
|
||||||
while (mInputEvents.try_pop(e))
|
|
||||||
{
|
|
||||||
e->execute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_CC_END
|
|
|
@ -1,189 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2010 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef __CC_EGLVIEWIMPL_WINRT_H__
|
|
||||||
#define __CC_EGLVIEWIMPL_WINRT_H__
|
|
||||||
|
|
||||||
#include "CCStdC.h"
|
|
||||||
#include "platform/CCCommon.h"
|
|
||||||
#include "platform/CCGLView.h"
|
|
||||||
#include "InputEvent.h"
|
|
||||||
|
|
||||||
|
|
||||||
#include <agile.h>
|
|
||||||
|
|
||||||
#include <wrl/client.h>
|
|
||||||
#include <d3d11_1.h>
|
|
||||||
#include <concurrent_queue.h>
|
|
||||||
|
|
||||||
#include <agile.h>
|
|
||||||
#include <DirectXMath.h>
|
|
||||||
|
|
||||||
#include <EGL/egl.h>
|
|
||||||
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
|
||||||
|
|
||||||
class GLViewImpl;
|
|
||||||
|
|
||||||
|
|
||||||
class CC_DLL GLViewImpl : public GLView
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static GLViewImpl* create(const std::string& viewName);
|
|
||||||
|
|
||||||
/* override functions */
|
|
||||||
virtual bool isOpenGLReady();
|
|
||||||
virtual void end();
|
|
||||||
virtual void swapBuffers();
|
|
||||||
virtual void setViewPortInPoints(float x , float y , float w , float h);
|
|
||||||
virtual void setScissorInPoints(float x , float y , float w , float h);
|
|
||||||
const Mat4& getOrientationMatrix() const;
|
|
||||||
const Mat4& getReverseOrientationMatrix () const {return m_reverseOrientationMatrix;};
|
|
||||||
|
|
||||||
Windows::Graphics::Display::DisplayOrientations getDeviceOrientation() {return m_orientation;};
|
|
||||||
Size getRenerTargetSize() const { return Size(m_width, m_height); }
|
|
||||||
|
|
||||||
virtual void setIMEKeyboardState(bool bOpen);
|
|
||||||
virtual void setIMEKeyboardState(bool bOpen, std::string str);
|
|
||||||
Platform::String^ stringToPlatformString(std::string strSrc);
|
|
||||||
void ShowKeyboard(Windows::Foundation::Rect r);
|
|
||||||
void HideKeyboard(Windows::Foundation::Rect r);
|
|
||||||
|
|
||||||
// WP8 XAML app
|
|
||||||
virtual bool Create(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface, float width, float height
|
|
||||||
,Windows::Graphics::Display::DisplayOrientations orientation);
|
|
||||||
virtual void UpdateDevice(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface);
|
|
||||||
|
|
||||||
void OnPointerPressed(Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
void OnPointerMoved(Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
void OnPointerReleased(Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^, Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
void OnPointerMoved(Windows::UI::Core::CoreWindow^, Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
|
|
||||||
void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
|
|
||||||
void OnResuming(Platform::Object^ sender, Platform::Object^ args);
|
|
||||||
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
|
|
||||||
void OnBackKeyPress();
|
|
||||||
|
|
||||||
void QueueBackKeyPress();
|
|
||||||
void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
void GLViewImpl::QueueEvent(std::shared_ptr<InputEvent>& event);
|
|
||||||
|
|
||||||
void SetXamlEventDelegate(Cocos2dEventDelegate^ delegate) { m_delegate = delegate; };
|
|
||||||
void SetXamlMessageBoxDelegate(Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; };
|
|
||||||
void SetXamlEditBoxDelegate(Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; };
|
|
||||||
|
|
||||||
bool ShowMessageBox(Platform::String^ title, Platform::String^ message);
|
|
||||||
bool OpenXamlEditBox(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler);
|
|
||||||
|
|
||||||
int Run();
|
|
||||||
void Render();
|
|
||||||
|
|
||||||
void resize(int width, int height);
|
|
||||||
|
|
||||||
float getFrameZoomFactor();
|
|
||||||
void centerWindow();
|
|
||||||
|
|
||||||
void UpdateOrientation(Windows::Graphics::Display::DisplayOrientations orientation);
|
|
||||||
void UpdateForWindowSizeChange(float width, float height);
|
|
||||||
|
|
||||||
// static function
|
|
||||||
/**
|
|
||||||
@brief get the shared main open gl window
|
|
||||||
*/
|
|
||||||
static GLViewImpl* sharedOpenGLView();
|
|
||||||
|
|
||||||
void ProcessEvents();
|
|
||||||
void AddPointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
GLViewImpl();
|
|
||||||
virtual ~GLViewImpl();
|
|
||||||
|
|
||||||
bool initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor);
|
|
||||||
bool initWithFullScreen(const std::string& viewName);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.
|
|
||||||
*/
|
|
||||||
void setFrameZoomFactor(float zoomFactor);
|
|
||||||
|
|
||||||
inline bool isRetina() { return _isRetina; };
|
|
||||||
|
|
||||||
float _frameZoomFactor;
|
|
||||||
bool _supportTouch;
|
|
||||||
bool _isRetina;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
CC_DISALLOW_COPY_AND_ASSIGN(GLViewImpl);
|
|
||||||
|
|
||||||
void OnRendering();
|
|
||||||
void UpdateWindowSize();
|
|
||||||
void UpdateOrientationMatrix();
|
|
||||||
|
|
||||||
cocos2d::Vec2 TransformToOrientation(Windows::Foundation::Point point);
|
|
||||||
cocos2d::Vec2 GetPoint(Windows::UI::Core::PointerEventArgs^ args);
|
|
||||||
|
|
||||||
Windows::Foundation::Rect m_windowBounds;
|
|
||||||
Windows::Foundation::EventRegistrationToken m_eventToken;
|
|
||||||
Windows::Foundation::Point m_lastPoint;
|
|
||||||
|
|
||||||
float m_width;
|
|
||||||
float m_height;
|
|
||||||
|
|
||||||
Windows::Graphics::Display::DisplayOrientations m_orientation;
|
|
||||||
Windows::Foundation::Rect m_keyboardRect;
|
|
||||||
|
|
||||||
bool m_lastPointValid;
|
|
||||||
bool m_windowClosed;
|
|
||||||
bool m_windowVisible;
|
|
||||||
Mat4 m_orientationMatrix;
|
|
||||||
Mat4 m_reverseOrientationMatrix;
|
|
||||||
|
|
||||||
|
|
||||||
bool m_running;
|
|
||||||
bool m_initialized;
|
|
||||||
|
|
||||||
Microsoft::WRL::ComPtr<IWinrtEglWindow> m_eglWindow;
|
|
||||||
|
|
||||||
EGLDisplay m_eglDisplay;
|
|
||||||
EGLContext m_eglContext;
|
|
||||||
EGLSurface m_eglSurface;
|
|
||||||
Cocos2dEventDelegate^ m_delegate;
|
|
||||||
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
|
||||||
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
|
||||||
|
|
||||||
Concurrency::concurrent_queue<std::shared_ptr<InputEvent>> mInputEvents;
|
|
||||||
};
|
|
||||||
|
|
||||||
NS_CC_END
|
|
||||||
|
|
||||||
#endif // end of __CC_EGLVIEWIMPL_WINRT_H__
|
|
|
@ -1,365 +0,0 @@
|
||||||
// XXX: For some reason, this file must not be compiled
|
|
||||||
// XXX: Ask MS why
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
#include "Direct3DBase.h"
|
|
||||||
|
|
||||||
|
|
||||||
using namespace DirectX;
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
using namespace Windows::UI::Core;
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::Graphics::Display;
|
|
||||||
|
|
||||||
// Constructor.
|
|
||||||
Direct3DBase::Direct3DBase()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize the Direct3D resources required to run.
|
|
||||||
void Direct3DBase::Initialize(CoreWindow^ window)
|
|
||||||
{
|
|
||||||
m_window = window;
|
|
||||||
|
|
||||||
CreateDeviceResources();
|
|
||||||
CreateWindowSizeDependentResources();
|
|
||||||
}
|
|
||||||
|
|
||||||
// This method is called in the event handler for the SizeChanged event.
|
|
||||||
void Direct3DBase::UpdateForWindowSizeChange()
|
|
||||||
{
|
|
||||||
if (m_window == nullptr)
|
|
||||||
return;
|
|
||||||
if (m_window->Bounds.Width != m_windowBounds.Width ||
|
|
||||||
m_window->Bounds.Height != m_windowBounds.Height ||
|
|
||||||
m_orientation != DisplayProperties::CurrentOrientation )
|
|
||||||
{
|
|
||||||
ID3D11RenderTargetView* nullViews[] = {nullptr};
|
|
||||||
m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
|
|
||||||
m_renderTargetView = nullptr;
|
|
||||||
m_depthStencilView = nullptr;
|
|
||||||
m_d3dContext->Flush();
|
|
||||||
CreateWindowSizeDependentResources();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Recreate all device resources and set them back to the current state.
|
|
||||||
void Direct3DBase::HandleDeviceLost()
|
|
||||||
{
|
|
||||||
// Reset these member variables to ensure that UpdateForWindowSizeChange recreates all resources.
|
|
||||||
m_windowBounds.Width = 0;
|
|
||||||
m_windowBounds.Height = 0;
|
|
||||||
m_swapChain = nullptr;
|
|
||||||
|
|
||||||
CreateDeviceResources();
|
|
||||||
UpdateForWindowSizeChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
// These are the resources that depend on the device.
|
|
||||||
void Direct3DBase::CreateDeviceResources()
|
|
||||||
{
|
|
||||||
// This flag adds support for surfaces with a different color channel ordering
|
|
||||||
// than the API default. It is required for compatibility with Direct2D.
|
|
||||||
UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
|
|
||||||
|
|
||||||
#if defined(_DEBUG)
|
|
||||||
// If the project is in a debug build, enable debugging via SDK Layers with this flag.
|
|
||||||
creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// This array defines the set of DirectX hardware feature levels this app will support.
|
|
||||||
// Note the ordering should be preserved.
|
|
||||||
// Don't forget to declare your application's minimum required feature level in its
|
|
||||||
// description. All applications are assumed to support 9.1 unless otherwise stated.
|
|
||||||
D3D_FEATURE_LEVEL featureLevels[] =
|
|
||||||
{
|
|
||||||
D3D_FEATURE_LEVEL_11_1,
|
|
||||||
D3D_FEATURE_LEVEL_11_0,
|
|
||||||
D3D_FEATURE_LEVEL_10_1,
|
|
||||||
D3D_FEATURE_LEVEL_10_0,
|
|
||||||
D3D_FEATURE_LEVEL_9_3
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create the Direct3D 11 API device object and a corresponding context.
|
|
||||||
ComPtr<ID3D11Device> device;
|
|
||||||
ComPtr<ID3D11DeviceContext> context;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
D3D11CreateDevice(
|
|
||||||
nullptr, // Specify nullptr to use the default adapter.
|
|
||||||
D3D_DRIVER_TYPE_HARDWARE,
|
|
||||||
nullptr,
|
|
||||||
creationFlags, // Set set debug and Direct2D compatibility flags.
|
|
||||||
featureLevels, // List of feature levels this app can support.
|
|
||||||
ARRAYSIZE(featureLevels),
|
|
||||||
D3D11_SDK_VERSION, // Always set this to D3D11_SDK_VERSION.
|
|
||||||
&device, // Returns the Direct3D device created.
|
|
||||||
&m_featureLevel, // Returns feature level of device created.
|
|
||||||
&context // Returns the device immediate context.
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Get the Direct3D 11.1 API device and context interfaces.
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
device.As(&m_d3dDevice)
|
|
||||||
);
|
|
||||||
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
context.As(&m_d3dContext)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allocate all memory resources that depend on the window size.
|
|
||||||
void Direct3DBase::CreateWindowSizeDependentResources()
|
|
||||||
{
|
|
||||||
m_windowBounds = m_window->Bounds;
|
|
||||||
|
|
||||||
// Calculate the necessary swap chain and render target size in pixels.
|
|
||||||
m_renderTargetSize.Width = ConvertDipsToPixels(m_windowBounds.Width);
|
|
||||||
m_renderTargetSize.Height = ConvertDipsToPixels(m_windowBounds.Height);
|
|
||||||
|
|
||||||
DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
|
|
||||||
swapChainDesc.Width = static_cast<UINT>(m_renderTargetSize.Width); // Match the size of the window.
|
|
||||||
swapChainDesc.Height = static_cast<UINT>(m_renderTargetSize.Height);
|
|
||||||
swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; // This is the most common swap chain format.
|
|
||||||
swapChainDesc.Stereo = false;
|
|
||||||
swapChainDesc.SampleDesc.Count = 1; // Don't use multi-sampling.
|
|
||||||
swapChainDesc.SampleDesc.Quality = 0;
|
|
||||||
swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
|
|
||||||
swapChainDesc.BufferCount = 1; // On phone, only single buffering is supported.
|
|
||||||
swapChainDesc.Scaling = DXGI_SCALING_STRETCH; // On phone, only stretch and aspect-ratio stretch scaling are allowed.
|
|
||||||
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; // On phone, no swap effects are supported.
|
|
||||||
swapChainDesc.Flags = 0;
|
|
||||||
|
|
||||||
ComPtr<IDXGIDevice1> dxgiDevice;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
m_d3dDevice.As(&dxgiDevice)
|
|
||||||
);
|
|
||||||
|
|
||||||
ComPtr<IDXGIAdapter> dxgiAdapter;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
dxgiDevice->GetAdapter(&dxgiAdapter)
|
|
||||||
);
|
|
||||||
|
|
||||||
ComPtr<IDXGIFactory2> dxgiFactory;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
dxgiAdapter->GetParent(
|
|
||||||
__uuidof(IDXGIFactory2),
|
|
||||||
&dxgiFactory
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Windows::UI::Core::CoreWindow^ window = m_window.Get();
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
dxgiFactory->CreateSwapChainForCoreWindow(
|
|
||||||
m_d3dDevice.Get(),
|
|
||||||
reinterpret_cast<IUnknown*>(window),
|
|
||||||
&swapChainDesc,
|
|
||||||
nullptr, // Allow on all displays.
|
|
||||||
&m_swapChain
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Ensure that DXGI does not queue more than one frame at a time. This both reduces latency and
|
|
||||||
// ensures that the application will only render after each VSync, minimizing power consumption.
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
dxgiDevice->SetMaximumFrameLatency(1)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create a render target view of the swap chain back buffer.
|
|
||||||
ComPtr<ID3D11Texture2D> backBuffer;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
m_swapChain->GetBuffer(
|
|
||||||
0,
|
|
||||||
__uuidof(ID3D11Texture2D),
|
|
||||||
&backBuffer
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
m_d3dDevice->CreateRenderTargetView(
|
|
||||||
backBuffer.Get(),
|
|
||||||
nullptr,
|
|
||||||
&m_renderTargetView
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create a depth stencil view.
|
|
||||||
CD3D11_TEXTURE2D_DESC depthStencilDesc(
|
|
||||||
DXGI_FORMAT_D24_UNORM_S8_UINT,
|
|
||||||
static_cast<UINT>(m_renderTargetSize.Width),
|
|
||||||
static_cast<UINT>(m_renderTargetSize.Height),
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
D3D11_BIND_DEPTH_STENCIL
|
|
||||||
);
|
|
||||||
|
|
||||||
ComPtr<ID3D11Texture2D> depthStencil;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
m_d3dDevice->CreateTexture2D(
|
|
||||||
&depthStencilDesc,
|
|
||||||
nullptr,
|
|
||||||
&depthStencil
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
m_d3dDevice->CreateDepthStencilView(
|
|
||||||
depthStencil.Get(),
|
|
||||||
&depthStencilViewDesc,
|
|
||||||
&m_depthStencilView
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Set the rendering viewport to target the entire window.
|
|
||||||
CD3D11_VIEWPORT viewport(
|
|
||||||
0.0f,
|
|
||||||
0.0f,
|
|
||||||
m_renderTargetSize.Width,
|
|
||||||
m_renderTargetSize.Height
|
|
||||||
);
|
|
||||||
|
|
||||||
m_d3dContext->RSSetViewports(1, &viewport);
|
|
||||||
|
|
||||||
ComputeOrientationMatrices();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Direct3DBase::ReleaseResourcesForSuspending()
|
|
||||||
{
|
|
||||||
// Phone applications operate in a memory-constrained environment, so when entering
|
|
||||||
// the background it is a good idea to free memory-intensive objects that will be
|
|
||||||
// easy to restore upon reactivation. The swapchain and backbuffer are good candidates
|
|
||||||
// here, as they consume a large amount of memory and can be reinitialized quickly.
|
|
||||||
m_swapChain = nullptr;
|
|
||||||
m_renderTargetView = nullptr;
|
|
||||||
m_depthStencilView = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Method to deliver the final image to the display.
|
|
||||||
void Direct3DBase::Present()
|
|
||||||
{
|
|
||||||
// The first argument instructs DXGI to block until VSync, putting the application
|
|
||||||
// to sleep until the next VSync. This ensures we don't waste any cycles rendering
|
|
||||||
// frames that will never be displayed to the screen.
|
|
||||||
HRESULT hr = m_swapChain->Present(1, 0);
|
|
||||||
|
|
||||||
// Discard the contents of the render target.
|
|
||||||
// This is a valid operation only when the existing contents will be entirely
|
|
||||||
// overwritten. If dirty or scroll rects are used, this call should be removed.
|
|
||||||
m_d3dContext->DiscardView(m_renderTargetView.Get());
|
|
||||||
|
|
||||||
// Discard the contents of the depth stencil.
|
|
||||||
m_d3dContext->DiscardView(m_depthStencilView.Get());
|
|
||||||
|
|
||||||
// If the device was removed either by a disconnect or a driver upgrade, we
|
|
||||||
// must recreate all device resources.
|
|
||||||
if (hr == DXGI_ERROR_DEVICE_REMOVED)
|
|
||||||
{
|
|
||||||
HandleDeviceLost();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DX::ThrowIfFailed(hr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
|
|
||||||
float Direct3DBase::ConvertDipsToPixels(float dips)
|
|
||||||
{
|
|
||||||
static const float dipsPerInch = 96.0f;
|
|
||||||
return floor(dips * DisplayProperties::LogicalDpi / dipsPerInch + 0.5f); // Round to nearest integer.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Method to compute the matrices that will need to be used for rotating whatever we draw.
|
|
||||||
void Direct3DBase::ComputeOrientationMatrices()
|
|
||||||
{
|
|
||||||
// Store the current device orientation
|
|
||||||
m_orientation = DisplayProperties::CurrentOrientation;
|
|
||||||
|
|
||||||
// Generate the matrix transformations for rendering to the new orientation.
|
|
||||||
switch (m_orientation)
|
|
||||||
{
|
|
||||||
case DisplayOrientations::Portrait:
|
|
||||||
// Portrait is default for WP8, so no changes need to be made here
|
|
||||||
// Just use Identity Matrices
|
|
||||||
m_orientationTransform2D = XMMatrixIdentity();
|
|
||||||
m_orientationTransform3D = XMMatrixIdentity();
|
|
||||||
m_orientedScreenSize = m_renderTargetSize;
|
|
||||||
break;
|
|
||||||
case DisplayOrientations::Landscape:
|
|
||||||
//2D: 90-degree Rotation + translation of origin
|
|
||||||
m_orientationTransform2D = XMMatrixMultiply(
|
|
||||||
XMMatrixRotationZ(XM_PIDIV2),
|
|
||||||
XMMatrixTranslation(m_renderTargetSize.Width,0 ,0));
|
|
||||||
//3D: 90-degree Z-rotation
|
|
||||||
m_orientationTransform3D = XMMATRIX(
|
|
||||||
0.0f, -1.0f, 0.0f, 0.0f,
|
|
||||||
1.0f, 0.0f, 0.0f, 0.0f,
|
|
||||||
0.0f, 0.0f, 1.0f, 0.0f,
|
|
||||||
0.0f, 0.0f, 0.0f, 1.0f );
|
|
||||||
m_orientedScreenSize = Size(m_renderTargetSize.Height, m_renderTargetSize.Width);
|
|
||||||
break;
|
|
||||||
case DisplayOrientations::PortraitFlipped:
|
|
||||||
//This is not supported on the phone, but we leave the math here, just in case...
|
|
||||||
//2D: 180-degree Rotation + translation of origin
|
|
||||||
m_orientationTransform2D = XMMatrixMultiply(
|
|
||||||
XMMatrixRotationZ(XM_PI),
|
|
||||||
XMMatrixTranslation(m_renderTargetSize.Width,m_renderTargetSize.Height,0));
|
|
||||||
//3D: // 180-degree Z-rotation
|
|
||||||
m_orientationTransform3D = XMMATRIX(
|
|
||||||
-1.0f, 0.0f, 0.0f, 0.0f,
|
|
||||||
0.0f, -1.0f, 0.0f, 0.0f,
|
|
||||||
0.0f, 0.0f, 1.0f, 0.0f,
|
|
||||||
0.0f, 0.0f, 0.0f, 1.0f
|
|
||||||
);
|
|
||||||
m_orientedScreenSize = m_renderTargetSize;
|
|
||||||
break;
|
|
||||||
case DisplayOrientations::LandscapeFlipped:
|
|
||||||
//2D: 270-degree Rotation + translation of origin
|
|
||||||
m_orientationTransform2D = XMMatrixMultiply(
|
|
||||||
XMMatrixRotationZ(3 * XM_PIDIV2),
|
|
||||||
XMMatrixTranslation(0,m_renderTargetSize.Height,0));
|
|
||||||
//3D: 270-degree Z-rotation
|
|
||||||
m_orientationTransform3D = XMMATRIX(
|
|
||||||
0.0f, 1.0f, 0.0f, 0.0f,
|
|
||||||
-1.0f, 0.0f, 0.0f, 0.0f,
|
|
||||||
0.0f, 0.0f, 1.0f, 0.0f,
|
|
||||||
0.0f, 0.0f, 0.0f, 1.0f );
|
|
||||||
m_orientedScreenSize = Size(m_renderTargetSize.Height, m_renderTargetSize.Width);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw ref new Platform::FailureException();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Point Direct3DBase::TransformToOrientation(Point point, bool dipsToPixels)
|
|
||||||
{
|
|
||||||
Point returnValue;
|
|
||||||
|
|
||||||
switch (m_orientation)
|
|
||||||
{
|
|
||||||
case DisplayOrientations::Portrait:
|
|
||||||
returnValue = point;
|
|
||||||
break;
|
|
||||||
case DisplayOrientations::Landscape:
|
|
||||||
returnValue = Point(point.Y, m_windowBounds.Width - point.X);
|
|
||||||
break;
|
|
||||||
case DisplayOrientations::PortraitFlipped:
|
|
||||||
returnValue = Point(m_windowBounds.Width - point.X, m_windowBounds.Height - point.Y);
|
|
||||||
break;
|
|
||||||
case DisplayOrientations::LandscapeFlipped:
|
|
||||||
returnValue = Point(m_windowBounds.Height - point.Y, point.X);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw ref new Platform::FailureException();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dipsToPixels ? Point(ConvertDipsToPixels(returnValue.X),
|
|
||||||
ConvertDipsToPixels(returnValue.Y))
|
|
||||||
: returnValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // 0
|
|
|
@ -1,63 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
// XXX: For some reason, this file must not be compiled
|
|
||||||
// XXX: Ask MS why
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
|
|
||||||
#include <wrl/client.h>
|
|
||||||
#include <d3d11_1.h>
|
|
||||||
#include <DirectXMath.h>
|
|
||||||
#include <memory>
|
|
||||||
#include <agile.h>
|
|
||||||
#include "DirectXHelper.h"
|
|
||||||
|
|
||||||
// Helper class that initializes DirectX APIs for 3D rendering.
|
|
||||||
ref class Direct3DBase abstract
|
|
||||||
{
|
|
||||||
internal:
|
|
||||||
Direct3DBase();
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual void Initialize(Windows::UI::Core::CoreWindow^ window);
|
|
||||||
virtual void HandleDeviceLost();
|
|
||||||
virtual void CreateDeviceResources();
|
|
||||||
virtual void CreateWindowSizeDependentResources();
|
|
||||||
virtual void UpdateForWindowSizeChange();
|
|
||||||
virtual void ReleaseResourcesForSuspending();
|
|
||||||
//virtual void Render() = 0;
|
|
||||||
virtual void Present();
|
|
||||||
virtual float ConvertDipsToPixels(float dips);
|
|
||||||
virtual void ComputeOrientationMatrices();
|
|
||||||
virtual Windows::Foundation::Point TransformToOrientation(Windows::Foundation::Point point, bool dipsToPixels=true);
|
|
||||||
|
|
||||||
float getOrientedWindowWidth() {return m_orientedScreenSize.Width;};
|
|
||||||
float getOrientedWindowHeight() {return m_orientedScreenSize.Height;};
|
|
||||||
|
|
||||||
protected private:
|
|
||||||
// Direct3D Objects.
|
|
||||||
Microsoft::WRL::ComPtr<ID3D11Device1> m_d3dDevice;
|
|
||||||
Microsoft::WRL::ComPtr<ID3D11DeviceContext1> m_d3dContext;
|
|
||||||
Microsoft::WRL::ComPtr<IDXGISwapChain1> m_swapChain;
|
|
||||||
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_renderTargetView;
|
|
||||||
Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_depthStencilView;
|
|
||||||
|
|
||||||
// Cached renderer properties.
|
|
||||||
D3D_FEATURE_LEVEL m_featureLevel;
|
|
||||||
Windows::Foundation::Size m_renderTargetSize;
|
|
||||||
Windows::Foundation::Rect m_windowBounds;
|
|
||||||
Platform::Agile<Windows::UI::Core::CoreWindow> m_window;
|
|
||||||
|
|
||||||
|
|
||||||
// Store the current Orientation of the device
|
|
||||||
Windows::Graphics::Display::DisplayOrientations m_orientation;
|
|
||||||
|
|
||||||
// Size of the virtual, oriented screen
|
|
||||||
Windows::Foundation::Size m_orientedScreenSize;
|
|
||||||
|
|
||||||
// Transforms used for rendering 2D and 3D elements in proper orientation
|
|
||||||
DirectX::XMMATRIX m_orientationTransform3D;
|
|
||||||
DirectX::XMMATRIX m_orientationTransform2D;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // 0
|
|
|
@ -1,284 +0,0 @@
|
||||||
// XXX: For some reason, this file must not be compiled
|
|
||||||
// XXX: Ask MS why
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
#include <wrl/client.h>
|
|
||||||
#include <d3d11_1.h>
|
|
||||||
#include "DirectXBase.h"
|
|
||||||
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
using namespace Windows::UI::Core;
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::Graphics::Display;
|
|
||||||
|
|
||||||
// Constructor.
|
|
||||||
DirectXBase::DirectXBase()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize the Direct3D resources required to run.
|
|
||||||
void DirectXBase::Initialize(CoreWindow^ window, float dpi)
|
|
||||||
{
|
|
||||||
m_window = window;
|
|
||||||
CreateDeviceResources();
|
|
||||||
CreateWindowSizeDependentResources();
|
|
||||||
SetDpi(dpi);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Recreate all device resources and set them back to the current state.
|
|
||||||
void DirectXBase::HandleDeviceLost()
|
|
||||||
{
|
|
||||||
// Reset these member variables to ensure that UpdateForWindowSizeChange recreates all resources.
|
|
||||||
m_windowBounds.Width = 0;
|
|
||||||
m_windowBounds.Height = 0;
|
|
||||||
m_swapChain = nullptr;
|
|
||||||
|
|
||||||
CreateDeviceResources();
|
|
||||||
UpdateForWindowSizeChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
// These are the resources that depend on the device.
|
|
||||||
void DirectXBase::CreateDeviceResources()
|
|
||||||
{
|
|
||||||
// This flag adds support for surfaces with a different color channel ordering
|
|
||||||
// than the API default. It is required for compatibility with Direct2D.
|
|
||||||
UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
|
|
||||||
|
|
||||||
#if defined(_DEBUG)
|
|
||||||
// If the project is in a debug build, enable debugging via SDK Layers with this flag.
|
|
||||||
creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// This array defines the set of DirectX hardware feature levels this app will support.
|
|
||||||
// Note the ordering should be preserved.
|
|
||||||
// Don't forget to declare your application's minimum required feature level in its
|
|
||||||
// description. All applications are assumed to support 9.1 unless otherwise stated.
|
|
||||||
D3D_FEATURE_LEVEL featureLevels[] =
|
|
||||||
{
|
|
||||||
D3D_FEATURE_LEVEL_11_1,
|
|
||||||
D3D_FEATURE_LEVEL_11_0,
|
|
||||||
D3D_FEATURE_LEVEL_10_1,
|
|
||||||
D3D_FEATURE_LEVEL_10_0,
|
|
||||||
D3D_FEATURE_LEVEL_9_3
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create the Direct3D 11 API device object and a corresponding context.
|
|
||||||
ComPtr<ID3D11Device> device;
|
|
||||||
ComPtr<ID3D11DeviceContext> context;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
D3D11CreateDevice(
|
|
||||||
nullptr, // Specify nullptr to use the default adapter.
|
|
||||||
D3D_DRIVER_TYPE_HARDWARE,
|
|
||||||
nullptr,
|
|
||||||
creationFlags, // Set set debug and Direct2D compatibility flags.
|
|
||||||
featureLevels, // List of feature levels this app can support.
|
|
||||||
ARRAYSIZE(featureLevels),
|
|
||||||
D3D11_SDK_VERSION, // Always set this to D3D11_SDK_VERSION.
|
|
||||||
&device, // Returns the Direct3D device created.
|
|
||||||
&m_featureLevel, // Returns feature level of device created.
|
|
||||||
&context // Returns the device immediate context.
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Get the Direct3D 11.1 API device and context interfaces.
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
device.As(&m_d3dDevice)
|
|
||||||
);
|
|
||||||
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
context.As(&m_d3dContext)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allocate all memory resources that depend on the window size.
|
|
||||||
void DirectXBase::CreateWindowSizeDependentResources()
|
|
||||||
{
|
|
||||||
m_windowBounds = m_window->Bounds;
|
|
||||||
|
|
||||||
// Calculate the necessary swap chain and render target size in pixels.
|
|
||||||
m_renderTargetSize.Width = ConvertDipsToPixels(m_windowBounds.Width);
|
|
||||||
m_renderTargetSize.Height = ConvertDipsToPixels(m_windowBounds.Height);
|
|
||||||
|
|
||||||
DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
|
|
||||||
swapChainDesc.Width = static_cast<UINT>(m_renderTargetSize.Width); // Match the size of the window.
|
|
||||||
swapChainDesc.Height = static_cast<UINT>(m_renderTargetSize.Height);
|
|
||||||
swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; // This is the most common swap chain format.
|
|
||||||
swapChainDesc.Stereo = false;
|
|
||||||
swapChainDesc.SampleDesc.Count = 1; // Don't use multi-sampling.
|
|
||||||
swapChainDesc.SampleDesc.Quality = 0;
|
|
||||||
swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
|
|
||||||
swapChainDesc.BufferCount = 1; // On phone, only single buffering is supported.
|
|
||||||
swapChainDesc.Scaling = DXGI_SCALING_STRETCH; // On phone, only stretch and aspect-ratio stretch scaling are allowed.
|
|
||||||
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; // On phone, no swap effects are supported.
|
|
||||||
swapChainDesc.Flags = 0;
|
|
||||||
|
|
||||||
ComPtr<IDXGIDevice1> dxgiDevice;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
m_d3dDevice.As(&dxgiDevice)
|
|
||||||
);
|
|
||||||
|
|
||||||
ComPtr<IDXGIAdapter> dxgiAdapter;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
dxgiDevice->GetAdapter(&dxgiAdapter)
|
|
||||||
);
|
|
||||||
|
|
||||||
ComPtr<IDXGIFactory2> dxgiFactory;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
dxgiAdapter->GetParent(
|
|
||||||
__uuidof(IDXGIFactory2),
|
|
||||||
&dxgiFactory
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Windows::UI::Core::CoreWindow^ window = m_window.Get();
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
dxgiFactory->CreateSwapChainForCoreWindow(
|
|
||||||
m_d3dDevice.Get(),
|
|
||||||
reinterpret_cast<IUnknown*>(window),
|
|
||||||
&swapChainDesc,
|
|
||||||
nullptr, // Allow on all displays.
|
|
||||||
&m_swapChain
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Ensure that DXGI does not queue more than one frame at a time. This both reduces latency and
|
|
||||||
// ensures that the application will only render after each VSync, minimizing power consumption.
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
dxgiDevice->SetMaximumFrameLatency(1)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create a render target view of the swap chain back buffer.
|
|
||||||
ComPtr<ID3D11Texture2D> backBuffer;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
m_swapChain->GetBuffer(
|
|
||||||
0,
|
|
||||||
__uuidof(ID3D11Texture2D),
|
|
||||||
&backBuffer
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
m_d3dDevice->CreateRenderTargetView(
|
|
||||||
backBuffer.Get(),
|
|
||||||
nullptr,
|
|
||||||
&m_renderTargetView
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create a depth stencil view.
|
|
||||||
CD3D11_TEXTURE2D_DESC depthStencilDesc(
|
|
||||||
DXGI_FORMAT_D24_UNORM_S8_UINT,
|
|
||||||
static_cast<UINT>(m_renderTargetSize.Width),
|
|
||||||
static_cast<UINT>(m_renderTargetSize.Height),
|
|
||||||
1,
|
|
||||||
1,
|
|
||||||
D3D11_BIND_DEPTH_STENCIL
|
|
||||||
);
|
|
||||||
|
|
||||||
ComPtr<ID3D11Texture2D> depthStencil;
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
m_d3dDevice->CreateTexture2D(
|
|
||||||
&depthStencilDesc,
|
|
||||||
nullptr,
|
|
||||||
&depthStencil
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
|
|
||||||
DX::ThrowIfFailed(
|
|
||||||
m_d3dDevice->CreateDepthStencilView(
|
|
||||||
depthStencil.Get(),
|
|
||||||
&depthStencilViewDesc,
|
|
||||||
&m_depthStencilView
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Set the rendering viewport to target the entire window.
|
|
||||||
CD3D11_VIEWPORT viewport(
|
|
||||||
0.0f,
|
|
||||||
0.0f,
|
|
||||||
m_renderTargetSize.Width,
|
|
||||||
m_renderTargetSize.Height
|
|
||||||
);
|
|
||||||
|
|
||||||
m_d3dContext->RSSetViewports(1, &viewport);
|
|
||||||
}
|
|
||||||
|
|
||||||
// This method is called in the event handler for the SizeChanged event.
|
|
||||||
void DirectXBase::UpdateForWindowSizeChange()
|
|
||||||
{
|
|
||||||
if (m_window->Bounds.Width != m_windowBounds.Width ||
|
|
||||||
m_window->Bounds.Height != m_windowBounds.Height)
|
|
||||||
{
|
|
||||||
ID3D11RenderTargetView* nullViews[] = {nullptr};
|
|
||||||
m_d3dContext->OMSetRenderTargets(ARRAYSIZE(nullViews), nullViews, nullptr);
|
|
||||||
m_renderTargetView = nullptr;
|
|
||||||
m_depthStencilView = nullptr;
|
|
||||||
m_d3dContext->Flush();
|
|
||||||
CreateWindowSizeDependentResources();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DirectXBase::ReleaseResourcesForSuspending()
|
|
||||||
{
|
|
||||||
// Phone applications operate in a memory-constrained environment, so when entering
|
|
||||||
// the background it is a good idea to free memory-intensive objects that will be
|
|
||||||
// easy to restore upon reactivation. The swapchain and backbuffer are good candidates
|
|
||||||
// here, as they consume a large amount of memory and can be reinitialized quickly.
|
|
||||||
m_swapChain = nullptr;
|
|
||||||
m_renderTargetView = nullptr;
|
|
||||||
m_depthStencilView = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Method to deliver the final image to the display.
|
|
||||||
void DirectXBase::Present()
|
|
||||||
{
|
|
||||||
// The first argument instructs DXGI to block until VSync, putting the application
|
|
||||||
// to sleep until the next VSync. This ensures we don't waste any cycles rendering
|
|
||||||
// frames that will never be displayed to the screen.
|
|
||||||
HRESULT hr = m_swapChain->Present(1, 0);
|
|
||||||
|
|
||||||
// Discard the contents of the render target.
|
|
||||||
// This is a valid operation only when the existing contents will be entirely
|
|
||||||
// overwritten. If dirty or scroll rects are used, this call should be removed.
|
|
||||||
m_d3dContext->DiscardView(m_renderTargetView.Get());
|
|
||||||
|
|
||||||
// Discard the contents of the depth stencil.
|
|
||||||
m_d3dContext->DiscardView(m_depthStencilView.Get());
|
|
||||||
|
|
||||||
// If the device was removed either by a disconnect or a driver upgrade, we
|
|
||||||
// must recreate all device resources.
|
|
||||||
if (hr == DXGI_ERROR_DEVICE_REMOVED)
|
|
||||||
{
|
|
||||||
HandleDeviceLost();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DX::ThrowIfFailed(hr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
|
|
||||||
float DirectXBase::ConvertDipsToPixels(float dips)
|
|
||||||
{
|
|
||||||
static const float dipsPerInch = 96.0f;
|
|
||||||
return floor(dips * DisplayProperties::LogicalDpi / dipsPerInch + 0.5f); // Round to nearest integer.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helps track the DPI in the helper class.
|
|
||||||
// This is called in the dpiChanged event handler in the view class.
|
|
||||||
void DirectXBase::SetDpi(float dpi)
|
|
||||||
{
|
|
||||||
if (dpi != m_dpi)
|
|
||||||
{
|
|
||||||
// Save the DPI of this display in our class.
|
|
||||||
m_dpi = dpi;
|
|
||||||
|
|
||||||
// Often a DPI change implies a window size change. In some cases Windows will issues
|
|
||||||
// both a size changed event and a DPI changed event. In this case, the resulting bounds
|
|
||||||
// will not change, and the window resize code will only be executed once.
|
|
||||||
UpdateForWindowSizeChange();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //0
|
|
|
@ -1,46 +0,0 @@
|
||||||
// XXX: For some reason, this file must not be compiled
|
|
||||||
// XXX: Ask MS why
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "DirectXHelper.h"
|
|
||||||
#include <wrl/client.h>
|
|
||||||
#include <d3d11_1.h>
|
|
||||||
#include <agile.h>
|
|
||||||
|
|
||||||
// Helper class that initializes DirectX APIs for 3D rendering.
|
|
||||||
ref class DirectXBase abstract
|
|
||||||
{
|
|
||||||
internal:
|
|
||||||
DirectXBase();
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual void Initialize(Windows::UI::Core::CoreWindow^ window, float dpi);
|
|
||||||
virtual void HandleDeviceLost();
|
|
||||||
virtual void CreateDeviceResources();
|
|
||||||
virtual void CreateWindowSizeDependentResources();
|
|
||||||
virtual void UpdateForWindowSizeChange();
|
|
||||||
virtual void ReleaseResourcesForSuspending();
|
|
||||||
virtual void Present();
|
|
||||||
virtual float ConvertDipsToPixels(float dips);
|
|
||||||
virtual void SetDpi(float dpi);
|
|
||||||
|
|
||||||
protected private:
|
|
||||||
// Direct3D Objects.
|
|
||||||
Microsoft::WRL::ComPtr<ID3D11Device1> m_d3dDevice;
|
|
||||||
Microsoft::WRL::ComPtr<ID3D11DeviceContext1> m_d3dContext;
|
|
||||||
Microsoft::WRL::ComPtr<IDXGISwapChain1> m_swapChain;
|
|
||||||
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_renderTargetView;
|
|
||||||
Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_depthStencilView;
|
|
||||||
|
|
||||||
// Cached renderer properties.
|
|
||||||
D3D_FEATURE_LEVEL m_featureLevel;
|
|
||||||
Windows::Foundation::Size m_renderTargetSize;
|
|
||||||
Windows::Foundation::Rect m_windowBounds;
|
|
||||||
Platform::Agile<Windows::UI::Core::CoreWindow> m_window;
|
|
||||||
float m_dpi;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // 0
|
|
|
@ -1,20 +0,0 @@
|
||||||
<Application
|
|
||||||
x:Class="cocos2d.App"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
|
||||||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
|
|
||||||
|
|
||||||
<!--Application Resources-->
|
|
||||||
<Application.Resources>
|
|
||||||
<local:LocalizedStrings xmlns:local="clr-namespace:cocos2d" x:Key="LocalizedStrings"/>
|
|
||||||
</Application.Resources>
|
|
||||||
|
|
||||||
<Application.ApplicationLifetimeObjects>
|
|
||||||
<!--Required object that handles lifetime events for the application-->
|
|
||||||
<shell:PhoneApplicationService
|
|
||||||
Launching="Application_Launching" Closing="Application_Closing"
|
|
||||||
Activated="Application_Activated" Deactivated="Application_Deactivated"/>
|
|
||||||
</Application.ApplicationLifetimeObjects>
|
|
||||||
|
|
||||||
</Application>
|
|
|
@ -1,362 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Resources;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Markup;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using Microsoft.Phone.Controls;
|
|
||||||
using Microsoft.Phone.Shell;
|
|
||||||
using System.IO.IsolatedStorage;
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
public partial class App : Application
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Provides easy access to the root frame of the Phone Application.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>The root frame of the Phone Application.</returns>
|
|
||||||
public static PhoneApplicationFrame RootFrame { get; private set; }
|
|
||||||
|
|
||||||
|
|
||||||
enum SessionType
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
Home,
|
|
||||||
DeepLink
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set to Home when the app is launched from Primary tile.
|
|
||||||
// Set to DeepLink when the app is launched from Deep Link.
|
|
||||||
private SessionType sessionType = SessionType.None;
|
|
||||||
|
|
||||||
// Set to true when the page navigation is being reset
|
|
||||||
bool wasRelaunched = false;
|
|
||||||
|
|
||||||
// set to true when 5 min passed since the app was relaunched
|
|
||||||
bool mustClearPagestack = false;
|
|
||||||
|
|
||||||
IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor for the Application object.
|
|
||||||
/// </summary>
|
|
||||||
public App()
|
|
||||||
{
|
|
||||||
// Global handler for uncaught exceptions.
|
|
||||||
UnhandledException += Application_UnhandledException;
|
|
||||||
|
|
||||||
// Standard XAML initialization
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
// Phone-specific initialization
|
|
||||||
InitializePhoneApplication();
|
|
||||||
|
|
||||||
// Show graphics profiling information while debugging.
|
|
||||||
if (Debugger.IsAttached)
|
|
||||||
{
|
|
||||||
// Display the current frame rate counters.
|
|
||||||
Application.Current.Host.Settings.EnableFrameRateCounter = false;
|
|
||||||
|
|
||||||
// Show the areas of the app that are being redrawn in each frame.
|
|
||||||
//Application.Current.Host.Settings.EnableRedrawRegions = true;
|
|
||||||
|
|
||||||
// Enable non-production analysis visualization mode,
|
|
||||||
// which shows areas of a page that are handed off to GPU with a colored overlay.
|
|
||||||
//Application.Current.Host.Settings.EnableCacheVisualization = true;
|
|
||||||
|
|
||||||
// Prevent the screen from turning off while under the debugger by disabling
|
|
||||||
// the application's idle detection.
|
|
||||||
// Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
|
|
||||||
// and consume battery power when the user is not using the phone.
|
|
||||||
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute when the application is launching (eg, from Start)
|
|
||||||
// This code will not execute when the application is reactivated
|
|
||||||
private void Application_Launching(object sender, LaunchingEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
// When a new instance of the app is launched, clear all deactivation settings
|
|
||||||
RemoveCurrentDeactivationSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute when the application is activated (brought to foreground)
|
|
||||||
// This code will not execute when the application is first launched
|
|
||||||
private void Application_Activated(object sender, ActivatedEventArgs e)
|
|
||||||
{
|
|
||||||
// If some interval has passed since the app was deactivated (30 seconds in this example),
|
|
||||||
// then remember to clear the back stack of pages
|
|
||||||
mustClearPagestack = CheckDeactivationTimeStamp();
|
|
||||||
|
|
||||||
|
|
||||||
// If IsApplicationInstancePreserved is not true, then set the session type to the value
|
|
||||||
// saved in isolated storage. This will make sure the session type is correct for an
|
|
||||||
// app that is being resumed after being tombstoned.
|
|
||||||
if (!e.IsApplicationInstancePreserved)
|
|
||||||
{
|
|
||||||
RestoreSessionType();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute when the application is deactivated (sent to background)
|
|
||||||
// This code will not execute when the application is closing
|
|
||||||
private void Application_Deactivated(object sender, DeactivatedEventArgs e)
|
|
||||||
{
|
|
||||||
// When the applicaiton is deactivated, save the current deactivation settings to isolated storage
|
|
||||||
SaveCurrentDeactivationSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute when the application is closing (eg, user hit Back)
|
|
||||||
// This code will not execute when the application is deactivated
|
|
||||||
private void Application_Closing(object sender, ClosingEventArgs e)
|
|
||||||
{
|
|
||||||
// When the application closes, delete any deactivation settings from isolated storage
|
|
||||||
RemoveCurrentDeactivationSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute if a navigation fails
|
|
||||||
private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
|
|
||||||
{
|
|
||||||
if (Debugger.IsAttached)
|
|
||||||
{
|
|
||||||
// A navigation has failed; break into the debugger
|
|
||||||
Debugger.Break();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code to execute on Unhandled Exceptions
|
|
||||||
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
|
|
||||||
{
|
|
||||||
if (Debugger.IsAttached)
|
|
||||||
{
|
|
||||||
// An unhandled exception has occurred; break into the debugger
|
|
||||||
Debugger.Break();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Phone application initialization
|
|
||||||
|
|
||||||
// Avoid double-initialization
|
|
||||||
private bool phoneApplicationInitialized = false;
|
|
||||||
|
|
||||||
// Do not add any additional code to this method
|
|
||||||
private void InitializePhoneApplication()
|
|
||||||
{
|
|
||||||
if (phoneApplicationInitialized)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Create the frame but don't set it as RootVisual yet; this allows the splash
|
|
||||||
// screen to remain active until the application is ready to render.
|
|
||||||
RootFrame = new PhoneApplicationFrame();
|
|
||||||
RootFrame.Navigated += CompleteInitializePhoneApplication;
|
|
||||||
|
|
||||||
// Handle navigation failures
|
|
||||||
RootFrame.NavigationFailed += RootFrame_NavigationFailed;
|
|
||||||
|
|
||||||
// Handle reset requests for clearing the backstack
|
|
||||||
RootFrame.Navigated += CheckForResetNavigation;
|
|
||||||
|
|
||||||
// Monitor deep link launching
|
|
||||||
RootFrame.Navigating += RootFrame_Navigating;
|
|
||||||
|
|
||||||
// Ensure we don't initialize again
|
|
||||||
phoneApplicationInitialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Event handler for the Navigating event of the root frame. Use this handler to modify
|
|
||||||
// the default navigation behavior.
|
|
||||||
void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
// If the session type is None or New, check the navigation Uri to determine if the
|
|
||||||
// navigation is a deep link or if it points to the app's main page.
|
|
||||||
if (sessionType == SessionType.None && e.NavigationMode == NavigationMode.New)
|
|
||||||
{
|
|
||||||
// This block will run if the current navigation is part of the app's intial launch
|
|
||||||
|
|
||||||
|
|
||||||
// Keep track of Session Type
|
|
||||||
if (e.Uri.ToString().Contains("DeepLink=true"))
|
|
||||||
{
|
|
||||||
sessionType = SessionType.DeepLink;
|
|
||||||
}
|
|
||||||
else if (e.Uri.ToString().Contains("/MainPage.xaml"))
|
|
||||||
{
|
|
||||||
sessionType = SessionType.Home;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (e.NavigationMode == NavigationMode.Reset)
|
|
||||||
{
|
|
||||||
// This block will execute if the current navigation is a relaunch.
|
|
||||||
// If so, another navigation will be coming, so this records that a relaunch just happened
|
|
||||||
// so that the next navigation can use this info.
|
|
||||||
wasRelaunched = true;
|
|
||||||
}
|
|
||||||
else if (e.NavigationMode == NavigationMode.New && wasRelaunched)
|
|
||||||
{
|
|
||||||
// This block will run if the previous navigation was a relaunch
|
|
||||||
wasRelaunched = false;
|
|
||||||
|
|
||||||
if (e.Uri.ToString().Contains("DeepLink=true"))
|
|
||||||
{
|
|
||||||
// This block will run if the launch Uri contains "DeepLink=true" which
|
|
||||||
// was specified when the secondary tile was created in MainPage.xaml.cs
|
|
||||||
|
|
||||||
sessionType = SessionType.DeepLink;
|
|
||||||
// The app was relaunched via a Deep Link.
|
|
||||||
// The page stack will be cleared.
|
|
||||||
}
|
|
||||||
else if (e.Uri.ToString().Contains("/MainPage.xaml"))
|
|
||||||
{
|
|
||||||
// This block will run if the navigation Uri is the main page
|
|
||||||
if (sessionType == SessionType.DeepLink)
|
|
||||||
{
|
|
||||||
// When the app was previously launched via Deep Link and relaunched via Main Tile, we need to clear the page stack.
|
|
||||||
sessionType = SessionType.Home;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!mustClearPagestack)
|
|
||||||
{
|
|
||||||
//The app was previously launched via Main Tile and relaunched via Main Tile. Cancel the navigation to resume.
|
|
||||||
e.Cancel = true;
|
|
||||||
RootFrame.Navigated -= ClearBackStackAfterReset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mustClearPagestack = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Do not add any additional code to this method
|
|
||||||
private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
|
|
||||||
{
|
|
||||||
// Set the root visual to allow the application to render
|
|
||||||
if (RootVisual != RootFrame)
|
|
||||||
RootVisual = RootFrame;
|
|
||||||
|
|
||||||
// Remove this handler since it is no longer needed
|
|
||||||
RootFrame.Navigated -= CompleteInitializePhoneApplication;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CheckForResetNavigation(object sender, NavigationEventArgs e)
|
|
||||||
{
|
|
||||||
// If the app has received a 'reset' navigation, then we need to check
|
|
||||||
// on the next navigation to see if the page stack should be reset
|
|
||||||
if (e.NavigationMode == NavigationMode.Reset)
|
|
||||||
RootFrame.Navigated += ClearBackStackAfterReset;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ClearBackStackAfterReset(object sender, NavigationEventArgs e)
|
|
||||||
{
|
|
||||||
// Unregister the event so it doesn't get called again
|
|
||||||
RootFrame.Navigated -= ClearBackStackAfterReset;
|
|
||||||
|
|
||||||
// Only clear the stack for 'new' (forward) and 'refresh' navigations
|
|
||||||
if (e.NavigationMode != NavigationMode.New)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// For UI consistency, clear the entire page stack
|
|
||||||
while (RootFrame.RemoveBackEntry() != null)
|
|
||||||
{
|
|
||||||
; // do nothing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
// Helper method for adding or updating a key/value pair in isolated storage
|
|
||||||
public bool AddOrUpdateValue(string Key, Object value)
|
|
||||||
{
|
|
||||||
bool valueChanged = false;
|
|
||||||
|
|
||||||
// If the key exists
|
|
||||||
if (settings.Contains(Key))
|
|
||||||
{
|
|
||||||
// If the value has changed
|
|
||||||
if (settings[Key] != value)
|
|
||||||
{
|
|
||||||
// Store the new value
|
|
||||||
settings[Key] = value;
|
|
||||||
valueChanged = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Otherwise create the key.
|
|
||||||
else
|
|
||||||
{
|
|
||||||
settings.Add(Key, value);
|
|
||||||
valueChanged = true;
|
|
||||||
}
|
|
||||||
return valueChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper method for removing a key/value pair from isolated storage
|
|
||||||
public void RemoveValue(string Key)
|
|
||||||
{
|
|
||||||
// If the key exists
|
|
||||||
if (settings.Contains(Key))
|
|
||||||
{
|
|
||||||
settings.Remove(Key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the app is deactivating. Saves the time of the deactivation and the
|
|
||||||
// session type of the app instance to isolated storage.
|
|
||||||
public void SaveCurrentDeactivationSettings()
|
|
||||||
{
|
|
||||||
if (AddOrUpdateValue("DeactivateTime", DateTimeOffset.Now))
|
|
||||||
{
|
|
||||||
settings.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AddOrUpdateValue("SessionType", sessionType))
|
|
||||||
{
|
|
||||||
settings.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called when the app is launched or closed. Removes all deactivation settings from
|
|
||||||
// isolated storage
|
|
||||||
public void RemoveCurrentDeactivationSettings()
|
|
||||||
{
|
|
||||||
RemoveValue("DeactivateTime");
|
|
||||||
RemoveValue("SessionType");
|
|
||||||
settings.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper method to determine if the interval since the app was deactivated is
|
|
||||||
// greater than 30 seconds
|
|
||||||
bool CheckDeactivationTimeStamp()
|
|
||||||
{
|
|
||||||
DateTimeOffset lastDeactivated;
|
|
||||||
|
|
||||||
if (settings.Contains("DeactivateTime"))
|
|
||||||
{
|
|
||||||
lastDeactivated = (DateTimeOffset)settings["DeactivateTime"];
|
|
||||||
}
|
|
||||||
|
|
||||||
var currentDuration = DateTimeOffset.Now.Subtract(lastDeactivated);
|
|
||||||
|
|
||||||
return TimeSpan.FromSeconds(currentDuration.TotalSeconds) > TimeSpan.FromSeconds(30);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper method to restore the session type from isolated storage.
|
|
||||||
void RestoreSessionType()
|
|
||||||
{
|
|
||||||
if (settings.Contains("SessionType"))
|
|
||||||
{
|
|
||||||
sessionType = (SessionType)settings["SessionType"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 3.6 KiB |
|
@ -1,20 +0,0 @@
|
||||||
<UserControl x:Class="cocos2d.EditBox"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
|
||||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
|
||||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
|
||||||
d:DesignHeight="480" d:DesignWidth="480">
|
|
||||||
|
|
||||||
<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneSemitransparentBrush}">
|
|
||||||
<!--<TextBox KeyDown="OnKeyDownHandler" Height="72" x:Name="textinput" TextWrapping="Wrap" VerticalAlignment="Top" Margin="0,0,220,0" TextChanged="textinput_TextChanged"/>-->
|
|
||||||
<!-- comment TextBox and uncomment PasswordBox to use PasswordBox -->
|
|
||||||
<!--<PasswordBox KeyDown="OnKeyDownHandler" Height="72" x:Name="textinput" TextWrapping="Wrap" VerticalAlignment="Top" Margin="0,0,220,0" TextChanged="textinput_TextChanged"/>-->
|
|
||||||
<Button Content="Done" VerticalAlignment="Top" Width="108" Background="{StaticResource PhoneChromeBrush}" HorizontalAlignment="Right" Margin="0,0,120,0" Click="Done_Click"/>
|
|
||||||
<Button Content="Cancel" VerticalAlignment="Top" Width="131" Background="{StaticResource PhoneChromeBrush}" HorizontalAlignment="Right" Click="Cancel_Click"/>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
|
@ -1,190 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2014 cocos2d-x.org
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using Microsoft.Phone.Controls;
|
|
||||||
using Microsoft.Phone.Shell;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
public partial class EditBox : UserControl
|
|
||||||
{
|
|
||||||
private MainPage m_mainPage = null;
|
|
||||||
private String m_strText = "";
|
|
||||||
private String m_strPlaceholder = "";
|
|
||||||
private bool bIsFocus = false;
|
|
||||||
private int m_inputFlag = 0;
|
|
||||||
private Control m_textinput = null;
|
|
||||||
|
|
||||||
public void initTextinput(int maxLen, int inputMode)
|
|
||||||
{
|
|
||||||
if (m_inputFlag == 0)
|
|
||||||
{
|
|
||||||
// kEditBoxInputFlagPassword
|
|
||||||
PasswordBox pwdBox = new PasswordBox();
|
|
||||||
pwdBox.MaxLength = maxLen < 0 ? 0 : maxLen;
|
|
||||||
pwdBox.Password = m_strText;
|
|
||||||
pwdBox.GotFocus += pwdBox_GotFocus;
|
|
||||||
m_textinput = pwdBox;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TextBox textbox = new TextBox();
|
|
||||||
textbox.MaxLength = maxLen < 0 ? 0 : maxLen;
|
|
||||||
SetInputScope(textbox, inputMode);
|
|
||||||
textbox.TextChanged += textinput_TextChanged;
|
|
||||||
textbox.GotFocus += textinput_GotFocus;
|
|
||||||
textbox.LostFocus += textinput_LostFocus;
|
|
||||||
m_textinput = textbox;
|
|
||||||
}
|
|
||||||
m_textinput.Margin = new System.Windows.Thickness(0, 0, 220, 0);
|
|
||||||
m_textinput.Height = 72.0;
|
|
||||||
m_textinput.TabIndex = 0;
|
|
||||||
m_textinput.VerticalAlignment = VerticalAlignment.Top;
|
|
||||||
m_textinput.KeyDown += OnKeyDownHandler;
|
|
||||||
this.LayoutRoot.Children.Add(m_textinput);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pwdBox_GotFocus(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
((PasswordBox)m_textinput).SelectAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
public EditBox(MainPage page, String strPlaceholder, String strText, int maxLen, int inputMode, int inputFlag)
|
|
||||||
{
|
|
||||||
m_mainPage = page;
|
|
||||||
InitializeComponent();
|
|
||||||
m_strText = strText;
|
|
||||||
m_strPlaceholder = strPlaceholder;
|
|
||||||
m_inputFlag = inputFlag;
|
|
||||||
initTextinput(maxLen, inputMode);
|
|
||||||
this.Loaded += EditBox_Loaded;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EditBox_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
m_textinput.Focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
void textinput_LostFocus(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
// TextBox.LostFocus
|
|
||||||
TextBox curBox = (TextBox)m_textinput;
|
|
||||||
bIsFocus = false;
|
|
||||||
m_strText = curBox.Text;
|
|
||||||
string strText = "";
|
|
||||||
strText = curBox.Text;
|
|
||||||
if (strText == "" && m_inputFlag != 0)
|
|
||||||
{
|
|
||||||
curBox.Text = m_strPlaceholder;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void textinput_GotFocus(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
// TextBox.GotFocus
|
|
||||||
TextBox curBox = (TextBox)m_textinput;
|
|
||||||
bIsFocus = true;
|
|
||||||
curBox.Text = m_strText;
|
|
||||||
curBox.Select(curBox.Text.Length, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnKeyDownHandler(object sender, System.Windows.Input.KeyEventArgs e)
|
|
||||||
{
|
|
||||||
switch (e.Key)
|
|
||||||
{
|
|
||||||
case Key.Enter:
|
|
||||||
Done_Click(sender, null);
|
|
||||||
e.Handled = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Done_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
m_mainPage.OnSelectText(sender, m_inputFlag == 0 ? ((PasswordBox)m_textinput).Password : m_strText);
|
|
||||||
((Grid)this.Parent).Children.Remove(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Cancel_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
((Grid)this.Parent).Children.Remove(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textinput_TextChanged(object sender, TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
// TextBox.textinput_TextChanged
|
|
||||||
if (bIsFocus)
|
|
||||||
m_strText = ((TextBox)m_textinput).Text;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetInputScope(TextBox curBox, int inputMode)
|
|
||||||
{
|
|
||||||
// TextBox.SetInputScope
|
|
||||||
InputScope inputScope = new InputScope();
|
|
||||||
InputScopeName name = new InputScopeName();
|
|
||||||
|
|
||||||
switch (inputMode)
|
|
||||||
{
|
|
||||||
case 0:// kEditBoxInputModeAny
|
|
||||||
name.NameValue = InputScopeNameValue.Default;
|
|
||||||
break;
|
|
||||||
case 1:// kEditBoxInputModeEmailAddr
|
|
||||||
name.NameValue = InputScopeNameValue.EmailNameOrAddress;
|
|
||||||
break;
|
|
||||||
case 2:// kEditBoxInputModeNumeric
|
|
||||||
name.NameValue = InputScopeNameValue.Number;
|
|
||||||
break;
|
|
||||||
case 3:// kEditBoxInputModePhoneNumber
|
|
||||||
name.NameValue = InputScopeNameValue.TelephoneNumber;
|
|
||||||
break;
|
|
||||||
case 4:// kEditBoxInputModeUrl
|
|
||||||
name.NameValue = InputScopeNameValue.Url;
|
|
||||||
break;
|
|
||||||
case 5:// kEditBoxInputModeDecimal
|
|
||||||
name.NameValue = InputScopeNameValue.Digits;
|
|
||||||
break;
|
|
||||||
case 6:// kEditBoxInputModeSingleLine
|
|
||||||
name.NameValue = InputScopeNameValue.Default;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
name.NameValue = InputScopeNameValue.Default;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
inputScope.Names.Add(name);
|
|
||||||
curBox.InputScope = inputScope;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,179 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProductVersion>10.0.20506</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{83CC88FE-7E79-4E1E-A129-742987130B5C}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>cocos2d</RootNamespace>
|
|
||||||
<AssemblyName>HelloCpp</AssemblyName>
|
|
||||||
<TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
|
|
||||||
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
|
|
||||||
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
|
|
||||||
<SilverlightApplication>true</SilverlightApplication>
|
|
||||||
<SupportedCultures>
|
|
||||||
</SupportedCultures>
|
|
||||||
<XapOutputs>true</XapOutputs>
|
|
||||||
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
|
|
||||||
<XapFilename>HelloCpp_$(Configuration)_$(Platform).xap</XapFilename>
|
|
||||||
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
|
|
||||||
<SilverlightAppEntry>cocos2d.App</SilverlightAppEntry>
|
|
||||||
<ValidateXaml>true</ValidateXaml>
|
|
||||||
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
|
||||||
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>Bin\Debug</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<NoConfig>true</NoConfig>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>Bin\Release</OutputPath>
|
|
||||||
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<NoConfig>true</NoConfig>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>Bin\x86\Debug</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<NoConfig>true</NoConfig>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>Bin\x86\Release</OutputPath>
|
|
||||||
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<NoConfig>true</NoConfig>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>Bin\ARM\Debug</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<NoConfig>true</NoConfig>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>Bin\ARM\Release</OutputPath>
|
|
||||||
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<NoConfig>true</NoConfig>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="App.xaml.cs" />
|
|
||||||
<Compile Include="EditBox.xaml.cs" />
|
|
||||||
<Compile Include="LocalizedStrings.cs" />
|
|
||||||
<Compile Include="MainPage.xaml.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Resources\AppResources.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
<DependentUpon>AppResources.resx</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="..\..\Resources\fonts\Marker Felt.ttf">
|
|
||||||
<Link>Assets\Resources\fonts\Marker Felt.ttf</Link>
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<None Include="Properties\AppManifest.xml" />
|
|
||||||
<None Include="Properties\WMAppManifest.xml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="Assets\AlignmentGrid.png" />
|
|
||||||
<Content Include="Assets\ApplicationIcon.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Assets\Tiles\FlipCycleTileLarge.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Assets\Tiles\FlipCycleTileMedium.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Assets\Tiles\FlipCycleTileSmall.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Assets\Tiles\IconicTileMediumLarge.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="Assets\Tiles\IconicTileSmall.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="SplashScreenImage.jpg" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="..\..\Resources\**\*">
|
|
||||||
<Link>Assets\Resources\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\AppComponent\HelloCppComponent.vcxproj">
|
|
||||||
<Name>HelloCppComponent</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Resources\AppResources.resx">
|
|
||||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
|
||||||
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Page Include="App.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="EditBox.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="MainPage.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
<ProjectExtensions />
|
|
||||||
</Project>
|
|
|
@ -1,14 +0,0 @@
|
||||||
using cocos2d.Resources;
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Provides access to string resources.
|
|
||||||
/// </summary>
|
|
||||||
public class LocalizedStrings
|
|
||||||
{
|
|
||||||
private static AppResources _localizedResources = new AppResources();
|
|
||||||
|
|
||||||
public AppResources LocalizedResources { get { return _localizedResources; } }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
<phone:PhoneApplicationPage
|
|
||||||
x:Class="cocos2d.MainPage"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
|
||||||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
|
||||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
|
||||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
|
||||||
SupportedOrientations="Landscape" Orientation="Landscape"
|
|
||||||
shell:SystemTray.IsVisible="False">
|
|
||||||
|
|
||||||
<!--LayoutRoot is the root grid where all page content is placed-->
|
|
||||||
<DrawingSurfaceBackgroundGrid x:Name="DrawingSurfaceBackground" Loaded="DrawingSurfaceBackground_Loaded">
|
|
||||||
<StackPanel Orientation="Horizontal" Margin="10,0,0,0" Height="30" VerticalAlignment="Top" x:Name="MemoryDisplay">
|
|
||||||
<TextBlock Text="Memory: "/>
|
|
||||||
<TextBlock x:Name="MemoryTextBlock"/>
|
|
||||||
<TextBlock Text=" MB"/>
|
|
||||||
<TextBlock Text=" Peak: "/>
|
|
||||||
<TextBlock x:Name="PeakMemoryTextBlock"/>
|
|
||||||
<TextBlock Text=" MB"/>
|
|
||||||
</StackPanel>
|
|
||||||
</DrawingSurfaceBackgroundGrid>
|
|
||||||
|
|
||||||
</phone:PhoneApplicationPage>
|
|
|
@ -1,251 +0,0 @@
|
||||||
#if DEBUG
|
|
||||||
#define DISPLAY_MEMORY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Animation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using Microsoft.Phone.Controls;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.Phone.Shell;
|
|
||||||
using Windows.UI.Input;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
using Microsoft.Phone.Info;
|
|
||||||
using Windows.Graphics.Display;
|
|
||||||
using Microsoft.Phone.Tasks;
|
|
||||||
|
|
||||||
namespace cocos2d
|
|
||||||
{
|
|
||||||
public partial class MainPage : PhoneApplicationPage
|
|
||||||
{
|
|
||||||
private Direct3DInterop m_d3dInterop = null;
|
|
||||||
private DispatcherTimer m_timer;
|
|
||||||
|
|
||||||
// event handler for CCEditBox
|
|
||||||
private event EventHandler<String> m_receiveHandler;
|
|
||||||
|
|
||||||
// invisible XAML TextBox for Cocos2d-x keyboard input
|
|
||||||
TextBox m_textBox = null;
|
|
||||||
|
|
||||||
// Constructor
|
|
||||||
public MainPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
#if DISPLAY_MEMORY
|
|
||||||
StartTimer();
|
|
||||||
#else
|
|
||||||
MemoryDisplay.Visibility = Visibility.Collapsed;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
override protected void OnOrientationChanged(OrientationChangedEventArgs args)
|
|
||||||
{
|
|
||||||
base.OnOrientationChanged(args);
|
|
||||||
if (m_d3dInterop != null)
|
|
||||||
{
|
|
||||||
DisplayOrientations orientation = ConvertToNativeOrientation(args.Orientation);
|
|
||||||
m_d3dInterop.OnOrientationChanged(orientation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static DisplayOrientations ConvertToNativeOrientation(PageOrientation xamlOrientation)
|
|
||||||
{
|
|
||||||
switch (xamlOrientation)
|
|
||||||
{
|
|
||||||
case PageOrientation.Portrait:
|
|
||||||
case PageOrientation.PortraitUp:
|
|
||||||
return DisplayOrientations.Portrait;
|
|
||||||
case PageOrientation.PortraitDown:
|
|
||||||
return DisplayOrientations.PortraitFlipped;
|
|
||||||
case PageOrientation.Landscape:
|
|
||||||
case PageOrientation.LandscapeLeft:
|
|
||||||
return DisplayOrientations.Landscape;
|
|
||||||
case PageOrientation.LandscapeRight:
|
|
||||||
return DisplayOrientations.LandscapeFlipped;
|
|
||||||
default:
|
|
||||||
return DisplayOrientations.Landscape;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawingSurfaceBackground_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (m_d3dInterop == null)
|
|
||||||
{
|
|
||||||
PageOrientation pageOrientation = (PageOrientation)GetValue(OrientationProperty);
|
|
||||||
DisplayOrientations displayOrientation = ConvertToNativeOrientation(pageOrientation);
|
|
||||||
|
|
||||||
m_d3dInterop = new Direct3DInterop(displayOrientation);
|
|
||||||
|
|
||||||
// Set WindowBounds to size of DrawingSurface
|
|
||||||
m_d3dInterop.WindowBounds = new Windows.Foundation.Size(
|
|
||||||
(float)Application.Current.Host.Content.ActualWidth,
|
|
||||||
(float)Application.Current.Host.Content.ActualHeight
|
|
||||||
);
|
|
||||||
|
|
||||||
// Hook-up native component to DrawingSurfaceBackgroundGrid
|
|
||||||
DrawingSurfaceBackground.SetBackgroundContentProvider(m_d3dInterop.CreateContentProvider());
|
|
||||||
DrawingSurfaceBackground.SetBackgroundManipulationHandler(m_d3dInterop);
|
|
||||||
|
|
||||||
// Hook-up Cocos2d-x delegates
|
|
||||||
m_d3dInterop.SetCocos2dEventDelegate(OnCocos2dEvent);
|
|
||||||
m_d3dInterop.SetCocos2dMessageBoxDelegate(OnCocos2dMessageBoxEvent);
|
|
||||||
m_d3dInterop.SetCocos2dEditBoxDelegate(OpenEditBox);
|
|
||||||
m_d3dInterop.SetCocos2dOpenURLDelegate(OpenURL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// called when the user presses the back button on the device
|
|
||||||
protected override void OnBackKeyPress(CancelEventArgs e)
|
|
||||||
{
|
|
||||||
m_d3dInterop.OnBackKeyPress();
|
|
||||||
// cocos2d-x will async send Cocos2dEvent.TerminateApp event if it is time to exit app.
|
|
||||||
// We do not want to exit now, so we set e.Cancel to true.
|
|
||||||
e.Cancel = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnKeyDown(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
ModifierKeys modifiers = Keyboard.Modifiers;
|
|
||||||
|
|
||||||
switch (e.Key)
|
|
||||||
{
|
|
||||||
case Key.Escape:
|
|
||||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Escape);
|
|
||||||
e.Handled = true;
|
|
||||||
break;
|
|
||||||
case Key.Back:
|
|
||||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Back);
|
|
||||||
e.Handled = true;
|
|
||||||
break;
|
|
||||||
case Key.Enter:
|
|
||||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Enter);
|
|
||||||
e.Handled = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnKeyUp(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnTextChanged(object sender, TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (m_textBox.Text.Length > 0)
|
|
||||||
{
|
|
||||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text);
|
|
||||||
m_textBox.Text = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called by the Cocos2d-x C++ engine to display a MessageBox
|
|
||||||
public void OnCocos2dMessageBoxEvent(String title, String text)
|
|
||||||
{
|
|
||||||
Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show(text, title, MessageBoxButton.OK);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// events called by the Cocos2d-x C++ engine to be handled by C#
|
|
||||||
public void OnCocos2dEvent(Cocos2dEvent theEvent, String text)
|
|
||||||
{
|
|
||||||
Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
switch (theEvent)
|
|
||||||
{
|
|
||||||
case Cocos2dEvent.TerminateApp:
|
|
||||||
Application.Current.Terminate();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Cocos2dEvent.ShowKeyboard:
|
|
||||||
if (m_textBox == null)
|
|
||||||
{
|
|
||||||
m_textBox = new TextBox();
|
|
||||||
m_textBox.Opacity = 0.0;
|
|
||||||
m_textBox.Width = 1;
|
|
||||||
m_textBox.Height = 1;
|
|
||||||
m_textBox.KeyDown += OnKeyDown;
|
|
||||||
m_textBox.TextChanged += OnTextChanged;
|
|
||||||
DrawingSurfaceBackground.Children.Add(m_textBox);
|
|
||||||
}
|
|
||||||
m_textBox.SelectionLength = 0;
|
|
||||||
m_textBox.SelectionStart = int.MaxValue;
|
|
||||||
m_textBox.Focus();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Cocos2dEvent.HideKeyboard:
|
|
||||||
if (m_textBox != null)
|
|
||||||
{
|
|
||||||
DrawingSurfaceBackground.Children.Remove(m_textBox);
|
|
||||||
}
|
|
||||||
m_textBox = null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called by the Cocos2d-x C++ engine to display a CCEditBox
|
|
||||||
public void OpenEditBox(String strPlaceHolder, string strText, int maxLength, int inputMode, int inputFlag, EventHandler<String> receiveHandler)
|
|
||||||
{
|
|
||||||
m_receiveHandler = receiveHandler;
|
|
||||||
Deployment.Current.Dispatcher.BeginInvoke(() =>
|
|
||||||
{
|
|
||||||
EditBox editbox = new EditBox(this, strPlaceHolder, strText, maxLength, inputMode, inputFlag);
|
|
||||||
DrawingSurfaceBackground.Children.Add(editbox);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSelectText(object sender, String str)
|
|
||||||
{
|
|
||||||
if (m_d3dInterop != null && m_receiveHandler != null)
|
|
||||||
{
|
|
||||||
m_d3dInterop.OnCocos2dEditboxEvent(sender, str, m_receiveHandler);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OpenURL(String url)
|
|
||||||
{
|
|
||||||
WebBrowserTask webBrowserTask = new WebBrowserTask();
|
|
||||||
webBrowserTask.Uri = new Uri(url, UriKind.Absolute);
|
|
||||||
webBrowserTask.Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StartTimer()
|
|
||||||
{
|
|
||||||
m_timer = new DispatcherTimer();
|
|
||||||
m_timer.Interval = new TimeSpan(0, 0, 1);
|
|
||||||
m_timer.Tick += new EventHandler(TimerTick);
|
|
||||||
m_timer.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TimerTick(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// These are TextBlock controls that are created in the page’s XAML file.
|
|
||||||
float value = DeviceStatus.ApplicationCurrentMemoryUsage / (1024.0f * 1024.0f);
|
|
||||||
MemoryTextBlock.Text = value.ToString();
|
|
||||||
value = DeviceStatus.ApplicationPeakMemoryUsage / (1024.0f * 1024.0f);
|
|
||||||
PeakMemoryTextBlock.Text = value.ToString();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MemoryTextBlock.Text = ex.Message;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
>
|
|
||||||
<Deployment.Parts>
|
|
||||||
</Deployment.Parts>
|
|
||||||
</Deployment>
|
|
|
@ -1,37 +0,0 @@
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Resources;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("cocos2d")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("")]
|
|
||||||
[assembly: AssemblyProduct("cocos2d")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("e9152507-1b95-4fca-9d7f-444a024ccb98")]
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
||||||
[assembly: NeutralResourcesLanguageAttribute("en-US")]
|
|
|
@ -1,42 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0">
|
|
||||||
<DefaultLanguage xmlns="" code="en-US" />
|
|
||||||
<App xmlns="" ProductID="{83cc88fe-7e79-4e1e-a129-742987130b5c}" Title="HelloCpp" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="HelloCpp author" Description="Sample description" Publisher="HelloCpp" PublisherID="{ebf6c0e1-80a3-41f1-8553-4aaab70da912}">
|
|
||||||
<IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath>
|
|
||||||
<Capabilities>
|
|
||||||
<Capability Name="ID_CAP_NETWORKING" />
|
|
||||||
<Capability Name="ID_CAP_MEDIALIB_AUDIO" />
|
|
||||||
<Capability Name="ID_CAP_MEDIALIB_PLAYBACK" />
|
|
||||||
<Capability Name="ID_CAP_SENSORS" />
|
|
||||||
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
|
|
||||||
</Capabilities>
|
|
||||||
<Tasks>
|
|
||||||
<DefaultTask Name="_default" NavigationPage="MainPage.xaml" ActivationPolicy="Resume" />
|
|
||||||
</Tasks>
|
|
||||||
<Tokens>
|
|
||||||
<PrimaryToken TokenID="cocos2dToken" TaskName="_default">
|
|
||||||
<TemplateFlip>
|
|
||||||
<SmallImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileSmall.png</SmallImageURI>
|
|
||||||
<Count>0</Count>
|
|
||||||
<BackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\FlipCycleTileMedium.png</BackgroundImageURI>
|
|
||||||
<Title>HelloCpp</Title>
|
|
||||||
<BackContent>
|
|
||||||
</BackContent>
|
|
||||||
<BackBackgroundImageURI>
|
|
||||||
</BackBackgroundImageURI>
|
|
||||||
<BackTitle>
|
|
||||||
</BackTitle>
|
|
||||||
<DeviceLockImageURI>
|
|
||||||
</DeviceLockImageURI>
|
|
||||||
<HasLarge>
|
|
||||||
</HasLarge>
|
|
||||||
</TemplateFlip>
|
|
||||||
</PrimaryToken>
|
|
||||||
</Tokens>
|
|
||||||
<ScreenResolutions>
|
|
||||||
<ScreenResolution Name="ID_RESOLUTION_WVGA" />
|
|
||||||
<ScreenResolution Name="ID_RESOLUTION_WXGA" />
|
|
||||||
<ScreenResolution Name="ID_RESOLUTION_HD720P" />
|
|
||||||
</ScreenResolutions>
|
|
||||||
</App>
|
|
||||||
</Deployment>
|
|
|
@ -1,91 +0,0 @@
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:4.0.30319.34014
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace cocos2d.Resources
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
|
||||||
/// </summary>
|
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
|
||||||
// class via a tool like ResGen or Visual Studio.
|
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
|
||||||
// with the /str option, or rebuild your VS project.
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
public class AppResources {
|
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
|
||||||
internal AppResources() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
public static global::System.Resources.ResourceManager ResourceManager {
|
|
||||||
get {
|
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PhoneDirect3DXamlAppInterop.Resources.AppResources", typeof(AppResources).Assembly);
|
|
||||||
resourceMan = temp;
|
|
||||||
}
|
|
||||||
return resourceMan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
|
||||||
/// resource lookups using this strongly typed resource class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
public static global::System.Globalization.CultureInfo Culture {
|
|
||||||
get {
|
|
||||||
return resourceCulture;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
resourceCulture = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to MY APPLICATION.
|
|
||||||
/// </summary>
|
|
||||||
public static string ApplicationTitle {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ApplicationTitle", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to LeftToRight.
|
|
||||||
/// </summary>
|
|
||||||
public static string ResourceFlowDirection {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ResourceFlowDirection", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to en-US.
|
|
||||||
/// </summary>
|
|
||||||
public static string ResourceLanguage {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ResourceLanguage", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,131 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<data name="ApplicationTitle" xml:space="preserve">
|
|
||||||
<value>MY APPLICATION</value>
|
|
||||||
</data>
|
|
||||||
<data name="ResourceFlowDirection" xml:space="preserve">
|
|
||||||
<value>LeftToRight</value>
|
|
||||||
<comment>Controls the FlowDirection for all elements in the RootFrame. Set to the traditional direction of this resource file's language</comment>
|
|
||||||
</data>
|
|
||||||
<data name="ResourceLanguage" xml:space="preserve">
|
|
||||||
<value>en-US</value>
|
|
||||||
<comment>Controls the Language and ensures that the font for all elements in the RootFrame aligns with the app's language. Set to the language code of this resource file's language.</comment>
|
|
||||||
</data>
|
|
||||||
</root>
|
|
Before Width: | Height: | Size: 117 KiB |
|
@ -1,223 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|ARM">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|ARM">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>ARM</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{60ec6889-c3c4-45ad-a006-47d9ee689212}</ProjectGuid>
|
|
||||||
<RootNamespace>cocos2d</RootNamespace>
|
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
|
||||||
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
|
||||||
<WinMDAssembly>true</WinMDAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<!-- If OutDir was set outside of the project file, then we will append ProjectName -->
|
|
||||||
<OutDir Condition="'$(OutDirWasSpecified)' == 'true'">$(OutDir)\$(MSBuildProjectName)\</OutDir>
|
|
||||||
<!-- else, OutDir needs to have project specific directory in order to handle files with unique names -->
|
|
||||||
<OutDir Condition="'$(OutDirWasSpecified)' != 'true' and '$(Platform)' == 'Win32'">$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
|
|
||||||
<OutDir Condition="'$(OutDirWasSpecified)' != 'true' and '$(Platform)' != 'Win32'">$(SolutionDir)$(Platform)\$(Configuration)\$(MSBuildProjectName)\</OutDir>
|
|
||||||
<!-- After OutDir has been fixed, disable Microsoft.common.targets from fixing it again -->
|
|
||||||
<OutDirWasSpecified>false</OutDirWasSpecified>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<PlatformToolset>v110_wp80</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8.props" />
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8_app.props" />
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8_component.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8.props" />
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8_app.props" />
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8_component.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8.props" />
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8_app.props" />
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8_component.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8.props" />
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8_app.props" />
|
|
||||||
<Import Project="..\..\cocos2d\cocos\2d\wp8_props\cocos2d_wp8_component.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<GenerateManifest>false</GenerateManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<CompileAsWinRT>true</CompileAsWinRT>
|
|
||||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
|
||||||
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<SDLCheck>false</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<AdditionalDependencies>d3d11.lib;libGLESv2_phone.lib;libEGL_phone.lib;xaudio2.lib;libwebsockets.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
|
|
||||||
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\angle\prebuilt\$(Platform);$(EngineRoot)\external\curl\prebuilt\wp8\$(Platform);$(EngineRoot)external\websockets\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<CompileAsWinRT>true</CompileAsWinRT>
|
|
||||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
|
||||||
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<SDLCheck>false</SDLCheck>
|
|
||||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<AdditionalDependencies>d3d11.lib;libGLESv2_phone.lib;libEGL_phone.lib;xaudio2.lib;libwebsockets.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
|
|
||||||
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\angle\prebuilt\$(Platform);$(EngineRoot)\external\curl\prebuilt\wp8\$(Platform);$(EngineRoot)external\websockets\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
|
||||||
<LinkTimeCodeGeneration />
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<CompileAsWinRT>true</CompileAsWinRT>
|
|
||||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
|
||||||
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<SDLCheck>false</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<AdditionalDependencies>d3d11.lib;libGLESv2_phone.lib;libEGL_phone.lib;xaudio2.lib;libwebsockets.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
|
|
||||||
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\angle\prebuilt\$(Platform);$(EngineRoot)\external\curl\prebuilt\wp8\$(Platform);$(EngineRoot)external\websockets\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>CC_ENABLE_CHIPMUNK_INTEGRATION=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
||||||
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
||||||
<CompileAsWinRT>true</CompileAsWinRT>
|
|
||||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
|
||||||
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\Classes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<SDLCheck>false</SDLCheck>
|
|
||||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
|
||||||
<AdditionalDependencies>d3d11.lib;libGLESv2_phone.lib;libEGL_phone.lib;xaudio2.lib;libwebsockets.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
|
||||||
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
|
|
||||||
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\angle\prebuilt\$(Platform);$(EngineRoot)\external\curl\prebuilt\wp8\$(Platform);$(EngineRoot)external\websockets\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
|
||||||
<LinkTimeCodeGeneration />
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="platform.winmd">
|
|
||||||
<IsWinMDFile>true</IsWinMDFile>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="..\..\Classes\AppDelegate.cpp" />
|
|
||||||
<ClCompile Include="..\..\Classes\HelloWorldScene.cpp" />
|
|
||||||
<ClCompile Include="src\Cocos2dRenderer.cpp" />
|
|
||||||
<ClCompile Include="src\Direct3DContentProvider.cpp" />
|
|
||||||
<ClCompile Include="src\Direct3DInterop.cpp" />
|
|
||||||
<ClCompile Include="src\DirectXBase.cpp" />
|
|
||||||
<ClCompile Include="src\EditBoxEvent.cpp" />
|
|
||||||
<ClCompile Include="src\pch.cpp">
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
|
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="..\..\Classes\AppDelegate.h" />
|
|
||||||
<ClInclude Include="..\..\Classes\HelloWorldScene.h" />
|
|
||||||
<ClInclude Include="src\Cocos2dRenderer.h" />
|
|
||||||
<ClInclude Include="src\Direct3DContentProvider.h" />
|
|
||||||
<ClInclude Include="src\Direct3DInterop.h" />
|
|
||||||
<ClInclude Include="src\DirectXBase.h" />
|
|
||||||
<ClInclude Include="src\DirectXHelper.h" />
|
|
||||||
<ClInclude Include="src\EditBoxEvent.h" />
|
|
||||||
<ClInclude Include="src\pch.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\cocos2d\cocos\2d\libcocos2d_wp8.vcxproj">
|
|
||||||
<Project>{7c5dbc42-27f6-4978-aabc-02ba77e2a7f0}</Project>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\..\cocos2d\cocos\editor-support\spine\proj.wp8\libSpine.vcxproj">
|
|
||||||
<Project>{7d4fc6eb-9497-4804-98f3-3eaedc896154}</Project>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\..\cocos2d\external\Box2D\proj.wp8\Box2D.vcxproj">
|
|
||||||
<Project>{c55734a3-702c-4fa1-b950-32c8e169302f}</Project>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
|
@ -1,75 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="src\Cocos2dRenderer.cpp">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="src\Direct3DContentProvider.cpp">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="src\Direct3DInterop.cpp">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="src\DirectXBase.cpp">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="src\EditBoxEvent.cpp">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\Classes\AppDelegate.cpp">
|
|
||||||
<Filter>Classes</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\Classes\HelloWorldScene.cpp">
|
|
||||||
<Filter>Classes</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="src\pch.cpp">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="src\Cocos2dRenderer.h">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="src\Direct3DContentProvider.h">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="src\Direct3DInterop.h">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="src\DirectXBase.h">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="src\DirectXHelper.h">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="src\EditBoxEvent.h">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\Classes\AppDelegate.h">
|
|
||||||
<Filter>Classes</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\Classes\HelloWorldScene.h">
|
|
||||||
<Filter>Classes</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="src\pch.h">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Filter Include="Classes">
|
|
||||||
<UniqueIdentifier>{ddb0f381-1dc4-44a0-ab28-0f672a551265}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="src">
|
|
||||||
<UniqueIdentifier>{6fcff44b-bb9f-4ed9-8553-558855bc91e3}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="$(AngleBinPath)libEGL_phone.dll" />
|
|
||||||
<None Include="$(AngleBinPath)libGLESv2_phone.dll" />
|
|
||||||
<None Include="$(WebsocketsBinPath)libwebsockets.dll" />
|
|
||||||
<None Include="$(SQLiteBinPath)sqlite3.dll" />
|
|
||||||
<None Include="$(CurlBinPath)libcurl.dll" />
|
|
||||||
<None Include="$(CurlBinPath)libeay32.dll" />
|
|
||||||
<None Include="$(CurlBinPath)ssleay32.dll" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
|
@ -1,191 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d-x.org
|
|
||||||
Copyright (c) Microsoft Open Technologies, Inc.
|
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "Cocos2dRenderer.h"
|
|
||||||
#include "cocos2d.h"
|
|
||||||
#include "CCApplication.h"
|
|
||||||
#include "CCGLViewImpl-wp8.h"
|
|
||||||
#include "AppDelegate.h"
|
|
||||||
#include <ppltasks.h>
|
|
||||||
|
|
||||||
using namespace Concurrency;
|
|
||||||
using namespace DirectX;
|
|
||||||
using namespace Microsoft::WRL;
|
|
||||||
using namespace Windows::Foundation;
|
|
||||||
using namespace Windows::UI::Core;
|
|
||||||
|
|
||||||
USING_NS_CC;
|
|
||||||
|
|
||||||
Cocos2dRenderer::Cocos2dRenderer(Windows::Graphics::Display::DisplayOrientations orientation): mInitialized(false), m_loadingComplete(false), m_delegate(nullptr), m_messageBoxDelegate(nullptr)
|
|
||||||
{
|
|
||||||
mApp = new AppDelegate();
|
|
||||||
m_orientation = orientation;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Creates and restores Cocos2d-x after DirectX and Angle contexts are created or updated
|
|
||||||
void Cocos2dRenderer::CreateGLResources()
|
|
||||||
{
|
|
||||||
auto director = cocos2d::Director::getInstance();
|
|
||||||
|
|
||||||
if(!mInitialized)
|
|
||||||
{
|
|
||||||
mInitialized = true;
|
|
||||||
GLViewImpl* glview = GLViewImpl::create("Test Cpp");
|
|
||||||
glview->Create(m_eglDisplay, m_eglContext, m_eglSurface, m_renderTargetSize.Width, m_renderTargetSize.Height,m_orientation);
|
|
||||||
director->setOpenGLView(glview);
|
|
||||||
glview->SetXamlEventDelegate(m_delegate);
|
|
||||||
glview->SetXamlMessageBoxDelegate(m_messageBoxDelegate);
|
|
||||||
glview->SetXamlEditBoxDelegate(m_editBoxDelegate);
|
|
||||||
CCApplication::getInstance()->run();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cocos2d::GL::invalidateStateCache();
|
|
||||||
cocos2d::ShaderCache::getInstance()->reloadDefaultGLPrograms();
|
|
||||||
cocos2d::DrawPrimitives::init();
|
|
||||||
cocos2d::VolatileTextureMgr::reloadAllTextures();
|
|
||||||
cocos2d::EventCustom recreatedEvent(EVENT_RENDERER_RECREATED);
|
|
||||||
director->getEventDispatcher()->dispatchEvent(&recreatedEvent);
|
|
||||||
cocos2d::Application::getInstance()->applicationWillEnterForeground();
|
|
||||||
director->setGLDefaultValues();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_loadingComplete = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::Connect()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// purge Cocos2d-x gl GL resourses since the DirectX/Angle Context has been lost
|
|
||||||
void Cocos2dRenderer::Disconnect()
|
|
||||||
{
|
|
||||||
Application::getInstance()->applicationDidEnterBackground();
|
|
||||||
cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);
|
|
||||||
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);
|
|
||||||
CloseAngle();
|
|
||||||
m_loadingComplete = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// save your game state here
|
|
||||||
IAsyncAction^ Cocos2dRenderer::OnSuspending()
|
|
||||||
{
|
|
||||||
return create_async([]() {
|
|
||||||
// save your game state here
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Cocos2dRenderer::OnUpdateDevice()
|
|
||||||
{
|
|
||||||
//GLView* glview = GLView::sharedOpenGLView();
|
|
||||||
GLViewImpl::sharedOpenGLView()->UpdateDevice(m_eglDisplay, m_eglContext, m_eglSurface);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::OnOrientationChanged(Windows::Graphics::Display::DisplayOrientations orientation)
|
|
||||||
{
|
|
||||||
DirectXBase::OnOrientationChanged(orientation);
|
|
||||||
GLViewImpl::sharedOpenGLView()->UpdateOrientation(orientation);
|
|
||||||
}
|
|
||||||
|
|
||||||
// return true if eglSwapBuffers was called by OnRender()
|
|
||||||
bool Cocos2dRenderer::OnRender()
|
|
||||||
{
|
|
||||||
if(m_loadingComplete)
|
|
||||||
{
|
|
||||||
//GLView* glview = GLView::sharedOpenGLView();
|
|
||||||
GLViewImpl::sharedOpenGLView()->Render();
|
|
||||||
return true; // eglSwapBuffers was called by glview->Render();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::OnKeyPressed(Platform::String^ text)
|
|
||||||
{
|
|
||||||
char szUtf8[8] = {0};
|
|
||||||
int nLen = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)text->Data(), 1, szUtf8, sizeof(szUtf8), NULL, NULL);
|
|
||||||
IMEDispatcher::sharedDispatcher()->dispatchInsertText(szUtf8, nLen);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::OnCocos2dKeyEvent(Cocos2dKeyEvent event)
|
|
||||||
{
|
|
||||||
switch(event)
|
|
||||||
{
|
|
||||||
case Cocos2dKeyEvent::Escape:
|
|
||||||
//Director::getInstance()()->getKeypadDispatcher()->dispatchKeypadMSG(kTypeBackClicked);
|
|
||||||
break;
|
|
||||||
case Cocos2dKeyEvent::Back:
|
|
||||||
IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward();
|
|
||||||
break;
|
|
||||||
case Cocos2dKeyEvent::Enter:
|
|
||||||
//SetFocus(false);
|
|
||||||
IMEDispatcher::sharedDispatcher()->dispatchInsertText("\n", 1);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::SetXamlEventDelegate(Cocos2dEventDelegate^ delegate)
|
|
||||||
{
|
|
||||||
m_delegate = delegate;
|
|
||||||
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
|
|
||||||
if(eglView)
|
|
||||||
{
|
|
||||||
eglView->SetXamlEventDelegate(delegate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::SetXamlMessageBoxDelegate(Cocos2dMessageBoxDelegate^ delegate)
|
|
||||||
{
|
|
||||||
m_messageBoxDelegate = delegate;
|
|
||||||
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
|
|
||||||
if(eglView)
|
|
||||||
{
|
|
||||||
eglView->SetXamlMessageBoxDelegate(delegate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::SetXamlEditBoxDelegate(Cocos2dEditBoxDelegate^ delegate)
|
|
||||||
{
|
|
||||||
m_editBoxDelegate = delegate;
|
|
||||||
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
|
|
||||||
if(eglView)
|
|
||||||
{
|
|
||||||
eglView->SetXamlEditBoxDelegate(delegate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cocos2dRenderer::SetXamlOpenURLDelegate(Cocos2dOpenURLDelegate^ delegate)
|
|
||||||
{
|
|
||||||
m_openURLDelegate = delegate;
|
|
||||||
Application* app = Application::getInstance();
|
|
||||||
if (app)
|
|
||||||
{
|
|
||||||
app->SetXamlOpenURLDelegate(delegate);
|
|
||||||
}
|
|
||||||
}
|
|