Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop_socket

This commit is contained in:
samuele3hu 2014-03-31 12:05:45 +08:00
commit 849d462c11
540 changed files with 119135 additions and 32 deletions

2
.gitignore vendored
View File

@ -7,6 +7,8 @@ Thumbs.db
*.pdb
*.aps
*.vcproj.*.user
*.vcxproj.user
*.csproj.user
*.vspscc
*_i.c
*.i

View File

@ -0,0 +1,444 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\cocos2d_wp8.vcxproj", "{B5AF91B3-64EA-44E1-84B0-D759E93758FB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.wp8\libSpine.vcxproj", "{7D4FC6EB-9497-4804-98F3-3EAEDC896154}"
ProjectSection(ProjectDependencies) = postProject
{B5AF91B3-64EA-44E1-84B0-D759E93758FB} = {B5AF91B3-64EA-44E1-84B0-D759E93758FB}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosStudio", "..\cocos\editor-support\cocostudio\proj.wp8\libCocosStudio.vcxproj", "{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}"
ProjectSection(ProjectDependencies) = postProject
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4} = {04A0C42F-23BB-469B-A9D8-CA49136ADBD4}
{B5AF91B3-64EA-44E1-84B0-D759E93758FB} = {B5AF91B3-64EA-44E1-84B0-D759E93758FB}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\cocos\editor-support\cocosbuilder\proj.wp8\libCocosBuilder.vcxproj", "{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}"
ProjectSection(ProjectDependencies) = postProject
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4} = {04A0C42F-23BB-469B-A9D8-CA49136ADBD4}
{B5AF91B3-64EA-44E1-84B0-D759E93758FB} = {B5AF91B3-64EA-44E1-84B0-D759E93758FB}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\extensions\proj.wp8\libExtensions.vcxproj", "{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}"
ProjectSection(ProjectDependencies) = postProject
{B5AF91B3-64EA-44E1-84B0-D759E93758FB} = {B5AF91B3-64EA-44E1-84B0-D759E93758FB}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D", "..\external\Box2D\proj.wp8\Box2D.vcxproj", "{C55734A3-702C-4FA1-B950-32C8E169302F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chipmunk", "..\external\chipmunk\proj.wp8\chipmunk.vcxproj", "{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libLocalStorage", "..\cocos\storage\local-storage\proj.wp8\libLocalStorage.vcxproj", "{88982C27-5A7B-40A8-86E7-B3187B44B322}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CocosDenshion", "..\cocos\audio\proj.wp8\CocosDenshion.vcxproj", "{DF125891-EEE9-4466-B903-F828FD272158}"
ProjectSection(ProjectDependencies) = postProject
{B5AF91B3-64EA-44E1-84B0-D759E93758FB} = {B5AF91B3-64EA-44E1-84B0-D759E93758FB}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-tests", "cpp-tests", "{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("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libNetwork", "..\cocos\network\proj.wp8\libNetwork.vcxproj", "{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}"
ProjectSection(ProjectDependencies) = postProject
{B5AF91B3-64EA-44E1-84B0-D759E93758FB} = {B5AF91B3-64EA-44E1-84B0-D759E93758FB}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cpp-empty-test", "cpp-empty-test", "{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\2d\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}") = "libGUI", "..\cocos\ui\proj.wp8\libGUI.vcxproj", "{08FB23E4-1517-4EDC-B682-DA238CDAA83D}"
ProjectSection(ProjectDependencies) = postProject
{B5AF91B3-64EA-44E1-84B0-D759E93758FB} = {B5AF91B3-64EA-44E1-84B0-D759E93758FB}
EndProjectSection
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
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Debug|Any CPU.ActiveCfg = Debug|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Debug|ARM.ActiveCfg = Debug|ARM
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Debug|ARM.Build.0 = Debug|ARM
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Debug|Win32.ActiveCfg = Debug|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Debug|Win32.Build.0 = Debug|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Debug|x64.ActiveCfg = Debug|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Debug|x86.ActiveCfg = Debug|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Debug|x86.Build.0 = Debug|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Release|Any CPU.ActiveCfg = Release|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Release|ARM.ActiveCfg = Release|ARM
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Release|ARM.Build.0 = Release|ARM
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Release|Mixed Platforms.Build.0 = Release|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Release|Win32.ActiveCfg = Release|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Release|Win32.Build.0 = Release|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Release|x64.ActiveCfg = Release|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Release|x86.ActiveCfg = Release|Win32
{B5AF91B3-64EA-44E1-84B0-D759E93758FB}.Release|x86.Build.0 = Release|Win32
{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
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Debug|Any CPU.ActiveCfg = Debug|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Debug|ARM.ActiveCfg = Debug|ARM
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Debug|ARM.Build.0 = Debug|ARM
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Debug|Win32.ActiveCfg = Debug|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Debug|Win32.Build.0 = Debug|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Debug|x64.ActiveCfg = Debug|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Debug|x86.ActiveCfg = Debug|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Debug|x86.Build.0 = Debug|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Release|Any CPU.ActiveCfg = Release|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Release|ARM.ActiveCfg = Release|ARM
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Release|ARM.Build.0 = Release|ARM
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Release|Mixed Platforms.Build.0 = Release|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Release|Win32.ActiveCfg = Release|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Release|Win32.Build.0 = Release|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Release|x64.ActiveCfg = Release|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Release|x86.ActiveCfg = Release|Win32
{51E5736E-E1A3-4C94-ABB7-E92ECEF9C12E}.Release|x86.Build.0 = Release|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Debug|Any CPU.ActiveCfg = Debug|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Debug|ARM.ActiveCfg = Debug|ARM
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Debug|ARM.Build.0 = Debug|ARM
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Debug|Win32.ActiveCfg = Debug|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Debug|Win32.Build.0 = Debug|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Debug|x64.ActiveCfg = Debug|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Debug|x86.ActiveCfg = Debug|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Debug|x86.Build.0 = Debug|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Release|Any CPU.ActiveCfg = Release|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Release|ARM.ActiveCfg = Release|ARM
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Release|ARM.Build.0 = Release|ARM
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Release|Mixed Platforms.Build.0 = Release|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Release|Win32.ActiveCfg = Release|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Release|Win32.Build.0 = Release|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Release|x64.ActiveCfg = Release|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Release|x86.ActiveCfg = Release|Win32
{20D4035D-FD3F-4FD3-BABA-97BC1C38DFC2}.Release|x86.Build.0 = Release|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Debug|Any CPU.ActiveCfg = Debug|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Debug|ARM.ActiveCfg = Debug|ARM
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Debug|ARM.Build.0 = Debug|ARM
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Debug|Win32.ActiveCfg = Debug|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Debug|Win32.Build.0 = Debug|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Debug|x64.ActiveCfg = Debug|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Debug|x86.ActiveCfg = Debug|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Debug|x86.Build.0 = Debug|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Release|Any CPU.ActiveCfg = Release|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Release|ARM.ActiveCfg = Release|ARM
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Release|ARM.Build.0 = Release|ARM
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Release|Mixed Platforms.Build.0 = Release|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Release|Win32.ActiveCfg = Release|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Release|Win32.Build.0 = Release|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Release|x64.ActiveCfg = Release|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.Release|x86.ActiveCfg = Release|Win32
{04A0C42F-23BB-469B-A9D8-CA49136ADBD4}.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
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|Any CPU.ActiveCfg = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|ARM.ActiveCfg = Debug|ARM
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|ARM.Build.0 = Debug|ARM
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|Win32.ActiveCfg = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|Win32.Build.0 = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|x64.ActiveCfg = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|x86.ActiveCfg = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Debug|x86.Build.0 = Debug|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|Any CPU.ActiveCfg = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|ARM.ActiveCfg = Release|ARM
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|ARM.Build.0 = Release|ARM
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|Mixed Platforms.Build.0 = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|Win32.ActiveCfg = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|Win32.Build.0 = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|x64.ActiveCfg = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|x86.ActiveCfg = Release|Win32
{BA568A33-98F9-4D2A-BFFF-C065ADCB447A}.Release|x86.Build.0 = Release|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|Any CPU.ActiveCfg = Debug|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|ARM.ActiveCfg = Debug|ARM
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|ARM.Build.0 = Debug|ARM
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|Win32.ActiveCfg = Debug|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|Win32.Build.0 = Debug|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|x64.ActiveCfg = Debug|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|x86.ActiveCfg = Debug|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Debug|x86.Build.0 = Debug|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Release|Any CPU.ActiveCfg = Release|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Release|ARM.ActiveCfg = Release|ARM
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Release|ARM.Build.0 = Release|ARM
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Release|Mixed Platforms.Build.0 = Release|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Release|Win32.ActiveCfg = Release|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Release|Win32.Build.0 = Release|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Release|x64.ActiveCfg = Release|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Release|x86.ActiveCfg = Release|Win32
{88982C27-5A7B-40A8-86E7-B3187B44B322}.Release|x86.Build.0 = Release|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Debug|Any CPU.ActiveCfg = Debug|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Debug|ARM.ActiveCfg = Debug|ARM
{DF125891-EEE9-4466-B903-F828FD272158}.Debug|ARM.Build.0 = Debug|ARM
{DF125891-EEE9-4466-B903-F828FD272158}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Debug|Win32.ActiveCfg = Debug|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Debug|Win32.Build.0 = Debug|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Debug|x64.ActiveCfg = Debug|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Debug|x86.ActiveCfg = Debug|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Debug|x86.Build.0 = Debug|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Release|Any CPU.ActiveCfg = Release|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Release|ARM.ActiveCfg = Release|ARM
{DF125891-EEE9-4466-B903-F828FD272158}.Release|ARM.Build.0 = Release|ARM
{DF125891-EEE9-4466-B903-F828FD272158}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Release|Mixed Platforms.Build.0 = Release|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Release|Win32.ActiveCfg = Release|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Release|Win32.Build.0 = Release|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Release|x64.ActiveCfg = Release|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.Release|x86.ActiveCfg = Release|Win32
{DF125891-EEE9-4466-B903-F828FD272158}.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
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Debug|Any CPU.ActiveCfg = Debug|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Debug|ARM.ActiveCfg = Debug|ARM
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Debug|ARM.Build.0 = Debug|ARM
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Debug|Win32.ActiveCfg = Debug|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Debug|Win32.Build.0 = Debug|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Debug|x64.ActiveCfg = Debug|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Debug|x86.ActiveCfg = Debug|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Debug|x86.Build.0 = Debug|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Release|Any CPU.ActiveCfg = Release|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Release|ARM.ActiveCfg = Release|ARM
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Release|ARM.Build.0 = Release|ARM
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Release|Mixed Platforms.Build.0 = Release|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Release|Win32.ActiveCfg = Release|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Release|Win32.Build.0 = Release|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Release|x64.ActiveCfg = Release|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.Release|x86.ActiveCfg = Release|Win32
{7DAA99E7-8E07-4FEF-8374-8EC04E395D2E}.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
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Debug|Any CPU.ActiveCfg = Debug|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Debug|ARM.ActiveCfg = Debug|ARM
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Debug|ARM.Build.0 = Debug|ARM
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Debug|Win32.ActiveCfg = Debug|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Debug|Win32.Build.0 = Debug|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Debug|x64.ActiveCfg = Debug|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Debug|x86.ActiveCfg = Debug|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Debug|x86.Build.0 = Debug|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Release|Any CPU.ActiveCfg = Release|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Release|ARM.ActiveCfg = Release|ARM
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Release|ARM.Build.0 = Release|ARM
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Release|Mixed Platforms.Build.0 = Release|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Release|Win32.ActiveCfg = Release|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Release|Win32.Build.0 = Release|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Release|x64.ActiveCfg = Release|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.Release|x86.ActiveCfg = Release|Win32
{08FB23E4-1517-4EDC-B682-DA238CDAA83D}.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

View File

@ -0,0 +1,7 @@
<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>

View File

@ -0,0 +1,89 @@
//
// 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);
}

View File

@ -0,0 +1,27 @@
//
// 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;
};
}

View File

@ -0,0 +1,68 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cocos2dShaderCompiler", "Cocos2dShaderCompiler.vcxproj", "{4F6DEF20-AC4C-487F-85B8-5993519E3911}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\..\cocos\2d\cocos2d_winrt.vcxproj", "{2330EDF4-5596-4B53-8BA5-158DDDE713D9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\..\..\external\chipmunk\proj.winrt\chipmunk.vcxproj", "{8B143765-5C1B-4076-9384-3E0EC3650B1A}"
EndProject
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
{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
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Debug|ARM.ActiveCfg = Debug|ARM
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Debug|ARM.Build.0 = Debug|ARM
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Debug|Win32.ActiveCfg = Debug|Win32
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Debug|Win32.Build.0 = Debug|Win32
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Debug|x64.ActiveCfg = Debug|x64
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Debug|x64.Build.0 = Debug|x64
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Release|ARM.ActiveCfg = Release|ARM
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Release|ARM.Build.0 = Release|ARM
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Release|Win32.ActiveCfg = Release|Win32
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Release|Win32.Build.0 = Release|Win32
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Release|x64.ActiveCfg = Release|x64
{2330EDF4-5596-4B53-8BA5-158DDDE713D9}.Release|x64.Build.0 = Release|x64
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Debug|ARM.ActiveCfg = Debug|ARM
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Debug|ARM.Build.0 = Debug|ARM
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Debug|Win32.ActiveCfg = Debug|Win32
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Debug|Win32.Build.0 = Debug|Win32
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Debug|x64.ActiveCfg = Debug|x64
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Debug|x64.Build.0 = Debug|x64
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Release|ARM.ActiveCfg = Release|ARM
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Release|ARM.Build.0 = Release|ARM
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Release|Win32.ActiveCfg = Release|Win32
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Release|Win32.Build.0 = Release|Win32
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Release|x64.ActiveCfg = Release|x64
{8B143765-5C1B-4076-9384-3E0EC3650B1A}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,262 @@
<?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\cocos2d_winrt_headers.props" />
<Import Project="..\..\..\cocos\2d\cocos2d_winrt.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\cocos2d_winrt_headers.props" />
<Import Project="..\..\..\cocos\2d\cocos2d_winrt.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\cocos2d_winrt_headers.props" />
<Import Project="..\..\..\cocos\2d\cocos2d_winrt.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\cocos2d_winrt_headers.props" />
<Import Project="..\..\..\cocos\2d\cocos2d_winrt.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\cocos2d_winrt_headers.props" />
<Import Project="..\..\..\cocos\2d\cocos2d_winrt.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\cocos2d_winrt_headers.props" />
<Import Project="..\..\..\cocos\2d\cocos2d_winrt.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<PackageCertificateKeyFile>Cocos2dShaderCompiler_TemporaryKey.pfx</PackageCertificateKeyFile>
</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;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WINRT;CC_USE_PHYSICS=0;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</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;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WINRT;CC_USE_PHYSICS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</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;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WINRT;CC_USE_PHYSICS=0;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</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;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WINRT;CC_USE_PHYSICS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</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;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WINRT;CC_USE_PHYSICS=0;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</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;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<PreprocessorDefinitions>WINRT;CC_USE_PHYSICS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</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="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="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="..\..\..\external\winrt-specific\angle\prebuilt\Win32\libEGL.dll">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</DeploymentContent>
</None>
<None Include="..\..\..\external\winrt-specific\angle\prebuilt\Win32\libGLESv2.dll">
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</DeploymentContent>
</None>
<None Include="Cocos2dShaderCompiler_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="DirectXPage.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\cocos\2d\cocos2d_winrt.vcxproj">
<Project>{2330edf4-5596-4b53-8ba5-158ddde713d9}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\external\chipmunk\proj.winrt\chipmunk.vcxproj">
<Project>{8b143765-5c1b-4076-9384-3e0ec3650b1a}</Project>
</ProjectReference>
</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>

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Assets">
<UniqueIdentifier>5a7dfab3-eb13-41b4-a863-3136f23cdca2</UniqueIdentifier>
<Extensions>bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png</Extensions>
</Filter>
<Image Include="Assets\Logo.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\SmallLogo.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\StoreLogo.png">
<Filter>Assets</Filter>
</Image>
<Image Include="Assets\SplashScreen.png">
<Filter>Assets</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="App.xaml.cpp" />
<ClCompile Include="DirectXPage.xaml.cpp" />
<ClCompile Include="ShaderCompiler.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="App.xaml.h" />
<ClInclude Include="DirectXPage.xaml.h" />
<ClInclude Include="ShaderCompiler.h" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" />
</ItemGroup>
<ItemGroup>
<None Include="Cocos2dShaderCompiler_TemporaryKey.pfx" />
<None Include="..\..\..\external\winrt-specific\angle\prebuilt\Win32\libEGL.dll" />
<None Include="..\..\..\external\winrt-specific\angle\prebuilt\Win32\libGLESv2.dll" />
</ItemGroup>
<ItemGroup>
<Page Include="DirectXPage.xaml" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,22 @@
<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="Horizontal" Margin="40,100,0,0" Height="50" VerticalAlignment="Top">
<TextBlock Text="Memory: " FontSize="36"/>
<TextBlock x:Name="MemoryTextBlock" FontSize="36"/>
<TextBlock Text=" MB" FontSize="36"/>
<TextBlock Text=" Peak: " FontSize="36"/>
<TextBlock x:Name="PeakMemoryTextBlock" FontSize="36"/>
<TextBlock Text=" MB" FontSize="36"/>
</StackPanel>
<Button Margin="40,10,0,0" x:Name="compileButton" Content="Compile" Width="150" Click="OnCompile" />
</Grid>
</Page>

View File

@ -0,0 +1,126 @@
//
// 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();
}
// 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)
{
}

View File

@ -0,0 +1,56 @@
//
// 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;
};
}

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Identity Name="648a721b-11b5-48d7-816b-4d7fa8b140c0"
Publisher="CN=dalestam"
Version="1.0.0.0" />
<Properties>
<DisplayName>Cocos2dShaderCompiler</DisplayName>
<PublisherDisplayName>dalestam</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">
<VisualElements
DisplayName="Cocos2dShaderCompiler"
Logo="Assets\Logo.png"
SmallLogo="Assets\SmallLogo.png"
Description="Cocos2dShaderCompiler"
ForegroundText="light"
BackgroundColor="#464646">
<DefaultTile ShowName="allLogos" />
<SplashScreen Image="Assets\SplashScreen.png" />
</VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

View File

@ -0,0 +1,170 @@
/****************************************************************************
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 DirectX;
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)
{
}
ShaderCompiler::~ShaderCompiler()
{
CloseAngle();
}
bool ShaderCompiler::applicationDidFinishLaunching()
{
return true;
}
void ShaderCompiler::applicationDidEnterBackground()
{
}
void ShaderCompiler::applicationWillEnterForeground()
{
}
bool ShaderCompiler::Compile()
{
bool result = InitializeAngle(ANGLE_D3D_FEATURE_LEVEL::ANGLE_D3D_FEATURE_LEVEL_9_3);
Director::getInstance()->setAnimationInterval(1.0 / 60.0);
CCShaderCache::getInstance()->loadDefaultShaders();
CCPrecompiledShaders::getInstance()->savePrecompiledShaders();
return result;
}
// 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;
}

View File

@ -0,0 +1,54 @@
/****************************************************************************
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 "cocos2d.h"
#include "CCGL.h"
class ShaderCompiler : private cocos2d::Application
{
public:
ShaderCompiler();
~ShaderCompiler();
bool Compile();
private:
virtual bool applicationDidFinishLaunching();
virtual void applicationDidEnterBackground();
virtual void applicationWillEnterForeground();
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;
};

View File

@ -0,0 +1 @@
#include "pch.h"

View File

@ -0,0 +1,16 @@
#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"

View File

@ -0,0 +1,83 @@
. ".\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)

View File

@ -0,0 +1,157 @@
. ".\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)
}

View File

@ -0,0 +1,98 @@
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
#>

View File

@ -0,0 +1,5 @@
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,10 @@
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

View File

@ -0,0 +1,12 @@
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

View File

@ -0,0 +1,188 @@
<?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>

View File

@ -0,0 +1,188 @@
<?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>

View File

@ -0,0 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1

View File

@ -0,0 +1,135 @@
<?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>

View File

@ -0,0 +1,119 @@
<?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>

View File

@ -0,0 +1,2 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012

View File

@ -0,0 +1,259 @@
. ".\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"
}
}

View File

@ -737,9 +737,6 @@ void Label::updateQuads()
_reusedRect.size.width = letterDef.width;
_reusedRect.origin.x = letterDef.U;
_reusedRect.origin.y = letterDef.V;
if(_reusedLetter->getBatchNode() != _batchNodes[letterDef.textureID])
_reusedLetter->setBatchNode(_batchNodes[letterDef.textureID]);
_reusedLetter->setTextureRect(_reusedRect,false,_reusedRect.size);
_reusedLetter->setPosition(_lettersInfo[ctr].position);
@ -1015,6 +1012,7 @@ void Label::createSpriteWithFontDefinition()
_textSprite->setAnchorPoint(Point::ANCHOR_BOTTOM_LEFT);
this->setContentSize(_textSprite->getContentSize());
texture->release();
_textSprite->setBlendFunc(_blendFunc);
Node::addChild(_textSprite,0,Node::INVALID_TAG);
@ -1086,6 +1084,7 @@ void Label::drawTextSprite(Renderer *renderer, bool parentTransformUpdated)
if (_shadowEnabled && _shadowNode == nullptr)
{
_shadowNode = Sprite::createWithTexture(_textSprite->getTexture());
_shadowNode->setBlendFunc(_blendFunc);
_shadowNode->setAnchorPoint(Point::ANCHOR_BOTTOM_LEFT);
_shadowNode->setColor(_shadowColor);
_shadowNode->setOpacity(_effectColorF.a * _displayedOpacity);

View File

@ -206,7 +206,7 @@ public:
/** Sets the text color
*
*/
void setTextColor(const Color4B &color);
virtual void setTextColor(const Color4B &color);
const Color4B& getTextColor() const { return _textColor;}
@ -372,7 +372,7 @@ protected:
int _shadowBlurRadius;
kmMat4 _parentTransform;
Color3B _shadowColor;
Node* _shadowNode;
Sprite* _shadowNode;
Color4B _textColor;
Color4F _textColorF;

View File

@ -849,6 +849,24 @@ LayerMultiplex::~LayerMultiplex()
}
}
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
LayerMultiplex * LayerMultiplex::createVariadic(Layer * layer, ...)
{
va_list args;
va_start(args,layer);
LayerMultiplex * multiplexLayer = new LayerMultiplex();
if(multiplexLayer && multiplexLayer->initWithLayers(layer, args))
{
multiplexLayer->autorelease();
va_end(args);
return multiplexLayer;
}
va_end(args);
CC_SAFE_DELETE(multiplexLayer);
return nullptr;
}
#else
LayerMultiplex * LayerMultiplex::create(Layer * layer, ...)
{
va_list args;
@ -865,6 +883,7 @@ LayerMultiplex * LayerMultiplex::create(Layer * layer, ...)
CC_SAFE_DELETE(multiplexLayer);
return nullptr;
}
#endif
LayerMultiplex * LayerMultiplex::createWithLayer(Layer* layer)
{

View File

@ -57,8 +57,10 @@ TextFieldTTF::TextFieldTTF()
, _inputText("")
, _placeHolder("") // prevent Label initWithString assertion
, _secureTextEntry(false)
, _colorText(Color4B::WHITE)
{
_colorSpaceHolder.r = _colorSpaceHolder.g = _colorSpaceHolder.b = 127;
_colorSpaceHolder.a = 255;
}
TextFieldTTF::~TextFieldTTF()
@ -112,6 +114,7 @@ bool TextFieldTTF::initWithPlaceHolder(const std::string& placeholder, const Siz
setFontName(fontName);
setFontSize(fontSize);
setAlignment(alignment,TextVAlignment::CENTER);
Label::setTextColor(_colorSpaceHolder);
Label::setString(_placeHolder);
return true;
@ -121,6 +124,7 @@ bool TextFieldTTF::initWithPlaceHolder(const std::string& placeholder, const std
_placeHolder = std::string(placeholder);
setFontName(fontName);
setFontSize(fontSize);
Label::setTextColor(_colorSpaceHolder);
Label::setString(_placeHolder);
return true;
@ -238,6 +242,7 @@ void TextFieldTTF::deleteBackward()
{
_inputText = "";
_charCount = 0;
Label::setTextColor(_colorSpaceHolder);
Label::setString(_placeHolder);
return;
}
@ -252,10 +257,10 @@ const std::string& TextFieldTTF::getContentText()
return _inputText;
}
void TextFieldTTF::setColor(const Color3B& color)
void TextFieldTTF::setTextColor(const Color4B &color)
{
_colorText = color;
Label::setColor(color);
Label::setTextColor(_colorText);
}
void TextFieldTTF::visit(Renderer *renderer, const kmMat4 &parentTransform, bool parentTransformUpdated)
@ -267,12 +272,20 @@ void TextFieldTTF::visit(Renderer *renderer, const kmMat4 &parentTransform, bool
Label::visit(renderer,parentTransform,parentTransformUpdated);
}
const Color3B& TextFieldTTF::getColorSpaceHolder()
const Color4B& TextFieldTTF::getColorSpaceHolder()
{
return _colorSpaceHolder;
}
void TextFieldTTF::setColorSpaceHolder(const Color3B& color)
{
_colorSpaceHolder.r = color.r;
_colorSpaceHolder.g = color.g;
_colorSpaceHolder.b = color.b;
_colorSpaceHolder.a = 255;
}
void TextFieldTTF::setColorSpaceHolder(const Color4B& color)
{
_colorSpaceHolder = color;
}
@ -311,12 +324,12 @@ void TextFieldTTF::setString(const std::string &text)
// if there is no input text, display placeholder instead
if (! _inputText.length())
{
Label::setColor(_colorSpaceHolder);
Label::setTextColor(_colorSpaceHolder);
Label::setString(_placeHolder);
}
else
{
Label::setColor(_colorText);
Label::setTextColor(_colorText);
Label::setString(displayText);
}
_charCount = _calcCharCount(_inputText.c_str());
@ -333,6 +346,7 @@ void TextFieldTTF::setPlaceHolder(const std::string& text)
_placeHolder = text;
if (! _inputText.length())
{
Label::setTextColor(_colorSpaceHolder);
Label::setString(_placeHolder);
}
}
@ -348,7 +362,7 @@ void TextFieldTTF::setSecureTextEntry(bool value)
if (_secureTextEntry != value)
{
_secureTextEntry = value;
setString(getString());
setString(_inputText);
}
}

View File

@ -145,10 +145,13 @@ public:
inline void setDelegate(TextFieldDelegate* delegate) { _delegate = delegate; };
inline int getCharCount() const { return _charCount; };
virtual const Color3B& getColorSpaceHolder();
virtual void setColorSpaceHolder(const Color3B& color);
virtual const Color4B& getColorSpaceHolder();
virtual void setColor(const Color3B& color) override;
virtual void setColorSpaceHolder(const Color3B& color);
virtual void setColorSpaceHolder(const Color4B& color);
virtual void setTextColor(const Color4B& textColor) override;
// input text property
virtual void setString(const std::string& text) override;
@ -181,8 +184,8 @@ protected:
std::string _inputText;
std::string _placeHolder;
Color3B _colorSpaceHolder;
Color3B _colorText;
Color4B _colorSpaceHolder;
Color4B _colorText;
bool _secureTextEntry;

View File

@ -548,6 +548,7 @@ VolatileTexture::VolatileTexture(Texture2D *t)
, _fileName("")
, _text("")
, _uiImage(nullptr)
, _hasMipmaps(false)
{
_texParams.minFilter = GL_LINEAR;
_texParams.magFilter = GL_LINEAR;

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<EngineRoot>$(MSBuildThisFileDirectory)..\..\</EngineRoot>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAsWinRT>true</CompileAsWinRT>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<DisableSpecificWarnings>4056;4996;</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<BuildMacro Include="EngineRoot">
<Value>$(EngineRoot)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -0,0 +1,832 @@
<?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>{2330EDF4-5596-4B53-8BA5-158DDDE713D9}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectName>libcocos2d</ProjectName>
<RootNamespace>cocos2d-x.win32</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" />
<Import Project="cocos2d_winrt_headers.props" />
<Import Project="cocos2d_winrt.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="cocos2d_winrt_headers.props" />
<Import Project="cocos2d_winrt.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="cocos2d_winrt_headers.props" />
<Import Project="cocos2d_winrt.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="cocos2d_winrt_headers.props" />
<Import Project="cocos2d_winrt.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="cocos2d_winrt_headers.props" />
<Import Project="cocos2d_winrt.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="cocos2d_winrt_headers.props" />
<Import Project="cocos2d_winrt.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)\winrt$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>winrt\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)\winrt$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>winrt\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)\winrt$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>winrt\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)\winrt$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>winrt\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)\winrt$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>winrt\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
<OutDir>$(SolutionDir)\winrt$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>winrt\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\winrt;$(EngineRoot)external\jpeg\include\winrt;$(EngineRoot)external\tiff\include\winrt;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\winrt;$(EngineRoot)external\winrt-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINRT;_DEBUG;_LIB;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\external\png\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\jpeg\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\tiff\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\freetype2\prebuilt\winrt\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\winrt;$(EngineRoot)external\jpeg\include\winrt;$(EngineRoot)external\tiff\include\winrt;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\winrt;$(EngineRoot)external\winrt-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINRT;NDEBUG;_LIB;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalLibraryDirectories>$(ProjectDir)..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\external\png\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\jpeg\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\tiff\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\freetype2\prebuilt\winrt\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\winrt;$(EngineRoot)external\jpeg\include\winrt;$(EngineRoot)external\tiff\include\winrt;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\winrt;$(EngineRoot)external\winrt-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINRT;_DEBUG;_LIB;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalLibraryDirectories>$(ProjectDir)..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\external\png\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\jpeg\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\tiff\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\freetype2\prebuilt\winrt\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\winrt;$(EngineRoot)external\jpeg\include\winrt;$(EngineRoot)external\tiff\include\winrt;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\winrt;$(EngineRoot)external\winrt-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINRT;NDEBUG;_LIB;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalLibraryDirectories>$(ProjectDir)..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\external\png\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\jpeg\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\tiff\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\freetype2\prebuilt\winrt\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\winrt;$(EngineRoot)external\jpeg\include\winrt;$(EngineRoot)external\tiff\include\winrt;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\winrt;$(EngineRoot)external\winrt-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINRT;_DEBUG;_LIB;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalLibraryDirectories>$(ProjectDir)..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\external\png\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\jpeg\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\tiff\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\freetype2\prebuilt\winrt\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\winrt;$(EngineRoot)external\jpeg\include\winrt;$(EngineRoot)external\tiff\include\winrt;$(EngineRoot)external\webp\include\win32;$(EngineRoot)external\freetype2\include\winrt;$(EngineRoot)external\winrt-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WINRT;NDEBUG;_LIB;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalLibraryDirectories>$(ProjectDir)..\..\external\winrt-specific\zlib\prebuilt\$(Platform);$(ProjectDir)..\..\external\png\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\jpeg\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\tiff\prebuilt\winrt\$(Platform);$(ProjectDir)..\..\external\freetype2\prebuilt\winrt\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ItemGroup>
<ClCompile Include="..\..\external\edtaa3func\edtaa3func.cpp" />
<ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi.cpp" />
<ClCompile Include="..\..\external\unzip\unzip.cpp" />
<ClCompile Include="..\base\atitc.cpp" />
<ClCompile Include="..\base\CCAffineTransform.cpp" />
<ClCompile Include="..\base\CCArray.cpp" />
<ClCompile Include="..\base\CCAutoreleasePool.cpp" />
<ClCompile Include="..\base\CCConsole.cpp" />
<ClCompile Include="..\base\CCData.cpp" />
<ClCompile Include="..\base\CCDataVisitor.cpp" />
<ClCompile Include="..\base\CCDictionary.cpp" />
<ClCompile Include="..\base\CCGeometry.cpp" />
<ClCompile Include="..\base\CCNS.cpp" />
<ClCompile Include="..\base\CCRef.cpp" />
<ClCompile Include="..\base\CCSet.cpp" />
<ClCompile Include="..\base\CCString.cpp" />
<ClCompile Include="..\base\CCValue.cpp" />
<ClCompile Include="..\base\etc1.cpp" />
<ClCompile Include="..\base\s3tc.cpp" />
<ClCompile Include="..\math\kazmath\kazmath\aabb.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\GL\mat4stack.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\GL\matrix.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\mat3.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\mat4.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\neon_matrix_impl.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\plane.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\quaternion.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\ray2.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\ray3.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\utility.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\vec2.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\vec3.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\vec4.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
</ClCompile>
<ClCompile Include="..\physics\CCPhysicsBody.cpp" />
<ClCompile Include="..\physics\CCPhysicsContact.cpp" />
<ClCompile Include="..\physics\CCPhysicsJoint.cpp" />
<ClCompile Include="..\physics\CCPhysicsShape.cpp" />
<ClCompile Include="..\physics\CCPhysicsWorld.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsBodyInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsContactInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsJointInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsShapeInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsWorldInfo_chipmunk.cpp" />
<ClCompile Include="base64.cpp" />
<ClCompile Include="CCAction.cpp" />
<ClCompile Include="CCActionCamera.cpp" />
<ClCompile Include="CCActionCatmullRom.cpp" />
<ClCompile Include="CCActionEase.cpp" />
<ClCompile Include="CCActionGrid.cpp" />
<ClCompile Include="CCActionGrid3D.cpp" />
<ClCompile Include="CCActionInstant.cpp" />
<ClCompile Include="CCActionInterval.cpp" />
<ClCompile Include="CCActionManager.cpp" />
<ClCompile Include="CCActionPageTurn3D.cpp" />
<ClCompile Include="CCActionProgressTimer.cpp" />
<ClCompile Include="CCActionTiledGrid.cpp" />
<ClCompile Include="CCActionTween.cpp" />
<ClCompile Include="CCAnimation.cpp" />
<ClCompile Include="CCAnimationCache.cpp" />
<ClCompile Include="CCAtlasNode.cpp" />
<ClCompile Include="ccCArray.cpp" />
<ClCompile Include="CCClippingNode.cpp" />
<ClCompile Include="CCComponent.cpp" />
<ClCompile Include="CCComponentContainer.cpp" />
<ClCompile Include="CCConfiguration.cpp" />
<ClCompile Include="CCDeprecated.cpp" />
<ClCompile Include="CCDirector.cpp" />
<ClCompile Include="CCDrawingPrimitives.cpp" />
<ClCompile Include="CCDrawNode.cpp" />
<ClCompile Include="CCEvent.cpp" />
<ClCompile Include="CCEventAcceleration.cpp" />
<ClCompile Include="CCEventCustom.cpp" />
<ClCompile Include="CCEventDispatcher.cpp" />
<ClCompile Include="CCEventKeyboard.cpp" />
<ClCompile Include="CCEventListener.cpp" />
<ClCompile Include="CCEventListenerAcceleration.cpp" />
<ClCompile Include="CCEventListenerCustom.cpp" />
<ClCompile Include="CCEventListenerKeyboard.cpp" />
<ClCompile Include="CCEventListenerMouse.cpp" />
<ClCompile Include="CCEventListenerTouch.cpp" />
<ClCompile Include="CCEventMouse.cpp" />
<ClCompile Include="CCEventTouch.cpp" />
<ClCompile Include="CCFont.cpp" />
<ClCompile Include="CCFontAtlas.cpp" />
<ClCompile Include="CCFontAtlasCache.cpp" />
<ClCompile Include="CCFontCharMap.cpp" />
<ClCompile Include="CCFontFNT.cpp" />
<ClCompile Include="CCFontFreeType.cpp" />
<ClCompile Include="ccFPSImages.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
</ClCompile>
<ClCompile Include="CCGLProgram.cpp" />
<ClCompile Include="ccGLStateCache.cpp" />
<ClCompile Include="CCGrabber.cpp" />
<ClCompile Include="CCGrid.cpp" />
<ClCompile Include="CCNodeGrid.cpp" />
<ClCompile Include="CCIMEDispatcher.cpp" />
<ClCompile Include="CCLabel.cpp" />
<ClCompile Include="CCLabelAtlas.cpp" />
<ClCompile Include="CCLabelBMFont.cpp" />
<ClCompile Include="CCLabelTextFormatter.cpp" />
<ClCompile Include="CCLabelTTF.cpp" />
<ClCompile Include="CCLayer.cpp" />
<ClCompile Include="CCMenu.cpp" />
<ClCompile Include="CCMenuItem.cpp" />
<ClCompile Include="CCMotionStreak.cpp" />
<ClCompile Include="CCNode.cpp" />
<ClCompile Include="CCNotificationCenter.cpp" />
<ClCompile Include="CCParallaxNode.cpp" />
<ClCompile Include="CCParticleBatchNode.cpp" />
<ClCompile Include="CCParticleExamples.cpp" />
<ClCompile Include="CCParticleSystem.cpp" />
<ClCompile Include="CCParticleSystemQuad.cpp" />
<ClCompile Include="CCProfiling.cpp" />
<ClCompile Include="CCProgressTimer.cpp" />
<ClCompile Include="CCRenderTexture.cpp" />
<ClCompile Include="CCScene.cpp" />
<ClCompile Include="CCScheduler.cpp" />
<ClCompile Include="CCScriptSupport.cpp" />
<ClCompile Include="CCShaderCache.cpp" />
<ClCompile Include="ccShaders.cpp" />
<ClCompile Include="CCSprite.cpp" />
<ClCompile Include="CCSpriteBatchNode.cpp" />
<ClCompile Include="CCSpriteFrame.cpp" />
<ClCompile Include="CCSpriteFrameCache.cpp" />
<ClCompile Include="CCTextFieldTTF.cpp" />
<ClCompile Include="CCTexture2D.cpp" />
<ClCompile Include="CCTextureAtlas.cpp" />
<ClCompile Include="CCTextureCache.cpp" />
<ClCompile Include="CCTileMapAtlas.cpp" />
<ClCompile Include="CCTMXLayer.cpp" />
<ClCompile Include="CCTMXObjectGroup.cpp" />
<ClCompile Include="CCTMXTiledMap.cpp" />
<ClCompile Include="CCTMXXMLParser.cpp" />
<ClCompile Include="CCTouch.cpp" />
<ClCompile Include="CCTransition.cpp" />
<ClCompile Include="CCTransitionPageTurn.cpp" />
<ClCompile Include="CCTransitionProgress.cpp" />
<ClCompile Include="ccTypes.cpp" />
<ClCompile Include="CCTweenFunction.cpp" />
<ClCompile Include="CCUserDefault.cpp" />
<ClCompile Include="ccUTF8.cpp" />
<ClCompile Include="ccUtils.cpp" />
<ClCompile Include="CCVertex.cpp" />
<ClCompile Include="cocos2d.cpp" />
<ClCompile Include="platform\CCGLViewProtocol.cpp" />
<ClCompile Include="platform\CCFileUtils.cpp" />
<ClCompile Include="platform\CCImage.cpp" />
<ClCompile Include="platform\CCSAXParser.cpp" />
<ClCompile Include="platform\CCThread.cpp" />
<ClCompile Include="platform\winrt\CCApplication.cpp" />
<ClCompile Include="platform\winrt\CCCommon.cpp" />
<ClCompile Include="platform\winrt\CCDevice.cpp" />
<ClCompile Include="platform\winrt\CCFileUtilsWinRT.cpp" />
<ClCompile Include="platform\winrt\CCFreeTypeFont.cpp" />
<ClCompile Include="platform\winrt\CCGLView.cpp" />
<ClCompile Include="platform\winrt\CCPrecompiledShaders.cpp" />
<ClCompile Include="platform\winrt\CCPThreadWinRT.cpp" />
<ClCompile Include="platform\winrt\CCStdC.cpp" />
<ClCompile Include="platform\winrt\CCWinRTUtils.cpp" />
<ClCompile Include="platform\winrt\DirectXBase.cpp" />
<ClCompile Include="platform\winrt\sha1.cpp" />
<ClCompile Include="renderer\CCBatchCommand.cpp" />
<ClCompile Include="renderer\CCCustomCommand.cpp" />
<ClCompile Include="renderer\CCFrustum.cpp" />
<ClCompile Include="renderer\CCGroupCommand.cpp" />
<ClCompile Include="renderer\CCMaterialManager.cpp" />
<ClCompile Include="renderer\CCQuadCommand.cpp" />
<ClCompile Include="renderer\CCRenderCommand.cpp" />
<ClCompile Include="renderer\CCRenderer.cpp" />
<ClCompile Include="renderer\CCRenderMaterial.cpp" />
<ClCompile Include="TGAlib.cpp" />
<ClCompile Include="TransformUtils.cpp" />
<ClCompile Include="ZipUtils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\external\edtaa3func\edtaa3func.h" />
<ClInclude Include="..\..\external\tinyxml2\tinyxml2.h" />
<ClInclude Include="..\..\external\unzip\ioapi.h" />
<ClInclude Include="..\..\external\unzip\unzip.h" />
<ClInclude Include="..\base\atitc.h" />
<ClInclude Include="..\base\CCAffineTransform.h" />
<ClInclude Include="..\base\CCArray.h" />
<ClInclude Include="..\base\CCAutoreleasePool.h" />
<ClInclude Include="..\base\CCBool.h" />
<ClInclude Include="..\base\CCConsole.h" />
<ClInclude Include="..\base\CCData.h" />
<ClInclude Include="..\base\CCDataVisitor.h" />
<ClInclude Include="..\base\CCDictionary.h" />
<ClInclude Include="..\base\CCDouble.h" />
<ClInclude Include="..\base\CCFloat.h" />
<ClInclude Include="..\base\CCGeometry.h" />
<ClInclude Include="..\base\CCInteger.h" />
<ClInclude Include="..\base\CCMap.h" />
<ClInclude Include="..\base\CCNS.h" />
<ClInclude Include="..\base\CCRef.h" />
<ClInclude Include="..\base\CCPlatformConfig.h" />
<ClInclude Include="..\base\CCPlatformMacros.h" />
<ClInclude Include="..\base\CCSet.h" />
<ClInclude Include="..\base\CCString.h" />
<ClInclude Include="..\base\CCValue.h" />
<ClInclude Include="..\base\CCVector.h" />
<ClInclude Include="..\base\etc1.h" />
<ClInclude Include="..\base\s3tc.h" />
<ClInclude Include="..\math\kazmath\kazmath\aabb.h" />
<ClInclude Include="..\math\kazmath\kazmath\GL\mat4stack.h" />
<ClInclude Include="..\math\kazmath\kazmath\GL\matrix.h" />
<ClInclude Include="..\math\kazmath\kazmath\kazmath.h" />
<ClInclude Include="..\math\kazmath\kazmath\mat3.h" />
<ClInclude Include="..\math\kazmath\kazmath\mat4.h" />
<ClInclude Include="..\math\kazmath\kazmath\neon_matrix_impl.h" />
<ClInclude Include="..\math\kazmath\kazmath\plane.h" />
<ClInclude Include="..\math\kazmath\kazmath\quaternion.h" />
<ClInclude Include="..\math\kazmath\kazmath\ray2.h" />
<ClInclude Include="..\math\kazmath\kazmath\ray3.h" />
<ClInclude Include="..\math\kazmath\kazmath\utility.h" />
<ClInclude Include="..\math\kazmath\kazmath\vec2.h" />
<ClInclude Include="..\math\kazmath\kazmath\vec3.h" />
<ClInclude Include="..\math\kazmath\kazmath\vec4.h" />
<ClInclude Include="..\physics\CCPhysicsBody.h" />
<ClInclude Include="..\physics\CCPhysicsContact.h" />
<ClInclude Include="..\physics\CCPhysicsJoint.h" />
<ClInclude Include="..\physics\CCPhysicsShape.h" />
<ClInclude Include="..\physics\CCPhysicsWorld.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsBodyInfo_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsContactInfo_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsHelper_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsJointInfo_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsShapeInfo_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsWorldInfo_chipmunk.h" />
<ClInclude Include="base64.h" />
<ClInclude Include="CCAction.h" />
<ClInclude Include="CCActionCamera.h" />
<ClInclude Include="CCActionCatmullRom.h" />
<ClInclude Include="CCActionEase.h" />
<ClInclude Include="CCActionGrid.h" />
<ClInclude Include="CCActionGrid3D.h" />
<ClInclude Include="CCActionInstant.h" />
<ClInclude Include="CCActionInterval.h" />
<ClInclude Include="CCActionManager.h" />
<ClInclude Include="CCActionPageTurn3D.h" />
<ClInclude Include="CCActionProgressTimer.h" />
<ClInclude Include="CCActionTiledGrid.h" />
<ClInclude Include="CCActionTween.h" />
<ClInclude Include="CCAnimation.h" />
<ClInclude Include="CCAnimationCache.h" />
<ClInclude Include="CCAtlasNode.h" />
<ClInclude Include="ccCArray.h" />
<ClInclude Include="CCClippingNode.h" />
<ClInclude Include="CCComponent.h" />
<ClInclude Include="CCComponentContainer.h" />
<ClInclude Include="ccConfig.h" />
<ClInclude Include="CCConfiguration.h" />
<ClInclude Include="CCDeprecated.h" />
<ClInclude Include="CCDirector.h" />
<ClInclude Include="CCDrawingPrimitives.h" />
<ClInclude Include="CCDrawNode.h" />
<ClInclude Include="CCEvent.h" />
<ClInclude Include="CCEventAcceleration.h" />
<ClInclude Include="CCEventCustom.h" />
<ClInclude Include="CCEventDispatcher.h" />
<ClInclude Include="CCEventKeyboard.h" />
<ClInclude Include="CCEventListener.h" />
<ClInclude Include="CCEventListenerAcceleration.h" />
<ClInclude Include="CCEventListenerCustom.h" />
<ClInclude Include="CCEventListenerKeyboard.h" />
<ClInclude Include="CCEventListenerMouse.h" />
<ClInclude Include="CCEventListenerTouch.h" />
<ClInclude Include="CCEventMouse.h" />
<ClInclude Include="CCEventTouch.h" />
<ClInclude Include="CCEventType.h" />
<ClInclude Include="CCFont.h" />
<ClInclude Include="CCFontAtlas.h" />
<ClInclude Include="CCFontAtlasCache.h" />
<ClInclude Include="CCFontCharMap.h" />
<ClInclude Include="CCFontFNT.h" />
<ClInclude Include="CCFontFreeType.h" />
<ClInclude Include="ccFPSImages.h" />
<ClInclude Include="CCGLProgram.h" />
<ClInclude Include="ccGLStateCache.h" />
<ClInclude Include="CCGrabber.h" />
<ClInclude Include="CCGrid.h" />
<ClInclude Include="CCNodeGrid.h" />
<ClInclude Include="CCIMEDelegate.h" />
<ClInclude Include="CCIMEDispatcher.h" />
<ClInclude Include="CCLabel.h" />
<ClInclude Include="CCLabelAtlas.h" />
<ClInclude Include="CCLabelBMFont.h" />
<ClInclude Include="CCLabelTextFormatter.h" />
<ClInclude Include="CCLabelTTF.h" />
<ClInclude Include="CCLayer.h" />
<ClInclude Include="ccMacros.h" />
<ClInclude Include="CCMenu.h" />
<ClInclude Include="CCMenuItem.h" />
<ClInclude Include="CCMotionStreak.h" />
<ClInclude Include="CCNode.h" />
<ClInclude Include="CCNotificationCenter.h" />
<ClInclude Include="CCParallaxNode.h" />
<ClInclude Include="CCParticleBatchNode.h" />
<ClInclude Include="CCParticleExamples.h" />
<ClInclude Include="CCParticleSystem.h" />
<ClInclude Include="CCParticleSystemQuad.h" />
<ClInclude Include="CCProfiling.h" />
<ClInclude Include="CCProgressTimer.h" />
<ClInclude Include="CCProtocols.h" />
<ClInclude Include="CCRenderTexture.h" />
<ClInclude Include="CCScene.h" />
<ClInclude Include="CCScheduler.h" />
<ClInclude Include="CCScriptSupport.h" />
<ClInclude Include="CCShaderCache.h" />
<ClInclude Include="ccShaderEx_SwitchMask_frag.h" />
<ClInclude Include="ccShaders.h" />
<ClInclude Include="ccShader_PositionColorLengthTexture_frag.h" />
<ClInclude Include="ccShader_PositionColorLengthTexture_vert.h" />
<ClInclude Include="ccShader_PositionColor_frag.h" />
<ClInclude Include="ccShader_PositionColor_vert.h" />
<ClInclude Include="ccShader_PositionTextureA8Color_frag.h" />
<ClInclude Include="ccShader_PositionTextureA8Color_vert.h" />
<ClInclude Include="ccShader_PositionTextureColorAlphaTest_frag.h" />
<ClInclude Include="ccShader_PositionTextureColor_frag.h" />
<ClInclude Include="ccShader_PositionTextureColor_vert.h" />
<ClInclude Include="ccShader_PositionTexture_frag.h" />
<ClInclude Include="ccShader_PositionTexture_uColor_frag.h" />
<ClInclude Include="ccShader_PositionTexture_uColor_vert.h" />
<ClInclude Include="ccShader_PositionTexture_vert.h" />
<ClInclude Include="ccShader_Position_uColor_frag.h" />
<ClInclude Include="ccShader_Position_uColor_vert.h" />
<ClInclude Include="CCSprite.h" />
<ClInclude Include="CCSpriteBatchNode.h" />
<ClInclude Include="CCSpriteFrame.h" />
<ClInclude Include="CCSpriteFrameCache.h" />
<ClInclude Include="CCTextFieldTTF.h" />
<ClInclude Include="CCTexture2D.h" />
<ClInclude Include="CCTextureAtlas.h" />
<ClInclude Include="CCTextureCache.h" />
<ClInclude Include="CCTileMapAtlas.h" />
<ClInclude Include="CCTMXLayer.h" />
<ClInclude Include="CCTMXObjectGroup.h" />
<ClInclude Include="CCTMXTiledMap.h" />
<ClInclude Include="CCTMXXMLParser.h" />
<ClInclude Include="CCTouch.h" />
<ClInclude Include="CCTransition.h" />
<ClInclude Include="CCTransitionPageTurn.h" />
<ClInclude Include="CCTransitionProgress.h" />
<ClInclude Include="ccTypes.h" />
<ClInclude Include="CCTweenFunction.h" />
<ClInclude Include="CCUserDefault.h" />
<ClInclude Include="ccUTF8.h" />
<ClInclude Include="ccUtils.h" />
<ClInclude Include="CCVertex.h" />
<ClInclude Include="cocos2d.h" />
<ClInclude Include="platform\CCApplicationProtocol.h" />
<ClInclude Include="platform\CCCommon.h" />
<ClInclude Include="platform\CCDevice.h" />
<ClInclude Include="platform\CCGLViewProtocol.h" />
<ClInclude Include="platform\CCFileUtils.h" />
<ClInclude Include="platform\CCImage.h" />
<ClInclude Include="platform\CCSAXParser.h" />
<ClInclude Include="platform\CCThread.h" />
<ClInclude Include="platform\winrt\CCApplication.h" />
<ClInclude Include="platform\winrt\CCFileUtilsWinRT.h" />
<ClInclude Include="platform\winrt\CCFreeTypeFont.h" />
<ClInclude Include="platform\winrt\CCGL.h" />
<ClInclude Include="platform\winrt\CCGLView.h" />
<ClInclude Include="platform\winrt\CCGL_Angle.h" />
<ClInclude Include="platform\winrt\CCPlatformDefine.h" />
<ClInclude Include="platform\winrt\CCPrecompiledShaders.h" />
<ClInclude Include="platform\winrt\CCPThreadWinRT.h" />
<ClInclude Include="platform\winrt\CCStdC.h" />
<ClInclude Include="platform\winrt\CCWinRTUtils.h" />
<ClInclude Include="platform\winrt\DirectXBase.h" />
<ClInclude Include="platform\winrt\DirectXHelper.h" />
<ClInclude Include="platform\winrt\sha1.h" />
<ClInclude Include="renderer\CCBatchCommand.h" />
<ClInclude Include="renderer\CCCustomCommand.h" />
<ClInclude Include="renderer\CCFrustum.h" />
<ClInclude Include="renderer\CCGroupCommand.h" />
<ClInclude Include="renderer\CCMaterialManager.h" />
<ClInclude Include="renderer\CCQuadCommand.h" />
<ClInclude Include="renderer\CCRenderCommand.h" />
<ClInclude Include="renderer\CCRenderCommandPool.h" />
<ClInclude Include="renderer\CCRenderer.h" />
<ClInclude Include="renderer\CCRenderMaterial.h" />
<ClInclude Include="TGAlib.h" />
<ClInclude Include="TransformUtils.h" />
<ClInclude Include="uthash.h" />
<ClInclude Include="utlist.h" />
<ClInclude Include="ZipUtils.h" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<EngineRoot>$(MSBuildThisFileDirectory)..\..\</EngineRoot>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(EngineRoot)cocos\2d\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\2d\renderer;$(EngineRoot)cocos\math\kazmath;$(EngineRoot)cocos\gui;$(EngineRoot)cocos\base;$(EngineRoot)cocos\physics;$(EngineRoot)cocos\math\kazmath\include;$(GeneratedFilesDir)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<BuildMacro Include="EngineRoot">
<Value>$(EngineRoot)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -0,0 +1,888 @@
<?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>{B5AF91B3-64EA-44E1-84B0-D759E93758FB}</ProjectGuid>
<RootNamespace>cocos2d-x.win32</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<ProjectName>libcocos2d</ProjectName>
</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="cocos2d_wp8_headers.props" />
<Import Project="cocos2dx.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="cocos2d_wp8_headers.props" />
<Import Project="cocos2dx.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="cocos2d_wp8_headers.props" />
<Import Project="cocos2dx.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="cocos2d_wp8_headers.props" />
<Import Project="cocos2dx.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>$(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;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_LIB;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>ole32.lib;</IgnoreSpecificDefaultLibraries>
<AdditionalDependencies>d3d11.lib;xaudio2.lib;libEGL_phone.lib;libGLESv2_phone.lib;freetype.lib;libpng.lib;libjpeg.lib;libtiff.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\external\wp8-specific\angle\prebuilt\$(Platform);..\..\external\wp8-specific\zlib\prebuilt\$(Platform);..\..\external\png\prebuilt\wp8\$(Platform);..\..\external\jpeg\prebuilt\wp8\$(Platform);..\..\external\tiff\prebuilt\wp8\$(Platform);..\..\external\freetype2\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\png\prebuilt\wp8\$(Platform);$(EngineRoot)external\jpeg\prebuilt\wp8\$(Platform);$(EngineRoot)external\tiff\prebuilt\wp8\$(Platform);$(EngineRoot)external\freetype2\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</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>
<AdditionalIncludeDirectories>$(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;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>ole32.lib;</IgnoreSpecificDefaultLibraries>
<AdditionalDependencies>d3d11.lib;xaudio2.lib;libEGL_phone.lib;libGLESv2_phone.lib;freetype.lib;libpng.lib;libjpeg.lib;libtiff.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\external\wp8-specific\angle\prebuilt\$(Platform);..\..\external\wp8-specific\zlib\prebuilt\$(Platform);..\..\external\png\prebuilt\wp8\$(Platform);..\..\external\jpeg\prebuilt\wp8\$(Platform);..\..\external\tiff\prebuilt\wp8\$(Platform);..\..\external\freetype2\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\png\prebuilt\wp8\$(Platform);$(EngineRoot)external\jpeg\prebuilt\wp8\$(Platform);$(EngineRoot)external\tiff\prebuilt\wp8\$(Platform);$(EngineRoot)external\freetype2\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>$(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;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_LIB;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>ole32.lib;</IgnoreSpecificDefaultLibraries>
<AdditionalDependencies>d3d11.lib;xaudio2.lib;libEGL_phone.lib;libGLESv2_phone.lib;freetype.lib;libpng.lib;libjpeg.lib;libtiff.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\external\wp8-specific\angle\prebuilt\$(Platform);..\..\external\wp8-specific\zlib\prebuilt\$(Platform);..\..\external\png\prebuilt\wp8\$(Platform);..\..\external\jpeg\prebuilt\wp8\$(Platform);..\..\external\tiff\prebuilt\wp8\$(Platform);..\..\external\freetype2\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\png\prebuilt\wp8\$(Platform);$(EngineRoot)external\jpeg\prebuilt\wp8\$(Platform);$(EngineRoot)external\tiff\prebuilt\wp8\$(Platform);$(EngineRoot)external\freetype2\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</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>
<AdditionalIncludeDirectories>$(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;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WP8;_LIB;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>ole32.lib;</IgnoreSpecificDefaultLibraries>
<AdditionalDependencies>d3d11.lib;xaudio2.lib;libEGL_phone.lib;libGLESv2_phone.lib;freetype.lib;libpng.lib;libjpeg.lib;libtiff.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\external\wp8-specific\angle\prebuilt\$(Platform);..\..\external\wp8-specific\zlib\prebuilt\$(Platform);..\..\external\png\prebuilt\wp8\$(Platform);..\..\external\jpeg\prebuilt\wp8\$(Platform);..\..\external\tiff\prebuilt\wp8\$(Platform);..\..\external\freetype2\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Lib>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(EngineRoot)external\wp8-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\png\prebuilt\wp8\$(Platform);$(EngineRoot)external\jpeg\prebuilt\wp8\$(Platform);$(EngineRoot)external\tiff\prebuilt\wp8\$(Platform);$(EngineRoot)external\freetype2\prebuilt\wp8\$(Platform);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</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>
<ItemGroup>
<ClCompile Include="..\..\external\edtaa3func\edtaa3func.cpp" />
<ClCompile Include="..\..\external\tinyxml2\tinyxml2.cpp" />
<ClCompile Include="..\..\external\unzip\ioapi.cpp" />
<ClCompile Include="..\..\external\unzip\unzip.cpp" />
<ClCompile Include="..\base\atitc.cpp" />
<ClCompile Include="..\base\CCAffineTransform.cpp" />
<ClCompile Include="..\base\CCArray.cpp" />
<ClCompile Include="..\base\CCAutoreleasePool.cpp" />
<ClCompile Include="..\base\CCConsole.cpp" />
<ClCompile Include="..\base\CCData.cpp" />
<ClCompile Include="..\base\CCDataVisitor.cpp" />
<ClCompile Include="..\base\CCDictionary.cpp" />
<ClCompile Include="..\base\CCGeometry.cpp" />
<ClCompile Include="..\base\CCNS.cpp" />
<ClCompile Include="..\base\CCRef.cpp" />
<ClCompile Include="..\base\CCSet.cpp" />
<ClCompile Include="..\base\CCString.cpp" />
<ClCompile Include="..\base\CCValue.cpp" />
<ClCompile Include="..\base\etc1.cpp" />
<ClCompile Include="..\base\s3tc.cpp" />
<ClCompile Include="..\math\kazmath\kazmath\aabb.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\GL\mat4stack.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\GL\matrix.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\mat3.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\mat4.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\neon_matrix_impl.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\plane.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\quaternion.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\ray2.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\ray3.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\utility.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\vec2.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\vec3.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\math\kazmath\kazmath\vec4.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="..\physics\CCPhysicsBody.cpp" />
<ClCompile Include="..\physics\CCPhysicsContact.cpp" />
<ClCompile Include="..\physics\CCPhysicsJoint.cpp" />
<ClCompile Include="..\physics\CCPhysicsShape.cpp" />
<ClCompile Include="..\physics\CCPhysicsWorld.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsBodyInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsContactInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsJointInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsShapeInfo_chipmunk.cpp" />
<ClCompile Include="..\physics\chipmunk\CCPhysicsWorldInfo_chipmunk.cpp" />
<ClCompile Include="base64.cpp" />
<ClCompile Include="CCAction.cpp" />
<ClCompile Include="CCActionCamera.cpp" />
<ClCompile Include="CCActionCatmullRom.cpp" />
<ClCompile Include="CCActionEase.cpp" />
<ClCompile Include="CCActionGrid.cpp" />
<ClCompile Include="CCActionGrid3D.cpp" />
<ClCompile Include="CCActionInstant.cpp" />
<ClCompile Include="CCActionInterval.cpp" />
<ClCompile Include="CCActionManager.cpp" />
<ClCompile Include="CCActionPageTurn3D.cpp" />
<ClCompile Include="CCActionProgressTimer.cpp" />
<ClCompile Include="CCActionTiledGrid.cpp" />
<ClCompile Include="CCActionTween.cpp" />
<ClCompile Include="CCAnimation.cpp" />
<ClCompile Include="CCAnimationCache.cpp" />
<ClCompile Include="CCAtlasNode.cpp" />
<ClCompile Include="ccCArray.cpp" />
<ClCompile Include="CCClippingNode.cpp" />
<ClCompile Include="CCComponent.cpp" />
<ClCompile Include="CCComponentContainer.cpp" />
<ClCompile Include="CCConfiguration.cpp" />
<ClCompile Include="CCDeprecated.cpp" />
<ClCompile Include="CCDirector.cpp" />
<ClCompile Include="CCDrawingPrimitives.cpp" />
<ClCompile Include="CCDrawNode.cpp" />
<ClCompile Include="CCEvent.cpp" />
<ClCompile Include="CCEventAcceleration.cpp" />
<ClCompile Include="CCEventCustom.cpp" />
<ClCompile Include="CCEventDispatcher.cpp" />
<ClCompile Include="CCEventKeyboard.cpp" />
<ClCompile Include="CCEventListener.cpp" />
<ClCompile Include="CCEventListenerAcceleration.cpp" />
<ClCompile Include="CCEventListenerCustom.cpp" />
<ClCompile Include="CCEventListenerKeyboard.cpp" />
<ClCompile Include="CCEventListenerMouse.cpp" />
<ClCompile Include="CCEventListenerTouch.cpp" />
<ClCompile Include="CCEventMouse.cpp" />
<ClCompile Include="CCEventTouch.cpp" />
<ClCompile Include="CCFont.cpp" />
<ClCompile Include="CCFontAtlas.cpp" />
<ClCompile Include="CCFontAtlasCache.cpp" />
<ClCompile Include="CCFontCharMap.cpp" />
<ClCompile Include="CCFontFNT.cpp" />
<ClCompile Include="CCFontFreeType.cpp" />
<ClCompile Include="ccFPSImages.c">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</ForcedIncludeFiles>
<ForcedIncludeFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ForcedIncludeFiles>
</ClCompile>
<ClCompile Include="CCGLProgram.cpp" />
<ClCompile Include="ccGLStateCache.cpp" />
<ClCompile Include="CCGrabber.cpp" />
<ClCompile Include="CCGrid.cpp" />
<ClCompile Include="CCNodeGrid.cpp" />
<ClCompile Include="CCIMEDispatcher.cpp" />
<ClCompile Include="CCLabel.cpp" />
<ClCompile Include="CCLabelAtlas.cpp" />
<ClCompile Include="CCLabelBMFont.cpp" />
<ClCompile Include="CCLabelTextFormatter.cpp" />
<ClCompile Include="CCLabelTTF.cpp" />
<ClCompile Include="CCLayer.cpp" />
<ClCompile Include="CCMenu.cpp" />
<ClCompile Include="CCMenuItem.cpp" />
<ClCompile Include="CCMotionStreak.cpp" />
<ClCompile Include="CCNode.cpp" />
<ClCompile Include="CCNotificationCenter.cpp" />
<ClCompile Include="CCParallaxNode.cpp" />
<ClCompile Include="CCParticleBatchNode.cpp" />
<ClCompile Include="CCParticleExamples.cpp" />
<ClCompile Include="CCParticleSystem.cpp" />
<ClCompile Include="CCParticleSystemQuad.cpp" />
<ClCompile Include="CCProfiling.cpp" />
<ClCompile Include="CCProgressTimer.cpp" />
<ClCompile Include="CCRenderTexture.cpp" />
<ClCompile Include="CCScene.cpp" />
<ClCompile Include="CCScheduler.cpp" />
<ClCompile Include="CCScriptSupport.cpp" />
<ClCompile Include="CCShaderCache.cpp" />
<ClCompile Include="ccShaders.cpp" />
<ClCompile Include="CCSprite.cpp" />
<ClCompile Include="CCSpriteBatchNode.cpp" />
<ClCompile Include="CCSpriteFrame.cpp" />
<ClCompile Include="CCSpriteFrameCache.cpp" />
<ClCompile Include="CCTextFieldTTF.cpp" />
<ClCompile Include="CCTexture2D.cpp" />
<ClCompile Include="CCTextureAtlas.cpp" />
<ClCompile Include="CCTextureCache.cpp" />
<ClCompile Include="CCTileMapAtlas.cpp" />
<ClCompile Include="CCTMXLayer.cpp" />
<ClCompile Include="CCTMXObjectGroup.cpp" />
<ClCompile Include="CCTMXTiledMap.cpp" />
<ClCompile Include="CCTMXXMLParser.cpp" />
<ClCompile Include="CCTouch.cpp" />
<ClCompile Include="CCTransition.cpp" />
<ClCompile Include="CCTransitionPageTurn.cpp" />
<ClCompile Include="CCTransitionProgress.cpp" />
<ClCompile Include="ccTypes.cpp" />
<ClCompile Include="CCTweenFunction.cpp" />
<ClCompile Include="CCUserDefault.cpp" />
<ClCompile Include="ccUTF8.cpp" />
<ClCompile Include="ccUtils.cpp" />
<ClCompile Include="CCVertex.cpp" />
<ClCompile Include="cocos2d.cpp" />
<ClCompile Include="platform\CCGLViewProtocol.cpp" />
<ClCompile Include="platform\CCFileUtils.cpp" />
<ClCompile Include="platform\CCImage.cpp" />
<ClCompile Include="platform\CCSAXParser.cpp" />
<ClCompile Include="platform\CCThread.cpp" />
<ClCompile Include="platform\winrt\CCApplication.cpp" />
<ClCompile Include="platform\winrt\CCCommon.cpp" />
<ClCompile Include="platform\winrt\CCDevice.cpp" />
<ClCompile Include="platform\winrt\CCFileUtilsWinRT.cpp" />
<ClCompile Include="platform\winrt\CCFreeTypeFont.cpp" />
<ClCompile Include="platform\winrt\CCPrecompiledShaders.cpp" />
<ClCompile Include="platform\winrt\CCStdC.cpp" />
<ClCompile Include="platform\winrt\CCWinRTUtils.cpp" />
<ClCompile Include="platform\winrt\pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="platform\winrt\sha1.cpp" />
<ClCompile Include="platform\wp8\CCGLView.cpp" />
<ClCompile Include="platform\wp8\DirectXBase.cpp" />
<ClCompile Include="renderer\CCBatchCommand.cpp" />
<ClCompile Include="renderer\CCCustomCommand.cpp" />
<ClCompile Include="renderer\CCFrustum.cpp" />
<ClCompile Include="renderer\CCGroupCommand.cpp" />
<ClCompile Include="renderer\CCMaterialManager.cpp" />
<ClCompile Include="renderer\CCQuadCommand.cpp" />
<ClCompile Include="renderer\CCRenderCommand.cpp" />
<ClCompile Include="renderer\CCRenderer.cpp" />
<ClCompile Include="renderer\CCRenderMaterial.cpp" />
<ClCompile Include="TGAlib.cpp" />
<ClCompile Include="TransformUtils.cpp" />
<ClCompile Include="ZipUtils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\external\edtaa3func\edtaa3func.h" />
<ClInclude Include="..\..\external\tinyxml2\tinyxml2.h" />
<ClInclude Include="..\..\external\unzip\ioapi.h" />
<ClInclude Include="..\..\external\unzip\unzip.h" />
<ClInclude Include="..\base\atitc.h" />
<ClInclude Include="..\base\CCAffineTransform.h" />
<ClInclude Include="..\base\CCArray.h" />
<ClInclude Include="..\base\CCAutoreleasePool.h" />
<ClInclude Include="..\base\CCBool.h" />
<ClInclude Include="..\base\CCConsole.h" />
<ClInclude Include="..\base\CCData.h" />
<ClInclude Include="..\base\CCDataVisitor.h" />
<ClInclude Include="..\base\CCDictionary.h" />
<ClInclude Include="..\base\CCDouble.h" />
<ClInclude Include="..\base\CCFloat.h" />
<ClInclude Include="..\base\CCGeometry.h" />
<ClInclude Include="..\base\CCInteger.h" />
<ClInclude Include="..\base\CCMap.h" />
<ClInclude Include="..\base\CCNS.h" />
<ClInclude Include="..\base\CCRef.h" />
<ClInclude Include="..\base\CCPlatformConfig.h" />
<ClInclude Include="..\base\CCPlatformMacros.h" />
<ClInclude Include="..\base\CCSet.h" />
<ClInclude Include="..\base\CCString.h" />
<ClInclude Include="..\base\CCValue.h" />
<ClInclude Include="..\base\CCVector.h" />
<ClInclude Include="..\base\etc1.h" />
<ClInclude Include="..\base\s3tc.h" />
<ClInclude Include="..\math\kazmath\kazmath\aabb.h" />
<ClInclude Include="..\math\kazmath\kazmath\GL\mat4stack.h" />
<ClInclude Include="..\math\kazmath\kazmath\GL\matrix.h" />
<ClInclude Include="..\math\kazmath\kazmath\kazmath.h" />
<ClInclude Include="..\math\kazmath\kazmath\mat3.h" />
<ClInclude Include="..\math\kazmath\kazmath\mat4.h" />
<ClInclude Include="..\math\kazmath\kazmath\neon_matrix_impl.h" />
<ClInclude Include="..\math\kazmath\kazmath\plane.h" />
<ClInclude Include="..\math\kazmath\kazmath\quaternion.h" />
<ClInclude Include="..\math\kazmath\kazmath\ray2.h" />
<ClInclude Include="..\math\kazmath\kazmath\ray3.h" />
<ClInclude Include="..\math\kazmath\kazmath\utility.h" />
<ClInclude Include="..\math\kazmath\kazmath\vec2.h" />
<ClInclude Include="..\math\kazmath\kazmath\vec3.h" />
<ClInclude Include="..\math\kazmath\kazmath\vec4.h" />
<ClInclude Include="..\physics\CCPhysicsBody.h" />
<ClInclude Include="..\physics\CCPhysicsContact.h" />
<ClInclude Include="..\physics\CCPhysicsJoint.h" />
<ClInclude Include="..\physics\CCPhysicsShape.h" />
<ClInclude Include="..\physics\CCPhysicsWorld.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsBodyInfo_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsContactInfo_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsHelper_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsJointInfo_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsShapeInfo_chipmunk.h" />
<ClInclude Include="..\physics\chipmunk\CCPhysicsWorldInfo_chipmunk.h" />
<ClInclude Include="base64.h" />
<ClInclude Include="CCAction.h" />
<ClInclude Include="CCActionCamera.h" />
<ClInclude Include="CCActionCatmullRom.h" />
<ClInclude Include="CCActionEase.h" />
<ClInclude Include="CCActionGrid.h" />
<ClInclude Include="CCActionGrid3D.h" />
<ClInclude Include="CCActionInstant.h" />
<ClInclude Include="CCActionInterval.h" />
<ClInclude Include="CCActionManager.h" />
<ClInclude Include="CCActionPageTurn3D.h" />
<ClInclude Include="CCActionProgressTimer.h" />
<ClInclude Include="CCActionTiledGrid.h" />
<ClInclude Include="CCActionTween.h" />
<ClInclude Include="CCAnimation.h" />
<ClInclude Include="CCAnimationCache.h" />
<ClInclude Include="CCAtlasNode.h" />
<ClInclude Include="ccCArray.h" />
<ClInclude Include="CCClippingNode.h" />
<ClInclude Include="CCComponent.h" />
<ClInclude Include="CCComponentContainer.h" />
<ClInclude Include="ccConfig.h" />
<ClInclude Include="CCConfiguration.h" />
<ClInclude Include="CCDeprecated.h" />
<ClInclude Include="CCDirector.h" />
<ClInclude Include="CCDrawingPrimitives.h" />
<ClInclude Include="CCDrawNode.h" />
<ClInclude Include="CCEvent.h" />
<ClInclude Include="CCEventAcceleration.h" />
<ClInclude Include="CCEventCustom.h" />
<ClInclude Include="CCEventDispatcher.h" />
<ClInclude Include="CCEventKeyboard.h" />
<ClInclude Include="CCEventListener.h" />
<ClInclude Include="CCEventListenerAcceleration.h" />
<ClInclude Include="CCEventListenerCustom.h" />
<ClInclude Include="CCEventListenerKeyboard.h" />
<ClInclude Include="CCEventListenerMouse.h" />
<ClInclude Include="CCEventListenerTouch.h" />
<ClInclude Include="CCEventMouse.h" />
<ClInclude Include="CCEventTouch.h" />
<ClInclude Include="CCEventType.h" />
<ClInclude Include="CCFont.h" />
<ClInclude Include="CCFontAtlas.h" />
<ClInclude Include="CCFontAtlasCache.h" />
<ClInclude Include="CCFontCharMap.h" />
<ClInclude Include="CCFontFNT.h" />
<ClInclude Include="CCFontFreeType.h" />
<ClInclude Include="ccFPSImages.h" />
<ClInclude Include="CCGLProgram.h" />
<ClInclude Include="ccGLStateCache.h" />
<ClInclude Include="CCGrabber.h" />
<ClInclude Include="CCGrid.h" />
<ClInclude Include="CCNodeGrid.h" />
<ClInclude Include="CCIMEDelegate.h" />
<ClInclude Include="CCIMEDispatcher.h" />
<ClInclude Include="CCLabel.h" />
<ClInclude Include="CCLabelAtlas.h" />
<ClInclude Include="CCLabelBMFont.h" />
<ClInclude Include="CCLabelTextFormatter.h" />
<ClInclude Include="CCLabelTTF.h" />
<ClInclude Include="CCLayer.h" />
<ClInclude Include="ccMacros.h" />
<ClInclude Include="CCMenu.h" />
<ClInclude Include="CCMenuItem.h" />
<ClInclude Include="CCMotionStreak.h" />
<ClInclude Include="CCNode.h" />
<ClInclude Include="CCNotificationCenter.h" />
<ClInclude Include="CCParallaxNode.h" />
<ClInclude Include="CCParticleBatchNode.h" />
<ClInclude Include="CCParticleExamples.h" />
<ClInclude Include="CCParticleSystem.h" />
<ClInclude Include="CCParticleSystemQuad.h" />
<ClInclude Include="CCProfiling.h" />
<ClInclude Include="CCProgressTimer.h" />
<ClInclude Include="CCProtocols.h" />
<ClInclude Include="CCRenderTexture.h" />
<ClInclude Include="CCScene.h" />
<ClInclude Include="CCScheduler.h" />
<ClInclude Include="CCScriptSupport.h" />
<ClInclude Include="CCShaderCache.h" />
<ClInclude Include="ccShaderEx_SwitchMask_frag.h" />
<ClInclude Include="ccShaders.h" />
<ClInclude Include="ccShader_PositionColorLengthTexture_frag.h" />
<ClInclude Include="ccShader_PositionColorLengthTexture_vert.h" />
<ClInclude Include="ccShader_PositionColor_frag.h" />
<ClInclude Include="ccShader_PositionColor_vert.h" />
<ClInclude Include="ccShader_PositionTextureA8Color_frag.h" />
<ClInclude Include="ccShader_PositionTextureA8Color_vert.h" />
<ClInclude Include="ccShader_PositionTextureColorAlphaTest_frag.h" />
<ClInclude Include="ccShader_PositionTextureColor_frag.h" />
<ClInclude Include="ccShader_PositionTextureColor_vert.h" />
<ClInclude Include="ccShader_PositionTexture_frag.h" />
<ClInclude Include="ccShader_PositionTexture_uColor_frag.h" />
<ClInclude Include="ccShader_PositionTexture_uColor_vert.h" />
<ClInclude Include="ccShader_PositionTexture_vert.h" />
<ClInclude Include="ccShader_Position_uColor_frag.h" />
<ClInclude Include="ccShader_Position_uColor_vert.h" />
<ClInclude Include="CCSprite.h" />
<ClInclude Include="CCSpriteBatchNode.h" />
<ClInclude Include="CCSpriteFrame.h" />
<ClInclude Include="CCSpriteFrameCache.h" />
<ClInclude Include="CCTextFieldTTF.h" />
<ClInclude Include="CCTexture2D.h" />
<ClInclude Include="CCTextureAtlas.h" />
<ClInclude Include="CCTextureCache.h" />
<ClInclude Include="CCTileMapAtlas.h" />
<ClInclude Include="CCTMXLayer.h" />
<ClInclude Include="CCTMXObjectGroup.h" />
<ClInclude Include="CCTMXTiledMap.h" />
<ClInclude Include="CCTMXXMLParser.h" />
<ClInclude Include="CCTouch.h" />
<ClInclude Include="CCTransition.h" />
<ClInclude Include="CCTransitionPageTurn.h" />
<ClInclude Include="CCTransitionProgress.h" />
<ClInclude Include="ccTypes.h" />
<ClInclude Include="CCTweenFunction.h" />
<ClInclude Include="CCUserDefault.h" />
<ClInclude Include="ccUTF8.h" />
<ClInclude Include="ccUtils.h" />
<ClInclude Include="CCVertex.h" />
<ClInclude Include="cocos2d.h" />
<ClInclude Include="platform\CCApplicationProtocol.h" />
<ClInclude Include="platform\CCCommon.h" />
<ClInclude Include="platform\CCDevice.h" />
<ClInclude Include="platform\CCGLViewProtocol.h" />
<ClInclude Include="platform\CCFileUtils.h" />
<ClInclude Include="platform\CCImage.h" />
<ClInclude Include="platform\CCSAXParser.h" />
<ClInclude Include="platform\CCThread.h" />
<ClInclude Include="platform\winrt\CCApplication.h" />
<ClInclude Include="platform\winrt\CCFileUtilsWinRT.h" />
<ClInclude Include="platform\winrt\CCFreeTypeFont.h" />
<ClInclude Include="platform\winrt\CCGL.h" />
<ClInclude Include="platform\winrt\CCGL_Angle.h" />
<ClInclude Include="platform\winrt\CCPlatformDefine.h" />
<ClInclude Include="platform\winrt\CCPrecompiledShaders.h" />
<ClInclude Include="platform\winrt\CCStdC.h" />
<ClInclude Include="platform\winrt\CCWinRTUtils.h" />
<ClInclude Include="platform\winrt\pch.h" />
<ClInclude Include="platform\winrt\sha1.h" />
<ClInclude Include="platform\wp8\CCGLView.h" />
<ClInclude Include="platform\wp8\DirectXBase.h" />
<ClInclude Include="renderer\CCBatchCommand.h" />
<ClInclude Include="renderer\CCCustomCommand.h" />
<ClInclude Include="renderer\CCFrustum.h" />
<ClInclude Include="renderer\CCGroupCommand.h" />
<ClInclude Include="renderer\CCMaterialManager.h" />
<ClInclude Include="renderer\CCQuadCommand.h" />
<ClInclude Include="renderer\CCRenderCommand.h" />
<ClInclude Include="renderer\CCRenderCommandPool.h" />
<ClInclude Include="renderer\CCRenderer.h" />
<ClInclude Include="renderer\CCRenderMaterial.h" />
<ClInclude Include="TGAlib.h" />
<ClInclude Include="TransformUtils.h" />
<ClInclude Include="uthash.h" />
<ClInclude Include="utlist.h" />
<ClInclude Include="ZipUtils.h" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<EngineRoot>$(MSBuildThisFileDirectory)..\..\</EngineRoot>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(EngineRoot)cocos\2d\platform\wp8;$(EngineRoot)cocos\2d\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\math\kazmath;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\2d\renderer;$(EngineRoot)cocos\gui;$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\physics;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external;$(EngineRoot)cocos\editor-support;$(EngineRoot);$(EngineRoot)cocos\math\kazmath\include;$(GeneratedFilesDir)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAsWinRT>true</CompileAsWinRT>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<DisableSpecificWarnings>4056;</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalOptions>/IGNORE:4264 %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<BuildMacro Include="EngineRoot">
<Value>$(EngineRoot)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -0,0 +1,207 @@
/****************************************************************************
Copyright (c) 2010-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 "CCApplication.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT
#include "platform/winrt/CCGLView.h"
#else
#include "platform/wp8/CCGLView.h"
#endif
#include "CCDirector.h"
#include <algorithm>
#include "platform/CCFileUtils.h"
#include "CCWinRTUtils.h"
/**
@brief This function change the PVRFrame show/hide setting in register.
@param bEnable If true show the PVRFrame window, otherwise hide.
*/
NS_CC_BEGIN
// sharedApplication pointer
Application * Application::sm_pSharedApplication = 0;
////////////////////////////////////////////////////////////////////////////////
// implement Application
////////////////////////////////////////////////////////////////////////////////
// sharedApplication pointer
Application * s_pSharedApplication = 0;
Application::Application()
{
m_nAnimationInterval.QuadPart = 0;
CC_ASSERT(! sm_pSharedApplication);
sm_pSharedApplication = this;
}
Application::~Application()
{
CC_ASSERT(this == sm_pSharedApplication);
sm_pSharedApplication = NULL;
}
int Application::run()
{
// Initialize instance and cocos2d.
if (!applicationDidFinishLaunching())
{
return 0;
}
GLView::sharedOpenGLView()->Run();
return 0;
}
void Application::setAnimationInterval(double interval)
{
LARGE_INTEGER nFreq;
QueryPerformanceFrequency(&nFreq);
m_nAnimationInterval.QuadPart = (LONGLONG)(interval * nFreq.QuadPart);
}
//////////////////////////////////////////////////////////////////////////
// static member function
//////////////////////////////////////////////////////////////////////////
Application* Application::getInstance()
{
CC_ASSERT(sm_pSharedApplication);
return sm_pSharedApplication;
}
const char * Application::getCurrentLanguageCode()
{
static std::string code = "";
wchar_t localeName[LOCALE_NAME_MAX_LENGTH] = {0};
if (GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH))
{
wchar_t* primary = wcstok(localeName, L"-");
std::string code = CCUnicodeToUtf8(primary);
}
else
{
code = "en";
}
return code.c_str();
}
LanguageType Application::getCurrentLanguage()
{
LanguageType ret = LanguageType::ENGLISH;
const char* code = getCurrentLanguageCode();
if (strcmp(code, "zh") == 0)
{
ret = LanguageType::CHINESE;
}
else if (strcmp(code, "ja") == 0)
{
ret = LanguageType::JAPANESE;
}
else if (strcmp(code, "fr") == 0)
{
ret = LanguageType::FRENCH;
}
else if (strcmp(code, "it") == 0)
{
ret = LanguageType::ITALIAN;
}
else if (strcmp(code, "de") == 0)
{
ret = LanguageType::GERMAN;
}
else if (strcmp(code, "es") == 0)
{
ret = LanguageType::SPANISH;
}
else if (strcmp(code, "nl") == 0)
{
ret = LanguageType::DUTCH;
}
else if (strcmp(code, "ru") == 0)
{
ret = LanguageType::RUSSIAN;
}
else if (strcmp(code, "hu") == 0)
{
ret = LanguageType::HUNGARIAN;
}
else if (strcmp(code, "pt") == 0)
{
ret = LanguageType::PORTUGUESE;
}
else if (strcmp(code, "ko") == 0)
{
ret = LanguageType::KOREAN;
}
else if (strcmp(code, "ar") == 0)
{
ret = LanguageType::ARABIC;
}
return ret;
}
Application::Platform Application::getTargetPlatform()
{
return Platform::OS_WP8;
}
void Application::setResourceRootPath(const std::string& rootResDir)
{
m_resourceRootPath = rootResDir;
std::replace(m_resourceRootPath.begin(), m_resourceRootPath.end(), '\\', '/');
if (m_resourceRootPath[m_resourceRootPath.length() - 1] != '/')
{
m_resourceRootPath += '/';
}
FileUtils* pFileUtils = FileUtils::getInstance();
std::vector<std::string> searchPaths = pFileUtils->getSearchPaths();
searchPaths.insert(searchPaths.begin(), m_resourceRootPath);
pFileUtils->setSearchPaths(searchPaths);
}
const std::string& Application::getResourceRootPath(void)
{
return m_resourceRootPath;
}
void Application::setStartupScriptFilename(const std::string& startupScriptFile)
{
m_startupScriptFilename = startupScriptFile;
std::replace(m_startupScriptFilename.begin(), m_startupScriptFilename.end(), '\\', '/');
}
NS_CC_END

View File

@ -0,0 +1,97 @@
/****************************************************************************
Copyright (c) 2010-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.
****************************************************************************/
#ifndef __CC_APPLICATION_WINRT_H__
#define __CC_APPLICATION_WINRT_H__
#include "CCPlatformConfig.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
#include "CCStdC.h"
#include "platform/CCCommon.h"
#include "platform/CCApplicationProtocol.h"
#include <string>
NS_CC_BEGIN
class CC_DLL Application : public ApplicationProtocol
{
public:
Application();
virtual ~Application();
/**
@brief Run the message loop.
*/
int run();
/**
@brief Get current applicaiton instance.
@return Current application instance pointer.
*/
static Application* getInstance();
/* override functions */
virtual void setAnimationInterval(double interval);
virtual LanguageType getCurrentLanguage();
virtual const char * getCurrentLanguageCode();
/**
@brief Get target platform
*/
virtual Platform getTargetPlatform() override;
/**
* Sets the Resource root path.
* @deprecated Please use CCFileUtils::sharedFileUtils()->setSearchPaths() instead.
*/
CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir);
/**
* Gets the Resource root path.
* @deprecated Please use CCFileUtils::sharedFileUtils()->getSearchPaths() instead.
*/
CC_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(void);
void setStartupScriptFilename(const std::string& startupScriptFile);
const std::string& getStartupScriptFilename(void)
{
return m_startupScriptFilename;
}
protected:
LARGE_INTEGER m_nAnimationInterval;
std::string m_resourceRootPath;
std::string m_startupScriptFilename;
static Application * sm_pSharedApplication;
};
NS_CC_END
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#endif // __CC_APPLICATION_WINRT_H__

View File

@ -0,0 +1,82 @@
/****************************************************************************
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.
****************************************************************************/
#include "platform/CCCommon.h"
#include "CCStdC.h"
#include "CCWinRTUtils.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
#include "platform/wp8/CCGLView.h"
#endif
#if defined(VLD_DEBUG_MEMORY)
#include <vld.h>
#endif
NS_CC_BEGIN
void MessageBox(const char * pszMsg, const char * pszTitle)
{
// Create the message dialog and set its content
Platform::String^ message = ref new Platform::String(CCUtf8ToUnicode(pszMsg, -1).c_str());
Platform::String^ title = ref new Platform::String(CCUtf8ToUnicode(pszTitle, -1).c_str());
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
Windows::UI::Popups::MessageDialog^ msg = ref new Windows::UI::Popups::MessageDialog(message, title);
// Set the command to be invoked when a user presses 'ESC'
msg->CancelCommandIndex = 1;
// Show the message dialog
msg->ShowAsync();
#else
GLView::sharedOpenGLView()->ShowMessageBox(title, message);
#endif
}
void CCLuaLog(const char *pszMsg)
{
#if defined(COCOS2D_DEBUG)
int bufflen = MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, NULL, 0);
WCHAR* widebuff = new WCHAR[bufflen + 1];
memset(widebuff, 0, sizeof(WCHAR) * (bufflen + 1));
MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, widebuff, bufflen);
OutputDebugStringW(widebuff);
OutputDebugStringA("\n");
bufflen = WideCharToMultiByte(CP_ACP, 0, widebuff, -1, NULL, 0, NULL, NULL);
char* buff = new char[bufflen + 1];
memset(buff, 0, sizeof(char) * (bufflen + 1));
WideCharToMultiByte(CP_ACP, 0, widebuff, -1, buff, bufflen, NULL, NULL);
puts(buff);
delete[] widebuff;
delete[] buff;
#endif
}
NS_CC_END

View File

@ -0,0 +1,142 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong 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 "CCPlatformConfig.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
#include "cocos2d.h"
#include "platform/CCDevice.h"
#include "platform/CCFileUtils.h"
#include "platform/winrt/CCFreeTypeFont.h"
#include "CCStdC.h"
using namespace Windows::Graphics::Display;
using namespace Windows::Devices::Sensors;
using namespace Windows::Foundation;
NS_CC_BEGIN
CCFreeTypeFont sFT;
int Device::getDPI()
{
static const float dipsPerInch = 96.0f;
return floor(DisplayProperties::LogicalDpi / dipsPerInch + 0.5f); // Round to nearest integer.
}
void Device::setAccelerometerEnabled(bool isEnabled)
{
static Windows::Foundation::EventRegistrationToken sToken;
auto accelerometer = Accelerometer::GetDefault();
if (isEnabled && accelerometer)
{
setAccelerometerInterval(0.0f);
sToken = accelerometer->ReadingChanged += ref new TypedEventHandler
<Accelerometer^,AccelerometerReadingChangedEventArgs^>
([=](Accelerometer^, AccelerometerReadingChangedEventArgs^)
{
AccelerometerReading^ reading = accelerometer->GetCurrentReading();
cocos2d::Acceleration acc;
acc.x = reading->AccelerationX;
acc.y = reading->AccelerationY;
acc.z = reading->AccelerationZ;
acc.timestamp = 0;
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
auto orientation = GLView::sharedOpenGLView()->getDeviceOrientation();
switch (orientation)
{
case DisplayOrientations::Portrait:
acc.x = reading->AccelerationX;
acc.y = reading->AccelerationY;
break;
case DisplayOrientations::Landscape:
acc.x = -reading->AccelerationY;
acc.y = reading->AccelerationX;
break;
case DisplayOrientations::PortraitFlipped:
acc.x = -reading->AccelerationX;
acc.y = reading->AccelerationY;
break;
case DisplayOrientations::LandscapeFlipped:
acc.x = reading->AccelerationY;
acc.y = reading->AccelerationX;
break;
default:
acc.x = reading->AccelerationX;
acc.y = reading->AccelerationY;
break;
}
#endif
cocos2d::EventAcceleration accEvent(acc);
auto dispatcher = cocos2d::Director::getInstance()->getEventDispatcher();
dispatcher->dispatchEvent(&accEvent);
});
}
else
{
accelerometer->ReadingChanged -= sToken;
}
}
void Device::setAccelerometerInterval(float interval)
{
auto a = Accelerometer::GetDefault();
if(a)
{
int minInterval = a->MinimumReportInterval;
int reqInterval = (int) interval;
a->ReportInterval = reqInterval < minInterval ? minInterval : reqInterval;
}
}
Data Device::getTextureDataForText(const char * text,const FontDefinition& textDefinition,TextAlign align,int &width,int &height)
{
Data ret;
ssize_t dataLen;
unsigned char* data = sFT.initWithString(text, textDefinition, align, width, height, dataLen);
if (data)
{
ret.fastSet(data, dataLen);
}
return ret;
}
NS_CC_END
#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)

View File

@ -0,0 +1,211 @@
/****************************************************************************
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.
****************************************************************************/
#include "CCFileUtilsWinRT.h"
#include "CCWinRTUtils.h"
#include "platform/CCCommon.h"
using namespace std;
NS_CC_BEGIN
static std::string s_pszResourcePath;
// D:\aaa\bbb\ccc\ddd\abc.txt --> D:/aaa/bbb/ccc/ddd/abc.txt
static inline std::string convertPathFormatToUnixStyle(const std::string& path)
{
std::string ret = path;
int len = ret.length();
for (int i = 0; i < len; ++i)
{
if (ret[i] == '\\')
{
ret[i] = '/';
}
}
return ret;
}
static void _checkPath()
{
if (s_pszResourcePath.empty())
{
// TODO: needs to be tested
s_pszResourcePath = convertPathFormatToUnixStyle(CCFileUtilsWinRT::getAppPath() + '\\' + "Assets\\Resources" + '\\');
}
}
FileUtils* FileUtils::getInstance()
{
if (s_sharedFileUtils == NULL)
{
s_sharedFileUtils = new CCFileUtilsWinRT();
if(!s_sharedFileUtils->init())
{
delete s_sharedFileUtils;
s_sharedFileUtils = NULL;
CCLOG("ERROR: Could not init CCFileUtilsWinRT");
}
}
return s_sharedFileUtils;
}
CCFileUtilsWinRT::CCFileUtilsWinRT()
{
}
bool CCFileUtilsWinRT::init()
{
_checkPath();
_defaultResRootPath = s_pszResourcePath;
return FileUtils::init();
}
std::string CCFileUtilsWinRT::getPathForFilename(const std::string& filename, const std::string& resolutionDirectory, const std::string& searchPath)
{
std::string unixFileName = convertPathFormatToUnixStyle(filename);
std::string unixResolutionDirectory = convertPathFormatToUnixStyle(resolutionDirectory);
std::string unixSearchPath = convertPathFormatToUnixStyle(searchPath);
return FileUtils::getPathForFilename(unixFileName, unixResolutionDirectory, unixSearchPath);
}
std::string CCFileUtilsWinRT::getFullPathForDirectoryAndFilename(const std::string& strDirectory, const std::string& strFilename)
{
std::string unixDirectory = convertPathFormatToUnixStyle(strDirectory);
std::string unixFilename = convertPathFormatToUnixStyle(strFilename);
return FileUtils::getFullPathForDirectoryAndFilename(unixDirectory, unixFilename);
}
bool CCFileUtilsWinRT::isFileExist(const std::string& strFilePath) const
{
bool ret = false;
FILE * pf = 0;
std::string strPath = strFilePath;
if (!isAbsolutePath(strPath))
{ // Not absolute path, add the default root path at the beginning.
strPath.insert(0, _defaultResRootPath);
}
const char* path = strPath.c_str();
if (path && strlen(path) && (pf = fopen(path, "rb")))
{
ret = true;
fclose(pf);
}
return ret;
}
bool CCFileUtilsWinRT::isAbsolutePath(const std::string& strPath) const
{
if ( strPath.length() > 2
&& ( (strPath[0] >= 'a' && strPath[0] <= 'z') || (strPath[0] >= 'A' && strPath[0] <= 'Z') )
&& strPath[1] == ':')
{
return true;
}
return false;
}
static Data getData(const std::string& filename, bool forString)
{
CCASSERT(!filename.empty(), "Invalid filename!");
Data ret;
unsigned char* buffer = nullptr;
ssize_t size = 0;
const char* mode = nullptr;
mode = "rb";
do
{
// Read the file from hardware
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filename);
FILE *fp = fopen(fullPath.c_str(), mode);
CC_BREAK_IF(!fp);
fseek(fp,0,SEEK_END);
size = ftell(fp);
fseek(fp,0,SEEK_SET);
if (forString)
{
buffer = (unsigned char*)malloc(sizeof(unsigned char) * (size + 1));
buffer[size] = '\0';
}
else
{
buffer = (unsigned char*)malloc(sizeof(unsigned char) * size);
}
size = fread(buffer, sizeof(unsigned char), size, fp);
fclose(fp);
} while (0);
if (nullptr == buffer || 0 == size)
{
std::string msg = "Get data from file(";
msg.append(filename).append(") failed!");
CCLOG("%s", msg.c_str());
}
else
{
ret.fastSet(buffer, size);
}
return ret;
}
std::string CCFileUtilsWinRT::getStringFromFile(const std::string& filename)
{
Data data = getData(filename, true);
if (data.isNull())
{
return "";
}
std::string ret((const char*)data.getBytes());
return ret;
}
string CCFileUtilsWinRT::getWritablePath() const
{
auto localFolderPath = Windows::Storage::ApplicationData::Current->LocalFolder->Path;
return convertPathFormatToUnixStyle(std::string(PlatformStringToString(localFolderPath)) + '\\');
}
string CCFileUtilsWinRT::getAppPath()
{
Windows::ApplicationModel::Package^ package = Windows::ApplicationModel::Package::Current;
return convertPathFormatToUnixStyle(std::string(PlatformStringToString(package->InstalledLocation->Path)));
}
NS_CC_END

View File

@ -0,0 +1,65 @@
/****************************************************************************
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_FILEUTILS_WINRT_H__
#define __CC_FILEUTILS_WINRT_H__
#include "platform/CCFileUtils.h"
#include "CCPlatformMacros.h"
#include "ccTypes.h"
#include <string>
#include <vector>
NS_CC_BEGIN
/**
* @addtogroup platform
* @{
*/
//! @brief Helper class to handle file operations
class CC_DLL CCFileUtilsWinRT : public FileUtils
{
friend class FileUtils;
CCFileUtilsWinRT();
public:
/* override funtions */
bool init();
virtual std::string getWritablePath() const;
virtual bool isFileExist(const std::string& strFilePath) const;
virtual bool isAbsolutePath(const std::string& strPath) const;
virtual std::string getPathForFilename(const std::string& filename, const std::string& resolutionDirectory, const std::string& searchPath) override;
virtual std::string getFullPathForDirectoryAndFilename(const std::string& strDirectory, const std::string& strFilename) override;
virtual std::string getStringFromFile(const std::string& filename) override;
static std::string getAppPath();
};
// end of platform group
/// @}
NS_CC_END
#endif // __CC_FILEUTILS_WINRT_H__

View File

@ -0,0 +1,738 @@
/****************************************************************************
Copyright (c) 2013 cocos2d-x.org http://cocos2d-x.org
Copyright (c) Microsoft Open Technologies, Inc.
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 "CCFreeTypeFont.h"
#include "CCDirector.h"
#include "platform/CCFileUtils.h"
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WP8)
#include <dwrite.h>
#endif
#include <map>
#include <string>
#include <sstream>
#include <vector>
#include <memory>
#include <algorithm>
using namespace std;
NS_CC_BEGIN
static map<std::string, FontBufferInfo> s_fontsNames;
static FT_Library s_FreeTypeLibrary = nullptr;
CCFreeTypeFont::CCFreeTypeFont()
:m_space(" ")
, m_face(nullptr)
{
}
CCFreeTypeFont::~CCFreeTypeFont()
{
reset();
}
void CCFreeTypeFont::reset()
{
for(auto line:m_lines)
{
line->glyphs.clear();
delete line;
}
m_lines.clear();
if(m_face)
{
FT_Done_Face(m_face);
m_face = nullptr;
}
}
unsigned char* CCFreeTypeFont::initWithString(const char * text, const FontDefinition& textDefinition, Device::TextAlign align, int &width, int &height, ssize_t& dataLength)
{
FT_Error error = 0;
ssize_t size = 0;
unsigned char* pBuffer = nullptr;
unsigned char* data = nullptr;
Size winSize = Director::getInstance()->getWinSizeInPixels();
m_windowWidth = (int)winSize.width;
m_inWidth = textDefinition._dimensions.width;
m_inHeight = textDefinition._dimensions.height;
#if 0
// check the cache for the font file buffer
auto ittFontNames = s_fontsNames.find(textDefinition._fontName);
if(ittFontNames != s_fontsNames.end())
{
pBuffer = ittFontNames->second.pBuffer;
size = ittFontNames->second.size;
}
#endif // 0
if(!pBuffer)
{
// attempt to load font from Resources fonts folder
pBuffer = loadFont(textDefinition._fontName.c_str(), &size);
if(!pBuffer)
{
// attempt to load font from System fonts folder
pBuffer = loadSystemFont(textDefinition._fontName.c_str(), &size);
}
if(!pBuffer)
{
// attempt to load default font from Resources fonts folder
pBuffer = loadFont("Arial", &size);
}
if(!pBuffer)
{
// attempt to load default font from System fonts folder
pBuffer = loadSystemFont("Arial", &size);
}
if(!pBuffer) // font not found!
{
return false;
}
#if 0
// cache the font file buffer
FontBufferInfo info;
info.pBuffer = pBuffer;
info.size = size;
s_fontsNames[textDefinition._fontName]=info;
#endif // 0
}
m_fontName = textDefinition._fontName;
m_text = text;
if(!s_FreeTypeLibrary)
{
error = FT_Init_FreeType(&s_FreeTypeLibrary);
}
if(!error && !m_face)
{
error = FT_New_Memory_Face(s_FreeTypeLibrary, pBuffer, size, 0, &m_face);
}
if(!error)
{
error = FT_Select_Charmap(m_face, FT_ENCODING_UNICODE);
}
if(!error)
{
error = FT_Set_Char_Size(m_face, textDefinition._fontSize << 6, textDefinition._fontSize << 6, 72, 72);
}
if(!error)
{
error = initGlyphs(text);
}
if (!error)
{
data = getBitmap(align, width, height, dataLength);
}
delete [] pBuffer;
reset();
return data;
}
unsigned char* CCFreeTypeFont::getBitmap(Device::TextAlign eAlignMask, int &width, int &height, ssize_t& dataLength)
{
int lineNumber = 0;
int totalLines = m_lines.size();
m_width = m_inWidth ? m_inWidth : m_textWidth;
m_height = m_inHeight ? m_inHeight : m_textHeight;
unsigned int size = m_width * m_height * 4;
unsigned char* pBuffer = new unsigned char[size];
dataLength = size;
if(!pBuffer)
{
dataLength = 0;
return nullptr;
}
memset(pBuffer, 0, size);
for (auto line = m_lines.begin() ; line != m_lines.end(); ++line)
{
FT_Vector pen = getPenForAlignment(*line, eAlignMask, lineNumber, totalLines);
drawText(*line, pBuffer, &pen);
lineNumber++;
}
width = m_width;
height = m_height;
return pBuffer;
}
FT_Vector CCFreeTypeFont::getPenForAlignment(FTLineInfo* pInfo, Device::TextAlign eAlignMask,int lineNumber, int totalLines)
{
FT_Error error = 0;
FT_Vector pen;
int top;
int stringWidth = pInfo->bbox.xMax - pInfo->bbox.xMin;
int maxLineNumber = totalLines - 1;
pen.x = 0;
pen.y = 0;
switch(eAlignMask)
{
case Device::TextAlign::TOP: // Horizontal center and vertical top.
pen.x = ((m_width - stringWidth) / 2) - pInfo->bbox.xMin;
pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight);
break;
case Device::TextAlign::TOP_LEFT: // Horizontal left and vertical top.
pen.x -=pInfo->bbox.xMin;
pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight);
break;
case Device::TextAlign::TOP_RIGHT: // Horizontal right and vertical top.
pen.x = m_width - stringWidth - pInfo->bbox.xMin;
pen.y = pInfo->bbox.yMax + (lineNumber * m_lineHeight);
break;
case Device::TextAlign::BOTTOM_RIGHT: // Horizontal right and vertical bottom.
pen.x = m_width - stringWidth - pInfo->bbox.xMin;
pen.y = m_height + pInfo->bbox.yMin - ((maxLineNumber - lineNumber) * m_lineHeight);
break;
case Device::TextAlign::BOTTOM: // Horizontal center and vertical bottom.
pen.x = ((m_width - stringWidth) / 2) - pInfo->bbox.xMin;
pen.y = m_height + pInfo->bbox.yMin - ((maxLineNumber - lineNumber) * m_lineHeight);
break;
case Device::TextAlign::BOTTOM_LEFT: // Horizontal left and vertical bottom.
pen.x -=pInfo->bbox.xMin;
top = (m_height - m_textHeight) / 2;
pen.y = m_height + pInfo->bbox.yMin - ((maxLineNumber - lineNumber) * m_lineHeight);
break;
case Device::TextAlign::CENTER: // Horizontal center and vertical center
pen.x = ((m_width - stringWidth) / 2) - pInfo->bbox.xMin;
top = (m_height - m_textHeight) / 2;
pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax;
break;
case Device::TextAlign::RIGHT: // Horizontal right and vertical center.
pen.x = m_width - stringWidth - pInfo->bbox.xMin;
top = (m_height - m_textHeight) / 2;
pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax;
break;
case Device::TextAlign::LEFT: // Horizontal left and vertical center.
default:
pen.x -=pInfo->bbox.xMin;
top = (m_height - m_textHeight) / 2;
pen.y = top + (lineNumber * m_lineHeight) + pInfo->bbox.yMax;
break;
}
return pen;
}
void CCFreeTypeFont::drawText(FTLineInfo* pInfo, unsigned char* pBuffer, FT_Vector *pen)
{
auto glyphs = pInfo->glyphs;
for (auto glyph = glyphs.begin() ; glyph != glyphs.end(); ++glyph)
{
FT_Glyph image = glyph->image;
FT_Error error = FT_Glyph_To_Bitmap(&image, FT_RENDER_MODE_NORMAL, 0, 1);
if (!error)
{
FT_BitmapGlyph bit = (FT_BitmapGlyph)image;
draw_bitmap(pBuffer, &bit->bitmap, pen->x + glyph->pos.x + bit->left,pen->y - bit->top);
FT_Done_Glyph(image);
}
}
}
void CCFreeTypeFont::draw_bitmap(unsigned char* pBuffer, FT_Bitmap* bitmap, FT_Int x, FT_Int y)
{
FT_Int i, j, p, q;
FT_Int x_max = x + bitmap->width;
FT_Int y_max = y + bitmap->rows;
for (i = x, p = 0; i < x_max; i++, p++)
{
for ( j = y, q = 0; j < y_max; j++, q++ )
{
if (i < 0 || j < 0 || i >= m_width || j >= m_height)
continue;
unsigned char value = bitmap->buffer[q * bitmap->width + p];
if(value > 0)
{
FT_Int index = (j * m_width * 4) + (i * 4);
pBuffer[index++] = value;
pBuffer[index++] = value;
pBuffer[index++] = value;
pBuffer[index++] = 0xff;
}
}
}
}
void CCFreeTypeFont::endLine()
{
if(m_currentLine)
{
m_lines.push_back(m_currentLine);
m_textWidth = std::max((long)m_textWidth,m_currentLine->bbox.xMax - m_currentLine->bbox.xMin);
m_textHeight += m_lineHeight;
}
}
void CCFreeTypeFont::newLine()
{
m_currentLine = new FTLineInfo();
m_currentLine->width = 0;
m_currentLine->pen.x = 0;
m_currentLine->pen.y = 0;
}
FT_Error CCFreeTypeFont::addWord(const std::string& word)
{
std::vector<TGlyph> glyphs; // glyphs for the word
FT_BBox bbox; // bounding box containing all of the glyphs in the word
int maxWidth = m_inWidth ? m_inWidth : m_windowWidth;
std::string newWord;
if(m_currentLine->width > 0)
{
newWord = ' ' + word;
}
else
{
newWord = word;
}
FT_Error error = initWordGlyphs(glyphs, newWord, m_currentLine->pen);
if(!error)
{
compute_bbox(glyphs, &bbox);
if(m_currentLine->width == 0 || bbox.xMax <= maxWidth)
{
m_currentLine->glyphs.insert(m_currentLine->glyphs.end(),glyphs.begin(),glyphs.end());
if(m_currentLine->width == 0)
{
m_currentLine->bbox = bbox;
}
else
{
m_currentLine->bbox.xMax = bbox.xMax;
}
m_currentLine->width = m_currentLine->bbox.xMax - m_currentLine->bbox.xMin;
}
else
{
endLine();
newLine();
addWord(word);
}
}
return error;
}
FT_Error CCFreeTypeFont::initGlyphs(const char* text)
{
FT_Error error = 0;
std::stringstream stringStream(text);
std::string line;
vector<std::string> lines;
vector<std::string> words;
m_textWidth = 0;
m_textHeight = 0;
// the height of a line of text based on the max height of a glyph in the font size
m_lineHeight = ((m_face->size->metrics.ascender) >> 6) - ((m_face->size->metrics.descender) >> 6);
m_lines.clear();
while(std::getline(stringStream, line) && !error)
{
newLine();
std::size_t prev = 0, pos;
while ((pos = line.find_first_of(" ", prev)) != std::string::npos)
{
if (pos > prev)
{
addWord(line.substr(prev, pos-prev));
}
prev = pos + 1;
}
if (prev < line.length())
{
addWord(line.substr(prev, std::string::npos));
}
endLine();
}
return error;
}
// if linewidth > m_inWidth
// get words for line
void CCFreeTypeFont::initWords(const char* text)
{
std::stringstream stringStream(text);
std::string line;
vector<std::string> lines;
vector<std::string> words;
while(std::getline(stringStream, line))
{
lines.push_back(line);
}
for (auto it = lines.begin() ; it != lines.end(); ++it)
{
std::size_t prev = 0, pos;
while ((pos = it->find_first_of(" ';", prev)) != std::string::npos)
{
if (pos > prev)
words.push_back(it->substr(prev, pos-prev));
prev = pos+1;
}
if (prev < it->length())
words.push_back(it->substr(prev, std::string::npos));
}
for (auto it = words.begin() ; it != words.end(); ++it)
{
std::string foo(*it);
}
}
FT_Error CCFreeTypeFont::initWordGlyphs(std::vector<TGlyph>& glyphs, const std::string& text, FT_Vector& pen)
{
FT_GlyphSlot slot = m_face->glyph;
FT_UInt glyph_index;
FT_UInt previous = 0;
FT_Error error = 0;
PGlyph glyph;
unsigned int numGlyphs = 0;
wchar_t * pwszBuffer = nullptr;
int num_chars = text.size();
int nBufLen = num_chars + 1;
pwszBuffer = new wchar_t[nBufLen];
if(!pwszBuffer)
{
return -1;
}
memset(pwszBuffer,0,nBufLen);
num_chars = MultiByteToWideChar(CP_UTF8, 0, text.c_str(), num_chars, pwszBuffer, nBufLen);
pwszBuffer[num_chars] = '\0';
glyphs.clear();
glyphs.resize(num_chars);
FT_Bool useKerning = FT_HAS_KERNING(m_face);
for (int n = 0; n < num_chars; n++)
{
glyph = &glyphs[numGlyphs];
/* convert character code to glyph index */
FT_ULong c = pwszBuffer[n];
glyph_index = FT_Get_Char_Index(m_face, c);
if (useKerning && previous && glyph_index)
{
FT_Vector delta;
FT_Get_Kerning(m_face, previous, glyph_index,
FT_KERNING_DEFAULT, &delta);
pen.x += delta.x >> 6;
}
/* store current pen position */
glyph->pos = pen;
glyph->index = glyph_index;
/* load glyph image into the slot without rendering */
error = FT_Load_Glyph(m_face, glyph_index, FT_LOAD_DEFAULT);
if (error)
continue; /* ignore errors, jump to next glyph */
/* extract glyph image and store it in our table */
error = FT_Get_Glyph(m_face->glyph, &glyph->image);
if (error)
continue; /* ignore errors, jump to next glyph */
/* translate the glyph image now */
FT_Glyph_Transform(glyph->image, 0, &glyph->pos);
/* increment pen position */
pen.x += slot->advance.x >> 6;
/* record current glyph index */
previous = glyph_index;
numGlyphs++;
}
CC_SAFE_DELETE_ARRAY(pwszBuffer);
return error;
}
void CCFreeTypeFont::compute_bbox(std::vector<TGlyph>& glyphs, FT_BBox *abbox)
{
FT_BBox bbox;
FT_BBox glyph_bbox;
/* initialize string bbox to "empty" values */
bbox.xMin = 32000;
bbox.xMax = -32000;
// use the max and min values for the entire font face
bbox.yMin = (m_face->size->metrics.descender) >> 6;
bbox.yMax = (m_face->size->metrics.ascender) >> 6;
/* for each glyph image, compute its bounding box, */
/* translate it, and grow the string bbox */
for (auto glyph = glyphs.begin() ; glyph != glyphs.end(); ++glyph)
{
FT_Glyph_Get_CBox(glyph->image, ft_glyph_bbox_pixels, &glyph_bbox);
glyph_bbox.xMin += glyph->pos.x;
glyph_bbox.xMax += glyph->pos.x;
glyph_bbox.yMin += glyph->pos.y;
glyph_bbox.yMax += glyph->pos.y;
if (glyph_bbox.xMin < bbox.xMin)
bbox.xMin = glyph_bbox.xMin;
if (glyph_bbox.yMin < bbox.yMin)
bbox.yMin = glyph_bbox.yMin;
if (glyph_bbox.xMax > bbox.xMax)
bbox.xMax = glyph_bbox.xMax;
if (glyph_bbox.yMax > bbox.yMax)
bbox.yMax = glyph_bbox.yMax;
}
/* check that we really grew the string bbox */
if (bbox.xMin > bbox.xMax)
{
bbox.xMin = 0;
bbox.yMin = 0;
bbox.xMax = 0;
bbox.yMax = 0;
}
/* return string bbox */
*abbox = bbox;
}
unsigned char* CCFreeTypeFont::loadFont(const char *pFontName, ssize_t *size)
{
std::string lowerCase(pFontName);
std::string path(pFontName);
for (unsigned int i = 0; i < lowerCase.length(); ++i)
{
lowerCase[i] = tolower(lowerCase[i]);
}
if (std::string::npos == lowerCase.find("fonts\\"))
{
path = "fonts\\";
path += pFontName;
}
if (std::string::npos == lowerCase.find(".ttf"))
{
path += ".ttf";
}
std::string fullpath = FileUtils::getInstance()->fullPathForFilename(path.c_str());
return FileUtils::sharedFileUtils()->getFileData(fullpath.c_str(), "rb", size);
}
unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, ssize_t *size)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
return nullptr;
#else
std::string aName(pFontName);
unsigned char* pBuffer = nullptr;
HRESULT hr = S_OK;
IDWriteFactory *writeFactory = nullptr;
IDWriteFontCollection *fontCollection = nullptr;
IDWriteFontFamily *fontFamily = nullptr;
IDWriteFont *matchingFont = nullptr;
IDWriteFontFace *fontFace = nullptr;
IDWriteFontFile *fontFile = nullptr;
IDWriteFontFileLoader *fontFileLoader = nullptr;
IDWriteFontFileStream *fontFileStream = nullptr;
UINT32 index;
BOOL exists;
std::wstring fontNameW;
const void *fontFileReferenceKey = nullptr;
UINT32 fontFileReferenceKeySize;
void *fragmentContext = nullptr;
for (unsigned int i = 0; i < aName.length(); ++i)
{
aName[i] = tolower(aName[i]);
}
fontNameW.assign(aName.begin(), aName.end());
//create the factory
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), reinterpret_cast<IUnknown**>(&writeFactory));
if(SUCCEEDED(hr))
{
//obtain the fonts owned by the machine
hr = writeFactory->GetSystemFontCollection(&fontCollection, TRUE);
}
//get the font
if(SUCCEEDED(hr))
{
hr = fontCollection->FindFamilyName(fontNameW.c_str(), &index, &exists);
if(SUCCEEDED(hr) && exists)
{
hr = fontCollection->GetFontFamily(index, &fontFamily);
if(SUCCEEDED(hr))
{
hr = fontFamily->GetFirstMatchingFont(DWRITE_FONT_WEIGHT_REGULAR, DWRITE_FONT_STRETCH_NORMAL, DWRITE_FONT_STYLE_NORMAL, &matchingFont);
}
if(SUCCEEDED(hr))
{
hr = matchingFont->CreateFontFace(&fontFace);
}
if(SUCCEEDED(hr))
{
UINT32 numberOfFiles = 1;
hr = fontFace->GetFiles(&numberOfFiles, &fontFile);
}
if(SUCCEEDED(hr))
{
//create the font file stream
hr = fontFile->GetReferenceKey(&fontFileReferenceKey, &fontFileReferenceKeySize);
}
if(SUCCEEDED(hr))
{
hr = fontFile->GetLoader(&fontFileLoader);
}
if(SUCCEEDED(hr))
{
hr = fontFileLoader->CreateStreamFromKey(fontFileReferenceKey, fontFileReferenceKeySize, &fontFileStream);
}
if(SUCCEEDED(hr))
{
//finally get the font file dat
UINT64 fileSize;
const void *fragmentStart = nullptr;
hr = fontFileStream->GetFileSize(&fileSize);
if(SUCCEEDED(hr))
{
hr = fontFileStream->ReadFileFragment(&fragmentStart, 0, fileSize, &fragmentContext);
}
if(SUCCEEDED(hr))
{
pBuffer = (unsigned char*)malloc((size_t)fileSize);
memcpy(pBuffer, fragmentStart, (size_t)fileSize);
*size = (unsigned long)fileSize;
}
}
}
}
//clean up all the DWrite stuff
if(fontFileStream)
{
fontFileStream->ReleaseFileFragment(fragmentContext);
fontFileStream->Release();
}
if(fontFileLoader)
{
fontFileLoader->Release();
}
if(fontFile)
{
fontFile->Release();
}
if(fontFace)
{
fontFace->Release();
}
if(matchingFont)
{
matchingFont->Release();
}
if(fontFamily)
{
fontFamily->Release();
}
if(fontCollection)
{
fontCollection->Release();
}
if(writeFactory)
{
writeFactory->Release();
}
return pBuffer;
#endif
}
NS_CC_END

View File

@ -0,0 +1,136 @@
/****************************************************************************
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 __PLATFORM_WINRT_FREETYPE_H__
#define __PLATFORM_WINRT_FREETYPE_H__
#include "platform/CCCommon.h"
#include "platform/CCDevice.h"
#include <string>
#include <vector>
#include <memory>
#define generic GenericFromFreeTypeLibrary
#define internal InternalFromFreeTypeLibrary
#include <ft2build.h>
#include <freetype/freetype.h>
#include <freetype/ftglyph.h>
#include <freetype/ftoutln.h>
#include <freetype/fttrigon.h>
#undef generic
#undef internal
NS_CC_BEGIN
typedef struct TGlyph_
{
FT_UInt index; // glyph index
FT_Vector pos; // glyph origin on the baseline
FT_Glyph image; // glyph image
} TGlyph, *PGlyph;
typedef struct FontBufferInfo
{
unsigned char* pBuffer;
unsigned long size;
} FontBufferInfo;
typedef struct FTWordInfo
{
std::vector<TGlyph> glyphs; // glyphs for the word
FT_BBox bbox; // bounding box containing all of the glyphs in the word
} FTWordInfo;
typedef struct FTLineInfo
{
std::vector<TGlyph> glyphs; // glyphs for the line text
FT_BBox bbox; // bounding box containing all of the glyphs in the line
unsigned int width; // width of the line
FT_Vector pen; // current pen position
} FTLineInfo;
class CC_DLL CCFreeTypeFont
{
public:
CCFreeTypeFont();
~CCFreeTypeFont();
unsigned char* initWithString(const char * text, const FontDefinition& textDefinition, Device::TextAlign align, int &width, int &height, ssize_t& dataLength);
private:
unsigned char* getBitmap(Device::TextAlign eAlignMask, int &width, int &height, ssize_t& dataLength);
unsigned char* loadFont(const char *pFontName, ssize_t* size);
unsigned char* CCFreeTypeFont::loadSystemFont(const char *pFontName, ssize_t* size);
FT_Error CCFreeTypeFont::initGlyphs(const char* text);
FT_Error CCFreeTypeFont::initWordGlyphs(std::vector<TGlyph>& glyphs, const std::string& text, FT_Vector& pen);
void compute_bbox(std::vector<TGlyph>& glyphs, FT_BBox *abbox);
void drawText(FTLineInfo* pInfo, unsigned char* pBuffer, FT_Vector *pen);
void draw_bitmap(unsigned char* pBuffer, FT_Bitmap* bitmap,FT_Int x,FT_Int y);
void initWords(const char* text);
void reset();
FT_Vector getPenForAlignment(FTLineInfo* pInfo, Device::TextAlign eAlignMask, int lineNumber, int totalLines);
FT_Error addWord(const std::string& word);
void newLine();
void endLine();
const std::string m_space;
std::string m_text;
std::string m_fontName;
FT_Face m_face;
std::vector<FTLineInfo*> m_lines;
int m_inWidth; // requested width of text box
int m_inHeight; // requested height of text box
int m_width; // final bitMap width
int m_height; // final bitMap height
int m_textWidth; // width of text text after word wrapping and line breaks
int m_textHeight; // height of text text after word wrapping and line breaks
int m_lineHeight; // height of a line for the font size
int m_windowWidth; // the width of the window
FTLineInfo* m_currentLine; // the current line object to add words to.
};
NS_CC_END
#endif

View File

@ -0,0 +1,31 @@
/****************************************************************************
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 __CCGL_H__
#define __CCGL_H__
#include "CCGL_Angle.h"
#endif // __CCGL_H__

View File

@ -0,0 +1,519 @@
/****************************************************************************
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.
****************************************************************************/
#include "CCGLView.h"
#include "CCSet.h"
#include "ccMacros.h"
#include "CCDirector.h"
#include "CCTouch.h"
#include "CCIMEDispatcher.h"
#include "CCApplication.h"
#include "CCWinRTUtils.h"
#if (_MSC_VER >= 1800)
#include <d3d11_2.h>
#endif
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::Controls;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::System;
using namespace Windows::UI::ViewManagement;
NS_CC_BEGIN
static GLView* s_pEglView = NULL;
//////////////////////////////////////////////////////////////////////////
// impliment GLView
//////////////////////////////////////////////////////////////////////////
// Initialize the DirectX resources required to run.
void WinRTWindow::Initialize(CoreWindow^ window, SwapChainBackgroundPanel^ panel)
{
m_window = window;
//TODO: remove esUtils
//esInitContext ( &m_esContext );
ANGLE_D3D_FEATURE_LEVEL featureLevel = ANGLE_D3D_FEATURE_LEVEL::ANGLE_D3D_FEATURE_LEVEL_9_1;
#if (_MSC_VER >= 1800)
// WinRT on Windows 8.1 can compile shaders at run time so we don't care about the DirectX feature level
featureLevel = ANGLE_D3D_FEATURE_LEVEL::ANGLE_D3D_FEATURE_LEVEL_ANY;
#endif
HRESULT result = CreateWinrtEglWindow(WINRT_EGL_IUNKNOWN(panel), featureLevel, m_eglWindow.GetAddressOf());
if (!SUCCEEDED(result))
{
CCLOG("Unable to create Angle EGL Window: %d", result);
return;
}
m_esContext.hWnd = m_eglWindow;
// width and height are ignored and determined from the CoreWindow the SwapChainBackgroundPanel is in.
//TODO: remove esUtils
//esCreateWindow ( &m_esContext, TEXT("Cocos2d-x"), 0, 0, ES_WINDOW_RGB | ES_WINDOW_ALPHA | ES_WINDOW_DEPTH | ES_WINDOW_STENCIL );
m_window->PointerPressed +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &WinRTWindow::OnPointerPressed);
m_window->PointerReleased +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &WinRTWindow::OnPointerReleased);
m_window->PointerMoved +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &WinRTWindow::OnPointerMoved);
m_window->PointerWheelChanged +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &WinRTWindow::OnPointerWheelChanged);
m_dummy = ref new Button();
m_dummy->Opacity = 0.0;
m_dummy->Width=1;
m_dummy->Height=1;
m_dummy->IsEnabled = true;
panel->Children->Append(m_dummy);
m_textBox = ref new TextBox();
m_textBox->Opacity = 0.0;
m_textBox->Width=1;
m_textBox->Height=1;
m_textBox->MaxLength = 1;
panel->Children->Append(m_textBox);
m_textBox->AddHandler(UIElement::KeyDownEvent, ref new KeyEventHandler(this, &WinRTWindow::OnTextKeyDown), true);
m_textBox->AddHandler(UIElement::KeyUpEvent, ref new KeyEventHandler(this, &WinRTWindow::OnTextKeyUp), true);
m_textBox->IsEnabled = false;
auto keyboard = InputPane::GetForCurrentView();
keyboard->Showing += ref new TypedEventHandler<InputPane^, InputPaneVisibilityEventArgs^>(this, &WinRTWindow::ShowKeyboard);
keyboard->Hiding += ref new TypedEventHandler<InputPane^, InputPaneVisibilityEventArgs^>(this, &WinRTWindow::HideKeyboard);
setIMEKeyboardState(false);
}
WinRTWindow::WinRTWindow(CoreWindow^ window) :
m_lastPointValid(false),
m_textInputEnabled(false)
{
window->SizeChanged +=
ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &WinRTWindow::OnWindowSizeChanged);
DisplayProperties::LogicalDpiChanged +=
ref new DisplayPropertiesEventHandler(this, &WinRTWindow::OnLogicalDpiChanged);
DisplayProperties::OrientationChanged +=
ref new DisplayPropertiesEventHandler(this, &WinRTWindow::OnOrientationChanged);
DisplayProperties::DisplayContentsInvalidated +=
ref new DisplayPropertiesEventHandler(this, &WinRTWindow::OnDisplayContentsInvalidated);
m_eventToken = CompositionTarget::Rendering::add(ref new EventHandler<Object^>(this, &WinRTWindow::OnRendering));
}
void WinRTWindow::swapBuffers()
{
eglSwapBuffers(m_esContext.eglDisplay, m_esContext.eglSurface);
}
void WinRTWindow::OnSuspending()
{
#if (_MSC_VER >= 1800)
Microsoft::WRL::ComPtr<IDXGIDevice3> dxgiDevice;
Microsoft::WRL::ComPtr<ID3D11Device> device = m_eglWindow->GetAngleD3DDevice();
HRESULT result = device.As(&dxgiDevice);
if (SUCCEEDED(result))
{
dxgiDevice->Trim();
}
#endif
}
void WinRTWindow::ResizeWindow()
{
GLView::sharedOpenGLView()->UpdateForWindowSizeChange();
}
cocos2d::Point WinRTWindow::GetCCPoint(PointerEventArgs^ args) {
auto p = args->CurrentPoint;
float x = getScaledDPIValue(p->Position.X);
float y = getScaledDPIValue(p->Position.Y);
Point pt(x, y);
float zoomFactor = GLView::sharedOpenGLView()->getFrameZoomFactor();
if(zoomFactor > 0.0f) {
pt.x /= zoomFactor;
pt.y /= zoomFactor;
}
return pt;
}
void WinRTWindow::ShowKeyboard(InputPane^ inputPane, InputPaneVisibilityEventArgs^ args)
{
GLView::sharedOpenGLView()->ShowKeyboard(args->OccludedRect);
}
void WinRTWindow::HideKeyboard(InputPane^ inputPane, InputPaneVisibilityEventArgs^ args)
{
GLView::sharedOpenGLView()->HideKeyboard(args->OccludedRect);
}
void WinRTWindow::setIMEKeyboardState(bool bOpen)
{
m_textInputEnabled = bOpen;
if(m_textInputEnabled)
{
m_textBox->IsEnabled = true;
m_textBox->Focus(FocusState::Pointer);
}
else
{
m_dummy->Focus(FocusState::Pointer);
m_textBox->IsEnabled = false;
}
}
void WinRTWindow::OnTextKeyDown(Object^ sender, KeyRoutedEventArgs^ args)
{
#if 0
if(!m_textInputEnabled)
{
return;
}
auto key = args->Key;
switch(key)
{
default:
break;
}
#endif
}
void WinRTWindow::OnTextKeyUp(Object^ sender, KeyRoutedEventArgs^ args)
{
if(!m_textInputEnabled)
{
return;
}
args->Handled = true;
auto key = args->Key;
switch(key)
{
case VirtualKey::Escape:
// TODO:: fix me
//Director::getInstance()->getKeypadDispatcher()->dispatchKeypadMSG(kTypeBackClicked);
args->Handled = true;
break;
case VirtualKey::Back:
IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward();
break;
case VirtualKey::Enter:
setIMEKeyboardState(false);
IMEDispatcher::sharedDispatcher()->dispatchInsertText("\n", 1);
break;
default:
char szUtf8[8] = {0};
int nLen = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)m_textBox->Text->Data(), 1, szUtf8, sizeof(szUtf8), NULL, NULL);
IMEDispatcher::sharedDispatcher()->dispatchInsertText(szUtf8, nLen);
break;
}
m_textBox->Text = "";
}
void WinRTWindow::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args)
{
float direction = (float)args->CurrentPoint->Properties->MouseWheelDelta;
int id = 0;
Point p(0.0f,0.0f);
GLView::sharedOpenGLView()->handleTouchesBegin(1, &id, &p.x, &p.y);
p.y += direction;
GLView::sharedOpenGLView()->handleTouchesMove(1, &id, &p.x, &p.y);
GLView::sharedOpenGLView()->handleTouchesEnd(1, &id, &p.x, &p.y);
}
void WinRTWindow::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args)
{
int id = args->CurrentPoint->PointerId;
Point pt = GetCCPoint(args);
GLView::sharedOpenGLView()->handleTouchesBegin(1, &id, &pt.x, &pt.y);
}
void WinRTWindow::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args)
{
auto currentPoint = args->CurrentPoint;
if (currentPoint->IsInContact)
{
if (m_lastPointValid)
{
int id = args->CurrentPoint->PointerId;
Point p = GetCCPoint(args);
GLView::sharedOpenGLView()->handleTouchesMove(1, &id, &p.x, &p.y);
}
m_lastPoint = currentPoint->Position;
m_lastPointValid = true;
}
else
{
m_lastPointValid = false;
}
}
void WinRTWindow::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args)
{
int id = args->CurrentPoint->PointerId;
Point pt = GetCCPoint(args);
GLView::sharedOpenGLView()->handleTouchesEnd(1, &id, &pt.x, &pt.y);
}
void WinRTWindow::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args)
{
ResizeWindow();
GLView::sharedOpenGLView()->UpdateForWindowSizeChange();
}
void WinRTWindow::OnLogicalDpiChanged(Object^ sender)
{
GLView::sharedOpenGLView()->UpdateForWindowSizeChange();
}
void WinRTWindow::OnOrientationChanged(Object^ sender)
{
ResizeWindow();
GLView::sharedOpenGLView()->UpdateForWindowSizeChange();
}
void WinRTWindow::OnDisplayContentsInvalidated(Object^ sender)
{
GLView::sharedOpenGLView()->UpdateForWindowSizeChange();
}
void WinRTWindow::OnRendering(Object^ sender, Object^ args)
{
GLView::sharedOpenGLView()->OnRendering();
}
GLView::GLView()
: m_window(nullptr)
, m_fFrameZoomFactor(1.0f)
, m_bSupportTouch(false)
, m_lastPointValid(false)
, m_running(false)
, m_winRTWindow(nullptr)
, m_initialized(false)
{
s_pEglView = this;
_viewName = "Cocos2dxWinRT";
}
GLView::~GLView()
{
CC_ASSERT(this == s_pEglView);
s_pEglView = NULL;
// TODO: cleanup
}
bool GLView::Create(CoreWindow^ window, SwapChainBackgroundPanel^ panel)
{
bool bRet = false;
m_window = window;
m_bSupportTouch = true;
m_winRTWindow = ref new WinRTWindow(window);
m_winRTWindow->Initialize(window, panel);
m_initialized = false;
UpdateForWindowSizeChange();
return bRet;
}
bool GLView::isOpenGLReady()
{
// TODO: need to revisit this
return (m_window.Get() != nullptr);
}
void GLView::end()
{
// TODO: need to implement
}
void GLView::swapBuffers()
{
m_winRTWindow->swapBuffers();
}
void GLView::setIMEKeyboardState(bool bOpen)
{
if(m_winRTWindow)
{
m_winRTWindow->setIMEKeyboardState(bOpen);
}
}
void GLView::resize(int width, int height)
{
}
void GLView::setFrameZoomFactor(float fZoomFactor)
{
m_fFrameZoomFactor = fZoomFactor;
resize((int) (_screenSize.width * fZoomFactor), (int) (_screenSize.height * fZoomFactor));
centerWindow();
Director::getInstance()->setProjection(Director::getInstance()->getProjection());
}
float GLView::getFrameZoomFactor()
{
return m_fFrameZoomFactor;
}
void GLView::setFrameSize(float width, float height)
{
// not implemented in WinRT. Window is always full screen
// GLViewProtocol::setFrameSize(width, height);
}
void GLView::centerWindow()
{
// not implemented in WinRT. Window is always full screen
}
void GLView::OnSuspending()
{
if (m_winRTWindow)
{
m_winRTWindow->OnSuspending();
}
}
GLView* GLView::sharedOpenGLView()
{
return s_pEglView;
}
int GLView::Run()
{
m_running = true;
return 0;
};
void GLView::OnRendering()
{
if(m_running && m_initialized)
{
Director::sharedDirector()->mainLoop();
}
}
void GLView::HideKeyboard(Windows::Foundation::Rect r)
{
return; // not implemented
#if 0
float height = m_keyboardRect.Height;
float factor = _scaleY / CC_CONTENT_SCALE_FACTOR();
height = (float)height / factor;
Rect rect_end(0, 0, 0, 0);
Rect rect_begin(0, 0, _screenSize.width / factor, height);
IMEKeyboardNotificationInfo info;
info.begin = rect_begin;
info.end = rect_end;
info.duration = 0;
IMEDispatcher::sharedDispatcher()->dispatchKeyboardWillHide(info);
IMEDispatcher::sharedDispatcher()->dispatchKeyboardDidHide(info);
#endif
}
void GLView::ShowKeyboard(Windows::Foundation::Rect r)
{
return; // not implemented
#if 0
float height = r.Height;
float factor = _scaleY / CC_CONTENT_SCALE_FACTOR();
height = (float)height / factor;
Rect rect_begin(0.0f, 0.0f - height, _screenSize.width / factor, height);
Rect rect_end(0.0f, 0.0f, _screenSize.width / factor, height);
CCIMEKeyboardNotificationInfo info;
info.begin = rect_begin;
info.end = rect_end;
info.duration = 0;
CCIMEDispatcher::sharedDispatcher()->dispatchKeyboardWillShow(info);
CCIMEDispatcher::sharedDispatcher()->dispatchKeyboardDidShow(info);
m_keyboardRect = r;
#endif
}
void GLView::UpdateForWindowSizeChange()
{
float width = ConvertDipsToPixels(m_window->Bounds.Width);
float height = ConvertDipsToPixels(m_window->Bounds.Height);
if(!m_initialized)
{
m_initialized = true;
GLViewProtocol::setFrameSize(width, height);
}
else
{
setFrameSize(width, height);
Size designSize = getDesignResolutionSize();
GLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::SHOW_ALL);
Director::sharedDirector()->setProjection(Director::sharedDirector()->getProjection());
}
}
NS_CC_END

View File

@ -0,0 +1,155 @@
/****************************************************************************
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_EGLVIEW_WINRT_H__
#define __CC_EGLVIEW_WINRT_H__
#include "CCStdC.h"
#include "CCGL.h"
#include "platform/CCCommon.h"
#include "CCGeometry.h"
#include "platform/CCGLViewProtocol.h"
#include <agile.h>
#include <wrl/client.h>
#include <agile.h>
#include <DirectXMath.h>
NS_CC_BEGIN
class CCEGL;
class GLView;
ref class WinRTWindow sealed
{
public:
WinRTWindow(Windows::UI::Core::CoreWindow^ window);
void Initialize(Windows::UI::Core::CoreWindow^ window, Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ panel);
void setIMEKeyboardState(bool bOpen);
void swapBuffers();
private:
cocos2d::Point GetCCPoint(Windows::UI::Core::PointerEventArgs^ args);
void OnTextKeyDown(Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e);
void OnTextKeyUp(Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e);
void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^, Windows::UI::Core::PointerEventArgs^ args);
void OnPointerMoved(Windows::UI::Core::CoreWindow^, Windows::UI::Core::PointerEventArgs^ args);
void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
void OnLogicalDpiChanged(Platform::Object^ sender);
void OnOrientationChanged(Platform::Object^ sender);
void OnDisplayContentsInvalidated(Platform::Object^ sender);
void OnRendering(Platform::Object^ sender, Platform::Object^ args);
void OnSuspending();
void ResizeWindow();
void ShowKeyboard(Windows::UI::ViewManagement::InputPane^ inputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs^ args);
void HideKeyboard(Windows::UI::ViewManagement::InputPane^ inputPane, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs^ args);
Platform::Agile<Windows::UI::Core::CoreWindow> m_window;
Windows::Foundation::Point m_lastPoint;
Windows::Foundation::EventRegistrationToken m_eventToken;
bool m_lastPointValid;
bool m_textInputEnabled;
Microsoft::WRL::ComPtr<IWinrtEglWindow> m_eglWindow;
Windows::UI::Xaml::Controls::TextBox^ m_textBox;
Windows::UI::Xaml::Controls::Button^ m_dummy;
ESContext m_esContext;
friend GLView;
};
class CC_DLL GLView : public Ref, public GLViewProtocol
{
public:
GLView();
virtual ~GLView();
/* override functions */
virtual bool isOpenGLReady();
virtual void end();
virtual void swapBuffers();
virtual void setFrameSize(float width, float height);
virtual void setIMEKeyboardState(bool bOpen);
void ShowKeyboard(Windows::Foundation::Rect r);
void HideKeyboard(Windows::Foundation::Rect r);
virtual bool Create(Windows::UI::Core::CoreWindow^ window, Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ panel);
void UpdateForWindowSizeChange();
void OnRendering();
void OnSuspending();
private:
Windows::Foundation::EventRegistrationToken m_eventToken;
Windows::Foundation::Point m_lastPoint;
bool m_lastPointValid;
public:
// winrt platform functions
Windows::UI::Core::CoreWindow^ getWindow() { return m_window.Get(); };
int Run();
void resize(int width, int height);
/*
* Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.
*/
void setFrameZoomFactor(float fZoomFactor);
float getFrameZoomFactor();
void centerWindow();
// static function
/**
@brief get the shared main open gl window
*/
static GLView* sharedOpenGLView();
protected:
private:
Platform::Agile<Windows::UI::Core::CoreWindow> m_window;
bool m_running;
bool m_initialized;
bool m_bSupportTouch;
float m_fFrameZoomFactor;
WinRTWindow^ m_winRTWindow;
Windows::Foundation::Rect m_keyboardRect;
};
NS_CC_END
#endif // end of __CC_EGLVIEW_WINRT_H__

View File

@ -0,0 +1,82 @@
/****************************************************************************
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 __CCGL_ANGLE_H__
#define __CCGL_ANGLE_H__
// disable unimplemented function declarations in Angle
#define GL_OES_mapbuffer 1
#define GL_OES_vertex_array_object 1
#include "EGL/egl.h"
#include "EGL/eglext.h"
#include "EGL/eglplatform.h"
#include "GLES2/gl2.h"
#include "GLES2/gl2ext.h"
#include "winrtangle.h"
#include "esUtil.h"
#include "ccMacros.h"
#define GL_WRITE_ONLY_OES 0x88B9
#define GL_BUFFER_ACCESS_OES 0x88BB
#define GL_BUFFER_MAPPED_OES 0x88BC
#define GL_BUFFER_MAP_POINTER_OES 0x88BD
#define GL_BGRA GL_BGRA_EXT
#define glClearDepth glClearDepthf
inline void glGenVertexArrays(GLsizei n, GLuint *arrays)
{
CCASSERT(false, "AngleProject does not implement glGenVertexArraysOES");
}
inline void glBindVertexArray(GLuint array)
{
CCASSERT(false, "AngleProject does not implement glBindVertexArrayOES");
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *arrays)
{
CCASSERT(false, "AngleProject does not implement glDeleteVertexArraysOES");
}
inline void* glMapBuffer(GLenum target, GLenum access)
{
CCASSERT(false, "AngleProject does not implement glMapBufferOES");
return NULL;
}
inline GLboolean glUnmapBuffer(GLenum targets)
{
CCASSERT(false, "AngleProject does not implement glUnmapBufferOES");
return false;
}
#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
#define GL_WRITE_ONLY GL_WRITE_ONLY_OES
#endif // __CCGL_ANGLE_H__

View File

@ -0,0 +1,51 @@
/****************************************************************************
Copyright (c) 2010-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 "CCPThreadWinRT.h"
NS_CC_BEGIN
void pthread_mutex_init(pthread_mutex_t* m, void* attributes) {
*m = CreateMutexEx(NULL,FALSE,0,NULL);
}
int pthread_mutex_lock(pthread_mutex_t* m) {
return WaitForSingleObjectEx(*m,INFINITE,FALSE);
}
int pthread_mutex_unlock(pthread_mutex_t* m) {
return ReleaseMutex(*m);
}
void pthread_mutex_destroy(pthread_mutex_t* m)
{
if(m)
{
CloseHandle(*m);
}
}
NS_CC_END

View File

@ -0,0 +1,57 @@
/****************************************************************************
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 __CCPTHREADWINRT_H__
#define __CCPTHREADWINRT_H__
#include "CCPlatformMacros.h"
#include <Windows.h>
NS_CC_BEGIN
typedef HANDLE pthread_t;
typedef HANDLE pthread_mutex_t;
typedef int pthread_cond_t;
#define pthread_cond_wait(x, y)
void pthread_mutex_init(pthread_mutex_t* m, void* attributes);
int pthread_mutex_lock(pthread_mutex_t* m);
int pthread_mutex_unlock(pthread_mutex_t* m);
void pthread_mutex_destroy(pthread_mutex_t* m);
#define pthread_cond_destroy(x)
#define pthread_cond_signal(x)
#define pthread_cond_init(x, y)
NS_CC_END
#endif // __CCPTHREADWINRT_H__

View File

@ -0,0 +1,56 @@
/****************************************************************************
Copyright (c) 2010-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.
****************************************************************************/
#ifndef __CCPLATFORMDEFINE_H__
#define __CCPLATFORMDEFINE_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#if 0
#if defined(_USRDLL)
#define CC_DLL __declspec(dllexport)
#else /* use a DLL library */
#define CC_DLL __declspec(dllimport)
#endif
#endif // 0
#define CC_DLL
#include <assert.h>
#if CC_DISABLE_ASSERT > 0
#define CC_ASSERT(cond)
#else
#define CC_ASSERT(cond) assert(cond)
#endif
#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#endif /* __CCPLATFORMDEFINE_H__*/

View File

@ -0,0 +1,280 @@
/****************************************************************************
Copyright (c) 2010-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 "CCPrecompiledShaders.h"
#include "CCWinRTUtils.h"
#include "CCGLProgram.h"
#include "sha1.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
#include "platform/winrt/shaders/precompiledshaders.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
#include "platform/wp8/shaders/precompiledshaders.h"
#endif
using namespace Windows::Graphics::Display;
using namespace Windows::Storage;
using namespace Platform;
using namespace Windows::Storage;
using namespace Windows::Storage::Pickers;
using namespace Windows::Storage::Streams;
using namespace concurrency;
NS_CC_BEGIN
// singleton stuff
static CCPrecompiledShaders *s_pPrecompiledShaders = NULL;
#define SHADER_NAME_PREFIX "s_"
CCPrecompiledShaders* CCPrecompiledShaders::getInstance(void)
{
if (!s_pPrecompiledShaders)
{
s_pPrecompiledShaders = new CCPrecompiledShaders();
}
return s_pPrecompiledShaders;
}
CCPrecompiledShaders::CCPrecompiledShaders(void)
: m_isDirty(false)
{
Init();
}
void CCPrecompiledShaders::Init(void)
{
m_programs.clear();
m_precompiledPrograms.clear();
// add existing precomiled programs to dictionary
loadPrecompiledPrograms();
}
CCPrecompiledShaders::~CCPrecompiledShaders(void)
{
}
static std::string computeHash(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray)
{
SHA1Context sha;
int err;
err = SHA1Reset(&sha);
std::string result = "";
uint8_t hash[SHA1HashSize];
char hashString[SHA1HashSize * 2 + 1];
if(!err)
{
err = SHA1Input(&sha,(const unsigned char *) vShaderByteArray,strlen(vShaderByteArray));
}
if(!err)
{
err = SHA1Input(&sha,(const unsigned char *) fShaderByteArray,strlen(fShaderByteArray));
}
if(!err)
{
char* shader_version = (char*) glGetString(GL_SHADING_LANGUAGE_VERSION);
err = SHA1Input(&sha,(const unsigned char *) shader_version,strlen(shader_version));
}
if(!err)
{
err = SHA1Result(&sha, hash);
}
if(!err)
{
SHA1ConvertMessageToString(hash, hashString);
result = hashString;
}
return result;
}
std::string CCPrecompiledShaders::addShaders(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray)
{
return computeHash(vShaderByteArray, fShaderByteArray);
}
void CCPrecompiledShaders::loadPrecompiledPrograms()
{
m_precompiledPrograms.clear();
#if defined(PRECOMPILED_SHADERS)
for(int i = 0; i < s_numPrograms; i++)
{
PrecompiledProgram* p = new PrecompiledProgram();
p->key = s_programKeys[i];
p->program = s_programs[i];
p->length = s_programLengths[i];
m_precompiledPrograms[s_programKeys[i]] = p;
}
#endif
}
bool CCPrecompiledShaders::loadProgram(GLuint program, const GLchar* vShaderByteArray, const GLchar* fShaderByteArray)
{
std::string id = computeHash(vShaderByteArray, fShaderByteArray);
auto it = m_precompiledPrograms.find(id);
if(it == m_precompiledPrograms.end())
return false;
glProgramBinaryOES(program, GL_PROGRAM_BINARY_ANGLE, (const GLvoid*) it->second->program, it->second->length);
return true;
}
bool CCPrecompiledShaders::addProgram(GLuint program, const std::string& id)
{
int length;
auto it = m_programs.find(id);
if(it != m_programs.end())
return true;
auto it2 = m_precompiledPrograms.find(id);
if(it2 == m_precompiledPrograms.end())
m_isDirty = true;
CompiledProgram* p = new CompiledProgram();
glGetProgramiv(program, GL_PROGRAM_BINARY_LENGTH_OES, &length);
p->program.reserve(length);
p->length = length;
p->key = id;
GLenum binaryFormat;
glGetProgramBinaryOES(program, length, NULL, &binaryFormat, p->program.data());
m_programs[id] = p;
return true;
}
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
void CCPrecompiledShaders::savePrecompiledPrograms(Windows::Storage::StorageFolder^ folder)
{
Platform::String ^fileName = L"precompiledshaders.h";
auto saveTask = create_task(folder->CreateFileAsync(fileName, CreationCollisionOption::ReplaceExisting));
saveTask.then([this](StorageFile^ file)
{
InMemoryRandomAccessStream^ memoryStream = ref new InMemoryRandomAccessStream();
DataWriter^ dataWriter = ref new DataWriter(memoryStream);
Platform::String^ programLengths = "const int s_programLengths[] = {";
Platform::String^ programs = "const unsigned char* s_programs[] = {";
Platform::String^ programKeys = "const char* s_programKeys[] = {";
int numPrograms = 0;
dataWriter->WriteString(L"#define PRECOMPILED_SHADERS\n\n");
for (auto iter = m_programs.begin(); iter != m_programs.end(); ++iter)
{
CompiledProgram* p = (CompiledProgram*)iter->second;
Platform::String^ keyName = ref new Platform::String(CCUtf8ToUnicode(p->key.c_str()).c_str());
Platform::String^ programName = SHADER_NAME_PREFIX + keyName;
dataWriter->WriteString("const unsigned char ");
dataWriter->WriteString(programName);
dataWriter->WriteString("[] = {\n");
char temp[32];
unsigned char* buffer = p->program.data();
for(int i = 0; i < p->length - 1; i++)
{
if(i % 8 == 0)
dataWriter->WriteString("\n");
sprintf_s(temp, "%3i, ", buffer[i]);
dataWriter->WriteString(ref new Platform::String(CCUtf8ToUnicode(temp).c_str()));
}
if((p->length - 1) % 8 == 0)
dataWriter->WriteString("\n");
sprintf_s(temp, "%3i, ", buffer[p->length - 1]);
dataWriter->WriteString(ref new Platform::String(CCUtf8ToUnicode(temp).c_str()));
dataWriter->WriteString("\n};\n\n");
if(numPrograms != 0)
{
programLengths += (",");
programs += (",");
programKeys += (",");
}
programLengths += p->length;
programs += programName;
programKeys += "\"" + keyName + "\"";
numPrograms++;
}
programLengths += "};\n";
programs += "};\n";
programKeys += "};\n";
Platform::String^ n = ref new Platform::String(L"const int s_numPrograms = ");
n += numPrograms;
n += ";\n";
dataWriter->WriteString(n);
dataWriter->WriteString(programLengths);
dataWriter->WriteString(programs);
dataWriter->WriteString(programKeys);
return FileIO::WriteBufferAsync(file, dataWriter->DetachBuffer());
});
}
void CCPrecompiledShaders::savePrecompiledShaders()
{
if(!m_isDirty)
return;
FolderPicker^ folderPicker = ref new FolderPicker();
folderPicker->SuggestedStartLocation = PickerLocationId::Desktop;
folderPicker->FileTypeFilter->Append(".h");
auto saveTask = create_task(folderPicker->PickSingleFolderAsync());
saveTask.then([this](StorageFolder^ folder)
{
if(folder != nullptr)
{
savePrecompiledPrograms(folder);
m_isDirty = false;
}
});
}
#endif
NS_CC_END

View File

@ -0,0 +1,97 @@
/****************************************************************************
Copyright (c) 2010-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.
****************************************************************************/
#ifndef __CC_PRECOMPILED_SHADERS_H__
#define __CC_PRECOMPILED_SHADERS_H__
#include "platform/CCCommon.h"
#include "CCGL.h"
#include <string>
#include <vector>
#include <map>
NS_CC_BEGIN
typedef struct _PrecompiledProgram
{
const char* key;
const unsigned char* program;
int length;
} PrecompiledProgram;
typedef struct _CompiledProgram
{
std::string key;
std::vector<unsigned char> program;
int length;
} CompiledProgram;
#if 0
const unsigned char gKey[] = "hello";
const unsigned char gProgram[] = "world";
PrecompiledShader gFoo = {gKey, gProgram, 100};
PrecompiledShader shaders[] = {gFoo, gFoo};
#endif
class CC_DLL CCPrecompiledShaders
{
public:
CCPrecompiledShaders();
virtual ~CCPrecompiledShaders();
/**
@brief Get current precompiled shaders instance.
@return Current precompiled shaders instance pointer.
*/
static CCPrecompiledShaders* getInstance();
std::string addShaders(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray);
bool addProgram(GLuint program, const std::string& id);
bool loadProgram(GLuint program, const GLchar* vShaderByteArray, const GLchar* fShaderByteArray);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
void savePrecompiledShaders();
#endif
protected:
void savePrecompiledPrograms(Windows::Storage::StorageFolder^ folder);
void loadPrecompiledPrograms();
void Init();
std::map<std::string, CompiledProgram*> m_programs;
std::map<std::string, PrecompiledProgram*> m_precompiledPrograms;
bool m_isDirty;
};
NS_CC_END
#endif // __CC_PRECOMPILED_SHADERS_H__

View File

@ -0,0 +1,48 @@
/****************************************************************************
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.
****************************************************************************/
#include "CCStdC.h"
int CC_DLL gettimeofday(struct timeval * val, struct timezone *)
{
if (val)
{
SYSTEMTIME wtm;
GetLocalTime(&wtm);
struct tm tTm;
tTm.tm_year = wtm.wYear - 1900;
tTm.tm_mon = wtm.wMonth - 1;
tTm.tm_mday = wtm.wDay;
tTm.tm_hour = wtm.wHour;
tTm.tm_min = wtm.wMinute;
tTm.tm_sec = wtm.wSecond;
tTm.tm_isdst = -1;
val->tv_sec = (long)mktime(&tTm); // time_t is 64-bit on win32
val->tv_usec = wtm.wMilliseconds * 1000;
}
return 0;
}

View File

@ -0,0 +1,115 @@
/****************************************************************************
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_STD_C_H__
#define __CC_STD_C_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#include "CCPlatformMacros.h"
#include <float.h>
//typedef SSIZE_T ssize_t;
// ssize_t was redefined as int in libwebsockets.h.
// Therefore, to avoid conflict, we needs the same definition.
typedef int ssize_t;
// for math.h on win32 platform
#if !defined(_USE_MATH_DEFINES)
#define _USE_MATH_DEFINES // make M_PI can be use
#endif
#if !defined(isnan)
#define isnan _isnan
#endif
#ifndef snprintf
#define snprintf _snprintf
#endif
#include <math.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#ifndef M_PI
#define M_PI 3.14159265358
#endif
#ifndef M_PI_2
#define M_PI_2 1.57079632679
#endif
// for MIN MAX and sys/time.h on win32 platform
#ifndef NOMINMAX
#define NOMINMAX
#endif
#ifndef MIN
#define MIN(x,y) (((x) > (y)) ? (y) : (x))
#endif // MIN
#ifndef MAX
#define MAX(x,y) (((x) < (y)) ? (y) : (x))
#endif // MAX
#include <stdint.h>
// Structure timeval has define in winsock.h, include windows.h for it.
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#define _WINSOCKAPI_
#include <WinSock2.h>
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WINRT
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <Windows.h>
#undef timeval
struct timeval
{
long tv_sec; // seconds
long tv_usec; // microSeconds
};
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WP8
struct timezone
{
int tz_minuteswest;
int tz_dsttime;
};
int CC_DLL gettimeofday(struct timeval *, struct timezone *);
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_WP8
#endif // __CC_STD_C_H__

View File

@ -0,0 +1,160 @@
/****************************************************************************
Copyright (c) 2010-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 "CCWinRTUtils.h"
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <Windows.h>
#include <wrl/client.h>
#include <ppl.h>
#include <ppltasks.h>
NS_CC_BEGIN
using namespace Windows::Graphics::Display;
using namespace Windows::Storage;
using namespace concurrency;
using namespace Platform;
using namespace Windows::Storage;
using namespace Windows::Storage::Pickers;
using namespace Windows::Storage::Streams;
std::wstring CCUtf8ToUnicode(const char * pszUtf8Str, unsigned len/* = -1*/)
{
std::wstring ret;
do
{
if (! pszUtf8Str) break;
// get UTF8 string length
if (-1 == len)
{
len = strlen(pszUtf8Str);
}
if (len <= 0) break;
// get UTF16 string length
int wLen = MultiByteToWideChar(CP_UTF8, 0, pszUtf8Str, len, 0, 0);
if (0 == wLen || 0xFFFD == wLen) break;
// convert string
wchar_t * pwszStr = new wchar_t[wLen + 1];
if (! pwszStr) break;
pwszStr[wLen] = 0;
MultiByteToWideChar(CP_UTF8, 0, pszUtf8Str, len, pwszStr, wLen + 1);
ret = pwszStr;
CC_SAFE_DELETE_ARRAY(pwszStr);
} 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;
size_t convertedChars = 0;
char * pszUtf8Str = new char[len*3 + 1];
WideCharToMultiByte(CP_UTF8, 0, pwszStr, len+1, pszUtf8Str, len*3 + 1, 0, 0);
ret = pszUtf8Str;
CC_SAFE_DELETE_ARRAY(pszUtf8Str);
}while(0);
return ret;
}
std::string PlatformStringToString(Platform::String^ s) {
std::wstring t = std::wstring(s->Data());
return std::string(t.begin(),t.end());
}
// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
float ConvertDipsToPixels(float dips)
{
static const float dipsPerInch = 96.0f;
return floor(dips * DisplayProperties::LogicalDpi / dipsPerInch + 0.5f); // Round to nearest integer.
}
float getScaledDPIValue(float v) {
auto dipFactor = DisplayProperties::LogicalDpi / 96.0f;
return v * dipFactor;
}
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
// Function that reads from a binary file asynchronously.
Concurrency::task<Platform::Array<byte>^> ReadDataAsync(Platform::String^ filename)
{
using namespace Windows::Storage;
using namespace Concurrency;
auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
return create_task(folder->GetFileAsync(filename)).then([] (StorageFile^ file)
{
return file->OpenReadAsync();
}).then([] (Streams::IRandomAccessStreamWithContentType^ stream)
{
unsigned int bufferSize = static_cast<unsigned int>(stream->Size);
auto fileBuffer = ref new Streams::Buffer(bufferSize);
return stream->ReadAsync(fileBuffer, bufferSize, Streams::InputStreamOptions::None);
}).then([] (Streams::IBuffer^ fileBuffer) -> Platform::Array<byte>^
{
auto fileData = ref new Platform::Array<byte>(fileBuffer->Length);
Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(fileData);
return fileData;
});
}
#else
// Function that reads from a binary file asynchronously.
Concurrency::task<Platform::Array<byte>^> ReadDataAsync(Platform::String^ path)
{
using namespace Windows::Storage;
using namespace Concurrency;
return create_task(StorageFile::GetFileFromPathAsync(path)).then([&](StorageFile^ f)
{
return FileIO::ReadBufferAsync(f);
}).then([] (Streams::IBuffer^ fileBuffer) -> Platform::Array<byte>^
{
auto fileData = ref new Platform::Array<byte>(fileBuffer->Length);
Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(fileData);
return fileData;
});
}
#endif
NS_CC_END

View File

@ -0,0 +1,55 @@
/****************************************************************************
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 __CCWINRT_UTILS_H__
#define __CCWINRT_UTILS_H__
#include "CCPlatformMacros.h"
#include "CCDictionary.h"
#include <wrl/client.h>
#include <ppl.h>
#include <ppltasks.h>
#include <string>
NS_CC_BEGIN
std::wstring CC_DLL CCUtf8ToUnicode(const char * pszUtf8Str, unsigned len = -1);
std::string CC_DLL CCUnicodeToUtf8(const wchar_t* pwszStr);
std::string PlatformStringToString(Platform::String^ s);
// Method to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
float ConvertDipsToPixels(float dips);
float getScaledDPIValue(float v);
Concurrency::task<Platform::Array<byte>^> ReadDataAsync(Platform::String^ path);
NS_CC_END
#endif // __CCWINRT_UTILS_H__

View File

@ -0,0 +1,466 @@
//-----------------------------------------------------------------------------------------------
// Copyright (c) 2012 Andrew Garrison
//-----------------------------------------------------------------------------------------------
// 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 <windows.ui.xaml.media.dxinterop.h>
#include <math.h>
using namespace Microsoft::WRL;
using namespace Windows::UI::Core;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::Foundation;
using namespace Windows::Graphics::Display;
using namespace D2D1;
// Constructor.
DirectXBase::DirectXBase() :
m_dpi(-1.0f)
{
}
// Initialize the DirectX resources required to run.
void DirectXBase::Initialize(CoreWindow^ window, SwapChainBackgroundPanel^ panel, float dpi)
{
m_window = window;
m_panel = panel;
CreateDeviceIndependentResources();
CreateDeviceResources();
SetDpi(dpi);
}
// These are the resources required independent of the device.
void DirectXBase::CreateDeviceIndependentResources()
{
D2D1_FACTORY_OPTIONS options;
ZeroMemory(&options, sizeof(D2D1_FACTORY_OPTIONS));
#if defined(_DEBUG)
// If the project is in a debug build, enable Direct2D debugging via SDK Layers
options.debugLevel = D2D1_DEBUG_LEVEL_INFORMATION;
#endif
DX::ThrowIfFailed(
D2D1CreateFactory(
D2D1_FACTORY_TYPE_SINGLE_THREADED,
__uuidof(ID2D1Factory1),
&options,
&m_d2dFactory
)
);
DX::ThrowIfFailed(
DWriteCreateFactory(
DWRITE_FACTORY_TYPE_SHARED,
__uuidof(IDWriteFactory),
&m_dwriteFactory
)
);
DX::ThrowIfFailed(
CoCreateInstance(
CLSID_WICImagingFactory,
nullptr,
CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(&m_wicFactory)
)
);
}
// 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 recommended usage, and is required for compatibility with Direct2D.
UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
ComPtr<IDXGIDevice> dxgiDevice;
#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,
D3D_FEATURE_LEVEL_9_2,
D3D_FEATURE_LEVEL_9_1
};
// Create the DX11 API device object, and get a corresponding context.
ComPtr<ID3D11Device> device;
ComPtr<ID3D11DeviceContext> context;
DX::ThrowIfFailed(
D3D11CreateDevice(
nullptr, // specify null to use the default adapter
D3D_DRIVER_TYPE_HARDWARE,
0, // leave as 0 unless software device
creationFlags, // optionally set debug and Direct2D compatibility flags
featureLevels, // list of feature levels this app can support
ARRAYSIZE(featureLevels), // number of entries in above list
D3D11_SDK_VERSION, // always set this to D3D11_SDK_VERSION for Metro style apps
&device, // returns the Direct3D device created
&m_featureLevel, // returns feature level of device created
&context // returns the device immediate context
)
);
// Get the DirectX11.1 device by QI off the DirectX11 one.
DX::ThrowIfFailed(
device.As(&m_d3dDevice)
);
// And get the corresponding device context in the same way.
DX::ThrowIfFailed(
context.As(&m_d3dContext)
);
// Obtain the underlying DXGI device of the Direct3D11.1 device.
DX::ThrowIfFailed(
m_d3dDevice.As(&dxgiDevice)
);
// Obtain the Direct2D device for 2-D rendering.
DX::ThrowIfFailed(
m_d2dFactory->CreateDevice(dxgiDevice.Get(), &m_d2dDevice)
);
// And get its corresponding device context object.
DX::ThrowIfFailed(
m_d2dDevice->CreateDeviceContext(
D2D1_DEVICE_CONTEXT_OPTIONS_NONE,
&m_d2dContext
)
);
// Release the swap chain (if it exists) as it will be incompatible with the new device.
m_swapChain = nullptr;
}
// 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;
// Update Direct2D's stored DPI.
m_d2dContext->SetDpi(m_dpi, m_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();
}
}
// This routine is called in the event handler for the view SizeChanged event.
void DirectXBase::UpdateForWindowSizeChange()
{
// Only handle window size changed if there is no pending DPI change.
if (m_dpi != DisplayProperties::LogicalDpi)
return;
if (m_window->Bounds.Width != m_windowBounds.Width ||
m_window->Bounds.Height != m_windowBounds.Height)
{
m_d2dContext->SetTarget(nullptr);
m_d2dTargetBitmap = nullptr;
m_renderTargetView = nullptr;
m_depthStencilView = nullptr;
CreateWindowSizeDependentResources();
}
}
// Allocate all memory resources that change on a window SizeChanged event.
void DirectXBase::CreateWindowSizeDependentResources()
{
// Store the window bounds so the next time we get a SizeChanged event we can
// avoid rebuilding everything if the size is identical.
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);
// If the swap chain already exists, resize it.
if (m_swapChain != nullptr)
{
DX::ThrowIfFailed(
m_swapChain->ResizeBuffers(
2,
static_cast<UINT>(m_renderTargetSize.Width),
static_cast<UINT>(m_renderTargetSize.Height),
DXGI_FORMAT_B8G8R8A8_UNORM,
0
)
);
}
// Otherwise, create a new one.
else
{
// Allocate a descriptor.
DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
swapChainDesc.Width = static_cast<UINT>(m_renderTargetSize.Width); // Match the size of the windowm.
swapChainDesc.Height = static_cast<UINT>(m_renderTargetSize.Height);
swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; // This is the most common swapchain 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 = 2; // Use double buffering to enable flip.
swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // All Metro style apps must use this SwapEffect.
swapChainDesc.Flags = 0;
// Once the desired swap chain description is configured, it must be created on the same adapter as our D3D Device.
// First, retrieve the underlying DXGI Device from the D3D Device.
ComPtr<IDXGIDevice1> dxgiDevice;
DX::ThrowIfFailed(
m_d3dDevice.As(&dxgiDevice)
);
// Identify the physical adapter (GPU or card) this device is running on.
ComPtr<IDXGIAdapter> dxgiAdapter;
DX::ThrowIfFailed(
dxgiDevice->GetAdapter(&dxgiAdapter)
);
// And obtain the factory object that created it.
ComPtr<IDXGIFactory2> dxgiFactory;
DX::ThrowIfFailed(
dxgiAdapter->GetParent(IID_PPV_ARGS(&dxgiFactory))
);
// Create the swap chain and then associate it with the SwapChainBackgroundPanel.
DX::ThrowIfFailed(
dxgiFactory->CreateSwapChainForComposition(
m_d3dDevice.Get(),
&swapChainDesc,
nullptr,
&m_swapChain
)
);
ComPtr<ISwapChainBackgroundPanelNative> panelNative;
DX::ThrowIfFailed(
reinterpret_cast<IUnknown*>(m_panel)->QueryInterface(IID_PPV_ARGS(&panelNative))
);
DX::ThrowIfFailed(
panelNative->SetSwapChain(m_swapChain.Get())
);
// 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)
);
}
// Obtain the backbuffer for this window which will be the final 3D rendertarget.
ComPtr<ID3D11Texture2D> backBuffer;
DX::ThrowIfFailed(
m_swapChain->GetBuffer(0, IID_PPV_ARGS(&backBuffer))
);
// Create a view interface on the rendertarget to use on bind.
DX::ThrowIfFailed(
m_d3dDevice->CreateRenderTargetView(
backBuffer.Get(),
nullptr,
&m_renderTargetView
)
);
// Create a descriptor for the depth/stencil buffer.
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
);
// Allocate a 2-D surface as the depth/stencil buffer.
ComPtr<ID3D11Texture2D> depthStencil;
DX::ThrowIfFailed(
m_d3dDevice->CreateTexture2D(
&depthStencilDesc,
nullptr,
&depthStencil
)
);
// Create a DepthStencil view on this surface to use on bind.
CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D);
DX::ThrowIfFailed(
m_d3dDevice->CreateDepthStencilView(
depthStencil.Get(),
&depthStencilViewDesc,
&m_depthStencilView
)
);
// Create a viewport descriptor of the full window size.
CD3D11_VIEWPORT viewport(
0.0f,
0.0f,
m_renderTargetSize.Width,
m_renderTargetSize.Height
);
// Set the current viewport using the descriptor.
m_d3dContext->RSSetViewports(1, &viewport);
// Now we set up the Direct2D render target bitmap linked to the swapchain.
// Whenever we render to this bitmap, it will be directly rendered to the
// swapchain associated with the window.
D2D1_BITMAP_PROPERTIES1 bitmapProperties =
BitmapProperties1(
D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED),
m_dpi,
m_dpi
);
// Direct2D needs the DXGI version of the backbuffer surface pointer.
ComPtr<IDXGISurface> dxgiBackBuffer;
DX::ThrowIfFailed(
m_swapChain->GetBuffer(0, IID_PPV_ARGS(&dxgiBackBuffer))
);
// Get a D2D surface from the DXGI back buffer to use as the D2D render target.
DX::ThrowIfFailed(
m_d2dContext->CreateBitmapFromDxgiSurface(
dxgiBackBuffer.Get(),
&bitmapProperties,
&m_d2dTargetBitmap
)
);
// So now we can set the Direct2D render target.
m_d2dContext->SetTarget(m_d2dTargetBitmap.Get());
// Set D2D text anti-alias mode to Grayscale to ensure proper rendering of text on intermediate surfaces.
m_d2dContext->SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE);
// Set the blend function.
ID3D11BlendState* g_pBlendState = NULL;
D3D11_BLEND_DESC blendDesc;
ZeroMemory(&blendDesc, sizeof(D3D11_BLEND_DESC));
blendDesc.AlphaToCoverageEnable = false;
blendDesc.IndependentBlendEnable = false;
D3D11_RENDER_TARGET_BLEND_DESC rtBlendDesc;
rtBlendDesc.BlendEnable = false;
rtBlendDesc.SrcBlend = D3D11_BLEND_SRC_ALPHA;
rtBlendDesc.DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
rtBlendDesc.BlendOp = D3D11_BLEND_OP_ADD;
rtBlendDesc.SrcBlendAlpha = D3D11_BLEND_ZERO;
rtBlendDesc.DestBlendAlpha = D3D11_BLEND_ZERO;
rtBlendDesc.BlendOpAlpha = D3D11_BLEND_OP_ADD;
rtBlendDesc.RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
blendDesc.RenderTarget[0] = rtBlendDesc;
auto hr1 = m_d3dDevice->CreateBlendState(&blendDesc, &g_pBlendState);
m_d3dContext->OMSetBlendState(g_pBlendState, 0, 0xffffffff);
D3D11_DEPTH_STENCIL_DESC dsDesc;
// Depth test parameters
dsDesc.DepthEnable = false;
dsDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
dsDesc.DepthFunc = D3D11_COMPARISON_LESS;
// Stencil test parameters
dsDesc.StencilEnable = true;
dsDesc.StencilReadMask = 0xFF;
dsDesc.StencilWriteMask = 0xFF;
// Stencil operations if pixel is front-facing
dsDesc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
dsDesc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_INCR;
dsDesc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
dsDesc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
// Stencil operations if pixel is back-facing
dsDesc.BackFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
dsDesc.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_DECR;
dsDesc.BackFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
dsDesc.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
// Create depth stencil state
ID3D11DepthStencilState * pDSState;
m_d3dDevice->CreateDepthStencilState(&dsDesc, &pDSState);
m_d3dContext->OMSetDepthStencilState(pDSState, 1);
m_d3dContext->OMSetRenderTargets(1, m_renderTargetView.GetAddressOf(), m_depthStencilView.Get());
}
// Method to deliver the final image to the display.
void DirectXBase::Present()
{
// The application may optionally specify "dirty" or "scroll" rects to improve efficiency
// in certain scenarios.
DXGI_PRESENT_PARAMETERS parameters = {0};
parameters.DirtyRectsCount = 0;
parameters.pDirtyRects = nullptr;
parameters.pScrollRect = nullptr;
parameters.pScrollOffset = nullptr;
// 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->Present1(1, 0, &parameters);
m_d3dContext->OMSetRenderTargets(1,m_renderTargetView.GetAddressOf(),m_depthStencilView.Get());
// If the device was removed either by a disconnect or a driver upgrade, we
// must completely reinitialize the renderer.
if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
{
Initialize(m_window.Get(), m_panel, m_dpi);
}
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 * m_dpi / dipsPerInch + 0.5f); // Round to nearest integer.
}

View File

@ -0,0 +1,78 @@
//-----------------------------------------------------------------------------------------------
// Copyright (c) 2012 Andrew Garrison
//-----------------------------------------------------------------------------------------------
// 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 <d3d11_1.h>
#include <d2d1_1.h>
#include <d2d1effects.h>
#include <dwrite_1.h>
#include <wincodec.h>
#include <agile.h>
#include <DirectXMath.h>
#include "DirectXHelper.h"
#pragma warning (disable: 4449)
using namespace Windows::UI::ViewManagement;
// Helper class that initializes DirectX APIs
ref class DirectXBase abstract
{
internal:
DirectXBase();
public:
virtual void Initialize(Windows::UI::Core::CoreWindow^ window, Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ panel, float dpi);
virtual void CreateDeviceIndependentResources();
virtual void CreateDeviceResources();
virtual void SetDpi(float dpi);
virtual void CreateWindowSizeDependentResources();
virtual void UpdateForWindowSizeChange();
virtual void Present();
virtual float ConvertDipsToPixels(float dips);
protected private:
Platform::Agile<Windows::UI::Core::CoreWindow> m_window;
Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ m_panel;
// Direct2D Objects
Microsoft::WRL::ComPtr<ID2D1Factory1> m_d2dFactory;
Microsoft::WRL::ComPtr<ID2D1Device> m_d2dDevice;
Microsoft::WRL::ComPtr<ID2D1DeviceContext> m_d2dContext;
Microsoft::WRL::ComPtr<ID2D1Bitmap1> m_d2dTargetBitmap;
// DirectWrite & Windows Imaging Component Objects
Microsoft::WRL::ComPtr<IDWriteFactory1> m_dwriteFactory;
Microsoft::WRL::ComPtr<IWICImagingFactory2> m_wicFactory;
// 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;
D3D_FEATURE_LEVEL m_featureLevel;
Windows::Foundation::Size m_renderTargetSize;
Windows::Foundation::Rect m_windowBounds;
float m_dpi;
};
#pragma warning (default: 4449)

View File

@ -0,0 +1,32 @@
//-----------------------------------------------------------------------------------------------
// Copyright (c) 2012 Andrew Garrison
//-----------------------------------------------------------------------------------------------
// 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
// Helper utilities to make Win32 APIs work with exceptions.
namespace DX
{
inline void ThrowIfFailed(HRESULT hr)
{
if (FAILED(hr))
{
// Set a breakpoint on this line to catch Win32 API errors.
throw Platform::Exception::CreateException(hr);
}
}
}

View File

@ -0,0 +1 @@
#include "pch.h"

View File

@ -0,0 +1,3 @@
#pragma once
#include "cocos2d.h"

View File

@ -0,0 +1,422 @@
/*
* sha1.cpp
*
* Copyright (C) The Internet Society (2001). All Rights Reserved.
* This document and translations of it may be copied and furnished to others,
* and derivative works that comment on or otherwise explain it or assist in its
* implementation may be prepared, copied, published and distributed, in whole or in part,
* without restriction of any kind, provided that the above copyright notice and this paragraph
* are included on all such copies and derivative works. However, this document itself may not
* be modified in any way, such as by removing the copyright notice or references to the Internet Society
* or other Internet organizations, except as needed for the purpose of developing Internet standards in
* which case the procedures for copyrights defined in the Internet Standards process must be followed,
* or as required to translate it into languages other than English.
*
* The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
*
* This document and the information contained herein is provided on an "AS IS" basis and
* THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS
* OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* Source:
* http://www.faqs.org/rfcs/rfc3174.html
*
* Description:
* This file implements the Secure Hashing Algorithm 1 as
* defined in FIPS PUB 180-1 published April 17, 1995.
*
* The SHA-1, produces a 160-bit message digest for a given
* data stream. It should take about 2**n steps to find a
* message with the same digest as a given message and
* 2**(n/2) to find any two messages with the same digest,
* when n is the digest size in bits. Therefore, this
* algorithm can serve as a means of providing a
* "fingerprint" for a message.
*
* Portability Issues:
* SHA-1 is defined in terms of 32-bit "words". This code
* uses <stdint.h> (included via "sha1.h" to define 32 and 8
* bit unsigned integer types. If your C compiler does not
* support 32 bit unsigned integers, this code is not
* appropriate.
*
* Caveats:
* SHA-1 is designed to work with messages less than 2^64 bits
* long. Although SHA-1 allows a message digest to be generated
* for messages of any number of bits less than 2^64, this
* implementation only works with messages with a length that is
* a multiple of the size of an 8-bit character.
*
*/
#include "sha1.h"
/*
* Define the SHA1 circular left shift macro
*/
#define SHA1CircularShift(bits,word) \
(((word) << (bits)) | ((word) >> (32-(bits))))
/* Local Function Prototyptes */
void SHA1PadMessage(SHA1Context *);
void SHA1ProcessMessageBlock(SHA1Context *);
/*
* SHA1Reset
*
* Description:
* This function will initialize the SHA1Context in preparation
* for computing a new SHA1 message digest.
*
* Parameters:
* context: [in/out]
* The context to reset.
*
* Returns:
* sha Error Code.
*
*/
int SHA1Reset(SHA1Context *context)
{
if (!context)
{
return shaNull;
}
context->Length_Low = 0;
context->Length_High = 0;
context->Message_Block_Index = 0;
context->Intermediate_Hash[0] = 0x67452301;
context->Intermediate_Hash[1] = 0xEFCDAB89;
context->Intermediate_Hash[2] = 0x98BADCFE;
context->Intermediate_Hash[3] = 0x10325476;
context->Intermediate_Hash[4] = 0xC3D2E1F0;
context->Computed = 0;
context->Corrupted = 0;
return shaSuccess;
}
/*
* SHA1Result
*
* Description:
* This function will return the 160-bit message digest into the
* Message_Digest array provided by the caller.
* NOTE: The first octet of hash is stored in the 0th element,
* the last octet of hash in the 19th element.
*
* Parameters:
* context: [in/out]
* The context to use to calculate the SHA-1 hash.
* Message_Digest: [out]
* Where the digest is returned.
*
* Returns:
* sha Error Code.
*
*/
int SHA1Result( SHA1Context *context,
uint8_t Message_Digest[SHA1HashSize])
{
int i;
if (!context || !Message_Digest)
{
return shaNull;
}
if (context->Corrupted)
{
return context->Corrupted;
}
if (!context->Computed)
{
SHA1PadMessage(context);
for(i=0; i<64; ++i)
{
/* message may be sensitive, clear it out */
context->Message_Block[i] = 0;
}
context->Length_Low = 0; /* and clear length */
context->Length_High = 0;
context->Computed = 1;
}
for(i = 0; i < SHA1HashSize; ++i)
{
Message_Digest[i] = context->Intermediate_Hash[i>>2]
>> 8 * ( 3 - ( i & 0x03 ) );
}
return shaSuccess;
}
/*
* SHA1Input
*
* Description:
* This function accepts an array of octets as the next portion
* of the message.
*
* Parameters:
* context: [in/out]
* The SHA context to update
* message_array: [in]
* An array of characters representing the next portion of
* the message.
* length: [in]
* The length of the message in message_array
*
* Returns:
* sha Error Code.
*
*/
int SHA1Input( SHA1Context *context,
const uint8_t *message_array,
unsigned length)
{
if (!length)
{
return shaSuccess;
}
if (!context || !message_array)
{
return shaNull;
}
if (context->Computed)
{
context->Corrupted = shaStateError;
return shaStateError;
}
if (context->Corrupted)
{
return context->Corrupted;
}
while(length-- && !context->Corrupted)
{
context->Message_Block[context->Message_Block_Index++] =
(*message_array & 0xFF);
context->Length_Low += 8;
if (context->Length_Low == 0)
{
context->Length_High++;
if (context->Length_High == 0)
{
/* Message is too long */
context->Corrupted = 1;
}
}
if (context->Message_Block_Index == 64)
{
SHA1ProcessMessageBlock(context);
}
message_array++;
}
return shaSuccess;
}
/*
* SHA1ProcessMessageBlock
*
* Description:
* This function will process the next 512 bits of the message
* stored in the Message_Block array.
*
* Parameters:
* None.
*
* Returns:
* Nothing.
*
* Comments:
* Many of the variable names in this code, especially the
* single character names, were used because those were the
* names used in the publication.
*
*
*/
void SHA1ProcessMessageBlock(SHA1Context *context)
{
const uint32_t K[] = { /* Constants defined in SHA-1 */
0x5A827999,
0x6ED9EBA1,
0x8F1BBCDC,
0xCA62C1D6
};
int t; /* Loop counter */
uint32_t temp; /* Temporary word value */
uint32_t W[80]; /* Word sequence */
uint32_t A, B, C, D, E; /* Word buffers */
/*
* Initialize the first 16 words in the array W
*/
for(t = 0; t < 16; t++)
{
W[t] = context->Message_Block[t * 4] << 24;
W[t] |= context->Message_Block[t * 4 + 1] << 16;
W[t] |= context->Message_Block[t * 4 + 2] << 8;
W[t] |= context->Message_Block[t * 4 + 3];
}
for(t = 16; t < 80; t++)
{
W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
}
A = context->Intermediate_Hash[0];
B = context->Intermediate_Hash[1];
C = context->Intermediate_Hash[2];
D = context->Intermediate_Hash[3];
E = context->Intermediate_Hash[4];
for(t = 0; t < 20; t++)
{
temp = SHA1CircularShift(5,A) +
((B & C) | ((~B) & D)) + E + W[t] + K[0];
E = D;
D = C;
C = SHA1CircularShift(30,B);
B = A;
A = temp;
}
for(t = 20; t < 40; t++)
{
temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1];
E = D;
D = C;
C = SHA1CircularShift(30,B);
B = A;
A = temp;
}
for(t = 40; t < 60; t++)
{
temp = SHA1CircularShift(5,A) +
((B & C) | (B & D) | (C & D)) + E + W[t] + K[2];
E = D;
D = C;
C = SHA1CircularShift(30,B);
B = A;
A = temp;
}
for(t = 60; t < 80; t++)
{
temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3];
E = D;
D = C;
C = SHA1CircularShift(30,B);
B = A;
A = temp;
}
context->Intermediate_Hash[0] += A;
context->Intermediate_Hash[1] += B;
context->Intermediate_Hash[2] += C;
context->Intermediate_Hash[3] += D;
context->Intermediate_Hash[4] += E;
context->Message_Block_Index = 0;
}
/*
* SHA1PadMessage
*
* Description:
* According to the standard, the message must be padded to an even
* 512 bits. The first padding bit must be a '1'. The last 64
* bits represent the length of the original message. All bits in
* between should be 0. This function will pad the message
* according to those rules by filling the Message_Block array
* accordingly. It will also call the ProcessMessageBlock function
* provided appropriately. When it returns, it can be assumed that
* the message digest has been computed.
*
* Parameters:
* context: [in/out]
* The context to pad
* ProcessMessageBlock: [in]
* The appropriate SHA*ProcessMessageBlock function
* Returns:
* Nothing.
*
*/
void SHA1PadMessage(SHA1Context *context)
{
/*
* Check to see if the current message block is too small to hold
* the initial padding bits and length. If so, we will pad the
* block, process it, and then continue padding into a second
* block.
*/
if (context->Message_Block_Index > 55)
{
context->Message_Block[context->Message_Block_Index++] = 0x80;
while(context->Message_Block_Index < 64)
{
context->Message_Block[context->Message_Block_Index++] = 0;
}
SHA1ProcessMessageBlock(context);
while(context->Message_Block_Index < 56)
{
context->Message_Block[context->Message_Block_Index++] = 0;
}
}
else
{
context->Message_Block[context->Message_Block_Index++] = 0x80;
while(context->Message_Block_Index < 56)
{
context->Message_Block[context->Message_Block_Index++] = 0;
}
}
/*
* Store the message length as the last 8 octets
*/
context->Message_Block[56] = context->Length_High >> 24;
context->Message_Block[57] = context->Length_High >> 16;
context->Message_Block[58] = context->Length_High >> 8;
context->Message_Block[59] = context->Length_High;
context->Message_Block[60] = context->Length_Low >> 24;
context->Message_Block[61] = context->Length_Low >> 16;
context->Message_Block[62] = context->Length_Low >> 8;
context->Message_Block[63] = context->Length_Low;
SHA1ProcessMessageBlock(context);
}
static const char alphabet[] = "0123456789ABCDEF";
void SHA1ConvertMessageToString(uint8_t *hash_binary, char* hash_string)
{
for (int i = 0; i != SHA1HashSize; ++i)
{
hash_string[2*i] = alphabet[hash_binary[i] / 16];
hash_string[2*i + 1] = alphabet[hash_binary[i] % 16];
}
hash_string[SHA1HashSize * 2] = '\0';
}

View File

@ -0,0 +1,93 @@
/*
* sha1.h
* Copyright (C) The Internet Society (2001). All Rights Reserved.
* This document and translations of it may be copied and furnished to others,
* and derivative works that comment on or otherwise explain it or assist in its
* implementation may be prepared, copied, published and distributed, in whole or in part,
* without restriction of any kind, provided that the above copyright notice and this paragraph
* are included on all such copies and derivative works. However, this document itself may not
* be modified in any way, such as by removing the copyright notice or references to the Internet Society
* or other Internet organizations, except as needed for the purpose of developing Internet standards in
* which case the procedures for copyrights defined in the Internet Standards process must be followed,
* or as required to translate it into languages other than English.
*
* The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
*
* This document and the information contained herein is provided on an "AS IS" basis and
* THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS
* OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
*
* Description:
* This is the header file for code which implements the Secure
* Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
* April 17, 1995.
*
* Many of the variable names in this code, especially the
* single character names, were used because those were the names
* used in the publication.
*
* Please read the file sha1.c for more information.
*
*/
#ifndef _SHA1_H_
#define _SHA1_H_
#include <stdint.h>
/*
* If you do not have the ISO standard stdint.h header file, then you
* must typdef the following:
* name meaning
* uint32_t unsigned 32 bit integer
* uint8_t unsigned 8 bit integer (i.e., unsigned char)
* int_least16_t integer of >= 16 bits
*
*/
#ifndef _SHA_enum_
#define _SHA_enum_
enum
{
shaSuccess = 0,
shaNull, /* Null pointer parameter */
shaInputTooLong, /* input data too long */
shaStateError /* called Input after Result */
};
#endif
#define SHA1HashSize 20
/*
* This structure will hold context information for the SHA-1
* hashing operation
*/
typedef struct SHA1Context
{
uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */
uint32_t Length_Low; /* Message length in bits */
uint32_t Length_High; /* Message length in bits */
/* Index into message block array */
int_least16_t Message_Block_Index;
uint8_t Message_Block[64]; /* 512-bit message blocks */
int Computed; /* Is the digest computed? */
int Corrupted; /* Is the message digest corrupted? */
} SHA1Context;
/*
* Function Prototypes
*/
int SHA1Reset( SHA1Context *);
int SHA1Input( SHA1Context *,
const uint8_t *,
unsigned int);
int SHA1Result( SHA1Context *,
uint8_t Message_Digest[SHA1HashSize]);
void SHA1ConvertMessageToString(uint8_t *hash_binary, char* hash_string);
#endif

View File

@ -0,0 +1 @@
00095ae1a72ab3dc810014ef908ab286185b86b7

View File

@ -0,0 +1,155 @@
<?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\HelloCpp\*" /eiycq
xcopy "xaml\App.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\MainPage.xaml" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\MainPage.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\EditBox.xaml" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\EditBox.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /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\HelloCpp\*" /eiycq
xcopy "xaml\App.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\MainPage.xaml" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\MainPage.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\EditBox.xaml" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\EditBox.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /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\HelloCpp\*" /eiycq
xcopy "xaml\App.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\MainPage.xaml" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\MainPage.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\EditBox.xaml" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\EditBox.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /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\HelloCpp\*" /eiycq
xcopy "xaml\App.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\MainPage.xaml" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\MainPage.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\EditBox.xaml" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /eiycq
xcopy "xaml\EditBox.xaml.cs" "..\..\..\..\templates\cpp-template-default\proj.wp8-xaml\HelloCpp\*" /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>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -0,0 +1,6 @@
<?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>

View File

@ -0,0 +1,211 @@
/****************************************************************************
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 "CCGLView.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 namespace PhoneDirect3DXamlAppComponent;
USING_NS_CC;
Cocos2dRenderer::Cocos2dRenderer(): mInitialized(false), m_loadingComplete(false), m_delegate(nullptr), m_messageBoxDelegate(nullptr)
{
mApp = new AppDelegate();
}
// 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;
GLView* glview = GLView::create("Test Cpp");
glview->Create(m_eglDisplay, m_eglContext, m_eglSurface, m_renderTargetSize.Width, m_renderTargetSize.Height);
director->setOpenGLView(glview);
CCApplication::getInstance()->run();
glview->SetXamlEventDelegate(m_delegate);
glview->SetXamlMessageBoxDelegate(m_messageBoxDelegate);
glview->SetXamlEditBoxDelegate(m_editBoxDelegate);
}
else
{
cocos2d::GL::invalidateStateCache();
cocos2d::ShaderCache::getInstance()->reloadDefaultShaders();
cocos2d::DrawPrimitives::init();
cocos2d::VolatileTextureMgr::reloadAllTextures();
cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND);
director->setGLDefaultValues();
director->getEventDispatcher()->dispatchEvent(&foregroundEvent);
cocos2d::Application::getInstance()->applicationWillEnterForeground();
}
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();
EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);
Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);
Director::getInstance()->purgeCachedData();
CloseAngle();
m_loadingComplete = false;
}
// save your game state here
IAsyncAction^ Cocos2dRenderer::OnSuspending()
{
return create_async([]() {
// save your game state here
});
}
// user pressed the Back Key on the phone
void Cocos2dRenderer::OnBackKeyPress()
{
// handle the backkey in your app here.
// call Cocos2dEvent::TerminateApp if it is time to exit your app.
// ie. the user is on your first page and wishes to exit your app.
m_delegate->Invoke(Cocos2dEvent::TerminateApp);
}
void Cocos2dRenderer::OnUpdateDevice()
{
GLView* glview = GLView::sharedOpenGLView();
glview->UpdateDevice(m_eglDisplay, m_eglContext, m_eglSurface);
}
void Cocos2dRenderer::OnOrientationChanged(Windows::Graphics::Display::DisplayOrientations orientation)
{
DirectXBase::OnOrientationChanged(orientation);
GLView::sharedOpenGLView()->UpdateOrientation(orientation);
}
// return true if eglSwapBuffers was called by OnRender()
bool Cocos2dRenderer::OnRender()
{
if(m_loadingComplete)
{
GLView* glview = GLView::sharedOpenGLView();
glview->Render();
return true; // eglSwapBuffers was called by glview->Render();
}
return false;
}
void Cocos2dRenderer::OnPointerPressed(PointerEventArgs^ args)
{
GLView::sharedOpenGLView()->OnPointerPressed(args);
}
void Cocos2dRenderer::OnPointerMoved(PointerEventArgs^ args)
{
GLView::sharedOpenGLView()->OnPointerMoved(args);
}
void Cocos2dRenderer::OnPointerReleased(PointerEventArgs^ args)
{
GLView::sharedOpenGLView()->OnPointerReleased(args);
}
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(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate)
{
m_delegate = delegate;
GLView* eglView = GLView::sharedOpenGLView();
if(eglView)
{
eglView->SetXamlEventDelegate(delegate);
}
}
void Cocos2dRenderer::SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate)
{
m_messageBoxDelegate = delegate;
GLView* eglView = GLView::sharedOpenGLView();
if(eglView)
{
eglView->SetXamlMessageBoxDelegate(delegate);
}
}
void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate)
{
m_editBoxDelegate = delegate;
GLView* eglView = GLView::sharedOpenGLView();
if(eglView)
{
eglView->SetXamlEditBoxDelegate(delegate);
}
}

View File

@ -0,0 +1,71 @@
/****************************************************************************
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();
// 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(PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent event);
void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate);
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate);
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate);
void OnPointerPressed(Windows::UI::Core::PointerEventArgs^ args);
void OnPointerMoved(Windows::UI::Core::PointerEventArgs^ args);
void OnPointerReleased(Windows::UI::Core::PointerEventArgs^ args);
Windows::Foundation::IAsyncAction^ OnSuspending();
void OnBackKeyPress();
void Connect();
void Disconnect();
protected:
virtual void OnUpdateDevice() override;
private:
bool m_loadingComplete;
bool mInitialized;
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
// The AppDelegate for the Cocos2D app
AppDelegate* mApp;
};

View File

@ -0,0 +1,65 @@
/****************************************************************************
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 PhoneDirect3DXamlAppComponent;
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);
}

View File

@ -0,0 +1,52 @@
/****************************************************************************
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(PhoneDirect3DXamlAppComponent::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:
PhoneDirect3DXamlAppComponent::Direct3DInterop^ m_controller;
Microsoft::WRL::ComPtr<IDrawingSurfaceRuntimeHostNative> m_host;
};

View File

@ -0,0 +1,214 @@
/****************************************************************************
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"
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;
using namespace PhoneDirect3DXamlAppComponent;
namespace PhoneDirect3DXamlAppComponent
{
Direct3DInterop::Direct3DInterop()
: mCurrentOrientation(DisplayOrientations::Portrait), m_delegate(nullptr)
{
m_renderer = ref new Cocos2dRenderer();
}
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)
{
//m_renderer->SetDevice(device);
return S_OK;
}
void Direct3DInterop::Disconnect()
{
std::lock_guard<std::mutex> guard(mRenderingMutex);
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()
{
std::lock_guard<std::mutex> guard(mMutex);
std::shared_ptr<BackButtonEvent> e(new BackButtonEvent());
mInputEvents.push(e);
}
// Pointer Event Handlers. We need to queue up pointer events to pass them to the drawing thread
void Direct3DInterop::OnPointerPressed(DrawingSurfaceManipulationHost^ sender, PointerEventArgs^ args)
{
AddPointerEvent(PointerEventType::PointerPressed, args);
}
void Direct3DInterop::OnPointerMoved(DrawingSurfaceManipulationHost^ sender, PointerEventArgs^ args)
{
AddPointerEvent(PointerEventType::PointerMoved, args);
}
void Direct3DInterop::OnPointerReleased(DrawingSurfaceManipulationHost^ sender, PointerEventArgs^ args)
{
AddPointerEvent(PointerEventType::PointerReleased, args);
}
void Direct3DInterop::OnCocos2dKeyEvent(Cocos2dKeyEvent key)
{
std::lock_guard<std::mutex> guard(mMutex);
std::shared_ptr<KeyboardEvent> e(new KeyboardEvent(key));
mInputEvents.push(e);
}
void Direct3DInterop::OnCocos2dKeyEvent(Cocos2dKeyEvent key, Platform::String^ text)
{
std::lock_guard<std::mutex> guard(mMutex);
std::shared_ptr<KeyboardEvent> e(new KeyboardEvent(key,text));
mInputEvents.push(e);
}
void Direct3DInterop::AddPointerEvent(PointerEventType type, PointerEventArgs^ args)
{
std::lock_guard<std::mutex> guard(mMutex);
std::shared_ptr<PointerEvent> e(new PointerEvent(type, args));
mInputEvents.push(e);
}
void Direct3DInterop::OnCocos2dEditboxEvent(Object^ sender, Platform::String^ args, Windows::Foundation::EventHandler<Platform::String^>^ handler)
{
std::lock_guard<std::mutex> guard(mMutex);
std::shared_ptr<EditBoxEvent> e(new EditBoxEvent(sender, args, handler));
mInputEvents.push(e);
}
void Direct3DInterop::ProcessEvents()
{
std::lock_guard<std::mutex> guard(mMutex);
while(!mInputEvents.empty())
{
InputEvent* e = mInputEvents.front().get();
e->execute(m_renderer);
mInputEvents.pop();
}
}
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)
{
std::lock_guard<std::mutex> guard(mRenderingMutex);
m_renderer->UpdateDevice(device, context, renderTargetView);
#if 0
if(mCurrentOrientation != WindowOrientation)
{
mCurrentOrientation = WindowOrientation;
m_renderer->OnOrientationChanged(mCurrentOrientation);
}
#endif // 0
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);
}
bool Direct3DInterop::SendCocos2dEvent(Cocos2dEvent event)
{
if(m_delegate)
{
m_delegate->Invoke(event);
return true;
}
return false;
}
}

View File

@ -0,0 +1,102 @@
/****************************************************************************
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 PhoneDirect3DXamlAppComponent
{
public delegate void RequestAdditionalFrameHandler();
[Windows::Foundation::Metadata::WebHostHidden]
public ref class Direct3DInterop sealed : public Windows::Phone::Input::Interop::IDrawingSurfaceManipulationHandler
{
public:
Direct3DInterop();
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(Object^ sender, Platform::String^ args, Windows::Foundation::EventHandler<Platform::String^>^ handler);
property Windows::Graphics::Display::DisplayOrientations WindowOrientation;
property Windows::Foundation::Size WindowBounds;
void SetCocos2dEventDelegate(Cocos2dEventDelegate^ delegate);
void SetCocos2dMessageBoxDelegate(Cocos2dMessageBoxDelegate ^ delegate);
void SetCocos2dEditBoxDelegate(Cocos2dEditBoxDelegate ^ 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:
void ProcessEvents();
void AddPointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
Cocos2dRenderer^ m_renderer;
Windows::Graphics::Display::DisplayOrientations mCurrentOrientation;
std::queue<std::shared_ptr<InputEvent>> mInputEvents;
std::mutex mMutex;
std::mutex mRenderingMutex;
Cocos2dEventDelegate^ m_delegate;
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
};
}

View File

@ -0,0 +1,322 @@
/****************************************************************************
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"
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()
{
if(m_eglDisplay && m_eglSurface)
{
eglDestroySurface(m_eglDisplay, m_eglSurface);
m_eglSurface = nullptr;
}
if(m_eglDisplay && m_eglContext)
{
eglDestroyContext(m_eglDisplay, m_eglContext);
m_eglContext = nullptr;
}
if(m_eglDisplay)
{
eglTerminate(m_eglDisplay);
m_eglDisplay = nullptr;
}
if(m_eglPhoneWindow != nullptr)
{
m_eglPhoneWindow->Update(nullptr, nullptr, nullptr);
}
eglMakeCurrent(NULL, NULL, NULL, NULL);
if(m_device)
{
m_device->Release();
m_device = nullptr;
}
#if 0
m_eglPhoneWindow = nullptr;
m_eglWindow = nullptr;
#endif // 0
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);
if(m_eglWindow == nullptr)
{ DX::ThrowIfFailed(
CreateWinrtEglWindow(m_eglPhoneWindow.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;
}

View File

@ -0,0 +1,80 @@
/****************************************************************************
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 "DirectXHelper.h"
#include "CCGL.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;
};

View File

@ -0,0 +1,47 @@
/****************************************************************************
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);
}
}
}

View File

@ -0,0 +1,48 @@
/****************************************************************************
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 PhoneDirect3DXamlAppComponent
{
EditBoxEvent::EditBoxEvent( Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler<Platform::String^>^ handle ):
m_sender(sender),
m_args(arg),
m_handler(handle)
{
}
void EditBoxEvent::execute( Cocos2dRenderer ^ renderer )
{
if(m_handler.Get())
{
m_handler.Get()->Invoke(m_sender.Get(), m_args.Get());
}
}
}

View File

@ -0,0 +1,48 @@
/****************************************************************************
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 "platform/wp8-xaml/cpp/InputEvent.h"
#include <agile.h>
namespace PhoneDirect3DXamlAppComponent
{
class EditBoxEvent : public InputEvent
{
public:
EditBoxEvent(Platform::Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler<Platform::String^>^ handle);
virtual void execute(Cocos2dRenderer ^ renderer);
private:
Platform::Agile<Platform::Object^> m_sender;
Platform::Agile<Platform::String^> m_args;
Platform::Agile<Windows::Foundation::EventHandler<Platform::String^>^> m_handler;
};
}
#endif

View File

@ -0,0 +1,92 @@
/****************************************************************************
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 "InputEvent.h"
#include "Cocos2dRenderer.h"
namespace PhoneDirect3DXamlAppComponent
{
PointerEvent::PointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args)
: m_type(type), m_args(args)
{
}
void PointerEvent::execute(Cocos2dRenderer ^ renderer)
{
switch(m_type)
{
case PointerEventType::PointerPressed:
renderer->OnPointerPressed(m_args.Get());
break;
case PointerEventType::PointerMoved:
renderer->OnPointerMoved(m_args.Get());
break;
case PointerEventType::PointerReleased:
renderer->OnPointerReleased(m_args.Get());
break;
}
}
KeyboardEvent::KeyboardEvent(Cocos2dKeyEvent type)
: m_type(type), m_text(nullptr)
{
}
KeyboardEvent::KeyboardEvent(Cocos2dKeyEvent type, Platform::String^ text)
: m_type(type), m_text(text)
{
}
void KeyboardEvent::execute(Cocos2dRenderer ^ renderer)
{
switch(m_type)
{
case Cocos2dKeyEvent::Text:
renderer->OnKeyPressed(m_text.Get());
break;
default:
renderer->OnCocos2dKeyEvent(m_type);
break;
}
}
BackButtonEvent::BackButtonEvent()
{
}
void BackButtonEvent::execute(Cocos2dRenderer ^ renderer)
{
renderer->OnBackKeyPress();
}
}

View File

@ -0,0 +1,96 @@
/****************************************************************************
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.
****************************************************************************/
#ifndef __INPUT_EVENT__
#define __INPUT_EVENT__
#include "InputEventTypes.h"
#include <agile.h>
ref class Cocos2dRenderer;
namespace PhoneDirect3DXamlAppComponent
{
public delegate void Cocos2dEventDelegate(Cocos2dEvent event);
public delegate void Cocos2dMessageBoxDelegate(Platform::String^ title, Platform::String^ text);
public delegate void Cocos2dEditBoxDelegate(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler);
enum PointerEventType
{
PointerPressed,
PointerMoved,
PointerReleased,
};
class InputEvent
{
public:
InputEvent() {};
virtual ~InputEvent() {};
virtual void execute(Cocos2dRenderer^ renderer) = 0;
};
class PointerEvent : public InputEvent
{
public:
PointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
virtual void execute(Cocos2dRenderer ^ renderer);
private:
PointerEventType m_type;
Platform::Agile<Windows::UI::Core::PointerEventArgs> m_args;
};
class KeyboardEvent : public InputEvent
{
public:
KeyboardEvent(Cocos2dKeyEvent type);
KeyboardEvent(Cocos2dKeyEvent type, Platform::String^ text);
virtual void execute(Cocos2dRenderer ^ renderer);
private:
Cocos2dKeyEvent m_type;
Platform::Agile<Platform::String> m_text;
};
class BackButtonEvent : public InputEvent
{
public:
BackButtonEvent();
virtual void execute(Cocos2dRenderer ^ renderer);
};
}
#endif // #ifndef __INPUT_EVENT__

View File

@ -0,0 +1,52 @@
/****************************************************************************
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.
****************************************************************************/
#ifndef __INPUT_EVENT_TYPES__
#define __INPUT_EVENT_TYPES__
namespace PhoneDirect3DXamlAppComponent
{
public enum class Cocos2dEvent
{
ShowKeyboard,
HideKeyboard,
TerminateApp
};
public enum class Cocos2dKeyEvent : int
{
Text,
Escape,
Back,
Enter
};
}
#endif // #ifndef __INPUT_EVENT_TYPES__

View File

@ -0,0 +1,20 @@
<Application
x:Class="PhoneDirect3DXamlAppInterop.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:PhoneDirect3DXamlAppInterop" 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>

View File

@ -0,0 +1,169 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
namespace PhoneDirect3DXamlAppInterop
{
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 PhoneApplicationFrame RootFrame { get; private set; }
/// <summary>
/// Constructor for the Application object.
/// </summary>
public App()
{
// Global handler for uncaught exceptions.
UnhandledException += Application_UnhandledException;
// Standard Silverlight initialization
InitializeComponent();
// Phone-specific initialization
InitializePhoneApplication();
// Show graphics profiling information while debugging.
if (System.Diagnostics.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;
// Disable the application idle detection by setting the UserIdleDetectionMode property of the
// application's PhoneApplicationService object to Disabled.
// 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)
{
}
// 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)
{
}
// 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)
{
}
// 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)
{
}
// Code to execute if a navigation fails
private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
if (System.Diagnostics.Debugger.IsAttached)
{
// A navigation has failed; break into the debugger
System.Diagnostics.Debugger.Break();
}
}
// Code to execute on Unhandled Exceptions
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
if (System.Diagnostics.Debugger.IsAttached)
{
// An unhandled exception has occurred; break into the debugger
System.Diagnostics.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;
// Ensure we don't initialize again
phoneApplicationInitialized = true;
}
// 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) navigations
if (e.NavigationMode != NavigationMode.New)
return;
// For UI consistency, clear the entire page stack
while (RootFrame.RemoveBackEntry() != null)
{
; // do nothing
}
}
#endregion
}
}

View File

@ -0,0 +1,20 @@
<UserControl x:Class="PhoneDirect3DXamlAppInterop.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>

View File

@ -0,0 +1,191 @@
/****************************************************************************
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 PhoneDirect3DXamlAppComponent;
using System.Windows.Media;
using System.Windows.Input;
namespace PhoneDirect3DXamlAppInterop
{
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;
}
}
}

View File

@ -0,0 +1,28 @@
<phone:PhoneApplicationPage
x:Class="PhoneDirect3DXamlAppInterop.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>

View File

@ -0,0 +1,202 @@
#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 PhoneDirect3DXamlAppComponent;
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;
namespace PhoneDirect3DXamlAppInterop
{
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
}
private void DrawingSurfaceBackground_Loaded(object sender, RoutedEventArgs e)
{
if (m_d3dInterop == null)
{
m_d3dInterop = new Direct3DInterop();
// 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);
}
}
// 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)
{
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)
{
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.MaxLength = 1;
m_textBox.KeyDown += OnKeyDown;
m_textBox.KeyUp += OnKeyUp;
DrawingSurfaceBackground.Children.Add(m_textBox);
}
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);
}
}
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 pages 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;
}
}
}
}

View File

@ -0,0 +1,508 @@
/****************************************************************************
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 "CCGLView.h"
#include "CCSet.h"
#include "ccMacros.h"
#include "CCDirector.h"
#include "CCTouch.h"
#include "CCIMEDispatcher.h"
#include "CCApplication.h"
#include "CCWinRTUtils.h"
#include "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;
using namespace PhoneDirect3DXamlAppComponent;
NS_CC_BEGIN
static GLView* s_pEglView = NULL;
GLView* GLView::create(const std::string& viewName)
{
auto ret = new GLView;
if(ret && ret->initWithFullScreen(viewName))
{
ret->autorelease();
return ret;
}
return nullptr;
}
GLView::GLView()
: _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";
UpdateOrientationMatrix();
}
GLView::~GLView()
{
CC_ASSERT(this == s_pEglView);
s_pEglView = NULL;
// TODO: cleanup
}
bool GLView::initWithRect(const std::string& viewName, Rect rect, float frameZoomFactor)
{
setViewName(viewName);
setFrameSize(rect.size.width, rect.size.height);
setFrameZoomFactor(frameZoomFactor);
return true;
}
bool GLView::initWithFullScreen(const std::string& viewName)
{
return initWithRect(viewName, Rect(0, 0, m_width, m_height), 1.0f);
}
bool GLView::Create(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface, float width, float height)
{
m_eglDisplay = eglDisplay;
m_eglContext = eglContext;
m_eglSurface = eglSurface;
UpdateForWindowSizeChange(width, height);
return true;
}
void GLView::UpdateDevice(EGLDisplay eglDisplay, EGLContext eglContext, EGLSurface eglSurface)
{
m_eglDisplay = eglDisplay;
m_eglContext = eglContext;
m_eglSurface = eglSurface;
//UpdateForWindowSizeChange(width, height);
}
void GLView::setIMEKeyboardState(bool bOpen)
{
if(m_delegate)
{
if(bOpen)
{
m_delegate->Invoke(Cocos2dEvent::ShowKeyboard);
}
else
{
m_delegate->Invoke(Cocos2dEvent::HideKeyboard);
}
}
}
void GLView::swapBuffers()
{
eglSwapBuffers(m_eglDisplay, m_eglSurface);
}
bool GLView::isOpenGLReady()
{
// TODO: need to revisit this
return (m_eglDisplay && m_orientation != DisplayOrientations::None);
}
void GLView::end()
{
m_windowClosed = true;
}
void GLView::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args)
{
}
void GLView::OnResuming(Platform::Object^ sender, Platform::Object^ args)
{
}
void GLView::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args)
{
OnPointerPressed(args);
}
void GLView::OnPointerPressed(PointerEventArgs^ args)
{
int id = args->CurrentPoint->PointerId;
Point pt = GetPoint(args);
handleTouchesBegin(1, &id, &pt.x, &pt.y);
}
void GLView::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args)
{
float direction = (float)args->CurrentPoint->Properties->MouseWheelDelta;
int id = 0;
Point 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 GLView::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
{
m_windowVisible = args->Visible;
}
void GLView::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
{
m_windowClosed = true;
}
void GLView::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args)
{
OnPointerMoved(args);
}
void GLView::OnPointerMoved( PointerEventArgs^ args)
{
auto currentPoint = args->CurrentPoint;
if (currentPoint->IsInContact)
{
if (m_lastPointValid)
{
int id = args->CurrentPoint->PointerId;
Point p = GetPoint(args);
handleTouchesMove(1, &id, &p.x, &p.y);
}
m_lastPoint = currentPoint->Position;
m_lastPointValid = true;
}
else
{
m_lastPointValid = false;
}
}
void GLView::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args)
{
OnPointerReleased(args);
}
void GLView::OnPointerReleased(PointerEventArgs^ args)
{
int id = args->CurrentPoint->PointerId;
Point pt = GetPoint(args);
handleTouchesEnd(1, &id, &pt.x, &pt.y);
}
void GLView::resize(int width, int height)
{
}
void GLView::setFrameZoomFactor(float fZoomFactor)
{
_frameZoomFactor = fZoomFactor;
Director::getInstance()->setProjection(Director::getInstance()->getProjection());
//resize(m_obScreenSize.width * fZoomFactor, m_obScreenSize.height * fZoomFactor);
}
float GLView::getFrameZoomFactor()
{
return _frameZoomFactor;
}
void GLView::centerWindow()
{
// not implemented in WinRT. Window is always full screen
}
GLView* GLView::sharedOpenGLView()
{
return s_pEglView;
}
int GLView::Run()
{
// XAML version does not have a run loop
m_running = true;
return 0;
};
void GLView::Render()
{
OnRendering();
}
void GLView::OnRendering()
{
if(m_running && m_initialized)
{
Director::getInstance()->mainLoop();
}
}
bool GLView::ShowMessageBox(Platform::String^ title, Platform::String^ message)
{
if(m_messageBoxDelegate)
{
m_messageBoxDelegate->Invoke(title, message);
return true;
}
return false;
}
bool GLView::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 GLView::UpdateOrientation(DisplayOrientations orientation)
{
if(m_orientation != orientation)
{
m_orientation = orientation;
UpdateWindowSize();
}
}
// called by size change from WP8 XAML
void GLView::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 GLView::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;
GLViewProtocol::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 kmMat4* GLView::getOrientationMatrix() const
{
const kmMat4* k = &m_orientationMatrix;
return &m_orientationMatrix;
};
void GLView::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::Point GLView::TransformToOrientation(Windows::Foundation::Point p)
{
cocos2d::Point returnValue;
float x = p.X;
float y = p.Y;
switch (m_orientation)
{
case DisplayOrientations::Portrait:
default:
returnValue = Point(x, y);
break;
case DisplayOrientations::Landscape:
returnValue = Point(y, m_width - x);
break;
case DisplayOrientations::PortraitFlipped:
returnValue = Point(m_width - x, m_height - y);
break;
case DisplayOrientations::LandscapeFlipped:
returnValue = Point(m_height - y, x);
break;
}
float zoomFactor = GLView::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;
}
Point GLView::GetPoint(PointerEventArgs^ args) {
return TransformToOrientation(args->CurrentPoint->Position);
}
void GLView::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 GLView::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));
}
}
NS_CC_END

View File

@ -0,0 +1,172 @@
/****************************************************************************
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_EGLVIEW_WINRT_H__
#define __CC_EGLVIEW_WINRT_H__
#include "CCStdC.h"
#include "platform/CCCommon.h"
#include "CCGeometry.h"
#include "platform/CCGLViewProtocol.h"
#include <agile.h>
#include <wrl/client.h>
#include <d3d11_1.h>
#include <agile.h>
#include <DirectXMath.h>
#include "kazmath/mat4.h"
#include "../wp8-xaml/cpp/InputEvent.h"
#include <EGL/egl.h>
NS_CC_BEGIN
class GLView;
class CC_DLL GLView : public Ref, public GLViewProtocol
{
public:
static GLView* 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 kmMat4* getOrientationMatrix() const;
const kmMat4* getReverseOrientationMatrix () const {return &m_reverseOrientationMatrix;};
Windows::Graphics::Display::DisplayOrientations getDeviceOrientation() {return m_orientation;};
virtual void setIMEKeyboardState(bool bOpen);
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);
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 SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate) { m_delegate = delegate; };
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; };
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::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 GLView* sharedOpenGLView();
protected:
GLView();
virtual ~GLView();
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(GLView);
void OnRendering();
void UpdateWindowSize();
void UpdateOrientationMatrix();
cocos2d::Point TransformToOrientation(Windows::Foundation::Point point);
cocos2d::Point 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;
kmMat4 m_orientationMatrix;
kmMat4 m_reverseOrientationMatrix;
bool m_running;
bool m_initialized;
Microsoft::WRL::ComPtr<IWinrtEglWindow> m_eglWindow;
EGLDisplay m_eglDisplay;
EGLContext m_eglContext;
EGLSurface m_eglSurface;
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
};
NS_CC_END
#endif // end of __CC_EGLVIEW_WINRT_H__

View File

@ -0,0 +1,359 @@
#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;
}

View File

@ -0,0 +1,56 @@
#pragma once
#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;
};

View File

@ -0,0 +1,278 @@
#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();
}
}

Some files were not shown because too many files have changed in this diff Show More