diff --git a/build/cocos2d-win10.sln b/build/cocos2d-win10.sln
new file mode 100644
index 0000000000..07f54c2bc2
--- /dev/null
+++ b/build/cocos2d-win10.sln
@@ -0,0 +1,123 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.22823.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{17093B03-00CA-402F-981A-D8C84B2922B5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos\editor-support\spine\proj.win10\libSpine.vcxproj", "{4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbox2d", "..\external\Box2D\proj-win10\libbox2d.vcxproj", "{0C32D479-46D5-46C3-9AA9-0A8FF8320516}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\cocos\2d\libcocos2d_win10\libcocos2d.vcxproj", "{07C2895D-720C-487D-B7B4-12C293EA533F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-empty-test", "..\tests\cpp-empty-test\proj.win10\cpp-empty-test.vcxproj", "{87ED86E7-A850-433F-88D5-D5F65CFF7BF5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-tests", "..\tests\cpp-tests\proj.win10\cpp-tests.vcxproj", "{C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbullet", "..\external\bullet\proj.win10\libbullet.vcxproj", "{ECEE1119-CE2E-4F7E-83A8-1932EA48E893}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|ARM = Release|ARM
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|ARM.ActiveCfg = Debug|ARM
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|ARM.Build.0 = Debug|ARM
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x64.ActiveCfg = Debug|x64
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x64.Build.0 = Debug|x64
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x86.ActiveCfg = Debug|Win32
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Debug|x86.Build.0 = Debug|Win32
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|ARM.ActiveCfg = Release|ARM
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|ARM.Build.0 = Release|ARM
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x64.ActiveCfg = Release|x64
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x64.Build.0 = Release|x64
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x86.ActiveCfg = Release|Win32
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8}.Release|x86.Build.0 = Release|Win32
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|ARM.ActiveCfg = Debug|ARM
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|ARM.Build.0 = Debug|ARM
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x64.ActiveCfg = Debug|x64
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x64.Build.0 = Debug|x64
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x86.ActiveCfg = Debug|Win32
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Debug|x86.Build.0 = Debug|Win32
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|ARM.ActiveCfg = Release|ARM
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|ARM.Build.0 = Release|ARM
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x64.ActiveCfg = Release|x64
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x64.Build.0 = Release|x64
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x86.ActiveCfg = Release|Win32
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516}.Release|x86.Build.0 = Release|Win32
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|ARM.ActiveCfg = Debug|ARM
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|ARM.Build.0 = Debug|ARM
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x64.ActiveCfg = Debug|x64
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x64.Build.0 = Debug|x64
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x86.ActiveCfg = Debug|Win32
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Debug|x86.Build.0 = Debug|Win32
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Release|ARM.ActiveCfg = Release|ARM
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Release|ARM.Build.0 = Release|ARM
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x64.ActiveCfg = Release|x64
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x64.Build.0 = Release|x64
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x86.ActiveCfg = Release|Win32
+ {07C2895D-720C-487D-B7B4-12C293EA533F}.Release|x86.Build.0 = Release|Win32
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|ARM.ActiveCfg = Debug|ARM
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|ARM.Build.0 = Debug|ARM
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|ARM.Deploy.0 = Debug|ARM
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x64.ActiveCfg = Debug|x64
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x64.Build.0 = Debug|x64
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x64.Deploy.0 = Debug|x64
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x86.ActiveCfg = Debug|Win32
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x86.Build.0 = Debug|Win32
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Debug|x86.Deploy.0 = Debug|Win32
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|ARM.ActiveCfg = Release|ARM
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|ARM.Build.0 = Release|ARM
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|ARM.Deploy.0 = Release|ARM
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x64.ActiveCfg = Release|x64
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x64.Build.0 = Release|x64
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x64.Deploy.0 = Release|x64
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x86.ActiveCfg = Release|Win32
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x86.Build.0 = Release|Win32
+ {87ED86E7-A850-433F-88D5-D5F65CFF7BF5}.Release|x86.Deploy.0 = Release|Win32
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|ARM.ActiveCfg = Debug|ARM
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|ARM.Build.0 = Debug|ARM
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|ARM.Deploy.0 = Debug|ARM
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x64.ActiveCfg = Debug|x64
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x64.Build.0 = Debug|x64
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x64.Deploy.0 = Debug|x64
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x86.ActiveCfg = Debug|Win32
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x86.Build.0 = Debug|Win32
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Debug|x86.Deploy.0 = Debug|Win32
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|ARM.ActiveCfg = Release|ARM
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|ARM.Build.0 = Release|ARM
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|ARM.Deploy.0 = Release|ARM
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x64.ActiveCfg = Release|x64
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x64.Build.0 = Release|x64
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x64.Deploy.0 = Release|x64
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x86.ActiveCfg = Release|Win32
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x86.Build.0 = Release|Win32
+ {C1307B42-D00A-4B88-BCDD-0A16A81FF4C1}.Release|x86.Deploy.0 = Release|Win32
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|ARM.ActiveCfg = Debug|ARM
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|ARM.Build.0 = Debug|ARM
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x64.ActiveCfg = Debug|x64
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x64.Build.0 = Debug|x64
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x86.ActiveCfg = Debug|Win32
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Debug|x86.Build.0 = Debug|Win32
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|ARM.ActiveCfg = Release|ARM
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|ARM.Build.0 = Release|ARM
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x64.ActiveCfg = Release|x64
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x64.Build.0 = Release|x64
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x86.ActiveCfg = Release|Win32
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {4B3BA10A-941F-4E08-8A50-8A7FCB822BB8} = {17093B03-00CA-402F-981A-D8C84B2922B5}
+ {0C32D479-46D5-46C3-9AA9-0A8FF8320516} = {17093B03-00CA-402F-981A-D8C84B2922B5}
+ {ECEE1119-CE2E-4F7E-83A8-1932EA48E893} = {17093B03-00CA-402F-981A-D8C84B2922B5}
+ EndGlobalSection
+EndGlobal
diff --git a/cocos/2d/MarchingSquare.cpp b/cocos/2d/MarchingSquare.cpp
index 773e51e7e8..b59b1502d6 100644
--- a/cocos/2d/MarchingSquare.cpp
+++ b/cocos/2d/MarchingSquare.cpp
@@ -257,8 +257,8 @@ void MarchingSquare::marchSquare(int startx, int starty)
{
//TODO: we triangulation cannot work collineer points, so we need to modify same point a little
//TODO: maybe we can detect if we go into a hole and coming back the hole, we should extract those points and remove them
- points.back().x -= 0.00001;
- points.back().y -= 0.00001;
+ points.back().x -= 0.00001f;
+ points.back().y -= 0.00001f;
points.push_back(Vec2((float)curx, (float)height-cury)/ scaleFactor);
}
else{
diff --git a/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj
new file mode 100644
index 0000000000..a6df06194a
--- /dev/null
+++ b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj
@@ -0,0 +1,1616 @@
+
+
+
+
+ Debug
+ ARM
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ ARM
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+ NotUsing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create
+ Create
+ Create
+ Create
+ Create
+ Create
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {ecee1119-ce2e-4f7e-83a8-1932ea48e893}
+
+
+
+ {07c2895d-720c-487d-b7b4-12c293ea533f}
+ DynamicLibrary
+ libcocos2d
+ libcocos2d
+ en-US
+ 14.0
+ true
+ Windows Store
+ 8.2
+ 10.0.10069.0
+ 10.0.10069.0
+
+
+
+ DynamicLibrary
+ true
+ v140
+
+
+ DynamicLibrary
+ true
+ v140
+
+
+ DynamicLibrary
+ true
+ v140
+
+
+ DynamicLibrary
+ false
+ true
+ v140
+
+
+ DynamicLibrary
+ false
+ true
+ v140
+
+
+ DynamicLibrary
+ false
+ true
+ v140
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ false
+ libcocos2d_v3.7_Windows_10.0
+
+
+ false
+ false
+ libcocos2d_v3.7_Windows_10.0
+
+
+ false
+ false
+ false
+ libcocos2d_v3.7_Windows_10.0
+
+
+ false
+ false
+ false
+ libcocos2d_v3.7_Windows_10.0
+
+
+ false
+ false
+ libcocos2d_v3.7_Windows_10.0
+
+
+ false
+ false
+ libcocos2d_v3.7_Windows_10.0
+
+
+
+ Use
+ true
+ pch.h
+ _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)
+ false
+ 4458;4459;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)
+ /Zm384 /bigobj %(AdditionalOptions)
+ ProgramDatabase
+
+
+ Console
+ false
+ false
+
+
+
+
+ Use
+ true
+ pch.h
+ _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions)
+ false
+ 4458;4459;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)
+ /Zm384 /bigobj %(AdditionalOptions)
+ false
+
+
+ Console
+ false
+ false
+
+
+
+
+
+ Use
+ true
+ pch.h
+ _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)
+ false
+ 4458;4459;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)
+ /Zm384 /bigobj %(AdditionalOptions)
+ ProgramDatabase
+
+
+ Console
+ false
+ false
+
+
+
+
+ Use
+ true
+ pch.h
+ _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions)
+ false
+ 4458;4459;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)
+ /Zm384 /bigobj %(AdditionalOptions)
+ false
+ ProgramDatabase
+
+
+ Console
+ false
+ false
+
+
+
+
+
+ Use
+ true
+ pch.h
+ _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)
+ false
+ 4458;4459;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)
+ /Zm384 /bigobj %(AdditionalOptions)
+ EditAndContinue
+
+
+ Console
+ false
+ false
+
+
+
+
+ Use
+ true
+ pch.h
+ _USRDLL;_LIB;COCOS2DXWIN32_EXPORTS;_USE3DDLL;_EXPORT_DLL_;_USRSTUDIODLL;_USREXDLL;_USEGUIDLL;CC_ENABLE_CHIPMUNK_INTEGRATION=1;CC_ENABLE_BULLET_INTEGRATION=1;%(PreprocessorDefinitions)
+ false
+ 4458;4459;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\zlib\include;$(EngineRoot)external\freetype2\include\win10\freetype2;$(EngineRoot)external\protobuf-lite\src;$(EngineRoot)external\protobuf-lite\win32;%(AdditionalIncludeDirectories)
+ /Zm384 /bigobj %(AdditionalOptions)
+ false
+
+
+ Console
+ false
+ false
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters
new file mode 100644
index 0000000000..c79856b76e
--- /dev/null
+++ b/cocos/2d/libcocos2d_win10/libcocos2d.vcxproj.filters
@@ -0,0 +1,3862 @@
+
+
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms
+
+
+ {7a1f75b9-e286-444c-9469-0cf18caf9851}
+
+
+ {0fee395c-63c7-44c6-a4f4-1f36e2c87bb8}
+
+
+ {50c0af16-c916-4fa8-9fa2-b86e38449e26}
+
+
+ {5aeb6e4f-9e25-4b88-b583-fa11189743a0}
+
+
+ {cfeb83ba-f330-49a3-a32f-4360729feb34}
+
+
+ {48ef00ff-acc8-4c9c-a6e4-00d72e737ad2}
+
+
+ {f2236b85-0526-49e2-a18c-ac4951062666}
+
+
+ {33f548c2-d835-4404-9e44-ad1511588c8e}
+
+
+ {26495053-242d-4ec8-bf5a-6ea6f5ac4000}
+
+
+ {94bbb957-b493-45d2-9f5a-753ac1ab78ce}
+
+
+ {a2141e87-a561-433e-905b-63ff5c4e0e6e}
+
+
+ {661c905d-7ec2-4161-8b09-1c22ddefb830}
+
+
+ {6b13d475-62b0-4d73-8cee-52f077aa3fe7}
+
+
+ {33af945f-9ffb-4e87-9467-7774d4cbaaee}
+
+
+ {abb46246-b4f9-4ad0-8db8-11b47ce43a1f}
+
+
+ {e779fbed-6102-4689-81bd-57b2e70b0f26}
+
+
+ {769e8f33-4eef-4d34-a192-6113354d584f}
+
+
+ {2775a689-9303-4568-8bdd-85793c152dc0}
+
+
+ {d58e753e-e7d1-49ea-970a-4e980b04cffa}
+
+
+ {9ec27523-fcde-48f7-8f77-34e2f2c51d3d}
+
+
+ {e7a997f1-97ef-408f-9455-132da617f439}
+
+
+ {b7fa88eb-4dd8-4476-89b3-665a128ecd49}
+
+
+ {84e54bc0-68a3-4466-b64b-147525501276}
+
+
+ {1c30324c-b033-419a-b0bc-fcd04bf5e887}
+
+
+ {5f24927a-be4e-43d4-bfa6-19a11c86ba74}
+
+
+ {b4dfd33e-325a-45e5-b5c4-bc759a765944}
+
+
+ {1adc7897-87b2-4fa2-9de1-a662bbc0cef2}
+
+
+ {8f07e318-d877-4880-834e-0e5a36759148}
+
+
+ {47260f4a-f9ab-4801-8a7f-5610755592f6}
+
+
+ {69e44658-eabe-4434-bc55-09ba8fc18a65}
+
+
+ {0a31f1b5-366b-4b0e-b998-6eee00a5e232}
+
+
+ {c2ef43b9-5a8e-4810-9430-31427c61cd57}
+
+
+ {377b23e6-4800-4305-b6de-7ffd6ab75445}
+
+
+ {3629c3cd-b691-403d-bec6-6915a63304bd}
+
+
+ {46c2c273-aa0e-4bc5-8eea-3aa512372d3a}
+
+
+ {09f711eb-3ba4-447e-85a0-b2b5ebb40328}
+
+
+ {ed4442ff-0420-424c-bbfa-720b8ab658d0}
+
+
+ {e6726a08-977a-4d22-b4b4-4e8c5aa75c80}
+
+
+ {33cb6b93-333c-4f05-bc0b-e17ac95abdf9}
+
+
+ {e74ad41e-c739-4e66-8b54-15914b651f1b}
+
+
+ {e6a2d595-06dc-436f-b5d7-57e8852f800e}
+
+
+ {5b4d4e9c-90de-496a-9897-930e48c96052}
+
+
+ {f711caa7-1c16-43ec-8f2e-92438bfdd92d}
+
+
+ {9b4e1b59-dc28-49aa-9b93-05ae39afeef4}
+
+
+ {566aad08-9d43-48ff-99a0-3f4a8e6cfa23}
+
+
+ {ebca298d-3724-42b8-923f-934f2df267de}
+
+
+ {2e9af99e-c268-459a-9615-9f3c5b58efdc}
+
+
+ {cdcb5464-cce7-4252-9fa9-0113c6f88731}
+
+
+ {6ba31aca-4ffb-4c7f-86b3-68c686e9e83a}
+
+
+ {12508884-4921-4027-9e3f-0afcc4d51b18}
+
+
+ {d28da99a-5849-465a-a1ef-a39f13b8d71b}
+
+
+ {5c9216f7-37c5-45a7-abd5-0f91ab126e78}
+
+
+ {efebb9af-0744-4d20-947b-a118679860ba}
+
+
+ {c67477ac-753e-48da-9f7c-2044d8d3561c}
+
+
+ {b96929a6-1068-4e34-ba12-9b1506c52029}
+
+
+ {2b9df357-22d4-4fd0-b797-a9bfb25a2f49}
+
+
+ {cd711175-67df-4a15-bc83-c13422334b46}
+
+
+ {2520090a-69d8-46d3-a958-de49c068035c}
+
+
+ {21031d69-8a1d-468a-98d7-2c3080705ab3}
+
+
+ {b666aa35-1920-44d0-8311-86e80b7a010a}
+
+
+ {21d16309-93ee-4b38-a10a-de87be25dcc9}
+
+
+ {939431be-589b-461b-a4dd-791ad66e9611}
+
+
+ {00ac48e4-fa60-4020-b924-18562a81d799}
+
+
+ {593b7ac7-693d-4a46-ab32-e0203004e865}
+
+
+ {6651f0d8-3685-457c-9674-91ba9c2bde9b}
+
+
+ {922ba080-bc7b-4493-b12a-2ccf5ccc3d68}
+
+
+ {7bfc1d7e-a562-4ef8-82f0-af7c5f9ec004}
+
+
+ {fff4ac28-7649-4202-85ee-4fc22b4de31b}
+
+
+ {d0b5ce80-dfff-44b8-8ca0-c01ec18c3983}
+
+
+ {8d2b7057-43b4-41e4-a752-0cfc20b1c825}
+
+
+ {1715f2ff-18ed-405a-a0b7-1bb7fc7968de}
+
+
+ {7a8dbff0-49af-4a9e-af07-7ecc643cf7d0}
+
+
+ {287c8ea7-54ab-4514-94ad-bc60fca8e2f6}
+
+
+ {f8e329a2-40aa-428b-b111-3b788023c5e0}
+
+
+ {0a443764-b762-4858-b578-114bfc5d7ab5}
+
+
+ {6fcf3801-c3e1-4097-ba82-3da0a6599555}
+
+
+ {acb13cf1-4b21-4392-826a-0ca62db8afe9}
+
+
+ {92cd288c-1327-4990-8ae2-dab11fa3a69c}
+
+
+ {bc47263f-0690-488e-b240-0b7bf763f401}
+
+
+ {5937896e-882c-429a-ada7-72c799c06920}
+
+
+ {f68e83b4-2fa3-4f47-9864-e7dfd90c16a6}
+
+
+
+
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base\allocator
+
+
+ base\allocator
+
+
+ base\allocator
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosdenshion\winrt
+
+
+ cocosdenshion\winrt
+
+
+ cocosdenshion\winrt
+
+
+ cocostudio\action
+
+
+ cocostudio\action
+
+
+ cocostudio\action
+
+
+ cocostudio\action
+
+
+ cocostudio\action
+
+
+ cocostudio\armature
+
+
+ cocostudio\armature
+
+
+ cocostudio\armature\animation
+
+
+ cocostudio\armature\animation
+
+
+ cocostudio\armature\animation
+
+
+ cocostudio\armature\datas
+
+
+ cocostudio\armature\display
+
+
+ cocostudio\armature\display
+
+
+ cocostudio\armature\display
+
+
+ cocostudio\armature\display
+
+
+ cocostudio\armature\display
+
+
+ cocostudio\armature\physics
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\components
+
+
+ cocostudio\components
+
+
+ cocostudio\components
+
+
+ cocostudio\components
+
+
+ cocostudio\components
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json\flatbuffers
+
+
+ cocostudio\json\flatbuffers
+
+
+ cocostudio\json\flatbuffers
+
+
+ cocostudio\json\flatbuffers
+
+
+ cocostudio\json\flatbuffers
+
+
+ cocostudio\json\flatbuffers
+
+
+ cocostudio\trigger
+
+
+ cocostudio\trigger
+
+
+ cocostudio\trigger
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\reader\WidgetReader
+
+
+ cocostudio\reader\WidgetReader
+
+
+ cocostudio\reader\WidgetReader
+
+
+ cocostudio\reader\WidgetReader\ArmatureNodeReader
+
+
+ cocostudio\reader\WidgetReader\ButtonReader
+
+
+ cocostudio\reader\WidgetReader\CheckBoxReader
+
+
+ cocostudio\reader\WidgetReader\ComAudioReader
+
+
+ cocostudio\reader\WidgetReader\GameMapReader
+
+
+ cocostudio\reader\WidgetReader\ImageViewReader
+
+
+ cocostudio\reader\WidgetReader\LayoutReader
+
+
+ cocostudio\reader\WidgetReader\ListViewReader
+
+
+ cocostudio\reader\WidgetReader\LoadingBarReader
+
+
+ cocostudio\reader\WidgetReader\Node3DReader
+
+
+ cocostudio\reader\WidgetReader\NodeReader
+
+
+ cocostudio\reader\WidgetReader\PageViewReader
+
+
+ cocostudio\reader\WidgetReader\Particle3DReader
+
+
+ cocostudio\reader\WidgetReader\ParticleReader
+
+
+ cocostudio\reader\WidgetReader\ProjectNodeReader
+
+
+ cocostudio\reader\WidgetReader\ScrollViewReader
+
+
+ cocostudio\reader\WidgetReader\SliderReader
+
+
+ cocostudio\reader\WidgetReader\SliderReader
+
+
+ cocostudio\reader\WidgetReader\Sprite3DReader
+
+
+ cocostudio\reader\WidgetReader\SpriteReader
+
+
+ cocostudio\reader\WidgetReader\TextAtlasReader
+
+
+ cocostudio\reader\WidgetReader\TextBMFontReader
+
+
+ cocostudio\reader\WidgetReader\TextFieldReader
+
+
+ cocostudio\reader\WidgetReader\TextReader
+
+
+ cocostudio\reader\WidgetReader\UserCameraReader
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCScrollView
+
+
+ extension\GUI\CCScrollView
+
+
+ extension\GUI\CCScrollView
+
+
+ extension\Particle3D
+
+
+ extension\Particle3D
+
+
+ extension\Particle3D
+
+
+ extension\Particle3D
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\physics_nodes
+
+
+ extension\physics_nodes
+
+
+ extension
+
+
+ external\ConvertUTF
+
+
+ external\ConvertUTF
+
+
+ external\edtaa
+
+
+ external\xxhash
+
+
+ external\unzip
+
+
+ external\unzip
+
+
+ external\unzip
+
+
+ external\tinyxml2
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ network
+
+
+ network
+
+
+ network
+
+
+ physics
+
+
+ physics
+
+
+ physics
+
+
+ physics
+
+
+ physics
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ storage
+
+
+ ui\BaseClasses
+
+
+ ui\BaseClasses
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\System
+
+
+ ui\System
+
+
+ ui\System
+
+
+ ui\UIWidgets\EditBox
+
+
+ ui\UIWidgets\EditBox
+
+
+ ui\UIWidgets\ScrollWidget
+
+
+ ui\UIWidgets\ScrollWidget
+
+
+ ui\UIWidgets\ScrollWidget
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ cocostudio\reader
+
+
+ cocostudio\reader
+
+
+ platform\winrt
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ external\poly2tri\common
+
+
+ external\poly2tri\sweep
+
+
+ external\poly2tri\sweep
+
+
+ external\poly2tri\sweep
+
+
+ external\poly2tri\sweep
+
+
+ network
+
+
+ network
+
+
+ base
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ base
+
+
+ base
+
+
+ audioengine
+
+
+ audioengine
+
+
+ audioengine
+
+
+ audioengine
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+
+
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ 3d
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base
+
+
+ base\allocator
+
+
+ base\allocator
+
+
+ base\allocator
+
+
+ base\allocator
+
+
+ base\allocator
+
+
+ base\allocator
+
+
+ base\allocator
+
+
+ base\allocator
+
+
+ base\allocator
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosbuilder
+
+
+ cocosdenshion\include
+
+
+ cocosdenshion\include
+
+
+ cocosdenshion\include
+
+
+ cocosdenshion\winrt
+
+
+ cocosdenshion\winrt
+
+
+ cocostudio
+
+
+ cocostudio\action
+
+
+ cocostudio\action
+
+
+ cocostudio\action
+
+
+ cocostudio\action
+
+
+ cocostudio\action
+
+
+ cocostudio\armature
+
+
+ cocostudio\armature
+
+
+ cocostudio\armature\animation
+
+
+ cocostudio\armature\animation
+
+
+ cocostudio\armature\animation
+
+
+ cocostudio\armature\datas
+
+
+ cocostudio\armature\display
+
+
+ cocostudio\armature\display
+
+
+ cocostudio\armature\display
+
+
+ cocostudio\armature\display
+
+
+ cocostudio\armature\display
+
+
+ cocostudio\armature\physics
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\armature\utils
+
+
+ cocostudio\components
+
+
+ cocostudio\components
+
+
+ cocostudio\components
+
+
+ cocostudio\components
+
+
+ cocostudio\components
+
+
+ cocostudio\components
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json
+
+
+ cocostudio\json\flatbuffers
+
+
+ cocostudio\json\flatbuffers
+
+
+ cocostudio\json\flatbuffers
+
+
+ cocostudio\trigger
+
+
+ cocostudio\trigger
+
+
+ cocostudio\trigger
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\TimelineAction
+
+
+ cocostudio\reader\WidgetReader
+
+
+ cocostudio\reader\WidgetReader
+
+
+ cocostudio\reader\WidgetReader
+
+
+ cocostudio\reader\WidgetReader
+
+
+ cocostudio\reader\WidgetReader\ArmatureNodeReader
+
+
+ cocostudio\reader\WidgetReader\ArmatureNodeReader
+
+
+ cocostudio\reader\WidgetReader\ButtonReader
+
+
+ cocostudio\reader\WidgetReader\CheckBoxReader
+
+
+ cocostudio\reader\WidgetReader\ComAudioReader
+
+
+ cocostudio\reader\WidgetReader\GameMapReader
+
+
+ cocostudio\reader\WidgetReader\ImageViewReader
+
+
+ cocostudio\reader\WidgetReader\LayoutReader
+
+
+ cocostudio\reader\WidgetReader\ListViewReader
+
+
+ cocostudio\reader\WidgetReader\LoadingBarReader
+
+
+ cocostudio\reader\WidgetReader\Node3DReader
+
+
+ cocostudio\reader\WidgetReader\NodeReader
+
+
+ cocostudio\reader\WidgetReader\PageViewReader
+
+
+ cocostudio\reader\WidgetReader\Particle3DReader
+
+
+ cocostudio\reader\WidgetReader\ParticleReader
+
+
+ cocostudio\reader\WidgetReader\ProjectNodeReader
+
+
+ cocostudio\reader\WidgetReader\ScrollViewReader
+
+
+ cocostudio\reader\WidgetReader\SliderReader
+
+
+ cocostudio\reader\WidgetReader\SliderReader
+
+
+ cocostudio\reader\WidgetReader\Sprite3DReader
+
+
+ cocostudio\reader\WidgetReader\SpriteReader
+
+
+ cocostudio\reader\WidgetReader\TextAtlasReader
+
+
+ cocostudio\reader\WidgetReader\TextBMFontReader
+
+
+ cocostudio\reader\WidgetReader\TextFieldReader
+
+
+ cocostudio\reader\WidgetReader\TextReader
+
+
+ cocostudio\reader\WidgetReader\UserCameraReader
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ deprecated
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCControlExtensions
+
+
+ extension\GUI\CCScrollView
+
+
+ extension\GUI\CCScrollView
+
+
+ extension\GUI\CCScrollView
+
+
+ extension\Particle3D
+
+
+ extension\Particle3D
+
+
+ extension\Particle3D
+
+
+ extension\Particle3D
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\Particle3D\PU
+
+
+ extension\physics_nodes
+
+
+ extension\physics_nodes
+
+
+ extension
+
+
+ extension
+
+
+ extension
+
+
+ extension
+
+
+ external\ConvertUTF
+
+
+ external\edtaa
+
+
+ external\xxhash
+
+
+ external\unzip
+
+
+ external\unzip
+
+
+ external\unzip
+
+
+ external\unzip
+
+
+ external\tinyxml2
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ network
+
+
+ network
+
+
+ network
+
+
+ network
+
+
+ network
+
+
+ network
+
+
+ physics
+
+
+ physics
+
+
+ physics
+
+
+ physics
+
+
+ physics
+
+
+ physics
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ platform\winrt
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ storage
+
+
+ ui\BaseClasses
+
+
+ ui\BaseClasses
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\Layouts
+
+
+ ui\System
+
+
+ ui\System
+
+
+ ui\System
+
+
+ ui\System
+
+
+ ui\UIWidgets\EditBox
+
+
+ ui\UIWidgets\EditBox
+
+
+ ui\UIWidgets\EditBox
+
+
+ ui\UIWidgets\ScrollWidget
+
+
+ ui\UIWidgets\ScrollWidget
+
+
+ ui\UIWidgets\ScrollWidget
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ ui\UIWidgets
+
+
+ cocostudio\reader
+
+
+ cocostudio\reader
+
+
+ platform\winrt
+
+
+ 2d
+
+
+ 2d
+
+
+ 2d
+
+
+ external\poly2tri
+
+
+ external\poly2tri\common
+
+
+ external\poly2tri\common
+
+
+ external\poly2tri\sweep
+
+
+ external\poly2tri\sweep
+
+
+ external\poly2tri\sweep
+
+
+ external\poly2tri\sweep
+
+
+ network
+
+
+ base
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ base
+
+
+ audioengine
+
+
+ audioengine
+
+
+ audioengine
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+ physics3d
+
+
+
+
+ base
+
+
+ base
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ math
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+ renderer
+
+
+
+
+ renderer
+
+
+
\ No newline at end of file
diff --git a/cocos/2d/win10_props/cocos2d_win10.props b/cocos/2d/win10_props/cocos2d_win10.props
new file mode 100644
index 0000000000..b5bfaeca85
--- /dev/null
+++ b/cocos/2d/win10_props/cocos2d_win10.props
@@ -0,0 +1,32 @@
+
+
+
+
+ $(MSBuildThisFileDirectory)..\..\..\
+
+
+
+
+ $(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\include;$(EngineRoot)external\freetype2\include\$(COCOS2D_PLATFORM)\freetype2;$(EngineRoot)external\websockets\include\$(COCOS2D_PLATFORM);$(EngineRoot)cocos\platform\winrt;$(EngineRoot)cocos\platform;$(EngineRoot)cocos\editor-support;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\sqlite3\include;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos;$(EngineRoot)extensions;$(EngineRoot)external;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\unzip;$(EngineRoot)external\tinyxml2;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\xxhash;$(EngineRoot)external\poly2tri;$(EngineRoot)external\poly2tri\common;$(EngineRoot)external\poly2tri\sweep;%(AdditionalIncludeDirectories)
+
+
+ WINRT;_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_UNICODE;UNICODE;RAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN;%(PreprocessorDefinitions)
+ true
+ true
+ false
+ OldStyle
+ 4056;4244;4251;4756;4453;28204;4099;
+
+
+ libGLESv2.lib;libEGL.lib;ws2_32.lib;libwebsockets.lib;chipmunk.lib;zlib.lib;freetype.lib;sqlite3.lib;d2d1.lib;d3d11.lib;dxgi.lib;windowscodecs.lib;dwrite.lib;dxguid.lib;xaudio2.lib;mfcore.lib;mfplat.lib;mfreadwrite.lib;mfuuid.lib;%(AdditionalDependencies)
+ $(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\prebuilt\$(Platform);$(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\chipmunk\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\freetype2\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\poly2tri;$(EngineRoot)external\poly2tri\common;$(EngineRoot)external\poly2tri\sweep;%(AdditionalLibraryDirectories);
+ /IGNORE:4264 %(AdditionalOptions)
+
+
+
+
+ $(EngineRoot)
+ true
+
+
+
\ No newline at end of file
diff --git a/cocos/2d/win10_props/cocos2d_win10_app.props b/cocos/2d/win10_props/cocos2d_win10_app.props
new file mode 100644
index 0000000000..9d5ace9ee9
--- /dev/null
+++ b/cocos/2d/win10_props/cocos2d_win10_app.props
@@ -0,0 +1,27 @@
+
+
+
+
+ $(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\angle\prebuilt\$(Platform)\
+ $(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\prebuilt\$(Platform)\
+ $(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform)\
+ $(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform)\
+
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+
\ No newline at end of file
diff --git a/cocos/2d/winrt_props/cocos2d_winrt_platform.props b/cocos/2d/win10_props/cocos2d_win10_platform.props
similarity index 59%
rename from cocos/2d/winrt_props/cocos2d_winrt_platform.props
rename to cocos/2d/win10_props/cocos2d_win10_platform.props
index 761976bf4e..14747a896d 100644
--- a/cocos/2d/winrt_props/cocos2d_winrt_platform.props
+++ b/cocos/2d/win10_props/cocos2d_win10_platform.props
@@ -2,6 +2,11 @@
- winrt_8.1
+ win10
+
+
+ msxml6.lib;%(AdditionalDependencies)
+
+
\ No newline at end of file
diff --git a/cocos/2d/winrt_props/cocos2d_winrt.props b/cocos/2d/winrt_props/cocos2d_winrt.props
deleted file mode 100644
index a35aa77534..0000000000
--- a/cocos/2d/winrt_props/cocos2d_winrt.props
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
- $(MSBuildThisFileDirectory)..\..\..\
-
-
-
-
- $(EngineRoot)external\winrt-specific\angle\include;$(EngineRoot)external\freetype2\include\$(COCOS2D_PLATFORM);$(EngineRoot)external\curl\include\$(COCOS2D_PLATFORM);$(EngineRoot)external\websockets\include\$(COCOS2D_PLATFORM);$(EngineRoot)cocos\platform\winrt;$(EngineRoot)cocos\platform;$(EngineRoot)cocos\editor-support;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\sqlite3\include;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos;$(EngineRoot)extensions;$(EngineRoot)external;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\unzip;$(EngineRoot)external\tinyxml2;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\xxhash;$(EngineRoot)external\poly2tri;$(EngineRoot)external\poly2tri\common;$(EngineRoot)external\poly2tri\sweep;%(AdditionalIncludeDirectories);
-
-
- WINRT;_VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)
- true
- true
- false
- OldStyle
- 4056;4996;4244;4251;
-
-
- libGLESv2.lib;libEGL.lib;ws2_32.lib;libwebsockets.lib;libcurl.lib;libchipmunk.lib;zlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;freetype250.lib;sqlite3.lib;d2d1.lib;d3d11.lib;dxgi.lib;windowscodecs.lib;dwrite.lib;dxguid.lib;xaudio2.lib;mfcore.lib;mfplat.lib;mfreadwrite.lib;mfuuid.lib;%(AdditionalDependencies)
- $(EngineRoot)external\winrt-specific\angle\prebuilt\$(Platform);$(EngineRoot)external\curl\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\websockets\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\chipmunk\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\$(COCOS2D_PLATFORM)-specific\zlib\prebuilt\$(Platform);$(EngineRoot)external\png\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\tiff\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\jpeg\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\sqlite3\libraries\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\freetype2\prebuilt\$(COCOS2D_PLATFORM)\$(Platform);$(EngineRoot)external\poly2tri;$(EngineRoot)external\poly2tri\common;$(EngineRoot)external\poly2tri\sweep;%(AdditionalLibraryDirectories);
- /IGNORE:4264 %(AdditionalOptions)
-
-
-
-
- $(EngineRoot)
- true
-
-
-
\ No newline at end of file
diff --git a/cocos/2d/winrt_props/cocos2d_winrt_app.props b/cocos/2d/winrt_props/cocos2d_winrt_app.props
deleted file mode 100644
index d0685779c1..0000000000
--- a/cocos/2d/winrt_props/cocos2d_winrt_app.props
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- $(EngineRoot)external\winrt-specific\angle\prebuilt\$(Platform)\
-
-
-
- true
-
-
- true
-
-
-
\ No newline at end of file
diff --git a/cocos/editor-support/spine/proj.win10/libSpine.vcxproj b/cocos/editor-support/spine/proj.win10/libSpine.vcxproj
new file mode 100644
index 0000000000..0cc0b2ecf4
--- /dev/null
+++ b/cocos/editor-support/spine/proj.win10/libSpine.vcxproj
@@ -0,0 +1,489 @@
+
+
+
+
+ Debug
+ ARM
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ ARM
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {4b3ba10a-941f-4e08-8a50-8a7fcb822bb8}
+ StaticLibrary
+ libSpine
+ libSpine
+ en-US
+ 14.0
+ true
+ Windows Store
+ 8.2
+
+
+
+ StaticLibrary
+ true
+ v140
+
+
+ StaticLibrary
+ true
+ v140
+
+
+ StaticLibrary
+ true
+ v140
+
+
+ StaticLibrary
+ false
+ true
+ v140
+
+
+ StaticLibrary
+ false
+ true
+ v140
+
+
+ StaticLibrary
+ false
+ true
+ v140
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+
+ NotUsing
+ true
+ false
+ 4458;4456;4996;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)
+ ProgramDatabase
+
+
+ Console
+ false
+ false
+
+
+ /IGNORE:4264 %(AdditionalOptions)
+
+
+
+
+ NotUsing
+ true
+ false
+ false
+ 4458;4456;4996;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)
+
+
+ Console
+ false
+ false
+
+
+ false
+ /IGNORE:4264 %(AdditionalOptions)
+
+
+
+
+ NotUsing
+ true
+ false
+ 4458;4456;4996;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)
+
+
+ Console
+ false
+ false
+
+
+ /IGNORE:4264 %(AdditionalOptions)
+
+
+
+
+ NotUsing
+ true
+ false
+ false
+ 4458;4456;4996;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)
+ ProgramDatabase
+
+
+ Console
+ false
+ false
+
+
+ false
+ /IGNORE:4264 %(AdditionalOptions)
+
+
+
+
+ NotUsing
+ true
+ false
+ 4458;4456;4996;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)
+
+
+ Console
+ false
+ false
+
+
+ /IGNORE:4264 %(AdditionalOptions)
+
+
+
+
+ NotUsing
+ true
+ false
+ false
+ 4458;4456;4996;%(DisableSpecificWarnings)
+ $(EngineRoot)external\win10-specific\angle\include;%(AdditionalIncludeDirectories)
+
+
+ Console
+ false
+ false
+
+
+ false
+ /IGNORE:4264 %(AdditionalOptions)
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cocos/network/HttpClient-winrt.cpp b/cocos/network/HttpClient-winrt.cpp
new file mode 100644
index 0000000000..83949dc7d9
--- /dev/null
+++ b/cocos/network/HttpClient-winrt.cpp
@@ -0,0 +1,366 @@
+/****************************************************************************
+Copyright (c) 2012 greathqy
+Copyright (c) 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 "HttpClient.h"
+
+#include
+#include
+#include
+
+#include
+
+#include "base/CCVector.h"
+#include "base/CCDirector.h"
+#include "base/CCScheduler.h"
+
+#include "platform/CCFileUtils.h"
+#include "HttpConnection-winrt.h"
+
+NS_CC_BEGIN
+
+namespace network {
+
+ static std::mutex s_requestQueueMutex;
+ static std::mutex s_responseQueueMutex;
+
+ static std::condition_variable_any s_SleepCondition;
+
+
+#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
+ typedef int int32_t;
+#endif
+
+ static Vector* s_requestQueue = nullptr;
+ static Vector* s_responseQueue = nullptr;
+
+ static HttpClient *s_pHttpClient = nullptr; // pointer to singleton
+
+ static std::string s_errorBuffer ="";
+
+ static std::string s_cookieFilename = "";
+
+ static std::string s_sslCaFilename = "";
+
+ // function used to collect response/header data
+ static void writeData(std::vector *pFromBuffer, std::vector *pToBuffer)
+ {
+ if(nullptr == pFromBuffer || nullptr == pToBuffer)
+ return;
+
+ pToBuffer->insert(pToBuffer->end(), pFromBuffer->begin(), pFromBuffer->end());
+ }
+
+ static void processHttpResponse(HttpResponse* response, std::string& errorStr);
+
+ static HttpRequest *s_requestSentinel = new HttpRequest;
+
+ // Worker thread
+ void HttpClient::networkThread()
+ {
+ auto scheduler = Director::getInstance()->getScheduler();
+
+ while (true)
+ {
+ HttpRequest *request;
+
+ // step 1: send http request if the requestQueue isn't empty
+ {
+ std::lock_guard lock(s_requestQueueMutex);
+ while (s_requestQueue->empty()) {
+ s_SleepCondition.wait(s_requestQueueMutex);
+ }
+ request = s_requestQueue->at(0);
+ s_requestQueue->erase(0);
+ }
+
+ if (request == s_requestSentinel) {
+ break;
+ }
+
+ // step 2: libcurl sync access
+
+ // Create a HttpResponse object, the default setting is http access failed
+ HttpResponse *response = new (std::nothrow) HttpResponse(request);
+
+ processHttpResponse(response, s_errorBuffer);
+
+
+ // add response packet into queue
+ s_responseQueueMutex.lock();
+ s_responseQueue->pushBack(response);
+ s_responseQueueMutex.unlock();
+
+ if (nullptr != s_pHttpClient) {
+ scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this));
+ }
+ }
+
+ // cleanup: if worker thread received quit signal, clean up un-completed request queue
+ s_requestQueueMutex.lock();
+ s_requestQueue->clear();
+ s_requestQueueMutex.unlock();
+
+
+ if (s_requestQueue != nullptr) {
+ delete s_requestQueue;
+ s_requestQueue = nullptr;
+ delete s_responseQueue;
+ s_responseQueue = nullptr;
+ }
+
+ }
+
+ // Worker thread
+ void HttpClient::networkThreadAlone(HttpRequest* request, HttpResponse* response)
+ {
+ std::string errorStr;
+ processHttpResponse(response, errorStr);
+
+ auto scheduler = Director::getInstance()->getScheduler();
+ scheduler->performFunctionInCocosThread([response, request]{
+ const ccHttpRequestCallback& callback = request->getCallback();
+ Ref* pTarget = request->getTarget();
+ SEL_HttpResponse pSelector = request->getSelector();
+
+ if (callback != nullptr)
+ {
+ callback(s_pHttpClient, response);
+ }
+ else if (pTarget && pSelector)
+ {
+ (pTarget->*pSelector)(s_pHttpClient, response);
+ }
+ response->release();
+ // do not release in other thread
+ request->release();
+ });
+ }
+
+ // Process Response
+ static void processHttpResponse(HttpResponse* response, std::string& errorStr)
+ {
+ auto request = response->getHttpRequest();
+ long responseCode = -1;
+ int retValue = 0;
+ HttpConnection xhr;
+ bool ok = false;
+ bool manualAuthReqd = false;
+
+ // Process the request -> get response packet
+ switch (request->getRequestType())
+ {
+ case HttpRequest::Type::GET: // HTTP GET
+ ok = (xhr.init(request) && xhr.open("GET", manualAuthReqd, s_cookieFilename) && xhr.send());
+ break;
+
+ case HttpRequest::Type::POST: // HTTP POST
+ ok = (xhr.init(request) && xhr.open("POST", manualAuthReqd, s_cookieFilename) && xhr.send());
+ break;
+
+ case HttpRequest::Type::PUT: // HTTP PUT
+ ok = (xhr.init(request) && xhr.open("PUT", manualAuthReqd, s_cookieFilename) && xhr.send());
+ break;
+
+ case HttpRequest::Type::DELETE: // HTTP DELETE
+ ok = (xhr.init(request) && xhr.open("DELETE", manualAuthReqd, s_cookieFilename) && xhr.send());
+ break;
+
+ default:
+ CCASSERT(true, "CCHttpClient: unknown request type, only GET and POST are supported");
+ break;
+ }
+
+ writeData(xhr.getResponseHeader(), response->getResponseHeader());
+ writeData(xhr.getResponseData(), response->getResponseData());
+ retValue = ok ? 0 : 1;
+ errorStr = xhr.getErrorMessage();
+ responseCode = xhr.getStatusCode();
+
+ // write data to HttpResponse
+ response->setResponseCode(responseCode);
+
+ if (retValue != 0)
+ {
+ response->setSucceed(false);
+ response->setErrorBuffer(errorStr.c_str());
+ }
+ else
+ {
+ response->setSucceed(true);
+ }
+ }
+
+ // HttpClient implementation
+ HttpClient* HttpClient::getInstance()
+ {
+ if (s_pHttpClient == nullptr) {
+ s_pHttpClient = new (std::nothrow) HttpClient();
+ }
+
+ return s_pHttpClient;
+ }
+
+ void HttpClient::destroyInstance()
+ {
+ CC_SAFE_DELETE(s_pHttpClient);
+ }
+
+ void HttpClient::enableCookies(const char* cookieFile) {
+ if (cookieFile) {
+ s_cookieFilename = std::string(cookieFile);
+ }
+ else {
+ s_cookieFilename = (FileUtils::getInstance()->getWritablePath() + "cookieFile.txt");
+ }
+ }
+
+ void HttpClient::setSSLVerification(const std::string& caFile)
+ {
+ s_sslCaFilename = caFile;
+ }
+
+ HttpClient::HttpClient()
+ : _timeoutForConnect(30)
+ , _timeoutForRead(60)
+ {
+ }
+
+ HttpClient::~HttpClient()
+ {
+ if (s_requestQueue != nullptr) {
+ {
+ std::lock_guard lock(s_requestQueueMutex);
+ s_requestQueue->pushBack(s_requestSentinel);
+ }
+ s_SleepCondition.notify_one();
+ }
+
+ s_pHttpClient = nullptr;
+ }
+
+ //Lazy create semaphore & mutex & thread
+ bool HttpClient::lazyInitThreadSemphore()
+ {
+ if (s_requestQueue != nullptr) {
+ return true;
+ }
+ else {
+
+ s_requestQueue = new (std::nothrow) Vector();
+ s_responseQueue = new (std::nothrow) Vector();
+
+ auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this));
+ t.detach();
+ }
+
+ return true;
+ }
+
+ //Add a get task to queue
+ void HttpClient::send(HttpRequest* request)
+ {
+ if (false == lazyInitThreadSemphore())
+ {
+ return;
+ }
+
+ if (!request)
+ {
+ return;
+ }
+
+ request->retain();
+
+ if (nullptr != s_requestQueue) {
+ s_requestQueueMutex.lock();
+ s_requestQueue->pushBack(request);
+ s_requestQueueMutex.unlock();
+
+ // Notify thread start to work
+ s_SleepCondition.notify_one();
+ }
+ }
+
+ void HttpClient::sendImmediate(HttpRequest* request)
+ {
+ if (!request)
+ {
+ return;
+ }
+
+ request->retain();
+ // Create a HttpResponse object, the default setting is http access failed
+ HttpResponse *response = new (std::nothrow) HttpResponse(request);
+
+ auto t = std::thread(&HttpClient::networkThreadAlone, this, request, response);
+ t.detach();
+ }
+
+ // Poll and notify main thread if responses exists in queue
+ void HttpClient::dispatchResponseCallbacks()
+ {
+ // log("CCHttpClient::dispatchResponseCallbacks is running");
+ //occurs when cocos thread fires but the network thread has already quited
+ if (nullptr == s_responseQueue) {
+ return;
+ }
+ HttpResponse* response = nullptr;
+
+ s_responseQueueMutex.lock();
+
+ if (!s_responseQueue->empty())
+ {
+ response = s_responseQueue->at(0);
+ s_responseQueue->erase(0);
+ }
+
+ s_responseQueueMutex.unlock();
+
+ if (response)
+ {
+ HttpRequest *request = response->getHttpRequest();
+ const ccHttpRequestCallback& callback = request->getCallback();
+ Ref* pTarget = request->getTarget();
+ SEL_HttpResponse pSelector = request->getSelector();
+
+ if (callback != nullptr)
+ {
+ callback(this, response);
+ }
+ else if (pTarget && pSelector)
+ {
+ (pTarget->*pSelector)(this, response);
+ }
+
+ response->release();
+ // do not release in other thread
+ request->release();
+ }
+ }
+
+ }
+
+NS_CC_END
diff --git a/cocos/network/HttpConnection-winrt.cpp b/cocos/network/HttpConnection-winrt.cpp
new file mode 100644
index 0000000000..d44901197c
--- /dev/null
+++ b/cocos/network/HttpConnection-winrt.cpp
@@ -0,0 +1,741 @@
+/****************************************************************************
+Copyright (c) 2012 greathqy
+Copyright (c) 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 "network/HttpCookie.h"
+#include "HttpConnection-winrt.h"
+
+NS_CC_BEGIN
+
+namespace network {
+
+ // Format and add default headers (Platform specific approach)
+ static void formatHeaders(std::vector& headers)
+ {
+#if defined(_XBOX_ONE)
+ for(auto iter = headers.begin(); iter != headers.end(); ++iter)
+ {
+ (*iter) += "\r\n";
+ }
+
+ // append default headers
+ headers.emplace_back("User-Agent: XB1_IXHR2_HTTP\r\n");
+ headers.emplace_back("x-xbl-device-type: XboxOne\r\n");
+ headers.emplace_back("x-xbl-client-type: Console\r\n");
+ headers.emplace_back("x-xbl-client-version: 1.0\r\n");
+ headers.emplace_back("x-xbl-contract-version: 1\r\n");
+#endif
+ }
+
+ // Get user authentication token (Platform specific approach)
+ static bool getAuthenticationToken(std::string verb, std::string url, std::string headersXST, std::string bodyXST, std::string& token, std::string& signature)
+ {
+#if defined(_XBOX_ONE)
+ using namespace Windows::Xbox::System;
+
+ token = "";
+ signature = "";
+ User^ loggedInUser = nullptr;
+ int ind = 0;
+
+ while(ind < User::Users->Size)
+ {
+ loggedInUser = User::Users->GetAt(ind++);
+ if(loggedInUser->IsSignedIn)
+ break;
+
+ loggedInUser = nullptr;
+ }
+
+ if(nullptr == loggedInUser)
+ return false;
+
+ Platform::Array^ body;
+
+ if(!bodyXST.empty()) {
+ body = ref new Platform::Array((unsigned char*)bodyXST.c_str(), bodyXST.size());
+ }
+ else {
+ body = ref new Platform::Array(1);
+ body[0] = 0;
+ }
+
+ // this method will crash if TitleId & PrimaryServiceConfigId not specified in Package.appxmanifest.
+ auto asynOp = loggedInUser->GetTokenAndSignatureAsync(
+ ref new Platform::String(std::wstring(verb.begin(), verb.end()).c_str()),
+ ref new Platform::String(std::wstring(url.begin(), url.end()).c_str()),
+ ref new Platform::String(std::wstring(headersXST.begin(), headersXST.end()).c_str()), body);
+
+ bool bRet = false;
+ HRESULT hr = S_OK;
+
+ asynOp->Completed = ref new Windows::Foundation::AsyncOperationCompletedHandler(
+ [&token, &signature, &bRet, &hr](Windows::Foundation::IAsyncOperation^ operation, Windows::Foundation::AsyncStatus status)
+ {
+ if(status == Windows::Foundation::AsyncStatus::Completed) {
+ try
+ {
+ auto result = operation->GetResults();
+
+ std::wstring tok = result->Token->Data();
+ std::wstring sig = result->Signature->Data();
+ token = std::string(tok.begin(), tok.end());
+ signature = std::string(sig.begin(), sig.end());
+
+ bRet = true;
+ }
+ catch(Platform::Exception^ e)
+ {
+ bRet = false;
+ }
+ }
+ else {
+ hr = operation->ErrorCode.Value;
+
+ if(hr == 0x87dd0021) //AM_E_NO_TOKEN_REQUIRED
+ bRet = true;
+ }
+ });
+
+ while(asynOp->Status == Windows::Foundation::AsyncStatus::Started)
+ {
+ ::Sleep(1);
+ }
+
+ return bRet;
+#else
+ return false;
+#endif
+ }
+
+
+ // CXMLHTTPRequest2Callback
+ CXHR2Callback::CXHR2Callback() :
+ _statusCode(0),
+ _hWfC(nullptr),
+ _errorMsg("")
+ {
+ }
+
+ CXHR2Callback::~CXHR2Callback()
+ {
+ if (nullptr != _hWfC)
+ {
+ CloseHandle(_hWfC);
+ _hWfC = nullptr;
+ }
+ }
+
+ HRESULT CXHR2Callback::RuntimeClassInitialize()
+ {
+ _hWfC = CreateEventEx(nullptr, nullptr, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ HRESULT CXHR2Callback::OnRedirect(IXMLHTTPRequest2 *pXHR, const WCHAR *pwszRedirectUrl)
+ {
+ UNREFERENCED_PARAMETER(pXHR);
+ UNREFERENCED_PARAMETER(pwszRedirectUrl);
+
+ return S_OK;
+ }
+
+ HRESULT CXHR2Callback::OnHeadersAvailable(IXMLHTTPRequest2 *pXHR, DWORD dwStatus, const WCHAR *pwszStatus)
+ {
+ _statusCode = dwStatus;
+
+ if(nullptr == pXHR) {
+ return E_INVALIDARG;
+ }
+
+ WCHAR *headers = nullptr;
+ HRESULT hr = pXHR->GetAllResponseHeaders(&headers);
+
+ if(SUCCEEDED(hr)) {
+ std::wstring hdr = headers;
+ _headers.insert(_headers.end(), hdr.begin(), hdr.end());
+ }
+
+ if(headers != nullptr) {
+ CoTaskMemFree(headers);
+ headers = nullptr;
+ }
+
+ return hr;
+ }
+
+ HRESULT CXHR2Callback::OnDataAvailable(IXMLHTTPRequest2 *pXHR, ISequentialStream *pResponseStream)
+ {
+ UNREFERENCED_PARAMETER(pXHR);
+
+ return ReadStreamData(pResponseStream);
+ }
+
+ HRESULT CXHR2Callback::OnResponseReceived(IXMLHTTPRequest2 *pXHR, ISequentialStream *pResponseStream)
+ {
+ UNREFERENCED_PARAMETER(pXHR);
+
+ HRESULT hr = ReadStreamData(pResponseStream);
+
+ CompleteRequest(hr);
+
+ return hr;
+ }
+
+ HRESULT CXHR2Callback::OnError(IXMLHTTPRequest2 *pXHR, HRESULT hrError)
+ {
+ CompleteRequest(hrError);
+
+ return hrError;
+ }
+
+ HRESULT CXHR2Callback::WaitForComplete(PDWORD pdwStatus)
+ {
+ HRESULT hr = E_FAIL;
+
+ if (NULL != _hWfC)
+ {
+ hr = S_OK;
+ DWORD error;
+
+ error = WaitForSingleObjectEx(_hWfC, INFINITE, FALSE);
+
+ if (error == WAIT_FAILED) {
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ if (error != WAIT_OBJECT_0) {
+ hr = E_ABORT;
+ }
+ }
+
+ if (SUCCEEDED(hr)) {
+ *pdwStatus = _statusCode;
+ }
+
+ return hr;
+ }
+
+ HRESULT CXHR2Callback::ReadStreamData(ISequentialStream* pResponseStream)
+ {
+ if(pResponseStream == NULL) {
+ return E_INVALIDARG;
+ }
+
+ CCHAR buff[READ_BUFFER_MAX];
+ DWORD totalBytes = 0;
+ DWORD bytesRead = 0;
+ HRESULT hr = S_OK;
+
+ do
+ {
+ hr = pResponseStream->Read(buff, READ_BUFFER_MAX, &bytesRead);
+
+ if(FAILED(hr)) {
+ break;
+ }
+
+ _data.insert(_data.end(), &buff[0], buff + bytesRead);
+ totalBytes += bytesRead;
+ }
+ while(hr == S_OK);
+
+ if(SUCCEEDED(hr)) {
+ hr = S_OK;
+ }
+
+ return hr;
+ }
+
+ void CXHR2Callback::CompleteRequest(HRESULT hrError)
+ {
+ if (NULL != _hWfC) {
+ SetEvent(_hWfC);
+ }
+
+ switch (hrError)
+ {
+ case S_OK:
+ case S_FALSE:
+ _statusCode = 200;
+ break;
+
+ case INET_E_AUTHENTICATION_REQUIRED:
+ _statusCode = 401;
+ _errorMsg = ERR_MSG_401;
+ break;
+
+ case INET_E_DOWNLOAD_FAILURE:
+ _statusCode = 500;
+ _errorMsg = ERR_MSG_DL_FLD;
+ break;
+
+ case INET_E_FORBIDFRAMING:
+ _statusCode = 403;
+ _errorMsg = ERR_MSG_403;
+ break;
+
+ case INET_E_RESOURCE_NOT_FOUND:
+ _statusCode = 404;
+ _errorMsg = ERR_MSG_404;
+ break;
+
+ case RPC_S_PROXY_ACCESS_DENIED:
+ _statusCode = 407;
+ _errorMsg = ERR_MSG_407;
+ break;
+
+ case ERROR_RESOURCE_CALL_TIMED_OUT:
+ _statusCode = 408;
+ _errorMsg = ERR_MSG_408;
+ break;
+
+ case INET_E_INVALID_REQUEST:
+ _statusCode = 400;
+ _errorMsg = ERR_MSG_400;
+ break;
+
+ case E_ABORT:
+ _statusCode = 412;
+ _errorMsg = ERR_MSG_412;
+ break;
+
+ default:
+ _statusCode = 500;
+ _errorMsg = ERR_MSG_500;
+ break;
+ }
+ }
+
+
+ //CXHR2DataStream
+ CXHR2DataStream::CXHR2DataStream() :
+ _pData(nullptr),
+ _dataSize(0),
+ _seekIndex(0),
+ _refCnt(1)
+ {
+ }
+
+ CXHR2DataStream::~CXHR2DataStream()
+ {
+ if(nullptr != _pData)
+ delete[] _pData;
+ }
+
+ ULONG CXHR2DataStream::Length()
+ {
+ return _dataSize;
+ }
+
+ HRESULT CXHR2DataStream::Init(const void *psBuffer, ULONG cbBufferSize)
+ {
+ HRESULT hr = S_OK;
+
+ if(psBuffer == nullptr || cbBufferSize > REQUEST_BUFFER_MAX) {
+ hr = E_INVALIDARG;
+ }
+
+ if(SUCCEEDED(hr)) {
+ _dataSize = cbBufferSize;
+ _seekIndex = 0;
+ _pData = new (std::nothrow) BYTE[_dataSize];
+
+ if(_pData == nullptr)
+ hr = E_OUTOFMEMORY;
+ }
+
+ if(SUCCEEDED(hr)) {
+ memcpy_s(_pData, _dataSize, psBuffer, cbBufferSize);
+ }
+
+ return hr;
+ }
+
+ HRESULT CXHR2DataStream::Read(void *pv, ULONG cb, ULONG *pcbRead)
+ {
+ HRESULT hr = S_OK;
+
+ if(pv == nullptr) {
+ hr = E_INVALIDARG;
+ }
+
+ if(SUCCEEDED(hr)) {
+ BYTE* pOutput = (BYTE*)pv;
+ BYTE* _pInput = _pData;
+
+ for(*pcbRead = 0; *pcbRead < cb; (*pcbRead)++)
+ {
+ if(_seekIndex == _dataSize) {
+ hr = S_FALSE;
+ break;
+ }
+
+ pOutput[*pcbRead] = _pInput[*pcbRead];
+ _seekIndex++;
+ }
+ }
+
+ return hr;
+ }
+
+ HRESULT CXHR2DataStream::Write(const void *pv, ULONG cb, ULONG *pcbWritten)
+ {
+ HRESULT hr = E_NOTIMPL;
+
+ UNREFERENCED_PARAMETER(pv);
+ UNREFERENCED_PARAMETER(cb);
+ UNREFERENCED_PARAMETER(pcbWritten);
+
+ return hr;
+ }
+
+ ULONG CXHR2DataStream::AddRef()
+ {
+ return ::InterlockedIncrement(&_refCnt);
+ }
+
+ ULONG CXHR2DataStream::Release()
+ {
+ ULONG refCnt = ::InterlockedDecrement(&_refCnt);
+
+ if(0 == refCnt) {
+ delete this;
+ }
+
+ return refCnt;
+ }
+
+ HRESULT CXHR2DataStream::QueryInterface(REFIID riid, void **ppvObject)
+ {
+ HRESULT hr = S_OK;
+
+ if(ppvObject == nullptr) {
+ hr = E_INVALIDARG;
+ }
+
+ void *pObject = nullptr;
+
+ if(SUCCEEDED(hr)) {
+
+ if(riid == IID_IUnknown) {
+ pObject = static_cast((IDispatch*)this);
+ }
+ else if(riid == IID_IDispatch) {
+ pObject = static_cast(this);
+ }
+ else if(riid == IID_ISequentialStream) {
+ pObject = static_cast(this);
+ }
+ else {
+ hr = E_NOINTERFACE;
+ }
+ }
+
+ if(SUCCEEDED(hr)) {
+ AddRef();
+ *ppvObject = pObject;
+ pObject = nullptr;
+ }
+
+ return hr;
+ }
+
+ HRESULT CXHR2DataStream::GetTypeInfoCount(unsigned int FAR* pctinfo)
+ {
+ HRESULT hr = E_NOTIMPL;
+
+ if(pctinfo)
+ *pctinfo = 0;
+
+ return hr;
+ }
+
+ HRESULT CXHR2DataStream::GetTypeInfo(unsigned int iTInfo, LCID lcid, ITypeInfo FAR* FAR* ppTInfo)
+ {
+ HRESULT hr = E_NOTIMPL;
+
+ if(ppTInfo)
+ *ppTInfo = 0;
+
+ UNREFERENCED_PARAMETER(iTInfo);
+ UNREFERENCED_PARAMETER(lcid);
+
+ return hr;
+ }
+
+ HRESULT CXHR2DataStream::GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames, unsigned int cNames, LCID lcid, DISPID FAR* rgDispId)
+ {
+ HRESULT hr = DISP_E_UNKNOWNNAME;
+
+ UNREFERENCED_PARAMETER(riid);
+ UNREFERENCED_PARAMETER(rgszNames);
+ UNREFERENCED_PARAMETER(cNames);
+ UNREFERENCED_PARAMETER(lcid);
+ UNREFERENCED_PARAMETER(rgDispId);
+
+ return hr;
+ }
+
+ HRESULT CXHR2DataStream::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, EXCEPINFO FAR* pExcepInfo, unsigned int FAR* puArgErr)
+ {
+ HRESULT hr = S_OK;
+
+ UNREFERENCED_PARAMETER(dispIdMember);
+ UNREFERENCED_PARAMETER(riid);
+ UNREFERENCED_PARAMETER(lcid);
+ UNREFERENCED_PARAMETER(wFlags);
+ UNREFERENCED_PARAMETER(pDispParams);
+ UNREFERENCED_PARAMETER(pVarResult);
+ UNREFERENCED_PARAMETER(pExcepInfo);
+ UNREFERENCED_PARAMETER(puArgErr);
+
+ return hr;
+ }
+
+
+ // HttpConnection
+ HttpConnection::HttpConnection() :
+ _isInitialized(false),
+ _spXhr(nullptr),
+ _spXhrCallback(nullptr),
+ _spXhrRequestData(nullptr),
+ _pRequest(nullptr),
+ _timeOutInMs(0)
+ {
+ }
+
+ HttpConnection::~HttpConnection()
+ {
+ }
+
+ bool HttpConnection::init(HttpRequest *pRequest, DWORD timeOutInMs)
+ {
+ if (_isInitialized || nullptr == pRequest) {
+ return _isInitialized;
+ }
+
+ HRESULT hr = CoInitializeEx(NULL, NULL);
+
+ if (SUCCEEDED(hr)) {
+ hr = CoCreateInstance(CLSID_FreeThreadedXMLHTTP60, NULL, CLSCTX_SERVER, IID_PPV_ARGS(&_spXhr));
+ }
+
+ if (SUCCEEDED(hr)) {
+ hr = MakeAndInitialize(&_spXhrCallback);
+ }
+
+ if(SUCCEEDED(hr)) {
+ _pRequest = pRequest;
+ _timeOutInMs = timeOutInMs;
+
+ LONG size = _pRequest->getRequestDataSize();
+
+ if(size > 0) {
+ _spXhrRequestData = Make();
+ hr = _spXhrRequestData->Init(_pRequest->getRequestData(), size);
+ }
+ }
+
+ return _isInitialized = SUCCEEDED(hr);
+ }
+
+ bool HttpConnection::open(std::string verb)
+ {
+ return open(verb, false, "");
+ }
+
+ bool HttpConnection::open(std::string verb, bool userAuthentication)
+ {
+ return open(verb, userAuthentication, "");
+ }
+
+ bool HttpConnection::open(std::string verb, std::string cookieFile)
+ {
+ return open(verb, false, cookieFile);
+ }
+
+ bool HttpConnection::open(std::string verb, bool userAuthentication, std::string cookieFile)
+ {
+ if (!_isInitialized) {
+ return false;
+ }
+
+ std::wstring method(verb.begin(), verb.end());
+ std::string url(_pRequest->getUrl());
+ std::wstring wUrl(url.begin(), url.end());
+ HRESULT hr = _spXhr->Open(method.c_str(), wUrl.c_str(), _spXhrCallback.Get(), NULL, NULL, NULL, NULL);
+
+ if(SUCCEEDED(hr) && _timeOutInMs != 0) {
+ hr = _spXhr->SetProperty(XHR_PROP_TIMEOUT, _timeOutInMs);
+ }
+
+#if 0
+ if(SUCCEEDED(hr)) {
+ hr = _spXhr->SetProperty(XHR_PROP_ONDATA_THRESHOLD, READ_BUFFER_MAX);
+ }
+#endif
+
+ auto headers = _pRequest->getHeaders();
+ formatHeaders(headers);
+
+ for(auto header : headers)
+ {
+ std::string key = header.substr(0, header.find_first_of(':'));
+ std::string value = header.substr(header.find_first_of(':') + 1, header.size() - 1);
+ if(SUCCEEDED(hr)) {
+ hr = _spXhr->SetRequestHeader(std::wstring(key.begin(), key.end()).c_str(), std::wstring(value.begin(), value.end()).c_str());
+ }
+ }
+
+ if(SUCCEEDED(hr) && userAuthentication) {
+ std::string authHeaders = std::accumulate(headers.begin(), headers.end(), std::string(""));
+ hr = authenticateUser(verb, url, authHeaders);
+ }
+
+ if(SUCCEEDED(hr) && !cookieFile.empty()) {
+ hr = processCookieFile(url, cookieFile);
+ }
+
+ if(FAILED(hr)) {
+ cancelRequest(hr);
+ }
+
+ return SUCCEEDED(hr);
+ }
+
+ HRESULT HttpConnection::authenticateUser(std::string& verb, std::string& url, std::string& headers)
+ {
+ HRESULT hr = S_OK;
+ std::string authToken;
+ std::string authSig;
+ std::string authBody;
+
+ if(_pRequest->getRequestDataSize() > 0)
+ authBody = _pRequest->getRequestData();
+
+ if(getAuthenticationToken(verb, url, headers, authBody, authToken, authSig)) {
+ hr = _spXhr->SetRequestHeader(L"Authorization", std::wstring(authToken.begin(), authToken.end()).c_str());
+
+ if(SUCCEEDED(hr)) {
+ hr = _spXhr->SetRequestHeader(L"Signature", std::wstring(authSig.begin(), authSig.end()).c_str());
+ }
+ }
+ else
+ {
+ hr = INET_E_AUTHENTICATION_REQUIRED;
+ }
+
+ return hr;
+ }
+
+ HRESULT HttpConnection::processCookieFile(std::string& url, std::string& cookieFile)
+ {
+ HRESULT hr = S_OK;
+
+ HttpCookie cookie;
+ cookie.setCookieFileName(cookieFile);
+ auto cookies = cookie.getCookies();
+ std::string cookieInfo = "";
+ int cCnt = 0;
+
+ for(auto iter = cookies->begin(); iter != cookies->end(); iter++)
+ {
+ if(url.find(iter->domain) != std::string::npos)
+ {
+ std::string keyVal = iter->name;
+ keyVal.append("=");
+ keyVal.append(iter->value);
+ if(cCnt != 0) {
+ cookieInfo.append(";");
+ }
+ cookieInfo.append(keyVal);
+ cCnt++;
+ }
+ }
+
+ if(!cookieInfo.empty() && nullptr != _spXhr) {
+ hr = _spXhr->SetRequestHeader(L"Cookie", std::wstring(cookieInfo.begin(), cookieInfo.end()).c_str());
+ }
+
+ return hr;
+ }
+
+ bool HttpConnection::send()
+ {
+ if (!_isInitialized) {
+ return false;
+ }
+
+ HRESULT hr = E_FAIL;
+
+ if(nullptr == _spXhrRequestData) {
+ hr = _spXhr->Send(NULL, 0);
+ }
+ else {
+ hr = _spXhr->Send(_spXhrRequestData.Get(), _spXhrRequestData->Length());
+ }
+
+ if(SUCCEEDED(hr)) {
+ DWORD status = 0;
+ hr = _spXhrCallback->WaitForComplete(&status);
+ }
+ else {
+ cancelRequest(hr);
+ }
+
+ return SUCCEEDED(hr);
+ }
+
+ DWORD HttpConnection::getStatusCode()
+ {
+ return _spXhrCallback != nullptr ? _spXhrCallback->_statusCode : 500;
+ }
+
+ std::string HttpConnection::getErrorMessage()
+ {
+ return _spXhrCallback != nullptr ? _spXhrCallback->_errorMsg : ERR_MSG_500;
+ }
+
+ std::vector* HttpConnection::getResponseHeader()
+ {
+ return _spXhrCallback != nullptr ? &_spXhrCallback->_headers : nullptr;
+ }
+
+ std::vector* HttpConnection::getResponseData()
+ {
+ return _spXhrCallback != nullptr ? &_spXhrCallback->_data : nullptr;
+ }
+
+ void HttpConnection::cancelRequest(HRESULT hrError)
+ {
+ if(nullptr != _spXhr) {
+ _spXhr->Abort();
+ _spXhrCallback->CompleteRequest(hrError);
+ }
+ }
+}
+
+NS_CC_END
diff --git a/cocos/network/HttpConnection-winrt.h b/cocos/network/HttpConnection-winrt.h
new file mode 100644
index 0000000000..db757fe424
--- /dev/null
+++ b/cocos/network/HttpConnection-winrt.h
@@ -0,0 +1,157 @@
+/****************************************************************************
+Copyright (c) 2012 greathqy
+Copyright (c) 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 "network/HttpRequest.h"
+#include "network/HttpClient.h"
+
+#include
+#include
+#include
+#include
+
+#include
+
+#include
+#if defined(_XBOX_ONE)
+#include
+#else
+#include
+#endif
+using namespace Microsoft::WRL;
+using namespace Microsoft::WRL::Details;
+
+#include "base/CCVector.h"
+#include "base/CCDirector.h"
+#include "base/CCScheduler.h"
+
+#include "platform/CCFileUtils.h"
+
+NS_CC_BEGIN
+
+namespace network {
+
+ const int READ_BUFFER_MAX = 16 * 1024;
+ const int REQUEST_BUFFER_MAX = 4 * 1024 * 1024;
+
+ const char ERR_MSG_500[] = "Internal server error";
+ const char ERR_MSG_400[] = "Invalid request";
+ const char ERR_MSG_401[] = "Authentication is required to access this resource";
+ const char ERR_MSG_403[] = "Forbidden";
+ const char ERR_MSG_404[] = "Specified resource could not be found";
+ const char ERR_MSG_407[] = "Proxy authentication failed";
+ const char ERR_MSG_408[] = "Request timed out";
+ const char ERR_MSG_412[] = "Request aborted";
+ const char ERR_MSG_DL_FLD[] = "The download of the specified resource has failed";
+
+ class CXHR2Callback : public Microsoft::WRL::RuntimeClass, IXMLHTTPRequest2Callback>
+ {
+ public:
+ CXHR2Callback();
+ ~CXHR2Callback();
+
+ HRESULT RuntimeClassInitialize();
+ HRESULT ReadStreamData(ISequentialStream* pResponseStream);
+ STDMETHODIMP OnRedirect(IXMLHTTPRequest2 *pXHR, const WCHAR *pwszRedirectUrl);
+ STDMETHODIMP OnHeadersAvailable(IXMLHTTPRequest2 *pXHR, DWORD dwStatus, const WCHAR *pwszStatus);
+ STDMETHODIMP OnDataAvailable(IXMLHTTPRequest2 *pXHR, ISequentialStream *pResponseStream);
+ STDMETHODIMP OnResponseReceived(IXMLHTTPRequest2 *pXHR, ISequentialStream *pResponseStream);
+ STDMETHODIMP OnError(IXMLHTTPRequest2 *pXHR, HRESULT hrError);
+ STDMETHODIMP WaitForComplete(PDWORD pdwStatus);
+
+ protected:
+ void CompleteRequest(HRESULT hrError);
+
+ private:
+ HANDLE _hWfC;
+ DWORD _statusCode;
+ std::string _errorMsg;
+ std::vector _headers;
+ std::vector _data;
+
+ friend class HttpConnection;
+ };
+
+ class CXHR2DataStream : public Microsoft::WRL::RuntimeClass, ISequentialStream, IDispatch>
+ {
+ public:
+ CXHR2DataStream();
+ ~CXHR2DataStream();
+
+ STDMETHODIMP_(ULONG) Length();
+ STDMETHODIMP Init(const void *psBuffer, ULONG cbBufferSize);
+
+ STDMETHODIMP Read(void *pv, ULONG cb, ULONG *pcbRead);
+ STDMETHODIMP Write(const void *pv, ULONG cb, ULONG *pcbWritten);
+
+ STDMETHODIMP_(ULONG) AddRef();
+ STDMETHODIMP_(ULONG) Release();
+ STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);
+
+ STDMETHODIMP GetTypeInfoCount(unsigned int FAR* pctinfo);
+ STDMETHODIMP GetTypeInfo(unsigned int iTInfo, LCID lcid, ITypeInfo FAR* FAR* ppTInfo);
+ STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames, unsigned int cNames, LCID lcid, DISPID FAR* rgDispId);
+ STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, EXCEPINFO FAR* pExcepInfo, unsigned int FAR* puArgErr);
+
+ private:
+ ULONG _refCnt;
+ BYTE* _pData;
+ ULONG _dataSize;
+ ULONG _seekIndex;
+ };
+
+ class HttpConnection
+ {
+ public:
+ HttpConnection();
+ ~HttpConnection();
+
+ bool init(HttpRequest *pRequest, DWORD timeOutInMs = 0);
+ bool open(std::string verb);
+ bool open(std::string verb, bool userAuthentication);
+ bool open(std::string verb, std::string cookieFile);
+ bool open(std::string verb, bool userAuthentication, std::string cookieFile);
+ bool send();
+ DWORD getStatusCode();
+ std::string getErrorMessage();
+ std::vector* getResponseHeader();
+ std::vector* getResponseData();
+
+ protected:
+ void cancelRequest(HRESULT hrError);
+ HRESULT authenticateUser(std::string& verb, std::string& url, std::string& headers);
+ HRESULT processCookieFile(std::string& url, std::string& cookieFile);
+
+ private:
+ bool _isInitialized;
+ ComPtr _spXhr;
+ ComPtr _spXhrCallback;
+ ComPtr _spXhrRequestData;
+ DWORD _timeOutInMs;
+ cocos2d::network::HttpRequest* _pRequest;
+ };
+}
+
+NS_CC_END
diff --git a/cocos/platform/winrt/DirectXBase.cpp b/cocos/platform/winrt/DirectXBase.cpp
deleted file mode 100644
index 21e1359e6f..0000000000
--- a/cocos/platform/winrt/DirectXBase.cpp
+++ /dev/null
@@ -1,470 +0,0 @@
-//-----------------------------------------------------------------------------------------------
-// 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 "platform/CCPlatformConfig.h"
-#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
-
-#include "DirectXBase.h"
-#include
-#include
-
-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 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 device;
- ComPtr 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(m_renderTargetSize.Width),
- static_cast(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(m_renderTargetSize.Width); // Match the size of the windowm.
- swapChainDesc.Height = static_cast(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 dxgiDevice;
- DX::ThrowIfFailed(
- m_d3dDevice.As(&dxgiDevice)
- );
-
- // Identify the physical adapter (GPU or card) this device is running on.
- ComPtr dxgiAdapter;
- DX::ThrowIfFailed(
- dxgiDevice->GetAdapter(&dxgiAdapter)
- );
-
- // And obtain the factory object that created it.
- ComPtr 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 panelNative;
- DX::ThrowIfFailed(
- reinterpret_cast(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 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(m_renderTargetSize.Width),
- static_cast(m_renderTargetSize.Height),
- 1,
- 1,
- D3D11_BIND_DEPTH_STENCIL
- );
-
- // Allocate a 2-D surface as the depth/stencil buffer.
- ComPtr 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 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, ¶meters);
- 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.
-}
-
-#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
diff --git a/cocos/platform/winrt/DirectXBase.h b/cocos/platform/winrt/DirectXBase.h
deleted file mode 100644
index 87f3aef4cc..0000000000
--- a/cocos/platform/winrt/DirectXBase.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//-----------------------------------------------------------------------------------------------
-// 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 "platform/CCPlatformConfig.h"
-#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#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 m_window;
- Windows::UI::Xaml::Controls::SwapChainBackgroundPanel^ m_panel;
-
- // Direct2D Objects
- Microsoft::WRL::ComPtr m_d2dFactory;
- Microsoft::WRL::ComPtr m_d2dDevice;
- Microsoft::WRL::ComPtr m_d2dContext;
- Microsoft::WRL::ComPtr m_d2dTargetBitmap;
-
- // DirectWrite & Windows Imaging Component Objects
- Microsoft::WRL::ComPtr m_dwriteFactory;
- Microsoft::WRL::ComPtr m_wicFactory;
-
- // Direct3D Objects
- Microsoft::WRL::ComPtr m_d3dDevice;
- Microsoft::WRL::ComPtr m_d3dContext;
- Microsoft::WRL::ComPtr m_swapChain;
- Microsoft::WRL::ComPtr m_renderTargetView;
- Microsoft::WRL::ComPtr m_depthStencilView;
-
- D3D_FEATURE_LEVEL m_featureLevel;
- Windows::Foundation::Size m_renderTargetSize;
- Windows::Foundation::Rect m_windowBounds;
- float m_dpi;
-};
-
-#pragma warning (default: 4449)
-
-#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
diff --git a/cocos/platform/winrt/DirectXHelper.h b/cocos/platform/winrt/DirectXHelper.h
deleted file mode 100644
index 9ff8d58538..0000000000
--- a/cocos/platform/winrt/DirectXHelper.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//-----------------------------------------------------------------------------------------------
-// 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 "platform/CCPlatformConfig.h"
-#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
-
-// 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);
- }
- }
-}
-
-#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp
index e7fb405dd5..6d0b91aeb1 100644
--- a/cocos/ui/UIScale9Sprite.cpp
+++ b/cocos/ui/UIScale9Sprite.cpp
@@ -793,7 +793,7 @@ namespace ui {
//shrink the image size when it is 9-patch
if(_isPatch9)
{
- float offset = 1.4;
+ float offset = 1.4f;
//Top left
if(!_spriteFrameRotated)
{
diff --git a/extensions/assets-manager/AssetsManager.h b/extensions/assets-manager/AssetsManager.h
index 8cb4e48017..ce21d884e1 100644
--- a/extensions/assets-manager/AssetsManager.h
+++ b/extensions/assets-manager/AssetsManager.h
@@ -33,6 +33,8 @@
#include "extensions/ExtensionMacros.h"
#include "extensions/ExtensionExport.h"
+#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT && _MSC_VER < 1900)
+
NS_CC_EXT_BEGIN
class AssetsManagerDelegateProtocol;
@@ -237,4 +239,5 @@ CC_DEPRECATED_ATTRIBUTE typedef AssetsManagerDelegateProtocol CCAssetsManagerDel
NS_CC_EXT_END;
+#endif /* #if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT && _MSC_VER < 1900) */
#endif /* defined(__AssetsManager__) */
diff --git a/extensions/assets-manager/Downloader.cpp b/extensions/assets-manager/Downloader.cpp
index 1175e6baa3..e14089a0d8 100644
--- a/extensions/assets-manager/Downloader.cpp
+++ b/extensions/assets-manager/Downloader.cpp
@@ -273,13 +273,6 @@ void Downloader::prepareDownload(const std::string &srcUrl, const std::string &s
}
}
-#if(CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
-Downloader::HeaderInfo Downloader::prepare(const std::string &srcUrl)
-{
- return prepareHeader(srcUrl);
-}
-#endif
-
Downloader::HeaderInfo Downloader::prepareHeader(const std::string &srcUrl, void* header/* = nullptr */)
{
bool headerGiven = true;
@@ -335,11 +328,7 @@ long Downloader::getContentSize(const std::string &srcUrl)
void Downloader::getHeaderAsync(const std::string &srcUrl, const HeaderCallback &callback)
{
setHeaderCallback(callback);
-#if(CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
- auto t = std::thread(&Downloader::prepare, this, srcUrl);
-#else
auto t = std::thread(&Downloader::prepareHeader, this, srcUrl, nullptr);
-#endif
t.detach();
}
diff --git a/extensions/assets-manager/Downloader.h b/extensions/assets-manager/Downloader.h
index 46893ec6ce..43960e162c 100644
--- a/extensions/assets-manager/Downloader.h
+++ b/extensions/assets-manager/Downloader.h
@@ -170,9 +170,6 @@ protected:
void prepareDownload(const std::string &srcUrl, const std::string &storagePath, const std::string &customId, bool resumeDownload, FileDescriptor *fDesc, ProgressData *pData);
-#if(CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
- HeaderInfo prepare(const std::string &srcUrl);
-#endif
HeaderInfo prepareHeader(const std::string &srcUrl, void* header = nullptr);
void downloadToBuffer(const std::string &srcUrl, const std::string &customId, const StreamData &buffer, const ProgressData &data);
diff --git a/extensions/assets-manager/Manifest.cpp b/extensions/assets-manager/Manifest.cpp
index d7541f7a2d..5d8dfa53a6 100644
--- a/extensions/assets-manager/Manifest.cpp
+++ b/extensions/assets-manager/Manifest.cpp
@@ -329,10 +329,9 @@ void Manifest::setAssetDownloadState(const std::string &key, const Manifest::Dow
std::string jkey = itr->name.GetString();
if (jkey == key) {
rapidjson::Value &entry = itr->value;
- rapidjson::Value &value = entry[KEY_DOWNLOAD_STATE];
- if (value.IsInt())
+ if (entry.HasMember(KEY_DOWNLOAD_STATE) && entry[KEY_DOWNLOAD_STATE].IsInt())
{
- value.SetInt((int)state);
+ entry[KEY_DOWNLOAD_STATE].SetInt((int) state);
}
else
{
diff --git a/extensions/cocos-ext.h b/extensions/cocos-ext.h
index c0f83798d8..283eede1fb 100644
--- a/extensions/cocos-ext.h
+++ b/extensions/cocos-ext.h
@@ -12,11 +12,15 @@
#include "physics-nodes/CCPhysicsDebugNode.h"
#include "physics-nodes/CCPhysicsSprite.h"
+#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT && _MSC_VER < 1900)
+// Window 10 UWP does not yet support CURL
#include "assets-manager/AssetsManager.h"
#include "assets-manager/AssetsManagerEx.h"
#include "assets-manager/CCEventAssetsManagerEx.h"
#include "assets-manager/CCEventListenerAssetsManagerEx.h"
#include "assets-manager/Manifest.h"
+#endif
+
#include "ExtensionDeprecated.h"
// Particle System, include Particle Universe Particle System
diff --git a/templates/cpp-template-default/cocos-project-template.json b/templates/cpp-template-default/cocos-project-template.json
index 37da10163d..a89a2ccac2 100644
--- a/templates/cpp-template-default/cocos-project-template.json
+++ b/templates/cpp-template-default/cocos-project-template.json
@@ -19,7 +19,11 @@
"proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows.vcxproj",
"proj.win8.1-universal/App.Windows/PROJECT_NAME.Windows.vcxproj.filters",
"proj.win8.1-universal/App.WindowsPhone/PROJECT_NAME.WindowsPhone.vcxproj",
- "proj.win8.1-universal/App.WindowsPhone/PROJECT_NAME.WindowsPhone.vcxproj.filters"
+ "proj.win8.1-universal/App.WindowsPhone/PROJECT_NAME.WindowsPhone.vcxproj.filters",
+ "proj.win10/PROJECT_NAME.sln",
+ "proj.win10/App/PROJECT_NAME.vcxproj",
+ "proj.win10/App/PROJECT_NAME.vcxproj.filters",
+ "proj.win10/App/PROJECT_NAME_TemporaryKey.pfx"
]
},
"project_replace_project_name":{
@@ -46,6 +50,10 @@
"proj.ios_mac/ios/main.m",
"proj.ios_mac/ios/Prefix.pch",
"proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj",
+ "proj.win10/PROJECT_NAME.sln",
+ "proj.win10/App/PROJECT_NAME.vcxproj",
+ "proj.win10/App/PROJECT_NAME.vcxproj.filters",
+ "proj.win10/App/Package.appxmanifest",
"CMakeLists.txt"
]
},
diff --git a/templates/cpp-template-default/proj.win10/App/App.xaml b/templates/cpp-template-default/proj.win10/App/App.xaml
new file mode 100644
index 0000000000..62de149dd6
--- /dev/null
+++ b/templates/cpp-template-default/proj.win10/App/App.xaml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/templates/cpp-template-default/proj.win10/App/App.xaml.cpp b/templates/cpp-template-default/proj.win10/App/App.xaml.cpp
new file mode 100644
index 0000000000..f702179939
--- /dev/null
+++ b/templates/cpp-template-default/proj.win10/App/App.xaml.cpp
@@ -0,0 +1,21 @@
+#include "App.xaml.h"
+#include "OpenGLESPage.xaml.h"
+
+using namespace cocos2d;
+
+App::App()
+{
+ InitializeComponent();
+}
+
+void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
+{
+ if (mPage == nullptr)
+ {
+ mPage = ref new OpenGLESPage(&mOpenGLES);
+ }
+
+ // Place the page in the current window and ensure that it is active.
+ Windows::UI::Xaml::Window::Current->Content = mPage;
+ Windows::UI::Xaml::Window::Current->Activate();
+}
diff --git a/templates/cpp-template-default/proj.win10/App/App.xaml.h b/templates/cpp-template-default/proj.win10/App/App.xaml.h
new file mode 100644
index 0000000000..8697d3d824
--- /dev/null
+++ b/templates/cpp-template-default/proj.win10/App/App.xaml.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include "app.g.h"
+#include "OpenGLES.h"
+#include "openglespage.xaml.h"
+
+namespace cocos2d
+{
+ ref class App sealed
+ {
+ public:
+ App();
+ virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
+
+ private:
+ OpenGLESPage^ mPage;
+ OpenGLES mOpenGLES;
+ };
+}
diff --git a/templates/cpp-template-default/proj.win10/App/Assets/Logo.scale-100.png b/templates/cpp-template-default/proj.win10/App/Assets/Logo.scale-100.png
new file mode 100644
index 0000000000..e26771cb33
Binary files /dev/null and b/templates/cpp-template-default/proj.win10/App/Assets/Logo.scale-100.png differ
diff --git a/templates/cpp-template-default/proj.win10/App/Assets/SmallLogo.scale-100.png b/templates/cpp-template-default/proj.win10/App/Assets/SmallLogo.scale-100.png
new file mode 100644
index 0000000000..1eb0d9d528
Binary files /dev/null and b/templates/cpp-template-default/proj.win10/App/Assets/SmallLogo.scale-100.png differ
diff --git a/templates/cpp-template-default/proj.win10/App/Assets/SplashScreen.scale-100.png b/templates/cpp-template-default/proj.win10/App/Assets/SplashScreen.scale-100.png
new file mode 100644
index 0000000000..c951e031bd
Binary files /dev/null and b/templates/cpp-template-default/proj.win10/App/Assets/SplashScreen.scale-100.png differ
diff --git a/templates/cpp-template-default/proj.win10/App/Assets/StoreLogo.scale-100.png b/templates/cpp-template-default/proj.win10/App/Assets/StoreLogo.scale-100.png
new file mode 100644
index 0000000000..dcb672712c
Binary files /dev/null and b/templates/cpp-template-default/proj.win10/App/Assets/StoreLogo.scale-100.png differ
diff --git a/templates/cpp-template-default/proj.win10/App/Assets/WideLogo.scale-100.png b/templates/cpp-template-default/proj.win10/App/Assets/WideLogo.scale-100.png
new file mode 100644
index 0000000000..9dd94b628c
Binary files /dev/null and b/templates/cpp-template-default/proj.win10/App/Assets/WideLogo.scale-100.png differ
diff --git a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.cpp b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.cpp
new file mode 100644
index 0000000000..85212dfded
--- /dev/null
+++ b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.cpp
@@ -0,0 +1,158 @@
+/*
+* cocos2d-x http://www.cocos2d-x.org
+*
+* Copyright (c) 2010-2014 - cocos2d-x community
+*
+* Portions Copyright (c) Microsoft Open Technologies, Inc.
+* All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the License.
+*/
+
+#include "Cocos2dRenderer.h"
+#include "AppDelegate.h"
+#include "CCGLViewImpl-winrt.h"
+#include "CCApplication.h"
+#include "cocos2d.h"
+#include "renderer/CCTextureCache.h"
+
+// These are used by the shader compilation methods.
+#include
+#include
+#include
+
+using namespace Platform;
+using namespace Windows::UI::Core;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::Graphics::Display;
+
+USING_NS_CC;
+
+
+Cocos2dRenderer::Cocos2dRenderer(int width, int height, float dpi, DisplayOrientations orientation, CoreDispatcher^ dispatcher, Panel^ panel)
+ : m_app(nullptr)
+ , m_width(width)
+ , m_height(height)
+ , m_dpi(dpi)
+ , m_dispatcher(dispatcher)
+ , m_panel(panel)
+ , m_orientation(orientation)
+{
+ m_app = new AppDelegate();
+}
+
+Cocos2dRenderer::~Cocos2dRenderer()
+{
+ delete m_app;
+}
+
+void Cocos2dRenderer::Resume()
+{
+ auto director = cocos2d::Director::getInstance();
+ auto glview = director->getOpenGLView();
+
+ if (!glview)
+ {
+ GLViewImpl* glview = GLViewImpl::create("Test Cpp");
+ glview->setDispatcher(m_dispatcher.Get());
+ glview->setPanel(m_panel.Get());
+ glview->Create(static_cast(m_width), static_cast(m_height), m_dpi, m_orientation);
+ director->setOpenGLView(glview);
+ CCApplication::getInstance()->run();
+ }
+ else
+ {
+ Application::getInstance()->applicationWillEnterForeground();
+ cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND);
+ cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent);
+ }
+}
+
+void Cocos2dRenderer::Pause()
+{
+ if (Director::getInstance()->getOpenGLView()) {
+ Application::getInstance()->applicationDidEnterBackground();
+ cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);
+ cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);
+ }
+}
+
+bool Cocos2dRenderer::AppShouldExit()
+{
+ return GLViewImpl::sharedOpenGLView()->AppShouldExit();
+}
+
+void Cocos2dRenderer::DeviceLost()
+{
+ Pause();
+
+ auto director = cocos2d::Director::getInstance();
+ if (director->getOpenGLView()) {
+ cocos2d::GL::invalidateStateCache();
+ cocos2d::GLProgramCache::getInstance()->reloadDefaultGLPrograms();
+ cocos2d::DrawPrimitives::init();
+ cocos2d::VolatileTextureMgr::reloadAllTextures();
+
+ cocos2d::EventCustom recreatedEvent(EVENT_RENDERER_RECREATED);
+ director->getEventDispatcher()->dispatchEvent(&recreatedEvent);
+ director->setGLDefaultValues();
+
+ Application::getInstance()->applicationWillEnterForeground();
+ cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND);
+ cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent);
+ }
+}
+
+
+
+void Cocos2dRenderer::Draw(GLsizei width, GLsizei height, float dpi, DisplayOrientations orientation)
+{
+ auto glView = GLViewImpl::sharedOpenGLView();
+
+ if (orientation != m_orientation)
+ {
+ m_orientation = orientation;
+ glView->UpdateOrientation(orientation);
+ }
+
+ if (width != m_width || height != m_height)
+ {
+ m_width = width;
+ m_height = height;
+ glView->UpdateForWindowSizeChange(static_cast(width), static_cast(height));
+ }
+
+ if (dpi != m_dpi)
+ {
+ m_dpi = dpi;
+ glView->SetDPI(m_dpi);
+ }
+
+ glView->ProcessEvents();
+ glView->Render();
+}
+
+void Cocos2dRenderer::QueuePointerEvent(cocos2d::PointerEventType type, Windows::UI::Core::PointerEventArgs^ args)
+{
+ GLViewImpl::sharedOpenGLView()->QueuePointerEvent(type, args);
+}
+
+void Cocos2dRenderer::QueueBackButtonEvent()
+{
+ GLViewImpl::sharedOpenGLView()->QueueBackKeyPress();
+}
+
+void Cocos2dRenderer::QueueKeyboardEvent(WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args)
+{
+ GLViewImpl::sharedOpenGLView()->QueueWinRTKeyboardEvent(type, args);
+}
+
+
+
diff --git a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.h b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.h
new file mode 100644
index 0000000000..b348c50043
--- /dev/null
+++ b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/Cocos2dRenderer.h
@@ -0,0 +1,57 @@
+/*
+* cocos2d-x http://www.cocos2d-x.org
+*
+* Copyright (c) 2010-2014 - cocos2d-x community
+*
+* Portions Copyright (c) Microsoft Open Technologies, Inc.
+* All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the License.
+*/
+#pragma once
+
+#include
+
+#include "cocos2d.h"
+
+
+class AppDelegate;
+
+namespace cocos2d
+{
+ class Cocos2dRenderer
+ {
+ public:
+ Cocos2dRenderer(int width, int height, float dpi,
+ Windows::Graphics::Display::DisplayOrientations orientation,
+ Windows::UI::Core::CoreDispatcher^ dispathcer, Windows::UI::Xaml::Controls::Panel^ panel);
+ ~Cocos2dRenderer();
+ void Draw(GLsizei width, GLsizei height, float dpi, Windows::Graphics::Display::DisplayOrientations orientation);
+ void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
+ void QueueKeyboardEvent(WinRTKeyboardEventType type, Windows::UI::Core::KeyEventArgs^ args);
+ void QueueBackButtonEvent();
+ void Pause();
+ void Resume();
+ void DeviceLost();
+ bool AppShouldExit();
+
+ private:
+
+ int m_width;
+ int m_height;
+ float m_dpi;
+
+ // The AppDelegate for the Cocos2D app
+ AppDelegate* m_app;
+ Platform::Agile m_dispatcher;
+ Platform::Agile m_panel;
+ Windows::Graphics::Display::DisplayOrientations m_orientation;
+ };
+}
\ No newline at end of file
diff --git a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLES.cpp b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLES.cpp
new file mode 100644
index 0000000000..3afdab08a9
--- /dev/null
+++ b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLES.cpp
@@ -0,0 +1,246 @@
+/*
+* cocos2d-x http://www.cocos2d-x.org
+*
+* Copyright (c) 2010-2014 - cocos2d-x community
+*
+* Portions Copyright (c) Microsoft Open Technologies, Inc.
+* All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the License.
+*/
+
+#include "OpenGLES.h"
+using namespace Platform;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::Foundation;
+using namespace Windows::Foundation::Collections;
+
+OpenGLES::OpenGLES() :
+ mEglConfig(nullptr),
+ mEglDisplay(EGL_NO_DISPLAY),
+ mEglContext(EGL_NO_CONTEXT)
+{
+ Initialize();
+}
+
+OpenGLES::~OpenGLES()
+{
+ Cleanup();
+}
+
+void OpenGLES::Initialize()
+{
+ const EGLint configAttributes[] =
+ {
+ 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_NONE
+ };
+
+ const EGLint contextAttributes[] =
+ {
+ EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL_NONE
+ };
+
+ const EGLint defaultDisplayAttributes[] =
+ {
+ // These are the default display attributes, used to request ANGLE's D3D11 renderer.
+ // eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+.
+ EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
+
+ // EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices.
+ // Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it.
+ EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
+
+ // EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE is an option that enables ANGLE to automatically call
+ // the IDXGIDevice3::Trim method on behalf of the application when it gets suspended.
+ // Calling IDXGIDevice3::Trim when an application is suspended is a Windows Store application certification requirement.
+ EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
+ EGL_NONE,
+ };
+
+ const EGLint fl9_3DisplayAttributes[] =
+ {
+ // These can be used to request ANGLE's D3D11 renderer, with D3D11 Feature Level 9_3.
+ // These attributes are used if the call to eglInitialize fails with the default display attributes.
+ EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
+ EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9,
+ EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3,
+ EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
+ EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
+ EGL_NONE,
+ };
+
+ const EGLint warpDisplayAttributes[] =
+ {
+ // These attributes can be used to request D3D11 WARP.
+ // They are used if eglInitialize fails with both the default display attributes and the 9_3 display attributes.
+ EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
+ EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE,
+ EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
+ EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
+ EGL_NONE,
+ };
+
+ EGLConfig config = NULL;
+
+ // eglGetPlatformDisplayEXT is an alternative to eglGetDisplay. It allows us to pass in display attributes, used to configure D3D11.
+ PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast(eglGetProcAddress("eglGetPlatformDisplayEXT"));
+ if (!eglGetPlatformDisplayEXT)
+ {
+ throw Exception::CreateException(E_FAIL, L"Failed to get function eglGetPlatformDisplayEXT");
+ }
+
+ //
+ // To initialize the display, we make three sets of calls to eglGetPlatformDisplayEXT and eglInitialize, with varying
+ // parameters passed to eglGetPlatformDisplayEXT:
+ // 1) The first calls uses "defaultDisplayAttributes" as a parameter. This corresponds to D3D11 Feature Level 10_0+.
+ // 2) If eglInitialize fails for step 1 (e.g. because 10_0+ isn't supported by the default GPU), then we try again
+ // using "fl9_3DisplayAttributes". This corresponds to D3D11 Feature Level 9_3.
+ // 3) If eglInitialize fails for step 2 (e.g. because 9_3+ isn't supported by the default GPU), then we try again
+ // using "warpDisplayAttributes". This corresponds to D3D11 Feature Level 11_0 on WARP, a D3D11 software rasterizer.
+ //
+ // Note: On Windows Phone, we #ifdef out the first set of calls to eglPlatformDisplayEXT and eglInitialize.
+ // Windows Phones devices only support D3D11 Feature Level 9_3, but the Windows Phone emulator supports 11_0+.
+ // We use this #ifdef to limit the Phone emulator to Feature Level 9_3, making it behave more like
+ // real Windows Phone devices.
+ // If you wish to test Feature Level 10_0+ in the Windows Phone emulator then you should remove this #ifdef.
+ //
+
+#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
+ // This tries to initialize EGL to D3D11 Feature Level 10_0+. See above comment for details.
+ mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, defaultDisplayAttributes);
+ if (mEglDisplay == EGL_NO_DISPLAY)
+ {
+ throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
+ }
+
+ if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
+#endif
+ {
+ // This tries to initialize EGL to D3D11 Feature Level 9_3, if 10_0+ is unavailable (e.g. on Windows Phone, or certain Windows tablets).
+ mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, fl9_3DisplayAttributes);
+ if (mEglDisplay == EGL_NO_DISPLAY)
+ {
+ throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
+ }
+
+ if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
+ {
+ // This initializes EGL to D3D11 Feature Level 11_0 on WARP, if 9_3+ is unavailable on the default GPU (e.g. on Surface RT).
+ mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, warpDisplayAttributes);
+ if (mEglDisplay == EGL_NO_DISPLAY)
+ {
+ throw Exception::CreateException(E_FAIL, L"Failed to get EGL display");
+ }
+
+ if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
+ {
+ // If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred.
+ throw Exception::CreateException(E_FAIL, L"Failed to initialize EGL");
+ }
+ }
+ }
+
+ EGLint numConfigs = 0;
+ if ((eglChooseConfig(mEglDisplay, configAttributes, &mEglConfig, 1, &numConfigs) == EGL_FALSE) || (numConfigs == 0))
+ {
+ throw Exception::CreateException(E_FAIL, L"Failed to choose first EGLConfig");
+ }
+
+ mEglContext = eglCreateContext(mEglDisplay, mEglConfig, EGL_NO_CONTEXT, contextAttributes);
+ if (mEglContext == EGL_NO_CONTEXT)
+ {
+ throw Exception::CreateException(E_FAIL, L"Failed to create EGL context");
+ }
+}
+
+void OpenGLES::Cleanup()
+{
+ if (mEglDisplay != EGL_NO_DISPLAY && mEglContext != EGL_NO_CONTEXT)
+ {
+ eglDestroyContext(mEglDisplay, mEglContext);
+ mEglContext = EGL_NO_CONTEXT;
+ }
+
+ if (mEglDisplay != EGL_NO_DISPLAY)
+ {
+ eglTerminate(mEglDisplay);
+ mEglDisplay = EGL_NO_DISPLAY;
+ }
+}
+
+void OpenGLES::Reset()
+{
+ Cleanup();
+ Initialize();
+}
+
+EGLSurface OpenGLES::CreateSurface(SwapChainPanel^ panel, const Size* renderSurfaceSize)
+{
+ if (!panel)
+ {
+ throw Exception::CreateException(E_INVALIDARG, L"SwapChainPanel parameter is invalid");
+ }
+
+ EGLSurface surface = EGL_NO_SURFACE;
+
+ const EGLint surfaceAttributes[] =
+ {
+ // EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER is part of the same optimization as EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER (see above).
+ // If you have compilation issues with it then please update your Visual Studio templates.
+ EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER, EGL_TRUE,
+ EGL_NONE
+ };
+
+ // Create a PropertySet and initialize with the EGLNativeWindowType.
+ PropertySet^ surfaceCreationProperties = ref new PropertySet();
+ surfaceCreationProperties->Insert(ref new String(EGLNativeWindowTypeProperty), panel);
+
+ // If a render surface size is specified, add it to the surface creation properties
+ if (renderSurfaceSize != nullptr)
+ {
+ surfaceCreationProperties->Insert(ref new String(EGLRenderSurfaceSizeProperty), PropertyValue::CreateSize(*renderSurfaceSize));
+ }
+
+ surface = eglCreateWindowSurface(mEglDisplay, mEglConfig, reinterpret_cast(surfaceCreationProperties), surfaceAttributes);
+ if (surface == EGL_NO_SURFACE)
+ {
+ throw Exception::CreateException(E_FAIL, L"Failed to create EGL surface");
+ }
+
+ return surface;
+}
+
+void OpenGLES::DestroySurface(const EGLSurface surface)
+{
+ if (mEglDisplay != EGL_NO_DISPLAY && surface != EGL_NO_SURFACE)
+ {
+ eglDestroySurface(mEglDisplay, surface);
+ }
+}
+
+void OpenGLES::MakeCurrent(const EGLSurface surface)
+{
+ if (eglMakeCurrent(mEglDisplay, surface, surface, mEglContext) == EGL_FALSE)
+ {
+ throw Exception::CreateException(E_FAIL, L"Failed to make EGLSurface current");
+ }
+}
+
+EGLBoolean OpenGLES::SwapBuffers(const EGLSurface surface)
+{
+ return (eglSwapBuffers(mEglDisplay, surface));
+}
diff --git a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLES.h b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLES.h
new file mode 100644
index 0000000000..e2e7d7e8aa
--- /dev/null
+++ b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLES.h
@@ -0,0 +1,51 @@
+/*
+* cocos2d-x http://www.cocos2d-x.org
+*
+* Copyright (c) 2010-2014 - cocos2d-x community
+*
+* Portions Copyright (c) Microsoft Open Technologies, Inc.
+* All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the License.
+*/
+
+#pragma once
+
+// OpenGL ES includes
+#include
+#include
+
+// EGL includes
+#include
+#include
+#include
+#include
+
+class OpenGLES
+{
+public:
+ OpenGLES();
+ ~OpenGLES();
+
+ EGLSurface CreateSurface(Windows::UI::Xaml::Controls::SwapChainPanel^ panel, const Windows::Foundation::Size* renderSurfaceSize);
+ void DestroySurface(const EGLSurface surface);
+ void MakeCurrent(const EGLSurface surface);
+ EGLBoolean SwapBuffers(const EGLSurface surface);
+ void Reset();
+ void Cleanup();
+
+private:
+ void Initialize();
+
+private:
+ EGLDisplay mEglDisplay;
+ EGLContext mEglContext;
+ EGLConfig mEglConfig;
+};
diff --git a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLESPage.xaml b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLESPage.xaml
new file mode 100644
index 0000000000..e5b62802a5
--- /dev/null
+++ b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLESPage.xaml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
diff --git a/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLESPage.xaml.cpp b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLESPage.xaml.cpp
new file mode 100644
index 0000000000..fc4a36bc71
--- /dev/null
+++ b/templates/cpp-template-default/proj.win10/App/Cocos2dEngine/OpenGLESPage.xaml.cpp
@@ -0,0 +1,418 @@
+/*
+* cocos2d-x http://www.cocos2d-x.org
+*
+* Copyright (c) 2010-2014 - cocos2d-x community
+*
+* Portions Copyright (c) Microsoft Open Technologies, Inc.
+* All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the License.
+*/
+
+#include "App.xaml.h"
+#include "OpenGLESPage.xaml.h"
+
+using namespace cocos2d;
+using namespace Platform;
+using namespace Concurrency;
+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;
+
+#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || _MSC_VER >= 1900
+using namespace Windows::Phone::UI::Input;
+#endif
+
+OpenGLESPage::OpenGLESPage() :
+ OpenGLESPage(nullptr)
+{
+
+}
+
+OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
+ mOpenGLES(openGLES),
+ mRenderSurface(EGL_NO_SURFACE),
+ mCustomRenderSurfaceSize(0,0),
+ mUseCustomRenderSurfaceSize(false),
+ m_coreInput(nullptr),
+ m_dpi(0.0f),
+ m_deviceLost(false),
+ m_orientation(DisplayOrientations::Landscape)
+{
+ InitializeComponent();
+
+ Windows::UI::Core::CoreWindow^ window = Windows::UI::Xaml::Window::Current->CoreWindow;
+
+ window->VisibilityChanged +=
+ ref new Windows::Foundation::TypedEventHandler(this, &OpenGLESPage::OnVisibilityChanged);
+
+ window->KeyDown += ref new TypedEventHandler(this, &OpenGLESPage::OnKeyPressed);
+
+ window->KeyUp += ref new TypedEventHandler(this, &OpenGLESPage::OnKeyReleased);
+
+ window->CharacterReceived += ref new TypedEventHandler(this, &OpenGLESPage::OnCharacterReceived);
+
+ swapChainPanel->SizeChanged +=
+ ref new Windows::UI::Xaml::SizeChangedEventHandler(this, &OpenGLESPage::OnSwapChainPanelSizeChanged);
+
+ DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
+
+ currentDisplayInformation->OrientationChanged +=
+ ref new TypedEventHandler(this, &OpenGLESPage::OnOrientationChanged);
+
+ m_orientation = currentDisplayInformation->CurrentOrientation;
+
+ this->Loaded +=
+ ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::OnPageLoaded);
+
+ mSwapChainPanelSize = { swapChainPanel->RenderSize.Width, swapChainPanel->RenderSize.Height };
+
+#if _MSC_VER >= 1900
+ if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
+ {
+ Windows::UI::ViewManagement::StatusBar::GetForCurrentView()->HideAsync();
+ }
+
+ if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
+ {
+ HardwareButtons::BackPressed += ref new EventHandler(this, &OpenGLESPage::OnBackButtonPressed);
+ }
+#else
+#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+ Windows::UI::ViewManagement::StatusBar::GetForCurrentView()->HideAsync();
+ HardwareButtons::BackPressed += ref new EventHandler(this, &OpenGLESPage::OnBackButtonPressed);
+#else
+ // Disable all pointer visual feedback for better performance when touching.
+ // This is not supported on Windows Phone applications.
+ auto pointerVisualizationSettings = Windows::UI::Input::PointerVisualizationSettings::GetForCurrentView();
+ pointerVisualizationSettings->IsContactFeedbackEnabled = false;
+ pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false;
+#endif
+#endif
+
+ // Register our SwapChainPanel to get independent input pointer events
+ auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^)
+ {
+ // The CoreIndependentInputSource will raise pointer events for the specified device types on whichever thread it's created on.
+ m_coreInput = swapChainPanel->CreateCoreIndependentInputSource(
+ Windows::UI::Core::CoreInputDeviceTypes::Mouse |
+ Windows::UI::Core::CoreInputDeviceTypes::Touch |
+ Windows::UI::Core::CoreInputDeviceTypes::Pen
+ );
+
+ // Register for pointer events, which will be raised on the background thread.
+ m_coreInput->PointerPressed += ref new TypedEventHandler